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-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20151015-23084-1ulyn9j%2Fapplication.zip

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NTd9.Zqfp3AN_zW4LcEKcwHC9QCSwTn99ztwwk-8KXkgrmh4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20151015-23084-1ulyn9j%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NTd9.Zqfp3AN_zW4LcEKcwHC9QCSwTn99ztwwk-8KXkgrmh4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2",
  "type": "bits",
  "data": {
    "hash": {
      "type": "sha1",
      "value": null
    },
    "error": null
  },
  "url": null,
  "state": "PROCESSING_UPLOAD",
  "created_at": "2015-10-15T23:52:37Z",
  "updated_at": "2015-10-15T23:52:37Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2"
    },
    "upload": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-376a569f-b95b-44cf-b8f7-77edc86bf116"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 5ff3e830-54cf-40c4-9149-c8e0686cc150
Content-Length: 875
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NTd9.Zqfp3AN_zW4LcEKcwHC9QCSwTn99ztwwk-8KXkgrmh4
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NTd9.Zqfp3AN_zW4LcEKcwHC9QCSwTn99ztwwk-8KXkgrmh4" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2",
  "type": "bits",
  "data": {
    "hash": {
      "type": "sha1",
      "value": "9298c639405091c0d0b8d1c95a7a4698a9c0cb26"
    },
    "error": null
  },
  "url": null,
  "state": "READY",
  "created_at": "2015-10-15T23:52:37Z",
  "updated_at": "2015-10-15T23:52:37Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2"
    },
    "upload": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-376a569f-b95b-44cf-b8f7-77edc86bf116"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 6c607964-a51d-4501-8047-6cdc4160df23
Content-Length: 901
X-Content-Type-Options: nosniff

Request

Route

GET /v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/download

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NTd9.Zqfp3AN_zW4LcEKcwHC9QCSwTn99ztwwk-8KXkgrmh4
Host: example.org
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-e42c2d0a-4b3b-4b05-9968-d9dac44277d2/download" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NCIsImVtYWlsIjoiZW1haWwtMTk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NTd9.Zqfp3AN_zW4LcEKcwHC9QCSwTn99ztwwk-8KXkgrmh4" \
	-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-e42c2d0a-4b3b-4b05-9968-d9dac44277d2?X-Amz-Expires=3600&X-Amz-Date=20151015T235238Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20151015/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=41a7e6195640ca58119b45d6496b3d2e9a7a604867c8b0fe55f602b4ed7e6ae5
X-VCAP-Request-ID: 5ccfed09-11f7-4a6e-8236-f1e58e3f6bbe
Content-Length: 0
X-Content-Type-Options: nosniff