Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-2dd2a871-0c91-423b-8a0a-a3e3970d1100/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.eyJ1c2VyX2lkIjoidWFhLWlkLTQyMiIsImVtYWlsIjoiZW1haWwtMjkwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDV9.EMvQL4rTA9eY4M7Tf_5HsEgo0fjhT9uTAlMaCUmdzE4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-2dd2a871-0c91-423b-8a0a-a3e3970d1100/packages" -d '{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyMiIsImVtYWlsIjoiZW1haWwtMjkwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDV9.EMvQL4rTA9eY4M7Tf_5HsEgo0fjhT9uTAlMaCUmdzE4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "eac19c85-389c-4aac-8307-d24bfe85e4f4",
  "type": "docker",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": "docker://cloudfoundry/runtime-ci",
  "state": "READY",
  "error": null,
  "created_at": "2015-10-07T00:35:45Z",
  "updated_at": null,
  "links": {
    "self": {
      "href": "/v3/packages/eac19c85-389c-4aac-8307-d24bfe85e4f4"
    },
    "app": {
      "href": "/v3/apps/guid-2dd2a871-0c91-423b-8a0a-a3e3970d1100"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 1236377e-fda3-4064-bd8e-a755d6f3ab54
Content-Length: 462
X-Content-Type-Options: nosniff