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-2915cfb0-424f-45c0-9a9c-51a8578db9e8/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20150930-23090-1elblh8%2Fapplication.zip

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20150930-23090-1elblh8%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3MSIsImVtYWlsIjoiZW1haWwtMTY4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDd9.rQhAi8gYFVWsVQD6Tf9Fe6TUCWD2VREgrgbvJI9A5gE" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8",
  "type": "bits",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": null,
  "state": "PROCESSING_UPLOAD",
  "error": null,
  "created_at": "2015-09-30T23:30:47Z",
  "updated_at": "2015-09-30T23:30:47Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8"
    },
    "upload": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-43a1a35a-4e67-4d59-a939-72d7060b0fd6"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 490e0219-8514-4a13-b44f-5fbcd98d553f
Content-Length: 849
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3MSIsImVtYWlsIjoiZW1haWwtMTY4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDd9.rQhAi8gYFVWsVQD6Tf9Fe6TUCWD2VREgrgbvJI9A5gE
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3MSIsImVtYWlsIjoiZW1haWwtMTY4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDd9.rQhAi8gYFVWsVQD6Tf9Fe6TUCWD2VREgrgbvJI9A5gE" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8",
  "type": "bits",
  "hash": {
    "type": "sha1",
    "value": "79750b24b6456ec264884b0d14d16d4773ea1bb1"
  },
  "url": null,
  "state": "READY",
  "error": null,
  "created_at": "2015-09-30T23:30:47Z",
  "updated_at": "2015-09-30T23:30:47Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8"
    },
    "upload": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-43a1a35a-4e67-4d59-a939-72d7060b0fd6"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 5a77f400-6b32-4134-a377-e0e32fa77d6b
Content-Length: 875
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3MSIsImVtYWlsIjoiZW1haWwtMTY4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDd9.rQhAi8gYFVWsVQD6Tf9Fe6TUCWD2VREgrgbvJI9A5gE
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-2915cfb0-424f-45c0-9a9c-51a8578db9e8/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3MSIsImVtYWlsIjoiZW1haWwtMTY4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDd9.rQhAi8gYFVWsVQD6Tf9Fe6TUCWD2VREgrgbvJI9A5gE" \
	-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-2915cfb0-424f-45c0-9a9c-51a8578db9e8?X-Amz-Expires=3600&X-Amz-Date=20150930T233047Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20150930/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=7bf2bf6c2922337a14d4621a11e0cc63d3bc26daf0313736d9b896f7972e0358
X-VCAP-Request-ID: 6003557e-ce1a-4bc1-a0f1-4fbc46d17a73
Content-Length: 0
X-Content-Type-Options: nosniff