Загрузка данных


stopLds.yaml
asyncapi: 3.0.0
info:
  title: API Gateway Websockets API for stopping LDS on TU
  version: '1.0.0'
  description: WebSockets API for API-GW
servers:
  prod:
    host: localhost
    pathname: "/"
    protocol: https
    description: |
      Public server available without authorization.
      Once the socket is open you can get to a public channel by sending
      a get request message.
  develop:
    host: "192.168.1.1"
    pathname: "/"
    protocol: wss
    description: |
      Public server available without authorization.
      Once the socket is open you can get to a public channel by sending
      a get request message.
channels:
  ldsMain:
    address: "/hub"
    messages:
      stopLdsRequest:
        $ref: '#/components/messages/stopLdsRequest'
      stopLdsReply:
        $ref: '#/components/messages/stopLdsReply'
operations:
  stopLds:
    title: stopLdsReply
    description: Команда позволяет остановить СОУ на выбранном ТУ
    action: send
    channel:
      $ref: '#/channels/ldsMain'
    messages:
      - $ref: '#/channels/ldsMain/messages/stopLdsRequest'
    reply:
      messages:
        - $ref: '#/channels/ldsMain/messages/stopLdsReply'
components:
  messages:
    stopLdsRequest:
      summary: Запрос на остановку СОУ
      payload:
        $ref: '#/components/schemas/stopLdsRequest'
      x-response:
        $ref: '#/components/schemas/stopLdsReply'
      examples:
        - payload:
            tuId: 1
    stopLdsReply:
      summary: Ответ на запрос stopLdsRequest
      payload:
        $ref: '#/components/schemas/stopLdsReply'
      examples:
        - name: Ok
          payload:
            replyStatus: 200
        - name: Unauthorized
          payload:
            replyStatus: 401
            replyErrors:
              - errorType: UNAUTHORIZED
                reason: Неавторизованный запрос
        - name: Not found
          payload:
            replyStatus: 404
            replyErrors:
              - errorType: NOT_FOUND
                reason: ТУ с таким идентификатором не найден
                location: tuId
        - name: Precondition failed
          payload:
            replyStatus: 412
            replyErrors:
              - errorType: PRECONDITION_FAILED
                reason: "Невозможно остановить СОУ на ТУ, т.к. СОУ на данном
                         ТУ не запущена"
        - name: Permission denied
          payload:
            replyStatus: 403
            replyErrors:
              - errorType: PERMISSION_DENIED
                reason: Недостаточно полномочий
        - name: Request timeout
          payload:
            replyStatus: 408
            replyErrors:
              - errorType: REQUEST_TIMEOUT
                reason: Время ожидания ответа сервером истекло
        - name: Too many requests
          payload:
            replyStatus: 429
            replyErrors:
              - errorType: TOO_MANY_REQUESTS
                reason: Слишком много запросов
        - name: Internal server error
          payload:
            replyStatus: 500
            replyErrors:
              - errorType: INTERNAL
                reason: Иная ошибка сервера, не описанная в примерах
        - name: Not implemented
          payload:
            replyStatus: 501
            replyErrors:
              - errorType: NOT_IMPLEMENTED
                reason: Метод не поддерживается
        - name: Service unavailable
          payload:
            replyStatus: 503
            replyErrors:
              - errorType: UNAVAILABLE
                reason: Сервис временно недоступен
        - name: Gateway timeout
          payload:
            replyStatus: 504
            replyErrors:
              - errorType: DEADLINE_EXCEEDED
                reason: Превышено время ожидания от сервера
        - name: Unknown error
          payload:
            replyStatus: 520
            replyErrors:
              - errorType: UNKNOWN_ERROR
                reason: Сервер не может обработать ошибку
  schemas:
    stopLdsRequest:
      title: stopLdsRequest
      description: ТУ, на котором нужно отключить СОУ
      properties:
        tuId:
          $ref: '#/components/schemas/tuId'
      required: [tuId]
    stopLdsReply:
      title: stopLdsReply
      description: Ответ на запрос stopLdsRequest
      type: object
      properties:
        replyStatus:
          $ref: '#/components/schemas/replyStatus'
        replyErrors:
          $ref: '#/components/schemas/replyErrors'
      required: [replyStatus]
    tuId:
      title: tuId
      description: Идентификатор ТУ
      type: number
      format: int64
      examples: [ 123456 ]
    replyErrors:
      title: replyErrors
      type: array
      items:
        title: replyError
        description: Информация об ошибке.
        type: object
        properties:
          errorType:
            title: errorType
            description: Тип ошибки.
            type: string
            examples: [ALREADY_EXISTS]
          reason:
            title: reason
            description: Причина ошибки.
            type: string
            examples: [Конфигурация  с таким названием уже существует]
          location:
            title: location
            description: Место возникновения ошибки.
            type: string
            examples: [configurationName]
        required: [reason]
    replyStatus:
      title: replyStatus
      type: integer
      format: int32
      enum:
        - 200
        - 400
        - 401
        - 403
        - 404
        - 408
        - 409
        - 412
        - 416
        - 429
        - 500
        - 501
        - 503
        - 504
        - 520
      x-enumNames:
        "200": OK
        "400": Bad request
        "401": Unauthorized
        "403": Permission denied
        "404": Not found
        "408": Request timeout
        "409": Conflict
        "412": Precondition failed
        "416": Range not satisfiable
        "429": Too many requests
        "500": Internal server error
        "501": Not implemented
        "503": Service unavailable
        "504": Gateway timeout
        "520": Unknown error