Desasocia recursos compartidos o principales de un recurso compartido.
Descripción de la operación
-
El propietario de un recurso puede llamar a esta API para eliminar recursos compartidos o principales de un recurso compartido.
-
Un principal fuera de su directorio de recursos puede llamar a esta API para abandonar el recurso compartido. Para obtener más información, consulte Salir de un recurso compartido.
Este ejemplo muestra cómo utilizar la cuenta de administración de un directorio de recursos para eliminar el principal 172050525300**** del recurso compartido rs-6GRmdD3X**** en la región cn-hangzhou. Esta acción detiene el uso compartido de recursos con dicho principal.
Pruébelo ahora
Test
Autorización de RAM
|
Action |
Nivel de acceso |
Tipo de recurso |
Clave de condición |
Acción dependiente |
|
resourcesharing:DisassociateResourceShare |
update |
*All Resource
|
|
Ninguna |
Parámetros de la solicitud
|
Parámetro |
Tipo |
Obligatorio |
Descripción |
Ejemplo |
| ResourceShareId |
string |
Sí |
El ID del recurso compartido. |
rs-6GRmdD3X**** |
| Resources |
array<object> |
No |
Una lista de recursos compartidos que se desasociarán del recurso compartido. |
|
|
object |
No |
Un recurso compartido. |
||
| ResourceType |
string |
No |
El tipo del recurso compartido. Puede desasociar hasta cinco recursos compartidos en una sola solicitud. Para consultar una lista de los tipos de recursos admitidos, consulte Servicios compatibles con Resource Sharing. Nota
Los parámetros |
VSwitch |
| ResourceId |
string |
No |
El ID del recurso compartido. Puede desasociar hasta cinco recursos compartidos en una sola solicitud. Nota
Los parámetros |
vsw-bp183p93qs667muql**** |
| Targets |
array |
No |
Una lista de principales que se desasociarán del recurso compartido. |
172050525300**** |
|
string |
No |
El ID de un principal. Puede desasociar hasta cinco principales en una sola solicitud. |
172050525300**** |
|
| ResourceArns |
array |
No |
Una lista de los nombres de recursos de Alibaba Cloud (ARN) de los recursos compartidos. Puede desasociar hasta cinco recursos compartidos en una sola solicitud. |
|
|
string |
No |
El nombre de recurso de Alibaba Cloud (ARN) del recurso compartido. Nota
Para conocer el formato de un ARN, consulte Servicios compatibles con Resource Sharing. |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
|
| ResourceOwner |
string |
No |
El propietario del recurso compartido. Valores válidos:
|
Self |
Elementos de la respuesta
|
Elemento |
Tipo |
Descripción |
Ejemplo |
|
object |
Los parámetros de respuesta. |
||
| RequestId |
string |
El ID de la solicitud. |
95230BC9-A8E8-4493-96BD-4F0C758E37F8 |
| ResourceShareAssociations |
array<object> |
Las asociaciones de recursos compartidos o principales con el recurso compartido. |
|
|
object |
Una asociación de un recurso compartido o principal con el recurso compartido. |
||
| UpdateTime |
string |
La hora de la última actualización de la asociación. Para esta operación, indica la hora de desasociación. El significado varía según el
|
2020-12-04T09:40:45.556Z |
| ResourceArn |
string |
El nombre de recurso de Alibaba Cloud (ARN) del recurso compartido. Nota
Este parámetro se devuelve solo cuando |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| ResourceShareName |
string |
El nombre del recurso compartido. |
test |
| CreateTime |
string |
La hora en que se creó la asociación. El significado varía según el
|
2020-12-04T09:40:41.250Z |
| EntityType |
string |
El tipo de entidad. Valores válidos:
|
Account |
| ResourceShareId |
string |
El ID del recurso compartido. |
rs-6GRmdD3X**** |
| AssociationStatusMessage |
string |
El motivo por el cual falló la desasociación. |
The Resources is invalid |
| AssociationType |
string |
El tipo de asociación. Valores válidos:
|
Target |
| AssociationStatus |
string |
El estado de la asociación. Valores válidos:
Nota
El sistema elimina automáticamente los registros en estados |
Disassociating |
| TargetProperty |
string |
Las propiedades del principal, como el período de tiempo para el uso compartido de recursos. Nota
Este parámetro se devuelve solo cuando el principal es un servicio de Alibaba Cloud. |
{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
| EntityId |
string |
El ID de la entidad. Su valor varía según el
|
172050525300**** |
| ResourceProperty |
string |
Las propiedades del recurso. |
{"sharePrincipals":true,"shareTagOptions":false} |
Ejemplos
Respuesta exitosa
JSON Formato
{
"RequestId": "95230BC9-A8E8-4493-96BD-4F0C758E37F8",
"ResourceShareAssociations": [
{
"UpdateTime": "2020-12-04T09:40:45.556Z",
"ResourceArn": "acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****",
"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}",
"EntityId": "172050525300****",
"ResourceProperty": "{\"sharePrincipals\":true,\"shareTagOptions\":false}"
}
]
}
Códigos de error
|
Código de estado HTTP |
Código de error |
Mensaje de error |
Descripción |
|---|---|---|---|
| 400 | MissingParameter.ResourceShareId | You must specify ResourceShareId. | You must specify ResourceShareId. |
| 400 | InvalidParameter.ResourceShareId | The ResourceShareId is invalid. | The ResourceShareId parameter is invalid. |
| 400 | InvalidParameter.Resources | The Resources is invalid. | The specified shared resource is invalid. |
| 400 | InvalidParameter.Resources.Duplicate | The Resources contains duplicate values. | The specified Resources parameter contains duplicate values. |
| 400 | InvalidParameter.Resources.Length | The maximum number of Resources exceeds 5. | The number of specified shared resources cannot exceed 5. |
| 400 | InvalidParameter.Targets | The Targets is invalid. | The specified Targets parameter is invalid. |
| 400 | InvalidParameter.Targets.Duplicate | The Targets contains duplicate values. | The specified Targets parameter contains duplicate values. |
| 400 | InvalidParameter.Targets.Length | The maximum number of Targets exceeds 5. | The number of Targets values cannot exceed 5. |
| 400 | ResourceAndTargetBothEmpty | Either a resource or a shared target must be specified. | You must specify a resource or a resource account. |
| 400 | DisassociateInvalid | You can not disassociate unassociated resource or target. | The disassociation operation is not supported for an entity that is not associated with the resource share. |
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | InvalidParameter.ResourceType | The ResourceType is invalid. | The specified ResourceType parameter is invalid. |
| 400 | InvalidParameter.ResourceArns | The ResourceArns is invalid. | The ResourceArns parameter is invalid. |
| 400 | InvalidParameter.ResourceArns.Duplicate | The ResourceArns contains duplicate values. | The ResourceArns contains duplicate values. |
| 400 | InvalidParameter.ResourceArns.Length | The ResourceArns beyond the length limit. | The maximum number of ResourceArns exceeds 5. |
| 400 | InvalidParameter.ResourceConflict | Both Resources and ResourceArns cannot be specified simultaneously. Please provide only one of these parameters. | Both Resources and ResourceArns cannot be specified simultaneously. Please provide only one of these parameters. |
| 400 | NotSupport.ResourceType.ResourcesParameter | The Resources parameter does not support this resource type. Please use ResourceArns instead. | The Resources parameter does not support this resource type. Please use ResourceArns instead. |
| 404 | EntityNotExists.ResourceShare | The resource share does not exist in the current account. | The resource share does not exist in the current account. |
| 409 | AccountNotInResourceDirectory | The account is not a master or a member of a resource directory. | The specified Targets value is not a member in the resource directory. |
| 409 | ResourceShareStatusMismatchAction | The status of the resource share does not allow the specified operation. | The status of the resource share does not allow the specified operation. |
| 409 | DisassociateConflict | You cannot perform the operation while association is already in progress. | The association operation is not supported while an association is being performed. |
| 409 | LeavingFailed.Account | The account was added to the resource share automatically by resoucre directory. | 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. |
| 409 | LeavingFailed.ResourceType | The resource share contains resources of the resource types that dont support this action. | 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. |
| 409 | ExternalTargetWithdrawConflict | Existing internal association task in resource directory when disassociating with 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. |
Consulte Códigos de error para ver la lista completa.
Notas de la versión
Consulte Notas de la versión para ver la lista completa.