Creating an Environment
Function
API providers can publish an API in different environments, such as the development, test, and production environments. API information, such as the version, request address, and even request message, varies depending on the environment in which an API is published. For example, v1.0 of an API is published in the production environment, v1.1 in the test environment, and v1.2 in the development environment.
API Gateway provides environment management, enabling you to access API Gateway in different scenarios at minimal costs.
URI
The following table lists the HTTP/HTTPS request method and URI of the API.
Request Method |
URI |
---|---|
POST |
/v1.0/apigw/envs |
Request
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": "DEV", "remark": "Development environment" }
Response
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": "DEV", "remark": "Development environment", "create_time": "2017-12-28T12:50:47.0744311Z" }
Status Codes
Status Code |
Description |
---|---|
201 |
Created |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
500 |
Server Internal Error |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot