---
swagger: "2.0"
############################
# NOTE: We use github markdown syntax for formatting multi-line description fields (https://help.github.com/categories/writing-on-github/)
############################
info:
  description: |
    #### Revised: 6/15/2018
    
    ### Overview
    This API provides secure access to a SNAP-PAC-R or -S series controller's variable and I/O tags. Confidentiality for API transactions is provided by HTTPS. Authentication uses HTTP Basic Authentication with an API key. An API key ID is submitted in the Basic Authentication userid field and API key value in the password field.
    
    **For more information visit:** [developer.opto22.com](http://developer.opto22.com)
    
    ### Examples
    
    **Read an array** of all the integer32 variables defined in the PAC's strategy.
    For example, on your SNAP-PAC-R or -S series controller at IP address 1.2.3.4, you would use the URL: 
    
    ```
    https://1.2.3.4/api/v1/device/strategy/vars/int32s
    ```
    and provide appropriate authentication. The GET response will be a JSON array of name-value 
    pairs such as: 
    ```json
    [ { "nMyVeryFavoriteNumber": 22 },
      { "nWidgetsProducedToday": 22222 },
      { "DELAY_LOOP_TIME_IN_MSECS"  : 200 } ]
    ```
    **Read the engineering units** (EU) of an analog input point configured in the PAC's strategy.
    For an analog input (I/O point) named aiTemperatureInDegreesF, use 
    
    `https://1.2.3.4/api/v1/device/strategy/ios/analogInputs/aiTemperatureInDegreesF/eu`
    
    The GET response will be a single JSON name-value pair such as:
    ```json
    { "value": 72.22 }
    ```    

    ### Note on packet sizes:
    When doing POSTs or GETs, the JSON payload in the body should not exceed 3k (3072 bytes).


  version: "R1.0a"
  title: "PAC Control REST API"
  contact:
    name: "Opto 22"
    url: "http://developer.opto22.com"
    email: "developer@opto22.com"
basePath: "/api/v1"
tags:
- name: "all"
  description: "Everything available through this RESTful API related to the PAC and its strategy"
- name: "device"
  description: "PAC's type, firmware version, mac addresses, and uptime"
- name: "strategy"
  description: "Information about the currently loaded strategy"
- name: "ios"
  description: "I/O points in the strategy"
- name: "tables"
  description: "Numeric and string tables in the strategy"
- name: "vars"
  description: "Numeric and string variables in the strategy"
schemes:
- "https"
consumes:
- "application/json"
produces:
- "application/json"
paths:
  /device:
    get:
      tags:
      - "all"
      - "device"
      description: "Returns controller's type; firmware version; both mac addresses; and uptime in seconds"
      operationId: "readDeviceDetails"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/ControllerResponse"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy:
    get:
      tags:
      - "all"
      - "strategy"
      description: "Returns the name, date, time, and CRC of the strategy currently in the controller, and the number of charts currently running. Empty strings and a 0 will be returned when there is no strategy."
      operationId: "readStrategyDetails"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/StrategyResponse"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/ios/analogInputs:
    get:
      tags:
      - "all"
      - "ios"
      description: "Returns the name and engineering units (EU) for all analog input points in the strategy"
      operationId: "readAnalogInputs"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/FloatVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/ios/analogInputs/{ioName}/eu:
    get:
      tags:
      - "all"
      - "ios"
      description: "Reads the value in engineering units (EU) of the specified analog input"
      operationId: "readAnalogInputEu"
      parameters:
      - name: "ioName"
        in: "path"
        description: "Name of the analog input point to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/FloatValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/ios/analogOutputs:
    get:
      tags:
      - "all"
      - "ios"
      description: "Returns the name and engineering units (EU) for all analog output points in the strategy"
      operationId: "readAnalogOutputs"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/FloatVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/ios/analogOutputs/{ioName}/eu:
    get:
      tags:
      - "all"
      - "ios"
      description: "Reads the value in engineering units (EU) of the specified analog output"
      operationId: "readAnalogOutputEu"
      parameters:
      - name: "ioName"
        in: "path"
        description: "Name of analog output point to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/FloatValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "ios"
      description: "Sets the value of the specified analog output point"
      operationId: "writeAnalogOutputEu"
      parameters:
      - name: "ioName"
        in: "path"
        description: "Name of the analog output point to write"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: "Value to write"
        required: true
        schema:
          $ref: "#/definitions/FloatValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/ios/digitalInputs:
    get:
      tags:
      - "all"
      - "ios"
      description: "Returns the name and state (true = on, false = off) of all digital input points in the strategy. If there is no strategy in the controller, or the strategy includes no digital inputs, the returned array will be empty."
      operationId: "readDigitalInputs"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/DigitalPointStateVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/ios/digitalInputs/{ioName}/state:
    get:
      tags:
      - "all"
      - "ios"
      description: "Returns the specified digital input point's state (true = on, false = off)"
      operationId: "readDigitalInputState"
      parameters:
      - name: "ioName"
        in: "path"
        description: "Name of the digital input point to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/DigitalPointStateObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/ios/digitalOutputs:
    get:
      tags:
      - "all"
      - "ios"
      description: "Returns the name and state (true = on, false = off) of all digital output points in the strategy"
      operationId: "readDigitalOutputs"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/DigitalPointStateVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/ios/digitalOutputs/{ioName}/state:
    get:
      tags:
      - "all"
      - "ios"
      description: "Returns the specified digital output point's state (true = on, false = off)"
      operationId: "readDigitalOutputState"
      parameters:
      - name: "ioName"
        in: "path"
        description: "Name of the digit output point to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/DigitalPointStateObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "ios"
      description: "Sets the value of the specified digital output point"
      operationId: "writeDigitalOutputState"
      parameters:
      - name: "ioName"
        in: "path"
        description: "Name of the digital output point to write"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: "Value to write"
        required: true
        schema:
          $ref: "#/definitions/DigitalPointStateObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/floats:
    get:
      tags:
      - "all"
      - "tables"
      description: "Returns an array of the name and length of all the float tables in the strategy"
      operationId: "readFloatTables"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/TableDef"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/tables/floats/{tableName}:
    get:
      tags:
      - "all"
      - "tables"
      description: |
       Read table elements
       #### Examples ####
       * Read all elements in a table named ftable: https://1.2.3.4/api/v1/device/strategy/tables/floats/ftable
       * Read elements 5 and up in a table named ftable starting with index 5: https://1.2.3.4/api/v1/device/strategy/tables/floats/ftable?startIndex=5
       * Read 3 consecutive elements in a table named ftable starting with the element at index 10: https://1.2.3.4/api/v1/device/strategy/tables/floats/ftable?startIndex=10&numElements=3
      operationId: "readFloatTable"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of float table to read; starting index and number of elements may be specified (defaults to all elements)"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to read (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - name: "numElements"
        in: "query"
        description: "Number of elements to read (default is number of elements in the table minus startIndex)"
        required: false
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              type: "number"
              format: "float"
              description: "Value of the float variable"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: |
       Write table elements
       #### Examples ####
       * Write the values (1.5, 2.4, 3.5) to 3 consecutive elements in a table named ftable starting with the element at index 10:POST to https://1.2.3.4/api/v1/device/strategy/tables/floats/ftable?startIndex=10  with body of the POST request set to [ 1.5, 2.4, 3.5 ]
      operationId: "writeFloatTable"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of float table to write; starting index may be specified"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to write (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - in: "body"
        name: "floatArray"
        description: "Array of element values to write starting at startIndex"
        required: true
        schema:
          type: "array"
          items:
            type: "number"
            format: "float"
            description: "Value of the float variable"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/floats/{tableName}/{index}:
    get:
      tags:
      - "all"
      - "tables"
      description: "Read specified table element"
      operationId: "readFloatTableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of float table to read"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to read"
        required: true
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/FloatValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: "Write specified table element"
      operationId: "writeFloatTableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of float table to write"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to write"
        required: true
        type: "integer"
        format: "int32"
      - in: "body"
        name: "FloatElementObject"
        description: "Element to write starting at index"
        required: true
        schema:
          $ref: "#/definitions/FloatValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/int32s:
    get:
      tags:
      - "all"
      - "tables"
      description: "Returns an array of the name and length of all the integer32 tables in the strategy"
      operationId: "readInt32Tables"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/TableDef"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/tables/int32s/{tableName}:
    get:
      tags:
      - "all"
      - "tables"
      description: |
       "Read a range of table elements from the specified integer32 table"
        #### Examples ####
        * Read all elements in a table named itable: https://1.2.3.4/api/v1/device/strategy/tables/int32s/itable
        * Read elements 5 and up in a table named itable starting with index 5: https://1.2.3.4/api/v1/device/strategy/tables/int32s/itable?startIndex=5
        * Read 3 consecutive elements in a table named itable starting with the element at index 10: https://1.2.3.4/api/v1/device/strategy/tables/int32s/itable?startIndex=10&numElements=3
      operationId: "readInt32Table"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of integer32 table to read; starting index and number of elements may be specified (defaults to all elements)"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to read (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - name: "numElements"
        in: "query"
        description: "Number of elements to read (default is number of elements in the table minus startIndex)"
        required: false
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              type: "integer"
              format: "int32"
              description: "Value of the integer32 variable"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: |
       "Write a range of table elements"
       #### Examples ####
       * Write the values (1, 2, 3) to 3 consecutive elements in a table named itable starting with the element at index 10:POST to https://1.2.3.4/api/v1/device/strategy/tables/int32s/itable?startIndex=10  with body of the POST request set to [ 1, 2, 3 ]      
      operationId: "writeInt32Table"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of integer32 table to write; starting index may be specified"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to write (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - in: "body"
        name: "int32Array"
        description: "Array of element values to write starting at startIndex; if the list of elements is too long to fit in the specified table, extra elements will be ignored"
        required: true
        schema:
          type: "array"
          items:
            type: "integer"
            format: "int32"
            description: "Value of the integer32 variable"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/int32s/{tableName}/{index}:
    get:
      tags:
      - "all"
      - "tables"
      description: "Read specified integer32 table element"
      operationId: "readInt32TableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of the integer32 table to read"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to read"
        required: true
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/Int32ValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: "Write specified integer32 table element"
      operationId: "writeInt32TableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of the integer32 table to write"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to write"
        required: true
        type: "integer"
        format: "int32"
      - in: "body"
        name: "int32ElementObject"
        description: "Element to write at index specified"
        required: true
        schema:
          $ref: "#/definitions/Int32ValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/int64s:
    get:
      tags:
      - "all"
      - "tables"
      description: "Returns an array of the name and length of all the integer64 tables in the strategy"
      operationId: "readInt64Tables"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/TableDef"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/tables/int64s/{tableName}:
    get:
      tags:
      - "all"
      - "tables"
      description: |
       "Read a range of table elements from the specified integer64 table"
        #### Examples ####
        * Read all elements in a table named i64table: https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table
        * Read elements 5 and up in a table named i64table starting with index 5: https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table?startIndex=5
        * Read 3 consecutive elements in a table named i64table starting with the element at index 10: https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table?startIndex=10&numElements=3
      operationId: "readInt64Table"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of the integer64 table to read; starting index and number of elements may be specified (defaults to all elements)"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to read (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - name: "numElements"
        in: "query"
        description: "Number of elements to read (default is number of elements in the table minus startIndex)"
        required: false
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              type: "integer"
              format: "int64"
              description: "Value of the integer64 variable"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: |
       "Write a range of table elements"
       #### Examples ####
       * Write the values (1, 2, 3) to 3 consecutive elements in a table named i64table starting with the element at index 10:POST to https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table?startIndex=10  with body of the POST request set to [ 1, 2, 3 ]
      operationId: "writeInt64Table"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of integer64 table to write; starting index may be specified"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to write; default is 0"
        required: false
        type: "integer"
        format: "int32"
      - in: "body"
        name: "int64Array"
        description: "Array of element values to write starting at startIndex; if the array of elements is too long 
         to fit in the specified table, extra elements will be ignored"
        required: true
        schema:
          type: "array"
          items:
            type: "integer"
            format: "int64"
            description: "Value of the integer64 variable"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/int64s/{tableName}/_string:
    get:
      tags:
      - "all"
      - "tables"
      description: |
       "Read a range of table elements from the specified integer64 table"
        #### Examples ####
        * Read all elements in a table named i64table: https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table/_string
        * Read elements 5 and up in a table named i64table starting with index 5: https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table/_string?startIndex=5
        * Read 3 consecutive elements in a table named i64table starting with the element at index 10: https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table/_string?startIndex=10&numElements=3
      operationId: "readInt64TableAsString"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of the integer64 table to read; starting index and number of elements may be specified (defaults to all elements)"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to read (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - name: "numElements"
        in: "query"
        description: "Number of elements to read (default is number of elements in the table minus startIndex)"
        required: false
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              type: "string"
              description: "Value of the integer64 variable expressed as a decimal string. E.g. \"34359738367\""
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: |
       "Write a range of table elements"
       #### Examples ####
       * Write the values (1, 2, 3) to 3 consecutive elements in a table named i64table starting with the element at index 10:POST to https://1.2.3.4/api/v1/device/strategy/tables/int64s/i64table/_string?startIndex=10  with body of the POST request set to [ "1", "2", "3" ]
      operationId: "writeInt64TableAsString"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of integer64 table to write; starting index may be specified"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to write; default is 0."
        required: false
        type: "integer"
        format: "int32"
      - in: "body"
        name: "int64AsStringArray"
        description: "Array of element values to write starting at startIndex; if the array of elements is too long 
         to fit in the specified table, extra elements will be ignored"
        required: true
        schema:
          type: "array"
          items:
            type: "string"
            description: "Value of the integer64 variable expressed as a decimal string. E.g. \"34359738367\""
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/int64s/{tableName}/{index}:
    get:
      tags:
      - "all"
      - "tables"
      description: "Read specified integer64 table element"
      operationId: "readInt64TableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of integer64 table to read"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to read"
        required: true
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/Int64ValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: "Write specified integer64 table element"
      operationId: "writeInt64TableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of the integer64 table to write"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to write"
        required: true
        type: "integer"
        format: "int32"
      - in: "body"
        name: "int64ElementObject"
        description: "Element to write starting at index specified"
        required: true
        schema:
          $ref: "#/definitions/Int64ValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/int64s/{tableName}/{index}/_string:
    get:
      tags:
      - "all"
      - "tables"
      description: "Read specified integer64 table element as string"
      operationId: "readInt64TableElementAsString"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of integer64 table to read"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to read"
        required: true
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/Int64StringValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: "Write specified integer64 table element as string"
      operationId: "writeInt64TableElementAsString"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of the integer64 table to write"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to write"
        required: true
        type: "integer"
        format: "int32"
      - in: "body"
        name: "int64ElementObject"
        description: "Element to write starting at index specified"
        required: true
        schema:
          $ref: "#/definitions/Int64StringValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/strings:
    get:
      tags:
      - "all"
      - "tables"
      description: "Returns an array of the name and length of all the string tables in the strategy"
      operationId: "readStringTables"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/TableDef"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/tables/strings/{tableName}:
    get:
      tags:
      - "all"
      - "tables"
      description: |
       "Read a range of table elements from the specified string table"
        #### Examples ####
        * Read all elements in a table named strTable: https://1.2.3.4/api/v1/device/strategy/tables/strings/strTable
        * Read elements 5 and up in a table named i64table starting with index 5: https://1.2.3.4/api/v1/device/strategy/tables/strings/strTable?startIndex=5
        * Read 3 consecutive elements in a table named i64table starting with the element at index 10: https://1.2.3.4/api/v1/device/strategy/tables/strings/strTable?startIndex=10&numElements=3
      operationId: "readStringTable"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of string table to read; starting index and number of elements may be specified (defaults to all elements)"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to read (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - name: "numElements"
        in: "query"
        description: "Number of elements to read (default is number of elements in the table minus startIndex)"
        required: false
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              type: "string"
              description: "The value of a string; string width (max length) for each string table is defined in the strategy"
              maxLength: 1024
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: |
       "Write a range of table elements"
       #### Examples ####
       * Write the values ("first", "second", "third") to 3 consecutive elements in a table named strTable starting with the element at index 10:POST to https://1.2.3.4/api/v1/device/strategy/tables/strings/strtable?startIndex=10  with body of the POST request set to [ "first", "second", "third" ]
      operationId: "writeStringTable"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of string table to write; starting index may be specified"
        required: true
        type: "string"
      - name: "startIndex"
        in: "query"
        description: "Index of first element to write (default is 0)"
        required: false
        type: "integer"
        format: "int32"
      - in: "body"
        name: "stringArray"
        description: "Array of element values to write starting at startIndex; if an element value is longer than the string width, the string will be truncated to fit"
        required: true
        schema:
          type: "array"
          items:
            type: "string"
            description: "The value of a string; string width (max length) for each string variable is defined in the strategy"
            maxLength: 1024
      responses:
        200:
          description: "OK - but check details for any error messages"
          schema:
            $ref: "#/definitions/ErrorResponse200OKish"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/tables/strings/{tableName}/{index}:
    get:
      tags:
      - "all"
      - "tables"
      description: "Read specified table element"
      operationId: "readStringTableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of string table to read"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to read"
        required: true
        type: "integer"
        format: "int32"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/StringValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "tables"
      description: "Write specified table element"
      operationId: "writeStringTableElement"
      parameters:
      - name: "tableName"
        in: "path"
        description: "Name of string table to write"
        required: true
        type: "string"
      - name: "index"
        in: "path"
        description: "Index of element to write"
        required: true
        type: "integer"
        format: "int32"
      - in: "body"
        name: "stringElementObject"
        description: "Element to write starting at index"
        required: true
        schema:
          $ref: "#/definitions/StringValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/vars/downTimers:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns the name and current value of all down timers in the strategy"
      operationId: "readDownTimerVars"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/FloatVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/vars/downTimers/{downTimerName}/value:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns current value of the specified down timer"
      operationId: "readDownTimerValue"
      parameters:
      - name: "downTimerName"
        in: "path"
        description: "Name of the down timer variable to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/FloatValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/vars/floats:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns the name and value of all (single-precision) float variables in the strategy"
      operationId: "readFloatVars"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/FloatVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/vars/floats/{floatName}:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns value of the specified float variable"
      operationId: "readFloatVar"
      parameters:
      - name: "floatName"
        in: "path"
        description: "Name of float variable to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/FloatValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "vars"
      description: "Sets the value of a float variable"
      operationId: "writeFloatVar"
      parameters:
      - name: "floatName"
        in: "path"
        description: "Name of the float variable to write"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: "Value to write to the float variable"
        required: true
        schema:
          $ref: "#/definitions/FloatValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/vars/int32s:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns the name and value of all integer32 variables in the strategy"
      operationId: "readInt32Vars"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/Int32Var"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/vars/int32s/{int32Name}:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns value of the specified integer32 variable"
      operationId: "readInt32Var"
      parameters:
      - name: "int32Name"
        in: "path"
        description: "Name of integer32 variable to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/Int32ValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "vars"
      description: "Sets the value of an integer32 variable"
      operationId: "writeInt32Var"
      parameters:
      - name: "int32Name"
        in: "path"
        description: "Name of integer32 variable to write"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: "Value to write to the integer32 variable"
        required: true
        schema:
          $ref: "#/definitions/Int32ValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/vars/int64s:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns the name and value of all integer64 variables in the strategy"
      operationId: "readInt64Vars"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/Int64Var"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/vars/int64s/_string:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns the name and value as a string of all integer64 variables in the strategy"
      operationId: "readInt64VarsAsStrings"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/Int64VarAsString"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/vars/int64s/{int64Name}:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns value of the specified integer64 variable"
      operationId: "readInt64Var"
      parameters:
      - name: "int64Name"
        in: "path"
        description: "Name of integer64 variable to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/Int64ValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "vars"
      description: "Sets the value of an integer64 variable"
      operationId: "writeInt64Var"
      parameters:
      - name: "int64Name"
        in: "path"
        description: "Name of integer64 variable to write"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: "Value to write to the integer64 variable"
        required: true
        schema:
          $ref: "#/definitions/Int64ValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/vars/int64s/{int64Name}/_string:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns value of the specified integer64 variable as a string"
      operationId: "readInt64VarAsString"
      parameters:
      - name: "int64Name"
        in: "path"
        description: "Name of integer64 variable to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/Int64StringValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "vars"
      description: "Sets the value of an integer64 variable as a string"
      operationId: "writeInt64VarAsString"
      parameters:
      - name: "int64Name"
        in: "path"
        description: "Name of integer64 variable to write"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: "Value to write to the integer64 variable"
        required: true
        schema:
          $ref: "#/definitions/Int64StringValueObject"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/vars/strings:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns the name and value of all string variables in the strategy"
      operationId: "readStringVars"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/StringVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/vars/strings/{stringName}:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns value of the specified string"
      operationId: "readStringVar"
      parameters:
      - name: "stringName"
        in: "path"
        description: "Name of string variable to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/StringValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
    post:
      tags:
      - "all"
      - "vars"
      description: "Sets the value of a string variable"
      operationId: "writeStringVar"
      parameters:
      - name: "stringName"
        in: "path"
        description: "Name of string variable to write"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: "String to write. If the value is longer than the string width, the string will be truncated to fit."
        required: true
        schema:
          $ref: "#/definitions/StringValueObject"
      responses:
        200:
          description: "OK - but check details for any error messages"
          schema:
            $ref: "#/definitions/ErrorResponse200OKish"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
  /device/strategy/vars/upTimers:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns the name and current value of all up timers in the strategy"
      operationId: "readUpTimerVars"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            type: "array"
            items:
              $ref: "#/definitions/FloatVar"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
      security:
      - basicAuth: []
  /device/strategy/vars/upTimers/{upTimerName}/value:
    get:
      tags:
      - "all"
      - "vars"
      description: "Returns current value of the specified up timer"
      operationId: "readUpTimerValue"
      parameters:
      - name: "upTimerName"
        in: "path"
        description: "Name of the up timer variable to read"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/FloatValueObject"
        400:
          description: "Bad Request"
          schema:
            $ref: "#/definitions/ErrorResponse400BadAdminOrValue"
        401:
          description: "Unauthorized"
          schema:
            $ref: "#/definitions/ErrorResponse401BadKeyForBasicAuth"
        404:
          description: "Not found"
          schema:
            $ref: "#/definitions/ErrorResponse404NotFound"
      security:
      - basicAuth: []
securityDefinitions:
  basicAuth:
    description: "HTTP Basic Authentication over HTTPS"
    type: "basic"
definitions:
  ControllerResponse:
    type: "object"
    properties:
      controllerType:
        type: "string"
      firmwareVersion:
        type: "string"
      firmwareDate:
        type: "string"
      firmwareTime:
        type: "string"
      mac1:
        type: "string"
      mac2:
        type: "string"
      upTimeSeconds:
        type: "integer"
        format: "int32"
  StrategyResponse:
    type: "object"
    properties:
      strategyName:
        type: "string"
      date:
        type: "string"
      time:
        type: "string"
      crc:
        type: "string"
      runningCharts:
        type: "integer"
        format: "int32"
  DigitalPointStateVar:
    type: "object"
    properties:
      name:
        type: "string"
        description: "Name of the tag (strategy variable, i/o point, etc.)"
        maxLength: 50
      value:
        type: "boolean"
        description: "State of a digital point (true = on, false = off)"
  DigitalPointStateObject:
    type: "object"
    properties:
      value:
        type: "boolean"
        description: "State of a digital point (true = on, false = off)"
  Int32Var:
    type: "object"
    properties:
      name:
        type: "string"
        description: "Name of the tag (strategy variable, i/o point, etc.)"
        maxLength: 50
      value:
        type: "integer"
        format: "int32"
        description: "Value of the integer32 variable"
  Int32ValueObject:
    type: "object"
    properties:
      value:
        type: "integer"
        format: "int32"
        description: "Value of the integer32 variable"
  Int64Var:
    type: "object"
    properties:
      name:
        type: "string"
        description: "Name of the tag (strategy variable, i/o point, etc.)"
        maxLength: 50
      value:
        type: "integer"
        format: "int64"
        description: "Value of the integer64 variable"
  Int64VarAsString:
    type: "object"
    properties:
      name:
        type: "string"
        description: "Name of the tag (strategy variable, i/o point, etc.)"
        maxLength: 50
      value:
        type: "string"
        description: "Value of the integer64 variable expressed as a decimal string, E.g. \"34359738367\""
  Int64ValueObject:
    type: "object"
    properties:
      value:
        type: "integer"
        format: "int64"
        description: "Value of the integer64 variable"
  Int64StringValueObject:
    type: "object"
    properties:
      value:
        type: "string"
        description: "Value of the integer64 variable expressed as decimal string, e.g. \"34359738367\""
  FloatVar:
    type: "object"
    properties:
      name:
        type: "string"
        description: "Name of the tag (strategy variable, i/o point, etc.)"
        maxLength: 50
      value:
        type: "number"
        format: "float"
        description: "Value of the float variable"
  FloatValueObject:
    type: "object"
    properties:
      value:
        type: "number"
        format: "float"
        description: "Value of the float variable"
  StringVar:
    type: "object"
    properties:
      name:
        type: "string"
        description: "Name of the tag (strategy variable, i/o point, etc.)"
        maxLength: 50
      value:
        type: "string"
        description: "The value of a string; string width (max length) for each string variable is defined in the strategy"
        maxLength: 1024
  StringValueObject:
    type: "object"
    properties:
      value:
        type: "string"
        description: "The value of a string; string width (max length) for each string variable is defined in the strategy"
        maxLength: 1024
  TableDef:
    type: "object"
    properties:
      name:
        type: "string"
        description: "Name of the tag (strategy variable, i/o point, etc.)"
        maxLength: 50
      length:
        type: "integer"
        format: "int32"
        description: "Number of elements contained in this table"
  ErrorResponse200OKish:
    type: "object"
    required:
    - "errorCode"
    - "message"
    properties:
      errorCode:
        type: "integer"
        format: "int32"
        description: "Details: ** -23 ** The string you passed is longer than the width of PAC Control string variable or table element you are writing to."
      message:
        type: "string"
  ErrorResponse400BadAdminOrValue:
    type: "object"
    required:
    - "errorCode"
    - "message"
    properties:
      errorCode:
        type: "integer"
        format: "int32"
        description: "Details: ** -1 ** Invalid or no strategy. Use PAC Control to download strategy logic. ** -3 ** Buffer overrun or invalid length. The number or range of table indicies you specified exceeds elements in the PAC Control table. ** -8 ** Invalid data. Check format of data written. Compare to what's read for the same endpoint. ** -12 ** You've passed a table index that is less than zero or greater than the length of the table minus 1. ** -13 ** The value you passed to write is outside of the valid range for the PAC Control data type you're writing to. For example, if you specified the value 999999999999999 for an integer32 (since integer32 data types must be in the range: -2147483648 to 2147483647). ** -17 or -20 ** The controller is busy with another task, for example, downloading a new strategy. Try again later. ** -36 ** Endpoint is not defined. ** -109 ** Attempting to write without write permissions. Check /admin/keys settings. ** -13019 ** Invalid endpoint. Check syntax of the URL (e.g. did you use 'ev' instead of 'eu'). ** 400 ** Before using the API on this device, you must first change the default user name and password via the URL /admin/keys. Use the default User Name: 'admin' and Password: 'password' to log ininitially."
      message:
        type: "string"
  ErrorResponse401BadKeyForBasicAuth:
    type: "object"
    required:
    - "errorCode"
    - "message"
    properties:
      errorCode:
        type: "integer"
        format: "int32"
        description: "Details: ** -104 ** Invalid key ID/value in HTTP header. Before using the API on this device, you must create at least one key ID/value via the URL /admin/keys. Then use one of those in your HTTP header for Basic Authentication."
      message:
        type: "string"
  ErrorResponse404NotFound:
    type: "object"
    required:
    - "errorCode"
    - "message"
    properties:
      errorCode:
        type: "integer"
        format: "int32"
        description: "Details: ** -29 ** The tag (variable, table, timer, I/O point, etc.) you requested exists on the controller but does not match the data type for this endpoint. 
** -28 ** The tag (variable, table, timer, I/O point, etc.) does not currently exist on the controller. Check the tag name and the controller's status. ** 404 ** Endpoint does not exist. Check URL."
      message:
        type: "string"
