Search
Denis Choukroun

Get started with the foundational APIs for the HPE GreenLake edge-to-cloud platform – Part 3: Tracking activities and monitoring health

February 2, 2024

This is part three of a blog series that showcases the capabilities of the APIs for common HPE GreenLake platform services using a real customer scenario, displaying it from the perspective of a user of the platform, such as an IT administrator.

Continuing on from the second part of this series, where I had put on my IT administrator’s hat for a Standard Enterprise workspace, I will now explore the set of REST API calls used for tracking activities in the workspace and monitoring the overall health of HPE services and HPE products in the workspace.

Tracking activities in the workspace

Audit log service records the occurrence of events emitted by users, any device or service in the workspace. These logs can be used for tracking user activities, doing root cause analysis of an incident, investigating breaches, and for auditing purposes.

Let’s assume that I have been notified of unusual activities in the workspace and I would like to act to begin an investigation and identify the root cause of the incident in the workspace. This involves an analysis of logs for the services and the platform in the workspace, and tracking activities for users. To conduct this analysis, I will use the set of audit log API calls from the Postman collection folder: Tracking GLP Workspace/Step5-audit-log/audit-log/v1beta1/logs.

Collecting service-specific logs and platform logs

The GET REST API request Get all audit logs of an application derived from the API call GET all audit logs of an application or user is used to get logs from a specific service in the workspace and platform logs in the workspace. I just need to specify the service identifier or the HPE GreenLake platform identifier to obtain the list of logs for a particular service or for the platform. In the example below, I specify the identifier of the HPE GreenLake platform and limit the output for activities that occurred after a certain date and time in UTC following the ISO 8601 standard:

GET {{baseUrl}}/audit-log/v1beta1/logs?filter=application/id eq '{{GLP_Application_Id}}'&filter=createdAt ge '2023-12-10T11:00:00.00000Z'&limit=50&offset=0

Figure 1: Audit logs for the HPE GreenLake platform in the workspace

Figure 1: Audit logs for the HPE GreenLake platform in the workspace

Tracking user-specific activities

The GET REST API call Get all audit logs of a user derived from the REST API call Get all audit logs of an application or user is used to track activities for a specific user in the workspace based on the criteria specified in the filter query parameters. In this example I limit the output for a particular user’s activities that occurred after a certain date and time in UTC following the ISO 8601 standard:

GET {{baseUrl}}/audit-log/v1beta1/logs?filter=user/username eq '<UserEmail@example.com>'&filter=createdAt ge '2023-12-14T11:00:00.00000Z'&limit=300

Note: You can specify additional query parameters to limit the scope of the output to a specific category of activities. For example, User Management, Device Management, or Customer Management.

Figure 2: Tracking activities for a specific user

Figure 2: Tracking activities for a specific user

Monitoring health events for the workspace

The HPE GreenLake platform provides a wellness service to enable you to monitor the overall health of the managed services and devices in the workspace. The wellness service API provides programmatic access to view health events and insights about HPE services and HPE products in the workspace.

I will use the set of Wellness API calls from the Postman collection folder: Tracking GLP Workspace/Step6-Wellness.

The GET REST API call Get a list of wellness events is used to retrieve a list of health events for services (for example, Networking, Storage, Compute or HPE GreenLake platform services) and HPE device models in the workspace. In the example below, I use a set of query parameters to view health information for a specific device model, service and severity:

GET {{baseUrl}}/wellness/v2beta2/events?filter=serviceName in ('Storage')&filter=productName eq 'HPE Alletra 6000'&filter=condition/severity eq 'warning'&limit=100

Figure 3: Retrieve list of health events for a specific service, device model and severity

Figure 3:Retrieve list of health events for a specific service, device model and severity

To view information about a specific event ID, I can use the REST API request Get wellness event with specific ID by specifying the event ID as a Path variable in the parameters of the API call:

GET {{baseUrl}}/wellness/v2beta2/events/:id

Figure 4: View information for a specific event ID

Figure 4: View information for a specific event ID

Summary

This blog series walks you through the APIs for common HPE GreenLake platform services for a single-tenant workspace environment from the perspective of an IT administrator. I took advantage of the Postman collection available on the HPE Developer Community tooling GitHub repository to help you get started with these APIs, learn the REST API call syntax for the API requests through the use of examples, how to programmatically configure and manage workspace resources such as users and infrastructure devices, and how to track activities and monitor health events for the workspace.

To learn more about all the REST API calls for the platform, I invite you to refer to the HPE GreenLake platform documentation for these APIs. The documentation leverages OpenAPI specifications and associated reference documentation for these API services. It provides a complete explanation of the operations supported by these APIs for common HPE GreenLake platform services, as well as sample requests and responses.

If you’re interested in trying out what I just discussed, you might want to check out one of our hands-on Workshops-on-Demand that lets you play with the HPE GreenLake APIs mentioned in this blog series. The workshops are free, available 24/7, and very easy to use. They give you a real-world experience without any risk. Check out our catalog of workshops, register for the one you’re interested in and go! It’s as simple as that.

If you still have any questions regarding the HPE GreenLake platform APIs, join the HPE Developer Community Slack Workspace and start a discussion in our #hpe-greenlake-api channel. We’re always here to help.

Related

Akash Patel, Guoping Jia, Sonu Sudhakaran

A guide to enabling a managed Istio service mesh in a Kubernetes cluster on HPE GreenLake for Private Cloud Enterprise

Feb 16, 2023
Ron Dharma

Using HPE GreenLake Console's API Gateway for Data Services Cloud Console

Nov 30, 2021
Paul Zinn

Automate ITOps: announcing foundational APIs for the HPE GreenLake edge-to-cloud platform

Dec 1, 2023
Chaitra Mylarappachar

Bare metal provisioning on HPE GreenLake using Terraform

Mar 20, 2023
Didier Lalli

Bulk onboarding of users in HPE GreenLake edge-to-cloud platform

Apr 24, 2024
Michael Rose Jr.

Configuring Azure AD as the SAML IDP with HPE Greenlake Cloud Platform and Aruba Central

Jul 11, 2022
Prabhu Murthy - Cloud Operations

How to implement a single sign-on solution to authenticate users onto the HPE GreenLake edge-to-cloud platform

Nov 29, 2023
Guoping Jia

Create a General-Purpose Kubeconfig File in HPE GreenLake for Private Cloud Enterprise

May 20, 2022

HPE Developer Newsletter

Stay in the loop.

Sign up for the HPE Developer Newsletter or visit the Newsletter Archive to see past content.

By clicking on “Subscribe Now”, I agree to HPE sending me personalized email communication about HPE and select HPE-Partner products, services, offers and events. I understand that my email address will be used in accordance with HPE Privacy Statement. You may unsubscribe from receiving HPE and HPE-Partner news and offers at any time by clicking on the Unsubscribe button at the bottom of the newsletter.

For more information on how HPE manages, uses, and protects your personal data please refer to HPE Privacy Statement.