View Package Cleanup Policy Run Summary Report API

JFrog REST APIs

Content Type
REST API

Description: This REST API is called to view a summary report on a cleanup policy run. Platform admins can view run summary reports for both global cleanup policies and project-specific cleanup policies. This API checks that the username is the project admin for the policyKey received and therefore project admins can view run summary reports for cleanup policies related to the projects they manage.

Security: Requires a platform admin. A project admin with permission can call this API on the project level.

Usage: GET /artifactory/api/cleanup/policies/runs/summaryReports?triggerId={triggerId}&policyKey={policyKey}

Produces: application/json

Since: 7.117

Sample Request:

GET https://[JFrogPlatformURL]/artifactory/api/cleanup/policies/runs/summaryReports?triggerId=1&policyKey=key1

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

This parameter is mandatory.

triggerId

integer

An ID that identifies the run. You can get this ID in the Retention Policies Monitoring screen, as explained in View All Cleanup Runs.View All Cleanup Runs

This parameter is mandatory.

Sample Response:

{
    "policySummary": {
        "policyName": "example-policy",
        "runId": 1,
        "dryRun": true,
        "status": "COMPLETED",
        "triggeredBy": "admin"
    },
    "executionSummary": {
        "startedAt": "2025-05-26T13:39:21.504+05:30",
        "finishedAt": "2025-05-26T13:39:21.528+05:30",
        "durationMillis": 24
    },
    "processedItemsSummary": {
        "itemType": "PACKAGE",
        "totalItems": 0,
        "processedItems": 0,
        "failedItems": 0,
        "processedPhysicalSizeBytes": 0,
        "processedVirtualSizeBytes": 0
    },
    "runConfiguration": {
        "createdAt": "2025-05-26T13:39:12.040+05:30",
        "createdBy": "admin",
        "modifiedAt": "2025-05-26T13:39:19.134+05:30",
        "modifiedBy": "admin",
        "schedule": {
            "cronExpression": "",
            "maxRunDurationMillis": 0
        },
        "description": "",
        "skipTrashCan": false,
        "target": {
            "reposIncluded": [
                "example-repo-local"
            ],
            "reposExcluded": [],
            "packageTypes": [
                "generic"
            ],
            "packagesIncluded": [
                "**"
            ],
            "packagesExcluded": [],
            "includeAllProjects": false,
            "projectsIncluded": [
                "default"
            ]
        },
        "cleanupCriteria": {
            "createdBefore": "1 days",
            "lastDownloadedBeforeInDays": 0,
            "keepLastNVersions": 0
        }
    }
}

Field

Type

Description

policySummary

object

The summary of the policy

policyName

string

The name of the cleanup policy that was executed.

runId

integer

A unique identifier for this execution run of the policy.

dryRun

boolean

Indicates if this was a dry run (true) or an actual run (false).

status

string

The current status of the cleanup run (for example, "COMPLETED").

triggeredBy

string

The username of the person who triggered the policy execution.

executionSummary

object

The execution summary of the policy.

startedAt

string

Timestamp at which the execution started.

finishedAt

string

Timestamp at which the execution finished.

durationMillis

integer

Duration of the execution in milliseconds.

processedItemsSummary

object

The summary of processed items for cleanup

itemType

string

Type of items processed - package

totalItems

integer

Total number of items that the policy intended to process.

processedItems

integer

Number of items that were actually processed.

failedItems

integer

Number of items that encountered errors during processing.

processedPhysicalSizeBytes

integer

Total physical size of processed items in bytes.

processedVirtualSizeBytes

integer

Total virtual size of processed items in bytes.

runConfiguration

object

The configuration of the run

createdAt

string

Timestamp when the run configuration was created.

createdBy

string

The user who created the run configuration.

modifiedAt

string

Timestamp when the run configuration was last modified.

modifiedBy

string

The user who last modified the run configuration.

schedule.cronExpression

string

A cron expression that defines the schedule for the cleanup policy. Empty if not scheduled.

schedule.maxRunDurationMillis

integer

Maximum duration allowed for the cleanup run in milliseconds (0 means no limit).

description

string

An optional description of the run configuration.

skipTrashCan

boolean

Indicates if the trash can was skipped during the cleanup (true or false).

target.reposIncluded

array of strings

List of repositories included in the execution.

target.reposExcluded

array of strings

List of repositories excluded from the execution.

target.packageTypes

array of strings

Types of packages targeted by the cleanup policy.

target.packagesIncluded

array of strings

Patterns of packages that should be included (for example, ["**"] means all packages).

target.packagesExcluded

array of strings

Patterns of packages that should be excluded.

target.projectsIncluded

array of strings

List of specific projects included.

cleanupCriteria

object

The cleanup criteria of the execution.

createdBefore

string

Criteria for creation date (for example, "1 days" means items created before 1 day ago).

lastDownloadedBeforeInDays

integer

Criteria for the last download date in days. The value indicates how many days before to consider (0 means all items regardless of last download date).

keepLastNVersions

integer

The number of latest versions to retain; older versions are deleted

Response Codes

Code

Description

200

The request was successful and the response body contains the run summary report.

400

One or both of the request parameters are invalid.

403

The user does not have permission to access the report.

404

No report is found for the given policyKey and/or runId.

500

Internal server error.