调用GetFolder获取资源夹信息。

本文将提供一个示例,查询资源夹fd-Jyl5U7****信息。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String GetFolder

要执行的操作。取值:GetFolder

FolderId String fd-Jyl5U7****

资源夹ID。

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

返回数据

名称 类型 示例值 描述
RequestId String C2CBCA30-C8DD-423E-B4AD-4FB694C9180C

请求ID。

Folder Object

资源夹信息。

FolderId String fd-Jyl5U7****

资源夹ID。

CreateTime String 2021-06-15T06:39:08.521Z

资源夹创建时间。

ParentFolderId String r-Wm****

父资源夹ID。

FolderName String Applications

资源夹名称。

ResourceDirectoryPath String rd-3G****/r-Wm****/fd-Jyl5U7****

资源夹在资源目录中的路径ID(RDPath)。

示例

请求示例

https://resourcemanager.aliyuncs.com/?Action=GetFolder
&FolderId=fd-Jyl5U7****
&<公共请求参数>

正常返回示例

XML格式

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

<?xml version="1.0" encoding="UTF-8" ?>
<GetFolderResponse>
	<RequestId>88EF473E-D5CD-589F-AAB3-F6E0D12AECA3</RequestId>
	<Folder>
		<CreateTime>2021-06-15T06:39:08.521Z</CreateTime>
		<FolderId>fd-Jyl5U7****</FolderId>
		<FolderName>Applications</FolderName>
		<ParentFolderId>r-Wm****</ParentFolderId>
		<ResourceDirectoryPath>rd-3G****/r-Wm****/fd-Jyl5U7****</ResourceDirectoryPath>
	</Folder>
</GetFolderResponse>

JSON格式

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

{
  "RequestId" : "88EF473E-D5CD-589F-AAB3-F6E0D12AECA3",
  "Folder" : {
    "CreateTime" : "2021-06-15T06:39:08.521Z",
    "FolderId" : "fd-Jyl5U7****",
    "FolderName" : "Applications",
    "ParentFolderId" : "r-Wm****",
    "ResourceDirectoryPath" : "rd-3G****/r-Wm****/fd-Jyl5U7****"
  }
}

错误码

HttpCode 错误码 错误信息 描述
400 MissingParameter.FolderId You must specify FolderId. 资源夹ID缺失,请指定目标ID。
400 InvalidParameter.FolderId The FolderId is invalid. 资源夹ID无效,资源夹ID应以“r-”开头+6位数字或英文字母或以“fd-”开头+10位数字或英文字母。
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. 资源夹不存在,请先创建资源夹。

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