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.
POST /v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20151130-23123-d8qwjy%2Fapplication.zip
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MjN9.mumqR2y1fybQkUcqgt7SShNUNn9BFoI8rU5yjcLBUUw Host: example.org Content-Type: application/x-www-form-urlencoded Cookie:
curl "https://api.[your-domain.com]/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20151130-23123-d8qwjy%2Fapplication.zip' -X POST \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MjN9.mumqR2y1fybQkUcqgt7SShNUNn9BFoI8rU5yjcLBUUw" \ -H "Host: example.org" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Cookie: "
200 OK
{ "guid": "guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0", "type": "bits", "data": { "hash": { "type": "sha1", "value": null }, "error": null }, "state": "PROCESSING_UPLOAD", "created_at": "2015-11-30T23:38:43Z", "updated_at": "2015-11-30T23:38:43Z", "links": { "self": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0" }, "upload": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/upload", "method": "POST" }, "download": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/download", "method": "GET" }, "stage": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/droplets", "method": "POST" }, "app": { "href": "/v3/apps/guid-fd7eb7fb-538c-429b-a811-01e0e4ab14fa" } } }
X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Type: application/json; charset=utf-8 X-Runtime: 0.027065 Content-Length: 860
GET /v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MjN9.mumqR2y1fybQkUcqgt7SShNUNn9BFoI8rU5yjcLBUUw Host: example.org Cookie:
curl "https://api.[your-domain.com]/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0" -X GET \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MjN9.mumqR2y1fybQkUcqgt7SShNUNn9BFoI8rU5yjcLBUUw" \ -H "Host: example.org" \ -H "Cookie: "
200 OK
{ "guid": "guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0", "type": "bits", "data": { "hash": { "type": "sha1", "value": "deb651865fca6aaf6340fbf1fa5fa5b231ba4ac5" }, "error": null }, "state": "READY", "created_at": "2015-11-30T23:38:43Z", "updated_at": "2015-11-30T23:38:43Z", "links": { "self": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0" }, "upload": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/upload", "method": "POST" }, "download": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/download", "method": "GET" }, "stage": { "href": "/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/droplets", "method": "POST" }, "app": { "href": "/v3/apps/guid-fd7eb7fb-538c-429b-a811-01e0e4ab14fa" } } }
X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Type: application/json; charset=utf-8 X-Runtime: 0.015319 Content-Length: 886
GET /v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/download
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MjN9.mumqR2y1fybQkUcqgt7SShNUNn9BFoI8rU5yjcLBUUw Host: example.org Cookie:
curl "https://api.[your-domain.com]/v3/packages/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0/download" -X GET \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwOCIsImVtYWlsIjoiZW1haWwtMTM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MjN9.mumqR2y1fybQkUcqgt7SShNUNn9BFoI8rU5yjcLBUUw" \ -H "Host: example.org" \ -H "Cookie: "
302 Found
X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Location: https://cc-packages.s3.amazonaws.com/gu/id/guid-3f2cfe5d-6a22-40ed-b5ee-b09c1df7dcb0?X-Amz-Expires=3600&X-Amz-Date=20151130T233844Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20151130/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=ecd67473bf6b681e552423c4dbd153e6a99c61a1300074034b55e5f31fe065b9 Content-Type: text/html; charset=utf-8 X-Runtime: 0.017694 Content-Length: 424