Get Single Release Bundle Cleanup Policy by Key API

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: This API is called to provide details on a single release bundle 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/bundles/policies/{policyKey}

Query Parameters:

Field

Type

Description

policyKey

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 Release Bundle Cleanup Policies API, searching the results for the appropriate description and then its corresponding ID.

Sample Query

GET http://{host:port}/artifactory/api/cleanup/bundles/policies/key1

Sample Response:

{
    "key": "key1",
    "description": "some test description",
    "cronExp": "0 15 10 * * ? 2025",
    "itemType": "releaseBundle",
    "durationInMinutes": 150,
    "enabled": true,
    "searchCriteria": {
        "includeAllProjects": true,
        "includedProjects": [],
        "releaseBundles": [
            {
                "name": "myReleaseBundle",
                "projectKey": "default"
            }
        ],
        "excludePromotedEnvironments": [
            "**"
        ],
        "createdBeforeInMonths": 24
    }
}

The response include the following information:

Parameter

Type

Description

key

String

A unique identifier for the cleanup policy (for example, "key1").

description

String

A brief description of the cleanup policy

cronExp

String

A cron expression specifying when the cleanup job will run (for example, 0 0 2 * * ?).

itemType

String

The type of items to clean up (releaseBundle).

durationInMinutes

Integer

The maximum duration (in minutes) for policy execution, after which the policy will stop running even if not completed. While setting a maximum run duration for a policy is useful for adhering to a strict cleanup schedule, it can cause the policy to stop before completion (for example, 60).

enabled

Boolean

Indicates if the cleanup policy is active (true) or disabled (false).

A cleanup policy must be created inactive. This parameter is optional, but if used it must be set to false. If set to true when calling this API, the API call will fail and an error message is received.

Note

After a cleanup policy is created, it can be set to active by calling Enable/Disable Release Bundle Cleanup Policy API.

searchCriteria

Object

An object containing search criteria for the cleanup job.

includeAllProjects

Boolean

Specifies whether to include all projects in the search (true to include).

includedProjects

Array of Strings

A list of specific project keys to include in the search ().

releaseBundles

Array of Objects

An array specifying the release bundles to consider during cleanup.

name

String

The name of the release bundle. Set "**" to include all bundles.

projectKey

String

The project identifier associated with the release bundle. This key is obtained from the Project Settings screen. This parameter is used only for project-level cleanup policies, it is not used for global-level policies.

excludePromotedEnvironments

Array of Strings

A list of environments to exclude from the cleanup process. To exclude all, set to **.

createdBeforeInMonths

Integer

Specifies the time frame for filtering based on item creation date (for example, 24 months).

Response Error Codes

Code

Description

400

Validation errors.

500

Internal server error.