Tag Archives: API

VAST Storage API & JQ

Glendalough Hiking Trail
Hiking Glendalough Park in Ireland

Vast builds some neat storage systems that provide management functionality via a REST API.

jq is a command-line JSON processor, or as the author describes it “sed for JSON”.

This is how I use both tools to get a quota’s used capacity:

curl -u $USERNAME:$PASSWORD --insecure -X GET "https://your-vast-dashboard/api/quotas/" -H "accept: application/json" | jq  ".[]|select(.used_capacity_tb | length > 0) | {name: .name, used: .used_capacity_tb}" 

USERNAME and PASSWORD are environmental variables set to the username and password you use to access your VAST API. Change to URI to point to your VAST appliance.