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 within the account 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 |
---|---|---|---|---|
*All Resources * |
| 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 shares. Valid values:
Note
The system automatically 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 IDs of the resource shares. Valid values of N: 1 to 5. This indicates that a maximum of five resource shares can be specified at a time. | |
string | No | The ID of a resource share. | rs-PqysnzIj**** | |
PermissionName | string | No | The information about the permissions. For more information, see Permission library. | AliyunRSDefaultPermissionVSwitch |
ResourceGroupId | string | No | The ID of the resource group. | rg-aekz5nlvlak**** |
Tag | array<object> | No | The tags. | |
object | No | A tag. | ||
Key | string | No | The tag key. Note
The tag key can be 128 characters in length and cannot start with acs: or aliyun . The tag key cannot contain http:// or https:// .
| k1 |
Value | string | No | The tag value. Note
The tag value can be 128 characters in length and cannot start with acs: . The tag value cannot contain http:// or https:// .
| v1 |
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": [
{
"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"
}
]
}
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. | |||
You cannot use ResourceOwner set to OtherAccounts and tags in one request. |
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 |