Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Create a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-39b0a56f-4c36-4e0d-9f1f-36a789955ea2/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.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDF9.1dixSasz-ym_gfUR2iPUNxYvzSYaFiQWiVl0QFn2rB0
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-39b0a56f-4c36-4e0d-9f1f-36a789955ea2/packages" -d '{
  "type": "docker",
  "url": "docker://cloudfoundry/runtime-ci"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTQzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxNDF9.1dixSasz-ym_gfUR2iPUNxYvzSYaFiQWiVl0QFn2rB0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "789bdc71-b83f-4af0-8c8d-addb102fd2ef",
  "type": "docker",
  "hash": null,
  "url": "docker://cloudfoundry/runtime-ci",
  "state": "READY",
  "error": null,
  "created_at": "2015-04-15T00:55:41Z",
  "updated_at": null,
  "_links": {
    "self": {
      "href": "/v3/packages/789bdc71-b83f-4af0-8c8d-addb102fd2ef"
    },
    "app": {
      "href": "/v3/apps/guid-39b0a56f-4c36-4e0d-9f1f-36a789955ea2"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 271f632c-0c55-40e4-ad47-a15469107e24
Content-Length: 424
X-Content-Type-Options: nosniff