View Smart Archiving Policies API

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: This REST API is called to display smart archiving policies in the user interface and uses various optional filters to refine results.

Produces: application/json

Usage: GET /artifactory/api/archive/v2/policies/view?itemTypes=<package>&policyName=<policyKey>

Since: ???

Query Parameters:

Field

Description

itemTypes

List of item types to filter. Possible value: package

policyKey

Optional parameter. Partial or complete string to use for search.

Sample Usage:

GET /artifactory/api/archive/v2/policies/view?itemTypes=<package>&policyName=<policyKey>

Sample Responses:

200 Created
Content-Type: application/json

{
    "policies": [
        {
            "itemType": "<itemType>", // string
            "policyName": "<policyName>", // string
            "enabled": "<enabled>", // boolean
            "nextRunTime": "<timestamp>", // integer, milliseconds
            "lastRunData": {
                "status": "<status>", // string
                "lastRunTime": "<timestamp>", // integer, milliseconds
                "dryRun": "<dryRun>" // boolean
            }
        },
        {
            "itemType": "<itemType>", // string
            "policyName": "<policyName>", // string
            "enabled": "<enabled>", // boolean
            "nextRunTime": "<timestamp>", // integer, milliseconds
            "lastRunData": {
                "status": "<status>", // string
                "lastRunTime": "<timestamp>", // integer, milliseconds
                "dryRun": "<dryRun>" // boolean
           }
        }
    ],
}

The response includes the following information:

Property

Description

itemType

The type of policy. Will be one of the following: package, artifact, build, releaseBundle.

policyKey

The key of the policy. This ID was configured when creating the policy.

enabled

Whether or not the policy is enabled. A TRUE value means the policy can be executed. A FALSE value means that it cannot.

nextRunTime

The next time this policy will be run. No data is available for policies that don't have a Crontime configured or that are disabled.

lastRunData

Contains the following information:

  • status: Indicates the status of the last policy run. Can include one of the following: PENDING, IN_PROGRESS, IN_PROGRESS_WITH_ERRORS, COMPLETED, COMPLETED_WITH_ERRORS, FAILED, STOPPING, STOPPED, SKIPPED.

  • lastRunTime: This timestamp indicates the last run time for the policy.

  • dryRun: If the last run was a dry run. If TRUE, the last run was a dry run. If FALSE, the last run was real.

Response Error Codes

Code

Description

400

Validation errors.

401

Bad Credentials.

403

Unauthorized.

500

Internal server error.