openapi: 3.0.1
info:
  title: Protection Settings related APIs
  description: This is the specification of Open APIs to access the OT Companion Protection data for building your own applications or integrations to IT tools
  version: '1.0'
  contact:
    name: API Support
    email: feedback.otams.si@siemens.com

paths:

  "/api/v1/settings/deviceid/{deviceId}":
    get:
      tags:
        - protection settings
      summary: Get protection settings by deviceId
      description: Get protection settings by deviceId
      operationId: getExtSettingsByDeviceId
      parameters:
        - name: deviceId
          in: path
          description: Get protection settings by deviceId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ProtectionSettingDataExt"
        '404':
          description: Protection settings not found for deviceId
        '500':
          description: Internal server error

  "/api/v1/settings/zip/deviceid/{deviceId}":
    get:
      tags:
        - protection settings
      summary: Get protection settings zip by deviceId in base64 format
      description: Get protection settings zip by deviceId in base64 format
      operationId: getProtectionSettingZipByDeviceId
      parameters:
        - name: deviceId
          in: path
          description: Get protection settings zip by deviceId in base64 format
          required: true
          schema:
            type: string
        - name: startDate
          in: query
          description: Protection settings created after start time, date format yyyy-mm-dd (for eg.- 2024-04-02)
          required: false
          schema:
            type: string
        - name: endDate
          in: query
          description: Protection settings created before end time, date format yyyy-mm-dd (for eg.- 2024-04-02)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ProtectionSettingDataExt"
        '404':
          description: Protection settings zip file not found for deviceId
        '500':
          description: Internal server error

  "/api/v1/settings/serialnumber/{serialNumber}":
    get:
      tags:
        - protection settings
      summary: Get protection settings by serialNumber
      description: Get protection settings by serialNumber
      operationId: getExtSettingsBySerialNumber
      parameters:
        - name: serialNumber
          in: path
          description: Get protection settings by serialNumber
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ProtectionSettingDataSerialNumberExt"
        '404':
          description: Protection settings not found for serialNumber
        '500':
          description: Internal server error

  "/api/v1/settings/zip/serialnumber/{serialNumber}":
    get:
      tags:
        - protection settings
      summary: Get protection settings zip by serialNumber in base64 format
      description: Get protection settings zip by serialNumber in base64 format
      operationId: getProtectionSettingZipBySerialNumber
      parameters:
        - name: serialNumber
          in: path
          description:  Get protection settings zip by serialNumber in base64 format
          required: true
          schema:
            type: string
        - name: startDate
          in: query
          description: Protection settings created after start time, date format yyyy-mm-dd (for eg.- 2024-04-02)
          required: false
          schema:
            type: string
        - name: endDate
          in: query
          description: Protection settings created before end time, date format yyyy-mm-dd (for eg.- 2024-04-02)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ProtectionSettingDataSerialNumberExt"
        '404':
          description: Protection settings zip file not found for serialNumber
        '500':
          description: Internal server error


components:
  schemas:
    ProtectionSettingDataExt:
      type: object
      properties:
        deviceId:
          type: string
        setting:
          type: array
          items:
            type: string
    ProtectionSettingDataSerialNumberExt:
      type: object
      properties:
        serialNumber:
          type: string
        setting:
          type: array
          items:
            type: string