Modifying an Environment

Function

This API is used to modify the information about a specified environment. Only the name and remark attributes of an environment can be modified.

URI

The following table lists the HTTP/HTTPS request method and URI of the API.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

PUT

/v1/{project_id}/apigw/instances/{instance_id}/envs/{id}

The following table lists the parameters in the URI.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which can be obtained by the administrator on the My Credentials page.

instance_id

Yes

String

Instance ID, which can be obtained from the dedicated gateway information on the API Gateway console.

id

Yes

String

Environment ID, which can be obtained by querying the environment information

Request

Table 3 Parameter description

Parameter

Mandatory

Type

Description

name

Yes

String

Environment name

An environment name consists of 3–64 characters, starting with a letter. Only letters, digits, and underscores (_) are allowed.

remark

No

String

Description of the environment

The description cannot exceed 255 characters.

Example request:

{
	"name": "DEVELOP",
	"remark": "Development environment"
}

Response

Table 4 Parameter description

Parameter

Type

Description

id

String

Environment ID

name

String

Environment name

create_time

Timestamp

Time when the environment is created

remark

String

Description of the environment

Example response:

{
	"id": "cca3616a-f368-4b32-9064-b2a631cb3eeb",
	"name": "DEVELOP",
	"remark": "Development environment",
	"create_time": "2017-12-28T12:50:47Z"
}

Status Codes

Table 5 Status codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Server Internal Error