调用GetResourceDirectory获取资源目录信息。主账号调用时,返回主账号开通的资源目录详情。成员账号调用时,返回成员账号所属资源目录详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetResourceDirectory |
要执行的操作。取值:GetResourceDirectory。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CD76D376-2517-4924-92C5-DBC52262F93A |
请求ID。 |
ResourceDirectory | Struct |
资源目录信息。 |
|
CreateTime | String | 2019-02-18T15:32:10.473Z |
资源目录开通时间。 |
MasterAccountId | String | 172845045600**** |
主账号ID。 |
MasterAccountName | String | aliyun-admin |
主账号名称。 |
ResourceDirectoryId | String | rd-St**** |
资源目录ID。 |
RootFolderId | String | r-Zo**** |
Root资源夹ID。 |
示例
请求示例
https://resourcemanager.aliyuncs.com/?Action=GetResourceDirectory
&<公共请求参数>
正常返回示例
XML
格式
<GetResourceDirectoryResponse>
<ResourceDirectory>
<RootFolderId>r-Zo****</RootFolderId>
<ResourceDirectoryId>rd-St****</ResourceDirectoryId>
<MasterAccountId>172845045600****</MasterAccountId>
<MasterAccountName>aliyun-admin</MasterAccountName>
<CreateTime>2019-02-18T15:32:10.473Z</CreateTime>
</ResourceDirectory>
<RequestId>CD76D376-2517-4924-92C5-DBC52262F93A</RequestId>
</GetResourceDirectoryResponse>
JSON
格式
{
"ResourceDirectory": {
"RootFolderId": "r-Zo****",
"ResourceDirectoryId": "rd-St****",
"MasterAccountId": "172845045600****",
"MasterAccountName": "aliyun-admin",
"CreateTime": "2019-02-18T15:32:10.473Z"
},
"RequestId": "CD76D376-2517-4924-92C5-DBC52262F93A"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | ResourceDirectoryNotInUse | The specified account is not an Alibaba Cloud account or a member account of the resource directory. | 当前账号不是主账号或不是资源目录的成员。 |
访问错误中心查看更多错误码。