调用CreateCloudAccount创建云账号类型的成员。
资源目录中有资源账号和云账号两种不同类型的成员。
- 资源账号(推荐):资源账号类型的成员只作为资源的容器并完全依赖于资源目录存在,是一种更为安全、创建更为简单的账号。创建资源账号类型的成员,请参见CreateResourceAccount。
说明 资源账号也可以升级为云账号,请参见PromoteResourceAccount。
- 云账号:云账号具备阿里云账号的全部特征,包括允许Root登录访问。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateCloudAccount |
要执行的操作。取值:CreateCloudAccount。 |
DisplayName | String | 是 | admin-**** |
成员名称。 长度为2~50个字符或汉字,可包含汉字、英文字母、数字、下划线(_)、英文句点(.)和短划线(-)。 成员名称在资源目录内必须唯一。 |
String | 是 | someone@example.com |
云账号登录邮箱。 |
|
ParentFolderId | String | 是 | fd-bVaRIG**** |
父资源夹ID。 |
PayerAccountId | String | 否 | 12323344**** |
结算账号ID。取值为空表示采用当前账号结算。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Account | Struct |
成员信息。 |
|
AccountId | String | 12323344**** |
账号ID。 |
AccountName | String | someone@example.com |
账号名称。 |
DisplayName | String | admin-**** |
成员名称。 |
FolderId | String | fd-bVaRIG**** |
资源夹ID。 |
JoinMethod | String | created |
成员加入方式。
|
ModifyTime | String | 2015-01-23T12:33:18Z |
成员修改时间。 |
RecordId | String | 06950264-3f0d-4ca9-82dd-6ee7a3d3**** |
账号记录ID。 |
ResourceDirectoryId | String | rd-k3**** |
资源目录ID。 |
Status | String | CreateVerifying |
成员加入状态。
|
Type | String | CloudAccount |
成员类型。取值为CloudAccount表示云账号。 |
RequestId | String | 9B34724D-54B0-4A51-B34D-4512372FE1BE |
请求ID。 |
示例
请求示例
https://resourcemanager.aliyuncs.com/?Action=CreateCloudAccount
&DisplayName=admin-****
&Email=someone@example.com
&ParentFolderId=fd-bVaRIG****
&<公共请求参数>
正常返回示例
XML
格式
<CreateCloudAccountResponse>
<RequestId>9B34724D-54B0-4A51-B34D-4512372FE1BE</RequestId>
<Account>
<ResourceDirectoryId>rd-k3****</ResourceDirectoryId>
<AccountId>12323344****</AccountId>
<AccountName>someone@example.com</AccountName>
<DisplayName>admin-****</DisplayName>
<FolderId>fd-bVaRIG****</FolderId>
<JoinMethod>created</JoinMethod>
<Type>CloudAccount</Type>
<Status>CreateVerifying</Status>
<RecordId>06950264-3f0d-4ca9-82dd-6ee7a3d3****</RecordId>
<ModifyTime>2015-01-23T12:33:18Z</ModifyTime>
</Account>
</CreateCloudAccountResponse>
JSON
格式
{
"RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE",
"Account": {
"ResourceDirectoryId":"rd-k3****",
"AccountId": "12323344****",
"AccountName": "someone@example.com",
"DisplayName": "admin-****",
"FolderId": "fd-bVaRIG****",
"JoinMethod": "created",
"Type":"CloudAccount",
"Status":"CreateVerifying",
"RecordId":"06950264-3f0d-4ca9-82dd-6ee7a3d3****",
"ModifyTime":"2015-01-23T12:33:18Z"
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | MissingParameter.Account.DisplayName | You must specify DisplayName. | 成员名称缺失,请指定成员名称。 |
400 | InvalidParameter.Account.DisplayName | The DisplayName of account is invalid. | 成员名称无效,请输入字符或汉字,可包含汉字、英文字母、数字、下划线(_)、英文句点(.)和短划线(-)。 |
400 | InvalidParameter.Account.DisplayName.Length | The DisplayName of the account exceeds the length limit. | 成员名称长度超出限制,长度为2~50个字符或汉字。 |
400 | InvalidParameter.ParentFolderId | The ParentFolderId is invalid. | 父资源夹ID无效,资源夹ID应以“r-”开头+6位数字或英文字母或以“fd-”开头+10位数字或英文字母。 |
400 | MissingParameter.Email | You must specify Email. | 邮箱缺失,请指定邮箱。 |
400 | InvalidParameter.Email | The Email is invalid. | 邮箱格式错误。 |
409 | LimitExceeded.Account | The maximum number of member accounts in a resource directory exceeds the limit. | 资源目录中的成员数量超出限制。 |
409 | InvalidParameter.Account.DisplayName.AlreadyUsed | The displayname of account has been used. | 成员名称已被占用,请更换其他名称。 |
409 | EntityAlreadyExists.ResourceDirectory.Account | The email address that the system generates when you create a member account already exists. Try again later. | 创建成员时系统生成的邮箱已被占用,请重试。 |
409 | InvalidParameter.Email.AlreadyUsed | The email has been used. | 邮箱已被占用,请更换其他邮箱。 |
404 | EntityNotExists.ResourceDirectory | The resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account. | 当前账号未启用资源目录,请先启用资源目录。 |
404 | EntityNotExists.Folder | The resource directory folder does not exist. | 资源夹不存在,请先创建资源夹。 |
409 | Invalid.PayRelation | Failed to create a member. The specified billing account is unavailable. Please change to another billing account and try again. | 成员创建失败。您选择的结算账号不可用,请更换后重新尝试。 |
409 | NotSupport.PayerAccountInAnotherResourceDirectory | The specified settlement account does not exist in the resource directory. You must specify a valid settlement account. | 结算账号不在当前资源目录内,请更换结算账号。 |
访问错误中心查看更多错误码。