Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce possibility to activate/deactivate mqtt topics #134

Merged
100 changes: 98 additions & 2 deletions JSON_for_IO-Link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
- {}
- basicAuth: []
- bearerAuth: []
- oauth2: [Maintenance]

Check warning on line 72 in JSON_for_IO-Link.yaml

View workflow job for this annotation

GitHub Actions / Lint (push)

oas3-operation-security-defined

"Maintenance" must be listed among scopes.

Check warning on line 72 in JSON_for_IO-Link.yaml

View workflow job for this annotation

GitHub Actions / Lint (pull_request)

oas3-operation-security-defined

"Maintenance" must be listed among scopes.
tags:
- name: general
description: Access to general informations
Expand Down Expand Up @@ -664,6 +664,7 @@
$ref: "./schemas.yaml#/schemas/mqttConfigurationTopicGet"
example:
- topicId: 1
activate: true
topicName: Sensor34/processData
qos: 1_AT_LEAST_ONCE
deviceAlias: DT35
Expand All @@ -674,11 +675,13 @@
value: 10
unit: ms
- topicId: 2
activate: true
topicName: Sensor34/event
qos: 1_AT_LEAST_ONCE
deviceAlias: TAD081
event: {}
- topicId: 3
activate: false
topicName: PD
qos: 0_ONLY_ONCE
deviceAlias: BNI_IOL
Expand All @@ -687,6 +690,7 @@
format: iodd
onChange: true
- topicId: 4
activate: false
topicName: DT35_CycleTime
qos: 0_ONLY_ONCE
deviceAlias: DT35
Expand All @@ -696,6 +700,7 @@
format: iodd
onChange: true
- topicId: 5
activate: true
topicName: deviceTemperature
qos: 0_ONLY_ONCE
deviceAlias: master1port2
Expand All @@ -716,7 +721,7 @@
"501":
$ref: "#/components/responses/HTTP_501"
post:
operationId: PostMqttTopicsTopicId
operationId: PostMqttTopics
tags:
- mqtt
summary: Create a new MQTT topic.
Expand All @@ -730,6 +735,7 @@
examples:
Process Data:
value:
activate: true
qos: 1_AT_LEAST_ONCE
deviceAlias: DT35
processData:
Expand All @@ -740,11 +746,13 @@
unit: ms
Event:
value:
activate: true
qos: 1_AT_LEAST_ONCE
deviceAlias: TAD081
event: {}
Parameter (Index):
value:
activate: false
qos: 0_ONLY_ONCE
deviceAlias: master1port1
parameter:
Expand All @@ -755,6 +763,7 @@
unit: ms
Parameter (ParameterName):
value:
activate: true
topicName: deviceTemperature
qos: 0_ONLY_ONCE
deviceAlias: AHM36A
Expand Down Expand Up @@ -803,6 +812,7 @@
Process Data:
value:
topicId: 1
activate: true
topicName: PD input
qos: 1_AT_LEAST_ONCE
deviceAlias: DT35
Expand All @@ -815,13 +825,15 @@
Event:
value:
topicId: 2
activate: true
topicName: Event
qos: 1_AT_LEAST_ONCE
deviceAlias: TAD081
event: {}
Parameter (Index):
value:
topicId: 3
activate: true
topicName: devvice/indexXY
qos: 0_ONLY_ONCE
deviceAlias: master1port1
Expand All @@ -834,6 +846,7 @@
Parameter (ParameterName):
value:
topicId: 5
activate: true
topicName: deviceTemperature
qos: 0_ONLY_ONCE
deviceAlias: AHM36A
Expand All @@ -853,6 +866,90 @@
$ref: "#/components/responses/HTTP_500"
"501":
$ref: "#/components/responses/HTTP_501"
post:
operationId: PostMqttTopicsTopicId
parameters:
- $ref: "#/components/parameters/mqttTopicId"
tags:
- mqtt
summary: Change or deactivate one MQTT topic.
description: Change or deactivate one MQTT topic.
requestBody:
required: true
content:
application/json:
schema:
$ref: "./schemas.yaml#/schemas/mqttConfigurationTopicsTopicPost"
examples:
Deactivate Topic:
value:
activate: false
Activate Topic:
value:
activate: true
Process Data:
value:
topicId: 1
activate: true
topicName: PD input
qos: 1_AT_LEAST_ONCE
deviceAlias: DT35
processData:
direction: getData
format: iodd
interval:
value: 10
unit: ms
Event:
value:
topicId: 2
activate: true
topicName: Event
qos: 1_AT_LEAST_ONCE
deviceAlias: TAD081
event: {}
Parameter (Index):
value:
topicId: 3
topicName: devvice/indexXY
qos: 0_ONLY_ONCE
deviceAlias: master1port1
parameter:
index: 86
format: byteArray
interval:
value: 10
unit: ms
Parameter (ParameterName):
value:
topicId: 5
activate: true
topicName: deviceTemperature
qos: 0_ONLY_ONCE
deviceAlias: AHM36A
parameter:
parameterName: Temperature1
format: iodd
interval:
value: 1000
unit: ms
responses:
"200":
description: Successful operation
content:
application/json:
schema:
type: integer
"401":
$ref: "#/components/responses/HTTP_401"
"403":
$ref: "#/components/responses/HTTP_403"
"404":
$ref: "#/components/responses/HTTP_404"
"500":
$ref: "#/components/responses/HTTP_500"
"501":
$ref: "#/components/responses/HTTP_501"
delete:
operationId: DeleteMqttTopicsTopicId
tags:
Expand Down Expand Up @@ -2833,7 +2930,6 @@
minimum: 0
maximum: 255
required: true

responses:
HTTP_400:
description: Bad request
Expand Down
25 changes: 25 additions & 0 deletions schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ schemas:
- qos
- deviceAlias
properties:
activate:
type: boolean
qos:
type: string
enum:
Expand All @@ -660,6 +662,29 @@ schemas:
topicName:
type: string
- $ref: "#/schemas/mqttConfigurationTopic"
mqttConfigurationTopicsTopicPost:
anyOf:
- type: object
properties:
topicId:
type: integer
- type: object
properties:
topicName:
type: string
- $ref: "#/schemas/mqttConfigurationTopic"
example:
topicId: 1
activate: true
topicName: PD input
qos: 1_AT_LEAST_ONCE
deviceAlias: DT35
processData:
direction: getData
format: iodd
interval:
value: 10
unit: ms
mqttConfigurationTopicGet:
allOf:
- type: object
Expand Down
Loading