Загрузка данных
launchLds.yaml
asyncapi: 3.0.0
info:
title: API Gateway Websockets API for launching 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:
launchLdsRequest:
$ref: '#/components/messages/launchLdsRequest'
launchLdsReply:
$ref: '#/components/messages/launchLdsReply'
operations:
launchLds:
title: launchLdsReply
description: >
Команда позволяет запустить СОУ на выбранном ТУ. СОУ можно запустить
только на том ТУ, на котором определена актуальная конфигурация
action: send
channel:
$ref: '#/channels/ldsMain'
messages:
- $ref: '#/channels/ldsMain/messages/launchLdsRequest'
reply:
messages:
- $ref: '#/channels/ldsMain/messages/launchLdsReply'
components:
messages:
launchLdsRequest:
summary: Запрос на запуск СОУ на ТУ
payload:
$ref: '#/components/schemas/launchLdsRequest'
x-response:
$ref: '#/components/schemas/launchLdsReply'
examples:
- payload:
tuId: 1
launchLdsReply:
summary: Ответ на запрос launchLdsRequest
payload:
$ref: '#/components/schemas/launchLdsReply'
examples:
- name: Ok
payload:
replyStatus: 200
- 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: Unauthorized
payload:
replyStatus: 401
replyErrors:
- errorType: UNAUTHORIZED
reason: Неавторизованный запрос
- name: Permission denied
payload:
replyStatus: 403
replyErrors:
- errorType: PERMISSION_DENIED
reason: Недостаточно полномочий
- errorType: ALREADY_EXIST
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:
launchLdsRequest:
title: launchLdsRequest
description: ТУ, на котором нужно запустить СОУ
properties:
tuId:
$ref: '#/components/schemas/tuId'
required: [tuId]
launchLdsReply:
title: launchLdsReply
description: Ответ на запрос launchLdsRequest
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