Unsolved
10 Posts
2
945
REST API and Dell Technologies Storage - Unity
In this post, we will discuss how you can use manage Dell Unity storage using REST API. We will use the Postman tool during the entire blog series. Feel free to download and install in your system to follow along. The first post in this series provides more details about Postman and the collections we will use in this article. So let’s get started with automating the Dell Unity storage system.
The Dell Unity REST API
Dell Unity is one of the most user-friendly storage systems. The most common management tools for Unity systems are
- Unisphere UI (Embedded) – An HTML5 graphical user interface used to manage Dell Unity systems
- Unisphere Command Line Interface (UEMCLI) – UEMCLI allows a user to perform tasks on the storage system by typing commands instead of using the graphical user interface
The Dell Unity includes complete REST API support, providing a developer-friendly way to manage Dell Unity systems and automate various tasks.
Dell Unity’s REST API fully supports all the management tasks that a user can perform in the Unisphere GUI. Dell Unity’s REST API response formats all communication in JSON notation. Users can send REST API requests using their favorite REST API tools to manage Dell Unity systems in their environment. This provides flexibility in management and opens possibilities for more complex operations.
Assessing Dell Unity’s REST API
Once a Unity system is up and running, users can navigate to the following web addresses to get access to the REST API documentation:
- REST API Programmer’s Guide – https://{ {unisphere_management_address}}/apidocs/programmers-guide/index.html
- REST API Reference Guide – https://{ {unisphere_management_address}}/apidocs/index.html
Dell Unity’s REST API is available via Unisphere running on the array via the following Base URL
https://{
{unisphere_management_address}}/api
- { {unisphere_management_address}} – Replace with IP Unisphere IP address or hostname
Supported Dell Unity REST API Operations
Dell Unity’s REST API supports the following types of REST calls.
- GET – Get information on objects. For example – Get the Unity storage system’s details
- POST – Create an Object. For example – Create new LUN/s
- PUT – Making changes to an object. For example – Change the size of the existing LUN
- DELETE – Remove an object. For example – Delete existing LUN/s
Usually, the REST client (like Postman) can be used to help figure out what REST calls you want to run.
Building your REST API calls
Now let’s get started with creating REST API calls. In this example, we will create a sample REST API call to list all the available storage pools.
Before we get started make sure you’ve Postman installed and Unisphere is reachable.
- Open Postman and click on New. Under the new drop-down, select Request
- In the New Request pop-up enter the Request name, Description (optional), and Name of the Collection. Then click on Save.
- Click on the request type drop-down and select GET.
- Please note that we are selecting GET because in this example we are creating a sample REST API call to list all the available storage pools.
- This option will be different based on the type of REST API operation
- Enter the below Request URL
- 1.1.1.1 – Replace with Unisphere IP address/hostname
https://1.1.1.1/api/types/pool/instances
- Note that Unity REST API GET request needs below 3 headers. Click on Headers and enter the below header details as shown in the screenshot. Then click Send
- Accept: application/json
- Content-type: application/json
- X-EMC-REST-CLIENT: true
- In the Postman Response section, you’ll see the REST API response. In this case, you’ll see a list of all the storage pools in the Unity array.
Additionally please note that POST/PUT/DELETE requests need one additional Header – EMC-CSRF-TOKEN. This token is generated as part of every GET request and it can be obtained from the Headers of the Response. CSRF stands for Cross-Site Request Forgery
So, let’s create one POST request for creating a new LUN.
- Follow the above-listed GET request steps. Click on Headers under GET Response. Copy the EMC-CSRF-TOKEN from the Headers
- Now click on New and Under the new drop-down, select Request (screenshot in GET request steps)
- In New Request pop-up enter the Request name, Description (optional), and Name of the Collection. Then click on Save. (screenshot in GET request steps)
- Click on the request type drop-down and select POST.
- Please note that we are selecting POST because in this second example we are creating a REST API call to create a new LUN.
- Click on the Authorization. Enter Unisphere Username and Password.
- Under Params enter the below details.
- Name – Name of the LUN
- Pool – Storage Pool in which LUN will be created
- Size – LUN size
- Click on Headers and enter the below header details as shown in the screenshot. Then click Send
- Accept – application/json
- Content-type – application/json
- X-EMC-REST-CLIENT – true
- EMC-CSRF-TOKEN – Copied from GET response
Dell and REST API – Way Forward
I hope this clarifies many basics for getting started with REST API and Dell Unity storage. You might also have understood that creating valid URLs is a very important aspect of using REST API. Having this in mind we have created a ready Postman collection for Dell Unity storage. Here’s the GitHub link to the repository. Feel free to download and share.
Below are the additional resources available for taking REST API usage to next level.
- Dell Unity: Unisphere Overview – This white paper introduces and describes Dell Unisphere on the Unity platform
- Unisphere Management REST API Programmer’s Guide– This link has the REST API documentation for the Dell Unity array.
- Unisphere Management REST API Reference Guide– This document lists all the available REST API resources by category.
- Dell Developer portal - This site contains online documentation for the REST API of all Dell products
I hope this post will get you started with your Dell Unity automation journey.