All Products
Search
Document Center

Platform For AI:CreateServiceAutoScaler

Last Updated:Jun 11, 2026

Mengaktifkan fitur Autoscaler dan membuat pengontrol Autoscaler untuk layanan.

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

eas:CreateServiceAutoScaler

create

*Service

acs:eas:{#regionId}:{#accountId}:service/{#ServiceName}

None None

Sintaks permintaan

POST /api/v2/services/{ClusterId}/{ServiceName}/autoscaler HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

ID wilayah tempat layanan diterapkan.

cn-shanghai

ServiceName

string

Yes

Nama layanan. Untuk informasi selengkapnya tentang cara mengkueri nama layanan, lihat ListServices.

foo

Parameter permintaan

Parameter

Type

Required

Description

Example

body

object

No

Badan permintaan.

min

integer

Yes

The minimum number of instances in the service.

2

max

integer

Yes

The maximum number of instances in the service. The value of max must be greater than the value of min.

8

scaleStrategies

array<object>

Yes

The service for which the metric is specified. If you do not set this parameter, the current service is specified by default.

object

No

metricName

string

Yes

The name of the metric for triggering auto scaling. Valid values:

  • qps: the queries per second (qps) for an individual instance.

  • cpu: the cpu utilization.

  • gpu[util]: gpu utilization.

qps

threshold

number

Yes

The threshold of the metric that triggers auto scaling.

  • If you set metricName to qps, scale-out is triggered when the average qps for a single instance is greater than this threshold.

  • If you set metricName to cpu, scale-out is triggered when the average cpu utilization for a single instance is greater than this threshold.

  • If you set metricName to gpu, scale-out is triggered when the average gpu utilization for a single instance is greater than this threshold.

10

service

string

No

The service for which the metric is specified. If you do not set this parameter, the current service is specified by default.

demo_svc

behavior

object

No

The Autoscaler operation.

scaleUp

object

No

The scale-out operation.

stabilizationWindowSeconds

integer

No

The time window that is required before the scale-out operation is performed. The scale-out operation can be performed only if the specified metric exceeds the specified threshold in the specified time window. Default value: 0.

0

scaleDown

object

No

The scale-in operation.

stabilizationWindowSeconds

integer

No

The time window that is required before the scale-in operation is performed. The scale-in operation can be performed only if the specified metric drops below the specified threshold in the specified time window. Default value: 300.

300

onZero

object

No

The operation that reduces the number of instances to 0.

scaleDownGracePeriodSeconds

integer

No

The time window that is required before the number of instances is reduced to 0. The number of instances can be reduced to 0 only if no request is available or no traffic exists in the specified time window. Default value: 600.

600

scaleUpActivationReplicas

integer

No

The number of instances that you want to create at a time if the number of instances is 0. Default value: 1.

1

Elemen respons

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

40325405-579C-4D82****

Message

string

The returned message.

Succeed to auto scale service [foo]

Contoh

Respons sukses

JSONformat

{
  "RequestId": "40325405-579C-4D82****",
  "Message": "Succeed to auto scale service [foo]"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.