Styra Health API

The Health API from Styra — 1 operation(s) for health.

OpenAPI Specification

styra-health-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Enterprise OPA REST Batch Health API
  version: 0.2.0
  contact:
    name: Styra
    url: https://github.com/StyraInc/enterprise-opa
servers:
- url: http://localhost:8181
  description: Local development server
security:
- {}
- bearerAuth: []
tags:
- name: Health
paths:
  /health:
    get:
      parameters:
      - $ref: '#/components/parameters/bundles'
      - $ref: '#/components/parameters/plugins'
      - $ref: '#/components/parameters/exclude-plugin'
      summary: Verify the server is operational
      operationId: health
      description: The health API endpoint executes a simple built-in policy query to verify that the server is operational. Optionally it can account for bundle activation as well (useful for “ready” checks at startup).
      responses:
        '200':
          $ref: '#/components/responses/HealthyServer'
        '500':
          $ref: '#/components/responses/UnhealthyServer'
      tags:
      - Health
components:
  parameters:
    bundles:
      name: bundles
      in: query
      description: Boolean parameter to account for bundle activation status in response. This includes any discovery bundles or bundles defined in the loaded discovery configuration.
      required: false
      schema:
        type: boolean
        default: false
    plugins:
      name: plugins
      in: query
      description: Boolean parameter to account for plugin status in response.
      required: false
      schema:
        type: boolean
        default: false
    exclude-plugin:
      name: exclude-plugin
      in: query
      description: String parameter to exclude a plugin from status checks. Can be added multiple times. Does nothing if plugins is not true. This parameter is useful for special use cases where a plugin depends on the server being fully initialized before it can fully initialize itself.
      required: false
      schema:
        type: array
        default: []
        items:
          type: string
  schemas:
    UnhealthyServer:
      type: object
      required:
      - code
      properties:
        code:
          type: string
        error:
          type: string
        message:
          type: string
  responses:
    UnhealthyServer:
      description: OPA service is not healthy. If the bundles option is specified this can mean any of the configured bundles have not yet been activated. If the plugins option is specified then at least one plugin is in a non-OK state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnhealthyServer'
    HealthyServer:
      description: OPA service is healthy. If the bundles option is specified then all configured bundles have been activated. If the plugins option is specified then all plugins are in an OK state.
      content:
        application/json:
          schema:
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
externalDocs:
  description: Enterprise OPA documentation
  url: https://docs.styra.com/enterprise-opa
  x-openpolicyagent-documentation-url: https://www.openpolicyagent.org/docs/latest/