プリンシパルのリストをクエリします。
操作説明
リソース所有者は、リソースを共有するプリンシパルをクエリできます。プリンシパルは、自分が属する共有ユニットをクエリできます。
このトピックでは、cn-hangzhou リージョンで作成した共有ユニットのプリンシパルのリストをクエリする方法の例を示します。レスポンスは、プリンシパル 114240524784**** および 172050525300**** とリソースを共有したことを示しています。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
resourcesharing:ListSharedTargets |
list |
*All Resource
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| ResourceOwner |
string |
必須 |
共有ユニットのオーナー。
|
Self |
| ResourceType |
string |
任意 |
共有リソースのタイプ。 共有できるリソースタイプの詳細については、「リソース共有をサポートする Alibaba Cloud サービス」をご参照ください。 |
VSwitch |
| ResourceId |
string |
任意 |
共有リソースの ID。 |
vsw-bp1upw03qyz8n7us9**** |
| ResourceArn |
string |
任意 |
共有リソースの Alibaba Cloud リソースネーム (ARN)。 |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| MaxResults |
integer |
任意 |
1 回のリクエストで返すエントリの最大数。 有効値: 1~100。デフォルト値: 20。 |
20 |
| NextToken |
string |
任意 |
レスポンスが切り捨てられた場合、 |
TGlzdFJlc291cm**** |
| ResourceShareIds |
array |
任意 |
共有ユニットの ID。 N の値は 1 から 5 までです。最大 5 つの共有ユニット ID を指定できます。 |
rs-6GRmdD3X**** |
|
string |
任意 |
共有ユニットの ID。 N の値は 1 から 5 までです。最大 5 つの共有ユニット ID を指定できます。 |
rs-6GRmdD3X**** |
|
| Targets |
array |
任意 |
プリンシパル。 |
114240524784**** |
|
string |
任意 |
プリンシパル。有効値:
詳細については、「リソース共有の方法」、「リソースディレクトリの ID の表示」、「フォルダの ID の表示」、または「メンバーの ID の表示」をご参照ください。 N の値は 1 から 5 までです。一度に最大 5 つのプリンシパルを追加できます。 |
114240524784**** |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
レスポンスパラメーター。 |
||
| NextToken |
string |
レスポンスが切り捨てられた場合、 |
TGlzdFJlc291cm**** |
| RequestId |
string |
リクエスト ID。 |
04677DCA-7C33-464B-8811-1B1DA3C3D197 |
| SharedTargets |
array<object> |
プリンシパルに関する情報。 |
|
|
object |
プリンシパルに関する情報。 |
||
| TargetId |
string |
プリンシパルまたはリソース所有者の ID。有効値:
|
114240524784**** |
| UpdateTime |
string |
プリンシパルとの関連付けが更新された時刻。 |
2020-12-07T09:16:59.905Z |
| CreateTime |
string |
プリンシパルが関連付けられた時刻。 |
2020-12-07T09:16:59.905Z |
| ResourceShareId |
string |
共有ユニットの ID。 |
rs-6GRmdD3X**** |
| External |
boolean |
プリンシパルがリソースディレクトリ外のアカウントであるかどうかを示します。有効値:
|
false |
| TargetProperty |
string |
プリンシパルのプロパティ。たとえば、リソース共有の期間などです。 説明
このパラメーターは、プリンシパルが Alibaba Cloud サービスの場合にのみ返されます。 |
{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
例
成功レスポンス
JSONJSON
{
"NextToken": "TGlzdFJlc291cm****",
"RequestId": "04677DCA-7C33-464B-8811-1B1DA3C3D197",
"SharedTargets": [
{
"TargetId": "114240524784****",
"UpdateTime": "2020-12-07T09:16:59.905Z",
"CreateTime": "2020-12-07T09:16:59.905Z",
"ResourceShareId": "rs-6GRmdD3X****",
"External": false,
"TargetProperty": "{\n \"timeRange\":{\n \"timeRangeType\":\"timeRange\",\n \"beginAtTime\":\"00:00\",\n \"timezone\":\"UTC+8\",\n \"endAtTime\":\"19:59\"\n }\n}"
}
]
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | MissingParameter.ResourceOwner | You must specify ResourceOwner. | You must specify ResourceOwner. |
| 400 | InvalidParameter.ResourceOwner | The ResourceOwner is invalid. | The ResourceOwner is invalid. |
| 400 | InvalidParameter.ResourceType | The ResourceType is invalid. | The ResourceType is invalid. |
| 400 | InvalidParameter.MaxResults | The MaxResults is invalid. | The MaxResults is invalid. |
| 400 | InvalidParameter.NextToken | The NextToken is invalid. | The NextToken is invalid. |
| 400 | InvalidParameter.NextToken.Length | The maximum length of NextToken exceeds 256 characters. | The maximum length of NextToken exceeds 256 characters. |
| 400 | InvalidParameter.ResourceShareIds | The ResourceShareIds is invalid. | The ResourceShareIds is invalid. |
| 400 | InvalidParameter.ResourceShareIds.Duplicate | The ResourceShareIds contains duplicate values. | The ResourceShareIds contains duplicate values. |
| 400 | InvalidParameter.ResourceShareIds.Length | The maximum length of ResourceShareIds exceeds 5 characters. | The maximum length of ResourceShareIds exceeds 5 characters. |
| 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 | InvalidParameter.ResourceId | The ResourceId is invalid. | The ResourceId is invalid. |
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | InvalidParameter.ResourceArn | The ResourceArn is invalid. | |
| 400 | InvalidParameter.ResourceConflict | Both ResourceId and ResourceArn cannot be specified simultaneously. Please provide only one of these parameters. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。