Queries the information of a resource directory. If you use an enterprise management account to call this operation, the system returns the information of the resource directory that is enabled by using the enterprise management 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.

In this example, an enterprise management account is used to query the information of the resource directory that is enabled by using the enterprise 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 enterprise management account.

MasterAccountName String aliyun-admin

The name of the enterprise management account.

ControlPolicyStatus String Enabled

The status of the Control Policy feature. Valid values:

  • Enabled: The Control Policy feature is enabled.
  • PendingEnable: The Control Policy feature is being enabled.
  • Disabled: The Control Policy feature is disabled.
  • PendingDisable: The Control Policy feature is being disabled.

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

<?xml version="1.0" encoding="UTF-8" ?>
<GetResourceDirectoryResponse>
    <ResourceDirectory>
        <RootFolderId>r-Zo****</RootFolderId>
        <ControlPolicyStatus>Enabled</ScpStatus>
        <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

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

{
  "ResourceDirectory" : {
    "RootFolderId" : "r-Zo****",
    "ControlPolicyStatus" : "Enabled",
    "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 enterprise management account or a member account of the resource directory.

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