调用InitResourceDirectory开通资源目录。开通资源目录后,系统会为您创建一个Root资源夹,并将当前账号设置为企业管理账号。该企业管理账号具有管理资源目录的所有权限。
说明
- 请使用经过企业实名认证的账号开通资源目录。个人实名认证账号不能开通资源目录。
- 建议您将企业管理账号仅作为资源目录的管理员,不建议您在企业管理账号下订购云产品资源。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | InitResourceDirectory |
要执行的操作。取值:InitResourceDirectory。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CD76D376-2517-4924-92C5-DBC52262F93A |
请求ID。 |
ResourceDirectory | Struct |
资源目录信息。 |
|
CreateTime | String | 2019-02-18T15:32:10.473Z |
资源目录开通时间。 |
MasterAccountId | String | 172841235500**** |
企业管理账号ID。 |
MasterAccountName | String | aliyun-**** |
企业管理账号名称。 |
ResourceDirectoryId | String | rd-Ss**** |
资源目录ID。 |
RootFolderId | String | r-Zo**** |
Root资源夹ID。 |
示例
请求示例
https://resourcemanager.aliyuncs.com/?Action=InitResourceDirectory
&<公共请求参数>
正常返回示例
XML
格式
<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
格式
{
"ResourceDirectory": {
"RootFolderId": "r-Zo****",
"ResourceDirectoryId": "rd-Ss****",
"MasterAccountId": "172841235500****",
"MasterAccountName": "aliyun-****",
"CreateTime": "2019-02-18T15:32:10.473Z"
},
"RequestId": "CD76D376-2517-4924-92C5-DBC52262F93A"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
409 | NotSupport.AccountInAnotherResourceDirectory | The specified account is an Alibaba Cloud account or already exists in 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. | 当前账号未经过企业实名认证。请您先完成企业实名认证。 |
409 | Invalid.AccountType | The specified profile type of account is invalid. | 账号类型无效,请您使用企业类型账号。 |
409 | Invalid.EnterpriseName | You must specify the enterprise name. | 账号未设置企业名称,请您先完成企业名称设置。 |
409 | NotSupport.Account.Site | The caller is not a China site account, which is not supported. | 当前账号所属站点错误,请更换为中国站账号。 |
409 | EntityAlreadyExists.ResourceDirectory | The resource directory for the account is already enabled. We recommend that you do not enable the resource directory again. | 账号已开通资源目录,请勿重复开通。 |
访问错误中心查看更多错误码。