查询伸缩规则详情
更新时间:2026-07-22
描述
查询指定规则详情
OpenAPI Explorer
去调试
您可以在 OpenAPI Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1GET /v1/rule/{ruleId}
2Host: as.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| ruleId | String | 是 | URL参数 | 规则ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| ruleId | String | 规则ID |
| ruleName | String | 规则名称 |
| groupId | String | 伸缩组ID |
| accountId | String | 用户ID |
| state | String | 规则的状态 |
| type | String | 规则的类型 |
| cronTime | String | 定时规则或周期规则:当日执行时间。如12:30。 |
| actionType | String | 动作类型。包括:INCREASE(扩容),DECREASE(缩容),ADJUST(调整至) |
| actionNum | Integer | 动作数量 |
| cooldownInSec | Integer | 冷却时间(秒) |
| createTime | String | 规则创建时间 |
| lastExecutionTime | String | 规则最后修改时间 |
| lastScheduleTime | String | 规则最后执行时间 |
| periodStartTime | String | 周期规则:周期有效期开始时间。如:2023-12-10T12:00:00Z |
| periodEndTime | String | 周期规则:周期有效期结束时间。如:2023-12-11T12:00:00Z |
| periodType | String | 周期规则:周期单位,可选值为DAY/WEEK/MONTH/CronExpression |
| periodValue | Integer | 周期规则:周期触发日期,1-7标识周1-周日,1-31表示1号到31号,与periodType相关 |
| asAlarmRule | AsAlarmRule | 报警类规则:报警规则信息,详情见附录 |
请求示例
Plain Text
1GET /v1/rule/
2Host: as.bj.baidubce.com
3Authorization: authorization string
返回示例
Plain Text
1200 Success
2
3{
4 "ruleId" : "asrule-p5huAcMP",
5 "ruleName" : "demo_rule3",
6 "ruleResourceType" : "",
7 "groupId" : "asg-nJGIweB6",
8 "accountId" : "a0d04d7c202140cb80155ff7b6752ce4",
9 "state" : "ENABLE",
10 "type" : "ALARM",
11 "targetType" : "",
12 "targetId" : "",
13 "indicator" : "",
14 "threshold" : "0",
15 "unit" : "",
16 "comparisonOperator" : "",
17 "actionType" : "INCREASE",
18 "actionNum" : 1,
19 "cooldownInSec" : 300,
20 "createTime" : "2026-07-02T06:48:24Z",
21 "lastExecutionTime" : "1971-01-01T00:00:01Z",
22 "lastScheduleTime" : "2026-07-02T06:48:28Z",
23 "periodStartTime" : "2026-07-02T06:48:24Z",
24 "periodEndTime" : "2026-07-02T06:48:24Z",
25 "periodValue" : 0,
26 "asAlarmRule" : {
27 "id" : 303400,
28 "scope" : "BCE_AS",
29 "monitorObject" : {
30 "type" : "INSTANCE",
31 "names" : [ "InstanceId:asg-nJGIweB6" ],
32 "resources" : [ {
33 "identifiers" : [ {
34 "name" : "InstanceId",
35 "value" : "asg-nJGIweB6"
36 } ],
37 "metricDimensions" : [ ]
38 } ],
39 "typeName" : "Instance"
40 },
41 "rules" : [ [ {
42 "id" : null,
43 "index" : 0,
44 "metric" : "CPUUsagePercent",
45 "periodInSecond" : 60,
46 "statistics" : "average",
47 "threshold" : "60",
48 "comparisonOperator" : ">",
49 "evaluationPeriodCount" : 1,
50 "metricDimensions" : [ ]
51 } ] ],
52 "alarmName" : "1196ec3adb7944eb9f988dfb20c0783a",
53 "aliasName" : "弹性伸缩_demoGroup_asrule-p5huAcMP",
54 "insufficientCycle" : 600,
55 "policyEnabled" : true,
56 "ruleContents" : [ "CPU使用率1分钟内平均值>60%,连续发生1次触发报警" ],
57 "ruleContentsEn" : [ "the average of CPUUsagePercent within 1 minute > 60%, occurring 1 time in a row" ],
58 "source" : "BCE_AS",
59 "componentType" : "Cloud",
60 "alarmActions" : [ "" ],
61 "okActions" : [ "" ],
62 "insufficientActions" : [ "" ]
63 }
64}
评价此篇文章
