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

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.

Response parameters

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

The ID of the request.

ResourceDirectory Struct

The information 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 master account.

MasterAccountName String aliyun-admin

The name of the master account.

ResourceDirectoryId String rd-St****

The ID of the resource directory.

RootFolderId String r-Zo****

The ID of the root folder.

Examples

Sample requests

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

Sample success responses

XML format

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

JSON format

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

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 master account or a member account of the resource directory.

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