すべてのプロダクト
Search
ドキュメントセンター

:DisassociateResourceShare

最終更新日:Oct 13, 2025

共有ユニットから共有リソースまたはプリンシパルを削除します。

操作説明

  • リソース所有者はこの操作を呼び出して、共有リソースまたはプリンシパルを削除できます。

  • リソースディレクトリの外部でリソースを共有する場合、共有ユニット内のプリンシパルはこの操作を呼び出して共有ユニットから退出できます。詳細については、「共有ユニットから退出する」をご参照ください。

このトピックでは、リソースディレクトリの管理アカウントを使用して、中国 (杭州) リージョンで共有ユニット rs-6GRmdD3X**** からプリンシパル 172050525300**** を削除する方法の例を示します。この操作により、プリンシパルとのリソース共有が停止されます。

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

下表に、この API を呼び出すために必要な認証情報を示します。認証情報は、RAM (Resource Access Management) ポリシーを使用して定義できます。以下で各列名について説明します。

  • アクション:特定のリソースに対して実行可能な操作。ポリシー構文ではAction要素として指定します。

  • API:アクションを具体的に実行するための API。

  • アクセスレベル:各 API に対して事前定義されているアクセスの種類。有効な値:create、list、get、update、delete。

  • リソースタイプ:アクションが作用するリソースの種類。リソースレベルでの権限をサポートするかどうかを示すことができます。ポリシーの有効性を確保するため、アクションの対象として適切なリソースを指定してください。

    • リソースレベルの権限を持つ API の場合、必要なリソースタイプはアスタリスク (*) でマークされます。ポリシーのResource要素で対応する ARN を指定してください。

    • リソースレベルの権限を持たない API の場合、「すべてのリソース」と表示され、ポリシーのResource要素でアスタリスク (*) でマークされます。

  • 条件キー:サービスによって定義された条件のキー。このキーにより、きめ細やかなアクセス制御が可能になります。この制御は、アクション単体に適用することも、特定のリソースに対するアクションに適用することもできます。Alibaba Cloud は、サービス固有の条件キーに加えて、すべての RAM 統合サービスに適用可能な一連の共通条件キーを提供しています。

  • 依存アクション:ある特定のアクションを実行するために、前提として実行が必要となる他のアクション。依存アクションの権限も RAM ユーザーまたは RAM ロールに付与する必要があります。

アクション

アクセスレベル

リソースタイプ

条件キー

依存アクション

resourcesharing:DisassociateResourceShare

update

*All Resource

*

  • resourcesharing:RequestedResourceType
  • resourcesharing:ResourceArn
なし

リクエストパラメーター

パラメーター

必須 / 任意

説明

ResourceShareId

string

必須

共有ユニットの ID。

rs-6GRmdD3X****

Resources

array<object>

任意

共有リソース。

object

任意

共有リソース。

ResourceType

string

任意

共有リソースのタイプ。一度に最大 5 つの共有リソースを削除できます。

共有可能なリソースタイプの詳細については、「リソース共有をサポートする Alibaba Cloud サービス」をご参照ください。

共有をサポートするリソースタイプの詳細については、「リソース共有をサポートする Alibaba Cloud サービス」をご参照ください。

説明

Resources.N.ResourceId と Resources.N.ResourceType をペアで設定します。

VSwitch

ResourceId

string

任意

共有リソースの ID。一度に最大 5 つの共有リソースを削除できます。

Resources.N.ResourceIdResources.N.ResourceType をペアで指定します。

説明

`Resources.N.ResourceId` と `Resources.N.ResourceType` パラメーターはペアで設定する必要があります。

vsw-bp183p93qs667muql****

Targets

array

任意

プリンシパル。

172050525300****

string

任意

プリンシパル。一度に最大 5 つのプリンシパルを削除できます。

N の有効値: 1~5。これは、一度に最大 5 つのプリンシパルを指定できることを示します。

172050525300****

ResourceArns

array

任意

共有リソースの Alibaba Cloud リソースネーム (ARN)。一度に最大 5 つの共有リソースを削除できます。

N の有効値: 1~5。これは、一度に最大 5 つの共有リソースを削除できることを示します。

string

任意

共有リソースの ARN。

説明

ARN フォーマットの詳細については、「リソース共有をサポートする Alibaba Cloud サービス」をご参照ください。

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

ResourceOwner

string

任意

