Queries the resources you share with other accounts or the resources other accounts share with you.
Operation description
This topic provides an example on how to call the API operation to query the resources that you share with other accounts in the cn-hangzhou
region. The response shows that in the resource share rs-6GRmdD3X****
, you share the vsw-bp1upw03qyz8n7us9****
resource of the VSwitch
type with other accounts.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
*All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ResourceOwner | string | Yes | The owner of the resource shares. Valid values:
| Self |
ResourceType | string | No | The type of the shared resources. For more information about the types of resources that can be shared, see Services that work with Resource Sharing. | VSwitch |
Target | string | No | The ID of the principal or resource owner.
| 172050525300**** |
MaxResults | integer | No | The maximum number of entries to return for a single request. Valid values: 1 to 100. Default value: 20. | 20 |
NextToken | string | No | The | TGlzdFJlc291cm**** |
ResourceShareIds | array | No | The ID of a resource share. | |
string | No | The ID of a resource share. | rs-6GRmdD3X**** | |
ResourceIds | array | No | The ID of a shared resource. | |
string | No | The ID of a shared resource. | vsw-bp1upw03qyz8n7us9**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"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****",
"ResourceId": "vsw-bp1upw03qyz8n7us9****",
"ResourceStatus": "Available",
"ResourceStatusMessage": "The reason for the association failure. "
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
You must specify ResourceOwner. | |||
The ResourceOwner parameter is invalid. | |||
The specified ResourceType parameter is invalid. | |||
The MaxResults parameter is invalid. | |||
The NextToken parameter is invalid. | |||
The length of NextToken cannot exceed 256 characters. | |||
The ResourceShareIds parameter is invalid. | |||
The ResourceShareIds parameter contains duplicate values. | |||
The number of ResourceShareIds values cannot exceed 5. | |||
The specified ResourceIds parameter is invalid. | |||
The specified ResourceIds parameter contains duplicate values. | |||
The number of specified ResourceIds values cannot exceed 5. | |||
The Target parameter is invalid. | |||
The specified parameter is invalid. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
View Change Details | ||
View Change Details | ||
View Change Details |