Retrieving data about resources by using a REST API command line utility
You can connect to the REST API for IBM Spectrum Control and retrieve data by using a REST command line utility.
You can use any REST command line utility, for example, GNU Wget. To access information
about the GNU Wget utility, go to https://www.gnu.org/software/wget/.
The IBM Spectrum
Control REST API is hosted
here: https://<hostname>:9569/srm/REST/api/v1/
.
You
can enter a command to authenticate with the REST API and store a security token in a file to use in
your later queries, for example, cookies.txt
.
You can use the utility, by
entering the following
command:
wget --post-data "j_username=<user name>&j_password=<password>"
--no-check-certificate --keep-session-cookies --save-cookies cookies.txt
https://<hostname>:9569/srm/j_security_check
You
can use the security token in all subsequent commands that are issued against the REST API, by
entering the following
command:wget --no-check-certificate --load-cookies cookies.txt
https://<hostname>:9569/srm/REST/api/v1/
Example
(partial
listing)
},
{
"Description": "Provides a list of ports belonging to a parent storage system.
Format: \/StorageSystems\/<id>\/Ports For a list of ports associated with a
port owner, specify the owner type and id in the URL.
To
see a list of all storage systems, you can append the
URL:
https://<hostname>:9569/srm/REST/api/v1/StorageSystems
To
see more information about a resource type, you can further append the URL (where
<Name> is the resource type, such as StorageSystems, Switches, Servers,
etc.)
https://<hostname>:9569/srm/REST/api/v1/<Name>
To
see more information about a specific resource, add the ID to the URL (where
<id> is available from
https://<hostname>:9569/srm/REST/api/v1/<Name>)
:
https://<hostname>:9569/srm/REST/api/v1/<Name>/<id>
To
query for volumes that belong to a specific storage system,
enter:
https://<hostname>:9569/srm/REST/api/v1/StorageSystems/57909/Volumes
Example
(partial listing)[
{
"Acknowledged": "No",
"Allocated Space": "1.00",
"Capacity": "1.00",
"Controller": "Node 0",
"Copy Relationship": "",
"Easy Tier": "Tiered Pools\/No",
"Encryption": "",
"Enterprise HDD Capacity": "1.00",
"Format": "FB",
"Hosts": "18",
"LSS or LCU": "00",
"Last Data Collection": "Apr 10, 2016, 15:03:57",
"Name": "CET_RA_vol",
"Nearline HDD Capacity": "",
"Physical Allocation": "Fully Allocated",
"Pool": "General_Use_1",
"RAID Level": "RAID 5",
"SSD Capacity": "",
"Service Class": "",
"Shortfall": "",
"Status": "Normal",
"Storage System": "DS8000-2107-75BLG91-IBM",
"Storage Virtualizer": "None",
"Thin Provisioned": "No",
"Ticket": "",
"Tier Distribution": "0",
"Unallocated Space": "0.00",
"Unused Space": "",
"Used Allocated Space": "",
"Used Space": "1.00",
"Virtualizer Disk": "None",
"Volume ID": "0000",
"Volume Number": "0",
"Volume Unique ID": "75blg91\/0000",
"id": "79852"
},
The information that is provided in the
Format:
field in the example shows
what combinations are possible. For
example,https://<hostname>:9569/srm/REST/api/v1/StorageSystems/<id>/Ports
Tips:
- If the
Format:
field is omitted, you can add the ID of one resource to the URL. - The name elements in the URL are case-sensitive.
- The names of resource types are plural.
- If the URL is not used correctly, you might receive the following error
message:
{"result":{"type":"E","msgId":"BPCUI0099E","time":"Apr 4, 2016 16:25:07","text": "The storage resource is not available."}}
- If the URL returns a blank page, it means that no data is available for the resource. For example, if you query an application for file shares and there are no file shares in the application, the resulting page is blank.
IBM Spectrum® Control REST API | Description |
---|---|
https://<hostname>:9569/srm/REST/api/v1/StorageSystems |
A list of all monitored storage systems. |
https://<hostname>:9569/srm/REST/api/v1/StorageSystems/2002 |
Specific information for one storage system (ID is available from this URL:
https://<hostname>:9569/srm/REST/api/v1/StorageSystems )
. |
https://<hostname>:9569/srm/REST/api/v1/StorageSystems/2002/Volumes |
A list of all volumes for one storage system. |
https://<hostname>:9569/srm/REST/api/v1/StorageSystems/2002/Volumes/2465/Performance |
The available performance metrics for a volume. |
https://<hostname>:9569/srm/REST/api/v1/StorageSystems/2002/RemoteReplication |
The remote mirror replication relationships for storage systems. |
https://<hostname>:9569/srm/REST/api/v1/StorageSystems/2002/Volumes/2465/Performance/824?granularity=sample&startTime=1455818400000&endTime=1455904800000 |
Sample performance granularity information and a start and end time for the performance data. |
Note: IBM® Storage is changing the capacity terminology that is
used in IBM Storage products to make it more consistent. The
new capacity terminology is used in IBM
Spectrum Control
5.3.6 or later. The new terminology is used in the GUI, but the names used in the REST API have not
changed. The output from the REST API continues to use Allocated Space instead of Used Capacity,
Physical Allocation instead of Used Capacity %, and so on.