All Products
Search
Document Center

Elastic Compute Service:DescribeReservedInstances

Last Updated:Jun 12, 2026

Mengkueri daftar Instans terjadwal yang Anda beli di wilayah tertentu. Mendukung pengambilan informasi detail Instans terjadwal berdasarkan parameter seperti tag dan atribut Instans terjadwal.

Deskripsi operasi

Kasus penggunaan

  • Mengkueri semua Instans terjadwal di wilayah tertentu.

  • Mengkueri informasi detail Instans terjadwal berdasarkan ID atau nama Instans terjadwal.

  • Memfilter dan mengkueri Instans terjadwal yang dibeli berdasarkan tipe instans atau keluarga instans.

  • Memfilter dan mengkueri Instans terjadwal yang dibeli berdasarkan cakupan (dalam OAuth) atau status Instans terjadwal.

Contoh permintaan

Contoh: Mengkueri semua Instans terjadwal yang dibeli di wilayah Hangzhou

"Region":"cn-hangzhou" //Set the region to Hangzhou

Contoh: Mengkueri informasi detail Instans terjadwal dengan ID ecsri-bp129enntoynwwj5**** di wilayah Hangzhou

"Region":"cn-hangzhou", //Set the region to Hangzhou
"ReservedInstanceId":"ecsri-bp129enntoynwwj5****" //Set the reserved instance ID

Contoh: Mengkueri Instans terjadwal di wilayah Hangzhou yang dapat Offset tipe instans ecs.c5.2xlarge

"Region":"cn-hangzhou", //Set the region to Hangzhou
"InstanceType":"ecs.c5.2xlarge" //Set the instance type

Contoh: Mengkueri Instans terjadwal tingkat wilayah yang sedang berlaku di wilayah Hangzhou

"Region":"cn-hangzhou", //Set the region to Hangzhou
"Scope":"Region", //Set the reserved instance scope
"Status":["Active"] //Set the status to in effect

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

ecs:DescribeReservedInstances

get

ReservedInstance

