Publishing Multiple APIs or Taking Multiple APIs Offline
Function
This API is used to publish multiple APIs in an environment or to remove multiple APIs from the environment in which they have been published.
URI
The following table lists the HTTP/HTTPS request method and URI of the API.
Request Method |
URI |
---|---|
POST |
/v1.0/apigw/apis/publish[?action] |
The following table lists the parameter in the URI.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
No |
String |
online: publish offline: take offline |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
apis |
Yes |
String Array |
IDs of the APIs to be published or taken offline |
env_id |
Yes |
String |
Environment ID |
remark |
No |
String |
Description of the publication The description cannot exceed 255 characters. |
Example request:
{ "apis": ["81efcfd94b8747a0b21e8c04144a4e8c","7addcd00cfab433984b1d8bf2fe08aaa"], "env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID", "remark": "Published in the production environment" }
Response
Parameter |
Type |
Description |
---|---|---|
success |
Array |
Message for successful API publication or taking offline |
failure |
Array |
Error message and APIs that fail to be published or taken offline |
Parameter |
Type |
Description |
---|---|---|
publish_id |
String |
Publication record ID |
api_id |
String |
ID of a successfully published API |
api_name |
String |
Name of the API |
env_id |
String |
ID of the environment in which the API has been published |
remark |
String |
Description of the publication |
publish_time |
Timestamp |
Time when the API is published |
version_id |
String |
API version |
Parameter |
Type |
Description |
---|---|---|
api_id |
String |
ID of an API that is successfully taken offline |
api_name |
String |
Name of the API |
Parameter |
Type |
Description |
---|---|---|
api_id |
String |
ID of an API that fails to be published or taken offline |
api_name |
String |
Name of the API |
error_code |
String |
Error code |
error_msg |
String |
Error message |
Example response:
{ "success": [{ "publish_id": "5b729aa252764739be2c37ef0d66dc63", "api_id": "7addcd00cfab433984b1d8bf2fe08aaa", "api_name": "testApi", "env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID", "version_id": "3d9dcb733ba34352b0d02f85fd16b026", "remark": "string", "publish_time": "2018-07-26T13:18:04.1079916Z" }], "failure": [{ "api_id": "81efcfd94b8747a0b21e8c04144a4e8c", "error_code": "APIG.3002", "error_msg": "api with id 81efcfd94b8747a0b21e8c04144a4e8c not found" }] }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
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