全部产品
Search
文档中心

资源管理:ListResourceShares - 查询共享单元列表

更新时间:Aug 28, 2026

查询共享单元列表。

接口说明

本文将提供一个示例,查询当前账号在cn-hangzhou地域创建的共享单元列表。返回结果显示,当前账号151266687691****创建过以下 2 个共享单元:

  • 共享单元rs-hX9wC5jO****,处于已删除Deleted状态。

  • 共享单元rs-PqysnzIj****,处于已启用Active状态。

调试

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

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

ResourceOwner

string

共享单元归属者。取值:

  • Self:查询当前账号的共享单元列表。

  • OtherAccounts:查询其他账号共享给当前账号的共享单元列表。

Self

ResourceShareName

string

共享单元名称。

test

ResourceShareStatus

string

共享单元状态。取值:

  • Active:已启用。

  • Pending:待确认。

  • Deleting:删除中。

  • Deleted:已删除。

说明

Deleted 状态的共享单元记录,会在 48~96 小时内被系统自动删除。

Active

MaxResults

integer

单次请求返回结果的最大条数。

取值范围:1~100。默认值:20。

20

NextToken

string

当请求的返回结果被截断时,您可以使用NextToken再次发起请求,获取从当前截断位置之后的内容。

TGlzdFJlc291cm****

ResourceShareIds

array

共享单元 ID。

N 的取值范围:1~5,即每次最多指定 5 个共享单元。

rs-PqysnzIj****

string

共享单元 ID。

rs-PqysnzIj****

PermissionName

string

共享权限名称。具体信息,请参见权限库

AliyunRSDefaultPermissionVSwitch

ResourceGroupId

string

资源组 ID。

rg-aekz5nlvlak****

Tag

array<object>

标签列表。

object

标签列表。

Key

string

标签键。

说明

最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://或者https://

k1

Value

string

标签值。

说明

最多支持 128 个字符,不能以acs:开头,不能包含http://或者https://

v1

返回参数

名称

类型

描述

示例值

object

返回参数。

NextToken

string

当请求的返回结果被截断时,您可以使用NextToken再次发起请求,获取从当前截断位置之后的内容。

TGlzdFJlc291cm****

RequestId

string

请求 ID。

2F23CFB6-A721-4E90-AC1E-0E30FA8B45DA

ResourceShares

array<object>

共享单元信息。

array<object>

共享单元信息。

AllowExternalTargets

boolean

是否允许共享给资源目录外的账号。取值:

  • false:仅允许资源目录内共享。

  • true:允许共享给任意账号。

false

CreateTime

string

共享单元创建时间。

2020-12-03T02:20:31.292Z

ResourceGroupId

string

资源组 ID。

rg-aekz5nlvlak****

ResourceShareId

string

共享单元 ID。

rs-PqysnzIj****

ResourceShareName

string

共享单元名称。

test

ResourceShareOwner

string

共享单元归属者。

151266687691****

ResourceShareStatus

string

共享单元状态。取值:

  • Active:已启用。

  • Pending:待确认。

  • Deleting:删除中。

  • Deleted:已删除。

说明

Deleted 状态的共享单元记录,会在 48~96 小时内被系统自动删除。

Active

Tags

array<object>

标签列表。

object

标签列表。

Key

string

标签键。

k1

Value

string

标签值。

v1

UpdateTime

string

共享单元更新时间。

2020-12-03T08:01:43.638Z

示例

正常返回示例

JSON格式

{
  "NextToken": "TGlzdFJlc291cm****",
  "RequestId": "2F23CFB6-A721-4E90-AC1E-0E30FA8B45DA",
  "ResourceShares": [
    {
      "AllowExternalTargets": false,
      "CreateTime": "2020-12-03T02:20:31.292Z",
      "ResourceGroupId": "rg-aekz5nlvlak****",
      "ResourceShareId": "rs-PqysnzIj****",
      "ResourceShareName": "test",
      "ResourceShareOwner": "151266687691****",
      "ResourceShareStatus": "Active",
      "Tags": [
        {
          "Key": "k1",
          "Value": "v1"
        }
      ],
      "UpdateTime": "2020-12-03T08:01:43.638Z"
    }
  ]
}

错误码

HTTP status code

错误码

错误信息

描述

400 MissingParameter.ResourceOwner You must specify ResourceOwner.
400 InvalidParameter.ResourceOwner The ResourceOwner is invalid.
400 InvalidParameter.ResourceShareName The ResourceShareName is invalid.
400 InvalidParameter.ResourceShareName.Length The maximum length of ResourceShareName exceeds 50 characters.
400 InvalidParameter.ResourceShareStatus The ResourceShareStatus is invalid.
400 InvalidParameter.MaxResults The MaxResults is invalid.
400 InvalidParameter.NextToken The NextToken is invalid.
400 InvalidParameter.NextToken.Length The maximum length of NextToken exceeds 256 characters.
400 InvalidParameter.ResourceShareIds The ResourceShareIds is invalid.
400 InvalidParameter.ResourceShareIds.Duplicate The ResourceShareIds contains duplicate values.
400 InvalidParameter.ResourceShareIds.Length The maximum length of ResourceShareIds exceeds 5 characters.
400 InvalidParameter The specified parameter is invalid.
400 InvalidParameter.ResourceOwnerAndTag You cannot use ResourceOwner set to OtherAccounts and tags in one request.

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

变更历史

更多信息,参考变更详情