Create an application instance

Last Updated: Apr 14, 2017


Creates an application instance.

Request information

Request line (RequestLine)

  1. POST /projects/ HTTP/1.1

Request line parameter (URI Param)


Special request header (RequestHead)

  1. Content-Type: application/json

Request body (RequestBody)

JSON object

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

Explanation on the request body

Name Type Required? Description
name string Yes Name of application, which can contain uppercase and lowercase letters, numbers, and dashes.
description string No Description.
template string Yes The Docker Compose template in yaml format. It should be encoded as one JSON string.
version string No Application version. The default value is 1.0.
environment map No key/value, used to replace the variable parameter in the Compose template.
latest_image bool No Whether to update the image before creating the application.

Response information

Response line (ResponseLine)

  1. HTTP/1.1 201 Created

Special response header (ResponseHead)

  1. Location /projects/<name>


Request example

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

Return example

  1. HTTP/1.1 201 Created
  2. Location /projects/test
Thank you! We've received your feedback.