Modifying Environment Resources

Function

This API is used to modify environment resources.

URI

PATCH /v2/{project_id}/cas/environments/{environment_id}/resources

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

environment_id

String

Yes

Environment ID.

Request Parameters

Request parameters

Table 2 Request parameters

Parameter

Type

Mandatory

Description

add_base_resources

Array of objects

No

Basic resources to be added. See Table 3.

add_optional_resources

Array of objects

No

Other resources to be added. See Table 4.

remove_resources

Array of objects

No

Resources to be removed. See Table 5.

Table 3 add_base_resources parameters

Parameter

Type

Mandatory

Description

id

String

Yes

Resource ID.

type

String

Yes

Basic resources: Cloud Container Engine (CCE), Cloud Container Instance (CCI), Elastic Cloud Server (ECS), and Auto Scaling (AS).

Table 4 add_optional_resources parameters

Parameter

Type

Mandatory

Description

id

String

Yes

Resource ID.

type

String

Yes

Optional resources: Relational Database Service (RDS), Distributed Cache Service (DCS), Elastic Load Balance (ELB), and other services.

Table 5 remove_resources parameters

Parameter

Type

Mandatory

Description

id

String

Yes

Resource ID.

type

String

Yes

Basic resources: CCE, CCI, ECS, and AS.

Optional resources: RDS, DCS, ELB, and other services.

Response Parameters

Response parameters

Table 6 Parameters

Parameter

Type

Description

id

String

Environment ID.

name

String

Environment name.

alias

String

Environment alias.

description

String

Environment description.

project_id

String

Project ID.

enterprise_project_id

String

Enterprise project ID.

charge_mode

String

Billing mode.

vpc_id

String

Virtual Private Cloud (VPC) ID.

base_resources

Array of objects

Basic resources. See Table 7.

optional_resources

Array of objects

Optional resources. See Table 7.

creator

String

Creator.

create_time

Integer

Creation time.

update_time

Integer

Update time.

Table 7 schemas parameters

Parameter

Type

Description

id

String

Resource ID.

type

String

Basic resources: CCE, CCI, ECS, and AS.

Optional resources: RDS, DCS, ELB, and other services.

Example

Example request

{
    "add_base_resources": [{
        "id": "cci-namespace",
        "type": "cci"
    }],
    "remove_resources": [{
        "id": "default",
        "type": "cse"
    }]
}

Example response

{
    "id": "345eae98-231e-4a23-92ef-9823c85ce356", 
    "name": "environment_name", 
    "description": "environment_description", 
    "project_id": "4c5fac143bc3459fae56789ead33a78a", 
    "enterprise_project_id": "0", 
    "charge_mode": "provided", 
    "vpc_id": "b9b8f9ad-1a2e-403d-83f1-cb71a3c06df8", 
    "base_resources": [
        {
            "id": "b6862a62-d916-11e9-bdf1-0255ac101fd9", 
            "type": "cce"
        }, 
        {
            "id": "cci-namespace", 
            "type": "cci"
        }
    ], 
    "optional_resources": [
        {
            "id": "default", 
            "type": "cse"
        }
    ], 
    "creator": "string", 
    "create_time": 1571107531621, 
    "update_time": 1571107531621
}

Status Code

Table 8 Status codes

HTTP Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error code must be in the format of SVCSTG.00100.[Error_ID]. Example: SVCSTG.00100400. See Error Codes of Application Management APIs.