openapi: 3.0.3
info:
  title: Chariot MQTT Server
  version: 2.1.0
  description: >-
    Chariot MQTT Server is a MQTT 3.1.1 compliant, Sparkplug aware MQTT server.
    The Chariot REST interface is described below.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
externalDocs:
  description: Find out more about the Chariot MQTT Server
  url: https://cirrus-link.com/mqtt-broker-iiot-mqtt-servers/
servers:
  - url: http://localhost:8080/

tags:
  - name: eula
    description: Chariot server EULA
  - name: authentication
    description: Chariot server authentication
    externalDocs:
      description: MQTT Server Configuration
      url: https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration
  - name: user
    description: Chariot server users
    externalDocs:
      description: MQTT Server Configuration - Users
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-UsersConfiguration
  - name: mqttuser
    description: Chariot server MQTT users
    externalDocs:
      description: MQTT Server Configuration - MQTT Credentials
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-MQTTCredentialsConfiguration
  - name: role
    description: Chariot server user roles
    externalDocs:
      description: MQTT Server Configuration - Roles
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-RolesConfiguration
  - name: permission
    description: Chariot server permissions
    externalDocs:
      description: MQTT Server Configuration - Roles
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-RolesConfiguration
  - name: server
    description: Chariot server
    externalDocs:
      description: MQTT Server Configuration - MQTT Server
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-MQTTServerConfiguration
        

  - name: bridging
    description: Chariot server - Bridging
    externalDocs:
      description: MQTT Server Configuration - Bridging
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-MQTTServerBridging


  - name: config
    description: Chariot server configuration
    externalDocs:
      description: MQTT Server Configuration - Configuration
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-MQTTServerConfiguration
  - name: license
    description: Chariot server licensing
    externalDocs:
      description: MQTT Server Configuration - License
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-LicenseConfiguration
  - name: system
    description: Chariot server system configuration
    externalDocs:
      description: MQTT Server Configuration - System Configuration
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Configuration#ChariotMQTTServerConfiguration-SystemConfiguration
  - name: logging
    description: Chariot server log configuration and download
    externalDocs:
      description: MQTT Server Configuration - Logging
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Usage#ChariotMQTTServerUsage-Logging
  - name: logs
    description: Chariot server live logs
    externalDocs:
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Usage#ChariotMQTTServerUsage-Logging
  - name: alerts
    description: Chariot server alerts
    externalDocs:
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Usage#ChariotMQTTServerUsage-Alerts
  - name: backup
    description: Chariot server configuration - import/export
    externalDocs:
      url: https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Usage
  - name: sparkplug
    description: Chariot server Sparkplug node/device tracking
    externalDocs:
      url: >-
        https://docs.chariot.io/display/CHAR2x/Chariot+MQTT+Server+Usage#ChariotMQTTServerUsage-Sparkplug
