Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-e268e354-e8f1-44dc-aa32-a97d1cf377bd/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.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MSIsImVtYWlsIjoiZW1haWwtMTM3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDE2NjI2MDR9.fQzMd1ZFGZLWFdX0Uo11Atyeww7ZL4UW4hvs0XQavBA
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-e268e354-e8f1-44dc-aa32-a97d1cf377bd/packages" -d '{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MSIsImVtYWlsIjoiZW1haWwtMTM3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDE2NjI2MDR9.fQzMd1ZFGZLWFdX0Uo11Atyeww7ZL4UW4hvs0XQavBA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "bcf14b85-9b3a-48cc-b709-b109902ba89a",
  "type": "docker",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": "docker://cloudfoundry/runtime-ci",
  "state": "READY",
  "error": null,
  "created_at": "2015-08-31T21:50:04Z",
  "updated_at": null,
  "_links": {
    "self": {
      "href": "/v3/packages/bcf14b85-9b3a-48cc-b709-b109902ba89a"
    },
    "app": {
      "href": "/v3/apps/guid-e268e354-e8f1-44dc-aa32-a97d1cf377bd"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: c52dd3a1-8297-41ec-bd83-a464883d1503
Content-Length: 463
X-Content-Type-Options: nosniff