All Products
Search
Document Center

Resource Management:DisassociateResourceShare

Last Updated:Jun 10, 2026

Melepaskan resource yang dibagikan atau pihak yang berwenang dari Bagian Sumber Daya.

Deskripsi operasi

  • A resource owner can call this API to remove shared resources or principals from a resource share.

  • A principal outside your resource directory can call this API to leave the resource share. For more information, see Exit a resource share.

This example shows how to use the management account of a resource directory to remove the principal 172050525300**** from the resource share rs-6GRmdD3X**** in the cn-hangzhou region. This action stops the sharing of resources with that principal.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

resourcesharing:DisassociateResourceShare

update

*全部资源

*

  • resourcesharing:RequestedResourceType
  • resourcesharing:ResourceArn
None

Parameter permintaan

Parameter

Type

Required

Description

Example

ResourceShareId

string

Yes

ID Bagian Sumber Daya.

rs-6GRmdD3X****

Resources

array<object>

No

Daftar resource yang dibagikan yang akan dilepaskan dari Bagian Sumber Daya.

object

No

A shared resource.

ResourceType

string

No

The type of the shared resource.

You can disassociate up to five shared resources in a single request.

For a list of supported resource types, see Services that work with Resource Sharing.

Catatan

The Resources.N.ResourceId and Resources.N.ResourceType parameters must be specified in pairs.

VSwitch

ResourceId

string

No

The ID of the shared resource.

You can disassociate up to five shared resources in a single request.

Catatan

The Resources.N.ResourceId and Resources.N.ResourceType parameters must be specified in pairs.

vsw-bp183p93qs667muql****

Targets

array

No

Daftar pihak yang berwenang yang akan dilepaskan dari Bagian Sumber Daya.

172050525300****

string

No

The ID of a principal.

You can disassociate up to five principals in a single request.

172050525300****

ResourceArns

array

No

Daftar Nama Sumber Daya Alibaba Cloud (ARN) dari resource yang dibagikan.

Anda dapat melepaskan hingga lima resource yang dibagikan dalam satu permintaan.

string

No

The Alibaba Cloud Resource Name (ARN) of the shared resource.

Catatan

For the format of an ARN, see Services that work with Resource Sharing.

acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****

ResourceOwner

string

No

Pemilik Bagian Sumber Daya. Nilai valid:

  • Self (default): Bagian Sumber Daya dimiliki oleh akun saat ini. Gunakan nilai ini ketika pemilik resource melepaskan resource yang dibagikan atau pihak yang berwenang dari Bagian Sumber Daya dalam Direktori sumber daya.

  • OtherAccounts: Bagian Sumber Daya dimiliki oleh akun lain. Gunakan nilai ini ketika pihak yang berwenang keluar dari Bagian Sumber Daya yang dibuat oleh akun di luar Direktori sumber daya Anda.

Self

Elemen respons

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request.

95230BC9-A8E8-4493-96BD-4F0C758E37F8

ResourceShareAssociations

array<object>

The associations of shared resources or principals with the resource share.

object

An association of a shared resource or principal with the resource share.

UpdateTime

string

The time the association was last updated. For this operation, this indicates the time of disassociation. The meaning varies based on the AssociationType:

  • If the AssociationType is Resource, this is the time the resource was disassociated.

  • If the AssociationType is Target, this is the time the principal was disassociated.

2020-12-04T09:40:45.556Z

ResourceArn

string

The Alibaba Cloud Resource Name (ARN) of the shared resource.

Catatan

This parameter is returned only when AssociationType is Resource.

acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****

ResourceShareName

string

The name of the resource share.

test

CreateTime

string

The time the association was created. The meaning varies based on the AssociationType:

  • If the AssociationType is Resource, this is the time the resource was associated.

  • If the AssociationType is Target, this is the time the principal was associated.

2020-12-04T09:40:41.250Z

EntityType

string

The type of the entity. Valid values:

Account

ResourceShareId

string

The ID of the resource share.

rs-6GRmdD3X****

AssociationStatusMessage

string

The reason why the disassociation failed.

The Resources is invalid.

AssociationType

string

The association type. Valid values:

  • Resource: The entity is a resource.

  • Target: The entity is a principal.

Target

AssociationStatus

string

The status of the association. Valid values:

  • Associating: The entity is being associated.

  • Associated: The entity is associated.

  • Failed: The association failed.

  • Disassociating: The entity is being disassociated.

  • Disassociated: The entity is disassociated.

Catatan

The system automatically deletes records in the Failed and Disassociated states within 48 to 96 hours.

Disassociating

TargetProperty

string

The properties of the principal, such as the time period for resource sharing.

Catatan

This parameter is returned only when the principal is an Alibaba Cloud service.

{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } }

EntityId

string

The ID of the entity. Its value varies based on the AssociationType:

  • If AssociationType is Resource, the value of this parameter is the resource ID.

  • If the AssociationType is Target, this is the ID of the Resource Directory, Folder, or Member.

172050525300****

ResourceProperty

string

The properties of the resource.

{"sharePrincipals":true,"shareTagOptions":false}

Contoh

Respons sukses

JSONformat

{
  "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}"
    }
  ]
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 MissingParameter.ResourceShareId You must specify ResourceShareId.
400 InvalidParameter.ResourceShareId The ResourceShareId is invalid.
400 InvalidParameter.Resources The Resources is invalid.
400 InvalidParameter.Resources.Duplicate The Resources contains duplicate values.
400 InvalidParameter.Resources.Length The maximum number of Resources exceeds 5.
400 InvalidParameter.Targets The Targets is invalid.
400 InvalidParameter.Targets.Duplicate The Targets contains duplicate values.
400 InvalidParameter.Targets.Length The maximum number of Targets exceeds 5.
400 ResourceAndTargetBothEmpty Either a resource or a shared target must be specified.
400 DisassociateInvalid You can not disassociate unassociated resource or target.
400 InvalidParameter The specified parameter is invalid.
400 InvalidParameter.ResourceType The ResourceType is invalid.
400 InvalidParameter.ResourceArns The ResourceArns is invalid.
400 InvalidParameter.ResourceArns.Duplicate The ResourceArns contains duplicate values.
400 InvalidParameter.ResourceArns.Length The ResourceArns beyond the length limit.
400 InvalidParameter.ResourceConflict 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.
404 EntityNotExists.ResourceShare 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.
409 ResourceShareStatusMismatchAction 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.
409 LeavingFailed.Account The account was added to the resource share automatically by resoucre directory.
409 LeavingFailed.ResourceType The resource share contains resources of the resource types that dont support this action.
409 ExternalTargetWithdrawConflict Existing internal association task in resource directory when disassociating with resource share.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.