Description: This REST API is called to manually run a smart archiving policy. For information on how to manually run a smart archiving policy from the UI, see Run Smart Archiving Policy Manually.
Security: Requires a platform admin. A project admin with permission can manually run a policy on the project level.
Produces: application/json
Usage: PUT /artifactory/api/archive/v2/packages/policies/{policyKey}/run?dryRun=<Boolean>
Query Parameters:
Field | Type | Description |
---|---|---|
| string | ID of the policy you want to run. This ID was configured when creating the policy. You can find the policy ID by running the Get All Smart Archiving Policies API, searching through the results for the appropriate description, and then its corresponding ID. |
| boolean | Optional, default is FALSE. Dry runs are used to run a policy without an actual archive. It produces a report used to determine which packages will be archived if an actual run is performed. |
Sample Query:
PUT /artifactory/api/archive/v2/packages/policies/sample-policy/run
Sample Response:
201 Created Content-Type: application/json { "runId": 1 // Integer }
The response includes the following information:
Property | Description |
---|---|
| An ID that identifies the run. This ID is used by the Stop Running Smart Archiving Policy API if you want to stop running an archive policy that was executed. |
Response Error Codes
Code | Description |
---|---|
200 | The request was successful and the response body contains the |
400 | Validation errors. This code indicates one of the following errors:
|
401 | Bad Credentials. |
403 | Unauthorized. |
404 | The policy with the key < |
500 | Internal server error. |