Description: This API is called to provide details on a single package cleanup policy.
Security: Requires a platform admin. A project admin with permission can call this API on the project level.
Produces: application/json
Usage: GET http://{host:port}/artifactory/api/cleanup/packages/policies/{policyKey}
Query Parameters:
Field | Type | Description |
---|---|---|
| string | The ID that identifies the policy. This ID was configured when creating the policy. You can find the policy ID by calling Get all Cleanup Policies API, searching the results for the appropriate description and then its corresponding ID. |
Sample Query
GET http://{host:port}/artifactory/api/cleanup/packages/policies/key1
Sample Response:
{ "key": "key1", "description": "some test description", "cronExp": "0 15 10 * * ? 2024", "durationInMinutes": 150, "enabled": false, "skipTrashcan": false, "searchCriteria": { "packageTypes": [ "docker", "maven" ], "repos": [ "repo1", "repo2" ], "excludedRepos": [], "includedPackages": [ "com/jfrog", ], "excludedPackages": [ "com/jfrog/latest", ], "includeAllProjects": false, "includedProjects": [ "project1", "project2" ], "createdBeforeInMonths": 12, "lastDownloadedBeforeInMonths": 1 "keepLastNVersions": 0 } }
The response include the following information:
Property | Description |
---|---|
| The ID that identifies the policy. This ID that was configured for the policy when it was created. |
| Description that was defined for the policy. |
| The cron expression that determines when the policy is run. This parameter is not mandatory, however if left empty the policy will not run automatically and can only be triggered manually. |
| The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. |
| A true value means the policy can be executed. A false value means that it cannot. |
| A true value means that when this policy is executed, packages will be permanently deleted. false means that when the policy is executed packages will be deleted to the Trash Can. |
| The criteria that define aspects of the policy such as package types (docker, maven), repository names in which the policy will be run, and other relevant criteria. For more details see the table below. |
Search Criteria
Field | Type | Description |
---|---|---|
| string | The package types that are cleaned up by the policy. For a list of the permitted package types, click here. You must enter at least one package type. |
| string | Specify one or more patterns for the repository name(s) on which you want the cleanup policy to run. You can also specify explicit repository names. Specifying at least one pattern or explicit name is mandatory. Only packages in repositories that match the pattern or explicit name will be deleted. |
| string | Specify patterns for repository names or explicit repository names that you want excluded from the cleanup policy. This parameter is optional. |
| string | Specify a pattern for a package name or an explicit package name on which you want the cleanup policy to run. Only one pattern or explicit name can be entered. To include all packages, use "**". For example: This parameter is mandatory. |
| string | Specify explicit package names that you want excluded from the policy. Only explicit names (and not patterns) are accepted. This parameter is optional. |
| boolean | Set this value to true if you want the policy to run on all Artifactory projects. The default value is false. This parameter is optional. NoteThis parameter is relevant only on the global level, for Platform Admins. |
| string | Enter the project names on which you want the policy to run. NoteThis parameter is relevant only on the global level, for Platform Admins. |
| integer | The cleanup policy will delete packages based on how long ago they were created. For example, if this parameter is 2 then packages created more than 2 months ago will be deleted as part of the policy. Note
|
| integer | The cleanup policy will delete packages based on how long ago they were dowloaded. For example, if this parameter is 5 then packages downloaded more than 5 months ago will be deleted as part of the policy. NoteJFrog recommends using |
| integer | Set a value for the number of latest versions to keep. The cleanup policy will remove all versions prior to the number you select here. The latest version is always excluded. Note
|
Response Error Codes
Code | Description |
---|---|
400 | Validation errors. |
500 | Internal server error. |