Home
Version 3
Apps API

Apps API

Uploads the bits for an App

PUT /v2/apps/:guid/bits

Defines and uploads the bits (artifacts and dependencies) that this application needs to run, using a multipart PUT request. Bits that have already been uploaded can be referenced by their resource fingerprint(s). Bits that have not already been uploaded to Cloud Foundry must be included as a zipped binary file named "application".

Request

Route

PUT /v2/apps/dc0176c4-2675-4268-9b1d-c4c365c6bfe6/bits

Parameters

Name Description Valid Values Example Values
guid The guid of the App
async If true, a new asynchronous job is submitted to persist the bits and the job id is included in the response. The client will need to poll the job's status until persistence is completed successfully. If false, the request will block until the bits are persisted synchronously. Defaults to false.

Body

Name Description Default Valid Values Example Values
resources Fingerprints of the application bits that have previously been pushed to Cloud Foundry. Each fingerprint must include the file path, sha1 hash, and file size in bytes. Fingerprinted bits MUST exist in the Cloud Foundry resource cache or the request (or job, if async) will fail.
  • [{"fn":"path/to/content.txt","size":123,"sha1":"b907173290db6a155949ab4dc9b2d019dea0c901"},{"fn":"path/to/code.jar","size":123,"sha1":"ff84f89760317996b9dd180ab996b079f418396f"}]
application A binary zip file containing the application bits.
--AaB03x
Content-Disposition: form-data; name="async"

true
--AaB03x
Content-Disposition: form-data; name="resources"

[{"fn":"path/to/content.txt","size":123,"sha1":"b907173290db6a155949ab4dc9b2d019dea0c901"},{"fn":"path/to/code.jar","size":123,"sha1":"ff84f89760317996b9dd180ab996b079f418396f"}]
--AaB03x
Content-Disposition: form-data; name="application"; filename="application.zip"
Content-Type: application/zip
Content-Length: 123
Content-Transfer-Encoding: binary

<<binary artifact bytes>>
--AaB03x

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxIiwiZW1haWwiOiJlbWFpbC00MUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI1OTQ4NjU5fQ.zYULNsFHAytessCodMSi-b9rkPtRwYmy9uzLod6PcKg
Host: example.org
Content-Type: multipart/form-data; boundary=AaB03x
Cookie: 

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "c4c68908-6b41-494f-ad52-7f0e0569b8f0",
    "created_at": "2015-03-03T00:50:59Z",
    "url": "/v2/jobs/c4c68908-6b41-494f-ad52-7f0e0569b8f0"
  },
  "entity": {
    "guid": "c4c68908-6b41-494f-ad52-7f0e0569b8f0",
    "status": "queued"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 1eab5dfb-e636-4497-aa01-ca0a1f3edc7e
Content-Length: 270
X-Content-Type-Options: nosniff