Download ODC Packages via REST API
search cancel

Download ODC Packages via REST API

book

Article ID: 452715

calendar_today

Updated On:

Products

DX SaaS DX APM SaaS DX Operational Observability DX Operational Intelligence DX OI SaaS

Issue/Introduction

The ODC packages, ODC Collector, ODC Agent, AppNeta and ODC Agent, Binaries are normally downloaded by:
 
- Settings
- Downloads in the product UI.

No API is documented, so the download cannot easily be automated.
 
Scripting attempts fail in a misleading way: a GET against the download URL returns HTTP 404 "using method 'GET' not a configured resource", which is indistinguishable from an invalid package name.

Environment

DX O2 SaaS

Resolution

Replace the token, tenant id and gateway host with your own values and run:
 
TOKEN="<tenant token>"
TENANT="<tenant-id>"
 
for PKG in odc-collector odc-agent-appneta odc-agent-binaries; do
curl -OJ -X POST \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \
--data '' \
"https://apmgw.dxi-na1.saas.broadcom.com/$TENANT/ess/packagedownload/v1/downloadfile/$PKG"
done
 
Three elements are mandatory and the call fails without any one of them: POST, the form-urlencoded Content-Type, and the empty body. The -OJ flag saves each file under the name supplied by the server in Content-Disposition.
Files returned on 26.8.1: odc-collector_26.8.1.zip (93 MB), odc-agent-appneta_26.8.1.zip (32 KB), odc-agent-binaries_26.8.1.zip (37 MB). The package id dx-gateway returns DXGateway-26.8.1.1-dist.zip.
The tenant id is the first path segment after the host in any tenant URL. The token is the value of the Authorization header on any request issued by the Downloads page, visible in browser developer tools.
 
Confirm each file is a real archive rather than an error page returned with HTTP 200:
 
for z in odc-*.zip; do unzip -tqq "$z" && echo "$z OK"; done

Additional Information

Response decoder:
 
- 404 with ca-emm-errorcode 5151113 means wrong HTTP method, not a missing package
- 401 with 5151110 means the token is missing or invalid.
- 400 with 6051101 means the Content-Type is wrong, or the package id does not exist.
- 200 with Content-Type application/zip is success.