Run Smart Archiving Policy API

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

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.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

policyKey

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.

dryRun

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

runId

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 runSummaryId.

400

Validation errors.

This code indicates one of the following errors:

  • The policyKey was not provided.

  • The policy is set to clean the Trash Can, but the Trash Can is disabled.

  • The policy is disabled.

401

Bad Credentials.

403

Unauthorized.

404

The policy with the key <policyKey> was not found.

500

Internal server error.