{"id":948,"date":"2020-06-11T03:36:02","date_gmt":"2020-06-11T03:36:02","guid":{"rendered":"http:\/\/timony.com\/mickzblog\/?p=948"},"modified":"2020-06-11T03:36:02","modified_gmt":"2020-06-11T03:36:02","slug":"vast-storage-api-jq-json","status":"publish","type":"post","link":"https:\/\/timony.com\/mickzblog\/2020\/06\/11\/vast-storage-api-jq-json\/","title":{"rendered":"VAST Storage API &#038; JQ"},"content":{"rendered":"\n<figure class=\"wp-block-embed-flickr aligncenter wp-block-embed is-type-photo is-provider-flickr\"><div class=\"wp-block-embed__wrapper\">\n<a href=\"https:\/\/flic.kr\/p\/fjwTkV\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/live.staticflickr.com\/5445\/9398717759_f7f6db4ae5_n.jpg\" alt=\"Glendalough Hiking Trail\" width=\"320\" height=\"240\" \/><\/a>\n<\/div><figcaption>Hiking Glendalough Park in Ireland<\/figcaption><\/figure>\n\n\n\n<p><a href=\"https:\/\/vastdata.com\/\">Vast<\/a> builds some neat storage systems that provide management functionality via a REST API. <\/p>\n\n\n\n<p><a href=\"https:\/\/stedolan.github.io\/jq\/\">jq<\/a> is a command-line JSON processor, or as the author describes it &#8220;sed for JSON&#8221;.<\/p>\n\n\n\n<p>This is how I use both tools to get a quota&#8217;s used capacity:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -u $USERNAME:$PASSWORD --insecure -X GET \"https:\/\/your-vast-dashboard\/api\/quotas\/\" -H \"accept: application\/json\" | jq\u00a0 \".[]|select(.used_capacity_tb | length > 0) | {name: .name, used: .used_capacity_tb}\"\u00a0<\/pre>\n\n\n\n<p>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. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;sed for JSON&#8221;. This is how I use both tools to get a quota&#8217;s used capacity: curl -u $USERNAME:$PASSWORD &#8211;insecure -X GET &#8220;https:\/\/your-vast-dashboard\/api\/quotas\/&#8221; -H &#8220;accept: application\/json&#8221; | jq\u00a0 &#8220;.[]|select(.used_capacity_tb &hellip; <a href=\"https:\/\/timony.com\/mickzblog\/2020\/06\/11\/vast-storage-api-jq-json\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">VAST Storage API &#038; JQ<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[22,39],"tags":[717,714,713,716,718,715],"class_list":["post-948","post","type-post","status-publish","format-standard","hentry","category-linux","category-tech","tag-api","tag-jq","tag-json","tag-rest","tag-storage","tag-vast"],"_links":{"self":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/948","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/comments?post=948"}],"version-history":[{"count":5,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/948\/revisions"}],"predecessor-version":[{"id":953,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/posts\/948\/revisions\/953"}],"wp:attachment":[{"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/media?parent=948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/categories?post=948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/timony.com\/mickzblog\/wp-json\/wp\/v2\/tags?post=948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}