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-90b8875c-8456-468e-a6e2-d4f0640d1524/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20150806-23095-crtucp%2Fapplication.zip

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20150806-23095-crtucp%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MiIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTV9.D1Hun_gpa2bFwEl6CJYIpX9zSMGifRkcAA4RAFThVSI" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-90b8875c-8456-468e-a6e2-d4f0640d1524",
  "type": "bits",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": null,
  "state": "PROCESSING_UPLOAD",
  "error": null,
  "created_at": "2015-08-06T00:36:55Z",
  "updated_at": "2015-08-06T00:36:55Z",
  "_links": {
    "self": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524"
    },
    "upload": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-b5e407a4-997a-48c4-a707-5685f9a5cd8a"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 2b19c529-7c6c-421b-ab9b-26628aca1ff4
Content-Length: 850
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MiIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTV9.D1Hun_gpa2bFwEl6CJYIpX9zSMGifRkcAA4RAFThVSI
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MiIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTV9.D1Hun_gpa2bFwEl6CJYIpX9zSMGifRkcAA4RAFThVSI" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-90b8875c-8456-468e-a6e2-d4f0640d1524",
  "type": "bits",
  "hash": {
    "type": "sha1",
    "value": "e2fbe0e25102dfe99c08d5fcd3c3f1ec290e73b8"
  },
  "url": null,
  "state": "READY",
  "error": null,
  "created_at": "2015-08-06T00:36:55Z",
  "updated_at": "2015-08-06T00:36:55Z",
  "_links": {
    "self": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524"
    },
    "upload": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-b5e407a4-997a-48c4-a707-5685f9a5cd8a"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: ac768447-2fd4-4059-931f-9f27025987d6
Content-Length: 876
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MiIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTV9.D1Hun_gpa2bFwEl6CJYIpX9zSMGifRkcAA4RAFThVSI
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-90b8875c-8456-468e-a6e2-d4f0640d1524/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM5MiIsImVtYWlsIjoiZW1haWwtMjgyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTV9.D1Hun_gpa2bFwEl6CJYIpX9zSMGifRkcAA4RAFThVSI" \
	-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-90b8875c-8456-468e-a6e2-d4f0640d1524?X-Amz-Expires=3600&X-Amz-Date=20150806T003655Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20150806/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=e9668f2403b63c7181ae813c8d12115e543f07a09293c353a0a64eb0058802a4
X-VCAP-Request-ID: 8e7da2ac-d3fe-492a-9a0f-2da84979a3c1
Content-Length: 0
X-Content-Type-Options: nosniff