Chapter 17. policy


Policy.

17.1. createOrganizationAutoPrunePolicy

Creates an auto-prune policy for the organization

Authorizations: oauth2_implicit (org:admin)

17.1.2. Path parameters

TypeNameDescriptionSchema

path

orgname

required

The name of the organization

string

17.1.3. Request body schema (application/json)

The policy configuration that is to be applied to the user namespace

NameDescriptionSchema

method

required

The method to use for pruning tags (number_of_tags, creation_date)

string

value

required

The value to use for the pruning method (number of tags e.g. 10, time delta e.g. 7d (7 days))

 

tagPattern

optional

Tags only matching this pattern will be pruned

string

tagPatternMatches

optional

Determine whether pruned tags should or should not match the tagPattern

boolean

17.1.4. Responses

HTTP CodeDescriptionSchema

201

Successful creation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.1.5. Example command

$ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags", "value": 10}' http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/

17.2. listOrganizationAutoPrunePolicies

Lists the auto-prune policies for the organization

Authorizations: oauth2_implicit (org:admin)

17.2.2. Path parameters

TypeNameDescriptionSchema

path

orgname

required

The name of the organization

string

17.2.3. Responses

HTTP CodeDescriptionSchema

200

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.2.4. Example command

$ curl -X GET "https://quay-server.example.com/api/v1/organization/example_org/autoprunepolicy/" \
  -H "Authorization: Bearer <your_access_token>"

17.3. getOrganizationAutoPrunePolicy

Fetches the auto-prune policy for the organization

Authorizations: oauth2_implicit (org:admin)

17.3.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

path

orgname

required

The name of the organization

string

17.3.3. Responses

HTTP CodeDescriptionSchema

200

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.3.4. Example command

$ curl -X GET -H "Authorization: Bearer <access_token>" http://<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/<policy_uuid>

17.4. deleteOrganizationAutoPrunePolicy

Deletes the auto-prune policy for the organization

Authorizations: oauth2_implicit (org:admin)

17.4.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

path

orgname

required

The name of the organization

string

17.4.3. Responses

HTTP CodeDescriptionSchema

204

Deleted

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.4.4. Example command

$ curl -X DELETE "https://quay-server.example.com/api/v1/organization/example_org/autoprunepolicy/example_policy_uuid" \
  -H "Authorization: Bearer <your_access_token>"

17.5. updateOrganizationAutoPrunePolicy

Updates the auto-prune policy for the organization

Authorizations: oauth2_implicit (org:admin)

17.5.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

path

orgname

required

The name of the organization

string

17.5.3. Request body schema (application/json)

The policy configuration that is to be applied to the user namespace

NameDescriptionSchema

method

required

The method to use for pruning tags (number_of_tags, creation_date)

string

value

required

The value to use for the pruning method (number of tags e.g. 10, time delta e.g. 7d (7 days))

 

tagPattern

optional

Tags only matching this pattern will be pruned

string

tagPatternMatches

optional

Determine whether pruned tags should or should not match the tagPattern

boolean

17.5.4. Responses

HTTP CodeDescriptionSchema

204

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.5.5. Example command

$ curl -X PUT   -H "Authorization: Bearer <bearer_token>"   -H "Content-Type: application/json"   -d '{
    "method": "creation_date",
    "value": "4d",
    "tagPattern": "^v*",
    "tagPatternMatches": true
  }'   "<quay-server.example.com>/api/v1/organization/<organization_name>/autoprunepolicy/<uuid>"

17.6. createRepositoryAutoPrunePolicy

Creates an auto-prune policy for the repository

Authorizations: oauth2_implicit (repo:admin)

17.6.2. Path parameters

TypeNameDescriptionSchema

path

repository

required

The full path of the repository. e.g. namespace/name

string

17.6.3. Request body schema (application/json)

The policy configuration that is to be applied to the user namespace

NameDescriptionSchema

method

required

The method to use for pruning tags (number_of_tags, creation_date)

string

value

required

The value to use for the pruning method (number of tags e.g. 10, time delta e.g. 7d (7 days))

 

tagPattern

optional

Tags only matching this pattern will be pruned

string

tagPatternMatches

optional

Determine whether pruned tags should or should not match the tagPattern

boolean

17.6.4. Responses

HTTP CodeDescriptionSchema

201

Successful creation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.6.5. Example command

$ curl -X POST -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"method": "number_of_tags","value": 2}' http://<quay-server.example.com>/api/v1/repository/<organization_name>/<repository_name>/autoprunepolicy/

17.7. listRepositoryAutoPrunePolicies

Lists the auto-prune policies for the repository

Authorizations: oauth2_implicit (repo:admin)

17.7.2. Path parameters

TypeNameDescriptionSchema

path

repository

required

The full path of the repository. e.g. namespace/name

string

17.7.3. Responses

HTTP CodeDescriptionSchema

200

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.7.4. Example command

$ curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/autoprunepolicy/" \
  -H "Authorization: Bearer <your_access_token>"

17.8. getRepositoryAutoPrunePolicy

Fetches the auto-prune policy for the repository

Authorizations: oauth2_implicit (repo:admin)

17.8.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

path

repository

required

The full path of the repository. e.g. namespace/name

string

17.8.3. Responses

HTTP CodeDescriptionSchema

200

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.8.4. Example command

