Queries resource shares.
Operation description
This topic provides an example on how to call the API operation to query the resource shares that are created by using the current Alibaba Cloud account in the cn-hangzhou
region. The response shows that the following resource shares are created by using the account whose ID is 151266687691****
:
rs-hX9wC5jO****
, which is in theDeleted
staters-PqysnzIj****
, which is in theActive
state
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 |
---|---|---|---|---|
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ResourceOwner | string | Yes | The owner of the resource shares. Valid values:
| Self |
ResourceShareName | string | No | The name of the resource share. | test |
ResourceShareStatus | string | No | The status of the resource share. Valid values:
Note
The system deletes the records of resource shares in the Deleted state within 48 hours to 96 hours after you delete the resource shares.
| Active |
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-PqysnzIj**** | |
PermissionName | string | No | The name of the permission. For more information, see Permission library. | AliyunRSDefaultPermissionVSwitch |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "TGlzdFJlc291cm****",
"RequestId": "2F23CFB6-A721-4E90-AC1E-0E30FA8B45DA",
"ResourceShares": [
{
"UpdateTime": "2020-12-03T08:01:43.638Z",
"ResourceShareName": "test",
"ResourceShareOwner": "151266687691****",
"CreateTime": "2020-12-03T02:20:31.292Z",
"ResourceShareId": "rs-PqysnzIj****",
"ResourceShareStatus": "Active",
"AllowExternalTargets": false
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
You must specify ResourceOwner. | |||
The ResourceOwner parameter is invalid. | |||
The ResourceShareName parameter is invalid. | |||
The length of ResourceShareName cannot exceed 50 characters. | |||
The ResourceShareStatus 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 parameter is invalid. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
see changesets | ||||||||||||
| ||||||||||||
see changesets | ||||||||||||
|