HashiCorp Consul Events API

Fire and list custom user events

OpenAPI Specification

consul-events-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: HashiCorp Consul HTTP ACL Events API
  description: The Consul HTTP API provides full access to Consul functionality including service discovery, health checking, key/value storage, ACL management, Connect service mesh, configuration entries, and multi-datacenter operations.
  version: 1.18.0
  contact:
    name: HashiCorp
    url: https://www.consul.io/
  license:
    name: Business Source License 1.1
    url: https://github.com/hashicorp/consul/blob/main/LICENSE
servers:
- url: http://localhost:8500/v1
  description: Local Consul agent
- url: https://{consul_host}:{port}/v1
  description: Custom Consul server
  variables:
    consul_host:
      default: localhost
    port:
      default: '8500'
security:
- ConsulToken: []
tags:
- name: Events
  description: Fire and list custom user events
paths:
  /event/fire/{name}:
    put:
      operationId: fireEvent
      summary: Fire a new event
      tags:
      - Events
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/dc'
      - name: node
        in: query
        schema:
          type: string
      - name: service
        in: query
        schema:
          type: string
      - name: tag
        in: query
        schema:
          type: string
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Event fired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
  /event/list:
    get:
      operationId: listEvents
      summary: List events
      tags:
      - Events
      parameters:
      - name: name
        in: query
        schema:
          type: string
      - $ref: '#/components/parameters/dc'
      responses:
        '200':
          description: List of events
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Event'
components:
  parameters:
    dc:
      name: dc
      in: query
      description: Datacenter to query (defaults to agent's datacenter)
      schema:
        type: string
  schemas:
    Event:
      type: object
      properties:
        ID:
          type: string
        Name:
          type: string
        Payload:
          type: string
        NodeFilter:
          type: string
        ServiceFilter:
          type: string
        TagFilter:
          type: string
        Version:
          type: integer
        LTime:
          type: integer
  securitySchemes:
    ConsulToken:
      type: apiKey
      name: X-Consul-Token
      in: header
      description: ACL token for authentication