95 lines
2.1 KiB
YAML
95 lines
2.1 KiB
YAML
|
openapi: 3.0.0
|
||
|
info:
|
||
|
title: ModbusService
|
||
|
version: "0.1"
|
||
|
|
||
|
paths:
|
||
|
/client:
|
||
|
get:
|
||
|
tags: [ "Client" ]
|
||
|
summary: List all configured clients
|
||
|
operationId: api.listClients
|
||
|
responses:
|
||
|
'200':
|
||
|
description: All configured clients
|
||
|
content:
|
||
|
'application/json':
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
$ref: '#/components/schemas/Client'
|
||
|
post:
|
||
|
tags: [ "Client" ]
|
||
|
summary: Create a new client
|
||
|
operationId: api.createClient
|
||
|
requestBody:
|
||
|
content:
|
||
|
'application/json':
|
||
|
schema:
|
||
|
$ref: '#/components/schemas/Client'
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Client successfully created
|
||
|
/action/coil/{client}/{address}:
|
||
|
get:
|
||
|
tags: [ "Action" ]
|
||
|
summary: Return a coil of client
|
||
|
operationId: api.readCoil
|
||
|
parameters:
|
||
|
- name: client
|
||
|
in: path
|
||
|
required: true
|
||
|
schema:
|
||
|
type: string
|
||
|
- name: address
|
||
|
in: path
|
||
|
required: true
|
||
|
schema:
|
||
|
type: integer
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Status of the coil
|
||
|
content:
|
||
|
'application/json':
|
||
|
schema:
|
||
|
type: integer
|
||
|
put:
|
||
|
tags: [ "Action" ]
|
||
|
summary: Set a coil of client
|
||
|
operationId: api.writeCoil
|
||
|
parameters:
|
||
|
- name: client
|
||
|
in: path
|
||
|
required: true
|
||
|
schema:
|
||
|
type: string
|
||
|
- name: address
|
||
|
in: path
|
||
|
required: true
|
||
|
schema:
|
||
|
type: integer
|
||
|
requestBody:
|
||
|
content:
|
||
|
'application/json':
|
||
|
schema:
|
||
|
type: number
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Status of the coil
|
||
|
content:
|
||
|
'application/json':
|
||
|
schema:
|
||
|
type: number
|
||
|
|
||
|
|
||
|
components:
|
||
|
schemas:
|
||
|
Client:
|
||
|
description: Modbus Client
|
||
|
type: object
|
||
|
properties:
|
||
|
name:
|
||
|
type: string
|
||
|
address:
|
||
|
type: string
|