REST API and Dell Technologies Storage - Introduction
Wed, 19 Oct 2022 22:01:00 -0000
|Read Time: 0 minutes
REST API with Dell Technologies
What is REST? REST stands for Representational State Transfer. REST provides access to resources on a tree-like structure. In order to reference a resource (like a volume, an initiator group, etc) we use a URI (Uniform Resource Identifier), which essentially looks like a path in a Linux file system, ex: /api/v1/volumes/volume1
REST uses HTTP or HTTPS for communication between the client and the API itself. A well design REST API implements CRUD operations by using different HTTP methods as follows:
POST method for Create operations, ex: creating a new volume in an array
GET method for Read operations
PUT method for Updating resources
DELETE method for Deleting resources.
REST is stateless, which means it does not store application state information. Since REST is stateless we typically see data being sent back and forth in self-documenting formats like JSON or XML . The actual supported format depends on the REST API and the product. XML used to be more common years ago but JSON is more common nowadays. Pretty much every product in the Dell storage portfolio supports JSON. Some products support both JSON and XML
All products in Dell's storage portfolio have a REST API. In some of them, the REST API is the primary means for management. This is the case for the newest products like PowerStore, VxRail, PPDM etc which have a API-first architecture. In this case, other tools like GUI or CLI are mere consumers of the REST API, and as such offer a subset of the capability available in the REST API. Other more veteran products (PowerMax, Unity, ...) also feature a powerful REST API
In terms of authentication, all products offer either Basic Authentication (username and password), a token-based system or both systems. Token-based authentication is more secure but it requires an extra step to generate a token
A key online resource to learn about the REST API of all products in
Accessing a REST API
As we mentioned above a REST API uses HTTP as the communication protocol. We tend to associate HTTP with the World Wide Web. However, as we saw, the data is transferred using a format like JSON, instead of HTML. This ultimately means that a web browser is not an adequate tool to talk to a REST API. This is partly due to the fact that other HTTP features like headers, body, http method, etc are used by REST APIs but are not accessible in web browsers. So generally we tend to use REST APIs in one of three ways:
CLI
REST Clients
Programming Language
Let's look at an example of cURL. In the following example we can see how to use cURL to retrieve information about bricks in an XtremIO system
curl -k -u "admin:p@ssw0rd" --request GET https://1.1.1.1/api/json/v2/types/bricks
-k
-u
--request GET
https
/api/json/v2/types/bricks
When it comes to graphical tools, Postman is very popular. It can be downloaded for free for most common tasks. Here you can see how Postman exposes capabilities of HTTP communications that are not available in ordinary web browsers
>>>Embedded content : https://www.youtube.com/watch?v=_3dZrc4xeso
One of the nice things you can do with Postman is to generate code for a given REST API call in virtually any programming language which is a good way to start your automation projects.
In the following articles in these series we will dive deeper into the REST API of some of Dell's most popular products