acs:ecs:{#regionId}:{#accountId}:reservedinstance/*

ReservedInstance

acs:ecs:{#regionId}:{#accountId}:reservedinstance/{#reservedinstanceId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID wilayah Instans terjadwal. Anda dapat memanggil DescribeRegions untuk mendapatkan daftar wilayah Alibaba Cloud terbaru.

cn-hangzhou

PageNumber

integer

No

Nomor halaman daftar Instans terjadwal. Nilai awal: 1.

Nilai default: 1.

1

PageSize

integer

No

Jumlah baris per halaman dalam kueri terpaginasi. Nilai maksimum: 100.

Nilai default: 10.

50

Tag

array<object>

No

Array tag. Panjang array: 1 hingga 20.

object

No

Tag.

Key

string

No

Kunci tag Instans terjadwal. String kosong tidak diperbolehkan. Mendukung hingga 128 karakter. Tidak dapat dimulai dengan aliyun atau acs:, dan tidak dapat mengandung http:// atau https://.

Catatan

Saat menggunakan satu tag untuk memfilter Sumber daya, jumlah Sumber daya yang dikueri di bawah tag ini tidak boleh melebihi 1.000. Saat menggunakan beberapa tag untuk memfilter Sumber daya, jumlah Sumber daya yang terikat ke beberapa tag secara bersamaan tidak boleh melebihi 1.000. Jika jumlah Sumber daya melebihi 1.000, gunakan API ListTagResources untuk mengkueri.

TestKey

Value

string

No

Nilai tag Instans terjadwal. String kosong tidak diperbolehkan. Mendukung hingga 128 karakter. Tidak dapat dimulai dengan acs:, dan tidak dapat mengandung http:// atau https://.

TestValue

RegionId

string

Yes

The region ID of the reserved instance. You can call DescribeRegions to obtain the latest Alibaba Cloud region list.

cn-hangzhou

ZoneId

string

No

ID zona instans. Parameter ini berlaku dan wajib diisi ketika Scope diatur ke Zone. Anda dapat memanggil DescribeZones untuk mendapatkan daftar zona.

cn-hangzhou-z

ReservedInstanceName

string

No

Nama Instans terjadwal.

Catatan

Pencocokan tepat. Pemfilteran kueri fuzzy saat ini tidak didukung.

testReservedInstanceName

LockReason

string

No

Tipe penguncian. Nilai valid:

  • financial: Akun menunggak pembayaran atau layanan telah kedaluwarsa.

  • security: Alasan keamanan.

security

InstanceType

string

No

Tipe instans yang sesuai dengan Instans terjadwal. Untuk nilai, lihat Instance Family.

Catatan

Tipe instans yang dipilih saat membeli Instans terjadwal. Selama Offset aktual, Instans terjadwal tingkat wilayah mendukung Offset konversi antar ukuran berbeda dalam keluarga instans yang sama.

ecs.g5.large

InstanceTypeFamily

string

No

Keluarga instans yang sesuai dengan Instans terjadwal. Untuk nilai, lihat Instance Family.

ecs.g5

Scope

string

No

Cakupan (dalam OAuth) Instans terjadwal. Nilai valid:

  • Region: Tingkat wilayah.

  • Zone: Tingkat zona.

Region

OfferingType

string

No

Tipe pembayaran Instans terjadwal. Nilai valid:

  • No Upfront: Tanpa pembayaran di muka.

  • Partial Upfront: Pembayaran di muka sebagian.

  • All Upfront: Pembayaran di muka penuh.

All Upfront

AllocationType

string

No

Tipe alokasi. Nilai valid:

  • Normal: Mengkueri Instans terjadwal di bawah akun saat ini.

  • Shared: Mengkueri Instans terjadwal di bawah akun saat ini yang telah dibagikan antara akun utama dan sub-akun.

Nilai default: Normal.

Normal

ReservedInstanceId

array

No

Array ID Instans terjadwal. Panjang array: 1 hingga 100.

ri-bpzhex2ulpzf53****

string

No

ID Instans terjadwal.

ri-bpzhex2ulpzf53****

Status

array

No

Array status Instans terjadwal.

Active

string

No

Status Instans terjadwal. Nilai valid:

  • Creating: Sedang dibuat.

  • Active: Sedang berlaku.

  • Retired: Tidak valid.

  • Updating: Atribut Instans terjadwal sedang diubah.

  • Expired: Kedaluwarsa. Instans terjadwal menjadi tidak valid segera setelah kedaluwarsa. Nilai ini saat ini tidak digunakan lagi dan akan dihapus nanti.

Active

Elemen respons

Element

Type

Description

Example

object

PageSize

integer

Jumlah baris per halaman yang diatur di input.

1

RequestId

string

ID permintaan.

E572643C-6A29-49D6-9D4E-6CFA4E063A3E

PageNumber

integer

Nomor halaman daftar Instans terjadwal.

1

TotalCount

integer

Jumlah total Instans terjadwal.

1

ReservedInstances

object

ReservedInstance

array<object>

Daftar informasi detail Instans terjadwal.

array<object>

Informasi detail Instans terjadwal.

Status

string

The status.

Active

CreationTime

string

The creation time.

2018-12-10T12:07Z

ReservedInstanceName

string

The name.

riZbpzhex2ulpzf53****

ReservedInstanceId

string

The reserved instance ID.

ri-bpzhex2ulpzf53****

InstanceType

string

The instance type of the pay-as-you-go instances that can be matched to the reserved instance.

ecs.g5.large

InstanceAmount

integer

The number of pay-as-you-go instances that are of the same instance type as the reserved instance and can be matched to the reserved instance.

10

RegionId

string

The region ID.

cn-hangzhou

OfferingType

string

The payment option.

All Upfront

StartTime

string

The effective time.

2018-12-10T12:00Z

Description

string

The description.

testDescription

AllocationStatus

string

Indicates the sharing status of the reserved instance when the AllocationType parameter is set to Shared. Valid values:

  • allocated: The reserved instance is allocated to another account.

  • beAllocated: The reserved instance is allocated by another account.

allocated

ExpiredTime

string

The expiration time.

2019-12-10T12:07Z

ResourceGroupId

string

The resource group ID.

EcsDocTest

ZoneId

string

The zone ID.

cn-hangzhou-z

Platform

string

The operating system of the image used by the instance. Valid values:

  • Windows

  • Linux

Linux

Scope

string

The scope.

region

OperationLocks

object

OperationLock

array<object>

Details about the lock status of the reserved instance.

object

Details about the lock status of the reserved instance.

LockReason

string

The reason why the instance is locked.

security

Tags

object

Tag

array<object>

The tags of the reserved instance.

object

The tag of the reserved instance.

TagValue

string

The tag value.

TestValue

TagKey

string

The tag key.

TestKey

Contoh

Respons sukses

JSONformat

{
  "PageSize": 1,
  "RequestId": "E572643C-6A29-49D6-9D4E-6CFA4E063A3E",
  "PageNumber": 1,
  "TotalCount": 1,
  "ReservedInstances": {
    "ReservedInstance": [
      {
        "Status": "Active",
        "CreationTime": "2018-12-10T12:07Z",
        "ReservedInstanceName": "riZbpzhex2ulpzf53****",
        "ReservedInstanceId": "ri-bpzhex2ulpzf53****",
        "InstanceType": "ecs.g5.large",
        "InstanceAmount": 10,
        "RegionId": "cn-hangzhou",
        "OfferingType": "All Upfront",
        "StartTime": "2018-12-10T12:00Z",
        "Description": "testDescription",
        "AllocationStatus": "allocated",
        "ExpiredTime": "2019-12-10T12:07Z",
        "ResourceGroupId": "EcsDocTest",
        "ZoneId": "cn-hangzhou-z",
        "Platform": "Linux",
        "Scope": "region",
        "OperationLocks": {
          "OperationLock": [
            {
              "LockReason": "security"
            }
          ]
        },
        "Tags": {
          "Tag": [
            {
              "TagValue": "TestValue",
              "TagKey": "TestKey"
            }
          ]
        }
      }
    ]
  }
}

Respons error

JSONformat

{
    "code":"200",
    "data":{
        "data":[
            {
                "CreationTime":"2018-12-10T12:07Z",
                "ExpiredTime":"2019-12-10T16:00Z",
                "InstanceAmount":1,
                "ReservedInstanceId":"ri-0xzhex2ulpzf53rxme2j",
                "InstanceType":"ecs.g5.large",
                "OfferingType":"All Upfront",
                "RegionId":"cn-hangzhou-test-307",
                "ReservedInstanceName":"riZ0xzhex2ulpzf53rxme2jZ",
                "Scope":"region",
                "StartTime":"2018-12-10T12:00Z",
                "Status":"active"
            }
        ],
        "PageNumber":1,
        "PageSize":50,
        "Total":1
    },
    "httpStatusCode":200,
    "message":"successful",
    "requestId":"E572643C-6A29-49D6-9D4E-6CFA4E063A3E",
    "success":true
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 MissingParamter.RegionId The regionId should not be null.
400 InvalidRegion.NotFound The specified parameter RegionId is not valid.
400 InvalidZone.NotFound The specified parameter ZoneId is not valid.
400 InvalidReservedInstanceOfferingType.ValueNotSupported the OfferingType is not supported
400 InvalidReservedInstanceOfferingClass.ValueNotSupported the OfferingClass is not supported
400 OperationDenied The specified InstanceType or Zone is not authorized for current user.
400 InvalidEndTime.ValueNotSupported The specified endTime is out of the permitted range.
400 InvalidReservedInstanceLockReason.ValueNotSupported The specified LockReason is not supported.
400 InvalidReservedInstanceStatus.ValueNotSupported The specified Status is not supported.
400 InvalidAllocationType.ValueNotSupported The specified AllocationType is not supported.
403 RAM.ApiNotSupported This call is not supported from ram accessing.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.