Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-cbcc4002-964a-47de-8895-ec1955dd2b86/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.eyJ1c2VyX2lkIjoidWFhLWlkLTI2NCIsImVtYWlsIjoiZW1haWwtMTkyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzE2NDY2Mzh9.i73phqX81xLcmh7MExmuCC9PixMBAq7QweNzq4rK6Aw
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-cbcc4002-964a-47de-8895-ec1955dd2b86/packages" -d '{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2NCIsImVtYWlsIjoiZW1haWwtMTkyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzE2NDY2Mzh9.i73phqX81xLcmh7MExmuCC9PixMBAq7QweNzq4rK6Aw" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "f9be4bee-1a89-4888-bf07-6e59ce656138",
  "type": "docker",
  "hash": null,
  "url": "docker://cloudfoundry/runtime-ci",
  "state": "READY",
  "error": null,
  "created_at": "2015-05-07T23:37:18Z",
  "updated_at": null,
  "_links": {
    "self": {
      "href": "/v3/packages/f9be4bee-1a89-4888-bf07-6e59ce656138"
    },
    "app": {
      "href": "/v3/apps/guid-cbcc4002-964a-47de-8895-ec1955dd2b86"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 6de10229-c555-43c9-8d37-bf677ce238ac
Content-Length: 424
X-Content-Type-Options: nosniff