调用CreateResourceAccount创建成员。
在资源目录内,成员作为资源容器,是一种资源分组单位。成员通常用于指代一个项目或应用,每个成员中的资源相对其他成员中的资源是物理隔离的。
本文将提供一个示例,在资源夹fd-r23M55****
下创建一个成员,其成员名称为Dev
,账号名称前缀为alice
。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateResourceAccount |
要执行的操作。取值:CreateResourceAccount。 |
DisplayName | String | 是 | Dev |
成员名称。 长度范围:2~50个字符或汉字。 格式:允许输入汉字、英文字母、数字、下划线(_)、英文句点(.)和短划线(-)。 成员名称在资源目录内必须唯一。 |
ParentFolderId | String | 否 | fd-r23M55**** |
父资源夹ID。 |
PayerAccountId | String | 否 | 12323344**** |
结算账号ID。置空则采用当前账号结算。 |
AccountNamePrefix | String | 否 | alice |
账号名称前缀。置空则系统随机生成。 长度范围:2~50个字符。 格式:允许输入英文字母、数字和特殊字符 完整账号名称的格式为<AccountNamePrefix>@<ResourceDirectoryId>.aliyunid.com,例如: 账号名称在资源目录内必须唯一。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Account | Struct |
成员信息。 |
|
AccountId | String | 112730938585**** |
账号ID。 |
AccountName | String | alice@rd-3g****.aliyunid.com |
账号名称。 |
DisplayName | String | Dev |
成员名称。 |
FolderId | String | fd-r23M55**** |
资源夹ID。 |
JoinMethod | String | created |
成员加入方式。
|
JoinTime | String | 2020-12-31T03:37:39.456Z |
成员加入时间。 |
ModifyTime | String | 2020-12-31T03:37:39.456Z |
成员修改时间。 |
ResourceDirectoryId | String | rd-3G**** |
资源目录ID。 |
Status | String | CreateSuccess |
成员加入状态。
|
Type | String | ResourceAccount |
成员类型。取值为ResourceAccount表示资源账号。 |
RequestId | String | B356A415-D860-43E5-865A-E2193D62BBD6 |
请求ID。 |
示例
请求示例
https://resourcemanager.aliyuncs.com/?Action=CreateResourceAccount
&DisplayName=Dev
&ParentFolderId=fd-r23M55****
&AccountNamePrefix=alice
&<公共请求参数>
正常返回示例
XML
格式
<CreateResourceAccountResponse>
<Account>
<Status>CreateSuccess</Status>
<ModifyTime>2020-12-31T03:37:39.456Z</ModifyTime>
<JoinMethod>created</JoinMethod>
<ResourceDirectoryId>rd-3G****</ResourceDirectoryId>
<Type>ResourceAccount</Type>
<AccountId>112730938585****</AccountId>
<DisplayName>Dev</DisplayName>
<JoinTime>2020-12-31T03:37:39.456Z</JoinTime>
<FolderId>fd-r23M55****</FolderId>
<AccountName>alice@rd-3g****.aliyunid.com</AccountName>
</Account>
<RequestId>B356A415-D860-43E5-865A-E2193D62BBD6</RequestId>
</CreateResourceAccountResponse>
JSON
格式
{
"Account": {
"Status": "CreateSuccess",
"ModifyTime": "2020-12-31T03:37:39.456Z",
"JoinMethod": "created",
"ResourceDirectoryId": "rd-3G****",
"Type": "ResourceAccount",
"AccountId": "112730938585****",
"DisplayName": "Dev",
"JoinTime": "2020-12-31T03:37:39.456Z",
"FolderId": "fd-r23M55****",
"AccountName": "alice@rd-3g****.aliyunid.com"
},
"RequestId": "B356A415-D860-43E5-865A-E2193D62BBD6"
}
错误码
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 | InvalidParameter.Account.AccountNamePrefix | The account name prefix is invalid. | 账号名称前缀无效,请按格式输入。 |
400 | InvalidParameter.Account.AccountNamePrefix.Length | The account name prefix exceeds the length limit. The limit is 2 to 50 characters. | 账号名称前缀长度超出限制,长度为2~50个字符。 |
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 | 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 | 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. | 结算账号不在当前资源目录内,请更换结算账号。 |
409 | CreateAccountDisabled | The specified resource directory cannot create a new account. | 禁止创建账号。 |
409 | PaymentAccountEnterpriseVerifyError | The type of the payment account is not enterprise verified. | 付款账号不是企业实名类型。 |
409 | PaymentAccountFinancialRelationshipVerifyError | The payment account must not be the beneficiary account from other financial relationships. | 付款账号不能是其他财务关系的受益账号。 |
409 | PaymentAccountEnterpriseTypeError | The type of the payment account is not enterprise. | 付款账号不是企业类型。 |
409 | PaymentAccountFinancialRelationshipsChangeFrequencyVerifyError | The financial relationship of payment account changes too frequently. Please try again later. | 付款账号的财务关系变更太频繁。请稍后重试。 |
409 | MemberAccountVirtualCloudOperatorVerifyError | The type of the member account must not be virtual operator. | 成员账号不能是虚拟运营商类型。 |
409 | MemberAccountResellerVerifyError | The type of the member account must not be reseller. | 成员账号不能是分销商类型。 |
409 | PaymentAccountVirtualCloudOperatorVerifyError | The type of the payment account must not be virtual operator. | 付款账号不能是虚拟运营商类型。 |
409 | PaymentAccountResellerVerifyError | The type of the payment account must not be reseller. | 付款账号不能是分销商类型。 |
409 | PaymentAccountCreditIdentityTypeError | The identity of the payment account is not credit. | 付款账号不是信用付款身份。 |
409 | InconsistentEnterpriseNameError | The enterprise name of the payment account and the member account must be consistent. | 付款账号与成员账号企业名称不一致。 |
409 | PaymentAccountEnterpriseInvoiceError | No enterprise invoice header information is set for the payment account. | 付款账号的企业发票抬头信息未设置。 |
409 | UnknownFinancialError | An unknown financial error occurred. | 未知的财资错误。 |
访问错误中心查看更多错误码。