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.
Pure1, a Fleet Management Platform that Fits All Needs
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:
- If you like Pure Storage appliances because they are simple to operate, you’ll love the usability of our Graphical User Interfaces (or GUIs), whether on-array or in Pure1 SaaS service.
- If you require purpose-built, occasional automation using a command line tool, our on-array Command Line Interfaces (or CLIs) provide that flexibility.
- For the ultimate automation experience, the FlashArray™, FlashBlade™, and Pure1 REST APIs are the answer, along with the SDKs (Python, PowerShell, Go, Ruby) and Infrastructure-as-Code libraries (Ansible, SaltStack, Puppet) built on top of them.
So Why Should You Use the Pure1 REST API?
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.
Third-party Monitoring Platform Integration
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:
- Use the Pure1 REST API to retrieve the required capacity and/or performance metrics from Pure1.
- Use the public API of the target monitoring platform to publish the relevant Pure1 metrics.
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:
Custom Report Generation
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.
A Few More Words about the Pure1 REST API
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:
Now It’s Your Turn
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!