paths:
  /eula:
    get:
      tags:
        - eula
      summary: Get EULA acceptance state
      description: EULA state can be queried at any time
      operationId: getEulaState
      responses:
        '200':
          description: EULA state returned
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/EulaState'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
    post:
      tags:
        - eula
      summary: Accept the EULA
      description: The must be done before any other REST calls are allowed
      operationId: acceptEula
      requestBody:
        description: EULA accept object
        content:
          application/json;api-version=1.0:
            schema:
              $ref: '#/components/schemas/EulaAccept'
        required: true
      responses:
        '200':
          description: EULA has been accepted
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/EulaState'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse404'

  /login:
    post:
      tags:
        - authentication
      summary: Log in
      description: Logs user into the system
      operationId: loginUser
      responses:
        '200':
          description: successful operation
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/AuthenticationResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - basicAuth: []
  /logout:
    post:
      tags:
        - authentication
      summary: Log out
      description: Logs out currently logged in user
      operationId: logoutUser
      responses:
        '200':
          description: successful operation
        '401':
          description: not authorized

      security:
        - bearerAuth: []
  /permissions:
    get:
      tags:
        - permission
      summary: Get all permissions
      description: Gets all permissions allowed by the caller
      operationId: getPermissions
      responses:
        '200':
          description: Query returned results
          content:
            application/json;api-version=1.0:
              schema:
                  $ref: '#/components/schemas/Permission'
            application/xml:
              schema:
                  $ref: '#/components/schemas/Permission'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'

        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'

        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'

      security:
        - bearerAuth: []
  /users:
    get:
      tags:
        - user
      summary: Get all users
      description: Get all Chariot server users
      operationId: getUsers
      parameters:
        - name: limit
          in: query
          description: Maximum  number of records to retrieve 
          schema:
            type: integer
        - name: offset
          in: query
          description: The user record offset when specifying a limit
          schema:
            type: integer
      responses:
        '200':
          description: Query returned results
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties:
                  info:
                    $ref: '#/components/schemas/QueryResultInfo'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - user
      summary: Create users
      description: Create Chariot server users
      operationId: createUsers
      requestBody:
        description: List of users
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/User'
        required: true
      responses:
        '200':
          description: Users created successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []

  /users/{username}:
    get:
      tags:
        - user
      summary: Get user
      description: Get Chariot server user by name
      operationId: getUserByName
      parameters:
        - name: username
          in: path
          description: The name of the user to be retrieved
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/User'
            application/xml:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'

      security:
        - bearerAuth: []
    put:
      tags:
        - user
      summary: Update user
      description: Update Chariot server user
      operationId: updateUser
      parameters:
        - name: username
          in: path
          description: The name of the user to be updated
          required: true
          schema:
            type: string
      requestBody:
        description: Updated user object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - user
      summary: Create user
      description: Create Chariot server user
      operationId: createUser
      parameters:
        - name: username
          in: path
          description: Username for the user to be created
          required: true
          schema:
            type: string
      requestBody:
        description: Created user object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
        required: true
      responses:
        '200':
          description: Created user details
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/User'

        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'

        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'

        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'

        '405':
          description: not allowed
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse'

      security:
        - bearerAuth: []
    delete:
      tags:
        - user
      summary: Delete user
      description: Delete Chariot server user
      operationId: deleteUser
      parameters:
        - name: username
          in: path
          description: The name of the user to be deleted
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
        
        
        
  /userinfo: 
    get:
      tags: 
        - user
      summary: Get the logged in  user details
      description: Get the logged in  user details
      operationId: getUserInfo
      responses: 
        '200':
          description: Query returned results
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/UserInfo'

                  
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []              

        
  /mqttusers:
    get:
      tags:
        - mqttuser
      summary: Get all MQTT users
      description: Get all Chariot server MQTT users
      operationId: getMqttUsers
      parameters:
        - name: limit
          in: query
          description: Maximum  number of records to retrieve 
          schema:
            type: integer
        - name: offset
          in: query
          description: The record offset when specifying a limit
          schema:
            type: integer
      responses:
        '200':
          description: Query returned results
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties: 
                  info:
                    $ref: '#/components/schemas/QueryResultInfo'
                  results: 
                    type: array
                    items:
                      $ref: '#/components/schemas/MqttUser'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - mqttuser
      summary: Create MQTT users
      description: Chariot Chariot server MQTT users
      operationId: createMqttUsers
      requestBody:
        description: List of MQTT user objects
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/MqttUser'
        required: true
      responses:
        '200':
          description: Query returned results
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MqttUser'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /mqttusers/{username}:
    get:
      tags:
        - mqttuser
      summary: Get MQTT user
      description: Get Chariot server MQTT user by name
      operationId: getMqttUserByName
      parameters:
        - name: username
          in: path
          description: The name of the user to be retrieved
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/MqttUser'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    put:
      tags:
        - mqttuser
      summary: Update MQTT user
      description: Update Chariot server MQTT user by name
      operationId: updateMqttUser
      parameters:
        - name: username
          in: path
          description: The name of the user to be updated
          required: true
          schema:
            type: string
      requestBody:
        description: Updated user object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MqttUser'
        required: true
      responses:
        '200':
          description: MQTT user successfully updated
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/MqttUser'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - mqttuser
      summary: Create MQTT user
      description: Create Chariot server MQTT user
      operationId: createMqttUser
      parameters:
        - name: username
          in: path
          description: The name of the user to be created
          required: true
          schema:
            type: string
      requestBody:
        description: Created MQTT user object
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MqttUser'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/MqttUser'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []

    delete:
      tags:
        - mqttuser
      summary: Delete MQTT user
      description: Delete Chariot server MQTT user by name
      operationId: deleteMqttUser
      parameters:
        - name: username
          in: path
          description: The name of the user to be deleted
          required: true
          schema:
            type: string
      responses:
        '200':
          description: MQTT user successfully deleted
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/MqttUser'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /roles:
    get:
      tags:
        - role
      summary: Get all roles
      description: Get all Chariot server roles
      operationId: getRoles
      parameters:
        - name: limit
          in: query
          description: Maximum  number of records to retrieve 
          schema:
            type: integer
        - name: offset
          in: query
          description: The record offset when specifying a limit
          schema:
            type: integer
      responses:
        '200':
          description: Roles retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties:
                  info:
                    $ref: '#/components/schemas/QueryResultInfo'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Role'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - role
      summary: Create roles
      description: Create Chariot server roles
      operationId: createRoles
      requestBody:
        description: List of role objects
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Role'
        required: true
      responses:
        '200':
          description: Roles created successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Role'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /roles/{rolename}:
    get:
      tags:
        - role
      summary: Get role
      description: Get Chariot server role by name
      operationId: getRoleByName
      parameters:
        - name: rolename
          in: path
          description: The name of the role to be retrieved
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Role retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Role'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    put:
      tags:
        - role
      summary: Update role
      description: Update Chariot role by name
      operationId: updateRole
      parameters:
        - name: rolename
          in: path
          description: name of role that needs to be updated
          required: true
          schema:
            type: string
      requestBody:
        description: Role object to be updated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Role'
        required: true
      responses:
        '200':
          description: Role successfully updated
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Role'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - role
      summary: Create role
      description: Create Chariot server role
      operationId: createRole
      parameters:
        - name: rolename
          in: path
          description: Name of role to be created
          required: true
          schema:
            type: string
      requestBody:
        description: Role object to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Role'
        required: true
      responses:
        '200':
          description: Role created successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Role'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []

    delete:
      tags:
        - role
      summary: Delete role
      description: Delete Chariot server role by name
      operationId: deleteRole
      parameters:
        - name: rolename
          in: path
          description: The name of the role to be deleted
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Role successfully deleted
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Role'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /server:
    get:
      tags:
        - server
      summary: Get server state
      description: Get the state of the Chariot MQTT server
      operationId: getServerState
      responses:
        '200':
          description: Server state retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ServerState'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - server
      summary: Run server action
      description: Run Chariot MQTT server action
      operationId: runServerAction
      parameters:
        - name: action
          in: query
          description: The action to be performed, if any
          schema:
            type: string
            enum:
              - start
              - stop
              - disconnect
        - name: clientId
          in: query
          description: The MQTT client id when action=disconnect
          schema:
            type: string
      responses:
        '200':
          description: Requested control operation performed
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ServerState'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /server/status:
    get:
      tags:
        - server
      summary: Get server status
      description: Get the status of the Chariot MQTT server
      operationId: getServerStatus
      responses:
        '200':
          description: Server status retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ServerState'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /server/clients:
    get:
      tags:
        - server
      summary: Get server clients
      description: Get Chariot MQTT server active clients
      operationId: getServerClients
      responses:
        '200':
          description: Active MQTT clients retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ActiveMqttClients'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /config/server:
    get:
      tags:
        - config
      summary: Get the server configuration
      description: Get the Chariot MQTT server configuration
      operationId: getServerConfiguration
      responses:
        '200':
          description: Successfully retrieved the server configuration
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ServerConfig'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    put:
      tags:
        - config
      summary: Update server configuration
      description: Update Chariot MQTT server configuration
      operationId: updateServerConfiguration
      requestBody:
        description: The server configuration
        content:
          application/json;api-version=1.0:
            schema:
              $ref: '#/components/schemas/ServerConfig'
        required: true
      responses:
        '200':
          description: Successfully configured the server
          content: 
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ServerConfig'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
      
  /bridgeclients:    
    get: 
      tags: 
        - bridging
      summary: Get all bridge clients
      description: Get all bridge clients
      operationId: getBridgeClients
      parameters: 
        - name: limit
          in: query
          description: The number of bridge clients requested
          schema:
            type: integer
        - name: offset
          in: query
          description: The bridge client offset when specifying a limit
          schema:
            type: integer
      responses:
        '200':
          description: Success
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties:
                  info:
                    $ref: '#/components/schemas/QueryResultInfo'
                  results: 
                    $ref: '#/components/schemas/Bridging'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post: 
      tags: 
        - bridging
      summary: Add new bridge clients
      
      operationId: addBridgeClients
      requestBody: 
        description: Bridge client details 
        content:
          application/json:
            schema:
              type: array
              items: 
                $ref: '#/components/schemas/Bridging'
      responses:
        '200':
          description: Successfully created bridge client
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items: 
                  $ref: '#/components/schemas/Bridging'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
      - bearerAuth: []   
  /bridgeclients/{clientName}:
    get:
      tags:
      - bridging
      summary: Get a bridge client by name 
      description: Retrieves a bridge client details by name
      operationId: getBridgeClient
      parameters:
        - name: clientName
          in: path
          description: The bridge client name
          required: true
          schema:
            type: string
      responses: 
        '200':
          description: Success
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Bridging'
                    
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
      - bearerAuth: []   
  
    put:
      tags:
        - bridging
      summary: Update a bridge client 
      description: This updates the specified bridge client
      operationId: updateBridgeClient
      parameters:
        - name: clientName
          in: path
          description: The bridge client  name
          required: true
          schema:
            type: string
      requestBody:
        description: Updated bridge client details. Name should not be changed. 
        content: 
          application/json:
            schema: 
              $ref: '#/components/schemas/Bridging'
      responses: 
        '200':
          description: Bridge client successfully updated
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Bridging'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
                    
                    
      security:
      - bearerAuth: []   
      
    post:
      tags:
        - bridging
      summary: Create a bridge client 
      description: This creates a bridge client
      operationId: createBridgeClient
      parameters:
        - name: clientName
          in: path
          description: The bridge client  name
          required: true
          schema:
            type: string
      requestBody:
        description: Bridge client details
        content: 
          application/json:
            schema: 
              $ref: '#/components/schemas/Bridging'
      responses: 
        '200':
          description: Bridge client successfully created 
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Bridging'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
      - bearerAuth: []  
      
      
      
    delete:
      tags:
        - bridging
      summary: Delete a bridge client 
      description: This deletes a bridge client
      operationId: deleteBridgeClient
      parameters:
        - name: clientName
          in: path
          description: The bridge client  name
          required: true
          schema:
            type: string
      responses: 
        '200':
          description: Bridge client successfully deleted
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Bridging'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
      - bearerAuth: []   
    

  /upload:
    get:
      tags:
        - upload
      summary: Get uploaded file info
      description: Get info for all files uploaded to the Chariot server
      operationId: getUploadedFiles
      responses:
        '200':
          description: Uploaded file info retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UploadedFile'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - upload
      summary: Upload files to Chariot
      description: >-
        The upload REST endpoint enables uploading specific files required for
        configuring the Chariot MQTT server. For example, SSL certificates and
        private keys. After uploading certificates, set up SSL with system/ssl?action=setup
      operationId: uploadFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                caChain:
                  type: string
                  description: >-
                    An X.509 public root CA (Certificate Authority) certificate
                    and any/all public intermediate CA certificates between the
                    root and the CA that issued the certificate in PEM format.
                    If there are no intermediate CAs, then the chain is made up
                    of only the public root CA certificate.
                  format: binary
                certificate:
                  type: string
                  description: An X.509 server certificate in PEM format.
                  format: binary
                privateKey:
                  type: string
                  description: >-
                    An RSA private key in PEM format that was used to generate
                    the server certificate.
                  format: binary
      responses:
        '200':
          description: File upload completed successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UploadResult'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    delete:
      tags:
        - upload
      summary: Delete uploaded file
      description: Delete file uploaded to Chariot by fileId
      operationId: deleteUploadedFile
      parameters:
        - name: fileId
          in: query
          description: The fileId to be deleted
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Uploaded file info retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/UploadedFile'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /system:
    get:
      tags:
        - system
      summary: Get system status
      description: Returns the system status
      operationId: getSystemStatus
      responses:
        '200':
          description: System status retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SystemStatus'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /system/ssl:
    get:
      tags:
        - system
      summary: Get system SSL status
      description: Returns the system SSL status
      operationId: getSystemSslStatus
      responses:
        '200':
          description: SSL status retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SslStatus'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - system
      summary: Enable system SSL for secure communication
      description: >-
        Configure the system to consume SSL certificates uploaded through the
        /upload endpoint.
      operationId: setSystemSsl
      parameters:
        - name: action
          in: query
          schema:
            type: string
            enum:
              - setup
      responses:
        '200':
          description: SSL enabled sucessfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SslStatus'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    delete:
      tags:
        - system
      summary: Disable system SSL
      description: Disables system SSL
      operationId: deleteSsl
      responses:
        '200':
          description: SSL disabled successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SslStatus'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /config/system:
    get:
      tags:
        - config
      summary: Get the system configuration
      description: Get the Chariot server system configuration
      operationId: getSystemConfiguration
      responses:
        '200':
          description: System configuration retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SystemConfig'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    put:
      tags:
        - config
      summary: Update system configuration
      description: Update the Chariot server system configuration
      operationId: updateSystemConfiguration
      requestBody:
        description: The system configuration
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemConfig'
        required: true
      responses:
        '200':
          description: System configuration updated successfully
          content: 
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /config/sparkplug:
    get:
      tags:
        - config
      summary: Get the Sparkplug configuration
      description: Get the Chariot server Sparkplug Tracking configuration
      operationId: getSparkplugConfiguration
      responses:
        '200':
          description: Sparkplug configuration retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SparkplugConfig'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /license:
    get:
      tags:
        - license
      summary: Get the license
      description: Get the Chariot server license
      operationId: getServerLicense
      responses:
        '200':
          description: License status retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/LicenseStatus'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - license
      summary: Install and configure the license
      description: Install and configure (activate/deactivate) the Chariot server license
      operationId: installServerLicense
      parameters:
        - name: action
          in: query
          description: The action to be performed, if any
          required: true
          schema:
            type: string
            enum:
              - activate
              - deactivate
              - manual-activate
              - get-manual-activation-request
              - get-manual-deactivation-request
              - start-trial-timer
              - stop-trial-timer
      requestBody:
        description: The license text
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseText'
        required: false
      responses:
        '200':
          description: Request succeeded, license status returned
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/LicenseStatus'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /logging:
    get:
      tags:
        - logging
      summary: Get all logger levels
      description: Get all Chariot loggers and their log levels
      operationId: getLogLevels
      parameters:
        - name: modified
          in: query
          description: whether the logger is modified or not
          schema:
            type: boolean
      responses:
        '200':
          description: Logger levels retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LogLevel'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - logging
      summary: Run logger action
      description: Execute an action against the Chariot loggers to changed log levels
      operationId: configureLogger
      parameters:
        - name: action
          in: query
          description: The action to be performed, if any
          schema:
            type: string
            enum:
              - export
              - setLevel
        - name: level
          in: query
          description: The logger level to set, if any
          schema:
            type: string
            enum:
              - NONE
              - ERROR
              - WARN
              - INFO
              - DEBUG
              - TRACE
        - name: name
          in: query
          description: The logger name
          schema:
            type: string
      responses:
        '200':
          description: Log level was successfully set
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/LogLevel'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /logging/{logger}:
    get:
      tags:
        - logging
      summary: Get logger level
      description: Get Chariot logger and its log level
      operationId: getLoggerLevel
      parameters:
        - name: logger
          in: path
          description: the logger requested
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Chariot logger retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LogLevel'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /logs:
    get:
      tags:
        - logs
      summary: Get logs
      description: Get all or some of the log entries
      operationId: getLogs
      parameters:
        - name: limit
          in: query
          description: The number of log messages requested
          schema:
            type: integer
        - name: maxLevel
          in: query
          description: The max logger level
          schema:
            type: string
            enum:
              - NONE
              - ERROR
              - WARN
              - INFO
              - DEBUG
              - TRACE
        - name: messageFilter
          in: query
          description: Log message filter (contains)
          schema:
            type: string
        - name: offset
          in: query
          description: The log message offset when specifying a limit
          schema:
            type: integer
      responses:
        '200':
          description: Chariot logs retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties:
                  info:
                    $ref: '#/components/schemas/QueryResultInfo'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/LogEntry'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /alerts:
    get:
      tags:
        - alerts
      summary: Get alerts
      description: Get Chariot alerts with the specified limits, filtering and offset
      operationId: getAlerts
      parameters:
        - name: limit
          in: query
          description: The number of alerts requested
          schema:
            type: integer
        - name: descriptionFilter
          in: query
          description: Alert description filter (contains)
          schema:
            type: string
        - name: offset
          in: query
          description: The alert offset when specifying a limit
          schema:
            type: integer
      responses:
        '200':
          description: Chariot alerts retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties:
                  info:
                    $ref: '#/components/schemas/QueryResultInfo'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Alert'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /alerts/{id}:
    put:
      tags:
        - alerts
      summary: Update alert
      description: Update Chariot alert by ID
      operationId: updateAlert
      parameters:
        - name: id
          in: path
          description: Alert ID
          required: true
          schema:
            type: integer
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/Alert'
        required: true
      responses:
        '200':
          description: Chariot alert updated successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Alert'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []

    delete:
      tags:
        - alerts
      summary: Delete alert
      description: Delete Chariot alert by ID
      operationId: deleteAlert
      parameters:
        - name: id
          in: path
          description: Alert ID
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Chariot alert deleted successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/Alert'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /alerttypes:
    get:
      tags:
        - alerts
      summary: Get alert types
      description: Get all Chariot alert types
      operationId: getAlertTypes
      responses:
        '200':
          description: Chariot alert types
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties:
                  info:
                    $ref: '#/components/schemas/QueryResultInfo'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/AlertType'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /alerttypes/{typename}:
    put:
      tags:
        - alerts
      summary: Update alert type
      description: Update Chariot alert type by name
      operationId: updateAlertType
      parameters:
        - name: typename
          in: path
          description: Alert type name
          required: true
          schema:
            type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/AlertType'
        required: true
      responses:
        '200':
          description: Alert type updated successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/AlertType'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
      
  /alertinfo:
    get:
      tags:
        - alerts
      summary: Alert types
      description: List all of the alert types 
      operationId: alertTypes
      responses:
        '200':
          description: Success
          content:          
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/AlertInfo'
      
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
      - bearerAuth: []

        
  /sparkplug:
    post:
      tags:
        - sparkplug
      summary: Peform an action on the Sparkplug tracker
      description: Perform an action on the Sparkplug tracker
      operationId: executeSparkplugAction
      parameters:
        - name: action
          in: query
          description: The action to be performed
          required: true
          schema:
            type: string
            enum:
              - sampleCompression
              - generateEdgeCreds
              - generateHostCreds
        - name: groupId
          in: query
          description: The Group ID of edge node
          schema:
            type: string
        - name: edgeNodeId
          in: query
          description: The EdgeNode ID of edge node
          schema:
            type: string
        - name: deviceId
          in: query
          description: The Device ID
          schema:
            type: string
        - name: duration
          in: query
          description: The amount of time to sample compression in seconds
          schema:
            type: integer
      requestBody:
        description: Input for credential generation
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/MqttCreds2Generate'
        required: false
      responses:
        '200':
          description: Sparkplug action executed successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []

  /sparkplug/status:
    get:
      tags:
        - sparkplug
      summary: Get Sparkplug status
      description: Get Chariot Sparkplug tracker status
      operationId: getSparkplugStatus
      responses:
        '200':
          description: Sparkplug status retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SparkplugStatus'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /sparkplug/edges:
    get:
      tags:
        - sparkplug
      summary: Get edge nodes
      description: Get Chariot Sparkplug edge nodes
      operationId: getSparkplugEdges
      parameters:
        - name: limit
          in: query
          description: Maximum  number of records to retrieve 
          schema:
            type: integer
            default: 10
        - name: offset
          in: query
          description: The record offset when specifying a limit
          schema:
            type: integer
            default: 0
        - name: filterField
          in: query
          description: The field to filter on
          required: false
          schema:
            type: string
            enum:
              - edgeNodeId
              - groupId
              - clientId
              - ipAddress
        - name: filterValue
          in: query
          description: The filter value
          schema:
            type: string
      responses:
        '200':
          description: Sparkplug edge nodes retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: object
                properties: 
                  info: 
                    $ref: '#/components/schemas/QueryResultInfo'
                  results: 
                    type: array
                    items: 
                       $ref: '#/components/schemas/SparkplugEdge'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    delete:
      tags:
        - sparkplug
      summary: Delete edge node(s)
      description: To delete a single Chariot Sparkplug edge node by ID, add the groupId and the edgeNodeId. To delete multiple edge nodes by filter, select filterField and add the filterValue
      operationId: deleteSparkplugEdge
      parameters:
        - name: groupId
          in: query
          description: The group ID of single edge node to be deleted
          required: false
          schema:
            type: string
        - name: edgeNodeId
          in: query
          description: The Edge Node ID of single edge node to be deleted
          required: false
          schema:
            type: string
        - name: filterField
          in: query
          description: The field to filter on for deleting multiple edge nodes
          required: false
          schema:
            type: string
            enum: 
              - edgeNodeId
              - groupId
              - clientId
              - ipAddress
        - name: filterValue
          in: query
          description: The filter value for deleting multiple edge nodes
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Sparkplug edge node(s) deleted successfully - single deletion
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SparkplugEdge'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    post:
      tags:
        - sparkplug
      summary: Delete edge nodes by ID
      description: Delete multiple Chariot Sparkplug edge nodes by ID
      operationId: deleteSparkplugEdges
      parameters:
        - name: action
          in: query
          description: Action = delete
          required: true
          schema:
            type: string
            default: delete
      requestBody:
        description: Describe edge nodes to delete 
        content:
          application/json;api-version=1.0:
            schema:
              $ref: '#/components/schemas/EdgeNodeDescriptor'
        required: false
    

      responses:
        '200':
          description: Sparkplug edge node(s) deleted successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/EdgeNodeDescriptors'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /sparkplug/hosts:
    get:
      tags:
        - sparkplug
      summary: Get hosts
      description: Get Chariot Sparkplug hosts
      operationId: getSparkplugHosts
      responses:
        '200':
          description: Sparkplug hosts retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SparkplugHost'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
    delete:
      tags:
        - sparkplug
      summary: Delete a host
      description: Delete a Chariot Sparkplug host by Primary ID
      operationId: deleteSparkplugHost
      parameters:
        - name: primaryId
          in: query
          description: The primary ID of host to be deleted
          required: true
          schema:
            type: string
        - name: stateTopic
          in: query
          description: The primary ID of host to be deleted
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Sparkplug host(s) deleted successfully
          content:
            application/json;api-version=1.0:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SparkplugHost'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /sparkplug/nbirth:
    get:
      tags:
        - sparkplug
      summary: Get NBIRTH
      description: Get Sparkplug edge node NBIRTH
      operationId: getSparkplugEdgeNbirth
      parameters:
        - name: groupId
          in: query
          description: The Group ID 
          required: true
          schema:
            type: string
        - name: edgeNodeId
          in: query
          description: The Edge Node ID 
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Sparkplug edge node NBIRTH retrieved successfully
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SparkplugEdgeNbirth'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /sparkplug/dbirth:
    get:
      tags:
        - sparkplug
      summary: Get DBIRTH
      description: Get Sparkplug device DBIRTH
      operationId: getSparkplugDeviceDbirth
      parameters:
        - name: groupId
          in: query
          description: The Group ID of edge node
          required: true
          schema:
            type: string
        - name: edgeNodeId
          in: query
          description: The Edge Node ID
          required: true
          schema:
            type: string
        - name: deviceId
          in: query
          description: The Device ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Sparkplug device DBIRTH
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/SparkplugDeviceDbirth'
        '400':
          description: bad request
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0:
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
  /backup:
    post:
      tags:
        - backup
      summary: Run a backup action
      description: Execute an action on the Chariot backup endpoint
      operationId: executeBackupAction
      parameters:
        - name: action
          in: query
          description: The action to be performed
          required: true
          schema:
            type: string
            enum:
              - export
              - import
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                File:
                  type: string
                  format: binary
      responses:
        '200':
          description: Chariot server export file
          content:
            application/json;api-version=1.0:
              schema:
                type: string
                format: binary
        '400':
          description: bad request
          content:
            application/json;api-version=1.0::
              schema:
                $ref: '#/components/schemas/ApiResponse400'
        '401':
          description: not authorized
          content:
            application/json;api-version=1.0::
              schema:
                $ref: '#/components/schemas/ApiResponse401'
        '404':
          description: not found
          content:
            application/json;api-version=1.0::
              schema:
                $ref: '#/components/schemas/ApiResponse404'
      security:
        - bearerAuth: []