共有ユニットのオーナー。有効な値:

  • Self (デフォルト): 共有ユニットは現在のアカウントに属します。この値は、リソース所有者がリソースディレクトリ内で共有するために作成された共有ユニットから共有リソースまたはプリンシパルを削除する場合に使用されます。

  • OtherAccounts: 共有ユニットは別のアカウントに属します。この値は、プリンシパルがリソースディレクトリの外部で共有するために作成された共有ユニットから退出する場合に使用されます。

Self

レスポンスフィールド

フィールド

説明

object

レスポンスパラメーター。

RequestId

string

リクエストの ID。

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

ResourceShareAssociations

array<object>

共有ユニットと共有リソースまたはプリンシパルとの関連付けに関する情報。

object

共有ユニットと共有リソースまたはプリンシパルとの関連付けに関する情報。

UpdateTime

string

関連付けの解除が最後に更新された時刻。このパラメーターは、次の場合に返されます:

  • AssociationTypeResource の場合、このパラメーターは共有リソースが削除された時刻を示します。

  • AssociationTypeTarget の場合、このパラメーターはプリンシパルが削除された時刻を示します。

2020-12-04T09:40:45.556Z

ResourceArn

string

関連付けられたリソースの ARN。

説明

AssociationTypeTarget の場合、このパラメーターは返されません。

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

ResourceShareName

string

共有ユニットの名前。

test

CreateTime

string

関連付けの解除が作成された時刻。このパラメーターは、次の場合に返されます:

  • AssociationTypeResource の場合、このパラメーターは共有リソースが削除された時刻を示します。

  • AssociationTypeTarget の場合、このパラメーターはプリンシパルが削除された時刻を示します。

2020-12-04T09:40:41.250Z

EntityType

string

関連付けられたエンティティのタイプ。有効な値:

  • エンティティがリソースの場合、このパラメーターの値はリソースタイプです。詳細については、「リソース共有をサポートする Alibaba Cloud サービス」をご参照ください。

  • エンティティがプリンシパルの場合、このパラメーターの値は Account です。

Account

ResourceShareId

string

共有ユニットの ID。

rs-6GRmdD3X****

AssociationStatusMessage

string

関連付けの解除が失敗した理由。

The Resources is invalid.

AssociationType

string

関連付けのタイプ。有効な値:

  • Resource: リソース。

  • Target: プリンシパル。

Target

AssociationStatus

string

関連付けのステータス。有効な値:

  • Associating: エンティティは関連付け中です。

  • Associated: エンティティは関連付けられています。

  • Failed: 関連付けに失敗しました。

  • Disassociating: エンティティは関連付け解除中です。

  • Disassociated: エンティティは関連付け解除されています。

説明

システムは、48~96 時間以内に Failed および Disassociated 状態のレコードを自動的に削除します。

Disassociating

TargetProperty

string

リソース共有の期間など、プリンシパルのプロパティ。

説明

このパラメーターは、プリンシパルが Alibaba Cloud サービスの場合にのみ返されます。

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

EntityId

string

関連付けられたエンティティの ID。有効な値:

  • AssociationTypeResource の場合、このパラメーターの値はリソースの ID です。

  • AssociationTypeTarget の場合、このパラメーターの値はリソースディレクトリ、フォルダ、またはメンバーの ID です。

172050525300****

成功レスポンス

JSONJSON

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

エラーコード

HTTP ステータスコード

エラーコード

エラーメッセージ

説明

400 MissingParameter.ResourceShareId You must specify ResourceShareId. You must specify ResourceShareId.
400 InvalidParameter.ResourceShareId The ResourceShareId is invalid. The ResourceShareId is invalid.
400 InvalidParameter.Resources The Resources is invalid. The Resources is invalid.
400 InvalidParameter.Resources.Duplicate The Resources contains duplicate values. The Resources contains duplicate values.
400 InvalidParameter.Resources.Length The maximum number of Resources exceeds 5. The maximum number of Resources exceeds 5.
400 InvalidParameter.Targets The Targets is invalid. The Targets is invalid.
400 InvalidParameter.Targets.Duplicate The Targets contains duplicate values. The Targets contains duplicate values.
400 InvalidParameter.Targets.Length The maximum number of Targets exceeds 5. The maximum number of Targets exceeds 5.
400 ResourceAndTargetBothEmpty Either a resource or a shared target must be specified. Either a resource or a target must be specified.
400 DisassociateInvalid You can not disassociate unassociated resource or target. You cannot disassociate unassociated resource or target.
400 InvalidParameter The specified parameter is invalid. The specified parameter is invalid.
400 InvalidParameter.ResourceType The ResourceType is invalid. 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. 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 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. 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. 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.

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。