Post Resource Matches

Post Resource Matches
Create a resource match

This endpoint returns a list of cached resources from the input list.

This endpoint matches given resource SHA-1/file size pairs against the Cloud Controller cache and reports the subset that describes already cached files. This is usually used to avoid uploading duplicate files when pushing an app which has only been partially changed. The path and mode fields are not used when matching.

When uploading package bits, the response from this endpoint should be used as the resources form field. As such, it is useful to include the path and mode fields for each resource even though they are not used when determining a resource match.

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.

Request
URI
POST
https://api.example.local/v3/resource_matches
COPY
Request Body

Show optional properties

{
    "resources": [
        {}
    ]
}
{
    "resources": [
        {
            "checksum": {
                "value": "string"
            },
            "size_in_bytes": 0,
            "path": "string"
        }
    ]
}
array of object
resources
Required

List of resources to check for in the resource cache

Authentication
This operation uses the following authentication methods.
Responses
201

Created

Returns ResourceMatch of type(s) application/json
{
    "resources": [
        {
            "checksum": {
                "value": "string"
            },
            "size_in_bytes": 0,
            "path": "string",
            "mode": "string"
        }
    ]
}
array of object
resources
Optional

resources


400

Bad Request

Returns BadRequest of type(s) application/json
{
    "errors": [
        {
            "code": 0,
            "detail": "string",
            "title": "string"
        }
    ]
}
array of object
errors
Optional

errors


401

Unauthorized

Returns Unauthorized of type(s) application/json
{
    "errors": [
        {
            "code": 0,
            "detail": "string",
            "title": "string"
        }
    ]
}
array of object
errors
Optional

errors


403

Forbidden

Returns Forbidden of type(s) application/json
{
    "errors": [
        {
            "code": 0,
            "detail": "string",
            "title": "string"
        }
    ]
}
array of object
errors
Optional

errors


409

Conflict

Returns Conflict of type(s) application/json
{
    "errors": [
        {
            "code": 0,
            "detail": "string",
            "title": "string"
        }
    ]
}
array of object
errors
Optional

errors


422

Unprocessable Entity

Returns UnprocessableEntity of type(s) application/json
{
    "errors": [
        {
            "code": 0,
            "detail": "string",
            "title": "string"
        }
    ]
}
array of object
errors
Optional

errors


500

Internal Server Error

Returns 500 of type(s) application/json
{
    "errors": [
        {
            "code": 0,
            "detail": "string",
            "title": "string"
        }
    ]
}
array of object
errors
Optional

errors


503

Service Unavailable

Returns ServiceUnavailable of type(s) application/json
{
    "errors": [
        {
            "code": 0,
            "detail": "string",
            "title": "string"
        }
    ]
}
array of object
errors
Optional

errors


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"resources":["object"]}' https://{api_host}/v3/resource_matches