search
top

Retrieving NFS Export Data on Isilon with RESTful API and PowerShell

Introduction

In an earlier post we covered using RESTful API calls to EMC Isilon to retrieve quota data. In this post we will make the same calls but gather data on NFS exports for screen output as well and optional CSV output.

Prerequisites

To be able to execute RESTful API 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 Platform API and NFS read-only roles.

The Code

So now lets get down to the meat of the post and the code we need to execute the RESTful API 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 RESTful API 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/nfs/exports 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 Invoke-RestMethod cmdlet and GET action using security for authentication.

Now we are ready to get the output.

 

The output from the scripts.

restfulnfsisilon

There are more fields available for output. By not adding the select statement we will get the full output available.

From the available output we can add much more to the output. All you have to do is to add the fields to the select statement.

Conclusion

So we have explored making a basic Restful API call to Isilon to get specific NFS export information. You can also change the output by exploring the different fields available from the output.

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