查询共享的资源列表或者其他账号共享的资源列表。
接口说明
本文将提供一个示例,查询您在cn-hangzhou
地域共享的资源列表。返回结果显示,您只共享过 1 个资源,即在共享单元rs-6GRmdD3X****
内共享过VSwitch
类型的资源vsw-bp1upw03qyz8n7us9****
。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
resourcesharing:ListSharedResources |
list |
*全部资源
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
ResourceOwner |
string |
是 |
共享单元归属者。取值:
|
Self |
ResourceType |
string |
否 |
共享资源类型。 支持共享的资源类型,请参见支持资源共享的云服务。 |
VSwitch |
Target |
string |
否 |
资源使用者 ID 或资源所有者 ID。取值:
|
172050525300**** |
MaxResults |
integer |
否 |
单次请求返回结果的最大条数。 取值范围:1~100。默认值:20。 |
20 |
NextToken |
string |
否 |
当请求的返回结果被截断时,您可以使用 |
TGlzdFJlc291cm**** |
ResourceShareIds |
array |
否 |
共享单元 ID。 N 的取值范围:1~5,即每次最多指定 5 个共享单元。 |
rs-6GRmdD3X**** |
string |
否 |
共享单元 ID。 |
rs-6GRmdD3X**** |
|
ResourceIds |
array |
否 |
共享资源 ID。 N 的取值范围:1~5,即每次最多指定 5 个共享资源。 |
vsw-bp1upw03qyz8n7us9**** |
string |
否 |
共享资源 ID。 |
vsw-bp1upw03qyz8n7us9**** |
|
ResourceArns |
array |
否 |
||
string |
否 |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
返回参数。 |
||
NextToken |
string |
当请求的返回结果被截断时,您可以使用 NextToken 再次发起请求,获取从当前截断位置之后的内容。 |
TGlzdFJlc291cm**** |
RequestId |
string |
请求 ID。 |
04677DCA-7C33-464B-8811-1B1DA3C3D197 |
SharedResources |
array<object> |
共享资源信息。 |
|
object |
共享资源信息。 |
||
UpdateTime |
string |
更新关联资源的时间。 |
2020-12-07T07:39:02.921Z |
ResourceType |
string |
共享资源类型。 支持共享的资源类型,请参见支持资源共享的云服务。 |
VSwitch |
CreateTime |
string |
关联资源的时间。 |
2020-12-07T07:39:02.921Z |
ResourceShareId |
string |
共享单元 ID。 |
rs-6GRmdD3X**** |
ResourceArn |
string |
||
ResourceStatus |
string |
共享资源状态。查询您共享的资源时不返回该参数,查询共享给您的资源时返回该参数。 取值:
|
Available |
ResourceStatusMessage |
string |
关联失败的原因。 |
The reason for the association failure. |
ResourceId |
string |
共享资源 ID。 |
vsw-bp1upw03qyz8n7us9**** |
示例
正常返回示例
JSON
格式
{
"NextToken": "TGlzdFJlc291cm****",
"RequestId": "04677DCA-7C33-464B-8811-1B1DA3C3D197",
"SharedResources": [
{
"UpdateTime": "2020-12-07T07:39:02.921Z",
"ResourceType": "VSwitch",
"CreateTime": "2020-12-07T07:39:02.921Z",
"ResourceShareId": "rs-6GRmdD3X****",
"ResourceArn": "",
"ResourceStatus": "Available",
"ResourceStatusMessage": "The reason for the association failure. ",
"ResourceId": "vsw-bp1upw03qyz8n7us9****"
}
]
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | MissingParameter.ResourceOwner | You must specify ResourceOwner. | ResourceOwner参数缺失。 |
400 | InvalidParameter.ResourceOwner | The ResourceOwner is invalid. | ResourceOwner参数错误。 |
400 | InvalidParameter.ResourceType | The ResourceType is invalid. | 传入的资源类型错误。 |
400 | InvalidParameter.MaxResults | The MaxResults is invalid. | MaxResults参数错误。 |
400 | InvalidParameter.NextToken | The NextToken is invalid. | NextToken参数错误。 |
400 | InvalidParameter.NextToken.Length | The maximum length of NextToken exceeds 256 characters. | NextToken长度超限(最大256个字符)。 |
400 | InvalidParameter.ResourceShareIds | The ResourceShareIds is invalid. | ResourceShareIds参数错误。 |
400 | InvalidParameter.ResourceShareIds.Duplicate | The ResourceShareIds contains duplicate values. | ResourceShareIds有重复项。 |
400 | InvalidParameter.ResourceShareIds.Length | The maximum length of ResourceShareIds exceeds 5 characters. | ResourceShareIds长度超限(最大5个)。 |
400 | InvalidParameter.ResourceIds | The ResourceIds is invalid. | 传入的资源ID错误。 |
400 | InvalidParameter.ResourceIds.Duplicate | The specified ResourceId contains duplicate values. | 传入的资源ID有重复项。 |
400 | InvalidParameter.ResourceIds.Length | The maximum number of ResourceIds (5) is exceeded. | 传入的资源ID数量超限(最大5个)。 |
400 | InvalidParameter.Target | The Target is invalid. | 资源所有者传参错误。 |
400 | InvalidParameter | The specified parameter is invalid. | 参数无效。 |
400 | InvalidParameter.ResourceArns | The ResourceArns is invalid. | ResourceArns参数无效。 |
400 | InvalidParameter.ResourceArns.Duplicate | The ResourceArns contains duplicate values. | 资源ARN参数有重复项。 |
400 | InvalidParameter.ResourceArns.Length | The ResourceArns beyond the length limit. | 资源ARN数量超限(最大5个)。 |
400 | NotSupport.ResourceType.ResourcesParameter | The Resources parameter does not support this resource type. Please use ResourceArns instead. | 当前资源类型不支持Resources参数,请使用ResourceArns参数。 |
400 | InvalidParameter.ResourceConflict | Both ResourceId and ResourceArn cannot be specified simultaneously. Please provide only one of these parameters. | ResourceId 和 ResourceArn 不能同时指定。请仅提供其中一个参数。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。