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-2a037128-8207-4792-af13-e2c1a47104c5/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20150911-23106-1onmvqc%2Fapplication.zip

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20150911-23106-1onmvqc%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2OCIsImVtYWlsIjoiZW1haWwtMjY1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDh9.mIVLDUjFZNTPHojzWZ1_kyIyDzcjMhnkrlccbAGDjFM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-2a037128-8207-4792-af13-e2c1a47104c5",
  "type": "bits",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": null,
  "state": "PROCESSING_UPLOAD",
  "error": null,
  "created_at": "2015-09-11T18:39:08Z",
  "updated_at": "2015-09-11T18:39:08Z",
  "_links": {
    "self": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5"
    },
    "upload": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-3fef41c2-0596-481a-ab79-cd789375b619"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: f831e1d1-3bd4-407f-b74e-9596e3f54b3e
Content-Length: 850
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2OCIsImVtYWlsIjoiZW1haWwtMjY1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDh9.mIVLDUjFZNTPHojzWZ1_kyIyDzcjMhnkrlccbAGDjFM
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2OCIsImVtYWlsIjoiZW1haWwtMjY1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDh9.mIVLDUjFZNTPHojzWZ1_kyIyDzcjMhnkrlccbAGDjFM" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-2a037128-8207-4792-af13-e2c1a47104c5",
  "type": "bits",
  "hash": {
    "type": "sha1",
    "value": "0d902c8c1708d659e3db81779884972cd2541d6a"
  },
  "url": null,
  "state": "READY",
  "error": null,
  "created_at": "2015-09-11T18:39:08Z",
  "updated_at": "2015-09-11T18:39:08Z",
  "_links": {
    "self": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5"
    },
    "upload": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-3fef41c2-0596-481a-ab79-cd789375b619"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 04613f07-da6c-43b6-abad-2cb79c6d24e8
Content-Length: 876
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2OCIsImVtYWlsIjoiZW1haWwtMjY1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDh9.mIVLDUjFZNTPHojzWZ1_kyIyDzcjMhnkrlccbAGDjFM
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-2a037128-8207-4792-af13-e2c1a47104c5/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2OCIsImVtYWlsIjoiZW1haWwtMjY1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDh9.mIVLDUjFZNTPHojzWZ1_kyIyDzcjMhnkrlccbAGDjFM" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

302 Found

Headers

Content-Type: application/json;charset=utf-8
Location: https://cc-packages.s3.amazonaws.com/gu/id/guid-2a037128-8207-4792-af13-e2c1a47104c5?X-Amz-Expires=3600&X-Amz-Date=20150911T183908Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20150911/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=a6edda641615174d98b05b472645cee6b7c21aaac587b6f040e0a8b6cee4d1af
X-VCAP-Request-ID: 1c102da7-3c9e-4585-8b78-aee57ba4231b
Content-Length: 0
X-Content-Type-Options: nosniff