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-84f1f341-71b1-4238-ad2f-74a26512ec07/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20151113-23102-155x2vg%2Fapplication.zip

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20151113-23102-155x2vg%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NCIsImVtYWlsIjoiZW1haWwtMzMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.YdpyRMrkyncAhQg8SoY_BXNiQ2v0T7lT9zvhVrB6j00" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-84f1f341-71b1-4238-ad2f-74a26512ec07",
  "type": "bits",
  "data": {
    "hash": {
      "type": "sha1",
      "value": null
    },
    "error": null
  },
  "state": "PROCESSING_UPLOAD",
  "created_at": "2015-11-13T17:02:56Z",
  "updated_at": "2015-11-13T17:02:56Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07"
    },
    "upload": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-3be0036a-cbfc-401b-9ff4-d3e0a972e3c2"
    }
  }
}

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.026127
Content-Length: 860

Request

Route

GET /v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NCIsImVtYWlsIjoiZW1haWwtMzMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.YdpyRMrkyncAhQg8SoY_BXNiQ2v0T7lT9zvhVrB6j00
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NCIsImVtYWlsIjoiZW1haWwtMzMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.YdpyRMrkyncAhQg8SoY_BXNiQ2v0T7lT9zvhVrB6j00" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-84f1f341-71b1-4238-ad2f-74a26512ec07",
  "type": "bits",
  "data": {
    "hash": {
      "type": "sha1",
      "value": "89642f4f73bc3fd0e0e674d1e6ec575c2be35784"
    },
    "error": null
  },
  "state": "READY",
  "created_at": "2015-11-13T17:02:56Z",
  "updated_at": "2015-11-13T17:02:56Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07"
    },
    "upload": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-3be0036a-cbfc-401b-9ff4-d3e0a972e3c2"
    }
  }
}

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.014112
Content-Length: 886

Request

Route

GET /v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NCIsImVtYWlsIjoiZW1haWwtMzMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.YdpyRMrkyncAhQg8SoY_BXNiQ2v0T7lT9zvhVrB6j00
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-84f1f341-71b1-4238-ad2f-74a26512ec07/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NCIsImVtYWlsIjoiZW1haWwtMzMxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDgwMzg5NzZ9.YdpyRMrkyncAhQg8SoY_BXNiQ2v0T7lT9zvhVrB6j00" \
	-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-84f1f341-71b1-4238-ad2f-74a26512ec07?X-Amz-Expires=3600&X-Amz-Date=20151113T170256Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20151113/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=575574e710e65f369add0ccc964a40b0410d64c75c766bfb5b9f71c8a5c6cf67
Content-Type: text/html; charset=utf-8
X-Runtime: 0.016058
Content-Length: 424