Skip to content

HPE GreenLake API for Audit Logs (v1)

The HPE GreenLake Audit Log Service offers a collection of RESTful APIs for publishing audit logs and querying both application-specific and overall platform logs.

Download OpenAPI description
Overview
License

HPE License

Languages
Servers
Mock server

https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/audit-logs/public/openapi/audit-logs-latest/

https://global.api.greenlake.hpe.com/

Audit logs - v1

Operations

Get all audit logs of an application or user.

Request

The audit logs can be filtered using a variety of parameters. Queries should be separated by and and can utilize eq, contains, and in operators to construct the final query. Each query should follow the format:

  • key eq 'value' for equality operation.
  • contains(key, 'value') for contains operation.
  • key in ('value1', 'value2') for in operation.
Filter parameterSupported OperatorsTypeExample
createdAtlt, geRFC timestamp in stringcreatedAt ge '2024-02-16T07:54:55.0Z'
categoryeq, instringcategory eq 'User Management' category in ('Device Management', 'User Activity')
descriptioneq, containsstringcontains(description, 'Logged in') description eq 'User test@test.com logged in via ping mode.'
additionalInfo/ipAddresseq, containsIP stringadditionalInfo/ipAddress eq '192.168.12.12' contains(additionalInfo/ipAddress, '192.168')
user/usernameeq, containsemail in stringuser/username eq 'test@test.com' contains(user/username, '@gmail.com')
workspace/workspaceNameeq, containsstringworkspace/workspaceName eq 'Example workspace' contains(workspace/workspaceName, 'Example')
application/ideqUUID in stringapplication/id eq '12312-123123-123123-123121'
regioneqregion code in stringregion eq 'us-west'
hasDetailseqbooleanhasDetails eq 'true'
Security
BearerAuth
Query
filterstring
Examples:

Get audit logs with category User Management and User Activity and description logged out

filter=category eq 'User Management' and contains(description, 'logged out')
selectstring

Use the select query parameter to restrict the number of properties included in the audit log response. The supported select parameters:

  • additionalInfo
  • createdAt
  • category
  • hasDetails
  • workspace/workspaceName
  • description
  • user/username
Examples:

Get audit logs with selected attributes

select=createdAt, user/username, category
allstring

Provide a free-text search to perform a comprehensive search across all properties for audit logs.

Examples:

Get audit logs that contain the provided text

all=logged in user
limitinteger<= 2000

How many items to return at one time (max 2000)

Default 50
offsetinteger

Specifies the zero-based resource offset to start the response from.

Default 0
curl -i -X GET \
  https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/audit-logs/public/openapi/audit-logs-latest/audit-log/v1/logs \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

All audit logs.

Bodyapplication/json
itemsArray of objects(AuditLog)required
items[].​idstringrequired

Unique audit log ID

items[].​typestringrequired

Resource type

Default "/audit-log/logs"
items[].​applicationobject
items[].​regionstring

The region code associated with the application.

items[].​userobject
items[].​categorystring

The category of the audit log.

items[].​descriptionstring

A short description of the changes such as subscription assignment, firmware upgrade, and configuration updates.

items[].​workspaceobject
items[].​createdAtstring(date-time)

The time the audit log was created.

items[].​updatedAtstring(date-time)

The time the audit log was updated.

items[].​generationinteger

if any update happened then field count will get increased.

items[].​additionalInfoobject

Returns additional attributes.

items[].​hasDetailsboolean

If set to true, additional details are available for the audit log.

countintegerrequired

Number of returned items

totalintegerrequired

Total number of items in the collection.

offsetinteger

Specifies the offset of the returned page. Only when offset based pagination is used.

remainingRecordsboolean

This boolean flag shows whether there are more records available

Response
application/json
{ "items": [ {} ], "count": 0, "offset": 0, "total": 0, "remainingRecords": true }

Get additional detail of an audit log.

Request

Security
BearerAuth
Path
idstringrequired

Provide the ID of the audit log record that has the hasDetails value set to true to fetch the additional details.

curl -i -X GET \
  'https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/audit-logs/public/openapi/audit-logs-latest/audit-log/v1/logs/{id}/detail' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Audit log details.

Bodyapplication/json
idstring(uuid)required

audit log id

typestringrequired

resource type

Default "/audit-log/logs"
headerstringrequired
bodyArray of stringsrequired
Response
application/json
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "type": "/audit-log/logs", "header": "string", "body": [ "string" ] }