Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Querying a Policy List

Updated on 2023-06-28 GMT+08:00

Function

This API is used to query details about all policies of a specified project.

URI

GET /v1/{project_id}/pe/policy

Table 1 describes the parameters.

Table 1 Parameters

Parameter

Mandatory

Description

project_id

Yes

Project ID.

Request

Request headers

None

Request parameters

None

Example request

None

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error details.

policy

See Table 3.

Details about a modified policy.

Table 3 policy parameters

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

Table 4 rule parameters

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.

Table 5 conditions parameters

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.

Table 6 actions parameters

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.

Table 7 parameters

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

Table 8 Error codes

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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback