search
top

Retrieving SmartQuota Data on Isilon with RestAPI and PowerShell

Introduction

Many different tools available for administrators to manage storage devices and create reports and or monitors. With EMC Isilon we have RestAPI available to make calls for information. In this post we will cover how to use PowerShell to make calls to Isilon and get Smartquota data (path, thresholds for advisory & hard) and usage data and convert it from bytes to GB. The basis of the script can be used as the main shell to create more customized scripts.

Prerequisites

To be able to execute RestAPI calls to Isilon you will need to create an account and add the appropriate roles. For GET operations a read-only account is all that you will need. For this post we will create a local group and grant PlatformAPI and Quota read-only roles.

The Code

So now lets get down to the meat of the post and the code we need to execute the RestAPI calls in PowerShell for Isilon.

 

 

Let’s take a deeper look into the code example what it is doing. The first part of the script is setting the security to be able to connect to your Isilon array. This code is not original, I found this at code from blogs.msdn.com. Just copy and paste this section and change the username and password. This will work for any other RestAPI in PowerShell using Basic Authentication.

Next section of the code we will setup our URI (Uniform Resource Identifier).  we will identify three variables called $baseurl, $resourceurl and $uri. The $baseurl is the https ip address of the Isilon node you want to run the query against. For the $resourceurl variable we will be using the /platform/1/quota/quotas resource path. You can get a list of all available resource available from EMC RestfulAPI documentation for Isilon. The final $uri is the combining of the two previous variables.

Next section of the code we are going to create an object and make a Invole-RestMethod cmdlet and GET action using security for authentication.

$ISIObject = Invoke-RestMethod -Uri $uri -Method Get -Headers $headers

Now we are ready to get the quotas. For the output I am looking for Advisory Threshold GB, Hard Threshold GB and Usage GB from quotas. I have added converting the output to GB instead of bytes to make it easier to read.

 

The output from the scripts.

Isilon RestAPI

Conclusion

So we have explored making a basic Restful API call to Isilon to get specific quota information. With this you can now start to explore  other RestfulAPI options available on Isilon.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

top