Events
Events are records that HPE GreenLake creates when a resource has changed (known as an occurrence). The records contain metadata (context attributes) and data (event data) about the change in the resource, and the events are sent by HPE GreenLake to the event destination (webhook URL) in the form of a message.
HPE GreenLake events follow the CloudEvents standard adopted by the Cloud Native Computing Foundation. This standard describes common formats for event data that provide interoperability across services, platforms, and systems. View the CloudEvents standard.
Events terminology
- Event —Events are factual records that HPE GreenLake creates when a resource has changed.
- Event data —Information about the occurrence or details about the data that was changed.
- Event types —Distinguishes between different events. Event types include created, updated, or deleted.
- Message —Events are sent to their destination in the form of a message.
- Occurrence —An occurrence is a factual capture of software system activity. For example, an occurrence might happen because of a state change in the software like a server is about to reboot.
- Context attributes —This is metadata included in an event that is used to identify the relationship of events to aspects of the system or to other events.
Event types and event data
Event data is domain-specific information about the occurrence. The information contained within data is encoded as specified in datacontenttype. HPE GreenLake supports three categories of event type.
- Resource created, updated, and deleted events
- Resource custom events
- Non-resource events
Resource create, update, and delete events
These event types represent state changes to individual resources. When a resource is created:
-
type—
com.hpe.greenlake.<api-group>.<version>.<resource-collection>.<event>
-
datacontenttype—
application/json
- time—The same as the createdAt and updatedAt property of the resource.
- data—A full representation of the updated resource.
When a resource is updated:
-
type—
com.hpe.greenlake.<api-group>.<version>.<resource-collection>.<event>
-
datacontenttype—
application/json
- time—The same as the updatedAt property of the resource.
- data—A full representation of the updated resource.
When a resource is deleted:
-
type—
com.hpe.greenlake.<api-group>.<version>.<resource-collection>.<event>
-
datacontenttype—
application/json
- time—The time the resource was deleted
- data—A partial representation of the deleted resource including the type and id properties.
Resource custom events
Resource custom events represent a transition related to an individual resource that is not a state change. For example, the completion of a system start.
The resource custom event has:
-
type—
hpe.greenlake.<api-group>.<version>.<resource-group>.<event>
-
datacontenttype—
application/json
- time—The time the custom event occurred.
- data—Custom data.
Non-resource event
These events represent a transition within the system not related to an individual resource. The non-resource event has:
-
type—
hpe.greenlake.<api-group>.<version>.<event>
-
datacontenttype—
application/json
- time—The time the custom event occurred.
- data—Custom data.
Event context attributes
Event context attributes are metadata that describe the event occurrence. HPE GreenLake events include the mandatory context attribute properties defined in the CloudEvents standard, and may include several of the optional properties.
Mandatory properties of an event
Property | Value type | Description |
---|---|---|
specversion | String | The version of the CloudEvent specification. |
id | String | The id property is the identifier of the event. In most cases, the id is in UUID format. |
source | URI-reference | Provides the context of the event. It must be The URI that identifies the source and context which the event occurred and it is prefixed with //.api.greenlake.hpe.com/ and identifies the region and API group that produced the event. |
type | String | The type property identifies the type of the event related to the source. For example: greenlake.hpe.data.v1.volumes.snapshots.updated (type: volumes.snapshot, event: updated) or greenlake.hpe.compute.v1.servers.rebooted (type:servers, event: rebooted) . |
Optional properties
The optional properties that an event might include.
Property | Value type | Description |
---|---|---|
datacontenttype |
String | The encoding of the data in the data property as an RFC2046 type. |
time |
Timestamp | Timestamp of when the event occurred in RFC3339 format. |
data |
Object | Event payload. The content is marshaled according to the media type in datacontenttype . |