调用EnableResourceDirectory开通资源目录。
接口说明
您可以使用当前登录账号或新创建管理账号两种方式开通资源目录。更多信息,请参见开通资源目录。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
resourcemanager:EnableResourceDirectory |
create |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| MAName |
string |
否 |
新管理账号名称。 格式: |
user01@rdadmin.aliyunid.com |
| MASecureMobilePhone |
string |
否 |
新创建管理账号的安全手机号码。 置空表示采用当前登录账号的安全手机号码。该手机号码必须与 SendVerificationCodeForEnableRD 中获取验证码时使用的手机号码一致。 格式: 说明
仅支持填写 |
xx-13900001234 |
| VerificationCode |
string |
否 |
验证码。 您可以调用 SendVerificationCodeForEnableRD 获取验证码。 |
123456 |
| EnableMode |
string |
是 |
开通方式。取值:
|
CurrentAccount |
| DryRun |
boolean |
否 |
是否只预检此次请求。取值:
|
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| ResourceDirectory |
object |
资源目录信息。 |
|
| ResourceDirectoryId |
string |
资源目录 ID。 |
rd-54**** |
| MasterAccountId |
string |
管理账号 ID。 |
507408460615**** |
| MasterAccountName |
string |
管理账号名称。 |
alice@example.com |
| RootFolderId |
string |
Root 资源夹 ID。 |
r-G9**** |
| CreateTime |
string |
资源目录开通时间。 |
2021-12-08T02:15:31.744Z |
| RequestId |
string |
请求 ID。 |
EC2FE94D-A4A2-51A1-A493-5C273A36C46A |
示例
正常返回示例
JSON格式
{
"ResourceDirectory": {
"ResourceDirectoryId": "rd-54****",
"MasterAccountId": "507408460615****",
"MasterAccountName": "alice@example.com",
"RootFolderId": "r-G9****",
"CreateTime": "2021-12-08T02:15:31.744Z"
},
"RequestId": "EC2FE94D-A4A2-51A1-A493-5C273A36C46A"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 409 | NotSupport.AccountInAnotherResourceDirectory | The specified account is an Alibaba Cloud account or already exists in another resource directory. | 您的账号是另一个资源目录的管理账号或是另一个资源目录内的成员。 |
| 409 | Invalid.EnterpriseName | You must specify the enterprise name. | 账号未设置企业名称,请您先完成企业名称设置。 |
| 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 | EntityAlreadyExists.ResourceDirectory | The resource directory for the account is already enabled. We recommend that you do not enable the resource directory again. | 账号已开通资源目录,请勿重复开通。 |
| 409 | InvalidParameter.ManagementAccountName.AlreadyUsed | The ManagementAccountName has been used. | 管理账号名称已被占用,请更换其他名称。 |
| 409 | Invalid.VerificationCode | The verification code is invalid. | 验证码无效。 |
| 409 | InvalidParameter.ManagementAccountName | The management account name is in the wrong format. | 管理账号名称格式错误。 |
| 409 | InvalidParameter.ManagementAccountSecurityInfo | The parameter management account secure mobile phone is invalid. | 安全手机号码格式不正确。 |
| 409 | MissingSecureMobilePhone | Secure mobile phone is missing. | 缺少安全手机号码。 |
| 409 | MissingSecurityInfo | Security info is missing. | 缺少安全信息。 |
| 409 | NotSupport.Account.Site | The caller is not a China site account, which is not supported. | 当前账号所属站点错误,请更换为中国站账号。 |
| 409 | Invalid.AccountType | The specified profile type of account is invalid. | 账号类型无效,请您使用企业类型账号。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。