Skip to content

Instantly share code, notes, and snippets.

@brucevanhorn2
Created December 16, 2022 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brucevanhorn2/80b517e983fd3c010770ed65af43dd13 to your computer and use it in GitHub Desktop.
Save brucevanhorn2/80b517e983fd3c010770ed65af43dd13 to your computer and use it in GitHub Desktop.
VSI 5 Enterprise Summary Export - 12 Months of Data

VSI 5 Enterprise Summary Export - 12 Months of Data

This gist contains a few exmaples of how to export your VSI data. In particular, 12 months of enterprise summary data. You can export to either a CSV file or a JSON file allowing you to then import the data into any analytics tool you choose.

This is a RESTful API call, so you need to create a script that can make an HTTP POST request to https://vsi5.visualstorageintelligence.com/api/export/v1/enterprise_summary_12_months. The payload you post should be in JSON format and should contain the following key value pairs:

output_format: "csv" or "json" request_user: the email address you use to login to VSI request_password: the password you use to login to VSI

This gist provides 3 examples: one in curl, one in PowerShell, and one in Python 3.

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$body = "{
`n `"export_format`": `"json`",
`n `"request_user`": `"your email address here`",
`n `"request_password`": `"your password here`"
`n}"
$response = Invoke-RestMethod 'https://vsi5.visualstorageintelligence.com/api/export/v1/enterprise_summary_12_months' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
/api/export/v1/enterprise_summary_12_months
curl --location --request POST 'https://vsi5.visualstorageintelligence.com/api/export/v1/enterprise_summary_12_months' \
--header 'Content-Type: application/json' \
--data-raw '{
"export_format": "json",
"request_user": "your email here",
"request_password": "your password here"
}'
import http.client
import json
conn = http.client.HTTPSConnection("vsi5.visualstorageintelligence.com")
payload = json.dumps({
"export_format": "json",
"request_user": "your email here",
"request_password": "your password here"
})
headers = {
'Content-Type': 'application/json'
}
conn.request("POST", "/api/export/v1/enterprise_summary_12_months", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment