Disassociates resources or accounts from a resource share.

In this example, the account 172050525300**** is disassociated from the resource share rs-6GRmdD3X**** in the cn-hangzhou region. This indicates that the account cannot share the resources associated with the resource share.

Request parameters

Parameter Type Required Example Description
Action String Yes DisassociateResourceShare

The operation that you want to perform. Set the value to DisassociateResourceShare.

RegionId String Yes cn-hangzhou

The region ID.

For more information about regions where the Resource Sharing service is available, see DescribeRegions.

ResourceShareId String Yes rs-6GRmdD3X****

The ID of the resource share.

Resources.N.ResourceId String No vsw-bp183p93qs667muql****

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.
Resources.N.ResourceType String No VSwitch

The type 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.

Set the value to VSwitch.

Note Resources.N.ResourceId and Resources.N.ResourceType must be used in pairs.
Targets.N RepeatList No 172050525300****

The shared target.

A shared target shares the resources of resource owners. You can share your resources only with the member accounts in your resource directory. A shared target is indicated by its account ID. For more information about how to obtain the ID, see View the basic information of a member account.

Valid values of N: 1 to 5. This indicates that a maximum of five shared targets can be specified at a time.

For more information about common parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String 95230BC9-A8E8-4493-96BD-4F0C758E37F8

The ID of the request.

ResourceShareAssociations Array of ResourceShareAssociation

The information of the entities that are disassociated from the resource share.

AssociationStatus String Disassociating

The association status. Valid values:

  • Associating: The entity is being associated.
  • Associated: The entity is associated.
  • Failed: The entity fails to be associated.
  • Disassociating: The entity is being disassociated.
  • Disassociated: The entity is disassociated.
Note The system automatically deletes the records of entities in the Failed or Disassociated state within 48 hours to 96 hours.
AssociationStatusMessage String The reason for the association failure.

The cause of the association failure.

AssociationType String Target

The association type. Valid values:

  • Resource
  • Target
CreateTime String 2020-12-04T09:40:41.250Z

The time when the disassociation was performed. The value of this parameter depends on the value of the AssociationType parameter:

  • If the value of AssociationType is Resource, the value of this parameter is the time when the resource was disassociated from the resource share.
  • If the value of AssociationType is Target, the value of this parameter is the time when the account was disassociated from the resource share.
EntityId String 172050525300****

The ID of the entity. The value of this parameter depends on the value of the AssociationType parameter:

  • If the value of AssociationType is Resource, the value of this parameter is the resource ID.
  • If the value of AssociationType is Target, the value of this parameter is the account ID.
EntityType String Account

The type of the entity. The value of this parameter depends on the value of the AssociationType parameter:

  • If the value of AssociationType is Resource, the value of this parameter is VSwitch.
  • If the value of AssociationType is Target, the value of this parameter is Account.
ResourceShareId String rs-6GRmdD3X****

The ID of the resource share.

ResourceShareName String test

The name of the resource share.

UpdateTime String 2020-12-04T09:40:45.556Z

The time when the disassociation was updated. The value of this parameter depends on the value of the AssociationType parameter:

  • If the value of AssociationType is Resource, the value of this parameter is the time when the disassociation of the resource was updated.
  • If the value of AssociationType is Target, the value of this parameter is the time when the disassociation of the account was updated.

Examples

Sample requests

https://resourcesharing.aliyuncs.com/?Action=DisassociateResourceShare
&RegionId=cn-hangzhou
&ResourceShareId=rs-6GRmdD3X****
&Targets.1=172050525300****
&<Common request parameters>

Sample success responses

XML format

<DisassociateResourceShareResponse>
      <ResourceShareAssociations>
            <ResourceShareId>rs-6GRmdD3X****</ResourceShareId>
            <EntityId>172050525300****</EntityId>
            <EntityType>Account</EntityType>
            <AssociationStatusMessage></AssociationStatusMessage>
            <AssociationType>Target</AssociationType>
            <CreateTime>2020-12-04T09:40:41.250Z</CreateTime>
            <UpdateTime>2020-12-04T09:40:45.556Z</UpdateTime>
            <ResourceShareName>test</ResourceShareName>
            <AssociationStatus>Disassociating</AssociationStatus>
      </ResourceShareAssociations>
      <RequestId>95230BC9-A8E8-4493-96BD-4F0C758E37F8</RequestId>
</DisassociateResourceShareResponse>

JSON format

{
  "ResourceShareAssociations": [
    {
      "ResourceShareId": "rs-6GRmdD3X****",
      "EntityId": "172050525300****",
      "EntityType": "Account",
      "AssociationStatusMessage": "",
      "AssociationType": "Target",
      "CreateTime": "2020-12-04T09:40:41.250Z",
      "UpdateTime": "2020-12-04T09:40:45.556Z",
      "ResourceShareName": "test",
      "AssociationStatus": "Disassociating"
    }
  ],
  "RequestId": "95230BC9-A8E8-4493-96BD-4F0C758E37F8"
}

Error codes

HTTP status code Error code Error message Description
400 MissingParameter.ResourceShareId You must specify ResourceShareId. The error message returned because the ResourceShareId parameter is not specified.
400 InvalidParameter.ResourceShareId The ResourceShareId is invalid. The error message returned because the value of the ResourceShareId parameter is invalid.
400 InvalidParameter.Resources The Resources is invalid. The error message returned because the specified resource is invalid.
400 InvalidParameter.Resources.Length The maximum number of Resources exceeds 5. The error message returned because the number of specified resources has exceeded the upper limit. Specify a maximum of five resources.
400 InvalidParameter.Resources.Duplicate The Resources contains duplicate values. The error message returned because duplicate resources are specified.
400 InvalidParameter.Targets The Targets is invalid. The error message returned because the value of the Targets parameter is invalid.
400 InvalidParameter.Targets.Length The maximum number of Targets exceeds 5. The error message returned because the number of specified accounts has exceeded the upper limit. Specify a maximum of five accounts.
400 InvalidParameter.Targets.Duplicate The Targets contains duplicate values. The error message returned because duplicate accounts are specified.
409 AccountNotInResourceDirectory The account is not a master or a member of a resource directory. The error message returned because the specified account is not in your resource directory.
404 EntityNotExists.ResourceShare The resource share does not exist in the current account. The error message returned because the resource share does not belong to your Alibaba Cloud account.
409 ResourceShareStatusMismatchAction The status of the resource share does not allow the specified operation. The error message returned because the operation is not supported while the resource share is in the current state.
400 ResourceAndTargetBothEmpty Either a resource or a shared target must be specified. The error message returned because no resources or accounts are specified.
409 DisassociateConflict You cannot perform the operation while association is already in progress. The error message returned because the operation is not supported while an association is being performed.
400 DisassociateInvalid You can not disassociate unassociated resource or target. The error message returned because the operation is not supported for an entity that is not associated with the resource share.
400 InvalidParameter The specified parameter is invalid. The error message returned because a specified parameter is invalid.

For a list of error codes, visit the API Error Center.