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:
Run Smart Archiving Policy API
Note
You can perform a dry run on a disabled policy, not the actual run.
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 |
---|---|---|
| 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. |
| 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. |