All Products
Search
Document Center

Resource Orchestration Service:GetStackInstance

Last Updated:Jun 10, 2026

Mengkueri informasi tentang Instans tumpukan yang terkait dengan Grup tumpukan.

Deskripsi operasi

In this example, the information about a stack instance associated with a stack group named MyStackGroup is queried. The stack instance is deployed in the China (Beijing) region within the 151266687691**** Alibaba Cloud account. The stack group is granted self-managed permissions and deployed in the China (Hangzhou) region.

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

ros:GetStackInstance

get

*StackInstance

acs:ros:{#regionId}:{#accountId}:stackinstance/{#StackGroupName}/{#StackInstanceAccountId}/{#StackInstanceRegionId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID Wilayah Grup tumpukan. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah terbaru.

cn-hangzhou

StackGroupName

string

Yes

Nama Grup tumpukan. Nama harus unik dalam suatu wilayah.
Nama dapat memiliki panjang hingga 255 karakter, dan dapat berisi digit, huruf, tanda hubung (-), dan garis bawah (_). Harus diawali dengan digit atau huruf.

MyStackGroup

StackInstanceAccountId

string

Yes

ID akun tujuan tempat stack berada.

  • Jika Grup tumpukan diberi izin yang dikelola sendiri, stack milik akun Alibaba Cloud.

  • Jika Grup tumpukan diberi izin yang dikelola layanan, stack milik anggota dalam Direktori sumber daya.

Catatan

Untuk informasi selengkapnya tentang akun tujuan, lihat Ikhtisar.

151266687691****

StackInstanceRegionId

string

Yes

ID Wilayah stack.

cn-beijing

OutputOption

string

No

Apakah akan mengembalikan parameter Outputs. Parameter Outputs menentukan output stack. Nilai valid:

  • Enabled: mengembalikan parameter Outputs.

  • Disabled (default): tidak mengembalikan parameter Outputs.

Catatan

Parameter Outputs memerlukan pengatur waktu yang lama untuk dihitung. Jika Anda tidak memerlukan output stack, atur OutputOption ke Disabled untuk meningkatkan kecepatan tanggapan Operasi API.

Disabled

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

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The request ID.

B8A6B693-82C8-419D-8796-DE99EC33CFF9

StackInstance

object

The information about the stack.

Status

string

The state of the stack.

Valid values:

  • CURRENT: The stack is up-to-date with the stack group.

  • OUTDATED: The stack is not up-to-date with the stack group. Stacks are in the OUTDATED state due to the following possible reasons:

    • When the CreateStackInstances operation is called to create stacks, the stacks fail to be created.

    • When the UpdateStackInstances or UpdateStackGroup operation is called to update stacks, the stacks fail to be updated, or only specific stacks are updated.

    • The creation or update operation is not complete.

CURRENT

StackGroupId

string

The ID of the stack group.

fd0ddef9-9540-4b42-a464-94f77835****

StackId

string

The stack ID.

Catatan

This parameter is returned only if the stack is in the CURRENT state.

35ad60e3-6a92-42d8-8812-f0700d45****

DriftDetectionTime

string

The time when the most recent successful drift detection was performed on the stack group.

Catatan

This parameter is returned only if drift detection is performed on the stack group.

2020-02-27T07:47:47

StackDriftStatus

string

The state of the stack when the most recent successful drift detection was performed on the stack group.

Valid values:

  • DRIFTED: The stack has drifted.

  • NOT_CHECKED: No successful drift detection is performed on the stack.

  • IN_SYNC: The stack is being synchronized.

Catatan

This parameter is returned only if drift detection is performed on the stack group.

IN_SYNC

StatusReason

string

The reason why the stack instance is in the OUTDATED state.

Catatan

This parameter is returned only if the stack instance is in the OUTDATED state.

User initiated stop

ParameterOverrides

array<object>

The parameters that are used to override specific parameters.

object

ParameterKey

string

The name of the parameter that is used to override a specific parameter.

Amount

ParameterValue

string

The value of the parameter that is used to override a specific parameter.

1

StackGroupName

string

The name of the stack group.

MyStackGroup

AccountId

string

The ID of the destination account to which the stack belongs.

151266687691****

RegionId

string

The region ID of the stack.

cn-beijing

RdFolderId

string

The ID of the folder in the resource directory.

Catatan

This parameter is returned only if the stack group is granted service-managed permissions.

fd-4PvlVLOL8v

Outputs

array<object>

The outputs of the stack.

Catatan

This parameter is returned if OutputOption is set to Enabled.

object

The output of the stack.

Catatan

This parameter is returned if OutputOption is set to Enabled.

[{'OutputKey': 'rds_connection_string', 'OutputValue': 'rm-gw868n4lzy0i7kzx3.mysql.germany.rds.aliyuncs.com'}]

Contoh

Respons sukses

JSONformat

{
  "RequestId": "B8A6B693-82C8-419D-8796-DE99EC33CFF9",
  "StackInstance": {
    "Status": "CURRENT",
    "StackGroupId": "fd0ddef9-9540-4b42-a464-94f77835****",
    "StackId": "35ad60e3-6a92-42d8-8812-f0700d45****",
    "DriftDetectionTime": "2020-02-27T07:47:47",
    "StackDriftStatus": "IN_SYNC",
    "StatusReason": "User initiated stop",
    "ParameterOverrides": [
      {
        "ParameterKey": "Amount",
        "ParameterValue": "1"
      }
    ],
    "StackGroupName": "MyStackGroup",
    "AccountId": "151266687691****",
    "RegionId": "cn-beijing",
    "RdFolderId": "fd-4PvlVLOL8v",
    "Outputs": [
      {
        "test": "test",
        "test2": 1
      }
    ]
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.