Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-be7aaa08-ee37-43e2-bd01-0233d74eb8cd/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.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MCIsImVtYWlsIjoiZW1haWwtMjY3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDh9.h8cggPbZ1VOkrWtk36k7NebYNPLfoJp__Mj5DG8n1E0
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-be7aaa08-ee37-43e2-bd01-0233d74eb8cd/packages" -d '{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM3MCIsImVtYWlsIjoiZW1haWwtMjY3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDh9.h8cggPbZ1VOkrWtk36k7NebYNPLfoJp__Mj5DG8n1E0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "cb002f86-1b66-4e4b-b88d-25ab903a0c93",
  "type": "docker",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": "docker://cloudfoundry/runtime-ci",
  "state": "READY",
  "error": null,
  "created_at": "2015-09-11T18:39:08Z",
  "updated_at": null,
  "_links": {
    "self": {
      "href": "/v3/packages/cb002f86-1b66-4e4b-b88d-25ab903a0c93"
    },
    "app": {
      "href": "/v3/apps/guid-be7aaa08-ee37-43e2-bd01-0233d74eb8cd"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 91b67965-707c-4ddd-8b1a-98544a0d39a5
Content-Length: 463
X-Content-Type-Options: nosniff