Publishing an API
Function
This API is used to publish an API in a specified environment. An API can be called in an environment only after it is published in it. APIs that have not been published cannot be called.
URI
The following table lists the HTTP/HTTPS request method and URI of the API.
Request Method |
URI |
---|---|
POST |
/v1.0/apigw/apis/publish/{api_id} |
The following table lists the parameter in the URI.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
api_id |
Yes |
String |
API ID |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
env_id |
Yes |
String |
ID of the environment in which the API will be published |
remark |
No |
String |
Description about the publication The description cannot exceed 255 characters. |
Example request:
{ "env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID", "remark": "Published in the production environment" }
Response
Parameter |
Type |
Description |
---|---|---|
publish_id |
String |
ID of the publication record |
api_id |
String |
API ID |
env_id |
String |
ID of the environment in which the API has been published |
remark |
String |
Description about the publication |
publish_time |
Timestamp |
Time when the API is published |
version_id |
String |
API version |
Example response:
{ "publish_id": "5b729aa252764739be2c37ef0d66dc63", "api_id": "7addcd00cfab433984b1d8bf2fe08aaa", "env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID", "version_id": "3d9dcb733ba34352b0d02f85fd16b026", "remark": "string", "publish_time": "2018-07-26T13:18:04.1079916Z" }
Status Codes
Status Code |
Description |
---|---|
201 |
Created |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
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