definitions:
  Config:
    properties:
      disableWatchChanges:
        type: boolean
      services:
        additionalProperties:
          $ref: '#/definitions/ConfigService'
        type: object
      tags:
        items:
          type: string
        type: array
      timezone:
        type: string
    type: object
  ConfigService:
    additionalProperties:
      $ref: '#/definitions/ConfigServiceTask'
    type: object
  ConfigServiceTask:
    properties:
      destinations:
        additionalProperties:
          $ref: '#/definitions/ConfigServiceTaskDestination'
        type: object
      notifications:
        items:
          $ref: '#/definitions/ConfigServiceTaskNotification'
        type: array
      schedule:
        $ref: '#/definitions/ConfigServiceTaskSchedule'
      source:
        $ref: '#/definitions/ConfigServiceTaskSource'
      tags:
        items:
          type: string
        type: array
    type: object
  ConfigServiceTaskDestination:
    properties:
      driver:
        type: string
    type: object
  ConfigServiceTaskNotification:
    properties:
      driver:
        type: string
      events:
        items:
          $ref: '#/definitions/EventType'
          enum:
            - OPERATION_START
            - OPERATION_STOP
            - OPERATION_ERROR
            - SOURCE_START
            - SOURCE_STOP
            - SOURCE_ERROR
            - DESTINATION_START
            - DESTINATION_STOP
            - DESTINATION_ERROR
        type: array
      name:
        type: string
    type: object
  ConfigServiceTaskSchedule:
    properties:
      backup:
        type: string
      prune:
        type: string
    type: object
  ConfigServiceTaskSource:
    properties:
      driver:
        type: string
    type: object
  EventType:
    enum:
      - OPERATION_START
      - OPERATION_STOP
      - OPERATION_ERROR
      - SOURCE_START
      - SOURCE_STOP
      - SOURCE_ERROR
      - DESTINATION_START
      - DESTINATION_STOP
      - DESTINATION_ERROR
    type: string
    x-enum-varnames:
      - EvOperationStart
      - EvOperationStop
      - EvOperationError
      - EvSourceStart
      - EvSourceStop
      - EvSourceError
      - EvDestinationStart
      - EvDestinationStop
      - EvDestinationError
  FormattedStats:
    properties:
      snapshotsCount:
        type: integer
      totalFileCount:
        type: integer
      totalSize:
        type: integer
      totalSizeFormatted:
        type: string
    type: object
  ManagerStatus:
    properties:
      lastChangedAt:
        type: string
      tasks:
        items:
          $ref: '#/definitions/ManagerTaskItem'
        type: array
    type: object
  ManagerTaskItem:
    properties:
      isRunning:
        type: boolean
      lastEndedAt:
        type: string
      operation:
        $ref: '#/definitions/OperationType'
      serviceName:
        type: string
      startedAt:
        type: string
      taskName:
        type: string
      trigger:
        $ref: '#/definitions/TriggerType'
    type: object
  OperationType:
    enum:
      - BACKUP
      - PRUNE
      - RESTORE
      - SNAPSHOTS
      - STATS
    type: string
    x-enum-varnames:
      - OpTypeBackup
      - OpTypePrune
      - OpTypeRestore
      - OpTypeSnapshots
      - OpTypeStats
  Snapshot:
    properties:
      id:
        type: string
      paths:
        items:
          type: string
        type: array
      shortId:
        type: string
      tags:
        items:
          type: string
        type: array
      time:
        type: string
    type: object
  TriggerType:
    enum:
      - SCHEDULE
      - API
      - MANUAL
    type: string
    x-enum-varnames:
      - TSchedule
      - TApi
      - TManual
  api.GetInfoResponse:
    properties:
      configUpdatedAt:
        type: string
      startedAt:
        type: string
      taskStatusUpdatedAt:
        type: string
      version:
        type: string
    type: object
  apiu.ResultError:
    properties:
      error:
        type: string
    type: object
  apiu.ResultSuccess:
    properties:
      data:
        type: string
    type: object
  public.getPingResponse:
    properties:
      data:
        type: string
    type: object
  services.getPruneResult:
    properties:
      data:
        items:
          $ref: '#/definitions/Snapshot'
        type: array
    type: object
  services.getSnapshotsResult:
    properties:
      items:
        items:
          $ref: '#/definitions/Snapshot'
        type: array
    type: object
  services.getStatsResult:
    properties:
      data:
        $ref: '#/definitions/FormattedStats'
    type: object
  services.getStatusResult:
    properties:
      data:
        $ref: '#/definitions/ManagerStatus'
    type: object
info:
  contact: {}
  title: Strolt API.
  version: '1.0'
paths:
  /api/v1/config:
    get:
      operationId: getConfig
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/Config'
      security:
        - BasicAuth: []
      summary: Show config
  /api/v1/info:
    get:
      operationId: getInfo
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/api.GetInfoResponse'
      security:
        - BasicAuth: []
      summary: Get info
      tags:
        - info
  /api/v1/ping:
    get:
      operationId: ping
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/public.getPingResponse'
      summary: Ping
      tags:
        - public
  /api/v1/services/{serviceName}/tasks/{taskName}/backup:
    post:
      operationId: backup
      parameters:
        - description: Service name
          in: path
          name: serviceName
          required: true
          type: string
        - description: Task name
          in: path
          name: taskName
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/apiu.ResultSuccess'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/apiu.ResultError'
      security:
        - BasicAuth: []
      summary: Start backup
      tags:
        - services
  /api/v1/services/{serviceName}/tasks/{taskName}/destinations/{destinationName}/prune:
    post:
      operationId: prune
      parameters:
        - description: Service name
          in: path
          name: serviceName
          required: true
          type: string
        - description: Task name
          in: path
          name: taskName
          required: true
          type: string
        - description: Destination name
          in: path
          name: destinationName
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/services.getPruneResult'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/apiu.ResultError'
      security:
        - BasicAuth: []
      summary: Prune snapshots
      tags:
        - services
  /api/v1/services/{serviceName}/tasks/{taskName}/destinations/{destinationName}/snapshots:
    get:
      operationId: getSnapshots
      parameters:
        - description: Service name
          in: path
          name: serviceName
          required: true
          type: string
        - description: Task name
          in: path
          name: taskName
          required: true
          type: string
        - description: Destination name
          in: path
          name: destinationName
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/services.getSnapshotsResult'
        '400':
          description: Bad Request
          schema:
            $ref: '#/definitions/apiu.ResultError'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/apiu.ResultError'
      security:
        - BasicAuth: []
      summary: Get snapshots
      tags:
        - services
  /api/v1/services/{serviceName}/tasks/{taskName}/destinations/{destinationName}/snapshots/prune:
    get:
      operationId: getSnapshotsForPrune
      parameters:
        - description: Service name
          in: path
          name: serviceName
          required: true
          type: string
        - description: Task name
          in: path
          name: taskName
          required: true
          type: string
        - description: Destination name
          in: path
          name: destinationName
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/services.getPruneResult'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/apiu.ResultError'
      security:
        - BasicAuth: []
      summary: Get snapshots for prune
      tags:
        - services
  /api/v1/services/{serviceName}/tasks/{taskName}/destinations/{destinationName}/stats:
    get:
      operationId: getStats
      parameters:
        - description: Service name
          in: path
          name: serviceName
          required: true
          type: string
        - description: Task name
          in: path
          name: taskName
          required: true
          type: string
        - description: Destination name
          in: path
          name: destinationName
          required: true
          type: string
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/services.getStatsResult'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/apiu.ResultError'
      security:
        - BasicAuth: []
      summary: Get stats
      tags:
        - services
  /api/v1/services/status:
    get:
      operationId: getStatus
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/services.getStatusResult'
      security:
        - BasicAuth: []
      summary: Get services status
      tags:
        - services
  /debug:
    get:
      description: >-
        Available only if env `STROLT_LOG_LEVEL=DEBUG` or
        `STROLT_LOG_LEVEL=TRACE`
      operationId: getDebug
      responses:
        '200':
          description: OK
          schema:
            type: string
      summary: Go debug info
      tags:
        - public
  /metrics:
    get:
      operationId: getMetrics
      responses:
        '200':
          description: OK
          schema:
            type: string
      summary: Prometheus metrics
      tags:
        - public
securityDefinitions:
  BasicAuth:
    type: basic
swagger: '2.0'
