V2 Web API

V2 Web API

Capabilities

The Capabilities API allows you to directly discover which functions from the V2 API functionality, including the selectable aggregate functions, are supported by the currently configured storage driver. A capabilities query returns a flattened dictionary of properties with associated boolean values - a ‘False’ or absent value means that the corresponding feature is not available in the backend.

type Capabilities

A representation of the API and storage capabilities.

Usually constrained by restrictions imposed by the storage driver.

Data samples:

Json
{
    "api": {
        "events:query:simple": true
    },
    "event_storage": {
        "storage:production_ready": true
    }
}
XML
b'<value>\n  <api>\n    <item>\n      <key>events:query:simple</key>\n      <value>true</value>\n    </item>\n  </api>\n  <event_storage>\n    <item>\n      <key>storage:production_ready</key>\n      <value>true</value>\n    </item>\n  </event_storage>\n</value>'
api
Type

dict(str: bool)

A flattened dictionary of API capabilities

event_storage
Type

dict(str: bool)

A flattened dictionary of event storage capabilities

Events and Traits

type Event

A System event.

Data samples:

Json
{
    "event_type": "compute.instance.update",
    "generated": "2015-01-01T12:00:00",
    "message_id": "94834db1-8f1b-404d-b2ec-c35901f1b7f0",
    "raw": {
        "status": {
            "nested": "started"
        }
    },
    "traits": [
        {
            "name": "service",
            "value": "conductor.tem-devstack-01"
        },
        {
            "name": "request_id",
            "value": "req-4e2d67b8-31a4-48af-bb2f-9df72a353a72"
        },
        {
            "name": "tenant_id",
            "value": "7f13f2b17917463b9ee21aa92c4b36d6"
        }
    ]
}
XML
b"<value>\n  <message_id>94834db1-8f1b-404d-b2ec-c35901f1b7f0</message_id>\n  <event_type>compute.instance.update</event_type>\n  <traits />\n  <generated>2015-01-01T12:00:00</generated>\n  <raw>{'status': {'nested': 'started'}}</raw>\n</value>"
event_type
Type

str

The type of the event

generated
Type

datetime

The time the event occurred

message_id
Type

str

The message ID for the notification

raw
Type

json

The raw copy of notification

traits
Type

list(Trait)

Event specific properties

type Trait

A Trait associated with an event.

Data samples:

Json
{
    "name": "service",
    "type": "string",
    "value": "compute.hostname"
}
XML
b'<value>\n  <name>service</name>\n  <value>compute.hostname</value>\n  <type>string</type>\n</value>'
name
Type

str

The name of the trait

type
Type

str

the type of the trait (string, integer, float or datetime)

value
Type

str

the value of the trait

type TraitDescription

A description of a trait, with no associated value.

Data samples:

Json
{
    "name": "service",
    "type": "string"
}
XML
b'<value>\n  <type>string</type>\n  <name>service</name>\n</value>'
name
Type

str

the name of the trait

type
Type

str

the data type, defaults to string

Filtering Queries

See api-queries for how to query the API.

type EventQuery

Query arguments for Event Queries.

Data samples:

Json
{
    "field": "event_type",
    "op": "eq",
    "type": "string",
    "value": "compute.instance.create.start"
}
XML
b'<value>\n  <type>string</type>\n  <field>event_type</field>\n  <op>eq</op>\n  <value>compute.instance.create.start</value>\n</value>'
field
Type

str

Name of the field to filter on. Can be either a trait name or field of an event. 1) Use start_timestamp/end_timestamp to filter on generated field. 2) Specify the ‘all_tenants=True’ query parameter to get all events for all projects, this is only allowed by admin users.

type
Type

str

the type of the trait filter, defaults to string

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.