CURL commandline examples for exporting a Hyperglance diagram to a PNG or VSDX.
For these examples to work you must already have a diagram in Hyperglance that you want to export:
- See instructions for connecting Hyperglance to AWS
- Note: In these examples we assume the Account Alias was set to "My AWS".
- See instructions for connecting Hyperglance to Azure
- Note: In these examples we assume the Subscription Alias was set to "My Azure Subscription".
- Or use our Python samples to connect an account or subscription programmatically.
You also need to generate your Hyperglance API key and set the key's name followed by a colon followed by the generated secret as the value for CURL's --user parameter. For example: --user my-api-user:77415974-1b16-4ee8-af98-6be979611158.
Choose a use-case to get started:
- Export entire AWS diagram
- Export a single AWS account
- Export an AWS VPC
- Export entire Azure diagram
- Export a single Azure subscription
- Export an Azure Resource Group
- Export a Hyperglance Tag View
To PNG:
curl -fk https://10.0.0.1/hgapi/export-png \
--output hyperglance.png \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Datasource_Group", "account":"Amazon", "id":"Amazon" }' \
--request POST --header "Content-Type: application/json"To VSDX:
curl -fk https://10.0.0.1/hgapi/export-vsdx \
--output hyperglance.vsdx \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Datasource_Group", "account":"Amazon", "id":"Amazon" }' \
--request POST --header "Content-Type: application/json"To PNG:
curl -fk https://10.0.0.1/hgapi/export-png \
--output hyperglance.png \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Amazon", "account":"My AWS", "id":"account:My AWS" }' \
--request POST --header "Content-Type: application/json"To VSDX:
curl -fk https://10.0.0.1/hgapi/export-vsdx \
--output hyperglance.vsdx \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Amazon", "account":"My AWS", "id":"account:My AWS" }' \
--request POST --header "Content-Type: application/json"To PNG:
curl -fk https://10.0.0.1/hgapi/export-png \
--output hyperglance.png \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Amazon", "account":"My AWS", "id":"vpc-123456789" }' \
--request POST --header "Content-Type: application/json"To VSDX:
curl -fk https://10.0.0.1/hgapi/export-vsdx \
--output hyperglance.vsdx \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Amazon", "account":"My AWS", "id":"vpc-123456789" }' \
--request POST --header "Content-Type: application/json"To PNG:
curl -fk https://10.0.0.1/hgapi/export-png \
--output hyperglance.png \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Datasource_Group", "account":"Azure", "id":"Azure" }' \
--request POST --header "Content-Type: application/json"To VSDX:
curl -fk https://10.0.0.1/hgapi/export-vsdx \
--output hyperglance.vsdx \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Datasource_Group", "account":"Azure", "id":"Azure" }' \
--request POST --header "Content-Type: application/json"To PNG:
curl -fk https://10.0.0.1/hgapi/export-png \
--output hyperglance.png \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Azure", "account":"My Azure Subscription", "id":"sub:My Azure Subscription" }' \
--request POST --header "Content-Type: application/json"To VSDX:
curl -fk https://10.0.0.1/hgapi/export-vsdx \
--output hyperglance.vsdx \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Azure", "account":"My Azure Subscription", "id":"sub:My Azure Subscription" }' \
--request POST --header "Content-Type: application/json"In this example the name of the resource group is "name-of-my-resource-grp". Azure Resource Groups are considered tag-views in Hyperglance (see Export a tag-view)
To PNG:
curl -fk https://10.0.0.1/hgapi/export-png \
--output hyperglance.png \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Azure", "tagViewIds": ["Resource Group: name-of-my-resource-grp"] }' \
--request POST --header "Content-Type: application/json"To VSDX:
curl -fk https://10.0.0.1/hgapi/export-vsdx \
--output hyperglance.vsdx \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "datasource":"Azure", "tagViewIds": ["Resource Group: name-of-my-resource-grp"] }' \
--request POST --header "Content-Type: application/json"To PNG:
curl -fk https://10.0.0.1/hgapi/export-png \
--output hyperglance.png \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "tags":[{"key":"MyTag", "value":"TheValue"}], "includeDependencies":true }' \
--request POST --header "Content-Type: application/json"To VSDX:
curl -fk https://10.0.0.1/hgapi/export-vsdx \
--output hyperglance.vsdx \
--user my-api-user:77415974-1b16-4ee8-af98-6be979611158 \
--data '{ "tags":[{"key":"MyTag", "value":"TheValue"}], "includeDependencies":true }' \
--request POST --header "Content-Type: application/json"