Enables a resource directory. After you enable a resource directory, the system automatically creates a root folder and sets the current account as the enterprise management account of the resource directory. The enterprise management account has all administrative permissions on this resource directory.

Note
  • An account can be used to enable a resource directory only after it passes enterprise real-name verification. An account that only passed individual real-name verification cannot be used to enable a resource directory.
  • We recommend that you only use the enterprise management account as the administrator of the resource directory. Do not use the enterprise management account to purchase cloud resources.

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 InitResourceDirectory

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

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 172841235500****

The ID of the enterprise management account.

MasterAccountName String aliyun-****

The name of the enterprise management account.

ResourceDirectoryId String rd-Ss****

The ID of the resource directory.

RootFolderId String r-Zo****

The ID of the root folder.

Examples

Sample requests

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

Sample success responses

XML format

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

JSON format

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

Error codes

HTTP status code Error code Error message Description
409 NotSupport.AccountInAnotherResourceDirectory The specified account is an Alibaba Cloud account or already exists in another resource directory. The error message returned because the account is an enterprise management account or has joined another resource directory.
409 EnterpriseRealNameVerificationError The specified account does not pass enterprise real-name verification. We recommend you first complete enterprise real-name verification for the account. The error message returned because the account does not pass enterprise real-name verification. Complete enterprise real-name verification first.
409 Invalid.AccountType The specified profile type of account is invalid. The error message returned because the account type is invalid. Use an enterprise account.
409 Invalid.EnterpriseName You must specify the enterprise name. The error message returned because the enterprise name of the account is not specified. Specify an enterprise name.
409 NotSupport.Account.Site The caller is not a China site account, which is not supported. The error message returned because the account is not registered at the China site (aliyun.com). Use an account registered at the China site (aliyun.com).
409 EntityAlreadyExists.ResourceDirectory The resource directory for the account is already enabled. We recommend that you do not enable the resource directory again. The error message returned because the resource directory for the account has been enabled. Do not enable the resource directory again.

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