Home
Version 3
Resource Match API

Resource Match API

List all matching resources

PUT /v2/resource_match

This endpoint matches given resource SHA / file size pairs against the Cloud Controller cache, and reports the subset which describes already existing files. This is usually used to avoid uploading duplicate files when pushing an app which has only been partially changed. Cloud Foundry operators may set minimum / maximum file sizes to match against. If the file size provided is outside this range, it will not be matched against.

Request

Route

PUT /v2/resource_match
[
  {
    "sha1": "2f907f0feff5e3c79eaeef81c9bbabb2bbb2ccbf",
    "size": 36
  },
  {
    "sha1": "a9993e364706816aba3e25717850c26c9cd0d89d",
    "size": 1
  }
]

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/resource_match" -d '[
  {
    "sha1": "2f907f0feff5e3c79eaeef81c9bbabb2bbb2ccbf",
    "size": 36
  },
  {
    "sha1": "a9993e364706816aba3e25717850c26c9cd0d89d",
    "size": 1
  }
]' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc5IiwiZW1haWwiOiJlbWFpbC00N0Bzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDUxNDEzNjc5fQ.M2Ze7lMUM2gRwLeoDwLNbYQS8RQyzPwKvuSN_3qc_tQ" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

[
  {
    "sha1": "2f907f0feff5e3c79eaeef81c9bbabb2bbb2ccbf",
    "size": 36
  }
]

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 
Content-Length: 63
X-Content-Type-Options: nosniff