$ curl -X GET "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/autoprunepolicy/123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer <your_access_token>"

17.9. deleteRepositoryAutoPrunePolicy

Deletes the auto-prune policy for the repository

Authorizations: oauth2_implicit (repo:admin)

17.9.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

path

repository

required

The full path of the repository. e.g. namespace/name

string

17.9.3. Responses

HTTP CodeDescriptionSchema

204

Deleted

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.9.4. Example command

$ curl -X DELETE "https://quay-server.example.com/api/v1/repository/example_namespace/example_repo/autoprunepolicy/123e4567-e89b-12d3-a456-426614174000" \
  -H "Authorization: Bearer <your_access_token>"

17.10. updateRepositoryAutoPrunePolicy

Updates the auto-prune policy for the repository

Authorizations: oauth2_implicit (repo:admin)

17.10.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

path

repository

required

The full path of the repository. e.g. namespace/name

string

17.10.3. Request body schema (application/json)

The policy configuration that is to be applied to the user namespace

NameDescriptionSchema

method

required

The method to use for pruning tags (number_of_tags, creation_date)

string

value

required

The value to use for the pruning method (number of tags e.g. 10, time delta e.g. 7d (7 days))

 

tagPattern

optional

Tags only matching this pattern will be pruned

string

tagPatternMatches

optional

Determine whether pruned tags should or should not match the tagPattern

boolean

17.10.4. Responses

HTTP CodeDescriptionSchema

200

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.10.5. Example command

$ curl -X PUT \
  -H "Authorization: Bearer <bearer_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "number_of_tags",
    "value": "5",
    "tagPattern": "^test.*",
    "tagPatternMatches": true
  }' \
  "https://quay-server.example.com/api/v1/repository/<namespace>/<repo_name>/autoprunepolicy/<uuid>"

17.11. createUserAutoPrunePolicy

Creates the auto-prune policy for the currently logged in user

17.11.1. POST /api/v1/user/autoprunepolicy/

Authorizations: oauth2_implicit (user:admin)

17.11.2. Request body schema (application/json)

The policy configuration that is to be applied to the user namespace

NameDescriptionSchema

method

required

The method to use for pruning tags (number_of_tags, creation_date)

string

value

required

The value to use for the pruning method (number of tags e.g. 10, time delta e.g. 7d (7 days))

 

tagPattern

optional

Tags only matching this pattern will be pruned

string

tagPatternMatches

optional

Determine whether pruned tags should or should not match the tagPattern

boolean

17.11.3. Responses

HTTP CodeDescriptionSchema

201

Successful creation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.11.4. Example command

$ curl -X POST "https://quay-server.example.com/api/v1/user/autoprunepolicy/" \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "number_of_tags",
    "value": 10,
    "tagPattern": "v*",
    "tagPatternMatches": true
  }'

17.12. listUserAutoPrunePolicies

Lists the auto-prune policies for the currently logged in user

17.12.1. GET /api/v1/user/autoprunepolicy/

Authorizations: oauth2_implicit (user:admin)

17.12.2. Responses

HTTP CodeDescriptionSchema

200

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.12.3. Example command

$ curl -X GET "https://quay-server.example.com/api/v1/user/autoprunepolicy/" \
  -H "Authorization: Bearer <your_access_token>"

17.13. getUserAutoPrunePolicy

Fetches the auto-prune policy for the currently logged in user

Authorizations: oauth2_implicit (user:admin)

17.13.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

17.13.3. Responses

HTTP CodeDescriptionSchema

200

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.13.4. Example command

$ curl -X GET "https://quay-server.example.com/api/v1/user/autoprunepolicy/{policy_uuid}" \
  -H "Authorization: Bearer <your_access_token>"

17.14. deleteUserAutoPrunePolicy

Deletes the auto-prune policy for the currently logged in user

Authorizations: oauth2_implicit (user:admin)

17.14.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

17.14.3. Responses

HTTP CodeDescriptionSchema

204

Deleted

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.14.4. Example command

$ curl -X DELETE "https://quay-server.example.com/api/v1/user/autoprunepolicy/<policy_uuid>" \
  -H "Authorization: Bearer <your_access_token>"

17.15. updateUserAutoPrunePolicy

Updates the auto-prune policy for the currently logged in user

Authorizations: oauth2_implicit (user:admin)

17.15.2. Path parameters

TypeNameDescriptionSchema

path

policy_uuid

required

The unique ID of the policy

string

17.15.3. Request body schema (application/json)

The policy configuration that is to be applied to the user namespace

NameDescriptionSchema

method

required

The method to use for pruning tags (number_of_tags, creation_date)

string

value

required

The value to use for the pruning method (number of tags e.g. 10, time delta e.g. 7d (7 days))

 

tagPattern

optional

Tags only matching this pattern will be pruned

string

tagPatternMatches

optional

Determine whether pruned tags should or should not match the tagPattern

boolean

17.15.4. Responses

HTTP CodeDescriptionSchema

204

Successful invocation

 

400

Bad Request

ApiError

401

Session required

ApiError

403

Unauthorized access

ApiError

404

Not found

ApiError

17.15.5. Example command

$ curl -X PUT "https://quay-server.example.com/api/v1/user/autoprunepolicy/<policy_uuid>" \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "number_of_tags",
    "value": "10",
    "tagPattern": ".*-old",
    "tagPatternMatches": true
  }'
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top