A few months ago, I wrote a conceptual blog post series about the Pure1® REST API. I shared scenarios where using the Pure1 REST API makes the most sense, but I stopped short of digging deeper with use cases.
Good news, folks. Following up to my Pure1 REST API talk at Accelerate 2019, today I’ll share how to improve your knowledge and build practical experience with the Pure1 REST API.
Flexibility is top of mind for us. As our enterprise customer base grows and the usage diversity of our storage solutions expands both in nature and locations (on-premises multi-zone data centers and cloud platforms) we can’t provide simplicity alone. There needs to be some level of “flexibility” to accomplish tasks that are specific for your needs.
And flexible we are:
While you most likely use the FlashArray and FlashBlade REST APIs for provisioning (and un-provisioning), the Pure1 REST API is most effective when you need a programmatic view of your array fleet. Specifically, the two most popular use cases our customers want to be addressed with the Pure1 REST API are third-party monitoring platform integration and custom reports generation.
Let’s take a closer look at each of them.
Collecting metrics data in one single, unified monitoring platform helps organizations better oversee disparate but interconnected systems and more easily correlate issues that may occur at the storage, networking, compute, or application layers. Indeed, many of our enterprise customers have told us that they aggregate infrastructure and application metrics in cloud monitoring platforms such as VMware Wavefront, Splunk, Datadog, or AppDynamics.
The integration of these monitoring systems with Pure’s storage solutions can be achieved in a straightforward pull-push model by using the Pure1 REST API:
In this integration example, the Python script retrieves the list of your organization arrays that phone home to our Pure1 cloud, as well as the list of available array metrics. It then retrieves a range of values for each of these metrics either from a set point in time to current time and continuously sends them to Wavefront. It’s that simple… uh sorry, flexible!
A video is worth a thousand images so let’s see an integration in action:
Let’s switch to the second most common use case for which our customers fully experience the value of the Pure1 REST API: custom report generation.
While Pure1 already provides a set of pre-formatted capacity, performance, and audit log reports, you can generate fine-grain statistical reports using the Metrics History endpoint of the Pure1 API. For example, this report Python script sample retrieves average capacity metrics for volumes, snapshots, and total used capacity over the last thirty days. Additionally, it provides a month-to-month comparison of the average usage rate:
Want to see it in action? The video demo shows how to use the script:
The script can easily be updated to allow for a custom report reference period or report on max metrics (instead of average metrics). For instance, if you are interested in max capacity metrics over the last seven days, including a week-to-week comparison of max usage rates, you can simply update two parameters and generate the following report:
Note that the generated report name allows you to quickly identify the report reference period and data point value used, average or maximum.
If you’re just getting started, the Pure1 Postman collection is a great way to explore the Pure1 REST API and become familiar with its various endpoints. I continuously improve the Pure1 Postman collection, and one of the recent enhancements is in-tool authentication token generation. You’ll no longer need to use a separate Python script to generate or renew your OAuth2 API token, and you can now do so with the Postman “Get an OAuth token” method:
For good measure, the video below shows how to register an application in Pure1 Manage:
Once your API application is registered, check out the Postman setup instructions, as well as the video below to see the Postman collection in action:
I hope that these REST API uses cases and associated scripts encourage you to explore and unleash the integration power of the Pure1 REST API.
If you have questions, leave a comment below or reach out to me on the Pure/Code() Slack Community. You will find a dedicated Pure1 channel, so the opportunity to leverage the knowledge and help of the entire Pure developer community, including some dedicated staff from the Pure Storage crew, is at your fingertips!