調(diào)用InitResourceDirectory開通資源目錄。開通資源目錄后,系統(tǒng)會為您創(chuàng)建一個Root資源夾,并將當(dāng)前賬號設(shè)置為企業(yè)管理賬號。該企業(yè)管理賬號具有管理資源目錄的所有權(quán)限。
說明
- 請使用經(jīng)過企業(yè)實名認證的賬號開通資源目錄。個人實名認證賬號不能開通資源目錄。
- 建議您將企業(yè)管理賬號僅作為資源目錄的管理員,不建議您在企業(yè)管理賬號下訂購云產(chǎn)品資源。
調(diào)試
您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。
請求參數(shù)
名稱 | 類型 | 是否必選 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | InitResourceDirectory |
要執(zhí)行的操作。取值:InitResourceDirectory。 |
返回數(shù)據(jù)
名稱 | 類型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CD76D376-2517-4924-92C5-DBC52262F93A |
請求ID。 |
ResourceDirectory | Struct |
資源目錄信息。 |
|
CreateTime | String | 2019-02-18T15:32:10.473Z |
資源目錄開通時間。 |
MasterAccountId | String | 172841235500**** |
企業(yè)管理賬號ID。 |
MasterAccountName | String | aliyun-**** |
企業(yè)管理賬號名稱。 |
ResourceDirectoryId | String | rd-Ss**** |
資源目錄ID。 |
RootFolderId | String | r-Zo**** |
Root資源夾ID。 |
示例
請求示例
https://resourcemanager.aliyuncs.com/?Action=InitResourceDirectory
&<公共請求參數(shù)>
正常返回示例
XML
格式
<InitResourceDirectoryResponse>
<ResourceDirectory>
<RootFolderId>r-Zo****</RootFolderId>
<ResourceDirectoryId>rd-Ss****</ResourceDirectoryId>
<MasterAccountId>172841235500****</MasterAccountId>
<MasterAccountName>aliyun-****</MasterAccountName>
<CreateTime>2019-02-18T15:32:10.473Z</CreateTime>
</ResourceDirectory>
<RequestId>CD76D376-2517-4924-92C5-DBC52262F93A</RequestId>
</InitResourceDirectoryResponse>
JSON
格式
{
"ResourceDirectory": {
"RootFolderId": "r-Zo****",
"ResourceDirectoryId": "rd-Ss****",
"MasterAccountId": "172841235500****",
"MasterAccountName": "aliyun-****",
"CreateTime": "2019-02-18T15:32:10.473Z"
},
"RequestId": "CD76D376-2517-4924-92C5-DBC52262F93A"
}
錯誤碼
HttpCode | 錯誤碼 | 錯誤信息 | 描述 |
---|---|---|---|
409 | NotSupport.AccountInAnotherResourceDirectory | The specified account is an Alibaba Cloud account or already exists in another resource directory. | 當(dāng)前賬號是主賬號或已經(jīng)在另一個資源目錄內(nèi)。 |
409 | EnterpriseRealNameVerificationError | The specified account does not pass enterprise real-name verification. We recommend you first complete enterprise real-name verification for the account. | 當(dāng)前賬號未經(jīng)過企業(yè)實名認證。請您先完成企業(yè)實名認證。 |
409 | Invalid.AccountType | The specified profile type of account is invalid. | 賬號類型無效,請您使用企業(yè)類型賬號。 |
409 | Invalid.EnterpriseName | You must specify the enterprise name. | 賬號未設(shè)置企業(yè)名稱,請您先完成企業(yè)名稱設(shè)置。 |
409 | NotSupport.Account.Site | The caller is not a China site account, which is not supported. | 當(dāng)前賬號所屬站點錯誤,請更換為中國站賬號。 |
409 | EntityAlreadyExists.ResourceDirectory | The resource directory for the account is already enabled. We recommend that you do not enable the resource directory again. | 賬號已開通資源目錄,請勿重復(fù)開通。 |
訪問錯誤中心查看更多錯誤碼。