Start a Conversation

Unsolved

1 Rookie

 • 

10 Posts

1235

October 18th, 2022 23:00

REST API and Dell Technologies Storage - PowerStore

Today we live in a world powered by REST APIs. And when it comes to REST APIs, Dell PowerStore is one of the best. Why? An important thing to understand is that PowerStore is a REST API-first system, which means all functionality that is exposed externally has been made available through the API. This also means that other interfaces such as the CLI or the GUI are in fact consumers of the REST API.

Like in previous articles in this series we will continue using Postman. You can download the Postman collection we showcase in this article from the Project Vision GitHub page

Once the collection is imported it will look like this

collection.jpg

 

The Postman collections in Project Vision use variables to make them more reusable. This means that directing a call to a different array is as simple as selecting a different environment. In the environment section in the top-right corner, I have configured and selected an environment for my PowerStore. The PowerStore collection requires 3 variables (ip, pwd, token) in the environment. The variable “pwd” is the password for the “admin” user. If you need to use a user other than “admin”, you can change it by selecting “edit” on the collection itself

changeuser.jpg

 

The user you use to query the API is important. It has to have enough rights to perform the equivalent action in the GUI. For example, the “/audit_event” resource needs to have the “Administrator” role. For the other resources, you can use “Storage Administrator” and even “Operator” roles.

By default the response to “GET” API calls will only return the “id” of the objects in that collection, ex: the internal “id” of every volume for the “GET volumes” call. As discussed in Part 1 of this series, this allows for more responsive queries and a more resource-efficient code

only-id.jpg

 

When you are exploring an object for the first time you can use the select parameter with “*” wildcard to show all properties.

wildcard.jpg

 

Ultimately you want to be selective, and retrieve the properties you are after. This is especially true if you are planning to run a query very frequently. You can do so with the “select” parameter by specifying a list of the properties you want to be separated by commas

specificfields.jpg

 

By default the response comes sorted alphabetically by “id”, ie 1,10,100,1000, 1001,1002 … You can sort the response by any field you want and you can do so in ascending or descending order

sorted.jpg

 

The PowerStore REST API has a pagination feature. By default, it gives you 100 entries but you can choose to show fewer. This is especially handy if you use it in conjunction with the sorting capability we mentioned above. This is done with the “limit” parameter. In the screenshot below you can see that “limit=5” shows 42 lines of output. If I run the same query without limit it will return 800 lines, which makes sense because 5 is 1/20th of 100. The net result is a more responsive query and a more resource efficient.

limit5.jpg

 

Finally, you can match the type of alerts you want by using the 13 operators supported (ex: gt for “greater than”, lt for “less than” …). Don’t forget the “.” After the comparator. In this screenshot, you can see how we are searching for audit_events with a “resource_type” of “volume”

match.jpg

 

Documentation for the API is available through Swagger UI from the live array itself in the following URL: https:///swaggerui#

ps-swagger.png

 

A good resource for API documentation for all Dell products is the Dell Developer Portal.

But if you like the old-fashioned API reference guide, you can get it here.

In the following video, you can see various aspects of the Dell PowerStore REST API in action such as authentication and the advanced request parameters, which allow developers to perform powerful queries with the REST API

 

 

Finally in this other video you can see an ste-by-step example of how to use use the REST API to do storage provisioning 

No Responses!

Top