logoBack to home screen

Exporting and Importing Repository Configuration via REST

This page explains how to execute REST calls allowing you to export and import repositories.

General

ADx provides REST services allowing you to export and import repository configuration. All export services allow you to export all repositories, but you can also retrieve configuration by any of the following categories:

  • Repository ID (/export/configuration/ endpoint)
  • Repository name (/export/configuration/by-names endpoint)
  • Repository technical name (/export/configuration/by-technical-names)

Import is always done through the /import/configuration endpoint. Check Endpoints for detailed information on what each endpoint can do.

You can get all of the export parameters in the Administration Area in the UI. Name and technical name are visible in the preview:

ID is visible in the detailed view of the repository (select Details to open):

Endpoints

You can use three different endpoints to export repositories (by ID, by name or by technical name). Importing is always done via the import/configuration endpoint. Export query parameters are optional - if you don't enter them, all repositories will be exported. 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
GETExport repository configuration by IDshttps://host:port/tribefire-services/api/v1/access.adx.admin/v1/export/configuration/sessionId, repositoryIds (array)none.zip file with repository configuration
GETExport repository configuration by nameshttps://host:port/tribefire-services/api/v1/access.adx.admin/v1/export/configuration/by-namessessionId, repositoryNames (array)none.zip file with repository configuration
GETExport repository configuration by technical namehttps://host:port/tribefire-services/api/v1/access.adx.admin/v1/export/configuration/by-technical-namesrepositoryTechnicalNames (array)none.zip file with repository configuration
POSTImport repository configurationhttps://host:port/tribefire-services/api/v1/access.adx.admin/v1/import/configurationnoneautoSync, importRepositoryOption, importUsers, resource, useRuntimeValues

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned when you authenticate
repositoryIdsarrayArray of one or more repository IDs, for example ["ab-cd-1234", "ef-gh-5678"]
repositoryNamesarrayArray of one or more repository names, for example ["Repository name 1", "Repository name 2"]
repositoryTechnicalNamesarrayArray of one or more repository technical names, for example ["Technical name 1", "Technical name 2"]
autoSyncbooleanIndicates whether affected repositories should be automatically synchronized after import.
importRepositoryOptionstringSpecifies option for repository import. delta - import only missing configuration, full - do a full import, none - do not import repository configuration (in case you only want to import users)
importUsersbooleanIndicates whether users/roles/groups should be imported.
resourcestringFile system path to the previously exported .zip archive with repository configuration to be imported.
useRuntimeValuesbooleanIndicates whether environment specific runtime values should be used instead of the values from the export package.

cURL Example - Repository Migration Between Hosts

The example below shows a typical workflow consisting of 4 cURL requests, where you export a configuration from one host and import it into another one.

Note that repositoryNames query parameter only has one value - myrepo, but it could take any number of repository names in an array, for example repositoryNames=["myrepo", "myrepo2"] (URL encoded: repositoryNames%3D%5B%22myrepo%22%2C%20%22myrepo2%22%5D) to export two repositories. If repositoryNames was removed the query at all, ALL repositories would be exported. The same logic applies to repositoryIds and repositoryTechnicalNames.

# open session to ADx-dev host
ADX_DEV_SESSION_ID=$(curl --silent --location --insecure --request POST 'https://adx-dev:8443/tribefire-services/api/v1/authenticate?user=admin&password=password' --header 'Content-Type: application/json' | cut -d '"' -f 2)

# export repository 'myrepo' from ADx-dev to myrepo-export.zip
curl --insecure --request GET "https://adx-dev:8443/tribefire-services/api/v1/access.adx.admin/v1/export/configuration/by-names?repositoryNames=myrepo&sessionId=${ADX_DEV_SESSION_ID}" --header "accept: application/json" --output /path/to/myrepo-export.zip

# open session to ADx-test host
ADX_TEST_SESSION_ID=$(curl --silent --location --insecure --request POST 'https://adx-test:8443/tribefire-services/api/v1/authenticate?user=admin&password=password' --header 'Content-Type: application/json' | cut -d '"' -f 2)

# import repository 'myrepo' myrepo-export.zip to ADx-test
curl --insecure --request POST "https://adx-test:8443/tribefire-services/api/v1/access.adx.admin/v1/import/configuration?sessionId=${ADX_TEST_SESSION_ID}" --header "accept: application/json" --header "Content-Type: multipart/form-data" --form "autoSync=true" --form "importRepositoryOption=full" --form "importUsers=false" --form "useRuntimeValues=false" --form "resource=@/path/to/myrepo-export.zip;type=application/zip"

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.

  1. Log in to ADx. Open Administrator 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 page:

  2. Find the Export/Import section (on top of the page):

  3. Expand and try out the endpoints yourself, following the guidelines provided in Swagger.

Exporting via ADx UI

You can execute the services described above via ADx Administration UI. See Exporting and Importing Repository Configuration via ADx UI for more information.