调用DisassociateResourceShare为共享单元移除共享资源或资源使用者。
本文将提供一个示例,在地域cn-hangzhou
下的共享单元rs-6GRmdD3X****
中,移除资源使用者172050525300****
,即停止对该资源使用者的共享。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DisassociateResourceShare |
要执行的操作。取值:DisassociateResourceShare。 |
RegionId | String | 是 | cn-hangzhou |
地域ID。 支持资源共享的地域,请参见DescribeRegions。 |
ResourceShareId | String | 是 | rs-6GRmdD3X**** |
共享单元ID。 |
Resources.N.ResourceId | String | 否 | vsw-bp183p93qs667muql**** |
共享资源ID。 N的取值范围:1~5,即每次最多移除5个共享资源。 说明 Resources.N.ResourceId与Resources.N.ResourceType成对出现,需要同时设置。
|
Resources.N.ResourceType | String | 否 | VSwitch |
共享资源类型。 N的取值范围:1~5,即每次最多移除5个共享资源。 取值:VSwitch。 说明 Resources.N.ResourceId与Resources.N.ResourceType成对出现,需要同时设置。
|
Targets.N | RepeatList | 否 | 172050525300**** |
资源使用者。 资源共享的受益方,可以使用共享的资源,通常为资源目录内的成员账号UID。关于如何获取成员账号UID,请参见查看成员基本信息。 N的取值范围:1~5,即每次最多移除5个资源使用者。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 95230BC9-A8E8-4493-96BD-4F0C758E37F8 |
请求ID。 |
ResourceShareAssociations | Array of ResourceShareAssociation |
共享单元关联的共享资源或资源使用者信息。 |
|
AssociationStatus | String | Disassociating |
关联状态。取值:
说明
Failed 和Disassociated 状态的记录,会在48~96小时内被系统自动删除。
|
AssociationStatusMessage | String | The reason for the association failure. |
关联失败的原因。 |
AssociationType | String | Target |
关联类型。取值:
|
CreateTime | String | 2020-12-04T09:40:41.250Z |
取消关联的时间。存在以下两种情况:
|
EntityId | String | 172050525300**** |
关联实体ID。取值:
|
EntityType | String | Account |
关联实体类型。取值:
|
ResourceShareId | String | rs-6GRmdD3X**** |
共享单元ID。 |
ResourceShareName | String | test |
共享单元名称。 |
UpdateTime | String | 2020-12-04T09:40:45.556Z |
取消关联的更新时间。存在以下两种情况:
|
示例
请求示例
https://resourcesharing.aliyuncs.com/?Action=DisassociateResourceShare
&RegionId=cn-hangzhou
&ResourceShareId=rs-6GRmdD3X****
&Targets.1=172050525300****
&<公共请求参数>
正常返回示例
XML
格式
<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
格式
{
"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"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | MissingParameter.ResourceShareId | You must specify ResourceShareId. | ResourceShareId参数缺失。 |
400 | InvalidParameter.ResourceShareId | The ResourceShareId is invalid. | ResourceShareId参数错误。 |
400 | InvalidParameter.Resources | The Resources is invalid. | 选定的共享资源无效。 |
400 | InvalidParameter.Resources.Length | The maximum number of Resources exceeds 5. | 选定的共享资源数量超限(最大5个)。 |
400 | InvalidParameter.Resources.Duplicate | The Resources contains duplicate values. | 选定的共享资源有重复项。 |
400 | InvalidParameter.Targets | The Targets is invalid. | 资源使用者的参数不符合规则。 |
400 | InvalidParameter.Targets.Length | The maximum number of Targets exceeds 5. | 资源使用者数量超限(最大5个)。 |
400 | InvalidParameter.Targets.Duplicate | The Targets contains duplicate values. | 资源使用者有重复项。 |
409 | AccountNotInResourceDirectory | The account is not a master or a member of a resource directory. | 资源使用者不在资源目录内。 |
404 | EntityNotExists.ResourceShare | The resource share does not exist in the current account. | 共享单元不在当前账号内。 |
409 | ResourceShareStatusMismatchAction | The status of the resource share does not allow the specified operation. | 共享单元的状态不支持当前操作。 |
400 | ResourceAndTargetBothEmpty | Either a resource or a shared target must be specified. | 必须指定一个资源或一个资源使用者。 |
409 | DisassociateConflict | You cannot perform the operation while association is already in progress. | 关联中,不能操作关联。 |
400 | DisassociateInvalid | You can not disassociate unassociated resource or target. | 对象未关联,不能取消关联。 |
400 | InvalidParameter | The specified parameter is invalid. | 参数无效。 |
访问错误中心查看更多错误码。