Queries the association records of resource shares.
Operation description
This topic provides an example on how to call the API operation to query the association records of the resource shares that are created by using the current Alibaba Cloud account in the cn-hangzhou
region. The response shows the following records:
- The resource
vsw-bp1upw03qyz8n7us9****
of theVSwitch
type has been associated with the resource sharers-6GRmdD3X****
. The resource is in theAssociated
state. This indicates that the resource is being shared. - The resource
vsw-bp183p93qs667muql****
of theVSwitch
type has been disassociated from the resource sharers-6GRmdD3X****
. The resource is in theDisassociated
state. This indicates that the sharing of the resource is stopped.
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 |
---|---|---|---|---|
ResourceId | string | No | The ID of the resource. Note
This parameter is unavailable if you set the AssociationType parameter to Target .
| vsw-bp183p93qs667muql**** |
Target | string | No | The ID of the principal. Note
This parameter is unavailable if you set the AssociationType parameter to Resource .
| 172050525300**** |
AssociationType | string | Yes | The association type. Valid values:
| Resource |
AssociationStatus | string | No | The association status. Valid values:
Note
The system deletes the records of entities in the Failed or Disassociated state within 48 hours to 96 hours.
| Associated |
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-6GRmdD3X**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "TGlzdFJlc291cm****",
"RequestId": "11BA57B5-7301-4E2F-BBA5-2AE4C2F4FCDB",
"ResourceShareAssociations": [
{
"UpdateTime": "2020-12-07T07:39:02.920Z",
"EntityId": "vsw-bp1upw03qyz8n7us9****",
"ResourceShareName": "example",
"CreateTime": "2020-12-07T07:39:01.818Z",
"EntityType": "VSwitch",
"ResourceShareId": "rs-6GRmdD3X****",
"AssociationStatusMessage": "The reason for the association failure. ",
"AssociationType": "Resource",
"AssociationStatus": "Associated",
"External": false,
"TargetProperty": "{\n \"timeRange\":{\n \"timeRangeType\":\"timeRange\",\n \"beginAtTime\":\"00:00\",\n \"timezone\":\"UTC+8\",\n \"endAtTime\":\"19:59\"\n }\n}",
"AssociationFailedDetails": [
{
"Status": "None\n",
"StatusMessage": "None\n",
"AssociateType": "None\n",
"EntityId": "172050525300****",
"EntityType": "Account",
"FailureReason": "Unavailable",
"FailureDescription": "You cannot access the specified resource at this time.",
"OperationType": "Associate"
}
]
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
You must specify AssociationType. | |||
The AssociationType parameter is invalid. | |||
The AssociationStatus 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 Target parameter is invalid. | |||
The ResourceId parameter is invalid. | |||
The specified parameter conflicts with AssociationType. | |||
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 |