Memperbarui konfigurasi penskalaan otomatis terjadwal untuk layanan.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eas:UpdateServiceCronScaler |
update |
*Service
|
None | None |
Sintaks permintaan
PUT /api/v2/services/{ClusterId}/{ServiceName}/cronscaler HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
ID wilayah tempat layanan berada. |
cn-shanghai |
| ServiceName |
string |
Yes |
Nama layanan. Untuk informasi selengkapnya, lihat ListServices. |
foo |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
Badan permintaan. |
|
| ScaleJobs |
array<object> |
Yes |
The scheduled scaling tasks. |
|
|
object |
No |
|||
| TargetSize |
integer |
Yes |
The target number of instances for the scaling task. |
2 |
| Schedule |
string |
Yes |
The cron expression that specifies when to run the scaling task. For more information about cron expressions, see the Cron expressions section in this topic. |
0 18 * * * * |
| Name |
string |
No |
The name of the scheduled auto scaling task. |
scale-job-1 |
| TimeZone |
string |
No |
The time zone for the cron expression. |
Asia/Shanghai |
| ExcludeDates |
array |
No |
The cron expressions for the dates to exclude from the schedule. |
|
|
string |
No |
A cron expression. For more information, see the Cron expressions section in this topic. |
* * * * * 0,6 |
Ekspresi cron

| Nama | Nilai yang diizinkan | Karakter khusus yang diizinkan |
| Detik | 0-59 | * / , - |
| Menit | 0-59 | * / , - |
| Jam | 0-23 | * / , - |
| Hari dalam sebulan | 1-31 | * / , - |
| Bulan | 1-12 atau JAN-DEC | * / , - |
| Hari dalam seminggu | 0-6 atau SUN-SAT | * / , - |
Karakter khusus
Asterisk (*) Asterisk (*) mewakili semua nilai dalam sebuah bidang. Misalnya, 0 0 0 1 * * berarti pada pukul 00:00 di hari pertama setiap bulan.
Hyphen (-) Hyphen (-) menentukan rentang nilai. Misalnya, 0 0 12-14 * * * berarti pada pukul 12:00, 13:00, dan 14:00 setiap hari.
Comma (,) Comma (,) memisahkan nilai individual. Misalnya, 0 0 12,14 * * * berarti pada pukul 12:00 dan 14:00 setiap hari.
Slash (/) Slash (/) menentukan penambahan. Misalnya, 0 */15 * * * * berarti pada menit ke-0, 15, 30, dan 45 setiap jam. Anda dapat menggunakan slash (/) dengan hyphen (-). Misalnya, 0 5-40/15 * * * * berarti setiap 15 menit antara menit ke-5 dan ke-40 setiap jam. Tugas berjalan pada menit ke-5, 20, dan 35 setiap jam.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| RequestId |
string |
The request ID. |
40325405-579C-4D82**** |
| Message |
string |
The returned message. |
Update cron scaler for service [foo] successfully |
Contoh
Respons sukses
JSONformat
{
"RequestId": "40325405-579C-4D82****",
"Message": "Update cron scaler for service [foo] successfully"
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.