Disassociates resources or principals from a resource share.
Operation description
- A resource owner can call this API operation to disassociate shared resources or principals from a resource share.
- If a principal does not belong to a resource directory, the principal can call this API operation to exit the resource share. For more information, see Exit a resource share.
This topic provides an example on how to use the management account of a resource directory to call the API operation to disassociate the member 172050525300****
from the resource share rs-6GRmdD3X****
in the cn-hangzhou
region. After the member is disassociated from the resource share, the member cannot share the resources in the resource share.
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 |
---|---|---|---|---|
ResourceShareId | string | Yes | The ID of the resource share. | rs-6GRmdD3X**** |
Resources | array<object> | No | The information about the resources. | |
object | No | The shared resource. | ||
ResourceType | string | No | The type of a shared resource. Valid values of N: 1 to 5. This indicates that a maximum of five shared resources can be specified at a time. For more information about the types of resources that can be shared, see Services that work with Resource Sharing. Note
Resources.N.ResourceId and Resources.N.ResourceType must be used in pairs.
| VSwitch |
ResourceId | string | No | The ID of the shared resource. Valid values of N: 1 to 5. This indicates that a maximum of five shared resources can be specified at a time. Note
Resources.N.ResourceId and Resources.N.ResourceType must be used in pairs.
| vsw-bp183p93qs667muql**** |
Targets | array | No | The information about the principals. | |
string | No | The information about the principals. Valid values of N: 1 to 5. This indicates that a maximum of five principals can be specified at a time. | 172050525300**** | |
ResourceOwner | string | No | The owner of the resource share. Valid values:
| Self |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "95230BC9-A8E8-4493-96BD-4F0C758E37F8",
"ResourceShareAssociations": [
{
"UpdateTime": "2020-12-04T09:40:45.556Z",
"EntityId": "172050525300****",
"ResourceShareName": "test",
"CreateTime": "2020-12-04T09:40:41.250Z",
"EntityType": "Account",
"ResourceShareId": "rs-6GRmdD3X****",
"AssociationStatusMessage": "The Resources is invalid.",
"AssociationType": "Target",
"AssociationStatus": "Disassociating",
"TargetProperty": "{\n \"timeRange\":{\n \"timeRangeType\":\"timeRange\",\n \"beginAtTime\":\"00:00\",\n \"timezone\":\"UTC+8\",\n \"endAtTime\":\"19:59\"\n }\n}"
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
You must specify ResourceShareId. | |||
The ResourceShareId parameter is invalid. | |||
The specified shared resource is invalid. | |||
The specified Resources parameter contains duplicate values. | |||
The number of specified shared resources cannot exceed 5. | |||
The specified Targets parameter is invalid. | |||
The specified Targets parameter contains duplicate values. | |||
The number of Targets values cannot exceed 5. | |||
You must specify a resource or a resource account. | |||
The disassociation operation is not supported for an entity that is not associated with the resource share. | |||
The specified parameter is invalid. | |||
The specified ResourceType parameter is invalid. | |||
The resource share does not exist in the current account. | |||
The specified Targets value is not a member in the resource directory. | |||
The status of the resource share does not allow the specified operation. | |||
The association operation is not supported while an association is being performed. | |||
The current account is a principal of a resource share and cannot proactively exit the resource share. Contact the owner of the resource share to remove the account from the resource share. | |||
The resource share contains resources that cannot proactively exit the resource share. Contact the owner of the resource share to remove the current account from the resource share. | |||
The current account is a principal of a resource share and cannot proactively exit the resource share. Contact the owner of the resource share to remove the account from the resource share. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
View Change Details |