Help Center/ ServiceStage/ API Reference/ Application Management V3 APIs/ Environment/ Modifying an Environment Resource Based on the Environment ID
Updated on 2026-04-10 GMT+08:00

Modifying an Environment Resource Based on the Environment ID

Function

This API is used to modify an environment resource based on the environment ID.

Authorization Information

Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.

URI

PUT /v3/{project_id}/cas/environments/{environment_id}/resources

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Tenant's project ID. See Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

environment_id

Yes

String

Definition

Environment ID. See Obtaining All Environments.

Constraints

N/A

Range

N/A

Default Value

N/A

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Definition

Message body type (or format).

Constraints

N/A

Range

application/json;charset=utf8

Default Value

N/A

X-Auth-Token

Yes

String

Definition

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

resources

Yes

Array of objects

Definition

Resource object. See Table 4.

Table 4 resources

Parameter

Mandatory

Type

Description

id

Yes

String

Definition

Resource ID. (To ensure that the API can be called properly, enter the correct resource ID.)

Range

N/A

Default Value

N/A

name

No

String

Definition

Resource name.

Range

N/A

Default Value

N/A

type

Yes

String

Definition

Resource type.

Range

  • vpc
  • eip
  • elb
  • cce
  • ecs
  • as
  • cse: ServiceComb engine
  • nacos: registry/configuration center
  • dcs
  • rds
  • subnet
  • acl
  • customServer
  • gaussdb
  • dms_rocketmq
  • css_es: Elasticsearch
  • custom_k8s: custom Kubernetes cluster

Default Value

N/A

parameters

No

Map<String, String>

Definition

Resource parameters. See Table 5.

alias

No

String

Definition

Resource alias.

Range

N/A

Default Value

N/A

Table 5 parameters

Parameter

Mandatory

Type

Description

kube_config

No

String

Definition

Kubernetes connection configuration file.

This parameter is required when the resource type is custom_k8s.

Range

N/A

Default Value

N/A

Response

Table 6 Response parameters

Parameter

Type

Description

resources

Array of objects

Definition

Resource object. See Table 7.

Table 7 schemas

Parameter

Type

Description

id

String

Definition

Resource ID.

Range

N/A

name

String

Definition

Resource name.

Range

N/A

type

String

Definition

Resource type.

Range

  • eip
  • elb
  • cce
  • ecs
  • as
  • cse
  • dcs
  • rds
  • gaussdb
  • dms_rocketmq
  • css_es: Elasticsearch
  • custom_k8s: custom Kubernetes cluster

parameters

Map<String, String>

Definition

Resource parameters. See Table 8.

Table 8 parameters

Parameter

Type

Description

kube_config

String

Definition

Kubernetes connection configuration file.

This parameter is returned when the resource type is custom_k8s.

Range

N/A

Example Request

Modify the ECS whose ID is 67835bb3-1235-4cc9-be71-becbb2b4ca0d and name is ecs-a5a9.

{
    "resources": [
        {
            "id": "67835bb3-1235-4cc9-be71-becbb2b4ca0d",
            "name": "ecs-a5a9",
            "type": "ecs"
        }
    ]
}

Example Response

{
    "resources": [
        {
            "id": "67835bb3-1235-4cc9-be71-becbb2b4ca0d",
            "type": "ecs",
            "name": "ecs-a5a9"
        }
    ]
}

Status Code

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

See ServiceStage Error Codes.