Skip to content

Event fields resources

Use the event fields resources of the dictionary service to override the default dictionary entries with your own definitions, create new entries for event fields that are not included in the default dictionary, and manage custom entries.

Resource list

Authentication

All Zenoss API endpoints require HTTPS, expect JSON in the request body when a body is required, and return a JSON response. You must have an authentication key to send requests to a Zenoss API endpoint. The key is sent in the zenoss-api-key header of each request.

All of the following API examples use curl to send a JSON request from a Bash shell to an endpoint. All examples use YOUR-API-ENDPOINT and YOUR-API-KEY as placeholders for endpoints and authentication keys.

POST /v1/dictionary/event_fields

Create a custom event field entry.

If the default dictionary includes an entry for the event field name specified in a create request, the custom entry becomes the effective entry. Subsequently, if the custom entry is deleted, the default entry becomes the effective entry.

Request template

An abstract preview of a JSON request to create one custom event field entry.

{
  "name": "<name>",
  "label": "<label>",
  "description": "<description>",
  "tags": [ "<tag>" ]
}

Request fields

name (string, required)
The event field name.
label (string, optional)
A short name for an event field.
description (string, optional)
A longer, free-form statement about an event field.
tags (array, optional)
A list of arbitrary terms to associate with an event field. The tags namespace is
shared among all dictionary types. By convention, this field is used to record the source of an entry.

Status Codes

  • 200 (custom entry was created)
  • 400 (no name provided)
  • 409 (a custom entry by the same name already exists)

Example

curl https://<YOUR-API-ENDPOINT>/v1/dictionary/event_fields \
  -H "zenoss-api-key: <YOUR_API_KEY>" \
  -X POST -s \
  -d '{
  "name": "psblusmk",
  "label": "Power Supply Blue Smoke",
  "description": "The power supply has released its last gasp of blue smoke.",
  "tags": [
    "hardware",
    "failure"
  ]
}'
{
  "name": "psblusmk",
  "label": "Power Supply Blue Smoke",
  "description": "The power supply has released its last gasp of blue smoke.",
  "tags": [
    "hardware",
    "failure"
  ],
  "layer": "TENANT",
  "default": null
}

GET /v1/dictionary/event_fields/{name}

Get one event field entry.

Response fields

layer
DEFAULT for Zenoss-defined entries or TENANT for entries defined by a user in your organization.
default
null for Zenoss-defined entries or an object containing the default value of a Zenoss-defined entry that has been overridden by a user in your organization.

Status Codes

  • 200 (entry exists for requested name)
  • 404 (no entry exists for requested name)

Examples

Default entry

curl https://<YOUR-API-ENDPOINT>/v1/dictionary/event_fields/CZ_EVENT_DETAIL-zenoss.device.groups \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X GET -s
{
  "name": "CZ_EVENT_DETAIL-zenoss.device.groups",
  "label": "Device Groups",
  "description": "Device groups of the event's device.",
  "tags": [
    "cz"
  ],
  "layer": "DEFAULT",
  "default": null
}

Overridden entry

curl https://<YOUR-API-ENDPOINT>/v1/dictionary/event_fields/CZ_EVENT_DETAIL-zenoss.device.groups \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X GET -s
{
  "name": "CZ_EVENT_DETAIL-zenoss.device.groups",
  "label": "CZ Device Groups",
  "description": "Device groups of the event's device.",
  "tags": [
    "cz"
  ],
  "layer": "TENANT",
  "default": {
    "name": "CZ_EVENT_DETAIL-zenoss.device.groups",
    "label": "Device Groups",
    "description": "Device groups of the event's device.",
    "tags": [
      "cz"
    ],
    "layer": "DEFAULT",
    "default": null
  }
}

Custom entry

curl https://<YOUR-API-ENDPOINT>/v1/dictionary/event_fields/psblusmk \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X GET -s
{
  "name": "psblusmk",
  "label": "Power Supply Blue Smoke",
  "description": "The power supply has released its last gasp of blue smoke.",
  "tags": [
    "hardware",
    "failure"
  ],
  "layer": "TENANT",
  "default": null
}

GET /v1/dictionary/event_fields

Get all event field entries. This includes all default entries, all overridden entries, and all custom entries.

Response fields

layer
DEFAULT for Zenoss-defined entries or TENANT for entries defined by a user in your organization.
default
null for Zenoss-defined entries or an object containing the default value of a Zenoss-defined entry that has been overridden by a user in your organization.

Status Codes

  • 200 (entries exist)

Example

curl https://<YOUR-API-ENDPOINT>/v1/dictionary/event_fields \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X GET -s
{
  "eventFields": [
    {
      "name": "CZ_EVENT_DETAIL-capacity.breach",
      "label": "Capacity Breach Type",
      "description": "The type of capacity breach being reported by the event.\n\nPossible values include current or projected. Current indicates that the defined capacity threshold is currently breached, and projected indicates that it is projected to be breached. When the type is projected you can use the Capacity Breach Timestamp, Capacity Breach At, or Capacity Breach In fields to know when breach is projected to occur.",
      "tags": [
        "cz",
        "capacity"
      ],
      "layer": "DEFAULT",
      "default": null
    },
    {
      "name": "CZ_EVENT_DETAIL-capacity.breach_at",
      "label": "Capacity Breach At",
      "description": "Formatted timestamp for when the capacity threshold is projected to be breached.",
      "tags": [
        "cz",
        "capacity"
      ],
      "layer": "DEFAULT",
      "default": null
    },
    .
    .
    .
  ],
  "nextPageToken": "",
  "totalCount": "68"
}

PATCH /v1/dictionary/event_fields/{name}

Update an existing custom event field entry.

To override a default entry, create a new custom entry.

Request fields

Update requests use the same fields as create requests. The name field is required but cannot be changed.

Status Codes

  • 200 (custom entry was updated)
  • 404 (no custom entry exists with the requested name)

Example

curl https://<YOUR-API-ENDPOINT>/v1/dictionary/event_fields/psblusmk \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X PATCH -s -d '{
  "name": "psblusmk",
  "description": "The power supply has released its last gasp of blue smoke. RIP good buddy."
}'
{
  "name": "psblusmk",
  "label": "Power Supply Blue Smoke",
  "description": "The power supply has released its last gasp of blue smoke. RIP good buddy.",
  "tags": [
    "hardware",
    "failure"
  ],
  "layer": "TENANT",
  "default": null
}

DELETE /v1/dictionary/event_fields/{name}

Delete a custom event field entry.

If a default entry exists for the specified name, the default entry becomes the effective entry.

Status Codes

  • 200 (custom entry was deleted)
  • 404 (no custom entry exists with the requested name)

Example

curl https://<YOUR-API-ENDPOINT>/v1/dictionary/event_fields/psblusmk \
  -H "zenoss-api-key: <YOUR-API-KEY>" \
  -X DELETE -s
{}