serverless建立周期任務策略
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
polardb:CreateCronJobPolicyServerless |
create |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| DBClusterId |
string |
是 |
叢集 ID。 |
pc-xxxxxxxxxx |
| RegionId |
string |
是 |
地區 ID。 |
cn-hangzhou |
| CronExpression |
string |
是 |
Cron 運算式。 |
0 0 13 * * ? |
| ScaleMin |
string |
否 |
最小值:0.25~32 PCU,且最小值 <= 最大值。單位:PCU。 |
1 |
| ScaleMax |
string |
否 |
最大值:1~32 PCU。單位:PCU。 |
3 |
| ScaleRoNumMin |
string |
否 |
唯讀節點個數的伸縮下限。取值範圍:0~15。 |
2 |
| ScaleRoNumMax |
string |
否 |
唯讀節點個數的伸縮上限 0~15 個可選, 且不能大於上限的值。取值範圍:0~15。 |
4 |
| AllowShutDown |
string |
否 |
是否開啟無活動暫停。取值範圍如下:
|
true |
| SecondsUntilAutoPause |
string |
否 |
無活動暫停檢測時間長度。取值範圍:5~1440。單位分鐘。檢測時間長度必須是 5 分鐘的倍數。 |
10 |
| ScaleApRoNumMin |
string |
否 |
唯讀列存節點個數下限。取值範圍:0~15。 |
1 |
| ScaleApRoNumMax |
string |
否 |
唯讀列存節點個數上限。取值範圍:0~15。 |
1 |
| ServerlessRuleCpuEnlargeThreshold |
string |
否 |
cpu 彈升閾值。最大值:40~100 % |
60 |
| ServerlessRuleCpuShrinkThreshold |
string |
否 |
cpu 彈降閾值。最小值:10~100 %,且最大值 - 最小值 >= 30 |
30 |
| ServerlessRuleMode |
string |
否 |
彈性靈敏度。取值:
|
normal |
| StartTime |
string |
否 |
任務開始時間。格式為 |
2020-11-14T00:00Z |
| EndTime |
string |
是 |
任務結束時間。格式: |
2021-09-23T01:01:00Z |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
45D24263-7E3A-4140-9472-************ |
| JobId |
string |
定時任務 ID。 |
1fa3c0e7-b568-4f41-b703-463c96a91bd8 |
| DBClusterId |
string |
叢集 ID。 |
pc-**************** |
| RegionId |
string |
地區 ID。 |
cn-hangzhou |
| Status |
string |
任務狀態。 取值範圍如下:
|
working |
| CronExpression |
string |
Cron 運算式。 |
0 0 8 * * ? |
| Action |
string |
系統規定參數。取值:ModifyDBClusterServerlessConf。 |
ModifyDBClusterServerlessConf |
| StartTime |
string |
任務開始時間。格式為 |
2020-05-01T00:00Z |
| EndTime |
string |
任務結束時間。格式: |
2021-04-07T04:00Z |
樣本
正常返回樣本
JSON格式
{
"RequestId": "45D24263-7E3A-4140-9472-************",
"JobId": "1fa3c0e7-b568-4f41-b703-463c96a91bd8",
"DBClusterId": "pc-****************",
"RegionId": "cn-hangzhou",
"Status": "working",
"CronExpression": "0 0 8 * * ?",
"Action": "ModifyDBClusterServerlessConf",
"StartTime": "2020-05-01T00:00Z",
"EndTime": "2021-04-07T04:00Z"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidRegionId.Malformed | The specified parameter RegionId is not valid. | 指定的參數RegionId無效 |
| 400 | InvalidStartTime.Malformed | The specified parameter StartTime is not valid. | 指定的參數StartTime無效 |
| 400 | InvalidEndTime.Malformed | The specified parameter EndTime is not valid. | 指定的參數EndTime無效 |
| 400 | InvalidCronJobParam.Type | The specified type is not valid. | 指定的類型無效。 |
| 400 | InvalidCronJobParam.InstanceId | The specified instanceId is not valid. | 指定的instanceId無效。 |
| 400 | InvalidCronJobParam.CronExpression | The specified cronExpression is not valid. | 指定的cronExpression無效。 |
| 404 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | 指定的參數DBClusterId無效 |
| 409 | InvalidCronJob.DuplicateJob | This instance has tasks with duplicate crontab expressions. | 此執行個體具有重複crontab運算式的任務。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。