Enable/Disable Smart Archiving Policy API

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: This REST API is called to enable or disable a smart archiving 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.

The following actions can be performed on a disabled policy:

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/archive/v2/packages/policies/{policyKey}/enablement

Produces: application/json

Sample Query:

POST http://{host:port}/artifactory/api/archive/v2/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 Smart Archiving 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.

401

Bad Credentials.

403

Unauthorized.

404

A policy with the specified key does not exist.

500

Internal server error.