Monitoring Events Service API

Events

Accept events send from e.g. monasca-events-agent. Events are JSON objects collected from the OpenStack message bus. Events, also called notifications, are emitted by the OpenStack Cloud core components. Monasca-events-api accepts versioned notifications according to the OpenStack documentation.

POST
/v1.0/events

Send Events

Accepts multiple events (i.e. bulk mode). Each event can be enriched with a set of dimensions with information about the notification service source (Nova, Glance, etc.), or the message bus source (topic name). A single event in bulk mode must also contain the project_id field which is required. Each event can be enriched with a set of dimensions. Dimensions can contain additional information, for example, about the topic from which the event was read or the hostname from which it was generated.

Success

Code

Reason

204 - No Content

Normal response code, the request was successfully processed.

Error

Code

Reason

400 - Bad Request

Bad request.

401 - Unauthorized

Unauthorized. User must authenticate before making a request.

411 - Length Required

Content-Length header was not found in request.

413 - Request Entity Too Large

Sent body is too large to be processed.

422 - Unprocessable Entity

Event property must have project_id field.

422 - Unprocessable Entity

Event property must have event payload object.

422 - Unprocessable Entity

Failed to create an envelope.

503 - Service Unavailable

The server is currently unable to handle the request due to a temporary overload or scheduled maintenance. This will likely be alleviated after some delay.

Request

Name

In

Type

Description

events

body

array

Array containing the events.

Example 1: Request with a single event

{
  "timestamp": "2012-10-29T13:42:11Z+0200",
  "events": [
    {
      "dimensions": {
        "service": "compute",
        "topic": "notification.sample",
        "hostname": "nova-compute:compute"
      },
      "project_id": "6f70656e737461636b20342065766572",
      "event": {
        "event_type": "instance.reboot.end",
        "payload": {
          "nova_object.data": {
            "architecture": "x86_64",
            "availability_zone": "nova",
            "created_at": "2012-10-29T13:42:11Z",
            "deleted_at": null,
            "display_name": "some-server",
            "display_description": "some-server",
            "fault": null,
            "host": "compute",
            "host_name": "some-server",
            "ip_addresses": [
              {
                "nova_object.name": "IpPayload",
                "nova_object.namespace": "nova",
                "nova_object.version": "1.0",
                "nova_object.data": {
                  "mac": "fa:16:3e:4c:2c:30",
                  "address": "192.168.1.3",
                  "port_uuid": "ce531f90-199f-48c0-816c-13e38010b442",
                  "meta": {},
                  "version": 4,
                  "label": "private-network",
                  "device_name": "tapce531f90-19"
                }
              }
            ],
            "key_name": "my-key",
            "auto_disk_config": "MANUAL",
            "kernel_id": "",
            "launched_at": "2012-10-29T13:42:11Z",
            "image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
            "metadata": {},
            "locked": false,
            "node": "fake-mini",
            "os_type": null,
            "progress": 0,
            "ramdisk_id": "",
            "reservation_id": "r-npxv0e40",
            "state": "active",
            "task_state": null,
            "power_state": "running",
            "tenant_id": "6f70656e737461636b20342065766572",
            "terminated_at": null,
            "flavor": {
              "nova_object.name": "FlavorPayload",
              "nova_object.data": {
                "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3",
                "name": "test_flavor",
                "projects": null,
                "root_gb": 1,
                "vcpus": 1,
                "ephemeral_gb": 0,
                "memory_mb": 512,
                "disabled": false,
                "rxtx_factor": 1.0,
                "extra_specs": {
                  "hw:watchdog_action": "disabled"
                },
                "swap": 0,
                "is_public": true,
                "vcpu_weight": 0
              },
              "nova_object.version": "1.3",
              "nova_object.namespace": "nova"
            },
            "user_id": "fake",
            "uuid": "178b0921-8f85-4257-88b6-2e743b5a975c"
          },
          "nova_object.name": "InstanceActionPayload",
          "nova_object.namespace": "nova",
          "nova_object.version": "1.3"
        },
        "priority": "INFO",
        "publisher_id": "nova-compute:compute"
      }
    }
  ]
}

Example 2:Request with multiple events

