Get All Archive Policies

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Returns a list of all available archive policies.

Note

This Cold Storage feature is available only for Artifactory Enterprise and Enterprise+ users.

Since: Artifactory 7.27.3

Security: Requires an admin user

Usage: GET /api/retention/archive/policies

Produces: application/json

Sample Request:

GET /api/retention/archive/policies

Sample Response: (myPolicy without cronExp, myPolicy2 with cronExp)

[
    {
        "key": "myPolicy",
        "enabled": false,
        "description": "Demo policy - archive using search criteria form",
        "durationInMinutes": 0,
        "expirationTimeInMonths": 0,
        "skipTrashcan": false,
        "searchCriteriaForm": {
            "properties": {
                "include": {
                    "operator": "or",
                    "values": [
                        {
                            "propertyKey": "updated",
                            "propertyValue": "updated"
                        }
                    ]
                },
                "exclude": {
                    "operator": "or",
                    "values": []
                }
            },
            "repositories": {
                "include": {
                    "operator": "or",
                    "values": [
                        "include-*",
                        "*-repo"
                    ]
                },
                "exclude": {
                    "operator": "or",
                    "values": []
                }
            },
            "paths": {
                "include": {
                    "operator": "or",
                    "values": []
                },
                "exclude": {
                    "operator": "or",
                    "values": [
                        "exclude-*",
                        "*-path"
                    ]
                }
            },
            "createdBefore": 2,
            "downloadedBefore": 3
        },
        "lastRunStatus": {
            "migrationIdentifier": "retention_archive_myPolicy2_OUYEVKCIO3",
            "state": "COMPLETE",
            "completedNumberOfArtifacts": 0,
            "failedNumberOfArtifacts": 0,
            "totalNumberOfArtifacts": 0,
            "progressPercentage": 0,
            "startTime": 1632915823313,
            "finishTime": 1632915823355,
            "totalByteSize": 0,
            "successByteSize": 0,
            "failureByteSize": 0,
            "triggeredBy": "admin",
            "policyName": "myPolicy"
        }
    },
    {
        "key": "myPolicy2",
        "enabled": true,
        "description": "Demo policy - archive using search criteria form",
        "cronExp": "0 0 0/1 ? * * *",
        "durationInMinutes": 0,
        "expirationTimeInMonths": 0,
        "skipTrashcan": false,
        "searchCriteriaForm": {
            "properties": {
                "include": {
                    "operator": "or",
                    "values": [
                        {
                            "propertyKey": "updated",
                            "propertyValue": "updated"
                        }
                    ]
                },
                "exclude": {
                    "operator": "or",
                    "values": []
                }
            },
            "repositories": {
                "include": {
                    "operator": "or",
                    "values": [
                        "include-*",
                        "*-repo"
                    ]
                },
                "exclude": {
                    "operator": "or",
                    "values": []
                }
            },
            "paths": {
                "include": {
                    "operator": "or",
                    "values": []
                },
                "exclude": {
                    "operator": "or",
                    "values": [
                        "exclude-*",
                        "*-path"
                    ]
                }
            },
            "createdBefore": 2,
            "downloadedBefore": 3
        },
        "lastRunStatus": {
            "migrationIdentifier": "retention_archive_myPolicy2_OUYEVKCIO3",
            "state": "COMPLETE",
            "completedNumberOfArtifacts": 0,
            "failedNumberOfArtifacts": 0,
            "totalNumberOfArtifacts": 0,
            "progressPercentage": 0,
            "startTime": 1632915823313,
            "finishTime": 1632915823355,
            "totalByteSize": 0,
            "successByteSize": 0,
            "failureByteSize": 0,
            "triggeredBy": "admin",
            "policyName": "myPolicy2"
        },
        "nextExecutionTime": 1632916800000
    }
]

The response displays the following information:

Property

Description

key

Unique policy key that identifies the policy.

enabled

If the policy is enabled/disabled for execution.

description

Description for the policy.

aqlQuery

The ???query used to search for the artifacts to be archived.

cronExp

The Cron expression is used for scheduling the archive policy.

nextExecutionTime

Time when the policy is scheduled to run next. This depends on the cronExp and the previous execution time.

durationInMinutes

The maximum duration (in minutes) for policy execution.

lastRunStatus

Shows the status of the last policy run. It can be one of the following:

  • PENDING: The policy has never been executed.

  • IN_PROGRESS: The policy execution is in progress.

  • IN_PROGRESS_WITH_ERORS: The policy execution is in progress but encountered one or more errors.

  • COMPLETE: The policy was executed successfully without any errors.

  • COMPLETE_WITH_ERRORS: The policy was executed, but encountered one or more errors.

  • FAILED: The policy execution failed.

totalNumberOfArtifacts

Total number of artifacts to be archived.

completedNumberOfArtifacts

Total number of artifacts that were successfully archived.

failedNumberOfArtifacts

Total number of artifacts that could not be archived.

progressPercentage

The progress of the archive policy (in percentage).

startTime

Time when the policy started executing. Value is in Unix epoch time in milliseconds.

finishTime

Time when the policy finished executing. Value is in Unix epoch time in milliseconds.

totalByteSize

The total size of the artifacts included in the policy.

successByteSize

The size of the artifacts that were archived.

failureByteSize

The size of the artifacts that couldn't be archived.

expirationTimeInMonths

The expiration period (in months) that it takes for archived artifacts to be cleaned up from the Cold instance.

skipTrashcan

If the transfer of the artifacts to the Trash Can repository is enabled or disabled.Browsing Artifacts

Status:

200: Success