Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-1ff51f71-fc43-40d1-9314-8da2a20373b2/packages

Body

Name Description Default Valid Values Example Values
type Package type
  • bits
  • docker
url Url of docker image
{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2MiIsImVtYWlsIjoiZW1haWwtMTE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE3OTZ9.HTVt3wl1jRknFt_eVd56d1XXmD86KecwjeArEMEe1do
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-1ff51f71-fc43-40d1-9314-8da2a20373b2/packages" -d '{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2MiIsImVtYWlsIjoiZW1haWwtMTE2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE3OTZ9.HTVt3wl1jRknFt_eVd56d1XXmD86KecwjeArEMEe1do" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "f583005c-20c1-41d5-91ba-7ffd94500dd0",
  "type": "docker",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": "docker://cloudfoundry/runtime-ci",
  "state": "READY",
  "error": null,
  "created_at": "2015-07-27T22:43:16Z",
  "updated_at": null,
  "_links": {
    "self": {
      "href": "/v3/packages/f583005c-20c1-41d5-91ba-7ffd94500dd0"
    },
    "app": {
      "href": "/v3/apps/guid-1ff51f71-fc43-40d1-9314-8da2a20373b2"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: ce165a89-2cbf-49f3-9b64-be98fab3ed1f
Content-Length: 463
X-Content-Type-Options: nosniff