Skip to content

Commit dcb6146

Browse files
authored
feat: Add DataHub interpolation variables (#1019)
1 parent e0dc3c0 commit dcb6146

File tree

2 files changed

+151
-4
lines changed

2 files changed

+151
-4
lines changed

ext/hivemq-edge-openapi-2025.9-SNAPSHOT.yaml

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ info:
1414
## OpenAPI
1515
HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages.
1616
title: HiveMQ Edge REST API
17-
version: 2025.9-SNAPSHOT
17+
version: 2025.10-SNAPSHOT
1818
x-logo:
1919
url: https://www.hivemq.com/img/svg/hivemq-bee.svg
2020
tags:
@@ -42,6 +42,8 @@ tags:
4242
name: Data Hub - FSM
4343
- description: This resource bundles endpoints for the available Functions for the HiveMQ Data Hub. Currently this is limited to getting the available Functions.
4444
name: Data Hub - Functions
45+
- description: This resource bundles endpoints for the interpolation features.
46+
name: Data Hub - Interpolation
4547
- description: |-
4648
Policies describe how you want the HiveMQ broker to validate the behavior of MQTT clients.
4749
Each policy has four sections:
@@ -1701,6 +1703,26 @@ paths:
17011703
summary: Get all functions as a JSON Schema
17021704
tags:
17031705
- Data Hub - Functions
1706+
/api/v1/data-hub/interpolation-variables:
1707+
get:
1708+
description: This endpoint provides the means to get information on the interpolation variables available for the HiveMQ Data Hub.
1709+
operationId: getVariables
1710+
responses:
1711+
'200':
1712+
content:
1713+
application/json:
1714+
schema:
1715+
$ref: '#/components/schemas/InterpolationVariableList'
1716+
description: Success
1717+
'500':
1718+
content:
1719+
application/json:
1720+
schema:
1721+
$ref: '#/components/schemas/ProblemDetails'
1722+
description: Internal server error
1723+
summary: Get all interpolation variables
1724+
tags:
1725+
- Data Hub - Interpolation
17041726
/api/v1/data-hub/function-specs:
17051727
get:
17061728
description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub.
@@ -4769,6 +4791,99 @@ components:
47694791
$ref: '#/components/schemas/DataPolicy'
47704792
Errors:
47714793
type: object
4794+
PolicyType:
4795+
description: The type of policy in Data Hub
4796+
type: string
4797+
enum:
4798+
- DATA_POLICY
4799+
- BEHAVIOR_POLICY
4800+
InterpolationVariable:
4801+
type: object
4802+
required:
4803+
- variable
4804+
- type
4805+
- description
4806+
- policyType
4807+
properties:
4808+
variable:
4809+
type: string
4810+
description: The unique variable name
4811+
type:
4812+
type: string
4813+
enum:
4814+
- string
4815+
- long
4816+
description:
4817+
type: string
4818+
description: The description of the variable name
4819+
policyType:
4820+
type: array
4821+
description: The list of policy types this variable can be used with
4822+
uniqueItems: true
4823+
items:
4824+
$ref: '#/components/schemas/PolicyType'
4825+
example:
4826+
variable: clientId
4827+
type: string
4828+
description: The MQTT client ID
4829+
policyType:
4830+
- DATA_POLICY
4831+
- BEHAVIOR_POLICY
4832+
InterpolationVariableList:
4833+
type: object
4834+
description: The list of interpolation variables that can be used in this Datahub instance
4835+
properties:
4836+
items:
4837+
type: array
4838+
items:
4839+
$ref: '#/components/schemas/InterpolationVariable'
4840+
required:
4841+
- items
4842+
example:
4843+
items:
4844+
- variable: clientId
4845+
type: string
4846+
description: The MQTT client ID.
4847+
policyType:
4848+
- BEHAVIOR_POLICY
4849+
- DATA_POLICY
4850+
- variable: topic
4851+
type: string
4852+
description: The MQTT topic to which the MQTT message was published.
4853+
policyType:
4854+
- DATA_POLICY
4855+
- variable: policyId
4856+
type: string
4857+
description: The id of the policy that is currently executed.
4858+
policyType:
4859+
- BEHAVIOR_POLICY
4860+
- DATA_POLICY
4861+
- variable: validationResult
4862+
type: string
4863+
description: A textual description of the validation result. This text can contain schema validation errors for further debugging.
4864+
policyType:
4865+
- BEHAVIOR_POLICY
4866+
- variable: fromState
4867+
type: string
4868+
description: Textual representation of the state of the state machine before the transition.
4869+
policyType:
4870+
- BEHAVIOR_POLICY
4871+
- variable: toState
4872+
type: string
4873+
description: Textual representation of the state to which the state machine transitions.
4874+
policyType:
4875+
- BEHAVIOR_POLICY
4876+
- variable: triggerEvent
4877+
type: string
4878+
description: Textual representation of the event that triggered the state machine transition.
4879+
policyType:
4880+
- BEHAVIOR_POLICY
4881+
- variable: timestamp
4882+
type: string
4883+
description: Current time in milliseconds since the UNIX epoch (Jan 1, 1970).
4884+
policyType:
4885+
- BEHAVIOR_POLICY
4886+
- DATA_POLICY
47724887
BehaviorPolicyTransitionEvent:
47734888
type: string
47744889
description: Accepted event in transition

ext/openAPI/components/schemas/InterpolationVariableList.yaml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,44 @@ example:
1111
items:
1212
- variable: clientId
1313
type: string
14-
description: The MQTT client ID
14+
description: "The MQTT client ID."
1515
policyType:
16-
- DATA_POLICY
1716
- BEHAVIOR_POLICY
17+
- DATA_POLICY
1818
- variable: topic
1919
type: string
20-
description: The MQTT topic to which the MQTT message was published xxx
20+
description: "The MQTT topic to which the MQTT message was published."
21+
policyType:
22+
- DATA_POLICY
23+
- variable: policyId
24+
type: string
25+
description: "The id of the policy that is currently executed."
26+
policyType:
27+
- BEHAVIOR_POLICY
28+
- DATA_POLICY
29+
- variable: validationResult
30+
type: string
31+
description: "A textual description of the validation result. This text can contain schema validation errors for further debugging."
32+
policyType:
33+
- BEHAVIOR_POLICY
34+
- variable: fromState
35+
type: string
36+
description: "Textual representation of the state of the state machine before the transition."
37+
policyType:
38+
- BEHAVIOR_POLICY
39+
- variable: toState
40+
type: string
41+
description: "Textual representation of the state to which the state machine transitions."
2142
policyType:
43+
- BEHAVIOR_POLICY
44+
- variable: triggerEvent
45+
type: string
46+
description: "Textual representation of the event that triggered the state machine transition."
47+
policyType:
48+
- BEHAVIOR_POLICY
49+
- variable: timestamp
50+
type: string
51+
description: "Current time in milliseconds since the UNIX epoch (Jan 1, 1970)."
52+
policyType:
53+
- BEHAVIOR_POLICY
2254
- DATA_POLICY

0 commit comments

Comments
 (0)