Queries the information of a resource directory. If you use a management account to call this API operation, the system returns the information of the resource directory that is enabled by using the management account. If you use a member to call this operation, the system returns the information of the resource directory to which the member belongs.

This topic provides an example on how to use a management account to call the API operation to query the information of the resource directory that is enabled by using the management account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetResourceDirectory

The operation that you want to perform. Set the value to GetResourceDirectory.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String CD76D376-2517-4924-92C5-DBC52262F93A

The ID of the request.

ResourceDirectory Object

The information of the resource directory.

RootFolderId String r-Zo****

The ID of the Root folder.

ResourceDirectoryId String rd-St****

The ID of the resource directory.

CreateTime String 2019-02-18T15:32:10.473Z

The time when the resource directory was enabled.

MasterAccountId String 172845045600****

The ID of the management account.

MasterAccountName String aliyun-admin

The name of the management account.

ControlPolicyStatus String Enabled

The status of the Control Policy feature. Valid values:

  • Enabled: The feature is enabled.
  • PendingEnable: The feature is being enabled.
  • Disabled: The feature is disabled.
  • PendingDisable: The feature is being disabled.
MemberDeletionStatus String Enabled

The status of the member deletion feature. Valid values:

  • Enabled: The feature is enabled. You can call the DeleteAccount operation to delete members of the resource account type.
  • Disabled: The feature is disabled. You cannot delete members of the resource account type.
IdentityInformation String *** Co., Ltd.

The real-name verification information.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=GetResourceDirectory
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetResourceDirectoryResponse>
    <RequestId>CD76D376-2517-4924-92C5-DBC52262F93A</RequestId>
    <ResourceDirectory>
        <RootFolderId>r-Zo****</RootFolderId>
        <ResourceDirectoryId>rd-St****</ResourceDirectoryId>
        <CreateTime>2019-02-18T15:32:10.473Z</CreateTime>
        <MasterAccountId>172845045600****</MasterAccountId>
        <MasterAccountName>aliyun-admin</MasterAccountName>
        <ControlPolicyStatus>Enabled</ControlPolicyStatus>
        <MemberDeletionStatus>Enabled</MemberDeletionStatus>
        <IdentityInformation>*** Co., Ltd.</IdentityInformation>
    </ResourceDirectory>
</GetResourceDirectoryResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "CD76D376-2517-4924-92C5-DBC52262F93A",
  "ResourceDirectory" : {
    "RootFolderId" : "r-Zo****",
    "ResourceDirectoryId" : "rd-St****",
    "CreateTime" : "2019-02-18T15:32:10.473Z",
    "MasterAccountId" : "172845045600****",
    "MasterAccountName" : "aliyun-admin",
    "ControlPolicyStatus" : "Enabled",
    "MemberDeletionStatus" : "Enabled",
    "IdentityInformation" : "*** Co., Ltd."
  }
}

Error codes

HTTP status code Error code Error message Description
404 ResourceDirectoryNotInUse The specified account is not an Alibaba Cloud account or a member account of the resource directory. The error message returned because the account is not the management account or a member of a resource directory.

For a list of error codes, visit the API Error Center.