查詢資源使用者列表。
介面說明
如果您是資源所有者,您可以查詢您把資源共用給了哪些資源使用者。 如果您是資源使用者,您可以查詢您參與了哪些資源共用。
本文將提供一個樣本,在cn-hangzhou地區,查詢您發起的資源共用的資源使用者列表。返回結果顯示,您將資源共用給了資源使用者114240524784****和172050525300****。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
resourcesharing:ListSharedTargets |
list |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ResourceOwner |
string |
是 |
共用單元歸屬者。
|
Self |
| ResourceType |
string |
否 |
共用資源類型。 支援共用的資源類型,請參見支援資源共用的雲端服務。 |
VSwitch |
| ResourceId |
string |
否 |
共用資源 ID。 |
vsw-bp1upw03qyz8n7us9**** |
| ResourceArn |
string |
否 |
共用資源 ARN。 |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| MaxResults |
integer |
否 |
單次請求返回結果的最大條數。 取值範圍:1~100。預設值:20。 |
20 |
| NextToken |
string |
否 |
當請求的返回結果被截斷時,您可以使用 |
TGlzdFJlc291cm**** |
| ResourceShareIds |
array |
否 |
共用單元 ID。 N 的取值範圍:1~5,即每次最多指定 5 個共用單元。 |
rs-6GRmdD3X**** |
|
string |
否 |
共用單元 ID。 N 的取值範圍:1~5,即每次最多指定 5 個共用單元。 |
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 或資源所有者 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 |
資源使用者屬性。例如:資源共用的時間段。 說明
僅當資源使用者為阿里雲服務時返回該參數。 |
{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
樣本
正常返回樣本
JSON格式
{
"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 status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | MissingParameter.ResourceOwner | You must specify ResourceOwner. | ResourceOwner參數缺失。 |
| 400 | InvalidParameter.ResourceOwner | The ResourceOwner is invalid. | ResourceOwner參數錯誤。 |
| 400 | InvalidParameter.ResourceType | The ResourceType is invalid. | 傳入的資源類型錯誤。 |
| 400 | InvalidParameter.MaxResults | The MaxResults is invalid. | MaxResults參數錯誤。 |
| 400 | InvalidParameter.NextToken | The NextToken is invalid. | NextToken參數錯誤。 |
| 400 | InvalidParameter.NextToken.Length | The maximum length of NextToken exceeds 256 characters. | NextToken長度超限(最大256個字元)。 |
| 400 | InvalidParameter.ResourceShareIds | The ResourceShareIds is invalid. | ResourceShareIds參數錯誤。 |
| 400 | InvalidParameter.ResourceShareIds.Duplicate | The ResourceShareIds contains duplicate values. | ResourceShareIds有重複項。 |
| 400 | InvalidParameter.ResourceShareIds.Length | The maximum length of ResourceShareIds exceeds 5 characters. | ResourceShareIds長度超限(最大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. | 資源使用者數量超限(最大5個)。 |
| 400 | InvalidParameter.ResourceId | The ResourceId is invalid. | ResourceId參數錯誤。 |
| 400 | InvalidParameter | The specified parameter is invalid. | 參數無效。 |
| 400 | InvalidParameter.ResourceArn | The ResourceArn is invalid. | 資源ARN參數無效。 |
| 400 | InvalidParameter.ResourceConflict | Both ResourceId and ResourceArn cannot be specified simultaneously. Please provide only one of these parameters. | ResourceId 和 ResourceArn 不能同時指定。請僅提供其中一個參數。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。