Memperbarui kebijakan penskalaan otomatis untuk aplikasi.
Deskripsi operasi
Usage notes
To scale an application beyond 50 instances, contact SAE technical support to be added to the allowlist. For details, see Contact us.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:UpdateApplicationScalingRule |
update |
*Application
|
None | None |
Sintaks permintaan
PUT /pop/v1/sam/scale/applicationScalingRule HTTP/1.1
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| AppId |
string |
Yes |
ID aplikasi. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| ScalingRuleName |
string |
Yes |
Nama kebijakan penskalaan otomatis. Nama harus diawali dengan huruf kecil, hanya boleh berisi huruf kecil, angka, dan tanda hubung (-), serta panjangnya tidak boleh lebih dari 32 karakter. Catatan
Anda tidak dapat mengubah nama kebijakan penskalaan otomatis setelah dibuat. |
timer-0800-2100 |
| ScalingRuleTimer |
string |
No |
Konfigurasi kebijakan penjadwalan penskalaan. Parameter ini wajib diisi untuk kebijakan penjadwalan penskalaan. Parameter ini mencakup bidang berikut:
|
{"beginDate":null,"endDate":null,"period":"* * *","schedules":[{"atTime":"08:00","targetReplicas":10},{"atTime":"20:00","targetReplicas":3}]} |
| ScalingRuleMetric |
string |
No |
Konfigurasi kebijakan penskalaan berbasis data deret waktu. Parameter ini wajib diisi untuk kebijakan penskalaan berbasis data deret waktu. Parameter ini mencakup bidang berikut:
Catatan
Jika Anda menentukan beberapa data deret waktu, penskalaan keluar akan dipicu ketika data deret waktu apa pun mencapai targetnya. Jumlah instans tidak akan melebihi maxReplicas. Penskalaan masuk hanya dipicu ketika semua data deret waktu berada di bawah targetnya. Jumlah instans tidak akan turun di bawah minReplicas. |
{"maxReplicas":3,"minReplicas":1,"metrics":[{"metricType":"CPU","metricTargetAverageUtilization":20},{"metricType":"MEMORY","metricTargetAverageUtilization":30},{"metricType":"tcpActiveConn","metricTargetAverageUtilization":20},{"metricType":"SLB_QPS","MetricTargetAverageUtilization":25,"slbId":"lb-xxx","slbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-************","slbLogstore":"function-log","vport":"80"},{"metricType":"SLB_RT","MetricTargetAverageUtilization":35,"slbId":"lb-xxx","slbProject":"aliyun-fc-cn-hangzhou-d95881d9-5d3c-5f26-a6b8-************","slbLogstore":"function-log","vport":"80"}],"scaleUpRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":0},"scaleDownRules":{"step":"100","disabled":false,"stabilizationWindowSeconds":300}} |
| MinReadyInstances |
integer |
No |
Jumlah minimum instans yang harus tetap tersedia selama penyebaran bergulir. Nilai valid:
Catatan
Untuk memastikan kelangsungan bisnis, atur jumlah minimum instans yang bertahan untuk setiap penyebaran bergulir ke 1 atau lebih tinggi. |
3 |
| MinReadyInstanceRatio |
integer |
No |
Persentase minimum instans yang harus tetap tersedia selama penyebaran bergulir. Nilai valid:
Catatan
Jika Anda menentukan MinReadyInstances dan MinReadyInstanceRatio, dan MinReadyInstanceRatio bukan -1, MinReadyInstanceRatio akan diutamakan. Misalnya, jika MinReadyInstances diatur ke 5 dan MinReadyInstanceRatio diatur ke 50, sistem akan menggunakan 50% untuk menghitung jumlah minimum instans yang bertahan. |
-1 |
| EnableIdle |
boolean |
No |
Apakah akan mengaktifkan mode idle. |
|
| ScalingRuleType |
string |
No |
弹性伸缩策略类型。取值说明如下:
Catatan
|
timing |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The returned information. |
||
| RequestId |
string |
The request ID. |
91F93257-7A4A-4BD3-9A7E-2F6EAE6D**** |
| TraceId |
string |
The trace ID used to query call details. |
0a98a02315955564772843261e**** |
| Data |
object |
The response data. |
|
| Timer |
object |
The configuration for scheduled scaling. |
|
| EndDate |
string |
The end date of the short-term scheduled scaling policy. The following rules apply:
|
2021-04-25 |
| BeginDate |
string |
The start date of the short-term scheduled scaling policy. The following rules apply:
|
2021-03-25 |
| Schedules |
array<object> |
The specific times each day the policy is triggered. |
|
|
object |
The details of a scheduled action. |
||
| AtTime |
string |
The trigger time in HH:mm format. |
08:00 |
| TargetReplicas |
integer |
The number of target instances. |
3 |
| MinReplicas |
integer |
The minimum number of instances. |
1 |
| MaxReplicas |
integer |
The maximum number of instances. |
10 |
| Period |
string |
The recurrence schedule for the scheduled scaling policy.
|
* * * |
| UpdateTime |
integer |
The time when the scaling policy was updated, in milliseconds. |
1616642248938 |
| AppId |
string |
The application ID. |
7171a6ca-d1cd-4928-8642-7d5cfe69**** |
| CreateTime |
integer |
The time when the scaling policy was created, in milliseconds. |
1616642248938 |
| LastDisableTime |
integer |
The time when the scaling policy was last disabled, in milliseconds. |
1641882854484 |
| ScaleRuleEnabled |
boolean |
Specifies whether the scaling policy is enabled. Valid values:
|
true |
| ScaleRuleType |
string |
The type of the scaling policy. Valid values:
|
timing |
| Metric |
object |
The configuration for metric-based scaling. |
|
| Metrics |
array<object> |
The list of metric-based scaling policies. |
|
|
object |
The metric data. |
||
| MetricTargetAverageUtilization |
integer |
The target value of the metric.
|
20 |
| MetricType |
string |
The metric that triggers the scaling policy. Valid values:
|
CPU |
| SlbProject |
string |
The SLB access log project. |
test |
| SlbLogstore |
string |
The Logstore for SLB access logs. |
test |
| Vport |
string |
The SLB port. |
80 |
| SlbId |
string |
The SLB instance ID. |
lb-xxx |
| MaxReplicas |
integer |
The maximum number of instances. |
3 |
| MinReplicas |
integer |
The minimum number of instances. |
1 |
| ScaleRuleName |
string |
The name of the scaling policy. |
test |
| EnableIdle |
boolean |
Specifies whether to enable idle mode. |
|
| Message |
string |
The response message.
|
success |
| ErrorCode |
string |
The error code.
|
|
| Code |
string |
The HTTP status code or a POP error code.
|
200 |
| Success |
boolean |
Specifies whether the request was successful. Valid values:
|
true |
Contoh
Respons sukses
JSONformat
{
"RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
"TraceId": "0a98a02315955564772843261e****",
"Data": {
"Timer": {
"EndDate": "2021-04-25",
"BeginDate": "2021-03-25",
"Schedules": [
{
"AtTime": "08:00",
"TargetReplicas": 3,
"MinReplicas": 1,
"MaxReplicas": 10
}
],
"Period": "* * *"
},
"UpdateTime": 1616642248938,
"AppId": "7171a6ca-d1cd-4928-8642-7d5cfe69****",
"CreateTime": 1616642248938,
"LastDisableTime": 1641882854484,
"ScaleRuleEnabled": true,
"ScaleRuleType": "timing",
"Metric": {
"Metrics": [
{
"MetricTargetAverageUtilization": 20,
"MetricType": "CPU",
"SlbProject": "test",
"SlbLogstore": "test",
"Vport": "80",
"SlbId": "lb-xxx"
}
],
"MaxReplicas": 3,
"MinReplicas": 1
},
"ScaleRuleName": "test",
"EnableIdle": false
},
"Message": "success",
"ErrorCode": "",
"Code": "200",
"Success": true
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidScalingRuleDate.BeginAfterEnd | The specified beginning time is later than the ending time. | |
| 400 | InvalidScalingRuleDate.Format | The specified date is invalid. | |
| 400 | InvalidScalingRuleName.NotFound | The specified ScalingRuleName does not exist. | |
| 400 | InvalidScalingRuleTime.Conflict | The specified scaling rule time is invalid. Another schedule has been set for the specified time range. Please set a different time. | |
| 400 | InvalidScalingRuleTime.Format | The specified time is invalid. | |
| 400 | QuotaExceeded.ScalingRuleTime | The maximum number of scaling policy trigger time is exceeded. | |
| 400 | NoComputeResourceQuota.Exceed | Your compute resource is insufficient. Please contact us to raise the quota. | |
| 400 | NoComputeResourceQuota.App.Exceed | You can create %s instances for each application. Please submit a ticket to raise the quota. | |
| 400 | NoComputeResourceQuota.User.Exceed | Your account is limited to create %s instances. Please submit a ticket to raise the quota. | |
| 400 | System.Upgrading | The system is being upgraded. Please try again later. | |
| 400 | MinReadyInstances.Not.Smaller.Replicas | The minimum number of available instances must be less than the number of application instances. | |
| 400 | MinReadyInstanceRatio.Invalid | The ratio of minimum available instances must be between 0 and 100. | |
| 400 | Application.ChangerOrderRunning | An application change process is in progress. Please try again later. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.