Querying a Policy List
Function
This API is used to query details about all policies of a specified project.
Request
Request headers
None
Request parameters
None
Example request
None
Response
Response parameters
Table 2 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
errorCode |
String |
Error code. |
errorMessage |
String |
Error details. |
policy |
See Table 3. |
Details about a modified policy. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Policy ID. |
name |
String |
Policy name. |
policy_type |
String |
Policy type. |
rule |
See Table 4. |
Policy trigger rule. |
create_time |
String |
Creation time. |
update_time |
String |
Update time. |
status |
String |
Status |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Policy name. |
conditions |
See Table 5. |
Condition contents. |
actions |
See Table 6. |
Action executed after a specified policy is successfully matched. |
Parameter |
Type |
Description |
---|---|---|
metric_namespace |
String |
Namespace. |
metric_name |
String |
Metric name. |
metric_unit |
String |
Unit. |
period |
Integer |
Statistical period (unit: s). |
evaluation_periods |
Integer |
Number of consecutive periods. |
statistic |
String |
Statistic. |
metric_operation |
String |
Metric operator. |
metric_threshold |
Float |
Threshold criterion. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Scale-in or -out. The value containing k8s indicates a container application and that containing vm indicates a process application. |
parameters |
See Table 7. |
Number of scale-in or -out instances. |
Parameter |
Type |
Description |
---|---|---|
scale_unit |
Integer |
Number of scale-in or -out instances. |
Example response
{ "errorCode" : "SVCSTG.PE.0", "errorMessage" : "", "policies" : [{ "id" : "8accffb6-e0ed-4433-b216-ccf6960eb1ad", "name" : "alarm", "group_id" : "77c37e1f-aa0c-438d-8445-39b3997786a2", "policy_type" : "ALARM", "rule" : { "name" : "", "conditions" : [{ "metric_namespace" : "PAAS.CONTAINER", "metric_name" : "cpuCoreLimit", "metric_unit" : "Percent", "period" : 60, "evaluation_periods" : 1, "statistic" : "average", "metric_operation" : "\u003e", "metric_threshold" : 100, "metric_dimensions" : null } ], "actions" : [{ "type" : "scale_out_k8s", "parameters" : { "scale_unit" : 1 } } ] }, "create_time" : "2017-12-21T09:13:42Z", "update_time" : "2017-12-21T09:13:42Z", "status" : "enabled" }, { "id" : "9aafbd3d-eac4-4a92-a342-5b6f8d60fff2", "name" : "dingshi2", "group_id" : "77c37e1f-aa0c-438d-8445-39b3997786a2", "policy_type" : "SCHEDULED", "rule" : { "name" : "", "conditions" : [{ "launch_time" : "2017-12-22T06:30Z", "recurrence_type" : "", "recurrence_value" : "", "start_time" : "", "end_time" : "" } ], "actions" : [{ "type" : "scale_set_k8s", "parameters" : { "scale_unit" : 1 } } ] }, "create_time" : "2017-12-21T09:14:00Z", "update_time" : "2017-12-21T09:14:00Z", "status" : "enabled" } ] }
Error Code
Error Code |
Message |
Solution |
---|---|---|
SVCSTG.PE.4031012 |
Failed to verify the project ID. |
Check whether the parameter meets requirements. |
SVCSTG.PE.5001203 |
Query error. |
Contact technical support. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot