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.
PUT /v2/resource_match
[ { "sha1": "c6d1b1640cd803bb1523b10bfce35238220aacf1", "size": 36 }, { "sha1": "a9993e364706816aba3e25717850c26c9cd0d89d", "size": 1 } ]
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwMCIsImVtYWlsIjoiZW1haWwtNjlAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MTk1ODM5NH0.uylT8ZDSZsBEYhcSL0E9XQDodFoANay-fDbUDm8OMqQ Host: example.org Content-Type: application/x-www-form-urlencoded Cookie:
curl "https://api.[your-domain.com]/v2/resource_match" -d '[ { "sha1": "c6d1b1640cd803bb1523b10bfce35238220aacf1", "size": 36 }, { "sha1": "a9993e364706816aba3e25717850c26c9cd0d89d", "size": 1 } ]' -X PUT \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwMCIsImVtYWlsIjoiZW1haWwtNjlAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MTk1ODM5NH0.uylT8ZDSZsBEYhcSL0E9XQDodFoANay-fDbUDm8OMqQ" \ -H "Host: example.org" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Cookie: "
200 OK
[ { "sha1": "c6d1b1640cd803bb1523b10bfce35238220aacf1", "size": 36 } ]
Content-Type: application/json;charset=utf-8 X-VCAP-Request-ID: 417f49b7-3e1e-4b93-b34f-03bb46e3863d Content-Length: 63 X-Content-Type-Options: nosniff