Primary Storage

 View Only

IBM Storage Insights – Ecosystem enablement using REST API

By Ramakrishna Vadla posted Sat January 20, 2024 12:55 AM

  

IBM Storage Insights – Ecosystem enablement using REST API

Ramakrishna Vadla, Arunagiri Rajasekaran

The IBM Storage Insights introduces access to REST APIs, facilitating the consumption of storage systems' configuration and performance data for integration with customers' operational dashboards. IBM Storage Insights REST APIs offer a smooth integration pathway for external applications, including integrated operation managers, by adhering to REST principles. These APIs utilize predictable resource-oriented URLs, accept form-encoded request bodies, generate JSON-encoded responses, and adhere to standard HTTP response codes, authentication methods, and verbs. Additionally, they incorporate safeguards to manage bursts of incoming requests, enhancing overall system stability. IBM Storage Insights administrators and monitoring personas can efficiently leverage the REST API to retrieve relevant data within their designated tenant.

The IBM Storage Insights REST APIs can be used for various ecosystem integrations, here are some of the use cases mentioned below, 

ü  Integrate storage systems health, capacity, and performance statistics with Integrated Operations Dashboards

ü  Integrate alerts and notifications generated from storage systems with Incident Management Systems

ü  Integrate security alerts with SOAR tools (Security Orchestration, Automation, and Response) for cyber resiliency workflow automations.

The usage of IBM Storage Insights REST APIs involve three simple steps,

  1. Create an API Key
  2. Generate a token using an API Key
  3. Access REST API using a token

1    1. Create an API Key

The following section describe the step by step process to create REST API key.

       a.     Go to “REST API Key access” menu

       b.     Click on “Create rest API +” to generate API key.

      c.     Fill all the relevant information and click on “Generate API Key+” to create an API key for a selected user with an expiration time.  Use “Copy” link to copy the API key for using it in your REST API.

      d.     The following table will be added with a new row for a selected user’s API key.

1     2. Generate a token using an API Key

The following section describes how to use the API key generated in the above steps to create an API token which is required for authenticating a REST API to query the data from IBM Storage Insights,

Use a curl command to get the token,

Command:

curl --location --request POST 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/token' \

--header 'x-api-key: <api-Key>' 

       Sample Output:

{"result":{"token":"<token>","expiration":1705647055000}, "metadata":{"rc":"success", "input":{},"took":1}}

Here is the description of the place holders used in these sections,

<tenant-id> - This is the tenant id of the customer’s IBM Storage Insights instance. For example, your IBM Storage Insights URL  look like this- https://insights.ibm.com/gui/abcd-efgh-ijkl-mnop-xyz, the last part of the url i.e. abcd-efgh-ijkl-mnop-xyz is your <tenant-id>

<api-key> - API key generated in #1 section

<token> - The short lived token created using the API key to access the REST API

<system-uuid> - It is the unique id of the storage system

3

3  3. Access REST API using a token 

a.     a. Get the list of storage systems.

Command:

curl --location --request GET 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/storage-systems' \

--header 'x-api-token: <token>' \

--header 'Content-Type: application/json' \

--data '{}'

       Sample Output:

{"tenantId":"<tenant-id>","storageType":"block, filer, object","timeStamp":1705646316686,"data":[{"written_capacity_limit_bytes":309761631322112,

"status":200,"message":"success","path":"/restapi/v1/tenants/<tenant-id>/storage-systems","method":"GET"}

b.     b. Get the details of a given storage system using its storage system UUID queried in 3.a

Command:

curl --location --request GET 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/storage-systems/<system-uuid>' \

--header 'x-api-token: <token>' \

--header 'Content-Type: application/json' \

--data '{}'

       Sample Output:

{"tenantId":"<tenant-id>","storageType":"block, filer, object","timeStamp":1705646316686,"data":[{"written_capacity_limit_bytes":309761631322112,

"status":200,"message":"success","path":"/restapi/v1/tenants/<tenant-id>/storage-systems/<system-uuid>","method":"GET"}

c.     c. Get the list of volume details for a given storage system.

Command:

curl --location --request GET 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/storage-systems/<system-uuid>/volumes' \

--header 'x-api-token: <token>' \

--header 'Content-Type: application/json' \

--data '{}'

Sample Output:

{"tenantID":"<tenant-id>","data":[{"capacity_bytes":1099511627776,…}

d.     d. Get the list of all latest alerts from last one day for all storage systems

Command:

curl --location --request GET 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/alerts?duration=1d&severity=critical' \

--header 'x-api-token: <token>' \

--data '{}'

      Sample Output:

{"tenantID":"<tenant-id>","startTimestamp":1705560308453,"endTimestamp":1705646708453,"data":[{"Alert ID":…}

e.     e. Get the list of all latest alerts from last one day for a given storage system.

Command:

curl --location --request GET 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/ storage-systems/<system-uuid>/alerts?duration=1d&severity=critical' \

--header 'x-api-token: <token>' \

--data '{}'

      Sample Output:

{"tenantID":"<tenant-id>","startTimestamp":1705560308453,"endTimestamp":1705646708453,"data":[{"Alert ID":…}

f.      f. Get the list of all latest notifications from last one day for all storage system

Command:

curl --location --request GET 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/notifications?duration=10d' \

--header 'x-api-token: <token>' \

--header 'Content-Type: application/json' \

--data '{}'

      Sample Output:

{"tenantID":"<tenant-id>","startTimestamp":1704783128987,"endTimestamp":1705647128987,"data":[{"event":"Call Home is operational",…}

g.     g.Get the list of all latest notifications from last one day for a given storage system.

Command:

curl --location --request GET 'https://insights.ibm.com/restapi/v1/tenants/<tenant-id>/storage-systems/<system-uuid>/notifications?duration=10d' \

--header 'x-api-token: <token>' \

--header 'Content-Type: application/json' \

--data '{}'

      Sample Output:

{"tenantID":"<tenant-id>","startTimestamp":1704783128987,"endTimestamp":1705647128987,"data":[{"event":"Call Home is operational",…}

References:

IBM Storage Insights REST API details

https://www.ibm.com/docs/en/storage-insights?topic=configuring-rest-api

REST API docs - 

https://insights.ibm.com/restapi/docs/

Sample Python code to try out the REST APIs

https://www.ibm.com/docs/en/SSQRB8/com.ibm.spectrum.si.doc/RESTAPISample.zip


#Featured-area-2
#Featured-area-2-home
#Highlights
#Highlights-home
0 comments
43 views

Permalink