Menampilkan daftar resource atau pihak yang berwenang yang terkait dengan bagian sumber daya.
Deskripsi operasi
This example shows how to query for association records of Shared Resources within Resource Shares created by the current account in the China (Hangzhou) Region. The response shows records for the following two Shared Resources:
-
A
VSwitchShared Resource,vsw-bp1upw03qyz8n7us9****, was associated with the Resource Sharers-6GRmdD3X****. The resource is in theAssociatedstate, meaning it is actively shared. -
A
VSwitchShared Resource,vsw-bp183p93qs667muql****, was disassociated from the Resource Sharers-6GRmdD3X****. The resource is in theDisassociatedstate, meaning it is no longer shared.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcesharing:ListResourceShareAssociations |
list |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceId |
string |
No |
ID Sumber daya. Catatan
Parameter ini tidak tersedia ketika |
vsw-bp183p93qs667muql**** |
| ResourceArn |
string |
No |
Nama Sumber Daya Alibaba Cloud (ARN) resource. Catatan
Parameter ini tidak tersedia ketika |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| Target |
string |
No |
ID pihak yang berwenang. Catatan
Parameter ini tidak tersedia ketika |
172050525300**** |
| AssociationType |
string |
Yes |
Tipe asosiasi. Nilai valid:
|
Resource |
| AssociationStatus |
string |
No |
Status asosiasi. Nilai valid:
Catatan
Sistem secara otomatis menghapus record dalam status |
Associated |
| MaxResults |
integer |
No |
Jumlah maksimum entri yang dikembalikan per halaman. Nilai valid: 1 hingga 100. Nilai default: 20. |
20 |
| NextToken |
string |
No |
Token untuk halaman hasil berikutnya. Jika tanggapan sebelumnya terpotong, sertakan |
TGlzdFJlc291cm**** |
| ResourceShareIds |
array |
No |
ID bagian sumber daya. Anda dapat menentukan hingga 5 ID bagian sumber daya. |
rs-6GRmdD3X**** |
|
string |
No |
A resource share ID. |
rs-6GRmdD3X**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| NextToken |
string |
The token to retrieve the next page of results. |
TGlzdFJlc291cm**** |
| RequestId |
string |
The ID of the request. |
11BA57B5-7301-4E2F-BBA5-2AE4C2F4FCDB |
| ResourceShareAssociations |
array<object> |
A list of associations. |
|
|
array<object> |
Details of the association. |
||
| UpdateTime |
string |
The time the association was last updated.
|
2020-12-07T07:39:02.920Z |
| EntityId |
string |
The ID of the associated entity.
|
vsw-bp1upw03qyz8n7us9**** |
| ResourceArn |
string |
The Alibaba Cloud Resource Name (ARN) of the associated resource. Catatan
Returned only if |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| ResourceShareName |
string |
The name of the resource share. |
example |
| CreateTime |
string |
The time the association was created.
|
2020-12-07T07:39:01.818Z |
| EntityType |
string |
The type of the associated entity.
|
VSwitch |
| ResourceShareId |
string |
The ID of the resource share. |
rs-6GRmdD3X**** |
| AssociationStatusMessage |
string |
The reason for the failed association. |
The reason for the association failure. |
| AssociationType |
string |
The type of the association. Valid values:
|
Resource |
| AssociationStatus |
string |
The status of the association. Valid values:
Catatan
The system automatically deletes associations in the |
Failed |
| External |
boolean |
Indicates whether the principal is an Alibaba Cloud Account that is not a member of your Resource Directory. Valid values:
|
false |
| AssociationFailedDetails |
array<object> |
Details of a failed association or disassociation. |
|
|
object |
Details of the failed operation. |
||
| Status |
string |
This parameter is deprecated. Use FailureReason instead. |
无 |
| StatusMessage |
string |
This parameter is deprecated. Use FailureDescription instead. |
无 |
| AssociateType |
string |
This parameter is deprecated. Use OperationType instead. |
无 |
| ResourceArn |
string |
The ARN of the associated resource. Catatan
This parameter is unavailable when |
acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di**** |
| EntityType |
string |
The type of the associated entity. Valid values:
|
Account |
| FailureReason |
string |
The reason why the association or disassociation failed. Valid values:
|
Unavailable |
| FailureDescription |
string |
A detailed description of the failure. |
You cannot access the specified resource at this time. |
| OperationType |
string |
The operation type. Valid values:
|
Associate |
| EntityId |
string |
The ID of the associated entity. Valid values:
|
172050525300**** |
| TargetProperty |
string |
The properties of the principal, such as the time period for resource sharing. Valid values for
Catatan
Returned only if the principal is an Alibaba Cloud service. |
{ "timeRange":{ "timeRangeType":"timeRange", "beginAtTime":"00:00", "timezone":"UTC+8", "endAtTime":"19:59" } } |
| ResourceProperty |
string |
The sharing-related properties of the resource. |
{"sharePrincipals":true,"shareTagOptions":false} |
Contoh
Respons sukses
JSONformat
{
"NextToken": "TGlzdFJlc291cm****",
"RequestId": "11BA57B5-7301-4E2F-BBA5-2AE4C2F4FCDB",
"ResourceShareAssociations": [
{
"UpdateTime": "2020-12-07T07:39:02.920Z",
"EntityId": "vsw-bp1upw03qyz8n7us9****",
"ResourceArn": "acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****",
"ResourceShareName": "example",
"CreateTime": "2020-12-07T07:39:01.818Z",
"EntityType": "VSwitch",
"ResourceShareId": "rs-6GRmdD3X****",
"AssociationStatusMessage": "The reason for the association failure. ",
"AssociationType": "Resource",
"AssociationStatus": "Failed",
"External": false,
"AssociationFailedDetails": [
{
"Status": "无",
"StatusMessage": "无",
"AssociateType": "无",
"ResourceArn": "acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****",
"EntityType": "Account",
"FailureReason": "Unavailable",
"FailureDescription": "You cannot access the specified resource at this time.",
"OperationType": "Associate",
"EntityId": "172050525300****"
}
],
"TargetProperty": "{\n \"timeRange\":{\n \"timeRangeType\":\"timeRange\",\n \"beginAtTime\":\"00:00\",\n \"timezone\":\"UTC+8\",\n \"endAtTime\":\"19:59\"\n }\n}",
"ResourceProperty": "{\"sharePrincipals\":true,\"shareTagOptions\":false}"
}
]
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter.AssociationType | You must specify AssociationType. | |
| 400 | InvalidParameter.AssociationType | The AssociationType is invalid. | |
| 400 | InvalidParameter.AssociationStatus | The AssociationStatus is invalid. | |
| 400 | InvalidParameter.MaxResults | The MaxResults is invalid. | |
| 400 | InvalidParameter.NextToken | The NextToken is invalid. | |
| 400 | InvalidParameter.NextToken.Length | The maximum length of NextToken exceeds 256 characters. | |
| 400 | InvalidParameter.ResourceShareIds | The ResourceShareIds is invalid. | |
| 400 | InvalidParameter.ResourceShareIds.Duplicate | The ResourceShareIds contains duplicate values. | |
| 400 | InvalidParameter.ResourceShareIds.Length | The maximum length of ResourceShareIds exceeds 5 characters. | |
| 400 | InvalidParameter.Target | The Target is invalid. | |
| 400 | InvalidParameter.ResourceId | The ResourceId is invalid. | |
| 400 | ConflictedAssociationType | The specified ResourceId or Target conflicts with AssociationType. | |
| 400 | InvalidParameter | 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. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.