Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-b5f92d47-4d70-4b84-98a1-5e3f521f24d0/packages

Parameters

Name Description Valid Values Example Values
type Package type
  • bits
  • docker
url Url of docker image

Body

Name Description Default Valid Values Example Values
{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-b5f92d47-4d70-4b84-98a1-5e3f521f24d0/packages" -d '{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQiLCJlbWFpbCI6ImVtYWlsLTRAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNzQ4MDgzOX0.Ce_qpcSzKfnTgc_SyBRF4qs8amfVGKdtvh1QxtVdw3A" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "01ec6e63-a0e7-4fdf-8a17-b6103d5f250e",
  "type": "docker",
  "hash": null,
  "url": "docker://cloudfoundry/runtime-ci",
  "state": "READY",
  "error": null,
  "created_at": "2015-03-20T18:27:19Z",
  "_links": {
    "self": {
      "href": "/v3/packages/01ec6e63-a0e7-4fdf-8a17-b6103d5f250e"
    },
    "app": {
      "href": "/v3/apps/guid-b5f92d47-4d70-4b84-98a1-5e3f521f24d0"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 0c39780f-1dd6-42a3-9b6f-9b4ab151b7f6
Content-Length: 402
X-Content-Type-Options: nosniff