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": "4c7b39643c07111a384bd8fcaa23d128c6414fbb",
    "size": 36
  },
  {
    "sha1": "a9993e364706816aba3e25717850c26c9cd0d89d",
    "size": 1
  }
]

Headers

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

cURL

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

Response

Status

200 OK

Body

[
  {
    "sha1": "4c7b39643c07111a384bd8fcaa23d128c6414fbb",
    "size": 36
  }
]

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: ead0865d-95c1-4c00-b60d-31f0d79454f3
Content-Length: 63
X-Content-Type-Options: nosniff