Update an application instance

Last Updated: Nov 01, 2016

Description

Updates configurations of an application instance.

Request information

Request line (RequestLine)

  1. POST /projects/{name}/update HTTP/1.1

Request line parameter (URI Param)

Name Type Required? Description
name string Yes Name of the application instance.

Special request header (RequestHead)

  1. Content-Type: application/json

Request body (RequestBody)

JSON object

  1. {
  2. "description": "string",
  3. "template": "string",
  4. "version": "string",
  5. "environment": {
  6. "key": "value",
  7. ...
  8. }
  9. }

Request body parsing

Name Type Required? Description
description string No Updated description.
template string Yes Updated Docker Compose yaml template, which must be encoded in JSON string.
version string No Updated application version. The new version must be different from the old version; otherwise, HTTP code 409 is returned.
environment map Environmental variable key/value pairs, used to replace the environment variables in the Compose template.

Response information

Response line (ResponseLine)

  1. HTTP/1.1 202 Accepted

Special response header (ResponseHead)

None

Response body (ResponseBody)

None

Example

Request example

  1. POST /projects/test/update HTTP/1.1
  2. Content-Type: application/json
  3. {
  4. "description": "This is a test application",
  5. "template": "web:\r\n image: nginx",
  6. "version": "2.0",
  7. "environment": {
  8. "USER": "abc",
  9. "PWD": "newpwd"
  10. }
  11. }

Return example

  1. HTTP/1.1 202 Accepted
Thank you! We've received your feedback.