DellEMC

REST API and DellEMC Storage Part 3 – Unity

This blog post is 3rd part of REST API with DellEMC Storage blog series.

  • In the first part of this blog series, we discussed what is REST API and different usage options
  • Second part was about managing DellEMC PowerMax storage arrays using REST API

In this post, we will discuss how you can use manage DellEMC Unity storage using REST API. We will be using the Postman tool during the entire blog series. So let’s get started with automating the DellEMC Unity storage system.

The DellEMC Unity REST API Background

DellEMC Unity is 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 EMC 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 EMC Unity includes complete REST API support, providing a developer-friendly way to manage Dell EMC Unity systems and automate various tasks.

Dell EMC Unity’s REST API fully supports all the management tasks that a user can perform in the Unisphere GUI. Dell EMC 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 EMC Unity systems in their environment. This provides flexibility in management and opens possibilities for more complex operations.

DellEMC Unity Management Options

Assessing DellEMC 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

DellEMC 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 DellEMC Unity REST API Operations

DellEMC Unity’s REST API supports the following types of REST calls.

  • GET – Get information on objects. For example – Get Unity storage system’s details
  • POST – Create an Object. For example – Create new LUN/s
  • PUT – Making changes to an objects. For example – Change 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 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 new drop-down, select Request
DellEMC Unity REST API – Postman tool GUI – 1
  • In New Request pop-up enter Request nameDescription (optional) and Name of the Collection. Then click on Save.
DellEMC Unity REST API – Postman tool GUI – 2
  • Click on the request type drop-down and select GET.
    • Please note that we are selecting GET because is this example we are creating sample REST API call to list all the available storage pools.
    • This option will be different based on type of REST API operation
DellEMC Unity REST API – Postman tool GUI – 3
  • Enter below Request URL
    • 1.1.1.1 – Replace with Unisphere IP address/hostname

https://1.1.1.1/api/types/pool/instances

DellEMC Unity REST API – Postman tool GUI – 4
  • Click on the Authorization. Enter Unisphere Username and Password.
DellEMC Unity REST API – Postman tool GUI – 5
  • Note that Unity REST API GET request needs below 3 headers. Click on Headers and enter below header details as shown in the screenshot. Then click Send
    • Accept – application/json
    • Content-type – application/json
    • X-EMC-REST-CLIENT – true
DellEMC Unity REST API – Postman tool GUI – 5
  • In the Postman Response section you’ll see REST API response. In this case you’ll see list of all the storage pools in Unity array.
DellEMC Unity REST API – Postman tool GUI – 6

Additionally please note that POST/PUT/DELETE requests need one additional Header – EMC-CSRF-TOKEN. This token is generated using GET request.

So, let’s create one POST request for creating new LUN.

  • Follow above-listed GET request steps. Click on Headers under GET Response. Copy the EMC-CSRF-TOKEN from the Headers
DellEMC Unity REST API – Postman tool GUI – 7
  • Now click on New and Under new drop-down, select Request (screenshot in GET request steps)
  • In New Request pop-up enter Request nameDescription (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 is this second example we are creating REST API call to create new LUN.
  • Click on the Authorization. Enter Unisphere Username and Password.
  • Under Params enter below details.
    • Name – Name of the LUN
    • Pool – Storage Pool in which LUN will be created
    • Size – LUN size
DellEMC Unity REST API – Postman tool GUI – 7
  • Click on Headers and enter 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
DellEMC Unity REST API – Postman tool GUI – 8

Dell EMC and REST API – Way Forward

I hope this clarifies many basics for getting started with REST API and DellEMC Unity storage. You might also have understood that creating creating valid URLs is very important aspect of using REST API. Having this in mind we have created ready Postman collection for DellEMC 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.

I hope this post will get you started with your Dell EMC Unity automation journey.

5 replies »

  1. Thank you for this step by step guide as it saved me a ton of time connecting our Dell EMC performance metrics to our Elasticsearch cluster via Logstash. I had spent days trying to get the connection to work and this post had all of the pieces that I was missing! Thanks again and enjoy the rest of your day!

    Like

Leave a comment

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