All Products
Search
Document Center

Resource Management:ListResourceShareInvitations

Last Updated:Jun 10, 2026

Mengkueri undangan berbagi sumber daya yang Anda terima.

Deskripsi operasi

Usage notes

This topic provides an example of how to query the resource sharing invitations for the current account in the cn-hangzhou region. The response shows one invitation that is in the Pending state.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

resourcesharing:ListResourceShareInvitations

list

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

MaxResults

integer

No

Jumlah maksimum entri yang dikembalikan untuk satu permintaan.

Nilai valid: 1 hingga 100. Nilai default: 20.

20

NextToken

string

No

Token paginasi yang digunakan di permintaan berikutnya untuk mengambil halaman hasil baru. Jika tanggapan terpotong, Anda dapat menggunakan token ini untuk memulai permintaan lain dan mengambil entri yang tersisa.

TGlzdFJlc291cm****

ResourceShareIds

array

No

ID bagian sumber daya.

string

No

The ID of the resource share.

rs-ysGRci9z****

ResourceShareInvitationIds

array

No

ID undangan berbagi sumber daya.

string

No

The ID of the resource sharing invitation.

i-p6eRytrkjVvM****

Untuk informasi selengkapnya tentang parameter permintaan umum, lihat Parameter umum.

Elemen respons

Element

Type

Description

Example

object

The response parameters.

NextToken

string

The pagination token that is used in the next request to retrieve a new page of results. If the response is truncated, you can use this token to initiate another request and retrieve the remaining entries.

TGlzdFJlc291cm****

RequestId

string

The request ID.

30EC8328-1BDE-51D5-BFAB-039508BD91A1

ResourceShareInvitations

array<object>

The information about the resource sharing invitations.

array<object>

The information about the resource sharing invitation.

Status

string

The status of the invitation. Valid values:

  • Pending: The invitation is pending confirmation.

  • Accepted: The invitation is accepted.

  • Cancelled: The invitation is canceled.

  • Rejected: The invitation is rejected.

  • Expired: The invitation is expired.

  • AcceptFailed: The invitation failed to be accepted.

Pending

CreateTime

string

The time when the invitation was created. The time is displayed in UTC.

2022-08-18T05:36:45.024Z

ResourceShareId

string

The ID of the resource share.

rs-ysGRci9z****

ResourceShareName

string

The name of the resource share.

example

SenderAccountId

string

The ID of the Alibaba Cloud account that sent the invitation.

151266687691****

ReceiverAccountId

string

The ID of the Alibaba Cloud account that received the invitation.

134254031178****

ResourceShareInvitationId

string

The ID of the resource sharing invitation.

i-p6eRytrkjVvM****

InvitationFailedDetails

array<object>

The information about the failure.

object

The information about the failure.

Status

string

This parameter is deprecated. Use FailureReason instead.

None

StatusMessage

string

This parameter is deprecated. Use FailureDescription instead.

None

AssociateType

string

This parameter is deprecated. Use OperationType instead.

None

ResourceArn

string

The Alibaba Cloud Resource Name (ARN) of the shared resource.

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

ResourceType

string

The type of the shared resource.

For more information about the types of resources that can be shared, see Services that work with Resource Sharing.

Snapshot

FailureReason

string

The failure cause. Valid values:

  • Unavailable: The resource cannot be shared.

  • LimitExceeded: The number of shared resources within the Alibaba Cloud account exceeds the upper limit.

  • ZonalResourceInaccessible: The resource is inaccessible in this region.

  • InternalError: An internal error occurred on the server during the check.

  • UnsupportedOperation: The operation is not supported.

Unavailable

FailureDescription

string

The failure description.

You cannot access the specified resource at this time.

OperationType

string

The operation type. Valid values:

  • Associate

  • Disassociate

Associate

ResourceId

string

The ID of the shared resource.

s-7xvh46nx5oqlre0wv***

Contoh

Respons sukses

JSONformat

{
  "NextToken": "TGlzdFJlc291cm****",
  "RequestId": "30EC8328-1BDE-51D5-BFAB-039508BD91A1",
  "ResourceShareInvitations": [
    {
      "Status": "Pending",
      "CreateTime": "2022-08-18T05:36:45.024Z",
      "ResourceShareId": "rs-ysGRci9z****",
      "ResourceShareName": "example",
      "SenderAccountId": "151266687691****",
      "ReceiverAccountId": "134254031178****",
      "ResourceShareInvitationId": "i-p6eRytrkjVvM****",
      "InvitationFailedDetails": [
        {
          "Status": "None",
          "StatusMessage": "None",
          "AssociateType": "None",
          "ResourceArn": "acs:vpc:cn-shanghai:103755469187****:vswitch/vsw-uf62b11ue4m8oz2di****",
          "ResourceType": "Snapshot",
          "FailureReason": "Unavailable",
          "FailureDescription": "You cannot access the specified resource at this time.",
          "OperationType": "Associate",
          "ResourceId": "s-7xvh46nx5oqlre0wv***"
        }
      ]
    }
  ]
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidParameter.MaxResults The MaxResults is invalid. The MaxResults parameter is invalid.
400 InvalidParameter.NextToken The NextToken is invalid. The NextToken parameter is invalid.
400 InvalidParameter.NextToken.Length The maximum length of NextToken exceeds 256 characters. The length of NextToken cannot exceed 256 characters.
400 InvalidParameter.ResourceShareIds The ResourceShareIds is invalid. The ResourceShareIds parameter is invalid.
400 InvalidParameter.ResourceShareIds.Duplicate The ResourceShareIds contains duplicate values. The ResourceShareIds parameter contains duplicate values.
400 InvalidParameter.ResourceShareIds.Length The maximum length of ResourceShareIds exceeds 5 characters. The number of ResourceShareIds values cannot exceed 5.
400 InvalidParameter.ResourceShareInvitationIds The ResourceShareInvitationIds is invalid. The value of ResourceShareInvitationIds is invalid.
400 InvalidParameter.ResourceShareInvitationIds.Duplicate The ResourceShareInvitationIds duplicate values. ResourceShareInvitationIds is already configured.
400 InvalidParameter.ResourceShareInvitationIds.Length The maximum length of ResourceShareInvitationIds exceeds quota limit. The length of the value specified for ResourceShareInvitationIds exceeds the limit.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.