Event

Events are changes occurring in Crunchy Bridge which are captured when certain actions are performed which are considered to be worth auditing. For example, when an account creates a cluster, an event is captured with a kind of cluster.created. In general, actions which cause mutable changes are captured as events whereas read-only actions are not.

Events apply to another type of API resource (like a cluster or network), and a representation of that API resource at the time an event occurred on it is captured in an event's data field. This means that to a certain degree, events on a resource can be walked back to see historical representations of a captured resource, although no API compatibility is guaranteed on captured data.

Events are retained for 90 days, after which they are deleted automatically.

Part of the API reference collection

This page is part of the Crunchy Bridge API reference, and primarily meant to act as an exhaustive guide for technical integrations which are already in progress. To understand the basics of using the API, see API concepts and getting started.

List events

List events for an account, cluster, or team.

With no query parameters, events for which the authenticated account is the "actor" are returned, meaning events which were captured due to actions taken by the account. When cluster_id is specified, events pertaining to any actions that occurred on that cluster are returned instead. When team_id is specified, events taken by any member of that team are returned instead. Only one of these filters can be specified.

This endpoint's pagination may be ordered through the order_field parameter by id only.

GET /events

Request

Query parameters

NameRequiredTypeDescription
cluster_idstring

The cluster ID for which to retrieve events.

cursorstring

Return only items starting after this cursor ID. When paginating, pass the value of next_cursor from the last page into this field to get the next one.

Cursor values depend on the field in order_field. Cursors will often be the primary IDs of object, but when ordering on another field like name, they'll be names (or another value) instead.

delayinteger

Duration to delay the event stream by. This option helps to hedge against the possibility that events may be read out of order as previously created events aren't yet visible in the event stream because the transaction that created them as not yet committed.

Recommended value is 10s (bringing the probability of missed events down to very close to zero), and an extremely conservative value would be 30s (making missed events due to ordering problems almost impossible).

kindarray

Kind to filter returned list of events on. For example, a value of cluster.created would return only cluster created events. This parameter maybe be specified multiple times to allow multiple event kinds.

limitinteger

The maximum number of items to return on the page. Defaults to 100 with a minimum of 1 and a maximum of 200.

orderstring

The order of pagination. asc for ascending or desc for descending. Defaults to asc.

Enum asc, or desc.

order_fieldstring

The name of the field on which to paginate like id or name. Supported fields are specific to each endpoint, and it's not possible to specify any arbitrary name. See the documentation for each specific list endpoint to see which fields it supports. Defaults to id for most resources.

team_idstring

The team ID for which to retrieve events.

cURL example

curl -X GET https://api.crunchybridge.com/events
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

Response for listing events.

Content type: application/json

NameNullableTypeDescription
eventsarray of array

List of events for this page.

has_moreboolean

Indicates whether or not there are more resources to page through in the collection.

next_cursorstring

A cursor value to pass to the endpoint to get the next page.

Example

{
    "events": [
        {
            "actor_email": null,
            "actor_id": "qvcw4hylovgyzbwzp53bmmlhga",
            "actor_ip": "73.70.33.3",
            "cluster_id": "rvf73a77ozfsvcttryebfrnlem",
            "created_at": "2021-07-11T01:02:03Z",
            "data": {
                "cidr4": "1.2.3.4/24",
                "id": "p56biajnfvgjhftvqs7lqymspe",
                "name": "crunchy-production-network",
                "provider_id": "aws",
                "region_id": "us-west-2",
                "team_id": "eaevtjiudzeq7bsqbbpiscund4"
            },
            "description": "[email protected] updated network `p56biajnfvgjhftvqs7lqymspe`.",
            "id": "klkvpx5enfdilaehwhvnmcfoiy",
            "kind": "network.created",
            "object_id": "p56biajnfvgjhftvqs7lqymspe",
            "object_kind": "network",
            "previous_properties": null,
            "request_id": "27a532f4-5bc8-4810-b602-88475a93167c",
            "team_id": "eaevtjiudzeq7bsqbbpiscund4"
        }
    ],
    "has_more": false,
    "next_cursor": null
}

Get event

Get a specific event.

GET /events/{event_id}

Request

Path parameters

  • event_id: The ID of the event to be retrieved.

cURL example

curl -X GET https://api.crunchybridge.com/events/{event_id}
    -H "Authorization: Bearer $CRUNCHY_API_KEY"

Response

Status: 200

An event represents an operation that occurred in the system. It contains a kind like cluster.created, a primary object associated with the event, and may also be associated with a cluster or team.

Content type: application/json

NameNullableTypeDescription
idstring in EID format

The primary ID of the event. IDs for events are generated in ascending order.

actor_emailstring

The email of the actor who initiated the event, if there was one.

actor_idstring in EID format

The ID of the actor who initiated the event, if there was one. Actor IDs are always the identifier of an account.

actor_ipstring

The IP from which the actor initiated the event, if there was an actor.

cluster_idstring in EID format

The ID of the cluster associated with the event, if there was one.

created_atstring of date/time formatted as RFC 3339

The time when the event occurred.

datastring

Data captured at the time of the event. When an event is captured for another API resource, that API resource is rendered and stored in the data field. Note that no API compatibility is guaranteed on this previously rendered version and it's therefore possible to have events whose data objects aren't fully compliant with the current version of that API resource.

descriptionstring

A human-readable description of the event. Note that this format is not guaranteed to be stable (it may change), so don't compare against it programmatically. Use other fields instead.

kindstring

The event's kind. Looks something like cluster.created. Kinds are mostly common of the form *.created, *.updated, or *.destroyed, but other types of operations are possible depending on the action. For example, cluster.suspended is generated when a cluster is suspended.

object_idstring in EID format

The ID of the primary object associated with the event. For example, for a cluster.created, this will be the cluster's ID.

object_kindstring

The kind of the primary object associated with the event. For example, for a cluster.created this will be cluster.

previous_propertiesstring

Contains the previous values of properties that may have changed during the operation which produced this event, taken by comparing a new API resource to how it rendered before the change. Usually only present on *.updated events.

request_idstring in UUID format

The ID of the request that instigated the action which caused this event to be captured, if there was one.

team_idstring in EID format

The team associated with the event, if there was one. For example, for a cluster.created event, this would be the ID of team which owns the cluster.

Example

{
    "actor_email": null,
    "actor_id": "qvcw4hylovgyzbwzp53bmmlhga",
    "actor_ip": "73.70.33.3",
    "cluster_id": "rvf73a77ozfsvcttryebfrnlem",
    "created_at": "2021-07-11T01:02:03Z",
    "data": {
        "cidr4": "1.2.3.4/24",
        "id": "p56biajnfvgjhftvqs7lqymspe",
        "name": "crunchy-production-network",
        "provider_id": "aws",
        "region_id": "us-west-2",
        "team_id": "eaevtjiudzeq7bsqbbpiscund4"
    },
    "description": "[email protected] updated network `p56biajnfvgjhftvqs7lqymspe`.",
    "id": "klkvpx5enfdilaehwhvnmcfoiy",
    "kind": "network.created",
    "object_id": "p56biajnfvgjhftvqs7lqymspe",
    "object_kind": "network",
    "previous_properties": null,
    "request_id": "27a532f4-5bc8-4810-b602-88475a93167c",
    "team_id": "eaevtjiudzeq7bsqbbpiscund4"
}