全部产品
Search
文档中心

资源管理:CreateResourceAccount - 创建成员

更新时间:Mar 19, 2024

调用CreateResourceAccount创建资源账号类型的成员。

接口说明

在资源目录内,成员作为资源容器,是一种资源分组单位。成员通常用于指代一个项目或应用,每个成员中的资源相对其他成员中的资源是物理隔离的。

本文将提供一个示例,在资源夹fd-r23M55****下创建一个成员,其成员显示名称为Dev,账号名称前缀为alice

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
DisplayNamestring

成员显示名称。

长度范围:2~50 个字符或汉字。

格式:允许输入汉字、英文字母、数字、下划线(_)、半角句号(.)、短划线(-)和空格。

成员显示名称在资源目录内必须唯一。

Dev
ParentFolderIdstring

父资源夹 ID。

fd-r23M55****
PayerAccountIdstring

结算账号 ID。置空则采用当前账号结算。

12323344****
AccountNamePrefixstring

账号名称前缀。置空则系统随机生成。

长度范围:2~37 个字符。

格式:允许输入英文字母、数字和特殊字符_.-,必须以英文字母或数字开头和结尾,且不能输入连续的特殊字符_.-

完整账号名称的格式为@.aliyunid.com,例如:alice@rd-3G****.aliyunid.com

账号名称在资源目录内必须唯一。

alice
Tagobject []

成员的标签。

Keystring

标签键。

k1
Valuestring

标签值。

v1
ResellAccountTypestring

成员的身份类型。取值:

  • resell(默认值):分销账号。创建的成员将自动与您的分销商建立分销关系,同时您需要使用管理账号为新成员付款。
  • non_resell :非分销账号。创建的成员为阿里云普通账号,与您当前的分销商无关联关系,该账号直接从阿里云购买资源,需自主付款。
说明 该参数仅支持国际站分销客户。
resell
DryRunboolean

是否只预检此次请求。取值:

  • true:发送检查请求,不会实际创建成员。检查项当前包括当前账号是否允许设置成员的身份类型。如果检查不通过,则返回对应错误码。
  • false(默认):发送正常请求,通过检查后直接创建成员。
false

关于公共请求参数的详情,请参见公共参数

返回参数

名称类型描述示例值
object

返回参数。

Accountobject

成员信息。

Statusstring

成员加入状态。取值为 CreateSuccess,表示创建成功。

CreateSuccess
Typestring

成员类型。取值为 ResourceAccount,表示资源账号。

ResourceAccount
DisplayNamestring

成员显示名称。

Dev
FolderIdstring

资源夹 ID。

fd-r23M55****
ResourceDirectoryIdstring

资源目录 ID。

rd-3G****
JoinTimestring

成员加入时间(UTC 时间)。

2020-12-31T03:37:39.456Z
AccountIdstring

成员 ID。

112730938585****
JoinMethodstring

成员加入方式。取值:

  • invited:邀请。
  • created:创建。
created
ModifyTimestring

成员修改时间(UTC 时间)。

2020-12-31T03:37:39.456Z
AccountNamestring

账号名称。

alice@rd-3g****.aliyunid.com
RequestIdstring

请求 ID。

B356A415-D860-43E5-865A-E2193D62BBD6

示例

正常返回示例

JSON格式

{
  "Account": {
    "Status": "CreateSuccess",
    "Type": "ResourceAccount",
    "DisplayName": "Dev",
    "FolderId": "fd-r23M55****",
    "ResourceDirectoryId": "rd-3G****",
    "JoinTime": "2020-12-31T03:37:39.456Z",
    "AccountId": "112730938585****",
    "JoinMethod": "created",
    "ModifyTime": "2020-12-31T03:37:39.456Z",
    "AccountName": "alice@rd-3g****.aliyunid.com"
  },
  "RequestId": "B356A415-D860-43E5-865A-E2193D62BBD6"
}

错误码

HTTP status code错误码错误信息描述
400MissingParameter.Account.DisplayNameYou must specify DisplayName.显示名缺失,请指定显示名。
400InvalidParameter.Account.DisplayNameThe DisplayName of account is invalid.显示名无效,请输入字符或汉字,可包含汉字、英文字母、数字、下划线(_)、半角句号(.)和短划线(-)。
400InvalidParameter.Account.DisplayName.LengthThe DisplayName of the account exceeds the length limit.显示名长度超出限制,长度为2~50个字符或汉字。
400InvalidParameter.ParentFolderIdThe ParentFolderId is invalid.父资源夹ID无效,资源夹ID应以“r-”开头+6位数字或英文字母或以“fd-”开头+10位数字或英文字母。
400InvalidParameter.Account.AccountNamePrefixThe account name prefix is invalid.-
400InvalidParameter.Account.AccountNamePrefix.LengthThe account name prefix exceeds the length limit.-
400NotSupport.Site.ActionSite does not allow current action.该操作不支持当前站点。
404EntityNotExists.ResourceDirectoryThe resource directory for the account is not enabled. We recommend that you first enable the resource directory for the account.当前账号未启用资源目录,请先启用资源目录。
404EntityNotExists.FolderThe resource directory folder does not exist.资源夹不存在,请先创建资源夹。
409LimitExceeded.AccountThe maximum number of member accounts in a resource directory exceeds the limit.资源目录中的成员数量超出限制。
409InvalidParameter.Account.DisplayName.AlreadyUsedThe displayname of account has been used.显示名已被占用,请更换其他名称。
409EntityAlreadyExists.ResourceDirectory.AccountThe email address that the system generates when you create a member account already exists. Try again later.创建成员时系统生成的邮箱已被占用,请重试。
409Invalid.PayRelationFailed to create a member. The specified billing account is unavailable. Please change to another billing account and try again.成员创建失败。您选择的结算账号不可用,请更换后重新尝试。
409NotSupport.PayerAccountInAnotherResourceDirectoryThe specified settlement account does not exist in the resource directory. You must specify a valid settlement account.-
409CreateAccountDisabledThe specified resource directory cannot create a new account.禁止创建账号。
409PaymentAccountEnterpriseVerifyErrorThe type of the payment account is not enterprise verified.结算账号不是企业实名类型。
409PaymentAccountFinancialRelationshipVerifyErrorThe payment account must not be the beneficiary account from other financial relationships.结算账号不能是其他财务关系的财务子账号。
409PaymentAccountEnterpriseTypeErrorThe type of the payment account is not enterprise.结算账号不是企业类型。
409PaymentAccountFinancialRelationshipsChangeFrequencyVerifyErrorThe financial relationship of payment account changes too frequently. Please try again later.结算账号的财务关系变更太频繁。请稍后重试。
409MemberAccountVirtualCloudOperatorVerifyErrorThe type of the member account must not be virtual operator.-
409MemberAccountResellerVerifyErrorThe type of the member account must not be reseller.-
409PaymentAccountVirtualCloudOperatorVerifyErrorThe type of the payment account must not be virtual operator.结算账号不能是虚拟运营商类型。
409PaymentAccountResellerVerifyErrorThe type of the payment account must not be reseller.结算账号不能是分销商类型。
409PaymentAccountCreditIdentityTypeErrorThe identity of the payment account is not credit.-
409InconsistentEnterpriseNameErrorThe enterprise name of the payment account and the member account must be consistent.-
409PaymentAccountEnterpriseInvoiceErrorNo enterprise invoice header information is set for the payment account.结算账号的企业发票抬头信息未设置。
409UnknownFinancialErrorAn unknown financial error occurred.未知的财资错误。
409BusinessRestrictedBusiness is restricted. Please contact your customer service manager.业务受限,请联系您的客户经理处理。
409FundAccountHasArrearsAmountThere are arrears in the current payment account. You cannot change the payment account. Please settle the arrears and try again.当前付款账户存在欠费,您不可变更付款账户,请结清欠费后重试。
409FundAccountOwnerPayedByOthersIf the payment has been made by another account, it is not allowed to be used as the main payment account.已经由其他账号代付的,不允许再作为代付主账号。
409UserOwnFundAccountPayForOthersIf the account has been used as the main payment account, it is not allowed to set up payment by others.已经作为代付主账号的,不允许再设置由他人代付。
409EcoRelationCheckFailedAccounts associated with partners are not allowed to set up agency payment relationships.生态伙伴关联的账号,不允许设置代付关系。
409NotSupport.SettingResellAccountTypeThe current account does not support setting the resellAccountType for members.当前账号不支持设置成员的身份类型。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2024-03-14OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 409 变更
    删除错误码:400
    删除错误码:404
入参OpenAPI 入参发生变更
    新增入参:DryRun
2024-01-05OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 409 变更
    删除错误码:400
    删除错误码:404
2023-04-27OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:404
    删除错误码:409