Create a Package
POST /v3/apps/:guid/packages
Request
Route
POST /v3/apps/guid-1b89200f-8dc1-4c5d-b523-664502be46bd/packages
Body
Name |
Description |
Parameter Type |
Default |
Valid Values |
Example Values |
type
|
Package type
|
String
|
|
|
|
data
|
Data for docker packages. Can be empty for bits packages.
|
|
|
|
|
data["image"]
|
Location of docker image. Required for docker packages.
|
String
|
|
|
|
data["credentials"]
|
Credentials for private docker image, available fields are user, password, email, login server.
|
String
|
|
|
|
data["store_image"]
|
Whether or not the backend should cache the image. For docker packages only.
|
Boolean
|
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-1b89200f-8dc1-4c5d-b523-664502be46bd/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.eyJ1c2VyX2lkIjoidWFhLWlkLTIxMSIsImVtYWlsIjoiZW1haWwtMTQyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MjR9.x1tfZc7V1i27h2SRMgJTten7hHztd97cZfGvae0lDLo" \
-H "Content-Type: application/json" \
-H "Host: example.org" \
-H "Cookie: "
Response
Status
201 Created
Body
{
"guid": "b7a5f30b-f4af-4df3-b694-5bf7319e8d6e",
"type": "docker",
"data": {
"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,
"error": null
},
"state": "READY",
"created_at": "2015-11-30T23:38:44Z",
"updated_at": null,
"links": {
"self": {
"href": "/v3/packages/b7a5f30b-f4af-4df3-b694-5bf7319e8d6e"
},
"app": {
"href": "/v3/apps/guid-1b89200f-8dc1-4c5d-b523-664502be46bd"
}
}
}
Headers