Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Download the bits for a package

GET /v3/packages/:guid/download

When using a remote blobstore, such as AWS, the response is a redirect to the actual location of the bits. If the client is automatically following redirects, then the OAuth token that was used to communicate with Cloud Controller will be replayed on the new redirect request. Some blobstores may reject the request in that case. Clients may need to follow the redirect without including the OAuth token.

Request

Route

POST /v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20160219-24373-1f6o5uj%2Fapplication.zip

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20160219-24373-1f6o5uj%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-b52cf015-9866-473e-9e51-55926e639470",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": null
    }
  },
  "state": "PROCESSING_UPLOAD",
  "created_at": "2016-02-19T02:03:41Z",
  "updated_at": "2016-02-19T02:03:41Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470"
    },
    "upload": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-62ef2f07-a028-4875-b192-9ee510d80ec5"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.022041
Content-Length: 860

Request

Route

GET /v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-b52cf015-9866-473e-9e51-55926e639470",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": "f7dc8b22b2abfa8d90b6d421660613025d861438"
    }
  },
  "state": "READY",
  "created_at": "2016-02-19T02:03:41Z",
  "updated_at": "2016-02-19T02:03:41Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470"
    },
    "upload": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-62ef2f07-a028-4875-b192-9ee510d80ec5"
    }
  }
}

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
X-Runtime: 0.014168
Content-Length: 886

Request

Route

GET /v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

302 Found

Body

You are being redirected.

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Location: https://cc-packages.s3.amazonaws.com/gu/id/guid-b52cf015-9866-473e-9e51-55926e639470?X-Amz-Expires=3600&X-Amz-Date=20160219T020341Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20160219/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=69103cb29a7b83392603283fec9a7dd991b63f8698188b1488d91672530fbdd8
Content-Type: text/html; charset=utf-8
X-Runtime: 0.015585
Content-Length: 424