Create a Package
POST /v3/apps/:guid/packages
Request
Route
POST /v3/apps/guid-fa151ad9-5b09-456d-ab16-97542f0cfef8/packages
Body
Name |
Description |
Default |
Valid Values |
Example Values |
type
|
Package type
|
|
|
|
data
|
Data for docker packages. Can be empty for bits packages.
|
|
|
|
data_image
|
Location of docker image. Required for docker packages.
|
|
|
|
data_credentials
|
Credentials for private docker image, available fields are user, password, email, login server.
|
|
|
|
data_store_image
|
Whether or not the backend should cache the image. defaults to false
|
|
|
|
{
"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
cURL
curl "https://api.[your-domain.com]/v3/apps/guid-fa151ad9-5b09-456d-ab16-97542f0cfef8/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.eyJ1c2VyX2lkIjoidWFhLWlkLTQ1OCIsImVtYWlsIjoiZW1haWwtMzI1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.yVYNnPsHmk43RwYCN-dxBSavIlIFCSm_gEAefKjb7hk" \
-H "Content-Type: application/json" \
-H "Host: example.org" \
-H "Cookie: "
Response
Status
201 Created
Body
{
"guid": "64bb71dc-2da1-45f6-9d07-9e3c3952ced7",
"type": "docker",
"data": {
"hash": {
"type": "sha1",
"value": null
},
"error": null,
"image": "registry/image:latest",
"credentials": {
"user": "user name",
"email": "root@admin.example.com",
"password": "very secret password",
"login_server": "https://index.docker.io/v1"
},
"store_image": true
},
"state": "READY",
"created_at": "2015-11-13T17:02:56Z",
"updated_at": null,
"links": {
"self": {
"href": "/v3/packages/64bb71dc-2da1-45f6-9d07-9e3c3952ced7"
},
"app": {
"href": "/v3/apps/guid-fa151ad9-5b09-456d-ab16-97542f0cfef8"
}
}
}
Headers