Relocating binary content resources via REST
General
Every repository in Document.One (D1) 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 the D1 Administration Area and easily move repository contents into these locations. This page explains how to relocate binary resources into alternative locations with the D1 REST API.
Alternative repository storage must be configured on the repository. For more information, see Configuring an alternative repository storage.
Task 1: Relocating a single binary resource
The example below shows how to authenticate to D1 and run the relocation request.
cURL example
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 a session to the D1 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 the content to the
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]'
Endpoints
You can use two endpoints described below to relocate a single binary resource or all repository resources. Check Parameters below for information on request parameters and their values.
You must authenticate before using any of the below endpoints — the session ID must be passed as a query parameter.
HTTP request | Endpoint | Service description | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | https://host:port/tribefire-services/api/v1/access.adx.REPOSITORY_NAME/v1/content/relocate | Relocate (single) content by ID. | sessionId | contentId, storageName | .zip file with repository configuration. |
Parameters
Parameter | Data type | Description |
---|---|---|
sessionId | string | The session ID returned when you authenticate. |
contentId | string | The content ID of the target content. |
storageName | string | The unique name of the target storage. If you do not send anything, the content will be moved to the default storage. |
Try It Out in OpenAPI
All of the above endpoints are documented and exposed in our OpenAPI pages, where you can try them out.
To try out the relocation of a single binary resource in OpenAPI, follow these steps:
Log in to D1. 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 OpenAPI 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.
For a code sample, see
Relocate content by ID
Exporting via D1 user interface
You can execute the services described above via the D1 user interface. See the following pages for more information:
- Relocating individual contents — How to relocate a single content binary source inside a repository.
- Relocating repository binaries — How to relocate all binary sources in a repository.