共有リソースまたはプリンシパルを共有ユニットに関連付けます。
操作説明
このトピックでは、cn-hangzhou リージョンで vSwitch vsw-bp183p93qs667muql**** を共有ユニット rs-6GRmdD3X**** に追加し、リソースディレクトリのメンバー 172050525300**** と共有する方法の例を示します。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
resourcesharing:AssociateResourceShare |
update |
*All Resource
|
|
なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| ResourceShareId |
string |
必須 |
共有ユニットの ID。 |
rs-6GRmdD3X**** |
| Resources |
array<object> |
任意 |
共有リソース。 |
|
|
object |
任意 |
共有リソース。 |
||
| ResourceType |
string |
任意 |
共有リソースのタイプ。 N の値は 1 から 5 です。つまり、一度に最大 5 つの共有リソースを追加できます。 共有可能なリソースタイプの詳細については、「リソース共有と連携するサービス」をご参照ください。 説明
|
VSwitch |
| ResourceId |
string |
任意 |
共有リソースの ID。 N の値は 1 から 5 です。つまり、一度に最大 5 つの共有リソースを追加できます。 説明
Resources.N.ResourceId と Resources.N.ResourceType はペアで指定する必要があります。 |
vsw-bp183p93qs667muql**** |
| Targets |
array |
任意 |
プリンシパル。 |
172050525300**** |
|
string |
任意 |
プリンシパル。有効な値:
詳細については、「リソース共有の概要」、「リソースディレクトリの基本情報を表示する」、「フォルダーの基本情報を表示する」、または「メンバーの基本情報を表示する」をご参照ください。 N の値は 1 から 5 です。つまり、一度に最大 5 つのプリンシパルを追加できます。 |
172050525300**** |
|
| ResourceArns |
array |
任意 |
共有リソースの Alibaba Cloud リソースネーム (ARN)。 N の値は 1 から 5 です。つまり、一度に最大 5 つの共有リソースを追加できます。 |
|
|
string |
任意 |
共有リソースの ARN。 説明
ARN のフォーマットの詳細については、「リソース共有と連携するサービス」をご参照ください。 |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
|
| PermissionNames |
array |
任意 |
権限の名前。このパラメーターを指定しない場合、システムは自動的にデフォルトの権限をリソースタイプに関連付けます。詳細については、「権限ライブラリ」をご参照ください。 |
|
|
string |
任意 |
権限の名前。このパラメーターを指定しない場合、システムは自動的にデフォルトの権限をリソースタイプに関連付けます。詳細については、「権限ライブラリ」をご参照ください。 |
AliyunRSDefaultPermissionVSwitch |
|
| TargetProperties |
array<object> |
任意 |
プリンシパルのプロパティ。 説明
このパラメーターは、プリンシパルが Alibaba Cloud サービスの場合にのみ使用できます。 |
|
|
object |
任意 |
プリンシパルのプロパティ。 説明
このパラメーターは、プリンシパルが Alibaba Cloud サービスの場合にのみ使用できます。 |
||
| TargetId |
string |
任意 |
プリンシパルの ID。 説明
|
172050525300**** |
| Property |
string |
任意 |
プリンシパルのプロパティ。たとえば、リソース共有の時間範囲を指定できます。
説明
|
{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
返される応答。 |
||
| RequestId |
string |
リクエストの ID。 |
111FB84A-60A9-403E-9067-E55D7EE95BD1 |
| ResourceShareAssociations |
array<object> |
共有ユニットに関連付けられている共有リソースまたはプリンシパルに関する情報。 |
|
|
object |
共有ユニットに関連付けられている共有リソースまたはプリンシパルに関する情報。 |
||
| UpdateTime |
string |
関連付けが更新された時刻。このパラメーターは、次の場合に返されます:
|
2020-12-04T09:40:41.246Z |
| ResourceArn |
string |
関連付けられたリソースの ARN。 説明
このパラメーターは、 |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| ResourceShareName |
string |
共有ユニットの名前。 |
test |
| CreateTime |
string |
関連付けが作成された時刻。このパラメーターは、次の場合に返されます:
|
2020-12-04T09:40:41.246Z |
| EntityType |
string |
関連付けられたエンティティのタイプ。有効な値:
|
VSwitch |
| ResourceShareId |
string |
共有ユニットの ID。 |
rs-6GRmdD3X**** |
| AssociationStatusMessage |
string |
関連付けが失敗した理由。 |
The reason for the association failure. |
| AssociationType |
string |
関連付けのタイプ。有効な値:
|
Resource |
| AssociationStatus |
string |
関連付けのステータス。有効な値:
説明
|
Associating |
| TargetProperty |
string |
プリンシパルのプロパティ。たとえば、リソース共有の時間範囲などです。 説明
このパラメーターは、プリンシパルが Alibaba Cloud サービスの場合にのみ返されます。 |
{ "plan":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
| EntityId |
string |
関連付けられたエンティティの ID。有効な値:
|
vsw-bp183p93qs667muql**** |
例
成功レスポンス
JSONJSON
{
"RequestId": "111FB84A-60A9-403E-9067-E55D7EE95BD1",
"ResourceShareAssociations": [
{
"UpdateTime": "2020-12-04T09:40:41.246Z",
"ResourceArn": "acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****",
"ResourceShareName": "test",
"CreateTime": "2020-12-04T09:40:41.246Z",
"EntityType": "VSwitch",
"ResourceShareId": "rs-6GRmdD3X****",
"AssociationStatusMessage": "The reason for the association failure.",
"AssociationType": "Resource",
"AssociationStatus": "Associating",
"TargetProperty": "{\n \"plan\":{\n \"timeRangeType\":\"timeRange\",\n \"beginAtTime\":\"00:00\",\n \"timezone\":\"UTC+8\",\n \"endAtTime\":\"19:59\"\n }\n}",
"EntityId": "vsw-bp183p93qs667muql****"
}
]
}
エラーコード
|
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 | InvalidTarget | The shared target does not exist in the resource directory. | The target you are sharing does not exist in your resource directory. |
| 400 | ResourceAndTargetBothEmpty | Either a resource or a shared target must be specified. | Either a resource or a target must be specified. |
| 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.PermissionNames.Duplicate | The PermissionNames duplicate values. | |
| 400 | InvalidParameter.PermissionNames.Length | The maximum length of PermissionNames exceeds quota limit. | |
| 400 | InvalidParameter.TargetProperties | The TargetProperties is invalid. | |
| 400 | InvalidParameter.TargetProperties.Duplicate | The TargetProperties contains duplicate values. | |
| 400 | InvalidParameter.TargetProperties.Length | The TargetProperties beyond the length limit. | |
| 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. |
| 404 | EntityNotExists.Permission | The resource share permission does not exist. | |
| 409 | NotEnableSharingWithResourceDirectory | You have not enabled sharing with your Resource Directory. | |
| 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 | QuotaExceeded.SharedResource.Count | The maximum number of shared resources per account exceeds the limit. | The maximum number of shared resources per account exceeds the limit. |
| 409 | ShareWithYourself | You cannot share resources with yourself. | You cannot share resources with yourself. |
| 409 | AssociateConflict | You cannot perform the operation while disassociation operation is being performed. | You cannot perform the operation while disassociation is in progress. |
| 409 | NotManagementAccount | Only the management account of the service is allowed to share such resources. | |
| 409 | QuotaExceeded.PendingInvitations | The maximum number of pending invitations exceeds the limit. | |
| 409 | InvalidTarget.LegalEntityMismatch | The target account does not have the same legal entity as the resource owner account. | |
| 409 | ExternalTargetsNotAllowed.ResourceType | The resource share includes resource types that cannot be shared with accounts outside the resource directory. | |
| 409 | InvalidTarget.SiteMismatch | Cross-site resource sharing is not supported. | |
| 409 | NotSupport.Service.ExistInOtherResourceShare | The resource type has been shared to the target service through other resourceShare. Please share it in the same resourceShare. | |
| 409 | NotSupport.Service.AssociateConflict | The same resource cannot be shared repeatedly to the target service. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。