components:
  schemas:
    Alert:
      required:
        - acknowledged
        - activeTime
        - cleared
        - description
        - id
        - priority
        - type
      type: object
      properties:
        id:
          type: integer
          example: 1
        description:
          type: string
          example: Client MT-RPC-8a14c739-4605-48 connected w/o registering LWT
        cleared:
          type: boolean
          example: false
        activeTime:
          type: integer
          example: 10221727488962
        acknowledged:
          type: boolean
          example: false
        priority:
          type: integer
          example: 3
        type:
          type: string
          example: MQTT_LWT_NOT_REGISTERED
          
    AlertType:
      required:
        - enabled
        - name
        - path
        - priority
        - severity
      type: object
      properties:
        enabled:
          type: boolean
          example: true
        path:
          type: string
          example: SPARKPLUG/GROUP_EDGE_COLLISION
        severity:
          type: integer
          example: 1
        name:
          type: string
          example: SPARKPLUG/GROUP_EDGE_COLLISION
        priority:
          type: integer
          example: 1
          
    AlertInfo:   
      required:
        - types
      type: object
      properties:
        types:
          type: array
          items:
            type: string
          example: 
            ["SPARKPLUG_SEQ_NUM_ERROR", "SPARKPLUG_GROUP_EDGE_COLLISION","MQTT_CONNECTION_LOST","SPARKPLUG_TEMPLATE_DEF_COLLISION","SPARKPLUG_NONCOMPLIANT_LWT_TOPIC","MQTT_LWT_NOT_REGISTERED","SPARKPLUG_COMPRESSION_WARNING","MQTT_DISCONNECT"]
    Address:
      required:
        - city
        - country
        - number
        - province
        - street
        - zip
      type: object
      properties:
        number:
          type: integer
          example: 123
        street:
          type: string
          example: NE 10th Street
        city:
          type: string
          example: Vancouver
        province:
          type: string
          example: WA
        country:
          type: string
          example: USA
        zip:
          type: string
          example: '98665'
    AuthenticationResponse:
      required:
        - access_token
        - expires_in
        - token_type
      type: object
      properties:
        access_token:
          type: string
          example: >-
            qoJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6ImNpcnJ1c2xpbmsiLCJzZXNzaW9uaWQiOiJhNTFjNWQ4Ni1jZWUxLTRjODItOTNjYi0yOTk5MjVjZWViY2MrfQ.cLPD7Uddz_JF3s7Rk3Yyc232Arnz6Qcg2Id0tstouh0wbcv50mck2vzH8iFkkAwKcMaWi8gLN-NIsLCRuW7Qzz
        token_type:
          type: string
          example: bearer
        expires_in:
          type: integer
          example: 5400000
          
    BridgeClients: 
      required: 
        - name
        - enabled
        - connected
      type: array
      items: 
        type: object
        properties:
          name:
            type: string
            example: clientName
          enabled: 
            type: boolean
            example: true
          connected: 
            type: boolean
            example: true
          
    Bridging: 
      required: 
        - name
        - address
        - port
        - keepAlive
        - cleanSession
        - allowRetained
        - tryPrivate
        - useTls
        - enabled
      type: object
      properties: 
        name:
          type: string
          example: client1
        username: 
          type: string
          example: client1Username
        password: 
          type: string
          example: password
        address: 
          type: string
          example: localhost
        port: 
          type: integer
          example: 1883
        clientId: 
          type: string
          example: BRIDGE_01
        keepAlive: 
          type: integer
          example: 30
        cleanSession: 
          type: boolean
          example: true
        allowRetained: 
          type: boolean
          example: true
        tryPrivate: 
          type: boolean
          example: true
        subTopics: 
          type: string
          example: "subTopic1, subTopic2, subTopic3"
        pubTopics: 
          type: string
          example: "pubTopic1, pubTopic2, pubTopic3"
        useTls: 
          type: boolean
          example: false
        enabled: 
          type: boolean
          example: true
                    

    EulaAccept:
      required:
        - isAccepted
      type: object
      properties:
        isAccepted:
          type: boolean
          example: true
    EulaState:
      required:
        - acceptedOn
        - isAccepted
        - name
      type: object
      properties:
        acceptedOn:
          type: integer
          example: 1588703796554
        isAccepted:
          type: boolean
          example: true
        name:
          type: string
          example: ChariotEula
          
    EdgeNodeDescriptor: 
      required:
        - edgeNodeDescriptor
      type: object
      properties:
        edgeNodeDescriptors:
          type: array
          example:
            - 'Emulated Sparkplug/EdgeNode-13f8e75b-de9b-4f57-2'
          items:
            type: string
    EdgeNodeDescriptors: 
      type: string
      example:
        - 'Emulated Sparkplug/EdgeNode-13f8e75b-de9b-4f57-2'
     
    Role:
      required:
        - name
        - permissions
      type: object
      properties:
        name:
          type: string
          example: admin
        permissions:
          type: array
          items:
            type: string
            example: permission:read
          
    Permission:
      type: array
      items:
        type: string
        example: permission:read
    User:
      required:
        - password
        - username
      type: object
      properties:
        username:
          type: string
          example: chariot-user1
        password:
          type: string
          example: mqtt4ever
        roles:
          type: array
          example:
            - admin
          items:
            type: string
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Smith
        phoneNumber:
          type: string
          example: '13605555555'
        email:
          type: string
          example: john.smith@test-email.com
        address:
          $ref: '#/components/schemas/Address'
        company:
          type: string
          example: Cirrus Link
          
    UserInfo: 
      required:
        - username
        - roles
        - firstname
        - lastname
        - email
        - address
        - company
      type: object
      properties:
        username:
          type: string
          example: chariot-user1
        roles:
          type: array
          example:
            - admin
          items:
            type: string
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Smith
        email:
          type: string
          example: john.smith@test-email.com
        address:
          $ref: '#/components/schemas/Address'
        company:
          type: string
          example: Cirrus Link

          
    MqttUser:
      required:
        - acl
        - password
        - username
      type: object
      properties:
        username:
          type: string
          example: admin
        password:
          type: string
          example: mqtt4ever
        acl:
          type: object
          properties:
            subscribeTopics:
              type: array
              example:
                - '#'
              items:
                type: string
            publishTopics:
              type: array
              example:
                - '#'
              items:
                type: string

    SystemStatus:
      required:
        - buildTimestamp
        - chariotVersion
        - jvmName
        - jvmVendor
        - jvmVersion
      type: object
      properties:
        jvmName:
          type: string
          example: OpenJDK 64-Bit Server VM
        jvmVersion:
          type: string
          example: 11.0.6+10-LTS
        jvmVendor:
          type: string
          example: Amazon.com Inc.
        chariotVersion:
          type: string
          example: 1.0.0
        buildTimestamp:
          type: string
          example: 20200630-191950
        chariotServerName:
          type: string
          example: Cirrus Link Charifot MQTT Server
        jvmMemory:
          type: object
          properties: 
            heapInit:
              type: integer
              example: 268435456
            heapUsed:
              type: integer
              example: 183392272
            heapMax:
              type: integer
              example: 268435456
            heapCommitted:
              type: integer
              example: 322961408
        cpu: 
          type: object
          properties:
            processCpuLoad:
              type: integer
              example: 0
            systemCpuLoad:
              type: integer
              example: 0
            processCpuTime:
              type: integer
              example: 268435456
    ServerState:
      required:
        - lastStartedOn
        - lastStoppedOn
        - running
      type: object
      properties:
        running:
          type: boolean
          example: true
        lastStartedOn:
          type: integer
          example: 1586824096739
        lastStoppedOn:
          type: integer
          example: 1586824096739
        bridgeClients: 
          $ref: '#/components/schemas/BridgeClients'
          
          
    SystemConfig:
      required:
        - chariotServerName
        - chariotVersionFile
        - httpEnabled
        - httpPort
        - httpsEnabled
        - httpsPort
      type: object
      properties:
        chariotServerName:
          type: string
          example: Cirrus Link Chariot MQTT Server
        chariotVersionFile:
          type: string
          example: version.properties
        httpEnabled:
          type: boolean
          example: true
        httpPort:
          type: integer
          example: 8080
        httpsEnabled:
          type: boolean
          example: false
        httpsPort:
          type: integer
          example: 8443
    ServerConfig:
      required:
        - allowAnonymous
        - allowEmptyClientId
        - anonymousAuthUsername
        - bindAddress
        - clientAuthPolicy
        - connectTimeout
        - enableNonSecure
        - enableSecure
        - keepAliveCheckInterval
        - maxActiveClients
        - maxClientIdLength
        - maxConnectSize
        - maxMessageSize
        - maxTopicLength
        - maxTopicLevels
        - messageThreads
        - port
        - redeliveryInterval
        - securePort
        - secureProtocol
        - sslHandshakeTimeout
        - webSocketEnable
        - webSocketEnableSecure
        - webSocketPort
        - webSocketSecurePort
      type: object
      properties:
        maxConnectSize:
          type: integer
          example: 268435455      
        webSocketEnable:
          type: boolean
          example: false      
        secureProtocol:
          type: string
          example: TLSv1.2      
        clientAuthPolicy:
          type: string
          example: none      
        maxActiveClients:
          type: integer
          example: 2147483647      
        webSocketSecurePort:
          type: integer
          example: 8091      
        enableSecure:
          type: boolean
          example: false      
        securePort:
          type: integer
          example: 8883      
        sslHandshakeTimeout:
          type: integer
          description: (in milliseconds)
          example: 10000      
        redeliveryInterval:
          type: integer
          example: 1000      
        maxClientIdLength:
          type: integer
          example: 65535      
        connectTimeout:
          type: integer
          description: (in milliseconds)
          example: 10000      
        keepAliveCheckInterval:
          type: integer
          description: (in milliseconds)
          example: 1000      
        maxMessageSize:
          type: integer
          example: 268435455
        webSocketEnableSecure:
          type: boolean
          example: false          
        anonymousAuthUsername:
          type: string
          example: anonymous          
        enableNonSecure:
          type: boolean
          example: true
        bindAddress:
          type: string
          example: 0.0.0.0          
        allowAnonymous:
          type: boolean
          example: false          
        maxTopicLevels:
          type: integer
          example: 25          
        messageThreads:
          type: integer
          example: 1          
        maxTopicLength:
          type: integer
          example: 65535          
        port:
          type: integer
          example: 1883
        allowEmptyClientId:
          type: boolean
          example: false
        webSocketPort:
          type: integer
          example: 8090
    LicenseStatus:
      required:
        - activatedOn
        - activationPeriod
        - expiresOn
        - licenseId
        - state
        - trialTimer
      type: object
      properties:
        licenseId:
          type: string
          example: '1581813888962'      
        expiresOn:
          type: integer
          example: 10221727488962      
        activatedOn:
          type: integer
          example: 1591722778404
        onlineActivation:
          type: boolean
          example: true
        activationPeriod:
          type: integer
          example: 90
        state:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - TRIAL
        trialTimer:
          type: integer
          example: 4678128
        requestText: 
          type: string
          example: string
        mode: 
          type: string
          example: NORMAL
          
    LicenseText:
      required:
        - text
      type: object
      properties:
        text:
          pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$
          type: string
          format: byte
          example: PEM encoded license certificate file in OpenSSL/SSLeay format
    LogLevel:
      required:
        - level
        - name
      type: object
      properties:
        level:
          type: string
          enum:
            - NONE
            - ERROR
            - WARN
            - INFO
            - DEBUG
            - TRACE
        name:
          type: string
          example: com.cirruslink.chariot.logging.impl.LoggingService
    QueryResultInfo:
      required:
        - count
        - limit
        - offset
        - total
      type: object
      properties:
        count:
          type: integer
          example: 100
        limit:
          type: integer
          example: 100
        offset:
          type: integer
          example: 200
        total:
          type: integer
          example: 2345567
    LogEntry:
      required:
        - level
        - logger
        - message
        - thread
        - timestamp
      type: object
      properties:
        level:
          type: string
          example: INFO
        logger:
          type: string
          example: com.cirruslink.chariot.logging.impl.LoggingService
        message:
          type: string
          example: Returning 132 log entries
        thread:
          type: string
          example: qtp1200672365-95
        timestamp:
          type: integer
          example: 10221727488962
    UploadedFile:
      required:
        - fileId
        - filename
        - timestamp
      type: object
      properties:
        fileId:
          type: string
          example: privateKey
        filename:
          type: string
          example: testKey.pem
        timestamp:
          type: integer
          example: 10221727488962
    UploadResult:
      required:
        - errorMessage
        - fileInfo
        - uploaded
      type: object
      properties:
        fileInfo:
          $ref: '#/components/schemas/UploadedFile'
        errorMessage:
          type: string
          example: there was an error
        uploaded:
          type: boolean
          example: false
    ApiResponse400:
      required:
        - code
        - message
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 400
        message:
          type: string
    ApiResponse401:
      required:
        - code
        - message
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 401
        message:
          type: string
    ApiResponse404:
      required:
        - code
        - message
      type: object
      properties:
        code:
          type: integer
          format: int32
          example: 404
        message:
          type: string
    ApiResponse:
      required:
        - code
        - message
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
    ActiveMqttClients:
      required:
        - activeClients
        - clients
      type: object
      properties:
        activeClients:
          type: integer
          format: int32
          example: 10
        clients:
          type: array
          items:
            $ref: '#/components/schemas/MqttClient'
    MqttClient:
      required:
        - bytesRx
        - bytesTx
        - cleanStart
        - clientId
        - connectedOn
        - ipAddress
        - keepalive
        - lastActive
        - state
        - subscriptions
        - username
        - willRetained
        - willTopic
      type: object
      properties:
        clientId:
          type: string
          example: ME-7f0ce171-ef29-4203
        state:
          type: string
          example: CONNECTED
        cleanStart:
          type: boolean
          example: true
        ipAddress:
          type: string
          example: 127.0.0.1
        keepalive:
          type: integer
          example: 30
        username:
          type: string
          example: admin
        lastActive:
          type: integer
          example: 1626889935056
        connectedOn:
          type: integer
          example: 1626889844950
        willTopic:
          type: string
          example: STATE/PrimaryHostID
        willQoS:
          type: integer
          example: 1
        willRetained:
          type: boolean
          example: true
        bytesTx:
          type: integer
          example: 6
        bytesRx:
          type: integer
          example: 896
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/Subscription'
    Subscription:
      required:
        - qos
        - topic
      type: object
      properties:
        topic:
          type: string
          example: spBv1.0/#
        qos:
          type: integer
          format: int32
          example: 0
    Certificate:
      required:
        - Issuer
        - Signature Algorithm
        - Subject
        - Valid From
        - Valid To
        - Version
      type: object
      properties:
        Signature Algorithm:
          type: string
          example: SHA256withRSA
        Issuer:
          type: string
          example: >-
            CN=CLS Testing Intermediate CA, OU=Support, O=Cirrus Link Solutions,
            ST=Kansas, C=US
        Version:
          type: integer
          example: 3
        Valid To:
          type: integer
          description: Timestamp (from epoch) when the certificate stops being valid
          example: 1849826113000
        Subject:
          type: string
          example: >-
            CN=localhost, OU=Support, O=Cirrus Link Solutions, L=Spring Hill,
            ST=Kansas, C=US
        Valid From:
          type: integer
          description: Timestamp (from epoch) when the certificate starts being valid
          example: 1525826113000
    SslStatus:
      required:
        - caChainFilename
        - certificate
        - certificateFilename
        - privateKeyFilename
        - setupOn
        - sslSetup
      type: object
      properties:
        setupOn:
          type: integer
          description: Timestamp (from epoch) when SSL was configured on the server.
          example: 1628201523389
        privateKeyFilename:
          type: string
          example: localhost.key.pem
        caChainFilename:
          type: string
          example: ca-chain.cert.pem
        certificateFilename:
          type: string
          example: localhost.cert.pem
        certificate:
          $ref: '#/components/schemas/Certificate'
        sslSetup:
          type: boolean
          example: true
    SparkplugStatus:
      required:
        - deviceCount
        - edgeNodeCount
        - groupCount
        - hostCount
      type: object
      properties:
        hostCount:
          type: integer
          description: >-
            The number of Sparkplug host applications connected to the Chariot
            server
          example: 1
        groupCount:
          type: integer
          description: The number of Sparkplug groups connected to the Chariot server
          example: 5
        edgeNodeCount:
          type: integer
          description: The number of Sparkplug edge nodes connected to the Chariot server
          example: 100
        deviceCount:
          type: integer
          description: The number of Sparkplug devices connected to the Chariot server
          example: 5000
    SparkplugEdge:
      required:
        - averageCompression
        - clientId
        - edgeNodeId
        - groupId
        - ipAddress
        - lastBirthReceived
        - lastDeathReceived
        - lastSeqNumber
        - lifetimeHistoricalMetrics
        - metricsCount
        - offlineCount
        - online
        - primaryId
        - sampledCount
        - samplingCompression
        - sessionHistoricalMetrics
        - subscriptions
      type: object
      properties:
        clientId:
          type: string
          example: MT-9bca926d-379a-415f
        ipAddress:
          type: string
          example: 76.115.180.30
        online:
          type: boolean
          example: true
        offlineCount:
          type: integer
          example: 6
        lastBirthReceived:
          type: integer
          example: 1628800335767
        lastDeathReceived:
          type: integer
          example: 1628799777192
        lastSeqNumber:
          type: integer
          example: 0
        metricsCount:
          type: integer
          example: 4
        sessionHistoricalMetrics:
          type: integer
          example: 6
        lifetimeHistoricalMetrics:
          type: integer
          example: 432
        samplingCompression:
          type: boolean
          example: true
        averageCompression:
          type: number
          example: 0.76
        sampledCount:
          type: integer
          example: 14
        groupId:
          type: string
          example: G1
        edgeNodeId:
          type: string
          example: E2
        primaryId:
          type: string
          example: Host
        devices:
          type: array
          items:
            $ref: '#/components/schemas/SparkplugDevice'
    SparkplugEdgeNbirth:
      required:
        - metrics
        - seq
        - timestamp
      type: object
      properties:
        timestamp:
          type: integer
          example: 1628800335767
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/SparkplugMetric'
        seq:
          type: integer
          example: 0
    SparkplugDeviceDbirth:
      required:
        - metrics
        - seq
        - timestamp
      type: object
      properties:
        timestamp:
          type: integer
          example: 1628800335767
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/SparkplugMetric'
        seq:
          type: integer
          example: 6
    SparkplugMetric:
      required:
        - dataType
        - name
        - timestamp
        - value
      type: object
      properties:
        name:
          type: string
          example: pumpOn
        timestamp:
          type: integer
          example: 1628800335767
        dataType:
          type: string
          example: Boolean
        value:
          type: object
          properties: {}
          example: false
    SparkplugDevice:
      required:
        - deviceId
        - lastBirthReceived
        - lastDeathReceived
        - lifetimeHistoricalMetrics
        - metricsCount
        - online
        - sessionHistoricalMetrics
      type: object
      properties:
        deviceId:
          type: string
          example: D2
        online:
          type: boolean
          example: true
        lastBirthReceived:
          type: integer
          example: 1628800335767
        lastDeathReceived:
          type: integer
          example: 1628799777192
        metricsCount:
          type: integer
          example: 4
        sessionHistoricalMetrics:
          type: integer
          example: 2
        lifetimeHistoricalMetrics:
          type: integer
          example: 88
    SparkplugHost:
      required:
        - clientId
        - ipAddress
        - lastOffline
        - lastOnline
        - online
        - primaryId
      type: object
      properties:
        clientId:
          type: string
          example: ME-c403ec5f-d796-48f1
        ipAddress:
          type: string
          example: 73.190.83.40
        online:
          type: boolean
          example: true
        lastOnline:
          type: integer
          example: 1628800335767
        lastOffline:
          type: integer
          example: 1628799777192
        hostId:
          type: string
          example: Host
        stateTopic:
          type: string
          example: STATE/Host
    SparkplugConfig:
      required:
        - enabled
      type: object
      properties:
        enabled:
          type: boolean
          example: true
    SparkplugIds:
      required:
        - edgeNodeId
        - groupId
      type: object
      properties:
        groupId:
          type: string
          example: North America
        edgeNodeId:
          type: string
          example: Portland OR
    MqttCreds2Generate:
      required:
        - password
        - primaryId
        - sparkplugIds
        - username
      type: object
      properties:
        username:
          type: string
          example: admin
        password:
          type: string
          example: changeit
        primaryId:
          type: string
          example: MQTT Engine Host 1
        sparkplugIds:
          type: array
          items:
            $ref: '#/components/schemas/SparkplugIds'
  responses:
    BadRequest:
      description: bad request
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/ApiResponse'
    Forbidden:
      description: forbidden
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/ApiResponse'
    InteralServerError:
      description: internal server error
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/ApiResponse'
    MethodNotAllowed:
      description: not allowed
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/ApiResponse'
    NotFound:
      description: not found
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/ApiResponse'
    Unauthorized:
      description: not authorized
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/ApiResponse'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
    bearerAuth:
      type: apiKey
      name: Authorization
      in: header
