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-e036ecfe-35d3-482d-a6da-5276a9d4d01e/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20151013-23073-iboity%2Fapplication.zip

Headers

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

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20151013-23073-iboity%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MiIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDN9.t6zP48PtoKVSRaBqhJLEpYmMnN1qEOPTfWsQ7rgHioM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e",
  "type": "bits",
  "data": {
    "hash": {
      "type": "sha1",
      "value": null
    },
    "error": null
  },
  "url": null,
  "state": "PROCESSING_UPLOAD",
  "created_at": "2015-10-13T17:31:43Z",
  "updated_at": "2015-10-13T17:31:43Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e"
    },
    "upload": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-9976b72b-6a91-4bf3-a121-cfd7a1a13120"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 5fb6e83a-01b2-4f82-a0e4-4533d33907e1
Content-Length: 875
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MiIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDN9.t6zP48PtoKVSRaBqhJLEpYmMnN1qEOPTfWsQ7rgHioM
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MiIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDN9.t6zP48PtoKVSRaBqhJLEpYmMnN1qEOPTfWsQ7rgHioM" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e",
  "type": "bits",
  "data": {
    "hash": {
      "type": "sha1",
      "value": "c208eb242623961e0a1f64379487fde8171a852b"
    },
    "error": null
  },
  "url": null,
  "state": "READY",
  "created_at": "2015-10-13T17:31:43Z",
  "updated_at": "2015-10-13T17:31:43Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e"
    },
    "upload": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-9976b72b-6a91-4bf3-a121-cfd7a1a13120"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 53d82e4d-669a-4208-bbd0-24f6b3c0e6c5
Content-Length: 901
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MiIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDN9.t6zP48PtoKVSRaBqhJLEpYmMnN1qEOPTfWsQ7rgHioM
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-e036ecfe-35d3-482d-a6da-5276a9d4d01e/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MiIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDUzNjIzMDN9.t6zP48PtoKVSRaBqhJLEpYmMnN1qEOPTfWsQ7rgHioM" \
	-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-e036ecfe-35d3-482d-a6da-5276a9d4d01e?X-Amz-Expires=3600&X-Amz-Date=20151013T173143Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20151013/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=e78bb4f1b8be1678cc19d5a0885eb32c7643751f29280cd9327da4393f4f8b19
X-VCAP-Request-ID: c15aaaca-26ca-4c44-a946-e927c03fe080
Content-Length: 0
X-Content-Type-Options: nosniff