Create an application

Last Updated: Jan 09, 2018

Description

Create an application.

Request information

Request line (RequestLine)

  1. POST /projects/ HTTP/1.1

Request line parameter (URI Param)

None

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. }

Request body explanation

Name Type Required? Description
namestringYesThe application name, which can be 1-64 characters long and contain numbers, English letters, and hyphens (-), but cannot start with hyphens (-).
descriptionstringNoThe application description.
templatestringYesThe application Compose yaml template in the format of strings, which must be escaped in the JSON format.
versionstringNoThe application version. The default value is 1.0.
environmentmapNokey/value used to replace the variable parameter in the Compose template.
latest_imageboolNoWhether or not to update the image before creating an application.

Response information

Response line (ResponseLine)

  1. HTTP/1.1 201 Created

Special response header (ResponseHead)

  1. Location /projects/<name>

Example

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.