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-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20160119-23197-1rhayu8%2Fapplication.zip

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OCIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzR9.z3bTJJthbBS-sEWVclTLsW6Af7xjnUZFNpQx4iRWcUU
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20160119-23197-1rhayu8%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OCIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzR9.z3bTJJthbBS-sEWVclTLsW6Af7xjnUZFNpQx4iRWcUU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": null
    }
  },
  "state": "PROCESSING_UPLOAD",
  "created_at": "2016-01-19T19:41:14Z",
  "updated_at": "2016-01-19T19:41:14Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c"
    },
    "upload": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-a6b6c9f6-a473-40f3-babe-f3d28ef25722"
    }
  }
}

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

Request

Route

GET /v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OCIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzR9.z3bTJJthbBS-sEWVclTLsW6Af7xjnUZFNpQx4iRWcUU
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OCIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzR9.z3bTJJthbBS-sEWVclTLsW6Af7xjnUZFNpQx4iRWcUU" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c",
  "type": "bits",
  "data": {
    "error": null,
    "hash": {
      "type": "sha1",
      "value": "0655a014eb4378c6cf31795f2a2d023195bde532"
    }
  },
  "state": "READY",
  "created_at": "2016-01-19T19:41:14Z",
  "updated_at": "2016-01-19T19:41:14Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c"
    },
    "upload": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-a6b6c9f6-a473-40f3-babe-f3d28ef25722"
    }
  }
}

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

Request

Route

GET /v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OCIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzR9.z3bTJJthbBS-sEWVclTLsW6Af7xjnUZFNpQx4iRWcUU
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OCIsImVtYWlsIjoiZW1haWwtMTg0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTM4MzcyNzR9.z3bTJJthbBS-sEWVclTLsW6Af7xjnUZFNpQx4iRWcUU" \
	-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-0a85dc5b-91f6-4cd2-a8c2-f3772bfa2a1c?X-Amz-Expires=3600&X-Amz-Date=20160119T194114Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20160119/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=4a08e7640a7c8e8a42daeb055472d879a16d6199958ee36571ddc6b11d6c0426
Content-Type: text/html; charset=utf-8
X-Runtime: 0.016801
Content-Length: 424