Skip to content

Instantly share code, notes, and snippets.

@brucevanhorn2
Last active December 16, 2022 22:16
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/bc48afb247fee606e4615e6716066d92 to your computer and use it in GitHub Desktop.
Save brucevanhorn2/bc48afb247fee606e4615e6716066d92 to your computer and use it in GitHub Desktop.

VSI 5 Business Unit Forecast by Data Center Export

This REST api call allows you to export your company's business unit forecast by data center. You need to send an HTTP POST to https://vsi5.visualstorageintelligence.com/api/export/v1/get_bu_forecasting along with the folloing parameters in JSON format:

export_format : "json" or "csv" request_date : formatted as mm-dd-yyyy such as 11-04-2022 request_user : the email address you use to login to VSI request_password : the password you use to login to VSI

In this gist, we have a curl script, a PowerShell script, and a Python 3 script to help with automated retrieval.

curl --location --request POST 'https://vsi5.visualstorageintelligence.com/api/export/v1/get_bu_forecasting' \
--header 'Content-Type: application/json' \
--data-raw '{
"export_format": "json",
"request_date": "11-04-2022",
"request_user": "your email here",
"request_password": "your password here"
}'
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$body = "{
`n `"export_format`": `"json`",
`n `"request_date`": `"10-31-2022`",
`n `"request_user`": `"your email address here`",
`n `"request_password`": `"your password here`"
`n}"
$response = Invoke-RestMethod 'https://vsi5.visualstorageintelligence.com/api/export/v1/get_bu_forecasting' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
import http.client
import json
conn = http.client.HTTPSConnection("vsi5.visualstorageintelligence.com")
payload = json.dumps({
"export_format": "json",
"request_date": "10-31-2022",
"request_user": "your email here",
"request_password": "your password here"
})
headers = {
'Content-Type': 'application/json'
}
conn.request("POST", "/api/export/v1/get_bu_forecasting", 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