Description: Returns an archive policy based on the policy key.
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/{policyKey}
Produces: application/json
URL Parameter:
Parameters | Type | Description | Required/Optional |
---|---|---|---|
| string | The policy key for which the archive policy details need to be retrieved. | Required |
Sample Request:
GET /api/retention/archive/policies/myPolicy2
Sample Response for Artifact Policy:
[ { "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 |
---|---|
| Unique policy key that identifies the policy. |
| If the policy is enabled/disabled for execution. |
| Description for the policy. |
| The Artifactory Query Language query used to search for the artifacts to be archived. |
| The Cron expression used for scheduling the archive policy. |
| Time when the policy is scheduled to run next. This depends on the cronExp and the previous execution time. |
| The maximum duration (in minutes) for policy execution. |
| Shows the status of the last policy run. It can be one of the following:
|
| Total number of artifacts to be archived. |
| Total number of artifacts that were successfully archived. |
| Total number of artifacts that could not be archived. |
| The progress of the archive policy (in percentage). |
| Time when the policy started executing. Value is in Unix epoch time in milliseconds. |
| Time when the policy finished executing. Value is in Unix epoch time in milliseconds. |
| The total size of the artifacts included in the policy. |
| The size of the artifacts that were archived. |
| The size of the artifacts that couldn't be archived. |
| The expiration period (in months) that it takes for archived artifacts to be cleaned up from the Cold instance. |
| If the transfer of the artifacts to the trash can repository is enabled or disabled. |
Sample Response for Package Policy:
{ "key": "package-local-to-local-policy-5655", "enabled": true, "durationInMinutes": 0, "expirationTimeInMonths": 0, "skipTrashcan": true, "packageRetention": true, "packageSearchCriteriaForm": { "packageType": "docker", "packageRepos": [ "package-archive-local-to-local-repo-5655" ] }, "lastRunStatus": { "state": "PENDING", "policyName": "package-local-to-local-policy-5655" } }
In addition to the properties listed above, package policies include the following properties:
Property | Description |
---|---|
| Determines whether the archive policy works on packages ( |
| See Create an Archive Policy for details. |
Status:
200: Success