Relocating Binary Content Sources with ADx REST API
On this page
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
- Alternative repository storage must be configured on the repository. For more information, see Configuring Alternative Repository Storage.
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
orhttps
) 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 type | Service description | Endpoint | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | Relocate (single) Content by ID | https://host:port/tribefire-services/api/v1/access.adx.REPOSITORY_NAME/v1/content/relocate | sessionId | contentId, storageName | .zip file with repository configuration |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | Session ID returned when you authenticate |
contentId | string | Content ID of the target content |
storageName | string | Unique 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
-
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:
-
Find the
/access.adx.content.test/v1/content/relocate
endpoint. Expand it to see the available parameters. -
Click Try it Out! to activate the fields.
Relocating All Binary Resources
- 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:
- Relocating All Repository Contents - how to relocate all binary sources in a repository.
- Relocating Individual Contents - how to relocate a single content binary source inside a repository.