調用CreateResourceAccount創建資源賬號類型的成員。

使用說明

在資源目錄內,成員作為資源容器,是一種資源分組單位。成員通常用于指代一個項目或應用,每個成員中的資源相對其他成員中的資源是物理隔離的。

本文將提供一個示例,在資源夾fd-r23M55****下創建一個成員,其成員顯示名稱為Dev,賬號名稱前綴為alice

調試

您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。

請求參數

名稱 類型 是否必選 示例值 描述
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,例如:alice@rd-3G****.aliyunid.com

賬號名稱在資源目錄內必須唯一。

Tag.N.Key String k1

標簽鍵。

Tag.N.Value String v1

標簽值。

ResellAccountType String resell

成員的身份類型。取值:

  • resell(默認值):分銷賬號。創建的成員將自動與您的分銷商建立分銷關系,同時您需要使用管理賬號為新成員付款。
  • non_resell :非分銷賬號。創建的成員為阿里云普通賬號,與您當前的分銷商無關聯關系,該賬號直接從阿里云購買資源,需自主付款。
說明 該參數僅支持國際站分銷客戶。

關于公共請求參數的詳情,請參見公共參數

返回數據

名稱 類型 示例值 描述
Account Object

成員信息。

Status String CreateSuccess

成員加入狀態。取值為CreateSuccess,表示創建成功。

Type String ResourceAccount

成員類型。取值為ResourceAccount,表示資源賬號。

DisplayName String Dev

成員顯示名稱。

FolderId String fd-r23M55****

資源夾ID。

ResourceDirectoryId String rd-3G****

資源目錄ID。

JoinTime String 2020-12-31T03:37:39.456Z

成員加入時間(UTC時間)。

AccountId String 112730938585****

成員ID。

JoinMethod String created

成員加入方式。取值:

  • invited:邀請。
  • created:創建。
ModifyTime String 2020-12-31T03:37:39.456Z

成員修改時間(UTC時間)。

AccountName String alice@rd-3g****.aliyunid.com

賬號名稱。

RequestId String B356A415-D860-43E5-865A-E2193D62BBD6

請求ID。

示例

請求示例

http(s)://[Endpoint]/?Action=CreateResourceAccount
&DisplayName=Dev
&ParentFolderId=fd-r23M55****
&PayerAccountId=12323344****
&AccountNamePrefix=alice
&Tag=[{"Key":"k1","Value":"v1"}]
&<公共請求參數>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON格式

HTTP/1.1 200 OK
Content-Type:application/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"
}

錯誤碼

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. 賬號名稱前綴長度超出限制。
400 NotSupport.Site.Action Site does not allow current action. 該操作不支持當前站點。
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 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 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 PaymentAccountEnterpriseInvoiceError No enterprise invoice header information is set for the payment account. 結算賬號的企業發票抬頭信息未設置。
409 UnknownFinancialError An unknown financial error occurred. 未知的財資錯誤。
409 BusinessRestricted Business is restricted. Please contact your customer service manager. 業務受限,請聯系您的客戶經理處理。
409 PaymentAccountCreditIdentityTypeError Non-credit identity type or insufficient credit limit, cannot be used as payment account. 非信用身份類型或信用額度不足,不能作為付款賬號。

訪問錯誤中心查看更多錯誤碼。