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/ea93748b-a480-47e3-b2c2-1e159d9bd182/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.eyJ1c2VyX2lkIjoidWFhLWlkLTUyIiwiZW1haWwiOiJlbWFpbC01MUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM1MTAyODQ3fQ.W54BV9vCLEWSPYgknWf-mB2_JK45SpN6kmPNSM0M9eQ
Host: example.org
Content-Type: multipart/form-data; boundary=AaB03x
Cookie: 

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "624b7176-41e8-430e-a4bc-6b74b906ffbf",
    "created_at": "2015-06-16T23:40:47Z",
    "url": "/v2/jobs/624b7176-41e8-430e-a4bc-6b74b906ffbf"
  },
  "entity": {
    "guid": "624b7176-41e8-430e-a4bc-6b74b906ffbf",
    "status": "queued"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: bde8d5ed-ee2b-4062-89e2-a8c8beba643e
Content-Length: 270
X-Content-Type-Options: nosniff