KB Article #177567

How to get deployment archive files from the command line using the REST API

Problem

Normally Policy Studio is used to download .fed, .pol, or .env archive files from the admin node manager. However this can be done with the REST API quite easily on a Linux system using some standard tools that should be available.


curl - for running the https REST API to the admin node manager
jq - for parsing the JSON result
base64 - to convert the base64 to binary .fed


Resolution

Our example uses GET /api/deployment/archive/{groupID}/{archiveID} to download a Deployment Archive. The other APIs listed under the Deployment section https://support.axway.com/htmldoc/1431572 could yield similar results.

Command format

curl --silent --basic -k -uusername:password -verbose -X GET https://anm-host:8090/api/deployment/archive/{groupID}/{archiveID} |jq -r '.result.data' | base64 -d > {archiveID}.fed

Typical example

curl --silent --basic -k -uadmin:changeme -verbose -X GET https://support:8090/api/deployment/archive/group-2/a076ea60-fb20-4e9c-a224-0274e6bad3dd |jq -r '.result.data' | base64 -d > a076ea60-fb20-4e9c-a224-0274e6bad3dd.fed