logoBack to home screen

Relocating Binary Content Sources with ADx REST API

General

Every repository in ADx comes with default content storage settings, defining where binary resources are stored. These settings, specifically the storage type and the path are determined by the ADX_DEFAULT_STORAGE_CONTENT_TYPE and ADX_DEFAULT_STORAGE_CONTENT_PATH runtime properties, respectively. However, you can also configure alternative storage locations in ADx Administration Area and easily move repository contents into these locations. This page explains how to relocate binary resources into alternative locations with ADx REST API.

Prerequisites

cURL Example - Relocating a Single Binary Resource

The example below shows how to authenticate to ADx and run the relocation request.

Adapt the following parts of the below requests:

  • https://[HOST]:[PORT] - adjust the protocol (http or https) and host name.
  • [USER_NAME] - replace with your user name
  • [PASSWORD] - replace with your password
  • [CONTENT_ID] - replace with the target content ID
# open session to ADx host
ADX_DEV_SESSION_ID=$(curl --silent --location --insecure --request POST 'https://[HOST]:[PORT]/tribefire-services/api/v1/authenticate?user=[USER_NAME]&password=[PASSWORD]' --header 'Content-Type: application/json' | cut -d '"' -f 2)

# relocate content to ALTERNATIVE_STORAGE
curl --location --request POST 'https://[HOST]:[PORT]/tribefire-services/api/v1/access.adx.content.[REPOSITORY_NAME]/v1/content/relocate?sessionId=20200904135026161-61f7fb33-422d-4e6c-806e-e25bb00999fc' \
--form 'contentId=[CONTENT_ID]' \
--form 'storageName=[ALTERNATIVE_STORAGE]'

cURL Example - Relocating All Repository Binary Resources

Endpoints

You can use two endpoints described below to relocate single binary resource or all repository resources. Check Parameters below for information on request parameters and their values.

You need to authenticate before using any of the below endpoints - session ID must be passed as a query parameter.

Request typeService descriptionEndpointRequest query parametersForm dataReturns
POSTRelocate (single) Content by IDhttps://host:port/tribefire-services/api/v1/access.adx.REPOSITORY_NAME/v1/content/relocatesessionIdcontentId, storageName.zip file with repository configuration

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned when you authenticate
contentIdstringContent ID of the target content
storageNamestringUnique name of the target storage. If you don't send anything, content will be moved to the default storage.

Try It Out in OpenAPI/Swagger

All of the above endpoints are documented and exposed in our OpenAPI and Swagger pages, where you can try them out.

Relocating a Single Binary Resource

  1. Log in to ADx. Open Repository API from the landing page. A list of repository endpoints is exposed. Switch to Swagger 2.0 in case of any issues in the default Open API page:

  2. Find the /access.adx.content.test/v1/content/relocate endpoint. Expand it to see the available parameters.

  3. Click Try it Out! to activate the fields.

Relocating All Binary Resources

  1. Log in to ADx. Open Repository API from the landing page:

Exporting via ADx UI

You can execute the services described above via ADx UI. See the following pages for more information: