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.
If the resource_matching feature flag is disabled, resource matching will always return an empty array.
PUT /v2/resource_match
[ { "sha1": "002d760bea1be268e27077412e11a320d0f164d3", "size": 36 }, { "sha1": "a9993e364706816aba3e25717850c26c9cd0d89d", "size": 1 } ]
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0MCIsImVtYWlsIjoiZW1haWwtMjM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg5MDB9.Jpw9QysYfAb7Ztlx7u_RDaBTpOnqsqCBUzjPykUVwc8 Host: example.org Content-Type: application/json Cookie:
curl "https://api.[your-domain.com]/v2/resource_match" -d '[ { "sha1": "002d760bea1be268e27077412e11a320d0f164d3", "size": 36 }, { "sha1": "a9993e364706816aba3e25717850c26c9cd0d89d", "size": 1 } ]' -X PUT \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0MCIsImVtYWlsIjoiZW1haWwtMjM1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg5MDB9.Jpw9QysYfAb7Ztlx7u_RDaBTpOnqsqCBUzjPykUVwc8" \ -H "Host: example.org" \ -H "Content-Type: application/json" \ -H "Cookie: "
200 OK
[ { "sha1": "002d760bea1be268e27077412e11a320d0f164d3", "size": 36 } ]
Content-Type: application/json;charset=utf-8 X-VCAP-Request-ID: 7e3d4770-d1cd-4915-84a3-86e2301bd08e Content-Length: 63 X-Content-Type-Options: nosniff