Restore from Archive

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Triggers restoration of multiple items from the Archive. An admin can choose one of the following options:

  • Restore items to the original location and provide fallback repository in case the original location was deprecated.

  • Restore to a dedicated central repository.

Important

Restore operation only moves the items back to the Warm instance location and does not delete them from the Cold instance.

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: POST /api/retention/restore

Consumes: application/json

Query Parameters:

Parameters

Type

Description

Required/Optional

restoreType

string

Determines whether to restore a package (PACKAGE_RESTORE) or artifacts (ARTIFACT_RESTORE).

The default value is ARTIFACT_RESTORE.

Required

restoreToOriginal

boolean

Set whether or not to restore to the original artifact location (saved on the Cold instance).

Required if centralDestinationPath is not set

fallbackDestinationPath

string

If restoreToOriginal is set as true and the original location does not exist anymore, restore to this fallback location. fallbackDestinationPath must contain at least the repository key.

Note

Before providing the fallbackDestinationPath, ensure that the path already exists.

Required if restoreToOriginal is set

centralDestinationPath

string

The repository key where the files need to be restored. The files will be restored to this repository according to its original path hierarchy. For example, if the repository key is test_repo and the original path is pypi-local/jfrogapp/0.1, the files will be restored to test_repo/pypi-local/jfrogapp/0.1.

centralDestinationPath and restoreToOriginal are mutually exclusive.

Note

Before providing the centralDestinationPath, ensure that the path already exists.

Required if restoreToOriginal is not set

addNamespace

boolean

This is set as true by default and you do not have to include the namespace when adding items for itemsToRestore.

When set as false, you must include the namespace when adding items for itemsToRestore.

Optional

itemsToRestore

string

Comma-separated list of the items or paths to be restored.

Format: “itemsToRestore”: [“<repository_name>/path/to/file”, “<repository_name>/path/to/folder/” …,]

Note

Folder paths must end with a / while file paths must not.

Note

Since addNamespace is set as true by default, you do not have to include the namespace with the path for itemsToRestore. However, if addNamespaceis set as false, ensure that the repository name includes the namespace that was generated during the archive process and the full repository path.

Example: gbbxmcuj_pypi-local/jfrogapp/0.1/jfrogapp-0.1.tar.gz

Where:

  • gbbxmcuj is the namespace

  • pypi-local is the name of the repository

  • jfrogapp/0.1/jfrogapp-0.1.tar.gz is the full path for the item to be restored

For information about getting the namespace, see Get Namespace.

Required

Sample Request:

POST /api/retention/restore

Restoring artifacts:

{
    "restoreType": "ARTIFACT_RESTORE",
    "restoreToOriginal": "false",
    "fallbackDestinationPath":"",
    "centralDestinationPath": "3750-artifacts",
    "itemsToRestore": []
}

Restoring packages:

{
    "restoreType": "PACKAGE_RESTORE",
    "restoreToOriginal": "false",
    "fallbackDestinationPath":"",
    "centralDestinationPath": "nir",
    "itemsToRestore": [
  "docker-local/docker-alpine-tag-11003.json",
  "docker-local/docker-alpine-tag-11004.json",
  "docker-local/docker-alpine-tag-11005.json",
  "docker-local/docker-alpine-tag-11012.json",
  "docker-local/docker-alpine-tag-11014.json",
  "docker-local/docker-alpine-tag-11017.json",
  "docker-local/docker-alpine-tag-11026.json",
  "docker-local/docker-alpine-tag-11034.json",
  "docker-local/docker-alpine-tag-11038.json",
  "docker-local/docker-alpine-tag-11045.json",
  "docker-local/docker-alpine-tag-11999.json"
]
}

Sample Response (packages): Successful

{ 
     "response" : "Restore process was initialized successfully.", 
     "restore_operation_id" : "retention_restore_package_AL8VPOK4EW" 
}

Sample Response (artifacts): Successful

{ 
    "response" : "Restore process was initialized successfully.", 
    "restore_operation_id" : "retention_restore_artifact_FVRU5YWVRU" 
}

Note

Archive restore operations can be tracked using the Get Restore Process Status API. An error message is displayed in Artifactory if the restore operation fails.

Status:

200: Success