{
  "timestamp": "2012-10-29T13:42:11Z+0200",
  "events": [
    {
      "dimensions": {
        "service": "compute",
        "topic": "notification.sample",
        "hostname": "nova-compute:compute"
      },
      "project_id": "6f70656e737461636b20342065766572",
      "event": {
        "event_type": "instance.reboot.end",
        "payload": {
          "nova_object.data": {
            "architecture": "x86_64",
            "availability_zone": "nova",
            "created_at": "2012-10-29T13:42:11Z",
            "deleted_at": null,
            "display_name": "some-server",
            "display_description": "some-server",
            "fault": null,
            "host": "compute",
            "host_name": "some-server",
            "ip_addresses": [
              {
                "nova_object.name": "IpPayload",
                "nova_object.namespace": "nova",
                "nova_object.version": "1.0",
                "nova_object.data": {
                  "mac": "fa:16:3e:4c:2c:30",
                  "address": "192.168.1.3",
                  "port_uuid": "ce531f90-199f-48c0-816c-13e38010b442",
                  "meta": {},
                  "version": 4,
                  "label": "private-network",
                  "device_name": "tapce531f90-19"
                }
              }
            ],
            "key_name": "my-key",
            "auto_disk_config": "MANUAL",
            "kernel_id": "",
            "launched_at": "2012-10-29T13:42:11Z",
            "image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
            "metadata": {},
            "locked": false,
            "node": "fake-mini",
            "os_type": null,
            "progress": 0,
            "ramdisk_id": "",
            "reservation_id": "r-npxv0e40",
            "state": "active",
            "task_state": null,
            "power_state": "running",
            "tenant_id": "6f70656e737461636b20342065766572",
            "terminated_at": null,
            "flavor": {
              "nova_object.name": "FlavorPayload",
              "nova_object.data": {
                "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3",
                "name": "test_flavor",
                "projects": null,
                "root_gb": 1,
                "vcpus": 1,
                "ephemeral_gb": 0,
                "memory_mb": 512,
                "disabled": false,
                "rxtx_factor": 1.0,
                "extra_specs": {
                  "hw:watchdog_action": "disabled"
                },
                "swap": 0,
                "is_public": true,
                "vcpu_weight": 0
              },
              "nova_object.version": "1.3",
              "nova_object.namespace": "nova"
            },
            "user_id": "fake",
            "uuid": "178b0921-8f85-4257-88b6-2e743b5a975c"
          },
          "nova_object.name": "InstanceActionPayload",
          "nova_object.namespace": "nova",
          "nova_object.version": "1.3"
        },
        "priority": "INFO",
        "publisher_id": "nova-compute:compute"
      }
    },
    {
      "dimensions": {
        "service": "compute",
        "topic": "notification.error",
        "hostname": "nova-compute:compute"
      },
      "project_id": "6f70656e737461636b20342065766572",
      "event": {
        "priority": "ERROR",
        "payload": {
          "nova_object.name": "InstanceActionPayload",
          "nova_object.data": {
            "state": "active",
            "availability_zone": "nova",
            "key_name": "my-key",
            "kernel_id": "",
            "host_name": "some-server",
            "progress": 0,
            "task_state": "rebuilding",
            "deleted_at": null,
            "architecture": null,
            "auto_disk_config": "MANUAL",
            "ramdisk_id": "",
            "locked": false,
            "created_at": "2012-10-29T13:42:11Z",
            "host": "compute",
            "display_name": "some-server",
            "os_type": null,
            "metadata": {},
            "ip_addresses": [
              {
                "nova_object.name": "IpPayload",
                "nova_object.data": {
                  "device_name": "tapce531f90-19",
                  "port_uuid": "ce531f90-199f-48c0-816c-13e38010b442",
                  "address": "192.168.1.3",
                  "version": 4,
                  "meta": {},
                  "label": "private-network",
                  "mac": "fa:16:3e:4c:2c:30"
                },
                "nova_object.version": "1.0",
                "nova_object.namespace": "nova"
              }
            ],
            "power_state": "running",
            "display_description": "some-server",
            "uuid": "5fafd989-4043-44b4-8acc-907e847f4b70",
            "flavor": {
              "nova_object.name": "FlavorPayload",
              "nova_object.data": {
                "disabled": false,
                "ephemeral_gb": 0,
                "extra_specs": {
                  "hw:watchdog_action": "disabled"
                },
                "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3",
                "is_public": true,
                "memory_mb": 512,
                "name": "test_flavor",
                "projects": null,
                "root_gb": 1,
                "rxtx_factor": 1.0,
                "swap": 0,
                "vcpu_weight": 0,
                "vcpus": 1
              },
              "nova_object.version": "1.3",
              "nova_object.namespace": "nova"
            },
            "reservation_id": "r-pfiic52h",
            "terminated_at": null,
            "tenant_id": "6f70656e737461636b20342065766572",
            "node": "fake-mini",
            "launched_at": "2012-10-29T13:42:11Z",
            "user_id": "fake",
            "image_uuid": "a2459075-d96c-40d5-893e-577ff92e721c",
            "fault": {
              "nova_object.name": "ExceptionPayload",
              "nova_object.data": {
                "module_name": "nova.tests.functional.notification_sample_tests.test_instance",
                "exception_message": "Insufficient compute resources: fake-resource.",
                "function_name": "_compute_resources_unavailable",
                "exception": "ComputeResourcesUnavailable"
              },
              "nova_object.version": "1.0",
              "nova_object.namespace": "nova"
            }
          },
          "nova_object.version": "1.3",
          "nova_object.namespace": "nova"
        },
        "publisher_id": "nova-compute:compute",
        "event_type": "instance.rebuild.error"
      }
    }
  ]
}

Response

No body content is returned on successful POST.