Updated on 2022-06-01 GMT+08:00

Modifying Policy Group Attributes

Function

This API is used to modify policy group attributes. [It is not supported in versions later than 1.8.0.] (tag:hcs)

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

ResourceType

Yes

String

Resource type. Default value: app, indicating that the policy group attributes of an application are modified.

Enumeration values:

  • app

Cluster-Id

Yes

String

Cluster ID.

Namespace

Yes

String

Namespace.

Deployment-Name

Yes

String

Application name.

X-Auth-Token

Yes

String

Project-level token obtained from IAM.

Content-Type

Yes

String

Content type, which is application/json.

Enumeration values:

  • application/json

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

max_instances

No

Integer

Maximum number of instances, indicating the upper limit for capacity expansion.

min_instances

No

Integer

Minimum number of instances, indicating the lower limit for capacity expansion.

cooldown_time

No

Integer

Cooldown period (unit: s). After an applied policy is executed, the next policy can be executed only after the cooldown period expires.

deployment_name

No

String

Application name.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Details.

Example Requests

Modify policy group attributes.

PUT https://{Endpoint}/v1/{project_id}/pe/policy/config

{
  "max_instances" : 100,
  "min_instances" : 1,
  "cooldown_time" : 60,
  "deployment_name" : "test01"
}

Example Responses

Status code: 200

OK: The request is successful.

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

Status Codes

Status Code

Description

200

OK: The request is successful.

400

Bad Request: Invalid request. The client should not repeat the request without modifications.

401

Unauthorized: The authorization information is incorrect or invalid.

403

Forbidden: The request is rejected. The server has received the request and understood it, but the server refuses to respond to it. The client should not repeat the request without modifications.

500

Internal Server Error: The server is able to receive the request but unable to understand the request.

503

Service Unavailable: The requested service is invalid. The client should not repeat the request without modifications.

Error Codes

See Error Codes.