Start PUD Process

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: This REST API is called to start a new PUD process, or resume a PUD process that was stopped before completion.

Security: Requires an admin user.

Produces: application/json

Usage:

curl -u <user_name>:<password> -XPOST http://artifactory_host:port/artifactory/api/system/storage/prune/start \
-H "Content-Type: application/json" \
-d '{  
    "dryRun":true,  
    "startFromDirectory":"f9",
    "startFromBinary":"81",  
    "binaryOlderThanDays":"2"
}’

Since: 7.72

Query Parameters:

Field

Type

Description

dryRun

boolean

Optional. If false then unreferenced binaries will be actually removed from the filestore. If true then unreferenced binaries will not be removed from the filestore. This mode may be useful to estimate the number of unreferenced binaries in each directory without actually removing them.

Default: false

startFromDirectory

string

Optional. If present, the PUD process will continue from the directory identified here.

If this parameter is omitted, the PUD process starts to prune from the beginning of the directories list.

Default: empty

startFromBinary

integer

Optional. If present, the PUD process continues from this position in the last directory that the previous PUD process stopped at. This parameter can be found in the response of the Get Status API at lastHandledDirectory>binariesProcessed.

If omitted, the PUD process starts to prune from the first binary in the directory.

Default: 0

binaryOlderThanDays

integer

Optional. If present, unreferenced binaries that are newer than binaryOlderThanDays are ignored by the PUD process. If binaryOlderThanDays = 0, the PUD process does not relate to the binary creation date.

Default: 1 (ignore unreferenced binaries created in the last 24 hours)

Sample Usage:

In this example, a real pruning is performed (dryRun is not present) starting from the directory d5. The first 812046 binaries will be skipped in this directory since startFromBinary = 812047. Any binaries newer than 90 days will be skipped by the PUD process.

curl -u admin:password -XPOST http://artifactory_host:port/artifactory/api/system/storage/prune/start
-H "Content-Type: application/json" \
-d '{
  "startFromDirectory":"d5",
  "startFromBinary":"812047",
  "binaryOlderThanDays":"90"
}’

Sample Responses:

In the response below, an error message was received since the PUD process is already running and another process cannot start.

HTTP/1.1 412 Precondition Failed
{
  "info": "Pruning Unreferenced Data task cannot be started"
}

The response below shows confirmation that the PUD process has started to run from the beginning of the directory list.

HTTP/1.1 202 Accepted
Content-Type: application/json
{
  "info": "Pruning Unreferenced Data task has been submitted"
}

The response below shows confirmation that the PUD process has started to run from a specific directory.

HTTP/1.1 202 Accepted
Content-Type: application/json
{
  "info": "Prune Unreferenced Data task resumes from directory f9"
}