Enables a resource directory.
Operation description
You can enable a resource directory by using the current logon account or by creating a new management account. For more information, see Enable a resource directory.
This topic provides an example of how to enable a resource directory by using the current logon account.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcemanager:EnableResourceDirectory |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| MAName |
string |
No |
The name of the new management account. Format: |
user01@rdadmin.aliyunid.com |
| MASecureMobilePhone |
string |
No |
The secure phone number of the new management account. If you leave this parameter empty, the secure phone number of the current logon account is used. The phone number must be the same as the one used to authenticate and obtain the verification code in SendVerificationCodeForEnableRD. Format: Note
Phone numbers from the Chinese mainland in the format |
xx-13900001234 |
| VerificationCode |
string |
No |
The verification code. You can call SendVerificationCodeForEnableRD to obtain the verification code. |
123456 |
| EnableMode |
string |
Yes |
The method used to enable the resource directory. Valid values:
|
CurrentAccount |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| ResourceDirectory |
object |
The resource directory information. |
|
| ResourceDirectoryId |
string |
The ID of the resource directory. |
rd-54**** |
| MasterAccountId |
string |
The ID of the management account. |
507408460615**** |
| MasterAccountName |
string |
The name of the management account. |
alice@example.com |
| RootFolderId |
string |
The ID of the Root folder. |
r-G9**** |
| CreateTime |
string |
The time when the resource directory was enabled. The time is displayed in UTC in RFC 3339 format, indicated by Z. |
2021-12-08T02:15:31.744Z |
| RequestId |
string |
The request ID. |
EC2FE94D-A4A2-51A1-A493-5C273A36C46A |
Examples
Success response
JSON format
{
"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"
}
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. | |
| 409 | Invalid.EnterpriseName | You must specify the enterprise name. | 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. | 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. | 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. | The management account name already exists. You must specify a valid name. |
| 409 | Invalid.VerificationCode | The verification code is invalid. | The verification code is invalid. |
| 409 | InvalidParameter.ManagementAccountName | The management account name is in the wrong format. | The specified management account name is invalid. |
| 409 | InvalidParameter.ManagementAccountSecurityInfo | The parameter management account secure mobile phone is invalid. | The specified mobile number is invalid. |
| 409 | MissingSecureMobilePhone | Secure mobile phone is missing. | No phone number is specified. |
| 409 | MissingSecurityInfo | Security info is missing. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.