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

Modifying Policy Group Attributes

Function

This API is used to modify policy group attributes.

URI

PUT /v1/{project_id}/pe/policy/config

Table 1 describes the parameters.

Table 1 Parameters

Parameter

Mandatory

Description

project_id

Yes

Project ID.

Request

Request headers

Table 2 describes the request headers.

Table 2 Request headers

Parameter

Description

Mandatory

Example

ResourceType

Resource type.

Yes

Default value: app, indicates modifying the policy group attributes of an application.

Cluster-Id

Cluster ID.

Yes

-

Namespace

Namespace.

Yes

-

Deployment-Name

Application name.

Yes

-

Request parameters

Table 3 describes the request parameters.

Table 3 Request parameters

Parameter

Type

Description

max_instances

Integer

Maximum number of instances.

min_instances

Integer

Minimum number of instances.

cooldown_time

Integer

Cooldown period (unit: s).

deployment_name

String

Microservice name.

cluster_id

String

Cluster ID.

namespace

String

Namespace.

Example request

{
        "max_instances": 100,//Maximum number of instances
        "min_instances": 1,//Minimum number of instances
          "cooldown_time": 60//Cooldown period, which is the execution interval between two policies.
}

Response

Response parameters

Table 4 describes the response parameters.

Table 4 Response parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error details.

Example response

{ 
     "errorCode": "SVCSTG.PE.0", 
     "errorMessage": "" 
}

Error Code

Table 5 Error codes

Error Code

Message

Solution

SVCSTG.PE.4001101

Invalid parameter.

Check whether the parameter meets requirements.

SVCSTG.PE.4031012

Failed to verify the project ID.

Check whether the parameter meets requirements.

SVCSTG.PE.5001201

Failed to insert or update data in the background.

Contact technical support.

SVCSTG.PE.5001203

Query error.

Contact technical support.