文档

GetDiscoveredResource - 获取资源详情

更新时间:

获取资源详细信息。

接口说明

本文将提供一个示例,查询资源new-bucket的详情。

调试

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

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
config:GetDiscoveredResourceRead
  • 全部资源
    *

请求参数

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

资源 ID。

关于如何获取资源 ID,请参见 ListDiscoveredResources

new-bucket
ResourceTypestring

资源类型。

关于如何获取资源类型,请参见 ListDiscoveredResources

ACS::OSS::Bucket
Regionstring

资源所在地域 ID。

关于如何获取资源所在地域 ID,请参见 ListDiscoveredResources

cn-hangzhou

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

返回参数

名称类型描述示例值
object

无。

RequestIdstring

请求 ID。

E4D71ACE-6B0A-46E0-8352-56952378CC7F
DiscoveredResourceDetailobject

资源详情。

AvailabilityZonestring

资源可用区。

cn-hangzhou-h
ResourceTypestring

资源类型。

ACS::OSS::BucketACS::CDN::Domain
Configurationstring

资源的完整配置信息。

{\"AccessControlList\":{\"Grant\":\"private\"},\"ServerSideEncryptionRule\":{\"SSEAlgorithm\":\"None\"},\"Comment\":\"\",\"CreationDate\":\"2021-06-29T10:05:12.000Z\",\"Owner\":{\"DisplayName\":\"100931896542****\",\"ID\":\"100931896542****\"},\"StorageClass\":\"Standard\",\"DataRedundancyType\":\"LRS\",\"AllowEmptyReferer\":\"true\",\"Name\":\"new-bucket\",\"BucketPolicy\":{\"LogPrefix\":\"\",\"LogBucket\":\"\"},\"ExtranetEndpoint\":\"oss-cn-hangzhou.aliyuncs.com\",\"IntranetEndpoint\":\"oss-cn-hangzhou-internal.aliyuncs.com\",\"Location\":\"oss-cn-hangzhou\"}
Regionstring

地域 ID。

cn-hangzhou
ResourceCreationTimelong

资源创建时间戳。

1624961112000
Tagsstring

资源标签。

{\"\"hc\"\":[\"\"value2\"\"]}
AccountIdlong

资源拥有者的阿里云账号 ID。

100931896542****
ResourceIdstring

资源 ID。

new-bucket
ResourceDeletedinteger

资源删除状态。取值:

  • 1:未删除。
  • 0:已删除。
1
ResourceNamestring

资源名称。

new-bucket
ResourceStatusstring

资源状态。资源的状态取决于各云服务对其的定义,该参数可能为空。例如:

  • 当资源类型为 ACS::ECS::Instance 时,由于 ECS 实例有状态,因此该参数为 Running 或 Stopped。

  • 当资源类型为 ACS::OSS::Bucket 时,由于 OSS Bucket 无状态,因此该参数为空。

offline

示例

正常返回示例

JSON格式

{
  "RequestId": "E4D71ACE-6B0A-46E0-8352-56952378CC7F",
  "DiscoveredResourceDetail": {
    "AvailabilityZone": "cn-hangzhou-h",
    "ResourceType": "ACS::OSS::BucketACS::CDN::Domain",
    "Configuration": "{\\\"AccessControlList\\\":{\\\"Grant\\\":\\\"private\\\"},\\\"ServerSideEncryptionRule\\\":{\\\"SSEAlgorithm\\\":\\\"None\\\"},\\\"Comment\\\":\\\"\\\",\\\"CreationDate\\\":\\\"2021-06-29T10:05:12.000Z\\\",\\\"Owner\\\":{\\\"DisplayName\\\":\\\"100931896542****\\\",\\\"ID\\\":\\\"100931896542****\\\"},\\\"StorageClass\\\":\\\"Standard\\\",\\\"DataRedundancyType\\\":\\\"LRS\\\",\\\"AllowEmptyReferer\\\":\\\"true\\\",\\\"Name\\\":\\\"new-bucket\\\",\\\"BucketPolicy\\\":{\\\"LogPrefix\\\":\\\"\\\",\\\"LogBucket\\\":\\\"\\\"},\\\"ExtranetEndpoint\\\":\\\"oss-cn-hangzhou.aliyuncs.com\\\",\\\"IntranetEndpoint\\\":\\\"oss-cn-hangzhou-internal.aliyuncs.com\\\",\\\"Location\\\":\\\"oss-cn-hangzhou\\\"}",
    "Region": "cn-hangzhou",
    "ResourceCreationTime": 1624961112000,
    "Tags": "{\\\"\\\"hc\\\"\\\":[\\\"\\\"value2\\\"\\\"]}",
    "AccountId": 0,
    "ResourceId": "new-bucket",
    "ResourceDeleted": 1,
    "ResourceName": "new-bucket",
    "ResourceStatus": "offline"
  }
}

错误码

HTTP status code错误码错误信息描述
400NoPermissionYou are not authorized to perform this operation.您无权执行此操作。
400MemberNotBelongToMasterThe specified member does not belong to your organization.该成员账号不属于您所在的资源目录。
404AccountNotExistedYour account does not exist.您的账号不存在。
503ServiceUnavailableThe request has failed due to a temporary failure of the server.服务不可用。

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

  • 本页导读 (1)
文档反馈