查询伸缩规则列表
更新时间:2026-07-22
描述
根据条件查询伸缩组的伸缩规则。
OpenAPI Explorer
去调试
您可以在 OpenAPI Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1GET /v1/rule?groupid={groupid}&keyword={keyword}&keywordType={keywordType}&order={order}&orderBy={orderBy}&pageNo={pageNo}&pageSize={pageSize}
2Host: as.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| groupid | String | 是 | Query参数 | 伸缩组ID |
| keyword | String | 否 | Query参数 | 过滤规则的关键词 |
| keywordType | String | 否 | Query参数 | 关键词的类型。包括:ruleId, ruleName |
| order | String | 否 | Query参数 | 规则的顺序,默认为desc |
| orderBy | String | 否 | Query参数 | 排序规则的字段,默认为createTime |
| pageNo | Integer | 是 | Query参数 | 页码,默认为1 |
| pageSize | Integer | 是 | Query参数 | 页面大小,默认为1000 |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| orderBy | String | 排序的key |
| order | String | 排序顺序(升序asc,降序desc) |
| pageNo | Integer | 页码数 |
| pageSize | Integer | 每页返回结果数 |
| totalCount | Integer | 符合条件的查询结果数 |
| result | List<Rule> | 查询结果 |
请求示例
Plain Text
1GET /v1/rule?groupid={groupid}&keyword={keyword}&keywordType={keywordType}&order={order}&orderBy={orderBy}&pageNo={pageNo}&pageSize={pageSize}
2Host: as.bj.baidubce.com
3Authorization: authorization string
返回示例
Plain Text
1200 Success
2
3{
4 "orderBy" : "createTime",
5 "order" : "desc",
6 "pageNo" : 1,
7 "pageSize" : 10,
8 "totalCount" : 3,
9 "result" : [ {
10 "ruleId" : "asrule-p5huAcMP",
11 "ruleName" : "demo_rule3",
12 "ruleResourceType" : "",
13 "groupId" : "asg-nJGIweB6",
14 "accountId" : "a0d04d7c202140cb80155ff7b6752ce4",
15 "state" : "ENABLE",
16 "type" : "ALARM",
17 "targetType" : "",
18 "targetId" : "",
19 "indicator" : "",
20 "threshold" : "0",
21 "unit" : "",
22 "comparisonOperator" : "",
23 "actionType" : "INCREASE",
24 "actionNum" : 1,
25 "cooldownInSec" : 300,
26 "createTime" : "2026-07-02T06:48:24Z",
27 "lastExecutionTime" : "1971-01-01T00:00:01Z",
28 "lastScheduleTime" : "2026-07-02T06:48:28Z",
29 "periodStartTime" : "2026-07-02T06:48:24Z",
30 "periodEndTime" : "2026-07-02T06:48:24Z",
31 "periodValue" : 0,
32 "asAlarmRule" : {
33 "id" : 303400,
34 "scope" : "BCE_AS",
35 "monitorObject" : {
36 "type" : "INSTANCE",
37 "names" : [ "InstanceId:asg-nJGIweB6" ],
38 "resources" : [ {
39 "identifiers" : [ {
40 "name" : "InstanceId",
41 "value" : "asg-nJGIweB6"
42 } ],
43 "metricDimensions" : [ ]
44 } ],
45 "typeName" : "Instance"
46 },
47 "rules" : [ [ {
48 "id" : null,
49 "index" : 0,
50 "metric" : "CPUUsagePercent",
51 "periodInSecond" : 60,
52 "statistics" : "average",
53 "threshold" : "60",
54 "comparisonOperator" : ">",
55 "evaluationPeriodCount" : 1,
56 "metricDimensions" : [ ]
57 } ] ],
58 "alarmName" : "1196ec3adb7944eb9f988dfb20c0783a",
59 "aliasName" : "弹性伸缩_demoGroup_asrule-p5huAcMP",
60 "insufficientCycle" : 600,
61 "policyEnabled" : true,
62 "ruleContents" : [ "CPU使用率1分钟内平均值>60%,连续发生1次触发报警" ],
63 "ruleContentsEn" : [ "the average of CPUUsagePercent within 1 minute > 60%, occurring 1 time in a row" ],
64 "source" : "BCE_AS",
65 "componentType" : "Cloud",
66 "alarmActions" : [ "" ],
67 "okActions" : [ "" ],
68 "insufficientActions" : [ "" ]
69 }
70 }, {
71 "ruleId" : "asrule-65s0swkF",
72 "ruleName" : "demo_rule2",
73 "ruleResourceType" : "",
74 "groupId" : "asg-nJGIweB6",
75 "accountId" : "a0d04d7c202140cb80155ff7b6752ce4",
76 "state" : "ENABLE",
77 "type" : "PERIOD",
78 "cronTime" : "11:11",
79 "actionType" : "INCREASE",
80 "actionNum" : 1,
81 "cooldownInSec" : 300,
82 "createTime" : "2026-07-02T06:47:06Z",
83 "lastExecutionTime" : "1971-01-01T00:00:01Z",
84 "lastScheduleTime" : "2026-07-02T06:47:06Z",
85 "periodStartTime" : "2026-07-02T06:46:30Z",
86 "periodEndTime" : "2026-07-31T06:00:00Z",
87 "periodType" : "MONTH",
88 "periodValue" : 1
89 }, {
90 "ruleId" : "asrule-hjuXMM0e",
91 "ruleName" : "demo_rule",
92 "ruleResourceType" : "",
93 "groupId" : "asg-nJGIweB6",
94 "accountId" : "a0d04d7c202140cb80155ff7b6752ce4",
95 "state" : "ENABLE",
96 "type" : "CRONTAB",
97 "cronTime" : "11:11",
98 "actionType" : "ADJUST",
99 "actionNum" : 2,
100 "cooldownInSec" : 300,
101 "createTime" : "2026-07-02T06:43:12Z",
102 "lastExecutionTime" : "1971-01-01T00:00:01Z",
103 "lastScheduleTime" : "2026-07-02T06:43:12Z",
104 "periodValue" : 0
105 } ]
106}
评价此篇文章
