Skip to content

Commit

Permalink
Adjust documentation for supported live message conditions
Browse files Browse the repository at this point in the history
Co-authored-by: Stanchev Aleksandar <aleksandar.stanchev@bosch.io>
Signed-off-by: David Schwilk <david.schwilk@bosch.io>
  • Loading branch information
DerSchwilk and Stanchev Aleksandar committed Oct 13, 2022
1 parent ebe8f61 commit c2c1860
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 9 deletions.
5 changes: 1 addition & 4 deletions documentation/src/main/resources/openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ To extend or update the OpenAPI of Ditto you can add or change the files in the
// go to sources
$ cd sources
// only v2
$ npm run build-v2
// both
// run build
$ npm run build
```
16 changes: 14 additions & 2 deletions documentation/src/main/resources/openapi/ditto-api-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4211,6 +4211,7 @@ paths:
- $ref: '#/components/parameters/MessageSubjectPathParam'
- $ref: '#/components/parameters/MessageTimeoutParam'
- $ref: '#/components/parameters/LiveMessageRequestedAcksParam'
- $ref: '#/components/parameters/ConditionParam'
responses:
'202':
description: The message was sent but not necessarily received by the thing (fire and forget).
Expand Down Expand Up @@ -4253,6 +4254,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AdvancedError'
'412':
$ref: '#/components/responses/PreconditionFailed'
'413':
$ref: '#/components/responses/MessageTooLarge'
'424':
Expand Down Expand Up @@ -4290,6 +4293,7 @@ paths:
- $ref: '#/components/parameters/MessageSubjectPathParam'
- $ref: '#/components/parameters/MessageTimeoutParam'
- $ref: '#/components/parameters/LiveMessageRequestedAcksParam'
- $ref: '#/components/parameters/ConditionParam'
responses:
'202':
description: The message was sent (fire and forget).
Expand Down Expand Up @@ -4332,6 +4336,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AdvancedError'
'412':
$ref: '#/components/responses/PreconditionFailed'
'413':
$ref: '#/components/responses/MessageTooLarge'
'424':
Expand Down Expand Up @@ -4371,6 +4377,7 @@ paths:
- $ref: '#/components/parameters/MessageSubjectPathParam'
- $ref: '#/components/parameters/MessageTimeoutParam'
- $ref: '#/components/parameters/LiveMessageRequestedAcksParam'
- $ref: '#/components/parameters/ConditionParam'
responses:
'202':
description: |-
Expand Down Expand Up @@ -4415,6 +4422,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AdvancedError'
'412':
$ref: '#/components/responses/PreconditionFailed'
'413':
$ref: '#/components/responses/MessageTooLarge'
'424':
Expand Down Expand Up @@ -4454,6 +4463,7 @@ paths:
- $ref: '#/components/parameters/MessageSubjectPathParam'
- $ref: '#/components/parameters/MessageTimeoutParam'
- $ref: '#/components/parameters/LiveMessageRequestedAcksParam'
- $ref: '#/components/parameters/ConditionParam'
responses:
'202':
description: The message was sent (fire and forget).
Expand Down Expand Up @@ -4496,6 +4506,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AdvancedError'
'412':
$ref: '#/components/responses/PreconditionFailed'
'413':
$ref: '#/components/responses/MessageTooLarge'
'424':
Expand Down Expand Up @@ -7179,7 +7191,7 @@ components:
name: condition
in: query
description: |-
Defines that the request should only be applied to a thing if the given condition is met. The condition can be specified using RQL syntax.
Defines that the request should only be processed if the given condition is met. The condition can be specified using RQL syntax.
#### Examples
E.g. if the temperature is not 23.9 update it to 23.9:
* ```PUT /api/2/things/{thingId}/features/temperature/properties/value?condition=ne(features/temperature/properties/value,23.9)```
Expand Down Expand Up @@ -8095,7 +8107,7 @@ components:
randomizationInterval:
type: string
default: 5m
description: 'Interval in which the announcement can be sent earlier in effort to prevent announcement peaks. If omitted, the default value will be applied. If set to minimum, no randomization will be applied.'
description: 'Interval in which the announcement can be sent earlier than the configured `beforeExpiry`. The actual point in time when the announcement will be sent is `beforeExpire` plus a randomly chosen time within the `randomizationInterval`. E.g assuming `beforeExpiry` is set to 5m and `randomizationInterval` is set to 1m, the announcements will be sent between 5 and 6 minutes before the subject expires. If omitted, the default value will be applied. If set to minimum, no randomization will be applied.'
example:
beforeExpiry: 5m
whenDeleted: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name: condition
in: query
description: >-
Defines that the request should only be applied to a thing if the given condition is met.
Defines that the request should only be processed if the given condition is met.
The condition can be specified using RQL syntax.
#### Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ post:
- $ref: '../../parameters/messageSubjectPathParam.yml'
- $ref: '../../parameters/messageTimeoutParam.yml'
- $ref: '../../parameters/liveMessageRequestedAcksParam.yml'
- $ref: '../../parameters/conditionParam.yml'
responses:
'202':
description: |-
Expand Down Expand Up @@ -84,6 +85,8 @@ post:
application/json:
schema:
$ref: '../../schemas/errors/advancedError.yml'
'412':
$ref: '../../responses/preconditionFailed.yml'
'413':
$ref: '../../responses/messageTooLarge.yml'
'424':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ post:
- $ref: '../../parameters/messageSubjectPathParam.yml'
- $ref: '../../parameters/messageTimeoutParam.yml'
- $ref: '../../parameters/liveMessageRequestedAcksParam.yml'
- $ref: '../../parameters/conditionParam.yml'
responses:
'202':
description: The message was sent (fire and forget).
Expand Down Expand Up @@ -82,6 +83,8 @@ post:
application/json:
schema:
$ref: '../../schemas/errors/advancedError.yml'
'412':
$ref: '../../responses/preconditionFailed.yml'
'413':
$ref: '../../responses/messageTooLarge.yml'
'424':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ post:
- $ref: '../../parameters/messageSubjectPathParam.yml'
- $ref: '../../parameters/messageTimeoutParam.yml'
- $ref: '../../parameters/liveMessageRequestedAcksParam.yml'
- $ref: '../../parameters/conditionParam.yml'
responses:
'202':
description: |-
Expand Down Expand Up @@ -94,6 +95,8 @@ post:
application/json:
schema:
$ref: '../../schemas/errors/advancedError.yml'
'412':
$ref: '../../responses/preconditionFailed.yml'
'413':
$ref: '../../responses/messageTooLarge.yml'
'424':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ post:
- $ref: '../../parameters/messageSubjectPathParam.yml'
- $ref: '../../parameters/messageTimeoutParam.yml'
- $ref: '../../parameters/liveMessageRequestedAcksParam.yml'
- $ref: '../../parameters/conditionParam.yml'
responses:
'202':
description: The message was sent (fire and forget).
Expand Down Expand Up @@ -80,6 +81,8 @@ post:
application/json:
schema:
$ref: '../../schemas/errors/advancedError.yml'
'412':
$ref: '../../responses/preconditionFailed.yml'
'413':
$ref: '../../responses/messageTooLarge.yml'
'424':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ It is possible to combine both headers within one request. If you use both heade

## Defining conditions

Ditto supports retrieving, modifying, and deleting things based on specific conditions of the current persisted twin state.
Conditions are not intended to be used for message dispatching.
Ditto supports retrieving, modifying, deleting and sending messages to/from things based on specific conditions of the
current persisted twin state.
For example, if you want to update the value of an attribute, but only if the current attribute value is not already 42,
you can specify a condition:

Expand Down

0 comments on commit c2c1860

Please sign in to comment.