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-1a5fc678-e74a-4e36-a3fc-08944e43d229/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20160113-23135-p82v2n%2Fapplication.zip

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NCIsImVtYWlsIjoiZW1haWwtMjU1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.3cQ-vHaiKRdvuKnvThcKVFgKbk9QEYLZakhF0aujcC8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20160113-23135-p82v2n%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NCIsImVtYWlsIjoiZW1haWwtMjU1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.3cQ-vHaiKRdvuKnvThcKVFgKbk9QEYLZakhF0aujcC8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-1a5fc678-e74a-4e36-a3fc-08944e43d229",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": null
    }
  },
  "state": "PROCESSING_UPLOAD",
  "created_at": "2016-01-13T17:29:49Z",
  "updated_at": "2016-01-13T17:29:49Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229"
    },
    "upload": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-d438951e-1e5f-4a18-a49a-574536242734"
    }
  }
}

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

Request

Route

GET /v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NCIsImVtYWlsIjoiZW1haWwtMjU1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.3cQ-vHaiKRdvuKnvThcKVFgKbk9QEYLZakhF0aujcC8
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NCIsImVtYWlsIjoiZW1haWwtMjU1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.3cQ-vHaiKRdvuKnvThcKVFgKbk9QEYLZakhF0aujcC8" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-1a5fc678-e74a-4e36-a3fc-08944e43d229",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": "1f3b5f1162e00133e3c2265d1998d59ebb7ef427"
    }
  },
  "state": "READY",
  "created_at": "2016-01-13T17:29:49Z",
  "updated_at": "2016-01-13T17:29:49Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229"
    },
    "upload": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-d438951e-1e5f-4a18-a49a-574536242734"
    }
  }
}

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

Request

Route

GET /v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NCIsImVtYWlsIjoiZW1haWwtMjU1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.3cQ-vHaiKRdvuKnvThcKVFgKbk9QEYLZakhF0aujcC8
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-1a5fc678-e74a-4e36-a3fc-08944e43d229/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM4NCIsImVtYWlsIjoiZW1haWwtMjU1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODl9.3cQ-vHaiKRdvuKnvThcKVFgKbk9QEYLZakhF0aujcC8" \
	-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-1a5fc678-e74a-4e36-a3fc-08944e43d229?X-Amz-Expires=3600&X-Amz-Date=20160113T172950Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20160113/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=f3b67ecfaf6568dba4289a4c878dbf1f78e8db1f14433887a12b3e3e4728151f
Content-Type: text/html; charset=utf-8
X-Runtime: 0.013195
Content-Length: 424