Spectrum Protect Plus REST API basics & how to get started
Daniel Wendler 310002MECP Visits (2906)
IBM Spectrum Protect Plus is a modern Data Protection and Data Reuse solution focused on Virtual Environments and Applications. This article provides an overview of the Spectrum Protect Plus REST API and explains how to get started with the API. We highlight the need to get involved with the REST API as it offers wide capabilities such as monitoring, configuration, automation and administration of Spectrum Protect Plus (SPP) environments without utilizing the Graphical User Interface (GUI). We will demonstrate how to explore and use the API and explain which tools are useful for exploration and interaction. General purpose tools like cURL and JQ are introduced as well as a Python library called sppclient which simplifies the interaction for API operations like GET, POST, PUT and DELETE.
The necessity to have a deeper look at the SPP's REST API mostly becomes a hot topic when the Spectrum Protect Plus Environment is scaling out. Reasons why the GUI may not be always the perfect fit for every client need may be:
The IBM Spectrum Protect Plus (SPP) REST API comes in place to enable administrators to use existing REST capable tools or to implement their own tools and scripts and integrate them into the operating workflows. RESTful (REpresentational State Transfer) APIs use stateless protocols where the client holds the session state. RESTful clients send requests to a resource URI and expects a response i.e. in HTML, XML, JSON, or some other formats. The SPP API is sending responses in JSON (Java Script Object Notification) and implements a subset of four basic HTTP methods for applications to interact with: GET, POST, PUT, and DELETE.
How to get started with the API:
Explore the API:
1. cURL and JQ
command: curl -sS -k -X POST -H 'Acc
The screenshots show a list available documented API categories. In the example below we query the available sites with their attributes. By selecting the endpoint and the desired operation the user can try out the command. A GET operation will not make any changes to the configuration so this is a good start to explore the responses and the response format....
3. use of sppclient
The sppclient is a Python project provided by the Spectrum Protect Plus development team. It can be obtained from Github (htt
The integration of the sppclient ease interaction with SPP's REST API and is intended for testing, monitoring and automation. The module is registered in PyPI and can be installed with all module requirements with the command: pip install sppclient
The table below lists scripts which are bundled with the sppclient package provided by the SPP development team:
Further on we have recently contributed in the project and have added the following new scripts:
Displays the alerts (see GUI alerts), can be sorted with DESC, ASC by timeframe and search string.
Lists the status of all VSNAPs with details like total capacity, used capacity, free space, etc...
Inspired by Spectrum Protect "q system", a base information about the SPP system, i.e. CPU utilization, dedup ratio, storage utilization and catalog backup status:
A script to query the API endpoint and receive response in pretty format, raw or filtered, accepts filter and sort arguments in order to build the proper URIs.
Purpose of this script is to demonstrate the basic steps to interact with a REST API without sppclient.
For various aspects in the day-to-day business of using Spectrum Protect Plus the REST API could be helpful to simplify and automate repeating tasks and monitoring activities. The sppclient project is a convenient and easy way forward to implement script-based solutions for Spectrum Protect Plus, where everyone could participate and contribute.