Enable/Disable a Package Cleanup Policy API

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: This REST API is called to enable or disable a package cleanup policy. A policy must be enabled for it to run according to the automated schedule set in the cron expression or to trigger a run manually.

Note

A dry run can be performed on a policy that is disabled.

Security: Requires a platform admin. A project admin with permission can enable or disable a policy on the project level.

Usage: POST http://{host:port}/artifactory/api/cleanup/packages/policies/{policyKey}/enablement

Produces: application/json

Sample Query:

POST http://{host:port}/artifactory/api/cleanup/packages/policies/key1/enablement
{
   "enabled": true
}

Query Parameters:

Field

Type

Description

policyKey

string

The ID that identifies the policy. This ID was configured when creating the policy. You can find the policy ID by calling Get all Cleanup Policies API, searching the results for the appropriate description and then its corresponding ID.

enabled

boolean

A true value means the policy can be executed. A false value means that it cannot.

Response Error Codes

Code

Description

400

Validation errors.

404

A policy with the specified key does not exist.

500

Internal server error.