Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-89f3836f-63f5-484d-b8ae-a6ae729e0157/packages

Body

Name Description Parameter Type Default Valid Values Example Values
type Package type String
  • bits
  • docker
data Data for docker packages. Can be empty for bits packages.
data["image"] Location of docker image. Required for docker packages. String
  • registry/image:latest
{
  "type": "docker",
  "data": {
    "image": "registry/image:latest",
    "credentials": {
      "user": "user name",
      "password": "very secret password",
      "email": "root@admin.example.com",
      "login_server": "https://index.docker.io/v1"
    },
    "store_image": true
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0NSIsImVtYWlsIjoiZW1haWwtODNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1MTQxMzY4Mn0.2dQVQSxNOu88pYlMIz6Lhunq5yxnENPIIuerbVMTfRQ
Content-Type: application/json
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-89f3836f-63f5-484d-b8ae-a6ae729e0157/packages" -d '{
  "type": "docker",
  "data": {
    "image": "registry/image:latest",
    "credentials": {
      "user": "user name",
      "password": "very secret password",
      "email": "root@admin.example.com",
      "login_server": "https://index.docker.io/v1"
    },
    "store_image": true
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE0NSIsImVtYWlsIjoiZW1haWwtODNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1MTQxMzY4Mn0.2dQVQSxNOu88pYlMIz6Lhunq5yxnENPIIuerbVMTfRQ" \
	-H "Content-Type: application/json" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "b6e7776d-0a42-4e35-8f96-af08fe2333e7",
  "type": "docker",
  "data": {
    "image": "registry/image:latest"
  },
  "state": "READY",
  "created_at": "2015-12-22T18:28:02Z",
  "updated_at": null,
  "links": {
    "self": {
      "href": "/v3/packages/b6e7776d-0a42-4e35-8f96-af08fe2333e7"
    },
    "app": {
      "href": "/v3/apps/guid-89f3836f-63f5-484d-b8ae-a6ae729e0157"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.032187
Content-Length: 399