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-7ff66289-5683-445a-9cdc-22f056d457d7/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20160317-24350-17mtz1c%2Fapplication.zip

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20160317-24350-17mtz1c%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1MyIsImVtYWlsIjoiZW1haWwtOTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2OX0.vJ21vHlOhtrxWXnzQXhTBKxeFceoWdX7frexGorkV0A" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-7ff66289-5683-445a-9cdc-22f056d457d7",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": null
    }
  },
  "state": "PROCESSING_UPLOAD",
  "created_at": "2016-03-17T21:41:09Z",
  "updated_at": "2016-03-17T21:41:09Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7"
    },
    "upload": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-45ec17aa-8926-4679-b178-ab108a72d0a4"
    }
  }
}

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

Request

Route

GET /v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1MyIsImVtYWlsIjoiZW1haWwtOTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2OX0.vJ21vHlOhtrxWXnzQXhTBKxeFceoWdX7frexGorkV0A
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1MyIsImVtYWlsIjoiZW1haWwtOTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2OX0.vJ21vHlOhtrxWXnzQXhTBKxeFceoWdX7frexGorkV0A" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-7ff66289-5683-445a-9cdc-22f056d457d7",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": "02a64550f70262631b4af50a797e2735732b5d4c"
    }
  },
  "state": "READY",
  "created_at": "2016-03-17T21:41:09Z",
  "updated_at": "2016-03-17T21:41:09Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7"
    },
    "upload": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-45ec17aa-8926-4679-b178-ab108a72d0a4"
    }
  }
}

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

Request

Route

GET /v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1MyIsImVtYWlsIjoiZW1haWwtOTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2OX0.vJ21vHlOhtrxWXnzQXhTBKxeFceoWdX7frexGorkV0A
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-7ff66289-5683-445a-9cdc-22f056d457d7/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1MyIsImVtYWlsIjoiZW1haWwtOTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2OX0.vJ21vHlOhtrxWXnzQXhTBKxeFceoWdX7frexGorkV0A" \
	-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-7ff66289-5683-445a-9cdc-22f056d457d7?X-Amz-Expires=3600&X-Amz-Date=20160317T214109Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20160317/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=24cf167af2b2b4085e33030136f7e73fd736d6f1f11128de3043f750277d97ff
Content-Type: text/html; charset=utf-8
X-Runtime: 0.014901
Content-Length: 424