diff --git a/paas/docs/DeviceApiControllerApi.md b/paas/docs/DeviceApiControllerApi.md deleted file mode 100644 index 278e2342..00000000 --- a/paas/docs/DeviceApiControllerApi.md +++ /dev/null @@ -1,255 +0,0 @@ -# DeviceApiControllerApi - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**getDeviceAttributes**](#getDeviceAttributes) | **GET** /api/v1/{deviceToken}/attributes | Get attributes (getDeviceAttributes) | -| [**getFirmware**](#getFirmware) | **GET** /api/v1/{deviceToken}/firmware | Get Device Firmware (getFirmware) | -| [**getSoftware**](#getSoftware) | **GET** /api/v1/{deviceToken}/software | Get Device Software (getSoftware) | -| [**postDeviceAttributes**](#postDeviceAttributes) | **POST** /api/v1/{deviceToken}/attributes | Post attributes (postDeviceAttributes) | -| [**postRpcRequest**](#postRpcRequest) | **POST** /api/v1/{deviceToken}/rpc | Send the RPC command (postRpcRequest) | -| [**postTelemetry**](#postTelemetry) | **POST** /api/v1/{deviceToken}/telemetry | Post time series data (postTelemetry) | -| [**provisionDevice**](#provisionDevice) | **POST** /api/v1/provision | Provision new device (provisionDevice) | -| [**replyToCommand**](#replyToCommand) | **POST** /api/v1/{deviceToken}/rpc/{requestId} | Reply to RPC commands (replyToCommand) | -| [**saveClaimingInfo**](#saveClaimingInfo) | **POST** /api/v1/{deviceToken}/claim | Save claiming information (saveClaimingInfo) | -| [**subscribeToAttributes**](#subscribeToAttributes) | **GET** /api/v1/{deviceToken}/attributes/updates | Subscribe to attribute updates (subscribeToAttributes) (Deprecated) | -| [**subscribeToCommands**](#subscribeToCommands) | **GET** /api/v1/{deviceToken}/rpc | Subscribe to RPC commands (subscribeToCommands) (Deprecated) | - - - -## getDeviceAttributes - -> String getDeviceAttributes(deviceToken, clientKeys, sharedKeys) - -Get attributes (getDeviceAttributes) - -Returns all attributes that belong to device. Use optional 'clientKeys' and/or 'sharedKeys' parameter to return specific attributes. Example of the result: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **clientKeys** | **String** | Comma separated key names for attribute with client scope | | -| **sharedKeys** | **String** | Comma separated key names for attribute with shared scope | | - -### Return type - -**String** - - -## getFirmware - -> String getFirmware(deviceToken, title, version, size, chunk) - -Get Device Firmware (getFirmware) - -Downloads the current firmware package.When the platform initiates firmware update, it informs the device by updating the 'fw_title', 'fw_version', 'fw_checksum' and 'fw_checksum_algorithm' shared attributes.The 'fw_title' and 'fw_version' parameters must be supplied in this request to double-check that the firmware that device is downloading matches the firmware it expects to download. This is important, since the administrator may change the firmware assignment while device is downloading the firmware. Optional 'chunk' and 'size' parameters may be used to download the firmware in chunks. For example, device may request first 16 KB of firmware using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **title** | **String** | Title of the firmware, corresponds to the value of 'fw_title' attribute. | | -| **version** | **String** | Version of the firmware, corresponds to the value of 'fw_version' attribute. | | -| **size** | **Integer** | Size of the chunk. Optional. Omit to download the entire file without chunks. | [optional] [default to 0] | -| **chunk** | **Integer** | Index of the chunk. Optional. Omit to download the entire file without chunks. | [optional] [default to 0] | - -### Return type - -**String** - - -## getSoftware - -> String getSoftware(deviceToken, title, version, size, chunk) - -Get Device Software (getSoftware) - -Downloads the current software package.When the platform initiates software update, it informs the device by updating the 'sw_title', 'sw_version', 'sw_checksum' and 'sw_checksum_algorithm' shared attributes.The 'sw_title' and 'sw_version' parameters must be supplied in this request to double-check that the software that device is downloading matches the software it expects to download. This is important, since the administrator may change the software assignment while device is downloading the software. Optional 'chunk' and 'size' parameters may be used to download the software in chunks. For example, device may request first 16 KB of software using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **title** | **String** | Title of the software, corresponds to the value of 'sw_title' attribute. | | -| **version** | **String** | Version of the software, corresponds to the value of 'sw_version' attribute. | | -| **size** | **Integer** | Size of the chunk. Optional. Omit to download the entire file without using chunks. | [optional] [default to 0] | -| **chunk** | **Integer** | Index of the chunk. Optional. Omit to download the entire file without using chunks. | [optional] [default to 0] | - -### Return type - -**String** - - -## postDeviceAttributes - -> String postDeviceAttributes(deviceToken, body) - -Post attributes (postDeviceAttributes) - -Post client attribute updates on behalf of device. Example of the request: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **body** | **String** | JSON with attribute key-value pairs. See API call description for example. | | - -### Return type - -**String** - - -## postRpcRequest - -> String postRpcRequest(deviceToken, body) - -Send the RPC command (postRpcRequest) - -Send the RPC request to server. The request payload is a JSON document that contains 'method' and 'params'. For example: ```json {\"method\": \"sumOnServer\", \"params\":{\"a\":2, \"b\":2}} ``` The response contains arbitrary JSON with the RPC reply. For example: ```json {\"result\": 4} ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **body** | **String** | The RPC request JSON | | - -### Return type - -**String** - - -## postTelemetry - -> String postTelemetry(deviceToken, body) - -Post time series data (postTelemetry) - -Post time series data on behalf of device. Example of the request: The request payload is a JSON document with three possible formats: Simple format without timestamp. In such a case, current server time will be used: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` Single JSON object with timestamp: ```json {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}} ``` JSON array with timestamps: ```json [ {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}} ] ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **body** | **String** | | | - -### Return type - -**String** - - -## provisionDevice - -> String provisionDevice(body) - -Provision new device (provisionDevice) - -Exchange the provision request to the device credentials. See more info about provisioning in the corresponding 'Device provisioning' platform documentation.Requires valid JSON request with the following format: ```json { \"deviceName\": \"NEW_DEVICE_NAME\", \"provisionDeviceKey\": \"u7piawkboq8v32dmcmpp\", \"provisionDeviceSecret\": \"jpmwdn8ptlswmf4m29bw\" } ``` Where 'deviceName' is the name of enw or existing device which depends on the provisioning strategy. The 'provisionDeviceKey' and 'provisionDeviceSecret' matches info configured in one of the existing device profiles. The result of the successful call is the JSON object that contains new credentials: ```json { \"credentialsType\":\"ACCESS_TOKEN\", \"credentialsValue\":\"DEVICE_ACCESS_TOKEN\", \"status\":\"SUCCESS\" } ``` - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **body** | **String** | JSON with provision request. See API call description for example. | | - -### Return type - -**String** - - -## replyToCommand - -> String replyToCommand(deviceToken, requestId, body) - -Reply to RPC commands (replyToCommand) - -Replies to server originated RPC command identified by 'requestId' parameter. The response is arbitrary JSON. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **requestId** | **String** | RPC request id from the incoming RPC request | | -| **body** | **String** | Reply to the RPC request, JSON. For example: {\"status\":\"success\"} | | - -### Return type - -**String** - - -## saveClaimingInfo - -> String saveClaimingInfo(deviceToken, body) - -Save claiming information (saveClaimingInfo) - -Saves the information required for user to claim the device. See more info about claiming in the corresponding 'Claiming devices' platform documentation. Example of the request payload: ```json {\"secretKey\":\"value\", \"durationMs\":60000} ``` Note: both 'secretKey' and 'durationMs' is optional parameters. In case the secretKey is not specified, the empty string as a default value is used. In case the durationMs is not specified, the system parameter device.claim.duration is used. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **body** | **String** | | [optional] | - -### Return type - -**String** - - -## subscribeToAttributes - -> String subscribeToAttributes(deviceToken, timeout) - -Subscribe to attribute updates (subscribeToAttributes) (Deprecated) - -Subscribes to client and shared scope attribute updates using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **timeout** | **Long** | Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. | [optional] [default to 0] | - -### Return type - -**String** - - -## subscribeToCommands - -> String subscribeToCommands(deviceToken, timeout) - -Subscribe to RPC commands (subscribeToCommands) (Deprecated) - -Subscribes to RPC commands using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **deviceToken** | **String** | Your device access token. | | -| **timeout** | **Long** | Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. | [optional] [default to 0] | - -### Return type - -**String** - diff --git a/paas/docs/FeaturesInfo.md b/paas/docs/FeaturesInfo.md index 106d56cb..ecc24058 100644 --- a/paas/docs/FeaturesInfo.md +++ b/paas/docs/FeaturesInfo.md @@ -9,10 +9,10 @@ |------------ | ------------- | ------------- | -------------| | **smsEnabled** | **Boolean** | | [optional] | | **oauthEnabled** | **Boolean** | | [optional] | -| **notificationEnabled** | **Boolean** | | [optional] | | **whiteLabelingEnabled** | **Boolean** | | [optional] | | **twoFaEnabled** | **Boolean** | | [optional] | | **emailEnabled** | **Boolean** | | [optional] | +| **notificationEnabled** | **Boolean** | | [optional] | diff --git a/paas/docs/ReportTemplateConfig.md b/paas/docs/ReportTemplateConfig.md index 0c4cda14..53571dfc 100644 --- a/paas/docs/ReportTemplateConfig.md +++ b/paas/docs/ReportTemplateConfig.md @@ -8,11 +8,11 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| | **format** | **TbReportFormat** | Report format | | +| **entityAliases** | **List\** | | [optional] | | **filters** | **List\** | | [optional] | | **namePattern** | **String** | | [optional] | | **components** | **List\** | | [optional] | | **timeDataPattern** | **String** | | [optional] | -| **entityAliases** | **List\** | | [optional] | diff --git a/paas/docs/ReportTimeSeriesChartSettings.md b/paas/docs/ReportTimeSeriesChartSettings.md index 7b9dcfc9..939a0353 100644 --- a/paas/docs/ReportTimeSeriesChartSettings.md +++ b/paas/docs/ReportTimeSeriesChartSettings.md @@ -23,8 +23,8 @@ | **legendLabelColor** | **String** | | [optional] | | **legendValueFont** | **Font** | | [optional] | | **legendValueColor** | **String** | | [optional] | -| **yaxes** | **Map\** | | [optional] | | **xaxis** | **TimeSeriesChartXAxisSettings** | | [optional] | +| **yaxes** | **Map\** | | [optional] | | **thresholds** | **List\** | | [optional] | | **grid** | **TimeSeriesChartGridSettings** | | [optional] | | **yAxes** | **Map\** | | [optional] | diff --git a/paas/docs/TsKvEntry.md b/paas/docs/TsKvEntry.md index 89ae6c19..65631283 100644 --- a/paas/docs/TsKvEntry.md +++ b/paas/docs/TsKvEntry.md @@ -10,13 +10,13 @@ | **ts** | **Long** | | [optional] | | **value** | **Object** | | [optional] | | **key** | **String** | | [optional] | -| **doubleValue** | **Double** | | [optional] | -| **longValue** | **Long** | | [optional] | | **booleanValue** | **Boolean** | | [optional] | | **valueAsString** | **String** | | [optional] | | **dataType** | **DataType** | | [optional] | | **jsonValue** | **String** | | [optional] | | **strValue** | **String** | | [optional] | +| **longValue** | **Long** | | [optional] | +| **doubleValue** | **Double** | | [optional] | | **version** | **Long** | | [optional] | diff --git a/paas/spec/openapi.json b/paas/spec/openapi.json index 9e714d18..d5aa08a3 100644 --- a/paas/spec/openapi.json +++ b/paas/spec/openapi.json @@ -117,10 +117,6 @@ "name": "dashboard-report-controller", "description": "Dashboard Report Controller" }, - { - "name": "device-api-controller", - "description": "Device Api Controller" - }, { "name": "device-connectivity-controller", "description": "Device Connectivity Controller" @@ -9922,7 +9918,7 @@ "api-key-controller" ], "summary": "Save API key for user (saveApiKey)", - "description": "Creates an API key for the given user and returns the token ONCE as 'ApiKey \u003Cvalue\u003E'.\n\nAvailable for any authorized user. ", + "description": "Creates an API key for the given user and returns the token ONCE as 'ApiKey '.\n\nAvailable for any authorized user. ", "operationId": "saveApiKey", "requestBody": { "content": { @@ -36098,190 +36094,19 @@ ] } }, - "/api/v1/provision": { - "post": { - "tags": [ - "device-api-controller" - ], - "summary": "Provision new device (provisionDevice)", - "description": "Exchange the provision request to the device credentials. See more info about provisioning in the corresponding 'Device provisioning' platform documentation.Requires valid JSON request with the following format: \n\n```json\n{\n \"deviceName\": \"NEW_DEVICE_NAME\",\n \"provisionDeviceKey\": \"u7piawkboq8v32dmcmpp\",\n \"provisionDeviceSecret\": \"jpmwdn8ptlswmf4m29bw\"\n}\n```\n\nWhere 'deviceName' is the name of enw or existing device which depends on the provisioning strategy. The 'provisionDeviceKey' and 'provisionDeviceSecret' matches info configured in one of the existing device profiles. The result of the successful call is the JSON object that contains new credentials:\n\n```json\n{\n \"credentialsType\":\"ACCESS_TOKEN\",\n \"credentialsValue\":\"DEVICE_ACCESS_TOKEN\",\n \"status\":\"SUCCESS\"\n}\n```\n\n", - "operationId": "provisionDevice", - "requestBody": { - "description": "JSON with provision request. See API call description for example.", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid request body", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - } - } - }, - "/api/v1/{deviceToken}/attributes": { + "/api/device-connectivity/gateway-launch/{deviceId}/docker-compose/download": { "get": { "tags": [ - "device-api-controller" + "device-connectivity-controller" ], - "summary": "Get attributes (getDeviceAttributes)", - "description": "Returns all attributes that belong to device. Use optional 'clientKeys' and/or 'sharedKeys' parameter to return specific attributes. \n Example of the result: \n\n```json\n{\n \"stringKey\":\"value1\", \n \"booleanKey\":true, \n \"doubleKey\":42.0, \n \"longKey\":73, \n \"jsonKey\": {\n \"someNumber\": 42,\n \"someArray\": [1,2,3],\n \"someNestedObject\": {\"key\": \"value\"}\n }\n}\n```\n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "getDeviceAttributes", + "summary": "Download generated docker-compose.yml file for gateway (downloadGatewayDockerCompose)", + "description": "Download generated docker-compose.yml for gateway.", + "operationId": "downloadGatewayDockerCompose", "parameters": [ { - "name": "deviceToken", + "name": "deviceId", "in": "path", - "description": "Your device access token.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "clientKeys", - "in": "query", - "description": "Comma separated key names for attribute with client scope", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "sharedKeys", - "in": "query", - "description": "Comma separated key names for attribute with shared scope", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -36292,9 +36117,10 @@ "200": { "description": "OK", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "type": "string" + "type": "string", + "format": "binary" } } } @@ -36419,44 +36245,57 @@ } } } - } - }, - "post": { + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/device-connectivity/{deviceId}": { + "get": { "tags": [ - "device-api-controller" + "device-connectivity-controller" ], - "summary": "Post attributes (postDeviceAttributes)", - "description": "Post client attribute updates on behalf of device. \n Example of the request: \n\n```json\n{\n \"stringKey\":\"value1\", \n \"booleanKey\":true, \n \"doubleKey\":42.0, \n \"longKey\":73, \n \"jsonKey\": {\n \"someNumber\": 42,\n \"someArray\": [1,2,3],\n \"someNestedObject\": {\"key\": \"value\"}\n }\n}\n```\n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "postDeviceAttributes", + "summary": "Get commands to publish device telemetry (getDevicePublishTelemetryCommands)", + "description": "Fetch the list of commands to publish device telemetry based on device profile If the user has the authority of 'Tenant Administrator', the server checks that the device is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the device is assigned to the same customer. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDevicePublishTelemetryCommands", "parameters": [ { - "name": "deviceToken", + "name": "deviceId", "in": "path", - "description": "Your device access token.", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "description": "JSON with attribute key-value pairs. See API call description for example.", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/JsonNode" + }, + "examples": { + "http": { + "description": "http", + "value": "curl -v -X POST http://localhost:8080/api/v1/0ySs4FTOn5WU15XLmal8/telemetry --header Content-Type:application/json --data {temperature:25}" + }, + "mqtt": { + "description": "mqtt", + "value": "mosquitto_pub -d -q 1 -h localhost -t v1/devices/me/telemetry -i myClient1 -u myUsername1 -P myPassword -m {temperature:25}" + }, + "coap": { + "description": "coap", + "value": "coap-client -m POST coap://localhost:5683/api/v1/0ySs4FTOn5WU15XLmal8/telemetry -t json -e {temperature:25}" + } } } } @@ -36472,7 +36311,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -36581,46 +36420,44 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/v1/{deviceToken}/attributes/updates": { + "/api/device-connectivity/{protocol}/certificate/download": { "get": { "tags": [ - "device-api-controller" + "device-connectivity-controller" ], - "summary": "Subscribe to attribute updates (subscribeToAttributes) (Deprecated)", - "description": "Subscribes to client and shared scope attribute updates using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. \n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "subscribeToAttributes", + "summary": "Download server certificate using file path defined in device.connectivity properties (downloadServerCertificate)", + "description": "Download server certificate.", + "operationId": "downloadServerCertificate", "parameters": [ { - "name": "deviceToken", + "name": "protocol", "in": "path", - "description": "Your device access token.", + "description": "A string value representing the device connectivity protocol. Possible values: 'mqtt', 'mqtts', 'http', 'https', 'coap', 'coaps'", "required": true, "schema": { "type": "string" } - }, - { - "name": "timeout", - "in": "query", - "description": "Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side.", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } } ], "responses": { "200": { "description": "OK", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "type": "string" + "type": "string", + "format": "binary" } } } @@ -36745,33 +36582,49 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/v1/{deviceToken}/claim": { + "/api/customer/device/{deviceName}/claim": { "post": { "tags": [ - "device-api-controller" + "device-controller" ], - "summary": "Save claiming information (saveClaimingInfo)", - "description": "Saves the information required for user to claim the device. See more info about claiming in the corresponding 'Claiming devices' platform documentation.\n Example of the request payload: \n\n```json\n{\"secretKey\":\"value\", \"durationMs\":60000}\n```\n\nNote: both 'secretKey' and 'durationMs' is optional parameters. In case the secretKey is not specified, the empty string as a default value is used. In case the durationMs is not specified, the system parameter device.claim.duration is used.\n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "saveClaimingInfo", + "summary": "Claim device (claimDevice)", + "description": "Claiming makes it possible to assign a device to the specific customer using device/server side claiming data (in the form of secret key).To make this happen you have to provide unique device name and optional claiming data (it is needed only for device-side claiming).Once device is claimed, the customer becomes its owner and customer users may access device data as well as control the device. \nIn order to enable claiming devices feature a system parameter security.claim.allowClaimingByDefault should be set to true, otherwise a server-side claimingAllowed attribute with the value true is obligatory for provisioned devices. \nSee official documentation for more details regarding claiming.\n\nAvailable for users with 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'CLAIM_DEVICES' permission for the entity (entities).", + "operationId": "claimDevice", "parameters": [ { - "name": "deviceToken", + "name": "deviceName", "in": "path", - "description": "Your device access token.", + "description": "Unique name of the device which is going to be claimed", "required": true, "schema": { "type": "string" } + }, + { + "name": "subCustomerId", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], "requestBody": { "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ClaimRequest" } } } @@ -36907,66 +36760,32 @@ } } } - } - } - }, - "/api/v1/{deviceToken}/firmware": { - "get": { + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + }, + "delete": { "tags": [ - "device-api-controller" + "device-controller" ], - "summary": "Get Device Firmware (getFirmware)", - "description": "Downloads the current firmware package.When the platform initiates firmware update, it informs the device by updating the 'fw_title', 'fw_version', 'fw_checksum' and 'fw_checksum_algorithm' shared attributes.The 'fw_title' and 'fw_version' parameters must be supplied in this request to double-check that the firmware that device is downloading matches the firmware it expects to download. This is important, since the administrator may change the firmware assignment while device is downloading the firmware. \n\nOptional 'chunk' and 'size' parameters may be used to download the firmware in chunks. For example, device may request first 16 KB of firmware using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. \n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "getFirmware", + "summary": "Reclaim device (reClaimDevice)", + "description": "Reclaiming means the device will be unassigned from the customer and the device will be available for claiming again.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'CLAIM_DEVICES' permission for the entity (entities).", + "operationId": "reClaimDevice", "parameters": [ { - "name": "deviceToken", + "name": "deviceName", "in": "path", - "description": "Your device access token.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "title", - "in": "query", - "description": "Title of the firmware, corresponds to the value of 'fw_title' attribute.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "version", - "in": "query", - "description": "Version of the firmware, corresponds to the value of 'fw_version' attribute.", + "description": "Unique name of the device which is going to be reclaimed", "required": true, "schema": { "type": "string" } - }, - { - "name": "size", - "in": "query", - "description": "Size of the chunk. Optional. Omit to download the entire file without chunks.", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "chunk", - "in": "query", - "description": "Index of the chunk. Optional. Omit to download the entire file without chunks.", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } } ], "responses": { @@ -37100,36 +36919,118 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/v1/{deviceToken}/rpc": { + "/api/customer/{customerId}/deviceInfos": { "get": { "tags": [ - "device-api-controller" + "device-controller" ], - "summary": "Subscribe to RPC commands (subscribeToCommands) (Deprecated)", - "description": "Subscribes to RPC commands using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. \n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "subscribeToCommands", + "summary": "Get Customer Device Infos (getCustomerDeviceInfos)", + "description": "Returns a page of device info objects owned by the specified customer. Device Info is an extension of the default Device object that contains information about the owner name. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getCustomerDeviceInfos", "parameters": [ { - "name": "deviceToken", + "name": "customerId", "in": "path", - "description": "Your device access token.", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "timeout", + "name": "pageSize", "in": "query", - "description": "Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side.", - "required": false, + "description": "Maximum amount of entities in a one page", + "required": true, "schema": { "type": "integer", - "format": "int64", - "default": 0 + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "includeCustomers", + "in": "query", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "active", + "in": "query", + "description": "A boolean value representing the device active flag.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the device name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "deviceProfileName", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -37139,7 +37040,7 @@ "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/PageDataDeviceInfo" } } } @@ -37264,64 +37165,134 @@ } } } - } - }, - "post": { + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/customer/{customerId}/devices": { + "get": { "tags": [ - "device-api-controller" + "device-controller" ], - "summary": "Send the RPC command (postRpcRequest)", - "description": "Send the RPC request to server. The request payload is a JSON document that contains 'method' and 'params'. For example:\n\n```json\n{\"method\": \"sumOnServer\", \"params\":{\"a\":2, \"b\":2}}\n```\n\nThe response contains arbitrary JSON with the RPC reply. For example: \n\n```json\n{\"result\": 4}\n```\n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "postRpcRequest", + "summary": "Get Customer Devices (getCustomerDevices)", + "description": "Returns a page of devices objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getCustomerDevices", "parameters": [ { - "name": "deviceToken", + "name": "customerId", "in": "path", - "description": "Your device access token.", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "description": "The RPC request JSON", - "content": { - "application/json": { - "schema": { - "type": "string" - } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "Device type as the name of the device profile", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the device name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "deviceProfileName", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { - "description": "RPC request to server was sent to Rule Engine.", + "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/PageDataDevice" } } } }, "400": { - "description": "Invalid structure of the request.", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "413": { - "description": "Request payload too large.", + "description": "Bad Request", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } } } } @@ -37422,43 +37393,92 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/v1/{deviceToken}/rpc/{requestId}": { + "/api/device": { "post": { "tags": [ - "device-api-controller" + "device-controller" ], - "summary": "Reply to RPC commands (replyToCommand)", - "description": "Replies to server originated RPC command identified by 'requestId' parameter. The response is arbitrary JSON.\n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "replyToCommand", + "summary": "Create Or Update Device (saveDevice)", + "description": "Create or update the Device. When creating device, platform generates Device Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). Device credentials are also generated if not provided in the 'accessToken' request parameter. The newly created device id will be present in the response. Specify existing Device id to update the device. Referencing non-existing device Id will cause 'Not Found' error.\n\nDevice name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the device names and non-unique 'label' field for user-friendly visualization purposes.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Device entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "saveDevice", "parameters": [ { - "name": "deviceToken", - "in": "path", - "description": "Your device access token.", - "required": true, + "name": "accessToken", + "in": "query", + "description": "Optional value of the device credentials to be used during device creation. If omitted, access token will be auto-generated.", + "required": false, "schema": { "type": "string" } }, { - "name": "requestId", - "in": "path", - "description": "RPC request id from the incoming RPC request", - "required": true, + "name": "entityGroupId", + "in": "query", + "required": false, "schema": { "type": "string" } + }, + { + "name": "entityGroupIds", + "in": "query", + "description": "A list of entity group ids, separated by comma ','", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "nameConflictPolicy", + "in": "query", + "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", + "required": false, + "schema": { + "$ref": "#/components/schemas/NameConflictPolicy", + "default": "FAIL" + } + }, + { + "name": "uniquifySeparator", + "in": "query", + "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", + "required": false, + "schema": { + "type": "string", + "default": "_" + } + }, + { + "name": "uniquifyStrategy", + "in": "query", + "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", + "required": false, + "schema": { + "$ref": "#/components/schemas/UniquifyStrategy", + "default": "RANDOM" + } } ], "requestBody": { - "description": "Reply to the RPC request, JSON. For example: {\"status\":\"success\"}", + "description": "A JSON value representing the device.", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Device" } } }, @@ -37466,31 +37486,35 @@ }, "responses": { "200": { - "description": "RPC reply to command request was sent to Core.", + "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Device" } } } }, "400": { - "description": "Invalid structure of the request.", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "413": { - "description": "Request payload is too large.", + "description": "Bad Request", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } } } } @@ -37591,75 +37615,94 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/v1/{deviceToken}/software": { - "get": { + "/api/device-with-credentials": { + "post": { "tags": [ - "device-api-controller" + "device-controller" ], - "summary": "Get Device Software (getSoftware)", - "description": "Downloads the current software package.When the platform initiates software update, it informs the device by updating the 'sw_title', 'sw_version', 'sw_checksum' and 'sw_checksum_algorithm' shared attributes.The 'sw_title' and 'sw_version' parameters must be supplied in this request to double-check that the software that device is downloading matches the software it expects to download. This is important, since the administrator may change the software assignment while device is downloading the software. \n\nOptional 'chunk' and 'size' parameters may be used to download the software in chunks. For example, device may request first 16 KB of software using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. \n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "getSoftware", + "summary": "Create Device (saveDevice) with credentials ", + "description": "Create or update the Device. When creating device, platform generates Device Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). Requires to provide the Device Credentials object as well as an existing device profile ID or use \"default\".\nYou may find the example of device with different type of credentials below: \n\n- Credentials type: \"Access token\" with device profile ID below: \n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_AccessToken\",\n \"label\":\"Label_DeviceWithCredantial_AccessToken\",\n \"deviceProfileId\":{\n \"id\":\"5636aba0-1022-11ee-9631-51fb57f69174\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"ACCESS_TOKEN\",\n \"credentialsId\": \"6hmxew8pmmzng4e3une2\"\n }\n}\n```\n\n- Credentials type: \"Access token\" with device profile default below: \n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_AccessToken_Default\",\n \"label\":\"Label_DeviceWithCredantial_AccessToken_Default\",\n \"type\": \"default\"\n },\n \"credentials\": {\n \"credentialsType\": \"ACCESS_TOKEN\",\n \"credentialsId\": \"6hmxew8pmmzng4e3une3\"\n }\n}\n```\n\n- Credentials type: \"X509\" with device profile ID below: \n\nNote: credentialsId - format Sha3Hash, certificateValue - format PEM (with \"--BEGIN CERTIFICATE----\" and -\"----END CERTIFICATE-\").\n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_X509_Certificate\",\n \"label\":\"Label_DeviceWithCredantial_X509_Certificate\",\n \"deviceProfileId\":{\n \"id\":\"9d9588c0-06c9-11ee-b618-19be30fdeb60\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"X509_CERTIFICATE\",\n \"credentialsId\": \"84f5911765abba1f96bf4165604e9e90338fc6214081a8e623b6ff9669aedb27\",\n \"credentialsValue\": \"-----BEGIN CERTIFICATE----- MIICMTCCAdegAwIBAgIUI9dBuwN6pTtK6uZ03rkiCwV4wEYwCgYIKoZIzj0EAwIwbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlQ2VydGlmaWNhdGVAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MB4XDTIzMDMyOTE0NTYxN1oXDTI0MDMyODE0NTYxN1owbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlQ2VydGlmaWNhdGVAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9Zo791qKQiGNBm11r4ZGxh+w+ossZL3xc46ufq5QckQHP7zkD2XDAcmP5GvdkM1sBFN9AWaCkQfNnWmfERsOOKNTMFEwHQYDVR0OBBYEFFFc5uyCyglQoZiKhzXzMcQ3BKORMB8GA1UdIwQYMBaAFFFc5uyCyglQoZiKhzXzMcQ3BKORMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIhANbA9CuhoOifZMMmqkpuld+65CR+ItKdXeRAhLMZuccuAiB0FSQB34zMutXrZj1g8Gl5OkE7YryFHbei1z0SveHR8g== -----END CERTIFICATE-----\"\n }\n}\n```\n\n- Credentials type: \"MQTT_BASIC\" with device profile ID below: \n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_MQTT_Basic\",\n \"label\":\"Label_DeviceWithCredantial_MQTT_Basic\",\n \"deviceProfileId\":{\n \"id\":\"9d9588c0-06c9-11ee-b618-19be30fdeb60\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"MQTT_BASIC\",\n \"credentialsValue\": \"{\\\"clientId\\\":\\\"5euh5nzm34bjjh1efmlt\\\",\\\"userName\\\":\\\"onasd1lgwasmjl7v2v7h\\\",\\\"password\\\":\\\"b9xtm4ny8kt9zewaga5o\\\"}\"\n }\n}\n```\n\n- You may find the example of LwM2M device and RPK credentials below: \n\nNote: LwM2M device - only existing device profile ID (Transport configuration -> Transport type: \"LWM2M\".\n\n```json\n{\n \"device\": {\n \"name\":\"Name_LwRpk00000000\",\n \"label\":\"Label_LwRpk00000000\",\n \"deviceProfileId\":{\n \"id\":\"a660bd50-10ef-11ee-8737-b5634e73c779\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"LWM2M_CREDENTIALS\",\n \"credentialsId\": \"LwRpk00000000\",\n \"credentialsValue\":\n \"{\\\"client\\\":{ \\\"endpoint\\\":\\\"LwRpk00000000\\\", \\\"securityConfigClientMode\\\":\\\"RPK\\\", \\\"key\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\" }, \\\"bootstrap\\\":{ \\\"bootstrapServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}, \\\"lwm2mServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}} }\"\n }\n}\n```\n\nRemove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Device entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "saveDeviceWithCredentials", "parameters": [ { - "name": "deviceToken", - "in": "path", - "description": "Your device access token.", - "required": true, + "name": "entityGroupId", + "in": "query", + "required": false, "schema": { "type": "string" } }, { - "name": "title", + "name": "entityGroupIds", "in": "query", - "description": "Title of the software, corresponds to the value of 'sw_title' attribute.", - "required": true, + "description": "A list of entity group ids, separated by comma ','", + "required": false, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } }, { - "name": "version", + "name": "nameConflictPolicy", "in": "query", - "description": "Version of the software, corresponds to the value of 'sw_version' attribute.", - "required": true, + "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", + "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/NameConflictPolicy", + "default": "FAIL" } }, { - "name": "size", + "name": "uniquifySeparator", "in": "query", - "description": "Size of the chunk. Optional. Omit to download the entire file without using chunks.", + "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", "required": false, "schema": { - "type": "integer", - "format": "int32", - "default": 0 + "type": "string", + "default": "_" } }, { - "name": "chunk", + "name": "uniquifyStrategy", "in": "query", - "description": "Index of the chunk. Optional. Omit to download the entire file without using chunks.", + "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", "required": false, "schema": { - "type": "integer", - "format": "int32", - "default": 0 + "$ref": "#/components/schemas/UniquifyStrategy", + "default": "RANDOM" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SaveDeviceWithCredentialsRequest" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Device" } } } @@ -37675,7 +37718,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -37784,33 +37827,30 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/v1/{deviceToken}/telemetry": { + "/api/device/bulk_import": { "post": { "tags": [ - "device-api-controller" - ], - "summary": "Post time series data (postTelemetry)", - "description": "Post time series data on behalf of device. \n Example of the request: The request payload is a JSON document with three possible formats:\n\nSimple format without timestamp. In such a case, current server time will be used: \n\n\n\n```json\n{\n \"stringKey\":\"value1\", \n \"booleanKey\":true, \n \"doubleKey\":42.0, \n \"longKey\":73, \n \"jsonKey\": {\n \"someNumber\": 42,\n \"someArray\": [1,2,3],\n \"someNestedObject\": {\"key\": \"value\"}\n }\n}\n```\n\n\n\n Single JSON object with timestamp: \n\n\n\n```json\n{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}\n```\n\n\n\n JSON array with timestamps: \n\n\n\n```json\n[\n{\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, \n{\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}}\n]\n```\n\nThe API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead).\n", - "operationId": "postTelemetry", - "parameters": [ - { - "name": "deviceToken", - "in": "path", - "description": "Your device access token.", - "required": true, - "schema": { - "type": "string" - } - } + "device-controller" ], + "summary": "Import the bulk of devices (processDevicesBulkImport)", + "description": "There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "processDevicesBulkImport", "requestBody": { "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/BulkImportRequest" } } }, @@ -37822,7 +37862,7 @@ "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/BulkImportResultDevice" } } } @@ -37947,36 +37987,42 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/device-connectivity/gateway-launch/{deviceId}/docker-compose/download": { - "get": { + "/api/device/credentials": { + "post": { "tags": [ - "device-connectivity-controller" + "device-controller" ], - "summary": "Download generated docker-compose.yml file for gateway (downloadGatewayDockerCompose)", - "description": "Download generated docker-compose.yml for gateway.", - "operationId": "downloadGatewayDockerCompose", - "parameters": [ - { - "name": "deviceId", - "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Update device credentials (updateDeviceCredentials)", + "description": "During device creation, platform generates random 'ACCESS_TOKEN' credentials.\nUse this method to update the device credentials. First use 'getDeviceCredentialsByDeviceId' to get the credentials id and value.\nThen use current method to update the credentials type and value. It is not possible to create multiple device credentials for the same device.\nThe structure of device credentials id and value is simple for the 'ACCESS_TOKEN' but is much more complex for the 'MQTT_BASIC' or 'LWM2M_CREDENTIALS'.\nYou may find the example of device with different type of credentials below: \n\n- Credentials type: \"Access token\" with device ID and with device ID below: \n\n```json\n{\n \"id\": {\n \"id\":\"c886a090-168d-11ee-87c9-6f157dbc816a\"\n },\n \"deviceId\": {\n \"id\":\"c5fb3ac0-168d-11ee-87c9-6f157dbc816a\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"ACCESS_TOKEN\",\n \"credentialsId\": \"6hmxew8pmmzng4e3une4\"\n}\n```\n\n- Credentials type: \"X509\" with device profile ID below: \n\nNote: credentialsId - format Sha3Hash, certificateValue - format PEM (with \"--BEGIN CERTIFICATE----\" and -\"----END CERTIFICATE-\").\n\n```json\n{\n \"id\": {\n \"id\":\"309bd9c0-14f4-11ee-9fc9-d9b7463abb63\"\n },\n \"deviceId\": {\n \"id\":\"3092b200-14f4-11ee-9fc9-d9b7463abb63\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"X509_CERTIFICATE\",\n \"credentialsId\": \"6b8adb49015500e51a527acd332b51684ab9b49b4ade03a9582a44c455e2e9b6\",\n \"credentialsValue\": \"-----BEGIN CERTIFICATE----- MIICMTCCAdegAwIBAgIUUEKxS9hTz4l+oLUMF0LV6TC/gCIwCgYIKoZIzj0EAwIwbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlUHJvZmlsZUNlcnRAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MB4XDTIzMDMyOTE0NTczNloXDTI0MDMyODE0NTczNlowbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlUHJvZmlsZUNlcnRAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECMlWO72krDoUL9FQjUmSCetkhaEGJUfQkdSfkLSNa0GyAEIMbfmzI4zITeapunu4rGet3EMyLydQzuQanBicp6NTMFEwHQYDVR0OBBYEFHpZ78tPnztNii4Da/yCw6mhEIL3MB8GA1UdIwQYMBaAFHpZ78tPnztNii4Da/yCw6mhEIL3MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIgJ7qyMFqNcwSYkH6o+UlQXzLWfwZbNjVk+aR7foAZNGsCIQDsd7v3WQIGHiArfZeDs1DLEDuV/2h6L+ZNoGNhEKL+1A== -----END CERTIFICATE-----\"\n}\n```\n\n- Credentials type: \"MQTT_BASIC\" with device profile ID below: \n\n```json\n{\n \"id\": {\n \"id\":\"d877ffb0-14f5-11ee-9fc9-d9b7463abb63\"\n },\n \"deviceId\": {\n \"id\":\"d875dcd0-14f5-11ee-9fc9-d9b7463abb63\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"MQTT_BASIC\",\n \"credentialsValue\": \"{\\\"clientId\\\":\\\"juy03yv4owqxcmqhqtvk\\\",\\\"userName\\\":\\\"ov19fxca0cyjn7lm7w7u\\\",\\\"password\\\":\\\"twy94he114dfi9usyk1o\\\"}\"\n}\n```\n\n- You may find the example of LwM2M device and RPK credentials below: \n\nNote: LwM2M device - only existing device profile ID (Transport configuration -> Transport type: \"LWM2M\".\n\n```json\n{\n \"id\": {\n \"id\":\"e238d4d0-1689-11ee-98c6-1713c1be5a8e\"\n },\n \"deviceId\": {\n \"id\":\"e232e160-1689-11ee-98c6-1713c1be5a8e\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"LWM2M_CREDENTIALS\",\n \"credentialsId\": \"LwRpk00000000\",\n \"credentialsValue\":\n \"{\\\"client\\\":{ \\\"endpoint\\\":\\\"LwRpk00000000\\\", \\\"securityConfigClientMode\\\":\\\"RPK\\\", \\\"key\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdvBZZ2vQRK9wgDhctj6B1c7bxR3Z0wYg1+YdoYFnVUKWb+rIfTTyYK9tmQJx5Vlb5fxdLnVv1RJOPiwsLIQbAA==\\\" }, \\\"bootstrap\\\":{ \\\"bootstrapServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}, \\\"lwm2mServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}} }\"\n}\n```\n\nUpdate to real value:\n - 'id' (this is id of Device Credentials -> \"Get Device Credentials (getDeviceCredentialsByDeviceId)\",\n - 'deviceId.id' (this is id of Device).\nRemove 'tenantId' and optionally 'customerId' from the request body example (below) to create new Device entity.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "updateDeviceCredentials", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceCredentials" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/DeviceCredentials" } } } @@ -37992,7 +38038,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -38112,14 +38158,14 @@ ] } }, - "/api/device-connectivity/{deviceId}": { + "/api/device/info/{deviceId}": { "get": { "tags": [ - "device-connectivity-controller" + "device-controller" ], - "summary": "Get commands to publish device telemetry (getDevicePublishTelemetryCommands)", - "description": "Fetch the list of commands to publish device telemetry based on device profile If the user has the authority of 'Tenant Administrator', the server checks that the device is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the device is assigned to the same customer. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDevicePublishTelemetryCommands", + "summary": "Get Device (getDeviceInfoById)", + "description": "Fetch the Device info object based on the provided Device Id. Device Info is an extension of the default Device object that contains information about the owner name. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getDeviceInfoById", "parameters": [ { "name": "deviceId", @@ -38137,21 +38183,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JsonNode" - }, - "examples": { - "http": { - "description": "http", - "value": "curl -v -X POST http://localhost:8080/api/v1/0ySs4FTOn5WU15XLmal8/telemetry --header Content-Type:application/json --data {temperature:25}" - }, - "mqtt": { - "description": "mqtt", - "value": "mosquitto_pub -d -q 1 -h localhost -t v1/devices/me/telemetry -i myClient1 -u myUsername1 -P myPassword -m {temperature:25}" - }, - "coap": { - "description": "coap", - "value": "coap-client -m POST coap://localhost:5683/api/v1/0ySs4FTOn5WU15XLmal8/telemetry -t json -e {temperature:25}" - } + "$ref": "#/components/schemas/DeviceInfo" } } } @@ -38287,33 +38319,24 @@ ] } }, - "/api/device-connectivity/{protocol}/certificate/download": { + "/api/device/types": { "get": { "tags": [ - "device-connectivity-controller" - ], - "summary": "Download server certificate using file path defined in device.connectivity properties (downloadServerCertificate)", - "description": "Download server certificate.", - "operationId": "downloadServerCertificate", - "parameters": [ - { - "name": "protocol", - "in": "path", - "description": "A string value representing the device connectivity protocol. Possible values: 'mqtt', 'mqtts', 'http', 'https', 'coap', 'coaps'", - "required": true, - "schema": { - "type": "string" - } - } + "device-controller" ], + "summary": "Get Device Types (getDeviceTypes)", + "description": "Deprecated. See 'getDeviceProfileNames' API from Device Profile Controller instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDeviceTypes", "responses": { "200": { "description": "OK", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntitySubtype" + } } } } @@ -38439,6 +38462,7 @@ } } }, + "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -38449,49 +38473,32 @@ ] } }, - "/api/customer/device/{deviceName}/claim": { - "post": { + "/api/device/{deviceId}": { + "get": { "tags": [ "device-controller" ], - "summary": "Claim device (claimDevice)", - "description": "Claiming makes it possible to assign a device to the specific customer using device/server side claiming data (in the form of secret key).To make this happen you have to provide unique device name and optional claiming data (it is needed only for device-side claiming).Once device is claimed, the customer becomes its owner and customer users may access device data as well as control the device. \nIn order to enable claiming devices feature a system parameter security.claim.allowClaimingByDefault should be set to true, otherwise a server-side claimingAllowed attribute with the value true is obligatory for provisioned devices. \nSee official documentation for more details regarding claiming.\n\nAvailable for users with 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'CLAIM_DEVICES' permission for the entity (entities).", - "operationId": "claimDevice", + "summary": "Get Device (getDeviceById)", + "description": "Fetch the Device object based on the provided Device Id. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getDeviceById", "parameters": [ { - "name": "deviceName", + "name": "deviceId", "in": "path", - "description": "Unique name of the device which is going to be claimed", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - }, - { - "name": "subCustomerId", - "in": "query", - "required": false, - "schema": { - "type": "string" - } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ClaimRequest" - } - } - } - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Device" } } } @@ -38507,7 +38514,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -38630,14 +38637,14 @@ "tags": [ "device-controller" ], - "summary": "Reclaim device (reClaimDevice)", - "description": "Reclaiming means the device will be unassigned from the customer and the device will be available for claiming again.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'CLAIM_DEVICES' permission for the entity (entities).", - "operationId": "reClaimDevice", + "summary": "Delete device (deleteDevice)", + "description": "Deletes the device, it's credentials and all the relations (from and to the device). Referencing non-existing device Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "deleteDevice", "parameters": [ { - "name": "deviceName", + "name": "deviceId", "in": "path", - "description": "Unique name of the device which is going to be reclaimed", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -38646,14 +38653,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -38786,108 +38786,23 @@ ] } }, - "/api/customer/{customerId}/deviceInfos": { + "/api/device/{deviceId}/credentials": { "get": { "tags": [ "device-controller" ], - "summary": "Get Customer Device Infos (getCustomerDeviceInfos)", - "description": "Returns a page of device info objects owned by the specified customer. Device Info is an extension of the default Device object that contains information about the owner name. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getCustomerDeviceInfos", + "summary": "Get Device Credentials (getDeviceCredentialsByDeviceId)", + "description": "If during device creation there wasn't specified any credentials, platform generates random 'ACCESS_TOKEN' credentials.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ_CREDENTIALS' permission for the entity (entities).", + "operationId": "getDeviceCredentialsByDeviceId", "parameters": [ { - "name": "customerId", + "name": "deviceId", "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "includeCustomers", - "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "deviceProfileId", - "in": "query", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": false, "schema": { "type": "string" } - }, - { - "name": "active", - "in": "query", - "description": "A boolean value representing the device active flag.", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the device name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "deviceProfileName", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -38896,7 +38811,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDeviceInfo" + "$ref": "#/components/schemas/DeviceCredentials" } } } @@ -39032,24 +38947,15 @@ ] } }, - "/api/customer/{customerId}/devices": { + "/api/deviceInfos/all": { "get": { "tags": [ "device-controller" ], - "summary": "Get Customer Devices (getCustomerDevices)", - "description": "Returns a page of devices objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getCustomerDevices", + "summary": "Get All Device Infos for current user (getAllDeviceInfos)", + "description": "Returns a page of device info objects owned by the tenant or the customer of a current user. Device Info is an extension of the default Device object that contains information about the owner name. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getAllDeviceInfos", "parameters": [ - { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "pageSize", "in": "query", @@ -39071,14 +38977,32 @@ } }, { - "name": "type", + "name": "includeCustomers", "in": "query", - "description": "Device type as the name of the device profile", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "deviceProfileId", + "in": "query", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": false, "schema": { "type": "string" } }, + { + "name": "active", + "in": "query", + "description": "A boolean value representing the device active flag.", + "required": false, + "schema": { + "type": "boolean" + } + }, { "name": "textSearch", "in": "query", @@ -39124,7 +39048,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDevice" + "$ref": "#/components/schemas/PageDataDeviceInfo" } } } @@ -39260,93 +39184,38 @@ ] } }, - "/api/device": { - "post": { + "/api/devices": { + "get": { "tags": [ "device-controller" ], - "summary": "Create Or Update Device (saveDevice)", - "description": "Create or update the Device. When creating device, platform generates Device Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). Device credentials are also generated if not provided in the 'accessToken' request parameter. The newly created device id will be present in the response. Specify existing Device id to update the device. Referencing non-existing device Id will cause 'Not Found' error.\n\nDevice name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the device names and non-unique 'label' field for user-friendly visualization purposes.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Device entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "saveDevice", + "summary": "Get Devices By Ids (getDevicesByIds)", + "description": "Requested devices must be owned by tenant or assigned to customer which user is performing the request. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getDevicesByIds", "parameters": [ { - "name": "accessToken", - "in": "query", - "description": "Optional value of the device credentials to be used during device creation. If omitted, access token will be auto-generated.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "entityGroupId", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "entityGroupIds", + "name": "deviceIds", "in": "query", - "description": "A list of entity group ids, separated by comma ','", - "required": false, + "description": "A list of devices ids, separated by comma ','", + "required": true, "schema": { "type": "array", "items": { "type": "string" } } - }, - { - "name": "nameConflictPolicy", - "in": "query", - "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", - "required": false, - "schema": { - "$ref": "#/components/schemas/NameConflictPolicy", - "default": "FAIL" - } - }, - { - "name": "uniquifySeparator", - "in": "query", - "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", - "required": false, - "schema": { - "type": "string", - "default": "_" - } - }, - { - "name": "uniquifyStrategy", - "in": "query", - "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", - "required": false, - "schema": { - "$ref": "#/components/schemas/UniquifyStrategy", - "default": "RANDOM" - } } ], - "requestBody": { - "description": "A JSON value representing the device.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Device" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Device" + "type": "array", + "items": { + "$ref": "#/components/schemas/Device" + } } } } @@ -39362,7 +39231,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -39480,73 +39349,19 @@ "ApiKeyForm": [] } ] - } - }, - "/api/device-with-credentials": { + }, "post": { "tags": [ "device-controller" ], - "summary": "Create Device (saveDevice) with credentials ", - "description": "Create or update the Device. When creating device, platform generates Device Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). Requires to provide the Device Credentials object as well as an existing device profile ID or use \"default\".\nYou may find the example of device with different type of credentials below: \n\n- Credentials type: \u003Cb\u003E\"Access token\"\u003C/b\u003E with \u003Cb\u003Edevice profile ID\u003C/b\u003E below: \n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_AccessToken\",\n \"label\":\"Label_DeviceWithCredantial_AccessToken\",\n \"deviceProfileId\":{\n \"id\":\"5636aba0-1022-11ee-9631-51fb57f69174\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"ACCESS_TOKEN\",\n \"credentialsId\": \"6hmxew8pmmzng4e3une2\"\n }\n}\n```\n\n- Credentials type: \u003Cb\u003E\"Access token\"\u003C/b\u003E with \u003Cb\u003Edevice profile default\u003C/b\u003E below: \n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_AccessToken_Default\",\n \"label\":\"Label_DeviceWithCredantial_AccessToken_Default\",\n \"type\": \"default\"\n },\n \"credentials\": {\n \"credentialsType\": \"ACCESS_TOKEN\",\n \"credentialsId\": \"6hmxew8pmmzng4e3une3\"\n }\n}\n```\n\n- Credentials type: \u003Cb\u003E\"X509\"\u003C/b\u003E with \u003Cb\u003Edevice profile ID\u003C/b\u003E below: \n\nNote: \u003Cb\u003EcredentialsId\u003C/b\u003E - format \u003Cb\u003ESha3Hash\u003C/b\u003E, \u003Cb\u003EcertificateValue\u003C/b\u003E - format \u003Cb\u003EPEM\u003C/b\u003E (with \"--BEGIN CERTIFICATE----\" and -\"----END CERTIFICATE-\").\n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_X509_Certificate\",\n \"label\":\"Label_DeviceWithCredantial_X509_Certificate\",\n \"deviceProfileId\":{\n \"id\":\"9d9588c0-06c9-11ee-b618-19be30fdeb60\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"X509_CERTIFICATE\",\n \"credentialsId\": \"84f5911765abba1f96bf4165604e9e90338fc6214081a8e623b6ff9669aedb27\",\n \"credentialsValue\": \"-----BEGIN CERTIFICATE----- MIICMTCCAdegAwIBAgIUI9dBuwN6pTtK6uZ03rkiCwV4wEYwCgYIKoZIzj0EAwIwbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlQ2VydGlmaWNhdGVAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MB4XDTIzMDMyOTE0NTYxN1oXDTI0MDMyODE0NTYxN1owbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlQ2VydGlmaWNhdGVAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9Zo791qKQiGNBm11r4ZGxh+w+ossZL3xc46ufq5QckQHP7zkD2XDAcmP5GvdkM1sBFN9AWaCkQfNnWmfERsOOKNTMFEwHQYDVR0OBBYEFFFc5uyCyglQoZiKhzXzMcQ3BKORMB8GA1UdIwQYMBaAFFFc5uyCyglQoZiKhzXzMcQ3BKORMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIhANbA9CuhoOifZMMmqkpuld+65CR+ItKdXeRAhLMZuccuAiB0FSQB34zMutXrZj1g8Gl5OkE7YryFHbei1z0SveHR8g== -----END CERTIFICATE-----\"\n }\n}\n```\n\n- Credentials type: \u003Cb\u003E\"MQTT_BASIC\"\u003C/b\u003E with \u003Cb\u003Edevice profile ID\u003C/b\u003E below: \n\n```json\n{\n \"device\": {\n \"name\":\"Name_DeviceWithCredantial_MQTT_Basic\",\n \"label\":\"Label_DeviceWithCredantial_MQTT_Basic\",\n \"deviceProfileId\":{\n \"id\":\"9d9588c0-06c9-11ee-b618-19be30fdeb60\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"MQTT_BASIC\",\n \"credentialsValue\": \"{\\\"clientId\\\":\\\"5euh5nzm34bjjh1efmlt\\\",\\\"userName\\\":\\\"onasd1lgwasmjl7v2v7h\\\",\\\"password\\\":\\\"b9xtm4ny8kt9zewaga5o\\\"}\"\n }\n}\n```\n\n- You may find the example of \u003Cb\u003ELwM2M\u003C/b\u003E device and \u003Cb\u003ERPK\u003C/b\u003E credentials below: \n\nNote: LwM2M device - only existing device profile ID (Transport configuration -\u003E Transport type: \"LWM2M\".\n\n```json\n{\n \"device\": {\n \"name\":\"Name_LwRpk00000000\",\n \"label\":\"Label_LwRpk00000000\",\n \"deviceProfileId\":{\n \"id\":\"a660bd50-10ef-11ee-8737-b5634e73c779\",\n \"entityType\":\"DEVICE_PROFILE\"\n }\n },\n \"credentials\": {\n \"credentialsType\": \"LWM2M_CREDENTIALS\",\n \"credentialsId\": \"LwRpk00000000\",\n \"credentialsValue\":\n \"{\\\"client\\\":{ \\\"endpoint\\\":\\\"LwRpk00000000\\\", \\\"securityConfigClientMode\\\":\\\"RPK\\\", \\\"key\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\" }, \\\"bootstrap\\\":{ \\\"bootstrapServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}, \\\"lwm2mServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}} }\"\n }\n}\n```\n\nRemove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Device entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "saveDeviceWithCredentials", - "parameters": [ - { - "name": "entityGroupId", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "entityGroupIds", - "in": "query", - "description": "A list of entity group ids, separated by comma ','", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "nameConflictPolicy", - "in": "query", - "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", - "required": false, - "schema": { - "$ref": "#/components/schemas/NameConflictPolicy", - "default": "FAIL" - } - }, - { - "name": "uniquifySeparator", - "in": "query", - "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", - "required": false, - "schema": { - "type": "string", - "default": "_" - } - }, - { - "name": "uniquifyStrategy", - "in": "query", - "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", - "required": false, - "schema": { - "$ref": "#/components/schemas/UniquifyStrategy", - "default": "RANDOM" - } - } - ], + "summary": "Find related devices (findDevicesByQuery)", + "description": "Returns all devices that are related to the specific entity. The entity id, relation type, device types, depth of the search, and other query parameters defined using complex 'DeviceSearchQuery' object. See 'Model' tab of the Parameters for more info.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "findDevicesByQuery", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SaveDeviceWithCredentialsRequest" + "$ref": "#/components/schemas/DeviceSearchQuery" } } }, @@ -39558,7 +39373,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Device" + "type": "array", + "items": { + "$ref": "#/components/schemas/Device" + } } } } @@ -39694,31 +39512,46 @@ ] } }, - "/api/device/bulk_import": { - "post": { + "/api/devices/count/{otaPackageType}/{deviceProfileId}": { + "get": { "tags": [ "device-controller" ], - "summary": "Import the bulk of devices (processDevicesBulkImport)", - "description": "There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "processDevicesBulkImport", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BulkImportRequest" - } + "summary": "Count devices by device profile (countByDeviceProfileAndEmptyOtaPackage)", + "description": "The platform gives an ability to load OTA (over-the-air) packages to devices. It can be done in two different ways: device scope or device profile scope.In the response you will find the number of devices with specified device profile, but without previously defined device scope OTA package. It can be useful when you want to define number of devices that will be affected with future OTA package\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "countByDeviceProfileAndEmptyOtaPackage", + "parameters": [ + { + "name": "otaPackageType", + "in": "path", + "description": "OTA package type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "FIRMWARE", + "SOFTWARE" + ] } }, - "required": true - }, + { + "name": "deviceProfileId", + "in": "path", + "description": "Device Profile Id. I.g. '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BulkImportResultDevice" + "type": "integer", + "format": "int64" } } } @@ -39734,7 +39567,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -39854,31 +39687,53 @@ ] } }, - "/api/device/credentials": { - "post": { + "/api/devices/count/{otaPackageType}/{otaPackageId}/{entityGroupId}": { + "get": { "tags": [ "device-controller" ], - "summary": "Update device credentials (updateDeviceCredentials)", - "description": "During device creation, platform generates random 'ACCESS_TOKEN' credentials.\nUse this method to update the device credentials. First use 'getDeviceCredentialsByDeviceId' to get the credentials id and value.\nThen use current method to update the credentials type and value. It is not possible to create multiple device credentials for the same device.\nThe structure of device credentials id and value is simple for the 'ACCESS_TOKEN' but is much more complex for the 'MQTT_BASIC' or 'LWM2M_CREDENTIALS'.\nYou may find the example of device with different type of credentials below: \n\n- Credentials type: \u003Cb\u003E\"Access token\"\u003C/b\u003E with \u003Cb\u003Edevice ID\u003C/b\u003E and with \u003Cb\u003Edevice ID\u003C/b\u003E below: \n\n```json\n{\n \"id\": {\n \"id\":\"c886a090-168d-11ee-87c9-6f157dbc816a\"\n },\n \"deviceId\": {\n \"id\":\"c5fb3ac0-168d-11ee-87c9-6f157dbc816a\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"ACCESS_TOKEN\",\n \"credentialsId\": \"6hmxew8pmmzng4e3une4\"\n}\n```\n\n- Credentials type: \u003Cb\u003E\"X509\"\u003C/b\u003E with \u003Cb\u003Edevice profile ID\u003C/b\u003E below: \n\nNote: \u003Cb\u003EcredentialsId\u003C/b\u003E - format \u003Cb\u003ESha3Hash\u003C/b\u003E, \u003Cb\u003EcertificateValue\u003C/b\u003E - format \u003Cb\u003EPEM\u003C/b\u003E (with \"--BEGIN CERTIFICATE----\" and -\"----END CERTIFICATE-\").\n\n```json\n{\n \"id\": {\n \"id\":\"309bd9c0-14f4-11ee-9fc9-d9b7463abb63\"\n },\n \"deviceId\": {\n \"id\":\"3092b200-14f4-11ee-9fc9-d9b7463abb63\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"X509_CERTIFICATE\",\n \"credentialsId\": \"6b8adb49015500e51a527acd332b51684ab9b49b4ade03a9582a44c455e2e9b6\",\n \"credentialsValue\": \"-----BEGIN CERTIFICATE----- MIICMTCCAdegAwIBAgIUUEKxS9hTz4l+oLUMF0LV6TC/gCIwCgYIKoZIzj0EAwIwbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlUHJvZmlsZUNlcnRAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MB4XDTIzMDMyOTE0NTczNloXDTI0MDMyODE0NTczNlowbjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCE5ldyBZb3JrMRowGAYDVQQKDBFUaGluZ3NCb2FyZCwgSW5jLjEwMC4GA1UEAwwnZGV2aWNlUHJvZmlsZUNlcnRAWDUwOVByb3Zpc2lvblN0cmF0ZWd5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECMlWO72krDoUL9FQjUmSCetkhaEGJUfQkdSfkLSNa0GyAEIMbfmzI4zITeapunu4rGet3EMyLydQzuQanBicp6NTMFEwHQYDVR0OBBYEFHpZ78tPnztNii4Da/yCw6mhEIL3MB8GA1UdIwQYMBaAFHpZ78tPnztNii4Da/yCw6mhEIL3MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIgJ7qyMFqNcwSYkH6o+UlQXzLWfwZbNjVk+aR7foAZNGsCIQDsd7v3WQIGHiArfZeDs1DLEDuV/2h6L+ZNoGNhEKL+1A== -----END CERTIFICATE-----\"\n}\n```\n\n- Credentials type: \u003Cb\u003E\"MQTT_BASIC\"\u003C/b\u003E with \u003Cb\u003Edevice profile ID\u003C/b\u003E below: \n\n```json\n{\n \"id\": {\n \"id\":\"d877ffb0-14f5-11ee-9fc9-d9b7463abb63\"\n },\n \"deviceId\": {\n \"id\":\"d875dcd0-14f5-11ee-9fc9-d9b7463abb63\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"MQTT_BASIC\",\n \"credentialsValue\": \"{\\\"clientId\\\":\\\"juy03yv4owqxcmqhqtvk\\\",\\\"userName\\\":\\\"ov19fxca0cyjn7lm7w7u\\\",\\\"password\\\":\\\"twy94he114dfi9usyk1o\\\"}\"\n}\n```\n\n- You may find the example of \u003Cb\u003ELwM2M\u003C/b\u003E device and \u003Cb\u003ERPK\u003C/b\u003E credentials below: \n\nNote: LwM2M device - only existing device profile ID (Transport configuration -\u003E Transport type: \"LWM2M\".\n\n```json\n{\n \"id\": {\n \"id\":\"e238d4d0-1689-11ee-98c6-1713c1be5a8e\"\n },\n \"deviceId\": {\n \"id\":\"e232e160-1689-11ee-98c6-1713c1be5a8e\",\n \"entityType\":\"DEVICE\"\n },\n \"credentialsType\": \"LWM2M_CREDENTIALS\",\n \"credentialsId\": \"LwRpk00000000\",\n \"credentialsValue\":\n \"{\\\"client\\\":{ \\\"endpoint\\\":\\\"LwRpk00000000\\\", \\\"securityConfigClientMode\\\":\\\"RPK\\\", \\\"key\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdvBZZ2vQRK9wgDhctj6B1c7bxR3Z0wYg1+YdoYFnVUKWb+rIfTTyYK9tmQJx5Vlb5fxdLnVv1RJOPiwsLIQbAA==\\\" }, \\\"bootstrap\\\":{ \\\"bootstrapServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}, \\\"lwm2mServer\\\":{ \\\"securityMode\\\":\\\"RPK\\\", \\\"clientPublicKeyOrId\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUEBxNl/RcYJNm8mk91CyVXoIJiROYDlXcSSqK6e5bDHwOW4ZiN2lNnXalyF0Jxw8MbAytnDMERXyAja5VEMeVQ==\\\", \\\"clientSecretKey\\\":\\\"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgd9GAx7yZW37autew5KZykn4IgRpge/tZSjnudnZJnMahRANCAARQQHE2X9Fxgk2byaT3ULJVeggmJE5gOVdxJKorp7lsMfA5bhmI3aU2ddqXIXQnHDwxsDK2cMwRFfICNrlUQx5V\\\"}} }\"\n}\n```\n\nUpdate to real value:\n - 'id' (this is id of Device Credentials -\u003E \"Get Device Credentials (getDeviceCredentialsByDeviceId)\",\n - 'deviceId.id' (this is id of Device).\nRemove 'tenantId' and optionally 'customerId' from the request body example (below) to create new Device entity.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "updateDeviceCredentials", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceCredentials" - } + "summary": "Count devices by device profile (countByDeviceProfileAndEmptyOtaPackage)", + "description": "The platform gives an ability to load OTA (over-the-air) packages to devices. It can be done in two different ways: device scope or device profile scope.In the response you will find the number of devices with specified device profile, but without previously defined device scope OTA package. It can be useful when you want to define number of devices that will be affected with future OTA package\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "countByDeviceGroupAndEmptyOtaPackage", + "parameters": [ + { + "name": "otaPackageType", + "in": "path", + "description": "OTA package type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "FIRMWARE", + "SOFTWARE" + ] } }, - "required": true - }, + { + "name": "otaPackageId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityGroupId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceCredentials" + "type": "integer", + "format": "int64" } } } @@ -39894,7 +39749,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -40014,23 +39869,81 @@ ] } }, - "/api/device/info/{deviceId}": { + "/api/entityGroup/{entityGroupId}/devices": { "get": { "tags": [ "device-controller" ], - "summary": "Get Device (getDeviceInfoById)", - "description": "Fetch the Device info object based on the provided Device Id. Device Info is an extension of the default Device object that contains information about the owner name. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getDeviceInfoById", + "summary": "Get devices by Entity Group Id (getDevicesByEntityGroupId)", + "description": "Returns a page of Device objects that belongs to specified Entity Group Id. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getDevicesByEntityGroupId", "parameters": [ { - "name": "deviceId", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the device name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "deviceProfileName", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -40039,7 +39952,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceInfo" + "$ref": "#/components/schemas/PageDataDevice" } } } @@ -40175,24 +40088,32 @@ ] } }, - "/api/device/types": { + "/api/tenant/device": { "get": { "tags": [ "device-controller" ], - "summary": "Get Device Types (getDeviceTypes)", - "description": "Deprecated. See 'getDeviceProfileNames' API from Device Profile Controller instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDeviceTypes", + "summary": "Get Tenant Device (getTenantDevice)", + "description": "Requested device must be owned by tenant that the user belongs to. Device name is an unique property of device. So it can be used to identify the device.\n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getTenantDeviceByName", + "parameters": [ + { + "name": "deviceName", + "in": "query", + "description": "A string value representing the Device name.", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntitySubtype" - } + "$ref": "#/components/schemas/Device" } } } @@ -40318,7 +40239,6 @@ } } }, - "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -40329,23 +40249,81 @@ ] } }, - "/api/device/{deviceId}": { + "/api/tenant/devices": { "get": { "tags": [ "device-controller" ], - "summary": "Get Device (getDeviceById)", - "description": "Fetch the Device object based on the provided Device Id. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getDeviceById", + "summary": "Get Tenant Devices (getTenantDevices)", + "description": "Returns a page of devices owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getTenantDevices", "parameters": [ { - "name": "deviceId", - "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "Device type as the name of the device profile", + "required": false, "schema": { "type": "string" } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the device name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "deviceProfileName", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -40354,7 +40332,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Device" + "$ref": "#/components/schemas/PageDataDevice" } } } @@ -40488,169 +40466,26 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/tenant/{tenantId}/device/{deviceId}": { + "post": { "tags": [ "device-controller" ], - "summary": "Delete device (deleteDevice)", - "description": "Deletes the device, it's credentials and all the relations (from and to the device). Referencing non-existing device Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "deleteDevice", + "summary": "Assign device to tenant (assignDeviceToTenant)", + "description": "Creates assignment of the device to tenant. Thereafter tenant will be able to reassign the device to a customer.\n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'ASSIGN_TO_TENANT' permission for the entity (entities).", + "operationId": "assignDeviceToTenant", "parameters": [ { - "name": "deviceId", + "name": "tenantId", "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] }, - { - "ApiKeyForm": [] - } - ] - } - }, - "/api/device/{deviceId}/credentials": { - "get": { - "tags": [ - "device-controller" - ], - "summary": "Get Device Credentials (getDeviceCredentialsByDeviceId)", - "description": "If during device creation there wasn't specified any credentials, platform generates random 'ACCESS_TOKEN' credentials.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ_CREDENTIALS' permission for the entity (entities).", - "operationId": "getDeviceCredentialsByDeviceId", - "parameters": [ { "name": "deviceId", "in": "path", @@ -40667,7 +40502,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceCredentials" + "$ref": "#/components/schemas/Device" } } } @@ -40683,7 +40518,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -40803,14 +40638,14 @@ ] } }, - "/api/deviceInfos/all": { + "/api/user/devices": { "get": { "tags": [ "device-controller" ], - "summary": "Get All Device Infos for current user (getAllDeviceInfos)", - "description": "Returns a page of device info objects owned by the tenant or the customer of a current user. Device Info is an extension of the default Device object that contains information about the owner name. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getAllDeviceInfos", + "summary": "Get Devices (getUserDevices)", + "description": "Returns a page of devices that are available for the current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getUserDevices", "parameters": [ { "name": "pageSize", @@ -40818,8 +40653,8 @@ "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "minimum": 1 } }, { @@ -40828,37 +40663,19 @@ "description": "Sequence number of page starting from 0", "required": true, "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "includeCustomers", - "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, - "schema": { - "type": "boolean" + "type": "string", + "minimum": 0 } }, { - "name": "deviceProfileId", + "name": "type", "in": "query", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Device type as the name of the device profile", "required": false, "schema": { "type": "string" } }, - { - "name": "active", - "in": "query", - "description": "A boolean value representing the device active flag.", - "required": false, - "schema": { - "type": "boolean" - } - }, { "name": "textSearch", "in": "query", @@ -40904,7 +40721,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDeviceInfo" + "$ref": "#/components/schemas/PageDataDevice" } } } @@ -41040,38 +40857,30 @@ ] } }, - "/api/devices": { - "get": { + "/api/deviceGroupOtaPackage": { + "post": { "tags": [ - "device-controller" + "device-group-ota-package-controller" ], - "summary": "Get Devices By Ids (getDevicesByIds)", - "description": "Requested devices must be owned by tenant or assigned to customer which user is performing the request. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getDevicesByIds", - "parameters": [ - { - "name": "deviceIds", - "in": "query", - "description": "A list of devices ids, separated by comma ','", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" + "summary": "saveDeviceGroupOtaPackage", + "operationId": "saveDeviceGroupOtaPackage", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceGroupOtaPackage" } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Device" - } + "$ref": "#/components/schemas/DeviceGroupOtaPackage" } } } @@ -41087,7 +40896,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -41205,34 +41014,40 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/deviceGroupOtaPackage/{groupId}/{firmwareType}": { + "get": { "tags": [ - "device-controller" + "device-group-ota-package-controller" ], - "summary": "Find related devices (findDevicesByQuery)", - "description": "Returns all devices that are related to the specific entity. The entity id, relation type, device types, depth of the search, and other query parameters defined using complex 'DeviceSearchQuery' object. See 'Model' tab of the Parameters for more info.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "findDevicesByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceSearchQuery" - } + "summary": "getFirmwareById", + "operationId": "getFirmwareById", + "parameters": [ + { + "name": "groupId", + "in": "path", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "firmwareType", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Device" - } + "$ref": "#/components/schemas/DeviceGroupOtaPackage" } } } @@ -41248,7 +41063,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -41368,32 +41183,17 @@ ] } }, - "/api/devices/count/{otaPackageType}/{deviceProfileId}": { - "get": { + "/api/deviceGroupOtaPackage/{id}": { + "delete": { "tags": [ - "device-controller" + "device-group-ota-package-controller" ], - "summary": "Count devices by device profile (countByDeviceProfileAndEmptyOtaPackage)", - "description": "The platform gives an ability to load OTA (over-the-air) packages to devices. It can be done in two different ways: device scope or device profile scope.In the response you will find the number of devices with specified device profile, but without previously defined device scope OTA package. It can be useful when you want to define number of devices that will be affected with future OTA package\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "countByDeviceProfileAndEmptyOtaPackage", + "summary": "deleteDeviceGroupOtaPackage", + "operationId": "deleteDeviceGroupOtaPackage", "parameters": [ { - "name": "otaPackageType", - "in": "path", - "description": "OTA package type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "FIRMWARE", - "SOFTWARE" - ] - } - }, - { - "name": "deviceProfileId", + "name": "id", "in": "path", - "description": "Device Profile Id. I.g. '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -41402,15 +41202,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "integer", - "format": "int64" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -41543,53 +41335,31 @@ ] } }, - "/api/devices/count/{otaPackageType}/{otaPackageId}/{entityGroupId}": { - "get": { + "/api/deviceProfile": { + "post": { "tags": [ - "device-controller" + "device-profile-controller" ], - "summary": "Count devices by device profile (countByDeviceProfileAndEmptyOtaPackage)", - "description": "The platform gives an ability to load OTA (over-the-air) packages to devices. It can be done in two different ways: device scope or device profile scope.In the response you will find the number of devices with specified device profile, but without previously defined device scope OTA package. It can be useful when you want to define number of devices that will be affected with future OTA package\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "countByDeviceGroupAndEmptyOtaPackage", - "parameters": [ - { - "name": "otaPackageType", - "in": "path", - "description": "OTA package type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "FIRMWARE", - "SOFTWARE" - ] - } - }, - { - "name": "otaPackageId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "summary": "Create Or Update Device Profile (saveDeviceProfile)", + "description": "Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. \n\nDevice profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant.\n\n# Device profile data definition\n\nDevice profile data object contains alarm rules configuration, device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. \n\n```json\n{\n \"alarms\":[\n ],\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"DISABLED\",\n \"provisionDeviceSecret\":null\n },\n \"transportConfiguration\":{\n \"type\":\"DEFAULT\"\n }\n}\n```\n\n```json\n{\n \"alarms\":[\n {\n \"id\":\"2492b935-1226-59e9-8615-17d8978a4f93\",\n \"alarmType\":\"Temperature Alarm\",\n \"clearRule\":{\n \"schedule\":null,\n \"condition\":{\n \"spec\":{\n \"type\":\"SIMPLE\"\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":30.0,\n \"dynamicValue\":null\n },\n \"operation\":\"LESS\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"propagate\":false,\n \"createRules\":{\n \"MAJOR\":{\n \"schedule\":{\n \"type\":\"SPECIFIC_TIME\",\n \"endsOn\":64800000,\n \"startsOn\":43200000,\n \"timezone\":\"Europe/Kiev\",\n \"daysOfWeek\":[\n 1,\n 3,\n 5\n ]\n },\n \"condition\":{\n \"spec\":{\n \"type\":\"DURATION\",\n \"unit\":\"MINUTES\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":30,\n \"dynamicValue\":null\n }\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"COMPLEX\",\n \"operation\":\"OR\",\n \"predicates\":[\n {\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":50.0,\n \"dynamicValue\":null\n },\n \"operation\":\"LESS_OR_EQUAL\"\n },\n {\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":30.0,\n \"dynamicValue\":null\n },\n \"operation\":\"GREATER\"\n }\n ]\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"WARNING\":{\n \"schedule\":{\n \"type\":\"CUSTOM\",\n \"items\":[\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":1\n },\n {\n \"endsOn\":64800000,\n \"enabled\":true,\n \"startsOn\":43200000,\n \"dayOfWeek\":2\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":3\n },\n {\n \"endsOn\":57600000,\n \"enabled\":true,\n \"startsOn\":36000000,\n \"dayOfWeek\":4\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":5\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":6\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":7\n }\n ],\n \"timezone\":\"Europe/Kiev\"\n },\n \"condition\":{\n \"spec\":{\n \"type\":\"REPEATING\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":5,\n \"dynamicValue\":null\n }\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"tempConstant\",\n \"type\":\"CONSTANT\"\n },\n \"value\":30,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":0.0,\n \"dynamicValue\":{\n \"inherit\":false,\n \"sourceType\":\"CURRENT_DEVICE\",\n \"sourceAttribute\":\"tempThreshold\"\n }\n },\n \"operation\":\"EQUAL\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"CRITICAL\":{\n \"schedule\":null,\n \"condition\":{\n \"spec\":{\n \"type\":\"SIMPLE\"\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":50.0,\n \"dynamicValue\":null\n },\n \"operation\":\"GREATER\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n }\n },\n \"propagateRelationTypes\":null\n }\n ],\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"ALLOW_CREATE_NEW_DEVICES\",\n \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\"\n },\n \"transportConfiguration\":{\n \"type\":\"MQTT\",\n \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\",\n \"deviceAttributesTopic\":\"v1/devices/me/attributes\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"PROTOBUF\",\n \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\",\n \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\",\n \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\",\n \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\"\n }\n }\n}\n```\n\nLet's review some specific objects examples related to the device profile configuration:\n\n# Alarm Schedule\n\nAlarm Schedule JSON object represents the time interval during which the alarm rule is active. Note, \n\n```json\n\"schedule\": null\n```\n\nmeans alarm rule is active all the time. **'daysOfWeek'** field represents Monday as 1, Tuesday as 2 and so on. **'startsOn'** and **'endsOn'** fields represent hours in millis (e.g. 64800000 = 18:00 or 6pm). **'enabled'** flag specifies if item in a custom rule is active for specific day of the week:\n\n## Specific Time Schedule\n\n```json\n{\n \"schedule\":{\n \"type\":\"SPECIFIC_TIME\",\n \"endsOn\":64800000,\n \"startsOn\":43200000,\n \"timezone\":\"Europe/Kiev\",\n \"daysOfWeek\":[\n 1,\n 3,\n 5\n ]\n }\n}\n```\n\n## Custom Schedule\n\n```json\n{\n \"schedule\":{\n \"type\":\"CUSTOM\",\n \"items\":[\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":1\n },\n {\n \"endsOn\":64800000,\n \"enabled\":true,\n \"startsOn\":43200000,\n \"dayOfWeek\":2\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":3\n },\n {\n \"endsOn\":57600000,\n \"enabled\":true,\n \"startsOn\":36000000,\n \"dayOfWeek\":4\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":5\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":6\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":7\n }\n ],\n \"timezone\":\"Europe/Kiev\"\n }\n}\n```\n\n# Alarm condition type (**'spec'**)\n\nAlarm condition type can be either simple, duration, or repeating. For example, 5 times in a row or during 5 minutes.\n\nNote, **'userValue'** field is not used and reserved for future usage, **'dynamicValue'** is used for condition appliance by using the value of the **'sourceAttribute'** or else **'defaultValue'** is used (if **'sourceAttribute'** is absent).\n\n**'sourceType'** of the **'sourceAttribute'** can be: \n * 'CURRENT_DEVICE';\n * 'CURRENT_CUSTOMER';\n * 'CURRENT_TENANT'.\n\n**'sourceAttribute'** can be inherited from the owner if **'inherit'** is set to true (for CURRENT_DEVICE and CURRENT_CUSTOMER).\n\n## Repeating alarm condition\n\n```json\n{\n \"spec\":{\n \"type\":\"REPEATING\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":5,\n \"dynamicValue\":{\n \"inherit\":true,\n \"sourceType\":\"CURRENT_DEVICE\",\n \"sourceAttribute\":\"tempAttr\"\n }\n }\n }\n}\n```\n\n## Duration alarm condition\n\n```json\n{\n \"spec\":{\n \"type\":\"DURATION\",\n \"unit\":\"MINUTES\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":30,\n \"dynamicValue\":null\n }\n }\n}\n```\n\n**'unit'** can be: \n * 'SECONDS';\n * 'MINUTES';\n * 'HOURS';\n * 'DAYS'.\n\n# Key Filters\n\nKey filter objects are created under the **'condition'** array. They allow you to define complex logical expressions over entity field, attribute, latest time series value or constant. The filter is defined using 'key', 'valueType', 'value' (refers to the value of the 'CONSTANT' alarm filter key type) and 'predicate' objects. Let's review each object:\n\n## Alarm Filter Key\n\nFilter Key defines either entity field, attribute, telemetry or constant. It is a JSON object that consists the key name and type. The following filter key types are supported:\n * 'ATTRIBUTE' - used for attributes values;\n * 'TIME_SERIES' - used for time series values;\n * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type;\n * 'CONSTANT' - constant value specified.\n\nLet's review the example:\n\n```json\n{\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n}\n```\n\n## Value Type and Operations\n\nProvides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: \n\n * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; \n * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL;\n * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n\n\n\n\n## Filter Predicate\n\nFilter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key.\n\nSimple predicate example to check 'value < 100': \n\n```json\n{\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 100,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nComplex predicate example, to check 'value < 10 or value > 20': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n}\n```\n\nMore complex predicate example, to check 'value < 10 or (value > 50 && value < 60)': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"type\": \"COMPLEX\",\n \"operation\": \"AND\",\n \"predicates\": [\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 50,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 60,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n }\n ]\n}\n```\n\nYou may also want to replace hardcoded values (for example, temperature > 20) with the more dynamic expression (for example, temperature > value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or device. See example below:\n\n```json\n{\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"inherit\": false,\n \"sourceType\": \"CURRENT_TENANT\",\n \"sourceAttribute\": \"temperatureThreshold\"\n }\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nNote that you may use 'CURRENT_DEVICE', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source. The 'sourceAttribute' can be inherited from the owner of the specified 'sourceType' if 'inherit' is set to true.\n\n# Provision Configuration\n\nThere are 3 types of device provision configuration for the device profile: \n * 'DISABLED';\n * 'ALLOW_CREATE_NEW_DEVICES';\n * 'CHECK_PRE_PROVISIONED_DEVICES'.\n\nPlease refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details.\n\n# Transport Configuration\n\n5 transport configuration types are available:\n * 'DEFAULT';\n * 'MQTT';\n * 'LWM2M';\n * 'COAP';\n * 'SNMP'.\n\nDefault type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types.\n\nSee another example of COAP transport configuration below:\n\n```json\n{\n \"type\":\"COAP\",\n \"clientSettings\":{\n \"edrxCycle\":null,\n \"powerMode\":\"DRX\",\n \"psmActivityTimer\":null,\n \"pagingTransmissionWindow\":null\n },\n \"coapDeviceTypeConfiguration\":{\n \"coapDeviceType\":\"DEFAULT\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"JSON\"\n }\n }\n}\n```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveDeviceProfile", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceProfile" + } } }, - { - "name": "entityGroupId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "integer", - "format": "int64" + "$ref": "#/components/schemas/DeviceProfile" } } } @@ -41605,7 +41375,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -41725,81 +41495,23 @@ ] } }, - "/api/entityGroup/{entityGroupId}/devices": { + "/api/deviceProfile/devices/keys/attributes": { "get": { "tags": [ - "device-controller" + "device-profile-controller" ], - "summary": "Get devices by Entity Group Id (getDevicesByEntityGroupId)", - "description": "Returns a page of Device objects that belongs to specified Entity Group Id. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getDevicesByEntityGroupId", + "summary": "Get attribute keys (getAttributesKeys)", + "description": "Get a set of unique attribute keys used by devices that belong to specified profile. If profile is not set returns a list of unique keys among all profiles. The call is used for auto-complete in the UI forms. The implementation limits the number of devices that participate in search to 100 as a trade of between accurate results and time-consuming queries. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAttributesKeys", "parameters": [ { - "name": "entityGroupId", - "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", + "name": "deviceProfileId", "in": "query", - "description": "The case insensitive 'substring' filter based on the device name.", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "deviceProfileName", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -41808,7 +41520,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDevice" + "type": "array", + "items": { + "type": "string" + } } } } @@ -41944,20 +41659,20 @@ ] } }, - "/api/tenant/device": { + "/api/deviceProfile/devices/keys/timeseries": { "get": { "tags": [ - "device-controller" + "device-profile-controller" ], - "summary": "Get Tenant Device (getTenantDevice)", - "description": "Requested device must be owned by tenant that the user belongs to. Device name is an unique property of device. So it can be used to identify the device.\n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getTenantDeviceByName", + "summary": "Get time series keys (getDeviceProfileTimeseriesKeys)", + "description": "Get a set of unique time series keys used by devices that belong to specified profile. If profile is not set returns a list of unique keys among all profiles. The call is used for auto-complete in the UI forms. The implementation limits the number of devices that participate in search to 100 as a trade of between accurate results and time-consuming queries. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getDeviceProfileTimeseriesKeys", "parameters": [ { - "name": "deviceName", + "name": "deviceProfileId", "in": "query", - "description": "A string value representing the Device name.", - "required": true, + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": false, "schema": { "type": "string" } @@ -41969,7 +41684,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Device" + "type": "array", + "items": { + "type": "string" + } } } } @@ -42105,80 +41823,23 @@ ] } }, - "/api/tenant/devices": { + "/api/deviceProfile/names": { "get": { "tags": [ - "device-controller" + "device-profile-controller" ], - "summary": "Get Tenant Devices (getTenantDevices)", - "description": "Returns a page of devices owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getTenantDevices", + "summary": "Get Device Profile names (getDeviceProfileNames)", + "description": "Returns a set of unique device profile names owned by the tenant.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDeviceProfileNames", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "Device type as the name of the device profile", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the device name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "deviceProfileName", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", + "name": "activeOnly", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "Flag indicating whether to retrieve exclusively the names of device profiles that are referenced by tenant's devices.", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "boolean", + "default": false } } ], @@ -42188,7 +41849,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDevice" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityInfo" + } } } } @@ -42324,31 +41988,31 @@ ] } }, - "/api/tenant/{tenantId}/device/{deviceId}": { - "post": { + "/api/deviceProfile/{deviceProfileId}": { + "get": { "tags": [ - "device-controller" + "device-profile-controller" ], - "summary": "Assign device to tenant (assignDeviceToTenant)", - "description": "Creates assignment of the device to tenant. Thereafter tenant will be able to reassign the device to a customer.\n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'ASSIGN_TO_TENANT' permission for the entity (entities).", - "operationId": "assignDeviceToTenant", + "summary": "Get Device Profile (getDeviceProfileById)", + "description": "Fetch the Device Profile object based on the provided Device Profile Id. The server checks that the device profile is owned by the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getDeviceProfileById", "parameters": [ { - "name": "tenantId", + "name": "deviceProfileId", "in": "path", - "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "deviceId", - "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "inlineImages", + "in": "query", + "description": "Inline images as a data URL (Base64)", + "required": false, "schema": { - "type": "string" + "type": "boolean" } } ], @@ -42358,7 +42022,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Device" + "$ref": "#/components/schemas/DeviceProfile" } } } @@ -42374,7 +42038,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -42492,95 +42156,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/user/devices": { - "get": { + }, + "delete": { "tags": [ - "device-controller" + "device-profile-controller" ], - "summary": "Get Devices (getUserDevices)", - "description": "Returns a page of devices that are available for the current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getUserDevices", + "summary": "Delete device profile (deleteDeviceProfile)", + "description": "Deletes the device profile. Referencing non-existing device profile Id will cause an error. Can't delete the device profile if it is referenced by existing devices.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteDeviceProfile", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "deviceProfileId", + "in": "path", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "type", - "in": "query", - "description": "Device type as the name of the device profile", - "required": false, "schema": { "type": "string" } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the device name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "deviceProfileName", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataDevice" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -42713,30 +42310,32 @@ ] } }, - "/api/deviceGroupOtaPackage": { + "/api/deviceProfile/{deviceProfileId}/default": { "post": { "tags": [ - "device-group-ota-package-controller" + "device-profile-controller" ], - "summary": "saveDeviceGroupOtaPackage", - "operationId": "saveDeviceGroupOtaPackage", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceGroupOtaPackage" - } + "summary": "Make Device Profile Default (setDefaultDeviceProfile)", + "description": "Marks device profile as default within a tenant scope.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "setDefaultDeviceProfile", + "parameters": [ + { + "name": "deviceProfileId", + "in": "path", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceGroupOtaPackage" + "$ref": "#/components/schemas/DeviceProfile" } } } @@ -42872,38 +42471,21 @@ ] } }, - "/api/deviceGroupOtaPackage/{groupId}/{firmwareType}": { + "/api/deviceProfileInfo/default": { "get": { "tags": [ - "device-group-ota-package-controller" - ], - "summary": "getFirmwareById", - "operationId": "getFirmwareById", - "parameters": [ - { - "name": "groupId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "firmwareType", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } + "device-profile-controller" ], + "summary": "Get Default Device Profile (getDefaultDeviceProfileInfo)", + "description": "Fetch the Default Device Profile Info object. Device Profile Info is a lightweight object that includes main information about Device Profile excluding the heavyweight configuration object. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDefaultDeviceProfileInfo", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceGroupOtaPackage" + "$ref": "#/components/schemas/DeviceProfileInfo" } } } @@ -43039,17 +42621,19 @@ ] } }, - "/api/deviceGroupOtaPackage/{id}": { - "delete": { + "/api/deviceProfileInfo/{deviceProfileId}": { + "get": { "tags": [ - "device-group-ota-package-controller" + "device-profile-controller" ], - "summary": "deleteDeviceGroupOtaPackage", - "operationId": "deleteDeviceGroupOtaPackage", + "summary": "Get Device Profile Info (getDeviceProfileInfoById)", + "description": "Fetch the Device Profile Info object based on the provided Device Profile Id. Device Profile Info is a lightweight object that includes main information about Device Profile excluding the heavyweight configuration object. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDeviceProfileInfoById", "parameters": [ { - "name": "id", + "name": "deviceProfileId", "in": "path", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -43058,7 +42642,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceProfileInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -43191,31 +42782,98 @@ ] } }, - "/api/deviceProfile": { - "post": { + "/api/deviceProfileInfos": { + "get": { "tags": [ "device-profile-controller" ], - "summary": "Create Or Update Device Profile (saveDeviceProfile)", - "description": "Create or update the Device Profile. When creating device profile, platform generates device profile id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created device profile id will be present in the response. Specify existing device profile id to update the device profile. Referencing non-existing device profile Id will cause 'Not Found' error. \n\nDevice profile name is unique in the scope of tenant. Only one 'default' device profile may exist in scope of tenant.\n\n# Device profile data definition\n\nDevice profile data object contains alarm rules configuration, device provision strategy and transport type configuration for device connectivity. Let's review some examples. First one is the default device profile data configuration and second one - the custom one. \n\n```json\n{\n \"alarms\":[\n ],\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"DISABLED\",\n \"provisionDeviceSecret\":null\n },\n \"transportConfiguration\":{\n \"type\":\"DEFAULT\"\n }\n}\n```\n\n```json\n{\n \"alarms\":[\n {\n \"id\":\"2492b935-1226-59e9-8615-17d8978a4f93\",\n \"alarmType\":\"Temperature Alarm\",\n \"clearRule\":{\n \"schedule\":null,\n \"condition\":{\n \"spec\":{\n \"type\":\"SIMPLE\"\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":30.0,\n \"dynamicValue\":null\n },\n \"operation\":\"LESS\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"propagate\":false,\n \"createRules\":{\n \"MAJOR\":{\n \"schedule\":{\n \"type\":\"SPECIFIC_TIME\",\n \"endsOn\":64800000,\n \"startsOn\":43200000,\n \"timezone\":\"Europe/Kiev\",\n \"daysOfWeek\":[\n 1,\n 3,\n 5\n ]\n },\n \"condition\":{\n \"spec\":{\n \"type\":\"DURATION\",\n \"unit\":\"MINUTES\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":30,\n \"dynamicValue\":null\n }\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"COMPLEX\",\n \"operation\":\"OR\",\n \"predicates\":[\n {\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":50.0,\n \"dynamicValue\":null\n },\n \"operation\":\"LESS_OR_EQUAL\"\n },\n {\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":30.0,\n \"dynamicValue\":null\n },\n \"operation\":\"GREATER\"\n }\n ]\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"WARNING\":{\n \"schedule\":{\n \"type\":\"CUSTOM\",\n \"items\":[\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":1\n },\n {\n \"endsOn\":64800000,\n \"enabled\":true,\n \"startsOn\":43200000,\n \"dayOfWeek\":2\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":3\n },\n {\n \"endsOn\":57600000,\n \"enabled\":true,\n \"startsOn\":36000000,\n \"dayOfWeek\":4\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":5\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":6\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":7\n }\n ],\n \"timezone\":\"Europe/Kiev\"\n },\n \"condition\":{\n \"spec\":{\n \"type\":\"REPEATING\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":5,\n \"dynamicValue\":null\n }\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"tempConstant\",\n \"type\":\"CONSTANT\"\n },\n \"value\":30,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":0.0,\n \"dynamicValue\":{\n \"inherit\":false,\n \"sourceType\":\"CURRENT_DEVICE\",\n \"sourceAttribute\":\"tempThreshold\"\n }\n },\n \"operation\":\"EQUAL\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n },\n \"CRITICAL\":{\n \"schedule\":null,\n \"condition\":{\n \"spec\":{\n \"type\":\"SIMPLE\"\n },\n \"condition\":[\n {\n \"key\":{\n \"key\":\"temperature\",\n \"type\":\"TIME_SERIES\"\n },\n \"value\":null,\n \"predicate\":{\n \"type\":\"NUMERIC\",\n \"value\":{\n \"userValue\":null,\n \"defaultValue\":50.0,\n \"dynamicValue\":null\n },\n \"operation\":\"GREATER\"\n },\n \"valueType\":\"NUMERIC\"\n }\n ]\n },\n \"dashboardId\":null,\n \"alarmDetails\":null\n }\n },\n \"propagateRelationTypes\":null\n }\n ],\n \"configuration\":{\n \"type\":\"DEFAULT\"\n },\n \"provisionConfiguration\":{\n \"type\":\"ALLOW_CREATE_NEW_DEVICES\",\n \"provisionDeviceSecret\":\"vaxb9hzqdbz3oqukvomg\"\n },\n \"transportConfiguration\":{\n \"type\":\"MQTT\",\n \"deviceTelemetryTopic\":\"v1/devices/me/telemetry\",\n \"deviceAttributesTopic\":\"v1/devices/me/attributes\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"PROTOBUF\",\n \"deviceTelemetryProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage telemetry;\\n\\nmessage SensorDataReading {\\n\\n optional double temperature = 1;\\n optional double humidity = 2;\\n InnerObject innerObject = 3;\\n\\n message InnerObject {\\n optional string key1 = 1;\\n optional bool key2 = 2;\\n optional double key3 = 3;\\n optional int32 key4 = 4;\\n optional string key5 = 5;\\n }\\n}\",\n \"deviceAttributesProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage attributes;\\n\\nmessage SensorConfiguration {\\n optional string firmwareVersion = 1;\\n optional string serialNumber = 2;\\n}\",\n \"deviceRpcRequestProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcRequestMsg {\\n optional string method = 1;\\n optional int32 requestId = 2;\\n optional string params = 3;\\n}\",\n \"deviceRpcResponseProtoSchema\":\"syntax =\\\"proto3\\\";\\npackage rpc;\\n\\nmessage RpcResponseMsg {\\n optional string payload = 1;\\n}\"\n }\n }\n}\n```\n\nLet's review some specific objects examples related to the device profile configuration:\n\n# Alarm Schedule\n\nAlarm Schedule JSON object represents the time interval during which the alarm rule is active. Note, \n\n```json\n\"schedule\": null\n```\n\nmeans alarm rule is active all the time. **'daysOfWeek'** field represents Monday as 1, Tuesday as 2 and so on. **'startsOn'** and **'endsOn'** fields represent hours in millis (e.g. 64800000 = 18:00 or 6pm). **'enabled'** flag specifies if item in a custom rule is active for specific day of the week:\n\n## Specific Time Schedule\n\n```json\n{\n \"schedule\":{\n \"type\":\"SPECIFIC_TIME\",\n \"endsOn\":64800000,\n \"startsOn\":43200000,\n \"timezone\":\"Europe/Kiev\",\n \"daysOfWeek\":[\n 1,\n 3,\n 5\n ]\n }\n}\n```\n\n## Custom Schedule\n\n```json\n{\n \"schedule\":{\n \"type\":\"CUSTOM\",\n \"items\":[\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":1\n },\n {\n \"endsOn\":64800000,\n \"enabled\":true,\n \"startsOn\":43200000,\n \"dayOfWeek\":2\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":3\n },\n {\n \"endsOn\":57600000,\n \"enabled\":true,\n \"startsOn\":36000000,\n \"dayOfWeek\":4\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":5\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":6\n },\n {\n \"endsOn\":0,\n \"enabled\":false,\n \"startsOn\":0,\n \"dayOfWeek\":7\n }\n ],\n \"timezone\":\"Europe/Kiev\"\n }\n}\n```\n\n# Alarm condition type (**'spec'**)\n\nAlarm condition type can be either simple, duration, or repeating. For example, 5 times in a row or during 5 minutes.\n\nNote, **'userValue'** field is not used and reserved for future usage, **'dynamicValue'** is used for condition appliance by using the value of the **'sourceAttribute'** or else **'defaultValue'** is used (if **'sourceAttribute'** is absent).\n\n**'sourceType'** of the **'sourceAttribute'** can be: \n * 'CURRENT_DEVICE';\n * 'CURRENT_CUSTOMER';\n * 'CURRENT_TENANT'.\n\n**'sourceAttribute'** can be inherited from the owner if **'inherit'** is set to true (for CURRENT_DEVICE and CURRENT_CUSTOMER).\n\n## Repeating alarm condition\n\n```json\n{\n \"spec\":{\n \"type\":\"REPEATING\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":5,\n \"dynamicValue\":{\n \"inherit\":true,\n \"sourceType\":\"CURRENT_DEVICE\",\n \"sourceAttribute\":\"tempAttr\"\n }\n }\n }\n}\n```\n\n## Duration alarm condition\n\n```json\n{\n \"spec\":{\n \"type\":\"DURATION\",\n \"unit\":\"MINUTES\",\n \"predicate\":{\n \"userValue\":null,\n \"defaultValue\":30,\n \"dynamicValue\":null\n }\n }\n}\n```\n\n**'unit'** can be: \n * 'SECONDS';\n * 'MINUTES';\n * 'HOURS';\n * 'DAYS'.\n\n# Key Filters\n\nKey filter objects are created under the **'condition'** array. They allow you to define complex logical expressions over entity field, attribute, latest time series value or constant. The filter is defined using 'key', 'valueType', 'value' (refers to the value of the 'CONSTANT' alarm filter key type) and 'predicate' objects. Let's review each object:\n\n## Alarm Filter Key\n\nFilter Key defines either entity field, attribute, telemetry or constant. It is a JSON object that consists the key name and type. The following filter key types are supported:\n * 'ATTRIBUTE' - used for attributes values;\n * 'TIME_SERIES' - used for time series values;\n * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type;\n * 'CONSTANT' - constant value specified.\n\nLet's review the example:\n\n```json\n{\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n}\n```\n\n## Value Type and Operations\n\nProvides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: \n\n * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; \n * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL;\n * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n\n\n\n\n## Filter Predicate\n\nFilter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key.\n\nSimple predicate example to check 'value \u003C 100': \n\n```json\n{\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 100,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nComplex predicate example, to check 'value \u003C 10 or value \u003E 20': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n}\n```\n\nMore complex predicate example, to check 'value \u003C 10 or (value \u003E 50 && value \u003C 60)': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"type\": \"COMPLEX\",\n \"operation\": \"AND\",\n \"predicates\": [\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 50,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 60,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n }\n ]\n}\n```\n\nYou may also want to replace hardcoded values (for example, temperature \u003E 20) with the more dynamic expression (for example, temperature \u003E value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or device. See example below:\n\n```json\n{\n \"operation\": \"GREATER\",\n \"value\": {\n \"userValue\": null,\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"inherit\": false,\n \"sourceType\": \"CURRENT_TENANT\",\n \"sourceAttribute\": \"temperatureThreshold\"\n }\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nNote that you may use 'CURRENT_DEVICE', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source. The 'sourceAttribute' can be inherited from the owner of the specified 'sourceType' if 'inherit' is set to true.\n\n# Provision Configuration\n\nThere are 3 types of device provision configuration for the device profile: \n * 'DISABLED';\n * 'ALLOW_CREATE_NEW_DEVICES';\n * 'CHECK_PRE_PROVISIONED_DEVICES'.\n\nPlease refer to the [docs](https://thingsboard.io/docs/user-guide/device-provisioning/) for more details.\n\n# Transport Configuration\n\n5 transport configuration types are available:\n * 'DEFAULT';\n * 'MQTT';\n * 'LWM2M';\n * 'COAP';\n * 'SNMP'.\n\nDefault type supports basic MQTT, HTTP, CoAP and LwM2M transports. Please refer to the [docs](https://thingsboard.io/docs/user-guide/device-profiles/#transport-configuration) for more details about other types.\n\nSee another example of COAP transport configuration below:\n\n```json\n{\n \"type\":\"COAP\",\n \"clientSettings\":{\n \"edrxCycle\":null,\n \"powerMode\":\"DRX\",\n \"psmActivityTimer\":null,\n \"pagingTransmissionWindow\":null\n },\n \"coapDeviceTypeConfiguration\":{\n \"coapDeviceType\":\"DEFAULT\",\n \"transportPayloadTypeConfiguration\":{\n \"transportPayloadType\":\"JSON\"\n }\n }\n}\n```Remove 'id', 'tenantId' from the request body example (below) to create new Device Profile entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveDeviceProfile", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceProfile" - } + "summary": "Get Device Profiles for transport type (getDeviceProfileInfos)", + "description": "Returns a page of devices profile info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Device Profile Info is a lightweight object that includes main information about Device Profile excluding the heavyweight configuration object. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDeviceProfileInfos", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the device profile name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "transportType", + "description", + "isDefault" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + }, + { + "name": "transportType", + "in": "query", + "description": "Type of the transport", + "required": false, + "schema": { + "type": "string", + "enum": [ + "DEFAULT", + "MQTT", + "COAP", + "LWM2M", + "SNMP" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceProfile" + "$ref": "#/components/schemas/PageDataDeviceProfileInfo" } } } @@ -43231,7 +42889,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -43351,22 +43009,25 @@ ] } }, - "/api/deviceProfile/devices/keys/attributes": { + "/api/deviceProfileInfos/list": { "get": { "tags": [ "device-profile-controller" ], - "summary": "Get attribute keys (getAttributesKeys)", - "description": "Get a set of unique attribute keys used by devices that belong to specified profile. If profile is not set returns a list of unique keys among all profiles. The call is used for auto-complete in the UI forms. The implementation limits the number of devices that participate in search to 100 as a trade of between accurate results and time-consuming queries. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getAttributesKeys", + "summary": "Get Device Profile Infos By Ids (getDeviceProfileInfosByIds)", + "description": "Requested device profiles must be owned by tenant which is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getDeviceProfileInfosByIds", "parameters": [ { - "name": "deviceProfileId", + "name": "deviceProfileIds", "in": "query", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": false, + "description": "A list of device profile ids, separated by comma ','", + "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -43378,7 +43039,7 @@ "schema": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/DeviceProfileInfo" } } } @@ -43515,23 +43176,73 @@ ] } }, - "/api/deviceProfile/devices/keys/timeseries": { + "/api/deviceProfiles": { "get": { "tags": [ "device-profile-controller" ], - "summary": "Get time series keys (getDeviceProfileTimeseriesKeys)", - "description": "Get a set of unique time series keys used by devices that belong to specified profile. If profile is not set returns a list of unique keys among all profiles. The call is used for auto-complete in the UI forms. The implementation limits the number of devices that participate in search to 100 as a trade of between accurate results and time-consuming queries. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getDeviceProfileTimeseriesKeys", + "summary": "Get Device Profiles (getDeviceProfiles)", + "description": "Returns a page of devices profile objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getDeviceProfiles", "parameters": [ { - "name": "deviceProfileId", + "name": "pageSize", "in": "query", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the device profile name.", "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "transportType", + "description", + "isDefault" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -43540,10 +43251,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "string" - } + "$ref": "#/components/schemas/PageDataDeviceProfile" } } } @@ -43679,36 +43387,45 @@ ] } }, - "/api/deviceProfile/names": { - "get": { + "/api/domain": { + "post": { "tags": [ - "device-profile-controller" + "domain-controller" ], - "summary": "Get Device Profile names (getDeviceProfileNames)", - "description": "Returns a set of unique device profile names owned by the tenant.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDeviceProfileNames", + "summary": "Save or Update Domain (saveDomain)", + "description": "Create or update the Domain. When creating domain, platform generates Domain Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Domain Id will be present in the response. Specify existing Domain Id to update the domain. Referencing non-existing Domain Id will cause 'Not Found' error.\n\nDomain name is unique for entire platform setup.\n\n\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "saveDomain", "parameters": [ { - "name": "activeOnly", + "name": "oauth2ClientIds", "in": "query", - "description": "Flag indicating whether to retrieve exclusively the names of device profiles that are referenced by tenant's devices.", + "description": "A list of oauth2 client registration ids, separated by comma ','", "required": false, "schema": { - "type": "boolean", - "default": false + "type": "array", + "items": { + "type": "string" + } } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Domain" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityInfo" - } + "$ref": "#/components/schemas/Domain" } } } @@ -43724,7 +43441,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -43844,31 +43561,22 @@ ] } }, - "/api/deviceProfile/{deviceProfileId}": { + "/api/domain/cloud/info/{id}": { "get": { "tags": [ - "device-profile-controller" + "domain-controller" ], - "summary": "Get Device Profile (getDeviceProfileById)", - "description": "Fetch the Device Profile object based on the provided Device Profile Id. The server checks that the device profile is owned by the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getDeviceProfileById", + "summary": "Get Domain info by Id (getCloudDomainInfoById)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getCloudDomainInfoById", "parameters": [ { - "name": "deviceProfileId", + "name": "id", "in": "path", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string" - } - }, - { - "name": "inlineImages", - "in": "query", - "description": "Inline images as a data URL (Base64)", - "required": false, - "schema": { - "type": "boolean" + "type": "string", + "format": "uuid" } } ], @@ -43878,7 +43586,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceProfile" + "$ref": "#/components/schemas/DomainInfo" } } } @@ -44012,28 +43720,37 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/domain/info/{id}": { + "get": { "tags": [ - "device-profile-controller" + "domain-controller" ], - "summary": "Delete device profile (deleteDeviceProfile)", - "description": "Deletes the device profile. Referencing non-existing device profile Id will cause an error. Can't delete the device profile if it is referenced by existing devices.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteDeviceProfile", + "summary": "Get Domain info by Id (getDomainInfoById)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDomainInfoById", "parameters": [ { - "name": "deviceProfileId", + "name": "id", "in": "path", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -44166,20 +43883,58 @@ ] } }, - "/api/deviceProfile/{deviceProfileId}/default": { - "post": { + "/api/domain/infos": { + "get": { "tags": [ - "device-profile-controller" + "domain-controller" ], - "summary": "Make Device Profile Default (setDefaultDeviceProfile)", - "description": "Marks device profile as default within a tenant scope.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "setDefaultDeviceProfile", + "summary": "Get Domain infos (getDomainInfos)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getDomainInfos", "parameters": [ { - "name": "deviceProfileId", - "in": "path", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on domain's name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, "schema": { "type": "string" } @@ -44191,7 +43946,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeviceProfile" + "$ref": "#/components/schemas/PageDataDomainInfo" } } } @@ -44207,7 +43962,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -44327,24 +44082,28 @@ ] } }, - "/api/deviceProfileInfo/default": { - "get": { + "/api/domain/{id}": { + "delete": { "tags": [ - "device-profile-controller" + "domain-controller" + ], + "summary": "Delete Domain by ID (deleteDomain)", + "description": "Deletes Domain by ID. Referencing non-existing domain Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "deleteDomain", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } ], - "summary": "Get Default Device Profile (getDefaultDeviceProfileInfo)", - "description": "Fetch the Default Device Profile Info object. Device Profile Info is a lightweight object that includes main information about Device Profile excluding the heavyweight configuration object. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDefaultDeviceProfileInfo", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceProfileInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -44477,36 +44236,43 @@ ] } }, - "/api/deviceProfileInfo/{deviceProfileId}": { - "get": { + "/api/domain/{id}/oauth2Clients": { + "put": { "tags": [ - "device-profile-controller" + "domain-controller" ], - "summary": "Get Device Profile Info (getDeviceProfileInfoById)", - "description": "Fetch the Device Profile Info object based on the provided Device Profile Id. Device Profile Info is a lightweight object that includes main information about Device Profile excluding the heavyweight configuration object. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDeviceProfileInfoById", + "summary": "Update oauth2 clients (updateOauth2Clients)", + "description": "Update oauth2 clients for the specified domain. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "updateOauth2Clients", "parameters": [ { - "name": "deviceProfileId", + "name": "id", "in": "path", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeviceProfileInfo" + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" } } } }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + }, "400": { "description": "Bad Request", "content": { @@ -44638,15 +44404,24 @@ ] } }, - "/api/deviceProfileInfos": { + "/api/customer/{customerId}/edgeInfos": { "get": { "tags": [ - "device-profile-controller" + "edge-controller" ], - "summary": "Get Device Profiles for transport type (getDeviceProfileInfos)", - "description": "Returns a page of devices profile info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Device Profile Info is a lightweight object that includes main information about Device Profile excluding the heavyweight configuration object. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDeviceProfileInfos", + "summary": "Get Customer Edge Infos (getCustomerEdgeInfos)", + "description": "Returns a page of edge info objects owned by the specified customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getCustomerEdgeInfos", "parameters": [ + { + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "pageSize", "in": "query", @@ -44667,10 +44442,28 @@ "format": "int32" } }, + { + "name": "includeCustomers", + "in": "query", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "type", + "in": "query", + "description": "A string value representing the edge type. For example, 'default'", + "required": false, + "schema": { + "type": "string" + } + }, { "name": "textSearch", "in": "query", - "description": "The case insensitive 'substring' filter based on the device profile name.", + "description": "The case insensitive 'substring' filter based on the edge name.", "required": false, "schema": { "type": "string" @@ -44687,9 +44480,8 @@ "createdTime", "name", "type", - "transportType", - "description", - "isDefault" + "label", + "customerTitle" ] } }, @@ -44705,22 +44497,6 @@ "DESC" ] } - }, - { - "name": "transportType", - "in": "query", - "description": "Type of the transport", - "required": false, - "schema": { - "type": "string", - "enum": [ - "DEFAULT", - "MQTT", - "COAP", - "LWM2M", - "SNMP" - ] - } } ], "responses": { @@ -44729,7 +44505,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDeviceProfileInfo" + "$ref": "#/components/schemas/PageDataEdgeInfo" } } } @@ -44865,25 +44641,89 @@ ] } }, - "/api/deviceProfileInfos/list": { + "/api/customer/{customerId}/edges": { "get": { "tags": [ - "device-profile-controller" + "edge-controller" ], - "summary": "Get Device Profile Infos By Ids (getDeviceProfileInfosByIds)", - "description": "Requested device profiles must be owned by tenant which is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getDeviceProfileInfosByIds", + "summary": "Get Customer Edges (getCustomerEdges)", + "description": "Returns a page of edges objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getCustomerEdges", "parameters": [ { - "name": "deviceProfileIds", + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", "in": "query", - "description": "A list of device profile ids, separated by comma ','", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "A string value representing the edge type. For example, 'default'", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the edge name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -44893,10 +44733,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DeviceProfileInfo" - } + "$ref": "#/components/schemas/PageDataEdge" } } } @@ -45032,82 +44869,53 @@ ] } }, - "/api/deviceProfiles": { - "get": { + "/api/edge": { + "post": { "tags": [ - "device-profile-controller" + "edge-controller" ], - "summary": "Get Device Profiles (getDeviceProfiles)", - "description": "Returns a page of devices profile objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getDeviceProfiles", + "summary": "Create Or Update Edge (saveEdge)", + "description": "Create or update the Edge. When creating edge, platform generates Edge Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created edge id will be present in the response. Specify existing Edge id to update the edge. Referencing non-existing Edge Id will cause 'Not Found' error.\n\nEdge name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the edge names and non-unique 'label' field for user-friendly visualization purposes.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Edge entity. ", + "operationId": "saveEdge", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", + "name": "entityGroupId", "in": "query", - "description": "The case insensitive 'substring' filter based on the device profile name.", "required": false, "schema": { "type": "string" } }, { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "transportType", - "description", - "isDefault" - ] - } - }, - { - "name": "sortOrder", + "name": "entityGroupIds", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "A list of entity group ids, separated by comma ','", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "array", + "items": { + "type": "string" + } } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Edge" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDeviceProfile" + "$ref": "#/components/schemas/Edge" } } } @@ -45123,7 +44931,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -45243,33 +45051,19 @@ ] } }, - "/api/domain": { + "/api/edge/bulk_import": { "post": { "tags": [ - "domain-controller" - ], - "summary": "Save or Update Domain (saveDomain)", - "description": "Create or update the Domain. When creating domain, platform generates Domain Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Domain Id will be present in the response. Specify existing Domain Id to update the domain. Referencing non-existing Domain Id will cause 'Not Found' error.\n\nDomain name is unique for entire platform setup.\n\n\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "saveDomain", - "parameters": [ - { - "name": "oauth2ClientIds", - "in": "query", - "description": "A list of oauth2 client registration ids, separated by comma ','", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } + "edge-controller" ], + "summary": "Import the bulk of edges (processEdgesBulkImport)", + "description": "There's an ability to import the bulk of edges using the only .csv file.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "processEdgesBulkImport", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Domain" + "$ref": "#/components/schemas/BulkImportRequest" } } }, @@ -45281,7 +45075,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Domain" + "$ref": "#/components/schemas/BulkImportResultEdge" } } } @@ -45417,22 +45211,22 @@ ] } }, - "/api/domain/cloud/info/{id}": { + "/api/edge/info/{edgeId}": { "get": { "tags": [ - "domain-controller" + "edge-controller" ], - "summary": "Get Domain info by Id (getCloudDomainInfoById)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getCloudDomainInfoById", + "summary": "Get Edge Info (getEdgeInfoById)", + "description": "Get the Edge info object based on the provided Edge Id. If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEdgeInfoById", "parameters": [ { - "name": "id", + "name": "edgeId", "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], @@ -45442,7 +45236,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DomainInfo" + "$ref": "#/components/schemas/EdgeInfo" } } } @@ -45578,22 +45372,36 @@ ] } }, - "/api/domain/info/{id}": { + "/api/edge/instructions/install/{edgeId}/{method}": { "get": { "tags": [ - "domain-controller" + "edge-controller" ], - "summary": "Get Domain info by Id (getDomainInfoById)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDomainInfoById", + "summary": "Get Edge Install Instructions (getEdgeInstallInstructions)", + "description": "Get an install instructions for provided edge id.If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEdgeInstallInstructions", "parameters": [ { - "name": "id", + "name": "edgeId", "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "method", + "in": "path", + "description": "Installation method ('docker', 'ubuntu' or 'centos')", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "docker", + "ubuntu", + "centos" + ] } } ], @@ -45603,7 +45411,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DomainInfo" + "$ref": "#/components/schemas/EdgeInstructions" } } } @@ -45739,60 +45547,36 @@ ] } }, - "/api/domain/infos": { + "/api/edge/instructions/upgrade/{edgeVersion}/{method}": { "get": { "tags": [ - "domain-controller" + "edge-controller" ], - "summary": "Get Domain infos (getDomainInfos)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getDomainInfos", + "summary": "Get Edge Upgrade Instructions (getEdgeUpgradeInstructions)", + "description": "Get an upgrade instructions for provided edge version.If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEdgeUpgradeInstructions", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "edgeVersion", + "in": "path", + "description": "Edge version", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on domain's name", - "required": false, "schema": { "type": "string" } }, { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, + "name": "method", + "in": "path", + "description": "Upgrade method ('docker', 'ubuntu' or 'centos')", + "required": true, "schema": { - "type": "string" + "type": "string", + "enum": [ + "docker", + "ubuntu", + "centos" + ] } } ], @@ -45802,7 +45586,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataDomainInfo" + "$ref": "#/components/schemas/EdgeInstructions" } } } @@ -45938,28 +45722,35 @@ ] } }, - "/api/domain/{id}": { - "delete": { + "/api/edge/missingToRelatedRuleChains/{edgeId}": { + "get": { "tags": [ - "domain-controller" + "edge-controller" ], - "summary": "Delete Domain by ID (deleteDomain)", - "description": "Deletes Domain by ID. Referencing non-existing domain Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "deleteDomain", + "summary": "Find missing rule chains (findMissingToRelatedRuleChains)", + "description": "Returns list of rule chains ids that are not assigned to particular edge, but these rule chains are present in the already assigned rule chains to edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "findMissingToRelatedRuleChains", "parameters": [ { - "name": "id", + "name": "edgeId", "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } }, "400": { "description": "Bad Request", @@ -46092,43 +45883,36 @@ ] } }, - "/api/domain/{id}/oauth2Clients": { - "put": { + "/api/edge/sync/{edgeId}": { + "post": { "tags": [ - "domain-controller" + "edge-controller" ], - "summary": "Update oauth2 clients (updateOauth2Clients)", - "description": "Update oauth2 clients for the specified domain. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "updateOauth2Clients", + "summary": "Sync edge (syncEdge)", + "description": "Starts synchronization process between edge and cloud. \nAll entities that are assigned to particular edge are going to be send to remote edge service.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "syncEdge", "parameters": [ { - "name": "id", + "name": "edgeId", "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" } } } }, - "required": true - }, - "responses": { - "200": { - "description": "OK" - }, "400": { "description": "Bad Request", "content": { @@ -46140,7 +45924,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -46260,108 +46044,24 @@ ] } }, - "/api/customer/{customerId}/edgeInfos": { + "/api/edge/types": { "get": { "tags": [ "edge-controller" ], - "summary": "Get Customer Edge Infos (getCustomerEdgeInfos)", - "description": "Returns a page of edge info objects owned by the specified customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getCustomerEdgeInfos", - "parameters": [ - { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "includeCustomers", - "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "type", - "in": "query", - "description": "A string value representing the edge type. For example, 'default'", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the edge name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "summary": "Get Edge Types (getEdgeTypes)", + "description": "Returns a set of unique edge types based on edges that are either owned by the tenant or assigned to the customer which user is performing the request.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEdgeTypes", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEdgeInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntitySubtype" + } } } } @@ -46497,90 +46197,23 @@ ] } }, - "/api/customer/{customerId}/edges": { + "/api/edge/{edgeId}": { "get": { "tags": [ "edge-controller" ], - "summary": "Get Customer Edges (getCustomerEdges)", - "description": "Returns a page of edges objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getCustomerEdges", + "summary": "Get Edge (getEdgeById)", + "description": "Get the Edge object based on the provided Edge Id. If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEdgeById", "parameters": [ { - "name": "customerId", + "name": "edgeId", "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "A string value representing the edge type. For example, 'default'", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the edge name.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -46589,7 +46222,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEdge" + "$ref": "#/components/schemas/Edge" } } } @@ -46723,58 +46356,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edge": { - "post": { + }, + "delete": { "tags": [ "edge-controller" ], - "summary": "Create Or Update Edge (saveEdge)", - "description": "Create or update the Edge. When creating edge, platform generates Edge Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created edge id will be present in the response. Specify existing Edge id to update the edge. Referencing non-existing Edge Id will cause 'Not Found' error.\n\nEdge name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the edge names and non-unique 'label' field for user-friendly visualization purposes.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Edge entity. ", - "operationId": "saveEdge", + "summary": "Delete edge (deleteEdge)", + "description": "Deletes the edge. Referencing non-existing edge Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteEdge", "parameters": [ { - "name": "entityGroupId", - "in": "query", - "required": false, + "name": "edgeId", + "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { "type": "string" } - }, - { - "name": "entityGroupIds", - "in": "query", - "description": "A list of entity group ids, separated by comma ','", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Edge" - } - } - }, - "required": true - }, "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Edge" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -46787,7 +46390,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -46907,31 +46510,32 @@ ] } }, - "/api/edge/bulk_import": { - "post": { + "/api/edge/{edgeId}/upgrade/available": { + "get": { "tags": [ "edge-controller" ], - "summary": "Import the bulk of edges (processEdgesBulkImport)", - "description": "There's an ability to import the bulk of edges using the only .csv file.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "processEdgesBulkImport", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BulkImportRequest" - } + "summary": "Is edge upgrade enabled (isEdgeUpgradeAvailable)", + "description": "Returns 'true' if upgrade available for connected edge, 'false' - otherwise.", + "operationId": "isEdgeUpgradeAvailable", + "parameters": [ + { + "name": "edgeId", + "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/BulkImportResultEdge" + "type": "boolean" } } } @@ -46947,7 +46551,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -47067,14 +46671,14 @@ ] } }, - "/api/edge/info/{edgeId}": { - "get": { + "/api/edge/{edgeId}/{ruleChainId}/root": { + "post": { "tags": [ "edge-controller" ], - "summary": "Get Edge Info (getEdgeInfoById)", - "description": "Get the Edge info object based on the provided Edge Id. If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEdgeInfoById", + "summary": "Set root rule chain for provided edge (setEdgeRootRuleChain)", + "description": "Change root rule chain of the edge to the new provided rule chain. \nThis operation will send a notification to update root rule chain on remote edge service.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "setEdgeRootRuleChain", "parameters": [ { "name": "edgeId", @@ -47084,6 +46688,15 @@ "schema": { "type": "string" } + }, + { + "name": "ruleChainId", + "in": "path", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { @@ -47092,7 +46705,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EdgeInfo" + "$ref": "#/components/schemas/Edge" } } } @@ -47108,7 +46721,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -47228,35 +46841,88 @@ ] } }, - "/api/edge/instructions/install/{edgeId}/{method}": { + "/api/edgeInfos/all": { "get": { "tags": [ "edge-controller" ], - "summary": "Get Edge Install Instructions (getEdgeInstallInstructions)", - "description": "Get an install instructions for provided edge id.If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEdgeInstallInstructions", + "summary": "Get All Edge Infos for current user (getAllEdgeInfos)", + "description": "Returns a page of edge info objects owned by the tenant or the customer of a current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getAllEdgeInfos", "parameters": [ { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { - "name": "method", - "in": "path", - "description": "Installation method ('docker', 'ubuntu' or 'centos')", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "includeCustomers", + "in": "query", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "type", + "in": "query", + "description": "A string value representing the edge type. For example, 'default'", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the edge name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, "schema": { "type": "string", "enum": [ - "docker", - "ubuntu", - "centos" + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" ] } } @@ -47267,7 +46933,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EdgeInstructions" + "$ref": "#/components/schemas/PageDataEdgeInfo" } } } @@ -47403,35 +47069,70 @@ ] } }, - "/api/edge/instructions/upgrade/{edgeVersion}/{method}": { + "/api/edges": { "get": { "tags": [ "edge-controller" ], - "summary": "Get Edge Upgrade Instructions (getEdgeUpgradeInstructions)", - "description": "Get an upgrade instructions for provided edge version.If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEdgeUpgradeInstructions", + "summary": "Get Tenant Edges (getEdges)", + "description": "Returns a page of edges owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getEdges", "parameters": [ { - "name": "edgeVersion", - "in": "path", - "description": "Edge version", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { - "name": "method", - "in": "path", - "description": "Upgrade method ('docker', 'ubuntu' or 'centos')", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the edge name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, "schema": { "type": "string", "enum": [ - "docker", - "ubuntu", - "centos" + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" ] } } @@ -47442,7 +47143,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EdgeInstructions" + "$ref": "#/components/schemas/PageDataEdge" } } } @@ -47576,34 +47277,34 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edge/missingToRelatedRuleChains/{edgeId}": { - "get": { + }, + "post": { "tags": [ "edge-controller" ], - "summary": "Find missing rule chains (findMissingToRelatedRuleChains)", - "description": "Returns list of rule chains ids that are not assigned to particular edge, but these rule chains are present in the already assigned rule chains to edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "findMissingToRelatedRuleChains", - "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Find related edges (findEdgesByQuery)", + "description": "Returns all edges that are related to the specific entity. The entity id, relation type, edge types, depth of the search, and other query parameters defined using complex 'EdgeSearchQuery' object. See 'Model' tab of the Parameters for more info.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "findEdgesByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EdgeSearchQuery" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "type": "array", + "items": { + "$ref": "#/components/schemas/Edge" + } } } } @@ -47619,7 +47320,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -47739,32 +47440,21 @@ ] } }, - "/api/edge/sync/{edgeId}": { - "post": { + "/api/edges/enabled": { + "get": { "tags": [ "edge-controller" ], - "summary": "Sync edge (syncEdge)", - "description": "Starts synchronization process between edge and cloud. \nAll entities that are assigned to particular edge are going to be send to remote edge service.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "syncEdge", - "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } - ], + "summary": "Is edges support enabled (isEdgesSupportEnabled)", + "description": "Returns 'true' if edges support enabled on server, 'false' - otherwise.", + "operationId": "isEdgesSupportEnabled", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "type": "boolean" } } } @@ -47780,7 +47470,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -47900,14 +47590,28 @@ ] } }, - "/api/edge/types": { + "/api/edges/list": { "get": { "tags": [ "edge-controller" ], - "summary": "Get Edge Types (getEdgeTypes)", - "description": "Returns a set of unique edge types based on edges that are either owned by the tenant or assigned to the customer which user is performing the request.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEdgeTypes", + "summary": "Get Edges By Ids (getEdgeList)", + "description": "Requested edges must be owned by tenant or assigned to customer which user is performing the request.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEdgeList", + "parameters": [ + { + "name": "edgeIds", + "in": "query", + "description": "A list of edges ids, separated by comma ','", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], "responses": { "200": { "description": "OK", @@ -47916,7 +47620,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/EntitySubtype" + "$ref": "#/components/schemas/Edge" } } } @@ -48053,23 +47757,81 @@ ] } }, - "/api/edge/{edgeId}": { + "/api/entityGroup/{entityGroupId}/edges": { "get": { "tags": [ "edge-controller" ], - "summary": "Get Edge (getEdgeById)", - "description": "Get the Edge object based on the provided Edge Id. If the user has the authority of 'Tenant Administrator', the server checks that the edge is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the edge is assigned to the same customer.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEdgeById", + "summary": "Get edges by Entity Group Id (getEdgesByEntityGroupId)", + "description": "Returns a page of Edge objects that belongs to specified Entity Group Id. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEdgesByEntityGroupId", "parameters": [ { - "name": "edgeId", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the edge name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -48078,7 +47840,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Edge" + "$ref": "#/components/schemas/PageDataEdge" } } } @@ -48212,19 +47974,28 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/license/activateInstance": { + "post": { "tags": [ "edge-controller" ], - "summary": "Delete edge (deleteEdge)", - "description": "Deletes the edge. Referencing non-existing edge Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteEdge", + "summary": "Activate edge instance (activateInstance)", + "description": "Activates edge license on license portal.", + "operationId": "activateInstance", "parameters": [ { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "licenseSecret", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "releaseDate", + "in": "query", "required": true, "schema": { "type": "string" @@ -48233,7 +48004,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + } }, "400": { "description": "Bad Request", @@ -48246,7 +48024,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -48366,32 +48144,31 @@ ] } }, - "/api/edge/{edgeId}/upgrade/available": { - "get": { + "/api/license/checkInstance": { + "post": { "tags": [ "edge-controller" ], - "summary": "Is edge upgrade enabled (isEdgeUpgradeAvailable)", - "description": "Returns 'true' if upgrade available for connected edge, 'false' - otherwise.", - "operationId": "isEdgeUpgradeAvailable", - "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Check edge license (checkInstance)", + "description": "Checks license request from edge service by forwarding request to license portal.", + "operationId": "checkInstance", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/JsonNode" } } } @@ -48407,7 +48184,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -48527,28 +48304,19 @@ ] } }, - "/api/edge/{edgeId}/{ruleChainId}/root": { - "post": { + "/api/tenant/edge": { + "get": { "tags": [ "edge-controller" ], - "summary": "Set root rule chain for provided edge (setEdgeRootRuleChain)", - "description": "Change root rule chain of the edge to the new provided rule chain. \nThis operation will send a notification to update root rule chain on remote edge service.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "setEdgeRootRuleChain", + "summary": "Get Tenant Edge by name (getTenantEdgeByName)", + "description": "Requested edge must be owned by tenant or customer that the user belongs to. Edge name is an unique property of edge. So it can be used to identify the edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantEdgeByName", "parameters": [ { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "ruleChainId", - "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "edgeName", + "in": "query", + "description": "Unique name of the edge", "required": true, "schema": { "type": "string" @@ -48577,7 +48345,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -48697,14 +48465,14 @@ ] } }, - "/api/edgeInfos/all": { + "/api/tenant/edges": { "get": { "tags": [ "edge-controller" ], - "summary": "Get All Edge Infos for current user (getAllEdgeInfos)", - "description": "Returns a page of edge info objects owned by the tenant or the customer of a current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getAllEdgeInfos", + "summary": "Get Tenant Edges (getTenantEdges)", + "description": "Returns a page of edges owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantEdges", "parameters": [ { "name": "pageSize", @@ -48726,15 +48494,6 @@ "format": "int32" } }, - { - "name": "includeCustomers", - "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, - "schema": { - "type": "boolean" - } - }, { "name": "type", "in": "query", @@ -48789,7 +48548,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEdgeInfo" + "$ref": "#/components/schemas/PageDataEdge" } } } @@ -48925,14 +48684,14 @@ ] } }, - "/api/edges": { + "/api/user/edges": { "get": { "tags": [ "edge-controller" ], - "summary": "Get Tenant Edges (getEdges)", - "description": "Returns a page of edges owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getEdges", + "summary": "Get Edges (getUserEdges)", + "description": "Returns a page of edges available for current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getUserEdges", "parameters": [ { "name": "pageSize", @@ -48940,8 +48699,8 @@ "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "minimum": 1 } }, { @@ -48950,8 +48709,17 @@ "description": "Sequence number of page starting from 0", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "minimum": 0 + } + }, + { + "name": "type", + "in": "query", + "description": "A string value representing the edge type. For example, 'default'", + "required": false, + "schema": { + "type": "string" } }, { @@ -49133,34 +48901,112 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/edge/{edgeId}/events": { + "get": { "tags": [ - "edge-controller" + "edge-event-controller" ], - "summary": "Find related edges (findEdgesByQuery)", - "description": "Returns all edges that are related to the specific entity. The entity id, relation type, edge types, depth of the search, and other query parameters defined using complex 'EdgeSearchQuery' object. See 'Model' tab of the Parameters for more info.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "findEdgesByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EdgeSearchQuery" - } + "summary": "Get Edge Events (getEdgeEvents)", + "description": "Returns a page of edge events for the requested edge. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", + "operationId": "getEdgeEvents", + "parameters": [ + { + "name": "edgeId", + "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the edge event type name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "label", + "customerTitle" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + }, + { + "name": "startTime", + "in": "query", + "description": "Timestamp. Edge events with creation time before it won't be queried", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Timestamp. Edge events with creation time after it won't be queried", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Edge" - } + "$ref": "#/components/schemas/PageDataEdgeEvent" } } } @@ -49176,7 +49022,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -49296,21 +49142,24 @@ ] } }, - "/api/edges/enabled": { + "/api/entities/vc/branches": { "get": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Is edges support enabled (isEdgesSupportEnabled)", - "description": "Returns 'true' if edges support enabled on server, 'false' - otherwise.", - "operationId": "isEdgesSupportEnabled", + "summary": "List branches (listBranches)", + "description": "Lists branches available in the remote repository. \n\nResponse example: \n```json\n[\n {\n \"name\": \"master\",\n \"default\": true\n },\n {\n \"name\": \"dev\",\n \"default\": false\n },\n {\n \"name\": \"dev-2\",\n \"default\": false\n }\n]\n```", + "operationId": "listBranches", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "type": "array", + "items": { + "$ref": "#/components/schemas/BranchInfo" + } } } } @@ -49446,25 +49295,41 @@ ] } }, - "/api/edges/list": { + "/api/entities/vc/diff/{entityType}/{internalEntityUuid}": { "get": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Get Edges By Ids (getEdgeList)", - "description": "Requested edges must be owned by tenant or assigned to customer which user is performing the request.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEdgeList", + "summary": "Compare entity data to version (compareEntityDataToVersion)", + "description": "Returns an object with current entity data and the one at a specific version. Entity data structure is the same as stored in a repository. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "compareEntityDataToVersion", "parameters": [ { - "name": "edgeIds", + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "$ref": "#/components/schemas/EntityType" + } + }, + { + "name": "internalEntityUuid", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "versionId", "in": "query", - "description": "A list of edges ids, separated by comma ','", + "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" } } ], @@ -49474,10 +49339,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Edge" - } + "$ref": "#/components/schemas/EntityDataDiff" } } } @@ -49613,90 +49475,32 @@ ] } }, - "/api/entityGroup/{entityGroupId}/edges": { - "get": { + "/api/entities/vc/entity": { + "post": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Get edges by Entity Group Id (getEdgesByEntityGroupId)", - "description": "Returns a page of Edge objects that belongs to specified Entity Group Id. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEdgesByEntityGroupId", - "parameters": [ - { - "name": "entityGroupId", - "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the edge name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] + "summary": "Load entities version (loadEntitiesVersion)", + "description": "Loads specific version of remote entities (or single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE, CONVERTER, INTEGRATION, ROLE and USER group.\n\nThere are multiple types of request. Each of them requires branch name (`branch`) and version id (`versionId`). Request of type `SINGLE_ENTITY` is needed to restore a concrete version of a specific entity. It contains id of a remote entity (`externalEntityId`), internal entity id (`internalEntityId`) and additional configuration (`config`):\n- `loadRelations` - to update relations list (in case `saveRelations` option was enabled during version creation);\n- `loadAttributes` - to load entity attributes (if `saveAttributes` config option was enabled);\n- `loadCredentials` - to update device credentials (if `saveCredentials` option was enabled during version creation);\n- `loadPermissions` - when loading user group, to update group permission list;\n- `loadGroupEntities` - when loading an entity group, to load its entities as well;\n- `autoGenerateIntegrationKey` - if loading integration version, to autogenerate routing key.\n\nAn example of such request:\n```json\n{\n \"type\": \"SINGLE_ENTITY\",\n \n \"branch\": \"dev\",\n \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",\n \n \"externalEntityId\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"b7944123-d4f4-11ec-847b-0f432358ab48\"\n },\n \"config\": {\n \"loadRelations\": false,\n \"loadAttributes\": true,\n \"loadCredentials\": true\n }\n}\n```\n\nAnother request type (`ENTITY_TYPE`) is needed to load specific version of the whole entity types. It contains a structure with entity types to load and configs for each entity type (`entityTypes`). For each specified entity type, the method will load all remote entities of this type that are present at the version. A config for each entity type contains the same options as in `SINGLE_ENTITY` request type, and additionally contains following options:\n- `removeOtherEntities` - to remove local entities that are not present on the remote - basically to overwrite local entity type with the remote one;\n- `findExistingEntityByName` - when you are loading some remote entities that are not yet present at this tenant, try to find existing entity by name and update it rather than create new.\n\nHere is an example of the request to completely restore version of the whole device entity type:\n```json\n{\n \"type\": \"ENTITY_TYPE\",\n\n \"branch\": \"dev\",\n \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",\n\n \"entityTypes\": {\n \"DEVICE\": {\n \"removeOtherEntities\": true,\n \"findExistingEntityByName\": false,\n \"loadRelations\": true,\n \"loadAttributes\": true,\n \"loadCredentials\": true\n }\n }\n}\n```\n\nThe response will contain generated request UUID that is to be used to check the status of operation via `getVersionLoadRequestStatus`.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "loadEntitiesVersion", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionLoadRequest" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEdge" + "type": "string", + "format": "uuid" } } } @@ -49712,7 +49516,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -49832,26 +49636,28 @@ ] } }, - "/api/license/activateInstance": { - "post": { + "/api/entities/vc/entity/{entityType}/{versionId}": { + "get": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Activate edge instance (activateInstance)", - "description": "Activates edge license on license portal.", - "operationId": "activateInstance", + "summary": "List entities at version (listEntitiesAtVersion)", + "description": "Returns a list of remote entities of a specific entity type that are available at a concrete version. \nEach entity item in the result has `externalId` property. Entities order will be the same as in the repository.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "listEntitiesAtVersion", "parameters": [ { - "name": "licenseSecret", - "in": "query", + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/EntityType" } }, { - "name": "releaseDate", - "in": "query", + "name": "versionId", + "in": "path", + "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", "required": true, "schema": { "type": "string" @@ -49864,7 +49670,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JsonNode" + "type": "array", + "items": { + "$ref": "#/components/schemas/VersionedEntityInfo" + } } } } @@ -49880,7 +49689,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -50000,31 +49809,33 @@ ] } }, - "/api/license/checkInstance": { - "post": { + "/api/entities/vc/entity/{requestId}/status": { + "get": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Check edge license (checkInstance)", - "description": "Checks license request from edge service by forwarding request to license portal.", - "operationId": "checkInstance", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JsonNode" - } + "summary": "Get version load request status (getVersionLoadRequestStatus)", + "description": "Returns the status of previously made version load request. The structure contains following parameters:\n- `done` - if the request was successfully processed;\n- `result` - a list of load results for each entity type:\n - `created` - created entities count;\n - `updated` - updated entities count;\n - `deleted` - removed entities count;\n - `groupsCreated` - created entity groups count;\n - `groupsUpdated` - updated entity groups count;\n - `groupsDeleted` - removed entity groups count.\n- `error` - if an error occurred during processing, error info:\n - `type` - error type;\n - `source` - an external id of remote entity;\n - `target` - if failed to find referenced entity by external id - this external id;\n - `message` - error message.\n\nAn example of successfully processed request status:\n```json\n{\n \"done\": true,\n \"result\": [\n {\n \"entityType\": \"DEVICE\",\n \"created\": 10,\n \"updated\": 5,\n \"deleted\": 5,\n \"groupsCreated\": 1,\n \"groupsUpdated\": 1,\n \"groupsDeleted\": 1\n },\n {\n \"entityType\": \"ASSET\",\n \"created\": 4,\n \"updated\": 0,\n \"deleted\": 8,\n \"groupsCreated\": 1,\n \"groupsUpdated\": 0,\n \"groupsDeleted\": 2\n }\n ]\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getVersionLoadRequestStatus", + "parameters": [ + { + "name": "requestId", + "in": "path", + "description": "A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JsonNode" + "$ref": "#/components/schemas/VersionLoadResult" } } } @@ -50040,7 +49851,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -50160,19 +49971,19 @@ ] } }, - "/api/tenant/edge": { + "/api/entities/vc/entity/{versionId}": { "get": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Get Tenant Edge by name (getTenantEdgeByName)", - "description": "Requested edge must be owned by tenant or customer that the user belongs to. Edge name is an unique property of edge. So it can be used to identify the edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantEdgeByName", + "summary": "List all entities at version (listAllEntitiesAtVersion)", + "description": "Returns a list of all remote entities available in a specific version. Response type is the same as for listAllEntitiesAtVersion API method. \nReturned entities order will be the same as in the repository.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "listAllEntitiesAtVersion", "parameters": [ { - "name": "edgeName", - "in": "query", - "description": "Unique name of the edge", + "name": "versionId", + "in": "path", + "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", "required": true, "schema": { "type": "string" @@ -50185,7 +49996,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Edge" + "type": "array", + "items": { + "$ref": "#/components/schemas/VersionedEntityInfo" + } } } } @@ -50321,80 +50135,51 @@ ] } }, - "/api/tenant/edges": { + "/api/entities/vc/info/{versionId}/{entityType}/{externalEntityUuid}": { "get": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Get Tenant Edges (getTenantEdges)", - "description": "Returns a page of edges owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantEdges", + "summary": "Get entity data info (getEntityDataInfo)", + "description": "Retrieves short info about the remote entity by external id at a concrete version. \nReturned entity data info contains following properties: `hasRelations` (whether stored entity data contains relations), `hasAttributes` (contains attributes), `hasCredentials` (whether stored device data has credentials), `hasPermissions` (user group data contains group permission list) and `hasGroupEntities` (entity group data contains group entities).\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getEntityDataInfo", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "versionId", + "in": "path", + "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "A string value representing the edge type. For example, 'default'", - "required": false, "schema": { "type": "string" } }, { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the edge name.", - "required": false, + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, "schema": { - "type": "string" + "$ref": "#/components/schemas/EntityType" } }, { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, + "name": "externalEntityUuid", + "in": "path", + "description": "A string value representing external entity id", + "required": true, "schema": { "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] + "format": "uuid" } }, { - "name": "sortOrder", + "name": "internalEntityId", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": false, "schema": { "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "format": "uuid" } } ], @@ -50404,7 +50189,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEdge" + "$ref": "#/components/schemas/EntityDataInfo" } } } @@ -50540,48 +50325,48 @@ ] } }, - "/api/user/edges": { + "/api/entities/vc/version": { "get": { "tags": [ - "edge-controller" + "entities-version-control-controller" ], - "summary": "Get Edges (getUserEdges)", - "description": "Returns a page of edges available for current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getUserEdges", + "summary": "List all versions (listVersions)", + "description": "Lists all available versions in a branch for all entity types. \nIf specified branch does not exist - empty page data will be returned. The response format is the same as for `listEntityVersions` API method.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "listVersions", "parameters": [ { - "name": "pageSize", + "name": "branch", "in": "query", - "description": "Maximum amount of entities in a one page", + "description": "The name of the working branch, for example 'master'", "required": true, "schema": { - "type": "string", - "minimum": 1 + "type": "string" } }, { - "name": "page", + "name": "pageSize", "in": "query", - "description": "Sequence number of page starting from 0", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string", - "minimum": 0 + "type": "integer", + "format": "int32" } }, { - "name": "type", + "name": "page", "in": "query", - "description": "A string value representing the edge type. For example, 'default'", - "required": false, + "description": "Sequence number of page starting from 0", + "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { "name": "textSearch", "in": "query", - "description": "The case insensitive 'substring' filter based on the edge name.", + "description": "The case insensitive 'substring' filter based on the entity version name.", "required": false, "schema": { "type": "string" @@ -50595,11 +50380,7 @@ "schema": { "type": "string", "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" + "timestamp" ] } }, @@ -50623,7 +50404,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEdge" + "$ref": "#/components/schemas/PageDataEntityVersion" } } } @@ -50757,112 +50538,32 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edge/{edgeId}/events": { - "get": { + }, + "post": { "tags": [ - "edge-event-controller" + "entities-version-control-controller" ], - "summary": "Get Edge Events (getEdgeEvents)", - "description": "Returns a page of edge events for the requested edge. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", - "operationId": "getEdgeEvents", - "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the edge event type name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "label", - "customerTitle" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - }, - { - "name": "startTime", - "in": "query", - "description": "Timestamp. Edge events with creation time before it won't be queried", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + "summary": "Save entities version (saveEntitiesVersion)", + "description": "Creates a new version of entities (or a single entity) by request.\nSupported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE, CONVERTER, INTEGRATION, ROLE and USER group.\n\nThere are two available types of request: `SINGLE_ENTITY` and `COMPLEX`. Each of them contains version name (`versionName`) and name of a branch (`branch`) to create version (commit) in. If specified branch does not exists in a remote repo, then new empty branch will be created. Request of the `SINGLE_ENTITY` type has id of an entity (`entityId`) and additional configuration (`config`) which has following options: \n- `saveRelations` - whether to add inbound and outbound relations of type COMMON to created entity version;\n- `saveAttributes` - to save attributes of server scope (and also shared scope for devices);\n- `saveCredentials` - when saving a version of a device, to add its credentials to the version;\n- `savePermissions` - when saving a user group - to save group permission list;\n- `saveGroupEntities` - when saving an entity group - to save its entities as well.\n\nAn example of a `SINGLE_ENTITY` version create request:\n```json\n{\n \"type\": \"SINGLE_ENTITY\",\n\n \"versionName\": \"Version 1.0\",\n \"branch\": \"dev\",\n\n \"entityId\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"b79448e0-d4f4-11ec-847b-0f432358ab48\"\n },\n \"config\": {\n \"saveRelations\": true,\n \"saveAttributes\": true,\n \"saveCredentials\": false\n }\n}\n```\n\nSecond request type (`COMPLEX`), additionally to `branch` and `versionName`, contains following properties:\n- `entityTypes` - a structure with entity types to export and configuration for each entity type; this configuration has all the options available for `SINGLE_ENTITY` and additionally has these ones: \n - `allEntities` and `entityIds` - if you want to save the version of all entities of the entity type then set `allEntities` param to true, otherwise set it to false and specify `entityIds` - in case entity type is group entity, list of specific entity groups, or if not - list of entities;\n - `syncStrategy` - synchronization strategy to use for this entity type: when set to `OVERWRITE` then the list of remote entities of this type will be overwritten by newly added entities. If set to `MERGE` - existing remote entities of this entity type will not be removed, new entities will just be added on top (or existing remote entities will be updated).\n- `syncStrategy` - default synchronization strategy to use when it is not specified for an entity type.\n\nExample for this type of request:\n```json\n{\n \"type\": \"COMPLEX\",\n\n \"versionName\": \"Devices and profiles: release 2\",\n \"branch\": \"master\",\n\n \"syncStrategy\": \"OVERWRITE\",\n \"entityTypes\": {\n \"DEVICE\": {\n \"syncStrategy\": null,\n \"allEntities\": true,\n \"saveRelations\": true,\n \"saveAttributes\": true,\n \"saveCredentials\": true\n },\n \"DEVICE_PROFILE\": {\n \"syncStrategy\": \"MERGE\",\n \"allEntities\": false,\n \"entityIds\": [\n \"b79448e0-d4f4-11ec-847b-0f432358ab48\"\n ],\n \"saveRelations\": true\n }\n }\n}\n```\n\nResponse wil contain generated request UUID, that can be then used to retrieve status of operation via `getVersionCreateRequestStatus`.\n\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveEntitiesVersion", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionCreateRequest" + } } }, - { - "name": "endTime", - "in": "query", - "description": "Timestamp. Edge events with creation time after it won't be queried", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEdgeEvent" + "type": "string", + "format": "uuid" } } } @@ -50878,7 +50579,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -50998,24 +50699,95 @@ ] } }, - "/api/entities/vc/branches": { + "/api/entities/vc/version/{entityType}": { "get": { "tags": [ "entities-version-control-controller" ], - "summary": "List branches (listBranches)", - "description": "Lists branches available in the remote repository. \n\nResponse example: \n```json\n[\n {\n \"name\": \"master\",\n \"default\": true\n },\n {\n \"name\": \"dev\",\n \"default\": false\n },\n {\n \"name\": \"dev-2\",\n \"default\": false\n }\n]\n```", - "operationId": "listBranches", + "summary": "List entity type versions (listEntityTypeVersions)", + "description": "Returns list of versions of an entity type in a branch. This is a collected list of versions that were created for entities of this type in a remote branch. \nIf specified branch does not exist - empty page data will be returned. The response structure is the same as for `listEntityVersions` API method.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "listEntityTypeVersions", + "parameters": [ + { + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "$ref": "#/components/schemas/EntityType" + } + }, + { + "name": "branch", + "in": "query", + "description": "The name of the working branch, for example 'master'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the entity version name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "timestamp" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BranchInfo" - } + "$ref": "#/components/schemas/PageDataEntityVersion" } } } @@ -51151,14 +50923,14 @@ ] } }, - "/api/entities/vc/diff/{entityType}/{internalEntityUuid}": { + "/api/entities/vc/version/{entityType}/{externalEntityUuid}": { "get": { "tags": [ "entities-version-control-controller" ], - "summary": "Compare entity data to version (compareEntityDataToVersion)", - "description": "Returns an object with current entity data and the one at a specific version. Entity data structure is the same as stored in a repository. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "compareEntityDataToVersion", + "summary": "List entity versions (listEntityVersions)", + "description": "Returns list of versions for a specific entity in a concrete branch. \nYou need to specify external id of an entity to list versions for. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity. \nIf specified branch does not exist - empty page data will be returned. \n\nEach version info item has timestamp, id, name and author. Version id can then be used to restore the version. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nResponse example: \n```json\n{\n \"data\": [\n {\n \"timestamp\": 1655198593000,\n \"id\": \"fd82625bdd7d6131cf8027b44ee967012ecaf990\",\n \"name\": \"Devices and assets - v2.0\",\n \"author\": \"John Doe \"\n },\n {\n \"timestamp\": 1655198528000,\n \"id\": \"682adcffa9c8a2f863af6f00c4850323acbd4219\",\n \"name\": \"Update my device\",\n \"author\": \"John Doe \"\n },\n {\n \"timestamp\": 1655198280000,\n \"id\": \"d2a6087c2b30e18cc55e7cdda345a8d0dfb959a4\",\n \"name\": \"Devices and assets - v1.0\",\n \"author\": \"John Doe \"\n }\n ],\n \"totalPages\": 1,\n \"totalElements\": 3,\n \"hasNext\": false\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "listEntityVersions", "parameters": [ { "name": "entityType", @@ -51170,9 +50942,9 @@ } }, { - "name": "internalEntityUuid", + "name": "externalEntityUuid", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing external entity id. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity.", "required": true, "schema": { "type": "string", @@ -51180,13 +50952,76 @@ } }, { - "name": "versionId", + "name": "branch", "in": "query", - "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", + "description": "The name of the working branch, for example 'master'", "required": true, "schema": { "type": "string" } + }, + { + "name": "internalEntityId", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the entity version name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "timestamp" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -51195,7 +51030,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityDataDiff" + "$ref": "#/components/schemas/PageDataEntityVersion" } } } @@ -51331,32 +51166,33 @@ ] } }, - "/api/entities/vc/entity": { - "post": { + "/api/entities/vc/version/{requestId}/status": { + "get": { "tags": [ "entities-version-control-controller" ], - "summary": "Load entities version (loadEntitiesVersion)", - "description": "Loads specific version of remote entities (or single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE, CONVERTER, INTEGRATION, ROLE and USER group.\n\nThere are multiple types of request. Each of them requires branch name (`branch`) and version id (`versionId`). Request of type `SINGLE_ENTITY` is needed to restore a concrete version of a specific entity. It contains id of a remote entity (`externalEntityId`), internal entity id (`internalEntityId`) and additional configuration (`config`):\n- `loadRelations` - to update relations list (in case `saveRelations` option was enabled during version creation);\n- `loadAttributes` - to load entity attributes (if `saveAttributes` config option was enabled);\n- `loadCredentials` - to update device credentials (if `saveCredentials` option was enabled during version creation);\n- `loadPermissions` - when loading user group, to update group permission list;\n- `loadGroupEntities` - when loading an entity group, to load its entities as well;\n- `autoGenerateIntegrationKey` - if loading integration version, to autogenerate routing key.\n\nAn example of such request:\n```json\n{\n \"type\": \"SINGLE_ENTITY\",\n \n \"branch\": \"dev\",\n \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",\n \n \"externalEntityId\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"b7944123-d4f4-11ec-847b-0f432358ab48\"\n },\n \"config\": {\n \"loadRelations\": false,\n \"loadAttributes\": true,\n \"loadCredentials\": true\n }\n}\n```\n\nAnother request type (`ENTITY_TYPE`) is needed to load specific version of the whole entity types. It contains a structure with entity types to load and configs for each entity type (`entityTypes`). For each specified entity type, the method will load all remote entities of this type that are present at the version. A config for each entity type contains the same options as in `SINGLE_ENTITY` request type, and additionally contains following options:\n- `removeOtherEntities` - to remove local entities that are not present on the remote - basically to overwrite local entity type with the remote one;\n- `findExistingEntityByName` - when you are loading some remote entities that are not yet present at this tenant, try to find existing entity by name and update it rather than create new.\n\nHere is an example of the request to completely restore version of the whole device entity type:\n```json\n{\n \"type\": \"ENTITY_TYPE\",\n\n \"branch\": \"dev\",\n \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",\n\n \"entityTypes\": {\n \"DEVICE\": {\n \"removeOtherEntities\": true,\n \"findExistingEntityByName\": false,\n \"loadRelations\": true,\n \"loadAttributes\": true,\n \"loadCredentials\": true\n }\n }\n}\n```\n\nThe response will contain generated request UUID that is to be used to check the status of operation via `getVersionLoadRequestStatus`.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "loadEntitiesVersion", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VersionLoadRequest" - } + "summary": "Get version create request status (getVersionCreateRequestStatus)", + "description": "Returns the status of previously made version create request. \n\nThis status contains following properties:\n- `done` - whether request processing is finished;\n- `version` - created version info: timestamp, version id (commit hash), commit name and commit author;\n- `added` - count of items that were created in the remote repo;\n- `modified` - modified items count;\n- `removed` - removed items count;\n- `error` - error message, if an error occurred while handling the request.\n\nAn example of successful status:\n```json\n{\n \"done\": true,\n \"added\": 10,\n \"modified\": 2,\n \"removed\": 5,\n \"version\": {\n \"timestamp\": 1655198528000,\n \"id\":\"8a834dd389ed80e0759ba8ee338b3f1fd160a114\",\n \"name\": \"My devices v2.0\",\n \"author\": \"John Doe\"\n },\n \"error\": null\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getVersionCreateRequestStatus", + "parameters": [ + { + "name": "requestId", + "in": "path", + "description": "A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string", - "format": "uuid" + "$ref": "#/components/schemas/VersionCreationResult" } } } @@ -51372,7 +51208,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -51492,31 +51328,38 @@ ] } }, - "/api/entities/vc/entity/{entityType}/{versionId}": { + "/api/allEntityGroups/edge/{edgeId}/{groupType}": { "get": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "List entities at version (listEntitiesAtVersion)", - "description": "Returns a list of remote entities of a specific entity type that are available at a concrete version. \nEach entity item in the result has `externalId` property. Entities order will be the same as in the repository.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "listEntitiesAtVersion", + "summary": "Get All Edge Entity Groups by entity type (getAllEdgeEntityGroups)", + "description": "Fetch the list of Entity Group Info objects based on the provided Entity Type and assigned to the provided Edge entity. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getAllEdgeEntityGroups", "parameters": [ { - "name": "entityType", + "name": "edgeId", "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "$ref": "#/components/schemas/EntityType" + "type": "string" } }, { - "name": "versionId", + "name": "groupType", "in": "path", - "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", + "description": "EntityGroup type", "required": true, "schema": { - "type": "string" + "type": "string", + "enum": [ + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD" + ] } } ], @@ -51528,7 +51371,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/VersionedEntityInfo" + "$ref": "#/components/schemas/EntityGroupInfo" } } } @@ -51665,181 +51508,44 @@ ] } }, - "/api/entities/vc/entity/{requestId}/status": { - "get": { + "/api/edge/{edgeId}/entityGroup/{entityGroupId}/{groupType}": { + "post": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "Get version load request status (getVersionLoadRequestStatus)", - "description": "Returns the status of previously made version load request. The structure contains following parameters:\n- `done` - if the request was successfully processed;\n- `result` - a list of load results for each entity type:\n - `created` - created entities count;\n - `updated` - updated entities count;\n - `deleted` - removed entities count;\n - `groupsCreated` - created entity groups count;\n - `groupsUpdated` - updated entity groups count;\n - `groupsDeleted` - removed entity groups count.\n- `error` - if an error occurred during processing, error info:\n - `type` - error type;\n - `source` - an external id of remote entity;\n - `target` - if failed to find referenced entity by external id - this external id;\n - `message` - error message.\n\nAn example of successfully processed request status:\n```json\n{\n \"done\": true,\n \"result\": [\n {\n \"entityType\": \"DEVICE\",\n \"created\": 10,\n \"updated\": 5,\n \"deleted\": 5,\n \"groupsCreated\": 1,\n \"groupsUpdated\": 1,\n \"groupsDeleted\": 1\n },\n {\n \"entityType\": \"ASSET\",\n \"created\": 4,\n \"updated\": 0,\n \"deleted\": 8,\n \"groupsCreated\": 1,\n \"groupsUpdated\": 0,\n \"groupsDeleted\": 2\n }\n ]\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getVersionLoadRequestStatus", + "summary": "Assign entity group to edge (assignEntityGroupToEdge)", + "description": "Creates assignment of an existing entity group to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment entity group (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once entity group will be delivered to edge service, edge will request entities of this group to be send to edge. Once entities will be delivered to edge service, they are going to be available for usage on remote edge instance.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "assignEntityGroupToEdge", "parameters": [ { - "name": "requestId", + "name": "edgeId", "in": "path", - "description": "A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VersionLoadResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + "type": "string" } }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ { - "HttpLoginForm": [] + "name": "groupType", + "in": "path", + "description": "EntityGroup type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD" + ] + } }, { - "ApiKeyForm": [] - } - ] - } - }, - "/api/entities/vc/entity/{versionId}": { - "get": { - "tags": [ - "entities-version-control-controller" - ], - "summary": "List all entities at version (listAllEntitiesAtVersion)", - "description": "Returns a list of all remote entities available in a specific version. Response type is the same as for listAllEntitiesAtVersion API method. \nReturned entities order will be the same as in the repository.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "listAllEntitiesAtVersion", - "parameters": [ - { - "name": "versionId", + "name": "entityGroupId", "in": "path", - "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -51852,10 +51558,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VersionedEntityInfo" - } + "$ref": "#/components/schemas/EntityGroup" } } } @@ -51871,7 +51574,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -51989,53 +51692,47 @@ "ApiKeyForm": [] } ] - } - }, - "/api/entities/vc/info/{versionId}/{entityType}/{externalEntityUuid}": { - "get": { + }, + "delete": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "Get entity data info (getEntityDataInfo)", - "description": "Retrieves short info about the remote entity by external id at a concrete version. \nReturned entity data info contains following properties: `hasRelations` (whether stored entity data contains relations), `hasAttributes` (contains attributes), `hasCredentials` (whether stored device data has credentials), `hasPermissions` (user group data contains group permission list) and `hasGroupEntities` (entity group data contains group entities).\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getEntityDataInfo", + "summary": "Unassign entity group from edge (unassignEntityGroupFromEdge)", + "description": "Clears assignment of the entity group to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove entity group (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove entity group and entities inside this group locally.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "unassignEntityGroupFromEdge", "parameters": [ { - "name": "versionId", + "name": "edgeId", "in": "path", - "description": "Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash.", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "entityType", + "name": "groupType", "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "description": "EntityGroup type", "required": true, "schema": { - "$ref": "#/components/schemas/EntityType" + "type": "string", + "enum": [ + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD" + ] } }, { - "name": "externalEntityUuid", + "name": "entityGroupId", "in": "path", - "description": "A string value representing external entity id", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "internalEntityId", - "in": "query", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": false, - "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], @@ -52045,7 +51742,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityDataInfo" + "$ref": "#/components/schemas/EntityGroup" } } } @@ -52181,86 +51878,31 @@ ] } }, - "/api/entities/vc/version": { - "get": { + "/api/entityGroup": { + "post": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "List all versions (listVersions)", - "description": "Lists all available versions in a branch for all entity types. \nIf specified branch does not exist - empty page data will be returned. The response format is the same as for `listEntityVersions` API method.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "listVersions", - "parameters": [ - { - "name": "branch", - "in": "query", - "description": "The name of the working branch, for example 'master'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the entity version name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "timestamp" - ] + "summary": "Create Or Update Entity Group (saveEntityGroup)", + "description": "Create or update the Entity Group. When creating Entity Group, platform generates Entity Group Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Entity Group Id will be present in the response. Specify existing Entity Group Id to update the group. Referencing non-existing Entity Group Id will cause 'Not Found' error.Remove 'id', 'tenantId' and optionally 'ownerId' from the request body example (below) to create new Entity Group entity. \n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", + "operationId": "saveEntityGroup", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityGroup" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityVersion" + "$ref": "#/components/schemas/EntityGroupInfo" } } } @@ -52276,7 +51918,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -52394,32 +52036,66 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/entityGroup/all/{ownerType}/{ownerId}/{groupType}": { + "get": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "Save entities version (saveEntitiesVersion)", - "description": "Creates a new version of entities (or a single entity) by request.\nSupported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE, CONVERTER, INTEGRATION, ROLE and USER group.\n\nThere are two available types of request: `SINGLE_ENTITY` and `COMPLEX`. Each of them contains version name (`versionName`) and name of a branch (`branch`) to create version (commit) in. If specified branch does not exists in a remote repo, then new empty branch will be created. Request of the `SINGLE_ENTITY` type has id of an entity (`entityId`) and additional configuration (`config`) which has following options: \n- `saveRelations` - whether to add inbound and outbound relations of type COMMON to created entity version;\n- `saveAttributes` - to save attributes of server scope (and also shared scope for devices);\n- `saveCredentials` - when saving a version of a device, to add its credentials to the version;\n- `savePermissions` - when saving a user group - to save group permission list;\n- `saveGroupEntities` - when saving an entity group - to save its entities as well.\n\nAn example of a `SINGLE_ENTITY` version create request:\n```json\n{\n \"type\": \"SINGLE_ENTITY\",\n\n \"versionName\": \"Version 1.0\",\n \"branch\": \"dev\",\n\n \"entityId\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"b79448e0-d4f4-11ec-847b-0f432358ab48\"\n },\n \"config\": {\n \"saveRelations\": true,\n \"saveAttributes\": true,\n \"saveCredentials\": false\n }\n}\n```\n\nSecond request type (`COMPLEX`), additionally to `branch` and `versionName`, contains following properties:\n- `entityTypes` - a structure with entity types to export and configuration for each entity type; this configuration has all the options available for `SINGLE_ENTITY` and additionally has these ones: \n - `allEntities` and `entityIds` - if you want to save the version of all entities of the entity type then set `allEntities` param to true, otherwise set it to false and specify `entityIds` - in case entity type is group entity, list of specific entity groups, or if not - list of entities;\n - `syncStrategy` - synchronization strategy to use for this entity type: when set to `OVERWRITE` then the list of remote entities of this type will be overwritten by newly added entities. If set to `MERGE` - existing remote entities of this entity type will not be removed, new entities will just be added on top (or existing remote entities will be updated).\n- `syncStrategy` - default synchronization strategy to use when it is not specified for an entity type.\n\nExample for this type of request:\n```json\n{\n \"type\": \"COMPLEX\",\n\n \"versionName\": \"Devices and profiles: release 2\",\n \"branch\": \"master\",\n\n \"syncStrategy\": \"OVERWRITE\",\n \"entityTypes\": {\n \"DEVICE\": {\n \"syncStrategy\": null,\n \"allEntities\": true,\n \"saveRelations\": true,\n \"saveAttributes\": true,\n \"saveCredentials\": true\n },\n \"DEVICE_PROFILE\": {\n \"syncStrategy\": \"MERGE\",\n \"allEntities\": false,\n \"entityIds\": [\n \"b79448e0-d4f4-11ec-847b-0f432358ab48\"\n ],\n \"saveRelations\": true\n }\n }\n}\n```\n\nResponse wil contain generated request UUID, that can be then used to retrieve status of operation via `getVersionCreateRequestStatus`.\n\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveEntitiesVersion", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VersionCreateRequest" - } + "summary": "Get special group All by owner and entity type (getEntityGroupsByOwnerAndType)", + "description": "Fetch reserved group 'All' based on the provided Owner Id and Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupAllByOwnerAndType", + "parameters": [ + { + "name": "ownerType", + "in": "path", + "description": "Tenant or Customer", + "required": true, + "schema": { + "type": "string", + "enum": [ + "TENANT", + "CUSTOMER" + ] } }, - "required": true - }, + { + "name": "ownerId", + "in": "path", + "description": "A string value representing the Tenant or Customer id", + "required": true, + "schema": { + "type": "string" + }, + "example": "784f394c-42b6-435a-983c-b7beff2784f9" + }, + { + "name": "groupType", + "in": "path", + "description": "Entity Group type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string", - "format": "uuid" + "$ref": "#/components/schemas/EntityGroupInfo" } } } @@ -52435,7 +52111,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -52555,86 +52231,23 @@ ] } }, - "/api/entities/vc/version/{entityType}": { + "/api/entityGroup/{entityGroupId}": { "get": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "List entity type versions (listEntityTypeVersions)", - "description": "Returns list of versions of an entity type in a branch. This is a collected list of versions that were created for entities of this type in a remote branch. \nIf specified branch does not exist - empty page data will be returned. The response structure is the same as for `listEntityVersions` API method.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "listEntityTypeVersions", + "summary": "Get Entity Group Info (getEntityGroupById)", + "description": "Fetch the Entity Group object based on the provided Entity Group Id. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupById", "parameters": [ { - "name": "entityType", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "$ref": "#/components/schemas/EntityType" - } - }, - { - "name": "branch", - "in": "query", - "description": "The name of the working branch, for example 'master'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the entity version name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "timestamp" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -52643,7 +52256,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityVersion" + "$ref": "#/components/schemas/EntityGroupInfo" } } } @@ -52777,119 +52390,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/entities/vc/version/{entityType}/{externalEntityUuid}": { - "get": { + }, + "delete": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "List entity versions (listEntityVersions)", - "description": "Returns list of versions for a specific entity in a concrete branch. \nYou need to specify external id of an entity to list versions for. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity. \nIf specified branch does not exist - empty page data will be returned. \n\nEach version info item has timestamp, id, name and author. Version id can then be used to restore the version. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nResponse example: \n```json\n{\n \"data\": [\n {\n \"timestamp\": 1655198593000,\n \"id\": \"fd82625bdd7d6131cf8027b44ee967012ecaf990\",\n \"name\": \"Devices and assets - v2.0\",\n \"author\": \"John Doe \u003Cjohndoe@gmail.com\u003E\"\n },\n {\n \"timestamp\": 1655198528000,\n \"id\": \"682adcffa9c8a2f863af6f00c4850323acbd4219\",\n \"name\": \"Update my device\",\n \"author\": \"John Doe \u003Cjohndoe@gmail.com\u003E\"\n },\n {\n \"timestamp\": 1655198280000,\n \"id\": \"d2a6087c2b30e18cc55e7cdda345a8d0dfb959a4\",\n \"name\": \"Devices and assets - v1.0\",\n \"author\": \"John Doe \u003Cjohndoe@gmail.com\u003E\"\n }\n ],\n \"totalPages\": 1,\n \"totalElements\": 3,\n \"hasNext\": false\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "listEntityVersions", + "summary": "Delete Entity Group (deleteEntityGroup)", + "description": "Deletes the entity group but does not delete the entities in the group, since they are also present in reserved group 'All'. Referencing non-existing Entity Group Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'DELETE' permission for specified group.", + "operationId": "deleteEntityGroup", "parameters": [ { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "$ref": "#/components/schemas/EntityType" - } - }, - { - "name": "externalEntityUuid", + "name": "entityGroupId", "in": "path", - "description": "A string value representing external entity id. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity.", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "branch", - "in": "query", - "description": "The name of the working branch, for example 'master'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "internalEntityId", - "in": "query", - "required": false, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the entity version name.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "timestamp" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataEntityVersion" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -53022,37 +52544,43 @@ ] } }, - "/api/entities/vc/version/{requestId}/status": { - "get": { + "/api/entityGroup/{entityGroupId}/addEntities": { + "post": { "tags": [ - "entities-version-control-controller" + "entity-group-controller" ], - "summary": "Get version create request status (getVersionCreateRequestStatus)", - "description": "Returns the status of previously made version create request. \n\nThis status contains following properties:\n- `done` - whether request processing is finished;\n- `version` - created version info: timestamp, version id (commit hash), commit name and commit author;\n- `added` - count of items that were created in the remote repo;\n- `modified` - modified items count;\n- `removed` - removed items count;\n- `error` - error message, if an error occurred while handling the request.\n\nAn example of successful status:\n```json\n{\n \"done\": true,\n \"added\": 10,\n \"modified\": 2,\n \"removed\": 5,\n \"version\": {\n \"timestamp\": 1655198528000,\n \"id\":\"8a834dd389ed80e0759ba8ee338b3f1fd160a114\",\n \"name\": \"My devices v2.0\",\n \"author\": \"John Doe\"\n },\n \"error\": null\n}\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getVersionCreateRequestStatus", + "summary": "Add entities to the group (addEntitiesToEntityGroup)", + "description": "Add entities to the specified entity group. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'ADD_TO_GROUP' permission for specified group.", + "operationId": "addEntitiesToEntityGroup", "parameters": [ { - "name": "requestId", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VersionCreationResult" + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "A list of entity ids", + "items": { + "type": "string" } } } }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + }, "400": { "description": "Bad Request", "content": { @@ -53064,7 +52592,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -53184,55 +52712,43 @@ ] } }, - "/api/allEntityGroups/edge/{edgeId}/{groupType}": { - "get": { + "/api/entityGroup/{entityGroupId}/deleteEntities": { + "post": { "tags": [ "entity-group-controller" ], - "summary": "Get All Edge Entity Groups by entity type (getAllEdgeEntityGroups)", - "description": "Fetch the list of Entity Group Info objects based on the provided Entity Type and assigned to the provided Edge entity. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getAllEdgeEntityGroups", + "summary": "Remove entities from the group (removeEntitiesFromEntityGroup)", + "description": "Removes entities from the specified entity group. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'REMOVE_FROM_GROUP' permission for specified group.", + "operationId": "removeEntitiesFromEntityGroup", "parameters": [ { - "name": "edgeId", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - }, - { - "name": "groupType", - "in": "path", - "description": "EntityGroup type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD" - ] - } } ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityGroupInfo" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "A list of entity ids", + "items": { + "type": "string" } } } }, + "required": true + }, + "responses": { + "200": { + "description": "OK" + }, "400": { "description": "Bad Request", "content": { @@ -53244,7 +52760,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -53364,48 +52880,74 @@ ] } }, - "/api/edge/{edgeId}/entityGroup/{entityGroupId}/{groupType}": { - "post": { + "/api/entityGroup/{entityGroupId}/entities": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Assign entity group to edge (assignEntityGroupToEdge)", - "description": "Creates assignment of an existing entity group to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment entity group (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once entity group will be delivered to edge service, edge will request entities of this group to be send to edge. Once entities will be delivered to edge service, they are going to be available for usage on remote edge instance.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "assignEntityGroupToEdge", + "summary": "Get Group Entities (getEntities)", + "description": "Returns a page of Short Entity View objects that belongs to specified Entity Group Id. Short Entity View object contains the entity id and number of fields (attributes, telemetry, etc). List of those fields is configurable and defined in the group configuration.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntities", "parameters": [ { - "name": "edgeId", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "groupType", - "in": "path", - "description": "EntityGroup type", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { "type": "string", - "enum": [ - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD" - ] + "minimum": 1 } }, { - "name": "entityGroupId", - "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the entity group name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -53414,7 +52956,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityGroup" + "$ref": "#/components/schemas/PageDataShortEntityView" } } } @@ -53430,7 +52972,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -53548,40 +53090,171 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/entityGroup/{entityGroupId}/makePrivate": { + "post": { "tags": [ "entity-group-controller" ], - "summary": "Unassign entity group from edge (unassignEntityGroupFromEdge)", - "description": "Clears assignment of the entity group to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove entity group (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove entity group and entities inside this group locally.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "unassignEntityGroupFromEdge", + "summary": "Make Entity Group Private (makeEntityGroupPrivate)", + "description": "Make the entity group not available for non authorized users. Every group is private by default. This call is useful to hide the group that was previously made public.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", + "operationId": "makeEntityGroupPrivate", "parameters": [ { - "name": "edgeId", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "OK" }, - { - "name": "groupType", - "in": "path", - "description": "EntityGroup type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD" - ] + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/entityGroup/{entityGroupId}/makePublic": { + "post": { + "tags": [ + "entity-group-controller" + ], + "summary": "Make Entity Group Publicly available (makeEntityGroupPublic)", + "description": "Make the entity group available for non authorized users. Useful for public dashboards that will be embedded into the public websites. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", + "operationId": "makeEntityGroupPublic", + "parameters": [ { "name": "entityGroupId", "in": "path", @@ -53594,14 +53267,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityGroup" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -53614,7 +53280,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -53734,19 +53400,30 @@ ] } }, - "/api/entityGroup": { + "/api/entityGroup/{entityGroupId}/share": { "post": { "tags": [ "entity-group-controller" ], - "summary": "Create Or Update Entity Group (saveEntityGroup)", - "description": "Create or update the Entity Group. When creating Entity Group, platform generates Entity Group Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Entity Group Id will be present in the response. Specify existing Entity Group Id to update the group. Referencing non-existing Entity Group Id will cause 'Not Found' error.Remove 'id', 'tenantId' and optionally 'ownerId' from the request body example (below) to create new Entity Group entity. \n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", - "operationId": "saveEntityGroup", + "summary": "Share the Entity Group (shareEntityGroup)", + "description": "Share the entity group with certain user group based on the provided Share Group Request. The request is quite flexible and processing of the request involves multiple security checks using platform RBAC feature.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", + "operationId": "shareEntityGroup", + "parameters": [ + { + "name": "entityGroupId", + "in": "path", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityGroup" + "$ref": "#/components/schemas/ShareGroupRequest" } } }, @@ -53754,14 +53431,7 @@ }, "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityGroupInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -53894,54 +53564,31 @@ ] } }, - "/api/entityGroup/all/{ownerType}/{ownerId}/{groupType}": { + "/api/entityGroup/{entityGroupId}/{entityId}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get special group All by owner and entity type (getEntityGroupsByOwnerAndType)", - "description": "Fetch reserved group 'All' based on the provided Owner Id and Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupAllByOwnerAndType", + "summary": "Get Group Entity (getGroupEntity)", + "description": "Fetch the Short Entity View object based on the group and entity id. Short Entity View object contains the entity id and number of fields (attributes, telemetry, etc). List of those fields is configurable and defined in the group configuration.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getGroupEntity", "parameters": [ { - "name": "ownerType", + "name": "entityGroupId", "in": "path", - "description": "Tenant or Customer", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "enum": [ - "TENANT", - "CUSTOMER" - ] + "type": "string" } }, { - "name": "ownerId", + "name": "entityId", "in": "path", - "description": "A string value representing the Tenant or Customer id", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" - }, - "example": "784f394c-42b6-435a-983c-b7beff2784f9" - }, - { - "name": "groupType", - "in": "path", - "description": "Entity Group type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] } } ], @@ -53951,7 +53598,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityGroupInfo" + "$ref": "#/components/schemas/ShortEntityView" } } } @@ -54087,19 +53734,37 @@ ] } }, - "/api/entityGroup/{entityGroupId}": { - "get": { + "/api/entityGroup/{entityGroupId}/{userGroupId}/{roleId}/share": { + "post": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Group Info (getEntityGroupById)", - "description": "Fetch the Entity Group object based on the provided Entity Group Id. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupById", + "summary": "Share the Entity Group with User group (shareEntityGroupToChildOwnerUserGroup)", + "description": "Share the entity group with specified user group using specified role. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", + "operationId": "shareEntityGroupToChildOwnerUserGroup", "parameters": [ { "name": "entityGroupId", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id that you would like to share. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "userGroupId", + "in": "path", + "description": "A string value representing the Entity(User) Group Id that you would like to share with. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "roleId", + "in": "path", + "description": "A string value representing the Role Id that describes set of permissions you would like to share (read, write, etc). For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -54108,14 +53773,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityGroupInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -54128,7 +53786,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -54246,19 +53904,62 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/entityGroup/{ownerType}/{ownerId}/{groupType}/{groupName}": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Delete Entity Group (deleteEntityGroup)", - "description": "Deletes the entity group but does not delete the entities in the group, since they are also present in reserved group 'All'. Referencing non-existing Entity Group Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'DELETE' permission for specified group.", - "operationId": "deleteEntityGroup", + "summary": "Get Entity Group by owner, type and name (getEntityGroupByOwnerAndNameAndType)", + "description": "Fetch the Entity Group object based on the provided Entity Group Id. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupByOwnerAndNameAndType", "parameters": [ { - "name": "entityGroupId", + "name": "ownerType", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Tenant or Customer", + "required": true, + "schema": { + "type": "string", + "enum": [ + "TENANT", + "CUSTOMER" + ] + } + }, + { + "name": "ownerId", + "in": "path", + "description": "A string value representing the Tenant or Customer id", + "required": true, + "schema": { + "type": "string" + }, + "example": "784f394c-42b6-435a-983c-b7beff2784f9" + }, + { + "name": "groupType", + "in": "path", + "description": "Entity Group type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] + } + }, + { + "name": "groupName", + "in": "path", + "description": "Entity Group name", "required": true, "schema": { "type": "string" @@ -54267,7 +53968,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityGroupInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -54400,14 +54108,14 @@ ] } }, - "/api/entityGroup/{entityGroupId}/addEntities": { - "post": { + "/api/entityGroupInfo/{entityGroupId}": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Add entities to the group (addEntitiesToEntityGroup)", - "description": "Add entities to the specified entity group. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'ADD_TO_GROUP' permission for specified group.", - "operationId": "addEntitiesToEntityGroup", + "summary": "Get Entity Group Entity Info (getEntityGroupEntityInfoById)", + "description": "Fetch the Entity Group Entity Info object based on the provided Entity Group Id. Entity Info is a lightweight object that contains only id and name of the entity group. \n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupEntityInfoById", "parameters": [ { "name": "entityGroupId", @@ -54419,24 +54127,17 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "description": "A list of entity ids", - "items": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityInfo" } } } }, - "required": true - }, - "responses": { - "200": { - "description": "OK" - }, "400": { "description": "Bad Request", "content": { @@ -54448,7 +54149,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -54568,43 +54269,42 @@ ] } }, - "/api/entityGroup/{entityGroupId}/deleteEntities": { - "post": { + "/api/entityGroupInfos": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Remove entities from the group (removeEntitiesFromEntityGroup)", - "description": "Removes entities from the specified entity group. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'REMOVE_FROM_GROUP' permission for specified group.", - "operationId": "removeEntitiesFromEntityGroup", + "summary": "Get Entity Group Entity Infos by Ids (getEntityGroupEntityInfosByIds)", + "description": "Fetch the list of Entity Group Entity Info objects based on the provided entity group ids list. Entity Info is a lightweight object that contains only id and name of the entity group. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupEntityInfosByIds", "parameters": [ { - "name": "entityGroupId", - "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "entityGroupIds", + "in": "query", + "description": "A list of group ids, separated by comma ','", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "description": "A list of entity ids", - "items": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityInfo" + } } } } }, - "required": true - }, - "responses": { - "200": { - "description": "OK" - }, "400": { "description": "Bad Request", "content": { @@ -54616,7 +54316,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -54736,22 +54436,40 @@ ] } }, - "/api/entityGroup/{entityGroupId}/entities": { + "/api/entityGroupInfos/{groupType}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Group Entities (getEntities)", - "description": "Returns a page of Short Entity View objects that belongs to specified Entity Group Id. Short Entity View object contains the entity id and number of fields (attributes, telemetry, etc). List of those fields is configurable and defined in the group configuration.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntities", + "summary": "Get Entity Group Entity Infos by entity type and page link (getEntityGroupEntityInfosByTypeAndPageLink)", + "description": "Returns a page of Entity Group Entity Info objects based on the provided Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupEntityInfosByTypeAndPageLink", "parameters": [ { - "name": "entityGroupId", + "name": "groupType", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Entity Group type", "required": true, "schema": { - "type": "string" + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] + } + }, + { + "name": "includeShared", + "in": "query", + "description": "Whether to include shared entity groups.", + "required": false, + "schema": { + "type": "boolean" } }, { @@ -54812,7 +54530,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataShortEntityView" + "$ref": "#/components/schemas/PageDataEntityInfo" } } } @@ -54948,28 +54666,95 @@ ] } }, - "/api/entityGroup/{entityGroupId}/makePrivate": { - "post": { + "/api/entityGroupInfos/{groupType}/shared": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Make Entity Group Private (makeEntityGroupPrivate)", - "description": "Make the entity group not available for non authorized users. Every group is private by default. This call is useful to hide the group that was previously made public.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", - "operationId": "makeEntityGroupPrivate", + "summary": "Get Shared Entity Group Entity Infos by entity type and page link (getSharedEntityGroupEntityInfosByTypeAndPageLink)", + "description": "Returns a page of Shared Entity Group Entity Info objects based on the provided Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getSharedEntityGroupEntityInfosByTypeAndPageLink", "parameters": [ { - "name": "entityGroupId", + "name": "groupType", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Entity Group type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the entity group name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataEntityInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -54982,7 +54767,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -55102,28 +54887,118 @@ ] } }, - "/api/entityGroup/{entityGroupId}/makePublic": { - "post": { + "/api/entityGroupInfos/{ownerType}/{ownerId}/{groupType}": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Make Entity Group Publicly available (makeEntityGroupPublic)", - "description": "Make the entity group available for non authorized users. Useful for public dashboards that will be embedded into the public websites. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", - "operationId": "makeEntityGroupPublic", + "summary": "Get Entity Group Entity Infos by owner and entity type and page link (getEntityGroupEntityInfosByOwnerAndTypeAndPageLink)", + "description": "Returns a page of Entity Group Entity Info objects based on the provided Owner Id and Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupEntityInfosByOwnerAndTypeAndPageLink", "parameters": [ { - "name": "entityGroupId", + "name": "ownerType", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Tenant or Customer", + "required": true, + "schema": { + "type": "string", + "enum": [ + "TENANT", + "CUSTOMER" + ] + } + }, + { + "name": "ownerId", + "in": "path", + "description": "A string value representing the Tenant or Customer id", + "required": true, + "schema": { + "type": "string" + }, + "example": "784f394c-42b6-435a-983c-b7beff2784f9" + }, + { + "name": "groupType", + "in": "path", + "description": "Entity Group type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the entity group name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataEntityInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -55136,7 +55011,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -55256,38 +55131,118 @@ ] } }, - "/api/entityGroup/{entityGroupId}/share": { - "post": { + "/api/entityGroupInfosHierarchy/{ownerType}/{ownerId}/{groupType}": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Share the Entity Group (shareEntityGroup)", - "description": "Share the entity group with certain user group based on the provided Share Group Request. The request is quite flexible and processing of the request involves multiple security checks using platform RBAC feature.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", - "operationId": "shareEntityGroup", + "summary": "Get Entity Group Entity Infos for all owners starting from specified than ending with owner of current user (getEntityGroupEntityInfosHierarchyByOwnerAndTypeAndPageLink)", + "description": "Returns a page of Entity Group Entity Info objects based on the provided Owner Id and Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupEntityInfosHierarchyByOwnerAndTypeAndPageLink", "parameters": [ { - "name": "entityGroupId", + "name": "ownerType", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Tenant or Customer", + "required": true, + "schema": { + "type": "string", + "enum": [ + "TENANT", + "CUSTOMER" + ] + } + }, + { + "name": "ownerId", + "in": "path", + "description": "A string value representing the Tenant or Customer id", "required": true, "schema": { "type": "string" + }, + "example": "784f394c-42b6-435a-983c-b7beff2784f9" + }, + { + "name": "groupType", + "in": "path", + "description": "Entity Group type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShareGroupRequest" - } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "string", + "minimum": 1 } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the entity group name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataEntityInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -55300,7 +55255,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -55420,32 +55375,90 @@ ] } }, - "/api/entityGroup/{entityGroupId}/{entityId}": { + "/api/entityGroups/edge/{edgeId}/{groupType}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Group Entity (getGroupEntity)", - "description": "Fetch the Short Entity View object based on the group and entity id. Short Entity View object contains the entity id and number of fields (attributes, telemetry, etc). List of those fields is configurable and defined in the group configuration.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getGroupEntity", + "summary": "Get Edge Entity Groups by entity type (getEdgeEntityGroups)", + "description": "Returns a page of Entity Group Info objects based on the provided Entity Type and assigned to the provided Edge entity. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getEdgeEntityGroups", "parameters": [ { - "name": "entityGroupId", + "name": "edgeId", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "entityId", + "name": "groupType", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "EntityGroup type", "required": true, + "schema": { + "type": "string", + "enum": [ + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD" + ] + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the entity group name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -55454,7 +55467,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ShortEntityView" + "$ref": "#/components/schemas/PageDataEntityGroupInfo" } } } @@ -55590,46 +55603,41 @@ ] } }, - "/api/entityGroup/{entityGroupId}/{userGroupId}/{roleId}/share": { - "post": { + "/api/entityGroups/list": { + "get": { "tags": [ "entity-group-controller" ], - "summary": "Share the Entity Group with User group (shareEntityGroupToChildOwnerUserGroup)", - "description": "Share the entity group with specified user group using specified role. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for specified group.", - "operationId": "shareEntityGroupToChildOwnerUserGroup", + "summary": "Get Entity Groups by Ids (getEntityGroupsByIds)", + "description": "Fetch the list of Entity Group Info objects based on the provided entity group ids list. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupsByIds", "parameters": [ { - "name": "entityGroupId", - "in": "path", - "description": "A string value representing the Entity Group Id that you would like to share. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "userGroupId", - "in": "path", - "description": "A string value representing the Entity(User) Group Id that you would like to share with. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "roleId", - "in": "path", - "description": "A string value representing the Role Id that describes set of permissions you would like to share (read, write, etc). For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "entityGroupIds", + "in": "query", + "description": "A list of group ids, separated by comma ','", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityGroupInfo" + } + } + } + } }, "400": { "description": "Bad Request", @@ -55642,7 +55650,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -55762,40 +55770,17 @@ ] } }, - "/api/entityGroup/{ownerType}/{ownerId}/{groupType}/{groupName}": { + "/api/entityGroups/{entityType}/{entityId}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Group by owner, type and name (getEntityGroupByOwnerAndNameAndType)", - "description": "Fetch the Entity Group object based on the provided Entity Group Id. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupByOwnerAndNameAndType", + "summary": "Get Entity Groups by Entity Id (getEntityGroupsForEntity)", + "description": "Returns a list of groups that contain the specified Entity Id. For example, all device groups that contain specific device. The list always contain at least one element - special group 'All'.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getEntityGroupsForEntity", "parameters": [ { - "name": "ownerType", - "in": "path", - "description": "Tenant or Customer", - "required": true, - "schema": { - "type": "string", - "enum": [ - "TENANT", - "CUSTOMER" - ] - } - }, - { - "name": "ownerId", - "in": "path", - "description": "A string value representing the Tenant or Customer id", - "required": true, - "schema": { - "type": "string" - }, - "example": "784f394c-42b6-435a-983c-b7beff2784f9" - }, - { - "name": "groupType", + "name": "entityType", "in": "path", "description": "Entity Group type", "required": true, @@ -55813,9 +55798,9 @@ } }, { - "name": "groupName", + "name": "entityId", "in": "path", - "description": "Entity Group name", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -55828,7 +55813,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityGroupInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityGroupId" + } } } } @@ -55964,23 +55952,92 @@ ] } }, - "/api/entityGroupInfo/{entityGroupId}": { + "/api/entityGroups/{groupType}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Group Entity Info (getEntityGroupEntityInfoById)", - "description": "Fetch the Entity Group Entity Info object based on the provided Entity Group Id. Entity Info is a lightweight object that contains only id and name of the entity group. \n\nEntity group name is unique in the scope of owner and entity type. For example, you can't create two tenant device groups called 'Water meters'. However, you may create device and asset group with the same name. And also you may create groups with the same name for two different customers of the same tenant. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupEntityInfoById", + "summary": "Get Entity Groups by entity type and page link (getEntityGroupsByTypeAndPageLink)", + "description": "Returns a page of Entity Group Info objects based on the provided Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupsByTypeAndPageLink", "parameters": [ { - "name": "entityGroupId", + "name": "groupType", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Entity Group type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] + } + }, + { + "name": "includeShared", + "in": "query", + "description": "Whether to include shared entity groups.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the entity group name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -55989,7 +56046,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityInfo" + "$ref": "#/components/schemas/PageDataEntityGroupInfo" } } } @@ -56125,25 +56182,40 @@ ] } }, - "/api/entityGroupInfos": { + "/api/entityGroups/{groupType}/all": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Group Entity Infos by Ids (getEntityGroupEntityInfosByIds)", - "description": "Fetch the list of Entity Group Entity Info objects based on the provided entity group ids list. Entity Info is a lightweight object that contains only id and name of the entity group. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupEntityInfosByIds", + "summary": "Get Entity Groups by entity type (getAllEntityGroupsByType)", + "description": "Fetch the list of Entity Group Info objects based on the provided Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getAllEntityGroupsByType", "parameters": [ { - "name": "entityGroupIds", - "in": "query", - "description": "A list of group ids, separated by comma ','", + "name": "groupType", + "in": "path", + "description": "Entity Group type", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string", + "enum": [ + "CUSTOMER", + "ASSET", + "DEVICE", + "USER", + "ENTITY_VIEW", + "DASHBOARD", + "EDGE" + ] + } + }, + { + "name": "includeShared", + "in": "query", + "description": "Whether to include shared entity groups.", + "required": false, + "schema": { + "type": "boolean" } } ], @@ -56155,7 +56227,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityInfo" + "$ref": "#/components/schemas/EntityGroupInfo" } } } @@ -56292,14 +56364,14 @@ ] } }, - "/api/entityGroupInfos/{groupType}": { + "/api/entityGroups/{groupType}/shared": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Group Entity Infos by entity type and page link (getEntityGroupEntityInfosByTypeAndPageLink)", - "description": "Returns a page of Entity Group Entity Info objects based on the provided Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupEntityInfosByTypeAndPageLink", + "summary": "Get Shared Entity Groups by entity type and page link (getSharedEntityGroupsByTypeAndPageLink)", + "description": "Returns a page of Shared Entity Group Info objects based on the provided Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getSharedEntityGroupsByTypeAndPageLink", "parameters": [ { "name": "groupType", @@ -56319,15 +56391,6 @@ ] } }, - { - "name": "includeShared", - "in": "query", - "description": "Whether to include shared entity groups.", - "required": false, - "schema": { - "type": "boolean" - } - }, { "name": "pageSize", "in": "query", @@ -56386,7 +56449,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityInfo" + "$ref": "#/components/schemas/PageDataEntityGroupInfo" } } } @@ -56522,14 +56585,14 @@ ] } }, - "/api/entityGroupInfos/{groupType}/shared": { + "/api/entityGroups/{groupType}/shared/all": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Shared Entity Group Entity Infos by entity type and page link (getSharedEntityGroupEntityInfosByTypeAndPageLink)", - "description": "Returns a page of Shared Entity Group Entity Info objects based on the provided Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getSharedEntityGroupEntityInfosByTypeAndPageLink", + "summary": "Get Shared Entity Groups by entity type (getAllSharedEntityGroups)", + "description": "Fetch the list of Shared Entity Group Info objects based on the provided Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getAllSharedEntityGroups", "parameters": [ { "name": "groupType", @@ -56548,57 +56611,6 @@ "EDGE" ] } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the entity group name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -56607,7 +56619,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityGroupInfo" + } } } } @@ -56743,14 +56758,14 @@ ] } }, - "/api/entityGroupInfos/{ownerType}/{ownerId}/{groupType}": { + "/api/entityGroups/{ownerType}/{ownerId}/{groupType}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Group Entity Infos by owner and entity type and page link (getEntityGroupEntityInfosByOwnerAndTypeAndPageLink)", - "description": "Returns a page of Entity Group Entity Info objects based on the provided Owner Id and Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupEntityInfosByOwnerAndTypeAndPageLink", + "summary": "Get Entity Groups by owner and entity type and page link (getEntityGroupsByOwnerAndTypeAndPageLink)", + "description": "Returns a page of Entity Group objects based on the provided Owner Id and Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupsByOwnerAndTypeAndPageLink", "parameters": [ { "name": "ownerType", @@ -56851,7 +56866,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityInfo" + "$ref": "#/components/schemas/PageDataEntityGroupInfo" } } } @@ -56987,14 +57002,14 @@ ] } }, - "/api/entityGroupInfosHierarchy/{ownerType}/{ownerId}/{groupType}": { + "/api/entityGroups/{ownerType}/{ownerId}/{groupType}/all": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Group Entity Infos for all owners starting from specified than ending with owner of current user (getEntityGroupEntityInfosHierarchyByOwnerAndTypeAndPageLink)", - "description": "Returns a page of Entity Group Entity Info objects based on the provided Owner Id and Entity Type and Page Link. Entity Info is a lightweight object that contains only id and name of the entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupEntityInfosHierarchyByOwnerAndTypeAndPageLink", + "summary": "Get Entity Groups by owner and entity type (getAllEntityGroupsByOwnerAndType)", + "description": "Fetch the list of Entity Group Info objects based on the provided Owner Id and Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getAllEntityGroupsByOwnerAndType", "parameters": [ { "name": "ownerType", @@ -57036,57 +57051,6 @@ "EDGE" ] } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the entity group name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -57095,7 +57059,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityGroupInfo" + } } } } @@ -57231,37 +57198,53 @@ ] } }, - "/api/entityGroups/edge/{edgeId}/{groupType}": { + "/api/entityGroupsHierarchy/{ownerType}/{ownerId}/{groupType}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Edge Entity Groups by entity type (getEdgeEntityGroups)", - "description": "Returns a page of Entity Group Info objects based on the provided Entity Type and assigned to the provided Edge entity. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getEdgeEntityGroups", + "summary": "Get Entity Groups for all owners starting from specified than ending with owner of current user (getEntityGroupsHierarchyByOwnerAndTypeAndPageLink)", + "description": "Returns a page of Entity Group objects based on the provided Owner Id and Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityGroupsHierarchyByOwnerAndTypeAndPageLink", "parameters": [ { - "name": "edgeId", + "name": "ownerType", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Tenant or Customer", "required": true, "schema": { - "type": "string" + "type": "string", + "enum": [ + "TENANT", + "CUSTOMER" + ] } }, + { + "name": "ownerId", + "in": "path", + "description": "A string value representing the Tenant or Customer id", + "required": true, + "schema": { + "type": "string" + }, + "example": "784f394c-42b6-435a-983c-b7beff2784f9" + }, { "name": "groupType", "in": "path", - "description": "EntityGroup type", + "description": "Entity Group type", "required": true, "schema": { "type": "string", "enum": [ + "CUSTOMER", "ASSET", "DEVICE", "USER", "ENTITY_VIEW", - "DASHBOARD" + "DASHBOARD", + "EDGE" ] } }, @@ -57459,208 +57442,37 @@ ] } }, - "/api/entityGroups/list": { - "get": { - "tags": [ - "entity-group-controller" - ], - "summary": "Get Entity Groups by Ids (getEntityGroupsByIds)", - "description": "Fetch the list of Entity Group Info objects based on the provided entity group ids list. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupsByIds", - "parameters": [ - { - "name": "entityGroupIds", - "in": "query", - "description": "A list of group ids, separated by comma ','", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityGroupInfo" - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - } - }, - "/api/entityGroups/{entityType}/{entityId}": { + "/api/ownerInfo/{ownerType}/{ownerId}": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Groups by Entity Id (getEntityGroupsForEntity)", - "description": "Returns a list of groups that contain the specified Entity Id. For example, all device groups that contain specific device. The list always contain at least one element - special group 'All'.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getEntityGroupsForEntity", + "summary": "Get Owner Info (getOwnerInfo)", + "description": "Fetch the owner info (tenant or customer) presented as Entity Info object based on the provided owner Id. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getOwnerInfo", "parameters": [ { - "name": "entityType", + "name": "ownerType", "in": "path", - "description": "Entity Group type", + "description": "Tenant or Customer", "required": true, "schema": { "type": "string", "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" + "TENANT", + "CUSTOMER" ] } }, { - "name": "entityId", + "name": "ownerId", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Tenant or Customer id", "required": true, "schema": { "type": "string" - } + }, + "example": "784f394c-42b6-435a-983c-b7beff2784f9" } ], "responses": { @@ -57669,10 +57481,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityGroupId" - } + "$ref": "#/components/schemas/EntityInfo" } } } @@ -57808,42 +57617,15 @@ ] } }, - "/api/entityGroups/{groupType}": { + "/api/ownerInfos": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Groups by entity type and page link (getEntityGroupsByTypeAndPageLink)", - "description": "Returns a page of Entity Group Info objects based on the provided Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupsByTypeAndPageLink", + "summary": "Get Owner Infos (getOwnerInfos)", + "description": "Provides a rage view of Customers that the current user has READ access to. If the current user is Tenant administrator, the result set also contains the tenant. The call is designed for the UI auto-complete component to show tenant and all possible Customers that the user may select to change the owner of the particular entity or entity group.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getOwnerInfos", "parameters": [ - { - "name": "groupType", - "in": "path", - "description": "Entity Group type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] - } - }, - { - "name": "includeShared", - "in": "query", - "description": "Whether to include shared entity groups.", - "required": false, - "schema": { - "type": "boolean" - } - }, { "name": "pageSize", "in": "query", @@ -57902,7 +57684,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityGroupInfo" + "$ref": "#/components/schemas/PageDataEntityInfo" } } } @@ -58038,40 +57820,64 @@ ] } }, - "/api/entityGroups/{groupType}/all": { + "/api/owners": { "get": { "tags": [ "entity-group-controller" ], - "summary": "Get Entity Groups by entity type (getAllEntityGroupsByType)", - "description": "Fetch the list of Entity Group Info objects based on the provided Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getAllEntityGroupsByType", + "summary": "Get Owners (getOwners)", + "description": "Provides a rage view of Customers that the current user has READ access to. If the current user is Tenant administrator, the result set also contains the tenant. The call is designed for the UI auto-complete component to show tenant and all possible Customers that the user may select to change the owner of the particular entity or entity group.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getOwners", "parameters": [ { - "name": "groupType", - "in": "path", - "description": "Entity Group type", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] + "minimum": 1 } }, { - "name": "includeShared", + "name": "page", "in": "query", - "description": "Whether to include shared entity groups.", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the entity group name.", "required": false, "schema": { - "type": "boolean" + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -58081,10 +57887,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityGroupInfo" - } + "$ref": "#/components/schemas/PageDataContactBasedObject" } } } @@ -58220,92 +58023,32 @@ ] } }, - "/api/entityGroups/{groupType}/shared": { - "get": { + "/api/alarmsQuery/count": { + "post": { "tags": [ - "entity-group-controller" + "entity-query-controller" ], - "summary": "Get Shared Entity Groups by entity type and page link (getSharedEntityGroupsByTypeAndPageLink)", - "description": "Returns a page of Shared Entity Group Info objects based on the provided Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getSharedEntityGroupsByTypeAndPageLink", - "parameters": [ - { - "name": "groupType", - "in": "path", - "description": "Entity Group type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the entity group name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" + "summary": "Count Alarms by Query (countAlarmsByQuery)", + "description": "Returns the number of alarms that match the query definition.", + "operationId": "countAlarmsByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlarmCountQuery" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityGroupInfo" + "type": "integer", + "format": "int64" } } } @@ -58321,7 +58064,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -58441,44 +58184,31 @@ ] } }, - "/api/entityGroups/{groupType}/shared/all": { - "get": { + "/api/alarmsQuery/find": { + "post": { "tags": [ - "entity-group-controller" + "entity-query-controller" ], - "summary": "Get Shared Entity Groups by entity type (getAllSharedEntityGroups)", - "description": "Fetch the list of Shared Entity Group Info objects based on the provided Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getAllSharedEntityGroups", - "parameters": [ - { - "name": "groupType", - "in": "path", - "description": "Entity Group type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] + "summary": "Find Alarms by Query", + "description": "This method description defines how Alarm Data Query extends the Entity Data Query. See method 'Find Entity Data by Query' first to get the info about 'Entity Data Query'.\n\n The platform will first search the entities that match the entity and key filters. Then, the platform will use 'Alarm Page Link' to filter the alarms related to those entities. Finally, platform fetch the properties of alarm that are defined in the **'alarmFields'** and combine them with the other entity, attribute and latest time series fields to return the result. \n\n See example of the alarm query below. The query will search first 100 active alarms with type 'Temperature Alarm' or 'Fire Alarm' for any device with current temperature > 0. The query will return combination of the entity fields: name of the device, device model and latest temperature reading and alarms fields: createdTime, type, severity and status: \n\n```json\n{\n \"entityFilter\": {\n \"type\": \"entityType\",\n \"resolveMultiple\": true,\n \"entityType\": \"DEVICE\"\n },\n \"pageLink\": {\n \"page\": 0,\n \"pageSize\": 100,\n \"textSearch\": null,\n \"searchPropagatedAlarms\": false,\n \"statusList\": [\n \"ACTIVE\"\n ],\n \"severityList\": [\n \"CRITICAL\",\n \"MAJOR\"\n ],\n \"typeList\": [\n \"Temperature Alarm\",\n \"Fire Alarm\"\n ],\n \"sortOrder\": {\n \"key\": {\n \"key\": \"createdTime\",\n \"type\": \"ALARM_FIELD\"\n },\n \"direction\": \"DESC\"\n },\n \"timeWindow\": 86400000\n },\n \"keyFilters\": [\n {\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n }\n ],\n \"alarmFields\": [\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"createdTime\"\n },\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"type\"\n },\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"severity\"\n },\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"status\"\n }\n ],\n \"entityFields\": [\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"name\"\n }\n ],\n \"latestValues\": [\n {\n \"type\": \"ATTRIBUTE\",\n \"key\": \"model\"\n },\n {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n }\n ]\n}\n```", + "operationId": "findAlarmDataByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlarmDataQuery" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityGroupInfo" - } + "$ref": "#/components/schemas/PageDataAlarmData" } } } @@ -58494,7 +58224,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -58614,115 +58344,20 @@ ] } }, - "/api/entityGroups/{ownerType}/{ownerId}/{groupType}": { + "/api/edqs/state": { "get": { "tags": [ - "entity-group-controller" - ], - "summary": "Get Entity Groups by owner and entity type and page link (getEntityGroupsByOwnerAndTypeAndPageLink)", - "description": "Returns a page of Entity Group objects based on the provided Owner Id and Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupsByOwnerAndTypeAndPageLink", - "parameters": [ - { - "name": "ownerType", - "in": "path", - "description": "Tenant or Customer", - "required": true, - "schema": { - "type": "string", - "enum": [ - "TENANT", - "CUSTOMER" - ] - } - }, - { - "name": "ownerId", - "in": "path", - "description": "A string value representing the Tenant or Customer id", - "required": true, - "schema": { - "type": "string" - }, - "example": "784f394c-42b6-435a-983c-b7beff2784f9" - }, - { - "name": "groupType", - "in": "path", - "description": "Entity Group type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the entity group name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } + "entity-query-controller" ], + "summary": "getEdqsState", + "operationId": "getEdqsState", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityGroupInfo" + "$ref": "#/components/schemas/EdqsState" } } } @@ -58858,70 +58493,26 @@ ] } }, - "/api/entityGroups/{ownerType}/{ownerId}/{groupType}/all": { - "get": { + "/api/edqs/system/request": { + "post": { "tags": [ - "entity-group-controller" + "entity-query-controller" ], - "summary": "Get Entity Groups by owner and entity type (getAllEntityGroupsByOwnerAndType)", - "description": "Fetch the list of Entity Group Info objects based on the provided Owner Id and Entity Type. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.Entity Group Info extends Entity Group object and adds 'ownerIds' - a list of owner ids.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getAllEntityGroupsByOwnerAndType", - "parameters": [ - { - "name": "ownerType", - "in": "path", - "description": "Tenant or Customer", - "required": true, - "schema": { - "type": "string", - "enum": [ - "TENANT", - "CUSTOMER" - ] + "summary": "processSystemEdqsRequest", + "operationId": "processSystemEdqsRequest", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToCoreEdqsRequest" + } } }, - { - "name": "ownerId", - "in": "path", - "description": "A string value representing the Tenant or Customer id", - "required": true, - "schema": { - "type": "string" - }, - "example": "784f394c-42b6-435a-983c-b7beff2784f9" - }, - { - "name": "groupType", - "in": "path", - "description": "Entity Group type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] - } - } - ], + "required": true + }, "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityGroupInfo" - } - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -58934,7 +58525,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -59054,115 +58645,32 @@ ] } }, - "/api/entityGroupsHierarchy/{ownerType}/{ownerId}/{groupType}": { - "get": { + "/api/entitiesQuery/count": { + "post": { "tags": [ - "entity-group-controller" + "entity-query-controller" ], - "summary": "Get Entity Groups for all owners starting from specified than ending with owner of current user (getEntityGroupsHierarchyByOwnerAndTypeAndPageLink)", - "description": "Returns a page of Entity Group objects based on the provided Owner Id and Entity Type and Page Link. Entity group allows you to group multiple entities of the same entity type (Device, Asset, Customer, User, Dashboard, etc). Entity Group always have an owner - particular Tenant or Customer. Each entity may belong to multiple groups simultaneously.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityGroupsHierarchyByOwnerAndTypeAndPageLink", - "parameters": [ - { - "name": "ownerType", - "in": "path", - "description": "Tenant or Customer", - "required": true, - "schema": { - "type": "string", - "enum": [ - "TENANT", - "CUSTOMER" - ] - } - }, - { - "name": "ownerId", - "in": "path", - "description": "A string value representing the Tenant or Customer id", - "required": true, - "schema": { - "type": "string" - }, - "example": "784f394c-42b6-435a-983c-b7beff2784f9" - }, - { - "name": "groupType", - "in": "path", - "description": "Entity Group type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "CUSTOMER", - "ASSET", - "DEVICE", - "USER", - "ENTITY_VIEW", - "DASHBOARD", - "EDGE" - ] - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the entity group name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" + "summary": "Count Entities by Query", + "description": "Allows to run complex queries to search the count of platform entities (devices, assets, customers, etc) based on the combination of main entity filter and multiple key filters. Returns the number of entities that match the query definition.\n\n# Query Definition\n\n\n\nMain **entity filter** is mandatory and defines generic search criteria. For example, \"find all devices with profile 'Moisture Sensor'\" or \"Find all devices related to asset 'Building A'\"\n\nOptional **key filters** allow to filter results of the entity filter by complex criteria against main entity fields (name, label, type, etc), attributes and telemetry. For example, \"temperature > 20 or temperature< 10\" or \"name starts with 'T', and attribute 'model' is 'T1000', and time series field 'batteryLevel' > 40\".\n\nLet's review the example:\n\n```json\n{\n \"entityFilter\": {\n \"type\": \"entityType\",\n \"entityType\": \"DEVICE\"\n },\n \"keyFilters\": [\n {\n \"key\": {\n \"type\": \"ATTRIBUTE\",\n \"key\": \"active\"\n },\n \"valueType\": \"BOOLEAN\",\n \"predicate\": {\n \"operation\": \"EQUAL\",\n \"value\": {\n \"defaultValue\": true,\n \"dynamicValue\": null\n },\n \"type\": \"BOOLEAN\"\n }\n }\n ]\n}\n```\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:\n\n # Entity Filters\nEntity Filter body depends on the 'type' parameter. Let's review available entity filter types. In fact, they do correspond to available dashboard aliases.\n\n## Single Entity\n\nAllows to filter only one entity based on the id. For example, this entity filter selects certain device:\n\n```json\n{\n \"type\": \"singleEntity\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Group Entities Filter\n\nAllows to filter multiple entities of the same type using the entity group type and id. For example, this entity filter selects all devices that belong to the group 'e52b0020-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"entityGroup\",\n \"groupType\": \"DEVICE\",\n \"entityGroup\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n}\n```\n\n## Entity List Filter\n\nAllows to filter entities of the same type using their ids. For example, this entity filter selects two devices:\n\n```json\n{\n \"type\": \"entityList\",\n \"entityType\": \"DEVICE\",\n \"entityList\": [\n \"e6501f30-2a7a-11ec-94eb-213c95f54092\",\n \"e6657bf0-2a7a-11ec-94eb-213c95f54092\"\n ]\n}\n```\n\n## Entity Name Filter\n\nAllows to filter entities of the same type using the **'starts with'** expression over entity name. For example, this entity filter selects all devices which name starts with 'Air Quality':\n\n```json\n{\n \"type\": \"entityName\",\n \"entityType\": \"DEVICE\",\n \"entityNameFilter\": \"Air Quality\"\n}\n```\n\n## Entity Type Filter\n\nAllows to filter entities based on their type (CUSTOMER, USER, DASHBOARD, ASSET, DEVICE, etc)For example, this entity filter selects all tenant customers:\n\n```json\n{\n \"type\": \"entityType\",\n \"entityType\": \"CUSTOMER\"\n}\n```\n\n## Group List Filter\n\nReturn multiple groups of the same type using specified ids. For example, this entity filter selects 2 device groups (if they are present in the system) with ids 'e52b0020-2a7a-11ec-94eb-213c95f54092' and 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"entityGroupList\",\n \"groupType\": \"DEVICE\",\n \"entityGroupList\": [\"e52b0020-2a7a-11ec-94eb-213c95f54092\", \"e52b0020-2a7a-11ec-94eb-213c95f54093\"]\n}\n```\n\n## Group Name Filter\n\nAllows to filter entity groups based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all devices which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"CAT\"\n}\n```\n\n## Entities by Group Name Filter\n\nAllows to filter entities that belong to group based on the entity type and the group name. Optional parameter 'ownerId' allows you to specify the owner of the group (Tenant or Customer, current user owner by default).For example, this entity filter selects all devices which belong to group 'Water Meters':\n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n Other example, this entity filter selects all devices which belong to group 'Water Meters' which in turn belongs to (sub-)Customer with id 'e52b0020-2a7a-11ec-94eb-213c95f54093': \n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"ownerId\": {\"entityType\": \"CUSTOMER\",\"id\":\"e52b0020-2a7a-11ec-94eb-213c95f54093\"},\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n## Entity owner Filter\n\nAllows to fetch owner (Tenant or Customer) of the specified entity. For example, this entity filter selects owner of the device with id 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"stateEntityOwner\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Asset Type Filter\n\nAllows to filter assets based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'charging station' assets which name starts with 'Tesla':\n\n```json\n{\n \"type\": \"assetType\",\n \"assetType\": \"charging station\",\n \"assetNameFilter\": \"Tesla\"\n}\n```\n\n## Device Type Filter\n\nAllows to filter devices based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Temperature Sensor' devices which name starts with 'ABC':\n\n```json\n{\n \"type\": \"deviceType\",\n \"deviceType\": \"Temperature Sensor\",\n \"deviceNameFilter\": \"ABC\"\n}\n```\n\n## Edge Type Filter\n\nAllows to filter edge instances based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Factory' edge instances which name starts with 'Nevada':\n\n```json\n{\n \"type\": \"edgeType\",\n \"edgeType\": \"Factory\",\n \"edgeNameFilter\": \"Nevada\"\n}\n```\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```\n\n## Api Usage Filter\n\nAllows to query for Api Usage based on optional customer id. If the customer id is not set, returns current tenant API usage.For example, this entity filter selects the 'Api Usage' entity for customer with id 'e6501f30-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"apiUsageState\",\n \"customerId\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"CUSTOMER\"\n }\n}\n```\n\n## Relations Query Filter\n\nAllows to filter entities that are related to the provided root entity. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'filter' object allows you to define the relation type and set of acceptable entity types to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only those who match the 'filters'.\n\nFor example, this entity filter selects all devices and assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"relationsQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"filters\": [\n {\n \"relationType\": \"Contains\",\n \"entityTypes\": [\n \"DEVICE\",\n \"ASSET\"\n ]\n }\n ]\n}\n```\n\n## Asset Search Query\n\nAllows to filter assets that are related to the provided root entity. Filters related assets based on the relation type and set of asset types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'assetTypes' defines the type of the asset to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only assets that match 'relationType' and 'assetTypes' conditions.\n\nFor example, this entity filter selects 'charging station' assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"assetSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"assetTypes\": [\n \"charging station\"\n ]\n}\n```\n\n## Device Search Query\n\nAllows to filter devices that are related to the provided root entity. Filters related devices based on the relation type and set of device types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Charging port' and 'Air Quality Sensor' devices which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"deviceTypes\": [\n \"Air Quality Sensor\",\n \"Charging port\"\n ]\n}\n```\n\n## Entity View Query\n\nAllows to filter entity views that are related to the provided root entity. Filters related entity views based on the relation type and set of entity view types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'entityViewTypes' defines the type of the entity view to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Concrete mixer' entity views which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"entityViewSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"entityViewTypes\": [\n \"Concrete mixer\"\n ]\n}\n```\n\n## Edge Search Query\n\nAllows to filter edge instances that are related to the provided root entity. Filters related edge instances based on the relation type and set of edge types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Factory' edge instances which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"edgeTypes\": [\n \"Factory\"\n ]\n}\n```\n\n # Key Filters\nKey Filter allows you to define complex logical expressions over entity field, attribute or latest time series value. The filter is defined using 'key', 'valueType' and 'predicate' objects. Single Entity Query may have zero, one or multiple predicates. If multiple filters are defined, they are evaluated using logical 'AND'. The example below checks that temperature of the entity is above 20 degrees:\n\n```json\n{\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n}\n```\n\n Now let's review 'key', 'valueType' and 'predicate' objects in detail.\n\n## Filter Key\n\nFilter Key defines either entity field, attribute or telemetry. It is a JSON object that consists the key name and type. The following filter key types are supported: \n\n * 'CLIENT_ATTRIBUTE' - used for client attributes; \n * 'SHARED_ATTRIBUTE' - used for shared attributes; \n * 'SERVER_ATTRIBUTE' - used for server attributes; \n * 'ATTRIBUTE' - used for any of the above; \n * 'TIME_SERIES' - used for time series values; \n * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type; \n * 'ALARM_FIELD' - similar to entity field, but is used in alarm queries only; \n\n\n Let's review the example:\n\n```json\n{\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n}\n```\n\n## Value Type and Operations\n\nProvides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: \n\n * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; \n * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL;\n * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n\n\n## Filter Predicate\n\nFilter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key.\n\nSimple predicate example to check 'value < 100': \n\n```json\n{\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 100,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nComplex predicate example, to check 'value < 10 or value > 20': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n}\n```\n\nMore complex predicate example, to check 'value < 10 or (value > 50 && value < 60)': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"type\": \"COMPLEX\",\n \"operation\": \"AND\",\n \"predicates\": [\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 50,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 60,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n }\n ]\n}\n```\n\n You may also want to replace hardcoded values (for example, temperature > 20) with the more dynamic expression (for example, temperature > 'value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or user that is performing the API call. See example below: \n\n```json\n{\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"sourceType\": \"CURRENT_USER\",\n \"sourceAttribute\": \"temperatureThreshold\"\n }\n },\n \"type\": \"NUMERIC\"\n}\n```\n\n Note that you may use 'CURRENT_USER', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "countEntitiesByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityCountQuery" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityGroupInfo" + "type": "integer", + "format": "int64" } } } @@ -59178,7 +58686,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -59298,46 +58806,31 @@ ] } }, - "/api/ownerInfo/{ownerType}/{ownerId}": { - "get": { + "/api/entitiesQuery/find": { + "post": { "tags": [ - "entity-group-controller" + "entity-query-controller" ], - "summary": "Get Owner Info (getOwnerInfo)", - "description": "Fetch the owner info (tenant or customer) presented as Entity Info object based on the provided owner Id. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getOwnerInfo", - "parameters": [ - { - "name": "ownerType", - "in": "path", - "description": "Tenant or Customer", - "required": true, - "schema": { - "type": "string", - "enum": [ - "TENANT", - "CUSTOMER" - ] + "summary": "Find Entity Data by Query", + "description": "Allows to run complex queries over platform entities (devices, assets, customers, etc) based on the combination of main entity filter and multiple key filters. Returns the paginated result of the query that contains requested entity fields and latest values of requested attributes and time series data.\n\n# Query Definition\n\n\n\nMain **entity filter** is mandatory and defines generic search criteria. For example, \"find all devices with profile 'Moisture Sensor'\" or \"Find all devices related to asset 'Building A'\"\n\nOptional **key filters** allow to filter results of the **entity filter** by complex criteria against main entity fields (name, label, type, etc), attributes and telemetry. For example, \"temperature > 20 or temperature< 10\" or \"name starts with 'T', and attribute 'model' is 'T1000', and time series field 'batteryLevel' > 40\".\n\nThe **entity fields** and **latest values** contains list of entity fields and latest attribute/telemetry fields to fetch for each entity.\n\nThe **page link** contains information about the page to fetch and the sort ordering.\n\nLet's review the example:\n\n```json\n{\n \"entityFilter\": {\n \"type\": \"entityType\",\n \"resolveMultiple\": true,\n \"entityType\": \"DEVICE\"\n },\n \"keyFilters\": [\n {\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"sourceType\": \"CURRENT_USER\",\n \"sourceAttribute\": \"temperatureThreshold\",\n \"inherit\": false\n }\n },\n \"type\": \"NUMERIC\"\n }\n }\n ],\n \"entityFields\": [\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"name\"\n },\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"label\"\n },\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"additionalInfo\"\n }\n ],\n \"latestValues\": [\n {\n \"type\": \"ATTRIBUTE\",\n \"key\": \"model\"\n },\n {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n }\n ],\n \"pageLink\": {\n \"page\": 0,\n \"pageSize\": 10,\n \"sortOrder\": {\n \"key\": {\n \"key\": \"name\",\n \"type\": \"ENTITY_FIELD\"\n },\n \"direction\": \"ASC\"\n }\n }\n}\n```\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:\n\n # Entity Filters\nEntity Filter body depends on the 'type' parameter. Let's review available entity filter types. In fact, they do correspond to available dashboard aliases.\n\n## Single Entity\n\nAllows to filter only one entity based on the id. For example, this entity filter selects certain device:\n\n```json\n{\n \"type\": \"singleEntity\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Group Entities Filter\n\nAllows to filter multiple entities of the same type using the entity group type and id. For example, this entity filter selects all devices that belong to the group 'e52b0020-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"entityGroup\",\n \"groupType\": \"DEVICE\",\n \"entityGroup\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n}\n```\n\n## Entity List Filter\n\nAllows to filter entities of the same type using their ids. For example, this entity filter selects two devices:\n\n```json\n{\n \"type\": \"entityList\",\n \"entityType\": \"DEVICE\",\n \"entityList\": [\n \"e6501f30-2a7a-11ec-94eb-213c95f54092\",\n \"e6657bf0-2a7a-11ec-94eb-213c95f54092\"\n ]\n}\n```\n\n## Entity Name Filter\n\nAllows to filter entities of the same type using the **'starts with'** expression over entity name. For example, this entity filter selects all devices which name starts with 'Air Quality':\n\n```json\n{\n \"type\": \"entityName\",\n \"entityType\": \"DEVICE\",\n \"entityNameFilter\": \"Air Quality\"\n}\n```\n\n## Entity Type Filter\n\nAllows to filter entities based on their type (CUSTOMER, USER, DASHBOARD, ASSET, DEVICE, etc)For example, this entity filter selects all tenant customers:\n\n```json\n{\n \"type\": \"entityType\",\n \"entityType\": \"CUSTOMER\"\n}\n```\n\n## Group List Filter\n\nReturn multiple groups of the same type using specified ids. For example, this entity filter selects 2 device groups (if they are present in the system) with ids 'e52b0020-2a7a-11ec-94eb-213c95f54092' and 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"entityGroupList\",\n \"groupType\": \"DEVICE\",\n \"entityGroupList\": [\"e52b0020-2a7a-11ec-94eb-213c95f54092\", \"e52b0020-2a7a-11ec-94eb-213c95f54093\"]\n}\n```\n\n## Group Name Filter\n\nAllows to filter entity groups based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all devices which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"CAT\"\n}\n```\n\n## Entities by Group Name Filter\n\nAllows to filter entities that belong to group based on the entity type and the group name. Optional parameter 'ownerId' allows you to specify the owner of the group (Tenant or Customer, current user owner by default).For example, this entity filter selects all devices which belong to group 'Water Meters':\n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n Other example, this entity filter selects all devices which belong to group 'Water Meters' which in turn belongs to (sub-)Customer with id 'e52b0020-2a7a-11ec-94eb-213c95f54093': \n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"ownerId\": {\"entityType\": \"CUSTOMER\",\"id\":\"e52b0020-2a7a-11ec-94eb-213c95f54093\"},\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n## Entity owner Filter\n\nAllows to fetch owner (Tenant or Customer) of the specified entity. For example, this entity filter selects owner of the device with id 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"stateEntityOwner\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Asset Type Filter\n\nAllows to filter assets based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'charging station' assets which name starts with 'Tesla':\n\n```json\n{\n \"type\": \"assetType\",\n \"assetType\": \"charging station\",\n \"assetNameFilter\": \"Tesla\"\n}\n```\n\n## Device Type Filter\n\nAllows to filter devices based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Temperature Sensor' devices which name starts with 'ABC':\n\n```json\n{\n \"type\": \"deviceType\",\n \"deviceType\": \"Temperature Sensor\",\n \"deviceNameFilter\": \"ABC\"\n}\n```\n\n## Edge Type Filter\n\nAllows to filter edge instances based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Factory' edge instances which name starts with 'Nevada':\n\n```json\n{\n \"type\": \"edgeType\",\n \"edgeType\": \"Factory\",\n \"edgeNameFilter\": \"Nevada\"\n}\n```\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```\n\n## Api Usage Filter\n\nAllows to query for Api Usage based on optional customer id. If the customer id is not set, returns current tenant API usage.For example, this entity filter selects the 'Api Usage' entity for customer with id 'e6501f30-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"apiUsageState\",\n \"customerId\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"CUSTOMER\"\n }\n}\n```\n\n## Relations Query Filter\n\nAllows to filter entities that are related to the provided root entity. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'filter' object allows you to define the relation type and set of acceptable entity types to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only those who match the 'filters'.\n\nFor example, this entity filter selects all devices and assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"relationsQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"filters\": [\n {\n \"relationType\": \"Contains\",\n \"entityTypes\": [\n \"DEVICE\",\n \"ASSET\"\n ]\n }\n ]\n}\n```\n\n## Asset Search Query\n\nAllows to filter assets that are related to the provided root entity. Filters related assets based on the relation type and set of asset types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'assetTypes' defines the type of the asset to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only assets that match 'relationType' and 'assetTypes' conditions.\n\nFor example, this entity filter selects 'charging station' assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"assetSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"assetTypes\": [\n \"charging station\"\n ]\n}\n```\n\n## Device Search Query\n\nAllows to filter devices that are related to the provided root entity. Filters related devices based on the relation type and set of device types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Charging port' and 'Air Quality Sensor' devices which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"deviceTypes\": [\n \"Air Quality Sensor\",\n \"Charging port\"\n ]\n}\n```\n\n## Entity View Query\n\nAllows to filter entity views that are related to the provided root entity. Filters related entity views based on the relation type and set of entity view types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'entityViewTypes' defines the type of the entity view to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Concrete mixer' entity views which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"entityViewSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"entityViewTypes\": [\n \"Concrete mixer\"\n ]\n}\n```\n\n## Edge Search Query\n\nAllows to filter edge instances that are related to the provided root entity. Filters related edge instances based on the relation type and set of edge types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is > 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Factory' edge instances which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"edgeTypes\": [\n \"Factory\"\n ]\n}\n```\n\n # Key Filters\nKey Filter allows you to define complex logical expressions over entity field, attribute or latest time series value. The filter is defined using 'key', 'valueType' and 'predicate' objects. Single Entity Query may have zero, one or multiple predicates. If multiple filters are defined, they are evaluated using logical 'AND'. The example below checks that temperature of the entity is above 20 degrees:\n\n```json\n{\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n}\n```\n\n Now let's review 'key', 'valueType' and 'predicate' objects in detail.\n\n## Filter Key\n\nFilter Key defines either entity field, attribute or telemetry. It is a JSON object that consists the key name and type. The following filter key types are supported: \n\n * 'CLIENT_ATTRIBUTE' - used for client attributes; \n * 'SHARED_ATTRIBUTE' - used for shared attributes; \n * 'SERVER_ATTRIBUTE' - used for server attributes; \n * 'ATTRIBUTE' - used for any of the above; \n * 'TIME_SERIES' - used for time series values; \n * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type; \n * 'ALARM_FIELD' - similar to entity field, but is used in alarm queries only; \n\n\n Let's review the example:\n\n```json\n{\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n}\n```\n\n## Value Type and Operations\n\nProvides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: \n\n * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; \n * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL;\n * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n\n\n## Filter Predicate\n\nFilter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key.\n\nSimple predicate example to check 'value < 100': \n\n```json\n{\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 100,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nComplex predicate example, to check 'value < 10 or value > 20': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n}\n```\n\nMore complex predicate example, to check 'value < 10 or (value > 50 && value < 60)': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"type\": \"COMPLEX\",\n \"operation\": \"AND\",\n \"predicates\": [\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 50,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 60,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n }\n ]\n}\n```\n\n You may also want to replace hardcoded values (for example, temperature > 20) with the more dynamic expression (for example, temperature > 'value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or user that is performing the API call. See example below: \n\n```json\n{\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"sourceType\": \"CURRENT_USER\",\n \"sourceAttribute\": \"temperatureThreshold\"\n }\n },\n \"type\": \"NUMERIC\"\n}\n```\n\n Note that you may use 'CURRENT_USER', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "findEntityDataByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityDataQuery" + } } }, - { - "name": "ownerId", - "in": "path", - "description": "A string value representing the Tenant or Customer id", - "required": true, - "schema": { - "type": "string" - }, - "example": "784f394c-42b6-435a-983c-b7beff2784f9" - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityInfo" + "$ref": "#/components/schemas/PageDataEntityData" } } } @@ -59353,7 +58846,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -59473,74 +58966,65 @@ ] } }, - "/api/ownerInfos": { - "get": { + "/api/entitiesQuery/find/keys": { + "post": { "tags": [ - "entity-group-controller" + "entity-query-controller" ], - "summary": "Get Owner Infos (getOwnerInfos)", - "description": "Provides a rage view of Customers that the current user has READ access to. If the current user is Tenant administrator, the result set also contains the tenant. The call is designed for the UI auto-complete component to show tenant and all possible Customers that the user may select to change the owner of the particular entity or entity group.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getOwnerInfos", + "summary": "Find Available Entity Keys by Query (deprecated)", + "description": "**Deprecated.** Use the V2 endpoint (`POST /api/v2/entitiesQuery/find/keys`) instead.\n\nReturns unique time series and/or attribute key names from entities matching the query.\n\nExecutes the Entity Data Query to find up to 100 entities, then fetches and aggregates all distinct key names.\n\nPrimarily used for UI features like autocomplete suggestions.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "findAvailableEntityKeysByQuery", "parameters": [ { - "name": "pageSize", + "name": "timeseries", "in": "query", - "description": "Maximum amount of entities in a one page", + "description": "When true, includes unique time series key names in the response.\nWhen false, the 'timeseries' list will be empty.", "required": true, "schema": { - "type": "string", - "minimum": 1 + "type": "boolean" } }, { - "name": "page", + "name": "attributes", "in": "query", - "description": "Sequence number of page starting from 0", + "description": "When true, includes unique attribute key names in the response.\nWhen false, the 'attribute' list will be empty. Use 'scope' parameter to filter by attribute scope.", "required": true, "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the entity group name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" + "type": "boolean" } }, { - "name": "sortOrder", + "name": "scope", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "Filters attribute keys by scope. Only applies when 'attributes' is true.\nIf not specified, returns attribute keys from all scopes.", "required": false, "schema": { "type": "string", "enum": [ - "ASC", - "DESC" + "SERVER_SCOPE", + "SHARED_SCOPE", + "CLIENT_SCOPE" ] } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityDataQuery" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityInfo" + "$ref": "#/components/schemas/AvailableEntityKeys" } } } @@ -59556,7 +59040,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -59666,6 +59150,7 @@ } } }, + "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -59676,74 +59161,77 @@ ] } }, - "/api/owners": { - "get": { + "/api/v2/entitiesQuery/find/keys": { + "post": { "tags": [ - "entity-group-controller" + "entity-query-controller" ], - "summary": "Get Owners (getOwners)", - "description": "Provides a rage view of Customers that the current user has READ access to. If the current user is Tenant administrator, the result set also contains the tenant. The call is designed for the UI auto-complete component to show tenant and all possible Customers that the user may select to change the owner of the particular entity or entity group.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getOwners", + "summary": "Find Available Entity Keys By Query", + "description": "Discovers unique time series and/or attribute key names available on entities that match the given query.\nWorks in two steps: first, the request body (an Entity Data Query) is executed to find matching entities\n(page size is capped at 100); then, all distinct key names are collected from those entities.\n\nOptionally, each key can include a sample — the most recent value (by timestamp) for that key\nacross all matched entities.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "findAvailableEntityKeysByQueryV2", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", + "name": "includeTimeseries", "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, + "description": "When true, includes unique time series keys in the response.\nWhen false, the 'timeseries' field is omitted. At least one of 'includeTimeseries' or 'includeAttributes' must be true.", + "required": false, "schema": { - "type": "string", - "minimum": 0 + "type": "boolean", + "default": true } }, { - "name": "textSearch", + "name": "includeAttributes", "in": "query", - "description": "The case insensitive 'startsWith' filter based on the entity group name.", + "description": "When true, includes unique attribute keys in the response.\nWhen false, the 'attributes' field is omitted. At least one of 'includeTimeseries' or 'includeAttributes' must be true.", "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": true } }, { - "name": "sortProperty", + "name": "scopes", "in": "query", - "description": "Property of entity to sort by", + "description": "Filters attribute keys by scope. Only applies when 'includeAttributes' is true.\nWhen not specified, scopes are auto-determined: all three scopes (server, client, shared) for device entities,\nserver scope only for other entity types.", "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "SERVER_SCOPE", + "SHARED_SCOPE", + "CLIENT_SCOPE" + ] } }, { - "name": "sortOrder", + "name": "includeSamples", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "When true, each key entry includes a 'sample' object with the most recent value and timestamp.\nWhen false, only key names are returned (sample is omitted from JSON).", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "boolean", + "default": false } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityDataQuery" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataContactBasedObject" + "$ref": "#/components/schemas/AvailableEntityKeysV2" } } } @@ -59759,7 +59247,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -59879,32 +59367,77 @@ ] } }, - "/api/alarmsQuery/count": { - "post": { + "/api/relation": { + "get": { "tags": [ - "entity-query-controller" + "entity-relation-controller" ], - "summary": "Count Alarms by Query (countAlarmsByQuery)", - "description": "Returns the number of alarms that match the query definition.", - "operationId": "countAlarmsByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AlarmCountQuery" - } + "summary": "Get Relation (getRelation)", + "description": "Returns relation object between two specified entities if present. Otherwise throws exception. \n\nIf the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.", + "operationId": "getRelation", + "parameters": [ + { + "name": "fromId", + "in": "query", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "fromType", + "in": "query", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "relationType", + "in": "query", + "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "relationTypeGroup", + "in": "query", + "description": "A string value representing relation type group. For example, 'COMMON'", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "toId", + "in": "query", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "toType", + "in": "query", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "integer", - "format": "int64" + "$ref": "#/components/schemas/EntityRelation" } } } @@ -59920,7 +59453,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -60040,19 +59573,19 @@ ] } }, - "/api/alarmsQuery/find": { + "/api/relations": { "post": { "tags": [ - "entity-query-controller" + "entity-relation-controller" ], - "summary": "Find Alarms by Query", - "description": "This method description defines how Alarm Data Query extends the Entity Data Query. See method 'Find Entity Data by Query' first to get the info about 'Entity Data Query'.\n\n The platform will first search the entities that match the entity and key filters. Then, the platform will use 'Alarm Page Link' to filter the alarms related to those entities. Finally, platform fetch the properties of alarm that are defined in the **'alarmFields'** and combine them with the other entity, attribute and latest time series fields to return the result. \n\n See example of the alarm query below. The query will search first 100 active alarms with type 'Temperature Alarm' or 'Fire Alarm' for any device with current temperature \u003E 0. The query will return combination of the entity fields: name of the device, device model and latest temperature reading and alarms fields: createdTime, type, severity and status: \n\n```json\n{\n \"entityFilter\": {\n \"type\": \"entityType\",\n \"resolveMultiple\": true,\n \"entityType\": \"DEVICE\"\n },\n \"pageLink\": {\n \"page\": 0,\n \"pageSize\": 100,\n \"textSearch\": null,\n \"searchPropagatedAlarms\": false,\n \"statusList\": [\n \"ACTIVE\"\n ],\n \"severityList\": [\n \"CRITICAL\",\n \"MAJOR\"\n ],\n \"typeList\": [\n \"Temperature Alarm\",\n \"Fire Alarm\"\n ],\n \"sortOrder\": {\n \"key\": {\n \"key\": \"createdTime\",\n \"type\": \"ALARM_FIELD\"\n },\n \"direction\": \"DESC\"\n },\n \"timeWindow\": 86400000\n },\n \"keyFilters\": [\n {\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n }\n ],\n \"alarmFields\": [\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"createdTime\"\n },\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"type\"\n },\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"severity\"\n },\n {\n \"type\": \"ALARM_FIELD\",\n \"key\": \"status\"\n }\n ],\n \"entityFields\": [\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"name\"\n }\n ],\n \"latestValues\": [\n {\n \"type\": \"ATTRIBUTE\",\n \"key\": \"model\"\n },\n {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n }\n ]\n}\n```", - "operationId": "findAlarmDataByQuery", + "summary": "Find related entities (findEntityRelationsByQuery)", + "description": "Returns all entities that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info.", + "operationId": "findEntityRelationsByQuery", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AlarmDataQuery" + "$ref": "#/components/schemas/EntityRelationsQuery" } } }, @@ -60064,7 +59597,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataAlarmData" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityRelation" + } } } } @@ -60198,25 +59734,37 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edqs/state": { - "get": { + }, + "delete": { "tags": [ - "entity-query-controller" + "entity-relation-controller" + ], + "summary": "Delete common relations (deleteRelations)", + "description": "Deletes all the relations ('from' and 'to' direction) for the specified entity and relation type group: 'COMMON'. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", + "operationId": "deleteRelations", + "parameters": [ + { + "name": "entityId", + "in": "query", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityType", + "in": "query", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "getEdqsState", - "operationId": "getEdqsState", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EdqsState" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -60349,26 +59897,56 @@ ] } }, - "/api/edqs/system/request": { - "post": { + "/api/relations/from/{fromType}/{fromId}": { + "get": { "tags": [ - "entity-query-controller" + "entity-relation-controller" ], - "summary": "processSystemEdqsRequest", - "operationId": "processSystemEdqsRequest", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToCoreEdqsRequest" - } + "summary": "Get List of Relations (findEntityRelationsByFrom)", + "description": "Returns list of relation objects for the specified entity by the 'from' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", + "operationId": "findEntityRelationsByFrom", + "parameters": [ + { + "name": "fromType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "fromId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "relationTypeGroup", + "in": "query", + "description": "A string value representing relation type group. For example, 'COMMON'", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityRelation" + } + } + } + } }, "400": { "description": "Bad Request", @@ -60381,7 +59959,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -60501,32 +60079,62 @@ ] } }, - "/api/entitiesQuery/count": { - "post": { + "/api/relations/from/{fromType}/{fromId}/{relationType}": { + "get": { "tags": [ - "entity-query-controller" + "entity-relation-controller" ], - "summary": "Count Entities by Query", - "description": "Allows to run complex queries to search the count of platform entities (devices, assets, customers, etc) based on the combination of main entity filter and multiple key filters. Returns the number of entities that match the query definition.\n\n# Query Definition\n\n\n\nMain **entity filter** is mandatory and defines generic search criteria. For example, \"find all devices with profile 'Moisture Sensor'\" or \"Find all devices related to asset 'Building A'\"\n\nOptional **key filters** allow to filter results of the entity filter by complex criteria against main entity fields (name, label, type, etc), attributes and telemetry. For example, \"temperature \u003E 20 or temperature\u003C 10\" or \"name starts with 'T', and attribute 'model' is 'T1000', and time series field 'batteryLevel' \u003E 40\".\n\nLet's review the example:\n\n```json\n{\n \"entityFilter\": {\n \"type\": \"entityType\",\n \"entityType\": \"DEVICE\"\n },\n \"keyFilters\": [\n {\n \"key\": {\n \"type\": \"ATTRIBUTE\",\n \"key\": \"active\"\n },\n \"valueType\": \"BOOLEAN\",\n \"predicate\": {\n \"operation\": \"EQUAL\",\n \"value\": {\n \"defaultValue\": true,\n \"dynamicValue\": null\n },\n \"type\": \"BOOLEAN\"\n }\n }\n ]\n}\n```\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:\n\n # Entity Filters\nEntity Filter body depends on the 'type' parameter. Let's review available entity filter types. In fact, they do correspond to available dashboard aliases.\n\n## Single Entity\n\nAllows to filter only one entity based on the id. For example, this entity filter selects certain device:\n\n```json\n{\n \"type\": \"singleEntity\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Group Entities Filter\n\nAllows to filter multiple entities of the same type using the entity group type and id. For example, this entity filter selects all devices that belong to the group 'e52b0020-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"entityGroup\",\n \"groupType\": \"DEVICE\",\n \"entityGroup\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n}\n```\n\n## Entity List Filter\n\nAllows to filter entities of the same type using their ids. For example, this entity filter selects two devices:\n\n```json\n{\n \"type\": \"entityList\",\n \"entityType\": \"DEVICE\",\n \"entityList\": [\n \"e6501f30-2a7a-11ec-94eb-213c95f54092\",\n \"e6657bf0-2a7a-11ec-94eb-213c95f54092\"\n ]\n}\n```\n\n## Entity Name Filter\n\nAllows to filter entities of the same type using the **'starts with'** expression over entity name. For example, this entity filter selects all devices which name starts with 'Air Quality':\n\n```json\n{\n \"type\": \"entityName\",\n \"entityType\": \"DEVICE\",\n \"entityNameFilter\": \"Air Quality\"\n}\n```\n\n## Entity Type Filter\n\nAllows to filter entities based on their type (CUSTOMER, USER, DASHBOARD, ASSET, DEVICE, etc)For example, this entity filter selects all tenant customers:\n\n```json\n{\n \"type\": \"entityType\",\n \"entityType\": \"CUSTOMER\"\n}\n```\n\n## Group List Filter\n\nReturn multiple groups of the same type using specified ids. For example, this entity filter selects 2 device groups (if they are present in the system) with ids 'e52b0020-2a7a-11ec-94eb-213c95f54092' and 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"entityGroupList\",\n \"groupType\": \"DEVICE\",\n \"entityGroupList\": [\"e52b0020-2a7a-11ec-94eb-213c95f54092\", \"e52b0020-2a7a-11ec-94eb-213c95f54093\"]\n}\n```\n\n## Group Name Filter\n\nAllows to filter entity groups based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all devices which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"CAT\"\n}\n```\n\n## Entities by Group Name Filter\n\nAllows to filter entities that belong to group based on the entity type and the group name. Optional parameter 'ownerId' allows you to specify the owner of the group (Tenant or Customer, current user owner by default).For example, this entity filter selects all devices which belong to group 'Water Meters':\n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n Other example, this entity filter selects all devices which belong to group 'Water Meters' which in turn belongs to (sub-)Customer with id 'e52b0020-2a7a-11ec-94eb-213c95f54093': \n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"ownerId\": {\"entityType\": \"CUSTOMER\",\"id\":\"e52b0020-2a7a-11ec-94eb-213c95f54093\"},\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n## Entity owner Filter\n\nAllows to fetch owner (Tenant or Customer) of the specified entity. For example, this entity filter selects owner of the device with id 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"stateEntityOwner\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Asset Type Filter\n\nAllows to filter assets based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'charging station' assets which name starts with 'Tesla':\n\n```json\n{\n \"type\": \"assetType\",\n \"assetType\": \"charging station\",\n \"assetNameFilter\": \"Tesla\"\n}\n```\n\n## Device Type Filter\n\nAllows to filter devices based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Temperature Sensor' devices which name starts with 'ABC':\n\n```json\n{\n \"type\": \"deviceType\",\n \"deviceType\": \"Temperature Sensor\",\n \"deviceNameFilter\": \"ABC\"\n}\n```\n\n## Edge Type Filter\n\nAllows to filter edge instances based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Factory' edge instances which name starts with 'Nevada':\n\n```json\n{\n \"type\": \"edgeType\",\n \"edgeType\": \"Factory\",\n \"edgeNameFilter\": \"Nevada\"\n}\n```\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```\n\n## Api Usage Filter\n\nAllows to query for Api Usage based on optional customer id. If the customer id is not set, returns current tenant API usage.For example, this entity filter selects the 'Api Usage' entity for customer with id 'e6501f30-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"apiUsageState\",\n \"customerId\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"CUSTOMER\"\n }\n}\n```\n\n## Relations Query Filter\n\nAllows to filter entities that are related to the provided root entity. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'filter' object allows you to define the relation type and set of acceptable entity types to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only those who match the 'filters'.\n\nFor example, this entity filter selects all devices and assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"relationsQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"filters\": [\n {\n \"relationType\": \"Contains\",\n \"entityTypes\": [\n \"DEVICE\",\n \"ASSET\"\n ]\n }\n ]\n}\n```\n\n## Asset Search Query\n\nAllows to filter assets that are related to the provided root entity. Filters related assets based on the relation type and set of asset types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'assetTypes' defines the type of the asset to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only assets that match 'relationType' and 'assetTypes' conditions.\n\nFor example, this entity filter selects 'charging station' assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"assetSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"assetTypes\": [\n \"charging station\"\n ]\n}\n```\n\n## Device Search Query\n\nAllows to filter devices that are related to the provided root entity. Filters related devices based on the relation type and set of device types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Charging port' and 'Air Quality Sensor' devices which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"deviceTypes\": [\n \"Air Quality Sensor\",\n \"Charging port\"\n ]\n}\n```\n\n## Entity View Query\n\nAllows to filter entity views that are related to the provided root entity. Filters related entity views based on the relation type and set of entity view types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'entityViewTypes' defines the type of the entity view to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Concrete mixer' entity views which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"entityViewSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"entityViewTypes\": [\n \"Concrete mixer\"\n ]\n}\n```\n\n## Edge Search Query\n\nAllows to filter edge instances that are related to the provided root entity. Filters related edge instances based on the relation type and set of edge types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Factory' edge instances which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"edgeTypes\": [\n \"Factory\"\n ]\n}\n```\n\n # Key Filters\nKey Filter allows you to define complex logical expressions over entity field, attribute or latest time series value. The filter is defined using 'key', 'valueType' and 'predicate' objects. Single Entity Query may have zero, one or multiple predicates. If multiple filters are defined, they are evaluated using logical 'AND'. The example below checks that temperature of the entity is above 20 degrees:\n\n```json\n{\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n}\n```\n\n Now let's review 'key', 'valueType' and 'predicate' objects in detail.\n\n## Filter Key\n\nFilter Key defines either entity field, attribute or telemetry. It is a JSON object that consists the key name and type. The following filter key types are supported: \n\n * 'CLIENT_ATTRIBUTE' - used for client attributes; \n * 'SHARED_ATTRIBUTE' - used for shared attributes; \n * 'SERVER_ATTRIBUTE' - used for server attributes; \n * 'ATTRIBUTE' - used for any of the above; \n * 'TIME_SERIES' - used for time series values; \n * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type; \n * 'ALARM_FIELD' - similar to entity field, but is used in alarm queries only; \n\n\n Let's review the example:\n\n```json\n{\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n}\n```\n\n## Value Type and Operations\n\nProvides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: \n\n * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; \n * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL;\n * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n\n\n## Filter Predicate\n\nFilter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key.\n\nSimple predicate example to check 'value \u003C 100': \n\n```json\n{\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 100,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nComplex predicate example, to check 'value \u003C 10 or value \u003E 20': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n}\n```\n\nMore complex predicate example, to check 'value \u003C 10 or (value \u003E 50 && value \u003C 60)': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"type\": \"COMPLEX\",\n \"operation\": \"AND\",\n \"predicates\": [\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 50,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 60,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n }\n ]\n}\n```\n\n You may also want to replace hardcoded values (for example, temperature \u003E 20) with the more dynamic expression (for example, temperature \u003E 'value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or user that is performing the API call. See example below: \n\n```json\n{\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"sourceType\": \"CURRENT_USER\",\n \"sourceAttribute\": \"temperatureThreshold\"\n }\n },\n \"type\": \"NUMERIC\"\n}\n```\n\n Note that you may use 'CURRENT_USER', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "countEntitiesByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityCountQuery" - } + "summary": "Get List of Relations (findEntityRelationsByFromAndRelationType)", + "description": "Returns list of relation objects for the specified entity by the 'from' direction and relation type. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", + "operationId": "findEntityRelationsByFromAndRelationType", + "parameters": [ + { + "name": "fromType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "fromId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "relationType", + "in": "path", + "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "relationTypeGroup", + "in": "query", + "description": "A string value representing relation type group. For example, 'COMMON'", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "integer", - "format": "int64" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityRelation" + } } } } @@ -60542,7 +60150,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -60662,19 +60270,19 @@ ] } }, - "/api/entitiesQuery/find": { + "/api/relations/info": { "post": { "tags": [ - "entity-query-controller" + "entity-relation-controller" ], - "summary": "Find Entity Data by Query", - "description": "Allows to run complex queries over platform entities (devices, assets, customers, etc) based on the combination of main entity filter and multiple key filters. Returns the paginated result of the query that contains requested entity fields and latest values of requested attributes and time series data.\n\n# Query Definition\n\n\n\nMain **entity filter** is mandatory and defines generic search criteria. For example, \"find all devices with profile 'Moisture Sensor'\" or \"Find all devices related to asset 'Building A'\"\n\nOptional **key filters** allow to filter results of the **entity filter** by complex criteria against main entity fields (name, label, type, etc), attributes and telemetry. For example, \"temperature \u003E 20 or temperature\u003C 10\" or \"name starts with 'T', and attribute 'model' is 'T1000', and time series field 'batteryLevel' \u003E 40\".\n\nThe **entity fields** and **latest values** contains list of entity fields and latest attribute/telemetry fields to fetch for each entity.\n\nThe **page link** contains information about the page to fetch and the sort ordering.\n\nLet's review the example:\n\n```json\n{\n \"entityFilter\": {\n \"type\": \"entityType\",\n \"resolveMultiple\": true,\n \"entityType\": \"DEVICE\"\n },\n \"keyFilters\": [\n {\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"sourceType\": \"CURRENT_USER\",\n \"sourceAttribute\": \"temperatureThreshold\",\n \"inherit\": false\n }\n },\n \"type\": \"NUMERIC\"\n }\n }\n ],\n \"entityFields\": [\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"name\"\n },\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"label\"\n },\n {\n \"type\": \"ENTITY_FIELD\",\n \"key\": \"additionalInfo\"\n }\n ],\n \"latestValues\": [\n {\n \"type\": \"ATTRIBUTE\",\n \"key\": \"model\"\n },\n {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n }\n ],\n \"pageLink\": {\n \"page\": 0,\n \"pageSize\": 10,\n \"sortOrder\": {\n \"key\": {\n \"key\": \"name\",\n \"type\": \"ENTITY_FIELD\"\n },\n \"direction\": \"ASC\"\n }\n }\n}\n```\n\n Example mentioned above search all devices which have attribute 'active' set to 'true'. Now let's review available entity filters and key filters syntax:\n\n # Entity Filters\nEntity Filter body depends on the 'type' parameter. Let's review available entity filter types. In fact, they do correspond to available dashboard aliases.\n\n## Single Entity\n\nAllows to filter only one entity based on the id. For example, this entity filter selects certain device:\n\n```json\n{\n \"type\": \"singleEntity\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Group Entities Filter\n\nAllows to filter multiple entities of the same type using the entity group type and id. For example, this entity filter selects all devices that belong to the group 'e52b0020-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"entityGroup\",\n \"groupType\": \"DEVICE\",\n \"entityGroup\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n}\n```\n\n## Entity List Filter\n\nAllows to filter entities of the same type using their ids. For example, this entity filter selects two devices:\n\n```json\n{\n \"type\": \"entityList\",\n \"entityType\": \"DEVICE\",\n \"entityList\": [\n \"e6501f30-2a7a-11ec-94eb-213c95f54092\",\n \"e6657bf0-2a7a-11ec-94eb-213c95f54092\"\n ]\n}\n```\n\n## Entity Name Filter\n\nAllows to filter entities of the same type using the **'starts with'** expression over entity name. For example, this entity filter selects all devices which name starts with 'Air Quality':\n\n```json\n{\n \"type\": \"entityName\",\n \"entityType\": \"DEVICE\",\n \"entityNameFilter\": \"Air Quality\"\n}\n```\n\n## Entity Type Filter\n\nAllows to filter entities based on their type (CUSTOMER, USER, DASHBOARD, ASSET, DEVICE, etc)For example, this entity filter selects all tenant customers:\n\n```json\n{\n \"type\": \"entityType\",\n \"entityType\": \"CUSTOMER\"\n}\n```\n\n## Group List Filter\n\nReturn multiple groups of the same type using specified ids. For example, this entity filter selects 2 device groups (if they are present in the system) with ids 'e52b0020-2a7a-11ec-94eb-213c95f54092' and 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"entityGroupList\",\n \"groupType\": \"DEVICE\",\n \"entityGroupList\": [\"e52b0020-2a7a-11ec-94eb-213c95f54092\", \"e52b0020-2a7a-11ec-94eb-213c95f54093\"]\n}\n```\n\n## Group Name Filter\n\nAllows to filter entity groups based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all devices which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"CAT\"\n}\n```\n\n## Entities by Group Name Filter\n\nAllows to filter entities that belong to group based on the entity type and the group name. Optional parameter 'ownerId' allows you to specify the owner of the group (Tenant or Customer, current user owner by default).For example, this entity filter selects all devices which belong to group 'Water Meters':\n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n Other example, this entity filter selects all devices which belong to group 'Water Meters' which in turn belongs to (sub-)Customer with id 'e52b0020-2a7a-11ec-94eb-213c95f54093': \n\n```json\n{\n \"type\": \"entitiesByGroupName\",\n \"ownerId\": {\"entityType\": \"CUSTOMER\",\"id\":\"e52b0020-2a7a-11ec-94eb-213c95f54093\"},\n \"groupType\": \"DEVICE\",\n \"entityGroupNameFilter\": \"Water Meters\"\n}\n```\n\n## Entity owner Filter\n\nAllows to fetch owner (Tenant or Customer) of the specified entity. For example, this entity filter selects owner of the device with id 'e52b0020-2a7a-11ec-94eb-213c95f54093':\n\n```json\n{\n \"type\": \"stateEntityOwner\",\n \"singleEntity\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"DEVICE\"\n }\n}\n```\n\n## Asset Type Filter\n\nAllows to filter assets based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'charging station' assets which name starts with 'Tesla':\n\n```json\n{\n \"type\": \"assetType\",\n \"assetType\": \"charging station\",\n \"assetNameFilter\": \"Tesla\"\n}\n```\n\n## Device Type Filter\n\nAllows to filter devices based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Temperature Sensor' devices which name starts with 'ABC':\n\n```json\n{\n \"type\": \"deviceType\",\n \"deviceType\": \"Temperature Sensor\",\n \"deviceNameFilter\": \"ABC\"\n}\n```\n\n## Edge Type Filter\n\nAllows to filter edge instances based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Factory' edge instances which name starts with 'Nevada':\n\n```json\n{\n \"type\": \"edgeType\",\n \"edgeType\": \"Factory\",\n \"edgeNameFilter\": \"Nevada\"\n}\n```\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```\n\n## Api Usage Filter\n\nAllows to query for Api Usage based on optional customer id. If the customer id is not set, returns current tenant API usage.For example, this entity filter selects the 'Api Usage' entity for customer with id 'e6501f30-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"apiUsageState\",\n \"customerId\": {\n \"id\": \"d521edb0-2a7a-11ec-94eb-213c95f54092\",\n \"entityType\": \"CUSTOMER\"\n }\n}\n```\n\n## Relations Query Filter\n\nAllows to filter entities that are related to the provided root entity. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'filter' object allows you to define the relation type and set of acceptable entity types to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only those who match the 'filters'.\n\nFor example, this entity filter selects all devices and assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092':\n\n```json\n{\n \"type\": \"relationsQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"filters\": [\n {\n \"relationType\": \"Contains\",\n \"entityTypes\": [\n \"DEVICE\",\n \"ASSET\"\n ]\n }\n ]\n}\n```\n\n## Asset Search Query\n\nAllows to filter assets that are related to the provided root entity. Filters related assets based on the relation type and set of asset types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'assetTypes' defines the type of the asset to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only assets that match 'relationType' and 'assetTypes' conditions.\n\nFor example, this entity filter selects 'charging station' assets which are related to the asset with id 'e51de0c0-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"assetSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e51de0c0-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"assetTypes\": [\n \"charging station\"\n ]\n}\n```\n\n## Device Search Query\n\nAllows to filter devices that are related to the provided root entity. Filters related devices based on the relation type and set of device types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Charging port' and 'Air Quality Sensor' devices which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"deviceTypes\": [\n \"Air Quality Sensor\",\n \"Charging port\"\n ]\n}\n```\n\n## Entity View Query\n\nAllows to filter entity views that are related to the provided root entity. Filters related entity views based on the relation type and set of entity view types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'entityViewTypes' defines the type of the entity view to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Concrete mixer' entity views which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"entityViewSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 1,\n \"fetchLastLevelOnly\": false,\n \"relationType\": \"Contains\",\n \"entityViewTypes\": [\n \"Concrete mixer\"\n ]\n}\n```\n\n## Edge Search Query\n\nAllows to filter edge instances that are related to the provided root entity. Filters related edge instances based on the relation type and set of edge types. Possible direction values are 'TO' and 'FROM'. The 'maxLevel' defines how many relation levels should the query search 'recursively'. Assuming the 'maxLevel' is \u003E 1, the 'fetchLastLevelOnly' defines either to return all related entities or only entities that are on the last level of relations. The 'relationType' defines the type of the relation to search for. The 'deviceTypes' defines the type of the device to search for. The relation query calculates all related entities, even if they are filtered using different relation types, and then extracts only devices that match 'relationType' and 'deviceTypes' conditions.\n\nFor example, this entity filter selects 'Factory' edge instances which are related to the asset with id 'e52b0020-2a7a-11ec-94eb-213c95f54092' using 'Contains' relation:\n\n```json\n{\n \"type\": \"deviceSearchQuery\",\n \"rootEntity\": {\n \"entityType\": \"ASSET\",\n \"id\": \"e52b0020-2a7a-11ec-94eb-213c95f54092\"\n },\n \"direction\": \"FROM\",\n \"maxLevel\": 2,\n \"fetchLastLevelOnly\": true,\n \"relationType\": \"Contains\",\n \"edgeTypes\": [\n \"Factory\"\n ]\n}\n```\n\n # Key Filters\nKey Filter allows you to define complex logical expressions over entity field, attribute or latest time series value. The filter is defined using 'key', 'valueType' and 'predicate' objects. Single Entity Query may have zero, one or multiple predicates. If multiple filters are defined, they are evaluated using logical 'AND'. The example below checks that temperature of the entity is above 20 degrees:\n\n```json\n{\n \"key\": {\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n },\n \"valueType\": \"NUMERIC\",\n \"predicate\": {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n}\n```\n\n Now let's review 'key', 'valueType' and 'predicate' objects in detail.\n\n## Filter Key\n\nFilter Key defines either entity field, attribute or telemetry. It is a JSON object that consists the key name and type. The following filter key types are supported: \n\n * 'CLIENT_ATTRIBUTE' - used for client attributes; \n * 'SHARED_ATTRIBUTE' - used for shared attributes; \n * 'SERVER_ATTRIBUTE' - used for server attributes; \n * 'ATTRIBUTE' - used for any of the above; \n * 'TIME_SERIES' - used for time series values; \n * 'ENTITY_FIELD' - used for accessing entity fields like 'name', 'label', etc. The list of available fields depends on the entity type; \n * 'ALARM_FIELD' - similar to entity field, but is used in alarm queries only; \n\n\n Let's review the example:\n\n```json\n{\n \"type\": \"TIME_SERIES\",\n \"key\": \"temperature\"\n}\n```\n\n## Value Type and Operations\n\nProvides a hint about the data type of the entity field that is defined in the filter key. The value type impacts the list of possible operations that you may use in the corresponding predicate. For example, you may use 'STARTS_WITH' or 'END_WITH', but you can't use 'GREATER_OR_EQUAL' for string values.The following filter value types and corresponding predicate operations are supported: \n\n * 'STRING' - used to filter any 'String' or 'JSON' values. Operations: EQUAL, NOT_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS, NOT_CONTAINS; \n * 'NUMERIC' - used for 'Long' and 'Double' values. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n * 'BOOLEAN' - used for boolean values. Operations: EQUAL, NOT_EQUAL;\n * 'DATE_TIME' - similar to numeric, transforms value to milliseconds since epoch. Operations: EQUAL, NOT_EQUAL, GREATER, LESS, GREATER_OR_EQUAL, LESS_OR_EQUAL; \n\n\n## Filter Predicate\n\nFilter Predicate defines the logical expression to evaluate. The list of available operations depends on the filter value type, see above. Platform supports 4 predicate types: 'STRING', 'NUMERIC', 'BOOLEAN' and 'COMPLEX'. The last one allows to combine multiple operations over one filter key.\n\nSimple predicate example to check 'value \u003C 100': \n\n```json\n{\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 100,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n}\n```\n\nComplex predicate example, to check 'value \u003C 10 or value \u003E 20': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 20,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n}\n```\n\nMore complex predicate example, to check 'value \u003C 10 or (value \u003E 50 && value \u003C 60)': \n\n```json\n{\n \"type\": \"COMPLEX\",\n \"operation\": \"OR\",\n \"predicates\": [\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 10,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"type\": \"COMPLEX\",\n \"operation\": \"AND\",\n \"predicates\": [\n {\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 50,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n },\n {\n \"operation\": \"LESS\",\n \"value\": {\n \"defaultValue\": 60,\n \"dynamicValue\": null\n },\n \"type\": \"NUMERIC\"\n }\n ]\n }\n ]\n}\n```\n\n You may also want to replace hardcoded values (for example, temperature \u003E 20) with the more dynamic expression (for example, temperature \u003E 'value of the tenant attribute with key 'temperatureThreshold'). It is possible to use 'dynamicValue' to define attribute of the tenant, customer or user that is performing the API call. See example below: \n\n```json\n{\n \"operation\": \"GREATER\",\n \"value\": {\n \"defaultValue\": 0,\n \"dynamicValue\": {\n \"sourceType\": \"CURRENT_USER\",\n \"sourceAttribute\": \"temperatureThreshold\"\n }\n },\n \"type\": \"NUMERIC\"\n}\n```\n\n Note that you may use 'CURRENT_USER', 'CURRENT_CUSTOMER' and 'CURRENT_TENANT' as a 'sourceType'. The 'defaultValue' is used when the attribute with such a name is not defined for the chosen source.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "findEntityDataByQuery", + "summary": "Find related entity infos (findEntityRelationInfosByQuery)", + "description": "Returns all entity infos that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names. ", + "operationId": "findEntityRelationInfosByQuery", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityDataQuery" + "$ref": "#/components/schemas/EntityRelationsQuery" } } }, @@ -60686,7 +60294,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityData" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityRelationInfo" + } } } } @@ -60822,65 +60433,53 @@ ] } }, - "/api/entitiesQuery/find/keys": { - "post": { + "/api/relations/info/from/{fromType}/{fromId}": { + "get": { "tags": [ - "entity-query-controller" + "entity-relation-controller" ], - "summary": "Find Available Entity Keys by Query (deprecated)", - "description": "**Deprecated.** Use the V2 endpoint (`POST /api/v2/entitiesQuery/find/keys`) instead.\n\nReturns unique time series and/or attribute key names from entities matching the query.\n\nExecutes the Entity Data Query to find up to 100 entities, then fetches and aggregates all distinct key names.\n\nPrimarily used for UI features like autocomplete suggestions.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "findAvailableEntityKeysByQuery", + "summary": "Get List of Relation Infos (findEntityRelationInfosByFrom)", + "description": "Returns list of relation info objects for the specified entity by the 'from' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names. ", + "operationId": "findEntityRelationInfosByFrom", "parameters": [ { - "name": "timeseries", - "in": "query", - "description": "When true, includes unique time series key names in the response.\nWhen false, the 'timeseries' list will be empty.", + "name": "fromType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { - "type": "boolean" + "type": "string" } }, { - "name": "attributes", - "in": "query", - "description": "When true, includes unique attribute key names in the response.\nWhen false, the 'attribute' list will be empty. Use 'scope' parameter to filter by attribute scope.", + "name": "fromId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "boolean" + "type": "string" } }, { - "name": "scope", + "name": "relationTypeGroup", "in": "query", - "description": "Filters attribute keys by scope. Only applies when 'attributes' is true.\nIf not specified, returns attribute keys from all scopes.", + "description": "A string value representing relation type group. For example, 'COMMON'", "required": false, "schema": { - "type": "string", - "enum": [ - "SERVER_SCOPE", - "SHARED_SCOPE", - "CLIENT_SCOPE" - ] + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityDataQuery" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AvailableEntityKeys" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityRelationInfo" + } } } } @@ -60896,7 +60495,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -61006,7 +60605,6 @@ } } }, - "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -61017,77 +60615,53 @@ ] } }, - "/api/v2/entitiesQuery/find/keys": { - "post": { + "/api/relations/info/to/{toType}/{toId}": { + "get": { "tags": [ - "entity-query-controller" + "entity-relation-controller" ], - "summary": "Find Available Entity Keys By Query", - "description": "Discovers unique time series and/or attribute key names available on entities that match the given query.\nWorks in two steps: first, the request body (an Entity Data Query) is executed to find matching entities\n(page size is capped at 100); then, all distinct key names are collected from those entities.\n\nOptionally, each key can include a sample — the most recent value (by timestamp) for that key\nacross all matched entities.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "findAvailableEntityKeysByQueryV2", + "summary": "Get List of Relation Infos (findEntityRelationInfosByTo)", + "description": "Returns list of relation info objects for the specified entity by the 'to' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names. ", + "operationId": "findEntityRelationInfosByTo", "parameters": [ { - "name": "includeTimeseries", - "in": "query", - "description": "When true, includes unique time series keys in the response.\nWhen false, the 'timeseries' field is omitted. At least one of 'includeTimeseries' or 'includeAttributes' must be true.", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "includeAttributes", - "in": "query", - "description": "When true, includes unique attribute keys in the response.\nWhen false, the 'attributes' field is omitted. At least one of 'includeTimeseries' or 'includeAttributes' must be true.", - "required": false, + "name": "toType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, "schema": { - "type": "boolean", - "default": true + "type": "string" } }, { - "name": "scopes", - "in": "query", - "description": "Filters attribute keys by scope. Only applies when 'includeAttributes' is true.\nWhen not specified, scopes are auto-determined: all three scopes (server, client, shared) for device entities,\nserver scope only for other entity types.", - "required": false, + "name": "toId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { - "type": "string", - "enum": [ - "SERVER_SCOPE", - "SHARED_SCOPE", - "CLIENT_SCOPE" - ] + "type": "string" } }, { - "name": "includeSamples", + "name": "relationTypeGroup", "in": "query", - "description": "When true, each key entry includes a 'sample' object with the most recent value and timestamp.\nWhen false, only key names are returned (sample is omitted from JSON).", + "description": "A string value representing relation type group. For example, 'COMMON'", "required": false, "schema": { - "type": "boolean", - "default": false + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityDataQuery" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AvailableEntityKeysV2" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityRelationInfo" + } } } } @@ -61103,7 +60677,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -61223,27 +60797,18 @@ ] } }, - "/api/relation": { + "/api/relations/to/{toType}/{toId}": { "get": { "tags": [ "entity-relation-controller" ], - "summary": "Get Relation (getRelation)", - "description": "Returns relation object between two specified entities if present. Otherwise throws exception. \n\nIf the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.", - "operationId": "getRelation", + "summary": "Get List of Relations (findEntityRelationsByTo)", + "description": "Returns list of relation objects for the specified entity by the 'to' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", + "operationId": "findEntityRelationsByTo", "parameters": [ { - "name": "fromId", - "in": "query", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "fromType", - "in": "query", + "name": "toType", + "in": "path", "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { @@ -61251,9 +60816,9 @@ } }, { - "name": "relationType", - "in": "query", - "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", + "name": "toId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -61267,24 +60832,6 @@ "schema": { "type": "string" } - }, - { - "name": "toId", - "in": "query", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "toType", - "in": "query", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } } ], "responses": { @@ -61293,7 +60840,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityRelation" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityRelation" + } } } } @@ -61429,24 +60979,52 @@ ] } }, - "/api/relations": { - "post": { + "/api/relations/to/{toType}/{toId}/{relationType}": { + "get": { "tags": [ "entity-relation-controller" ], - "summary": "Find related entities (findEntityRelationsByQuery)", - "description": "Returns all entities that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info.", - "operationId": "findEntityRelationsByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityRelationsQuery" - } + "summary": "Get List of Relations (findEntityRelationsByToAndRelationType)", + "description": "Returns list of relation objects for the specified entity by the 'to' direction and relation type. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", + "operationId": "findEntityRelationsByToAndRelationType", + "parameters": [ + { + "name": "toType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "toId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "relationType", + "in": "path", + "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "relationTypeGroup", + "in": "query", + "description": "A string value representing relation type group. For example, 'COMMON'", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", @@ -61472,7 +61050,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -61590,37 +61168,36 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/v2/relation": { + "post": { "tags": [ "entity-relation-controller" ], - "summary": "Delete common relations (deleteRelations)", - "description": "Deletes all the relations ('from' and 'to' direction) for the specified entity and relation type group: 'COMMON'. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", - "operationId": "deleteRelations", - "parameters": [ - { - "name": "entityId", - "in": "query", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Create Relation (saveRelation)", + "description": "Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. \n\nIf the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.", + "operationId": "saveRelation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityRelation" + } } }, - { - "name": "entityType", - "in": "query", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityRelation" + } + } + } }, "400": { "description": "Bad Request", @@ -61633,7 +61210,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -61751,20 +61328,27 @@ "ApiKeyForm": [] } ] - } - }, - "/api/relations/from/{fromType}/{fromId}": { - "get": { + }, + "delete": { "tags": [ "entity-relation-controller" ], - "summary": "Get List of Relations (findEntityRelationsByFrom)", - "description": "Returns list of relation objects for the specified entity by the 'from' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", - "operationId": "findEntityRelationsByFrom", + "summary": "Delete Relation (deleteRelation)", + "description": "Deletes a relation between two entities in the platform. \n\nIf the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.", + "operationId": "deleteRelation", "parameters": [ + { + "name": "fromId", + "in": "query", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "fromType", - "in": "path", + "in": "query", "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { @@ -61772,9 +61356,9 @@ } }, { - "name": "fromId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "relationType", + "in": "query", + "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", "required": true, "schema": { "type": "string" @@ -61788,6 +61372,24 @@ "schema": { "type": "string" } + }, + { + "name": "toId", + "in": "query", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "toType", + "in": "query", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { @@ -61796,10 +61398,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityRelation" - } + "$ref": "#/components/schemas/EntityRelation" } } } @@ -61935,50 +61534,97 @@ ] } }, - "/api/relations/from/{fromType}/{fromId}/{relationType}": { + "/api/customer/{customerId}/entityViewInfos": { "get": { "tags": [ - "entity-relation-controller" + "entity-view-controller" ], - "summary": "Get List of Relations (findEntityRelationsByFromAndRelationType)", - "description": "Returns list of relation objects for the specified entity by the 'from' direction and relation type. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", - "operationId": "findEntityRelationsByFromAndRelationType", + "summary": "Get Customer Entity View Infos (getCustomerEntityViewInfos)", + "description": "Returns a page of entity view info objects owned by the specified customer. Entity Views Info extends the Entity View with owner name. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getCustomerEntityViewInfos", "parameters": [ { - "name": "fromType", + "name": "customerId", "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "fromId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { - "name": "relationType", - "in": "path", - "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "includeCustomers", + "in": "query", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "type", + "in": "query", + "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", + "required": false, "schema": { "type": "string" } }, { - "name": "relationTypeGroup", + "name": "textSearch", "in": "query", - "description": "A string value representing relation type group. For example, 'COMMON'", + "description": "The case insensitive 'substring' filter based on the entity view name.", "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -61987,10 +61633,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityRelation" - } + "$ref": "#/components/schemas/PageDataEntityViewInfo" } } } @@ -62126,34 +61769,97 @@ ] } }, - "/api/relations/info": { - "post": { + "/api/customer/{customerId}/entityViews": { + "get": { "tags": [ - "entity-relation-controller" + "entity-view-controller" ], - "summary": "Find related entity infos (findEntityRelationInfosByQuery)", - "description": "Returns all entity infos that are related to the specific entity. The entity id, relation type, entity types, depth of the search, and other query parameters defined using complex 'EntityRelationsQuery' object. See 'Model' tab of the Parameters for more info. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names. ", - "operationId": "findEntityRelationInfosByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityRelationsQuery" - } + "summary": "Get Customer Entity Views (getCustomerEntityViews)", + "description": "Returns a page of Entity View objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getCustomerEntityViews", + "parameters": [ + { + "name": "customerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the entity view name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityRelationInfo" - } + "$ref": "#/components/schemas/PageDataEntityView" } } } @@ -62169,7 +61875,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -62289,41 +61995,79 @@ ] } }, - "/api/relations/info/from/{fromType}/{fromId}": { + "/api/entityGroup/{entityGroupId}/entityViews": { "get": { "tags": [ - "entity-relation-controller" + "entity-view-controller" ], - "summary": "Get List of Relation Infos (findEntityRelationInfosByFrom)", - "description": "Returns list of relation info objects for the specified entity by the 'from' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names. ", - "operationId": "findEntityRelationInfosByFrom", + "summary": "Get entity views by Entity Group Id (getEntityViewsByEntityGroupId)", + "description": "Returns a page of Entity View objects that belongs to specified Entity View Id. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", + "operationId": "getEntityViewsByEntityGroupId", "parameters": [ { - "name": "fromType", + "name": "entityGroupId", "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "fromId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "string", + "minimum": 1 } }, { - "name": "relationTypeGroup", + "name": "page", "in": "query", - "description": "A string value representing relation type group. For example, 'COMMON'", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the entity view name.", "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -62332,10 +62076,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityRelationInfo" - } + "$ref": "#/components/schemas/PageDataEntityView" } } } @@ -62471,53 +62212,83 @@ ] } }, - "/api/relations/info/to/{toType}/{toId}": { - "get": { + "/api/entityView": { + "post": { "tags": [ - "entity-relation-controller" + "entity-view-controller" ], - "summary": "Get List of Relation Infos (findEntityRelationInfosByTo)", - "description": "Returns list of relation info objects for the specified entity by the 'to' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer. Relation Info is an extension of the default Relation object that contains information about the 'from' and 'to' entity names. ", - "operationId": "findEntityRelationInfosByTo", + "summary": "Save or update entity view (saveEntityView)", + "description": "Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. See the 'Model' tab for more details.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Entity View entity.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "saveEntityView", "parameters": [ { - "name": "toType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, + "name": "entityGroupId", + "in": "query", + "required": false, "schema": { "type": "string" } }, { - "name": "toId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "entityGroupIds", + "in": "query", + "description": "A list of entity group ids, separated by comma ','", + "required": false, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } }, { - "name": "relationTypeGroup", + "name": "nameConflictPolicy", "in": "query", - "description": "A string value representing relation type group. For example, 'COMMON'", + "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/NameConflictPolicy", + "default": "FAIL" + } + }, + { + "name": "uniquifySeparator", + "in": "query", + "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", + "required": false, + "schema": { + "type": "string", + "default": "_" + } + }, + { + "name": "uniquifyStrategy", + "in": "query", + "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", + "required": false, + "schema": { + "$ref": "#/components/schemas/UniquifyStrategy", + "default": "RANDOM" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityView" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityRelationInfo" - } + "$ref": "#/components/schemas/EntityView" } } } @@ -62533,7 +62304,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -62653,41 +62424,23 @@ ] } }, - "/api/relations/to/{toType}/{toId}": { + "/api/entityView/info/{entityViewId}": { "get": { "tags": [ - "entity-relation-controller" + "entity-view-controller" ], - "summary": "Get List of Relations (findEntityRelationsByTo)", - "description": "Returns list of relation objects for the specified entity by the 'to' direction. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", - "operationId": "findEntityRelationsByTo", + "summary": "Get entity view info (getEntityViewInfoById)", + "description": "Fetch the Entity View info object based on the provided entity view id. Entity Views Info extends the Entity View with owner name. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. See the 'Model' tab for more details.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEntityViewInfoById", "parameters": [ { - "name": "toType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "toId", + "name": "entityViewId", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the entity view id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - }, - { - "name": "relationTypeGroup", - "in": "query", - "description": "A string value representing relation type group. For example, 'COMMON'", - "required": false, - "schema": { - "type": "string" - } } ], "responses": { @@ -62696,10 +62449,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityRelation" - } + "$ref": "#/components/schemas/EntityViewInfo" } } } @@ -62835,52 +62585,14 @@ ] } }, - "/api/relations/to/{toType}/{toId}/{relationType}": { + "/api/entityView/types": { "get": { "tags": [ - "entity-relation-controller" - ], - "summary": "Get List of Relations (findEntityRelationsByToAndRelationType)", - "description": "Returns list of relation objects for the specified entity by the 'to' direction and relation type. \n\nIf the user has the authority of 'System Administrator', the server checks that the entity is owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that the entity is owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the entity is assigned to the same customer.", - "operationId": "findEntityRelationsByToAndRelationType", - "parameters": [ - { - "name": "toType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "toId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "relationType", - "in": "path", - "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "relationTypeGroup", - "in": "query", - "description": "A string value representing relation type group. For example, 'COMMON'", - "required": false, - "schema": { - "type": "string" - } - } + "entity-view-controller" ], + "summary": "Get Entity View Types (getEntityViewTypes)", + "description": "Returns a set of unique entity view types based on entity views that are either owned by the tenant or assigned to the customer which user is performing the request.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEntityViewTypes", "responses": { "200": { "description": "OK", @@ -62889,7 +62601,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityRelation" + "$ref": "#/components/schemas/EntitySubtype" } } } @@ -63026,31 +62738,32 @@ ] } }, - "/api/v2/relation": { - "post": { + "/api/entityView/{entityViewId}": { + "get": { "tags": [ - "entity-relation-controller" + "entity-view-controller" ], - "summary": "Create Relation (saveRelation)", - "description": "Creates or updates a relation between two entities in the platform. Relations unique key is a combination of from/to entity id and relation type group and relation type. \n\nIf the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.", - "operationId": "saveRelation", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityRelation" - } + "summary": "Get entity view (getEntityViewById)", + "description": "Fetch the EntityView object based on the provided entity view id. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. See the 'Model' tab for more details.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getEntityViewById", + "parameters": [ + { + "name": "entityViewId", + "in": "path", + "description": "A string value representing the entity view id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityRelation" + "$ref": "#/components/schemas/EntityView" } } } @@ -63066,7 +62779,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -63187,61 +62900,16 @@ }, "delete": { "tags": [ - "entity-relation-controller" + "entity-view-controller" ], - "summary": "Delete Relation (deleteRelation)", - "description": "Deletes a relation between two entities in the platform. \n\nIf the user has the authority of 'System Administrator', the server checks that 'from' and 'to' entities are owned by the sysadmin. If the user has the authority of 'Tenant Administrator', the server checks that 'from' and 'to' entities are owned by the same tenant. If the user has the authority of 'Customer User', the server checks that the 'from' and 'to' entities are assigned to the same customer.", - "operationId": "deleteRelation", + "summary": "Delete entity view (deleteEntityView)", + "description": "Delete the EntityView object based on the provided entity view id. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "deleteEntityView", "parameters": [ { - "name": "fromId", - "in": "query", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "fromType", - "in": "query", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "relationType", - "in": "query", - "description": "A string value representing relation type between entities. For example, 'Contains', 'Manages'. It can be any string value.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "relationTypeGroup", - "in": "query", - "description": "A string value representing relation type group. For example, 'COMMON'", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "toId", - "in": "query", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "toType", - "in": "query", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "name": "entityViewId", + "in": "path", + "description": "A string value representing the entity view id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -63250,14 +62918,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityRelation" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -63390,24 +63051,15 @@ ] } }, - "/api/customer/{customerId}/entityViewInfos": { + "/api/entityViewInfos/all": { "get": { "tags": [ "entity-view-controller" ], - "summary": "Get Customer Entity View Infos (getCustomerEntityViewInfos)", - "description": "Returns a page of entity view info objects owned by the specified customer. Entity Views Info extends the Entity View with owner name. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getCustomerEntityViewInfos", + "summary": "Get All Entity View Infos for current user (getAllEntityViewInfos)", + "description": "Returns a page of entity view info objects owned by the tenant or the customer of a current user. Entity Views Info extends the Entity View with owner name. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getAllEntityViewInfos", "parameters": [ - { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "pageSize", "in": "query", @@ -63625,97 +63277,34 @@ ] } }, - "/api/customer/{customerId}/entityViews": { - "get": { + "/api/entityViews": { + "post": { "tags": [ "entity-view-controller" ], - "summary": "Get Customer Entity Views (getCustomerEntityViews)", - "description": "Returns a page of Entity View objects assigned to customer. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getCustomerEntityViews", - "parameters": [ - { - "name": "customerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the entity view name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type" - ] + "summary": "Find related entity views (findEntityViewsByQuery)", + "description": "Returns all entity views that are related to the specific entity. The entity id, relation type, entity view types, depth of the search, and other query parameters defined using complex 'EntityViewSearchQuery' object. See 'Model' tab of the Parameters for more info.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "findEntityViewsByQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EntityViewSearchQuery" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityView" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityView" + } } } } @@ -63731,7 +63320,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -63851,78 +63440,25 @@ ] } }, - "/api/entityGroup/{entityGroupId}/entityViews": { + "/api/entityViews/list": { "get": { "tags": [ "entity-view-controller" ], - "summary": "Get entity views by Entity Group Id (getEntityViewsByEntityGroupId)", - "description": "Returns a page of Entity View objects that belongs to specified Entity View Id. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for specified group.", - "operationId": "getEntityViewsByEntityGroupId", + "summary": "Get Entity Views By Ids (getEntityViewsByIds)", + "description": "Requested entity views must be owned by tenant or assigned to customer which user is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getEntityViewsByIds", "parameters": [ { - "name": "entityGroupId", - "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", + "name": "entityViewIds", "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A list of entity view ids, separated by comma ','", "required": true, "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the entity view name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "array", + "items": { + "type": "string" + } } } ], @@ -63932,7 +63468,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityView" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityView" + } } } } @@ -64068,76 +63607,25 @@ ] } }, - "/api/entityView": { - "post": { + "/api/tenant/entityView": { + "get": { "tags": [ "entity-view-controller" ], - "summary": "Save or update entity view (saveEntityView)", - "description": "Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. See the 'Model' tab for more details.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Entity View entity.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "saveEntityView", + "summary": "Get Entity View by name (getTenantEntityViewByName)", + "description": "Fetch the Entity View object based on the tenant id and entity view name. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantEntityViewByName", "parameters": [ { - "name": "entityGroupId", + "name": "entityViewName", "in": "query", - "required": false, + "description": "Entity View name", + "required": true, "schema": { "type": "string" } - }, - { - "name": "entityGroupIds", - "in": "query", - "description": "A list of entity group ids, separated by comma ','", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "nameConflictPolicy", - "in": "query", - "description": "Optional value of name conflict policy. Possible values: FAIL or UNIQUIFY. If omitted, FAIL policy is applied. FAIL policy implies exception will be thrown if an entity with the same name already exists. UNIQUIFY policy appends a suffix to the entity name, if a name conflict occurs.", - "required": false, - "schema": { - "$ref": "#/components/schemas/NameConflictPolicy", - "default": "FAIL" - } - }, - { - "name": "uniquifySeparator", - "in": "query", - "description": "Optional value of name suffix separator used by UNIQUIFY policy. By default, underscore separator is used. For example, strategy is UNIQUIFY, separator is '-'; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-7fsh4f'.", - "required": false, - "schema": { - "type": "string", - "default": "_" - } - }, - { - "name": "uniquifyStrategy", - "in": "query", - "description": "Optional value of uniquify strategy used by UNIQUIFY policy. Possible values: RANDOM or INCREMENTAL. By default, RANDOM strategy is used, which means random alphanumeric string will be added as a suffix to entity name. INCREMENTAL implies the first possible number starting from 1 will be added as a name suffix. For example, strategy is UNIQUIFY, uniquify strategy is INCREMENTAL; if a name conflict occurs for entity name 'test-name', created entity will have name like 'test-name-1.", - "required": false, - "schema": { - "$ref": "#/components/schemas/UniquifyStrategy", - "default": "RANDOM" - } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityView" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", @@ -64160,7 +63648,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -64280,23 +63768,79 @@ ] } }, - "/api/entityView/info/{entityViewId}": { + "/api/tenant/entityViews": { "get": { "tags": [ "entity-view-controller" ], - "summary": "Get entity view info (getEntityViewInfoById)", - "description": "Fetch the Entity View info object based on the provided entity view id. Entity Views Info extends the Entity View with owner name. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. See the 'Model' tab for more details.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEntityViewInfoById", + "summary": "Get Tenant Entity Views (getTenantEntityViews)", + "description": "Returns a page of entity views owned by tenant. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantEntityViews", "parameters": [ { - "name": "entityViewId", - "in": "path", - "description": "A string value representing the entity view id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", + "required": false, "schema": { "type": "string" } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the entity view name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -64305,7 +63849,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityViewInfo" + "$ref": "#/components/schemas/PageDataEntityView" } } } @@ -64441,24 +63985,88 @@ ] } }, - "/api/entityView/types": { + "/api/user/entityViews": { "get": { "tags": [ "entity-view-controller" ], - "summary": "Get Entity View Types (getEntityViewTypes)", - "description": "Returns a set of unique entity view types based on entity views that are either owned by the tenant or assigned to the customer which user is performing the request.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEntityViewTypes", + "summary": "Get Entity Views (getUserEntityViews)", + "description": "Returns a page of entity views that are available for the current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getUserEntityViews", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "type", + "in": "query", + "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the entity view name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntitySubtype" - } + "$ref": "#/components/schemas/PageDataEntityView" } } } @@ -64594,32 +64202,135 @@ ] } }, - "/api/entityView/{entityViewId}": { - "get": { + "/api/events/{entityType}/{entityId}": { + "post": { "tags": [ - "entity-view-controller" + "event-controller" ], - "summary": "Get entity view (getEntityViewById)", - "description": "Fetch the EntityView object based on the provided entity view id. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. See the 'Model' tab for more details.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getEntityViewById", + "summary": "Get Events by event filter (getEventsByFilter)", + "description": "Returns a page of events for the chosen entity by specifying the event filter. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n# Event Filter Definition\n\n6 different eventFilter objects could be set for different event types. The eventType field is required. Others are optional. If some of them are set, the filtering will be applied according to them. See the examples below for all the fields used for each event type filtering. \n\nNote,\n\n * 'server' - string value representing the server name, identif ier or ip address where the platform is running;\n * 'errorStr' - the case insensitive 'contains' filter based on error message.\n\n## Error Event Filter\n\n```json\n{\n \"eventType\":\"ERROR\",\n \"server\":\"ip-172-31-24-152\",\n \"method\":\"onClusterEventMsg\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n * 'method' - string value representing the method name when the error happened.\n\n## Lifecycle Event Filter\n\n```json\n{\n \"eventType\":\"LC_EVENT\",\n \"server\":\"ip-172-31-24-152\",\n \"event\":\"STARTED\",\n \"status\":\"Success\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n * 'event' - string value representing the lifecycle event type;\n * 'status' - string value representing status of the lifecycle event.\n\n## Statistics Event Filter\n\n```json\n{\n \"eventType\":\"STATS\",\n \"server\":\"ip-172-31-24-152\",\n \"messagesProcessed\":10,\n \"errorsOccurred\":5\n}\n```\n\n * 'messagesProcessed' - the minimum number of successfully processed messages;\n * 'errorsOccurred' - the minimum number of errors occurred during messages processing.\n\n## Debug Rule Node Event Filter\n\n```json\n{\n \"eventType\":\"DEBUG_RULE_NODE\",\n \"msgDirectionType\":\"IN\",\n \"server\":\"ip-172-31-24-152\",\n \"dataSearch\":\"humidity\",\n \"metadataSearch\":\"deviceName\",\n \"entityName\":\"DEVICE\",\n \"relationType\":\"Success\",\n \"entityId\":\"de9d54a0-2b7a-11ec-a3cc-23386423d98f\",\n \"msgType\":\"POST_TELEMETRY_REQUEST\",\n \"isError\":\"false\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n## Debug Rule Chain Event Filter\n\n```json\n{\n \"eventType\":\"DEBUG_RULE_CHAIN\",\n \"msgDirectionType\":\"IN\",\n \"server\":\"ip-172-31-24-152\",\n \"dataSearch\":\"humidity\",\n \"metadataSearch\":\"deviceName\",\n \"entityName\":\"DEVICE\",\n \"relationType\":\"Success\",\n \"entityId\":\"de9d54a0-2b7a-11ec-a3cc-23386423d98f\",\n \"msgType\":\"POST_TELEMETRY_REQUEST\",\n \"isError\":\"false\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n * 'msgDirectionType' - string value representing msg direction type (incoming to entity or outcoming from entity);\n * 'dataSearch' - the case insensitive 'contains' filter based on data (key and value) for the message;\n * 'metadataSearch' - the case insensitive 'contains' filter based on metadata (key and value) for the message;\n * 'entityName' - string value representing the entity type;\n * 'relationType' - string value representing the type of message routing;\n * 'entityId' - string value representing the entity id in the event body (originator of the message);\n * 'msgType' - string value representing the message type;\n * 'isError' - boolean value to filter the errors.\n\n## Debug Calculated Field Event Filter\n\n```json\n{\n \"eventType\":\"DEBUG_CALCULATED_FIELD\",\n \"server\":\"ip-172-31-24-152\",\n \"isError\":\"false\",\n \"errorStr\":\"Error Message\"\n \"entityId\":\"cf4b8741-f618-471f-ae08-d881ca7f9fe9\",\n \"msgId\":\"5cf7d3a0-aee7-40dd-a737-ade05528e7eb\",\n \"msgType\":\"POST_TELEMETRY_REQUEST\",\n \"arguments\":\"{\n \"x\": {\n \"ts\": 1739432016629,\n \"value\": 20\n },\n \"y\": {\n \"ts\": 1739429717656,\n \"value\": 12\n }\n }\",\n \"result\":\"{\n \"x + y\": 32\n }\",\n}\n```\n\n * 'entityId' - string value representing the entity id in the event body;\n * 'entityType' - string value representing the entity type;\n * 'msgId' - string value representing the message id in the rule engine;\n * 'msgType' - string value representing the message type;\n * 'arguments' - string value representing the arguments that were used in the calculation performed;\n * 'result' - string value representing the result of a calculation;\n * 'isError' - boolean value to filter the errors.\n\n", + "operationId": "getEventsByFilter", "parameters": [ { - "name": "entityViewId", + "name": "entityType", "in": "path", - "description": "A string value representing the entity view id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { "type": "string" } + }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tenantId", + "in": "query", + "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The value is not used in searching.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ts", + "id" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + }, + { + "name": "startTime", + "in": "query", + "description": "Timestamp. Events with creation time before it won't be queried.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Timestamp. Events with creation time after it won't be queried.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventFilter" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityView" + "$ref": "#/components/schemas/PageDataEventInfo" } } } @@ -64635,7 +64346,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -64753,25 +64464,66 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/events/{entityType}/{entityId}/clear": { + "post": { "tags": [ - "entity-view-controller" + "event-controller" ], - "summary": "Delete entity view (deleteEntityView)", - "description": "Delete the EntityView object based on the provided entity view id. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "deleteEntityView", + "summary": "Clear Events (clearEvents)", + "description": "Clears events by filter for specified entity.", + "operationId": "clearEvents", "parameters": [ { - "name": "entityViewId", + "name": "entityType", "in": "path", - "description": "A string value representing the entity view id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { "type": "string" } + }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "startTime", + "in": "query", + "description": "Timestamp. Events with creation time before it won't be queried.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Timestamp. Events with creation time after it won't be queried.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventFilter" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK" @@ -64787,7 +64539,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -64907,57 +64659,76 @@ ] } }, - "/api/entityViewInfos/all": { + "/api/events/{entityType}/{entityId}/{eventType}": { "get": { "tags": [ - "entity-view-controller" + "event-controller" ], - "summary": "Get All Entity View Infos for current user (getAllEntityViewInfos)", - "description": "Returns a page of entity view info objects owned by the tenant or the customer of a current user. Entity Views Info extends the Entity View with owner name. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getAllEntityViewInfos", + "summary": "Get Events by type (getEventsByType)", + "description": "Returns a page of events for specified entity by specifying event type. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", + "operationId": "getEventsByType", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } }, { - "name": "page", + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "eventType", + "in": "path", + "description": "A string value representing event type", + "required": true, + "schema": { + "type": "string" + }, + "example": "STATS" + }, + { + "name": "tenantId", "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } }, { - "name": "includeCustomers", + "name": "pageSize", "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, + "description": "Maximum amount of entities in a one page", + "required": true, "schema": { - "type": "boolean" + "type": "integer", + "format": "int32" } }, { - "name": "type", + "name": "page", "in": "query", - "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", - "required": false, + "description": "Sequence number of page starting from 0", + "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { "name": "textSearch", "in": "query", - "description": "The case insensitive 'substring' filter based on the entity view name.", + "description": "The value is not used in searching.", "required": false, "schema": { "type": "string" @@ -64971,9 +64742,8 @@ "schema": { "type": "string", "enum": [ - "createdTime", - "name", - "type" + "ts", + "id" ] } }, @@ -64989,6 +64759,26 @@ "DESC" ] } + }, + { + "name": "startTime", + "in": "query", + "description": "Timestamp. Events with creation time before it won't be queried.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Timestamp. Events with creation time after it won't be queried.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { @@ -64997,7 +64787,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityViewInfo" + "$ref": "#/components/schemas/PageDataEventInfo" } } } @@ -65133,24 +64923,25 @@ ] } }, - "/api/entityViews": { - "post": { + "/api/entityGroup/{entityGroupId}/groupPermissions": { + "get": { "tags": [ - "entity-view-controller" + "group-permission-controller" ], - "summary": "Find related entity views (findEntityViewsByQuery)", - "description": "Returns all entity views that are related to the specific entity. The entity id, relation type, entity view types, depth of the search, and other query parameters defined using complex 'EntityViewSearchQuery' object. See 'Model' tab of the Parameters for more info.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "findEntityViewsByQuery", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityViewSearchQuery" - } + "summary": "Get group permissions by Entity Group Id (getEntityGroupPermissions)", + "description": "Returns a list of group permission objects that is assigned for the specified Entity Group Id. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getEntityGroupPermissions", + "parameters": [ + { + "name": "entityGroupId", + "in": "path", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", @@ -65159,7 +64950,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityView" + "$ref": "#/components/schemas/GroupPermissionInfo" } } } @@ -65176,7 +64967,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -65296,38 +65087,31 @@ ] } }, - "/api/entityViews/list": { - "get": { + "/api/groupPermission": { + "post": { "tags": [ - "entity-view-controller" + "group-permission-controller" ], - "summary": "Get Entity Views By Ids (getEntityViewsByIds)", - "description": "Requested entity views must be owned by tenant or assigned to customer which user is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getEntityViewsByIds", - "parameters": [ - { - "name": "entityViewIds", - "in": "query", - "description": "A list of entity view ids, separated by comma ','", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" + "summary": "Create Or Update Group Permission (saveGroupPermission)", + "description": "Creates or Updates the Group Permission. When creating group permission, platform generates Group Permission Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Group Permission id will be present in the response. Specify existing Group Permission id to update the permission. Referencing non-existing Group Permission Id will cause 'Not Found' error.\n\nGroup permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "saveGroupPermission", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupPermission" } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityView" - } + "$ref": "#/components/schemas/GroupPermission" } } } @@ -65343,7 +65127,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -65463,23 +65247,32 @@ ] } }, - "/api/tenant/entityView": { + "/api/groupPermission/info/{groupPermissionId}": { "get": { "tags": [ - "entity-view-controller" + "group-permission-controller" ], - "summary": "Get Entity View by name (getTenantEntityViewByName)", - "description": "Fetch the Entity View object based on the tenant id and entity view name. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantEntityViewByName", + "summary": "Get Group Permission Info (getGroupPermissionInfoById)", + "description": "Fetch the Group Permission Info object based on the provided Group Permission Id and the flag that controls what additional information to load: User or Entity Group. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getGroupPermissionInfoById", "parameters": [ { - "name": "entityViewName", - "in": "query", - "description": "Entity View name", + "name": "groupPermissionId", + "in": "path", + "description": "A string value representing the group permission id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } + }, + { + "name": "isUserGroup", + "in": "query", + "description": "Load additional information about User('true') or Entity Group('false).", + "required": true, + "schema": { + "type": "boolean" + } } ], "responses": { @@ -65488,7 +65281,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EntityView" + "$ref": "#/components/schemas/GroupPermissionInfo" } } } @@ -65624,79 +65417,23 @@ ] } }, - "/api/tenant/entityViews": { + "/api/groupPermission/{groupPermissionId}": { "get": { "tags": [ - "entity-view-controller" + "group-permission-controller" ], - "summary": "Get Tenant Entity Views (getTenantEntityViews)", - "description": "Returns a page of entity views owned by tenant. Entity Views limit the degree of exposure of the Device or Asset telemetry and attributes to the Customers. Every Entity View references exactly one entity (device or asset) and defines telemetry and attribute keys that will be visible to the assigned Customer. As a Tenant Administrator you are able to create multiple EVs per Device or Asset and assign them to different Customers. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantEntityViews", + "summary": "Get Group Permission (getGroupPermissionById)", + "description": "Fetch the Group Permission object based on the provided Group Permission Id. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getGroupPermissionById", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "groupPermissionId", + "in": "path", + "description": "A string value representing the group permission id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the entity view name.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -65705,7 +65442,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEntityView" + "$ref": "#/components/schemas/GroupPermission" } } } @@ -65839,93 +65576,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/user/entityViews": { - "get": { + }, + "delete": { "tags": [ - "entity-view-controller" + "group-permission-controller" ], - "summary": "Get Entity Views (getUserEntityViews)", - "description": "Returns a page of entity views that are available for the current user. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getUserEntityViews", + "summary": "Delete group permission (deleteGroupPermission)", + "description": "Deletes the group permission. Referencing non-existing group permission Id will cause an error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "deleteGroupPermission", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "groupPermissionId", + "in": "path", + "description": "A string value representing the group permission id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "type", - "in": "query", - "description": "\n\n## Entity View Filter\n\nAllows to filter entity views based on their type and the **'starts with'** expression over their name. For example, this entity filter selects all 'Concrete Mixer' entity views which name starts with 'CAT':\n\n```json\n{\n \"type\": \"entityViewType\",\n \"entityViewType\": \"Concrete Mixer\",\n \"entityViewNameFilter\": \"CAT\"\n}\n```", - "required": false, "schema": { "type": "string" } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the entity view name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataEntityView" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -66058,123 +65730,23 @@ ] } }, - "/api/events/{entityType}/{entityId}": { + "/api/userGroup/groupPermissions/info": { "post": { "tags": [ - "event-controller" - ], - "summary": "Get Events by event filter (getEventsByFilter)", - "description": "Returns a page of events for the chosen entity by specifying the event filter. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n# Event Filter Definition\n\n6 different eventFilter objects could be set for different event types. The eventType field is required. Others are optional. If some of them are set, the filtering will be applied according to them. See the examples below for all the fields used for each event type filtering. \n\nNote,\n\n * 'server' - string value representing the server name, identif ier or ip address where the platform is running;\n * 'errorStr' - the case insensitive 'contains' filter based on error message.\n\n## Error Event Filter\n\n```json\n{\n \"eventType\":\"ERROR\",\n \"server\":\"ip-172-31-24-152\",\n \"method\":\"onClusterEventMsg\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n * 'method' - string value representing the method name when the error happened.\n\n## Lifecycle Event Filter\n\n```json\n{\n \"eventType\":\"LC_EVENT\",\n \"server\":\"ip-172-31-24-152\",\n \"event\":\"STARTED\",\n \"status\":\"Success\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n * 'event' - string value representing the lifecycle event type;\n * 'status' - string value representing status of the lifecycle event.\n\n## Statistics Event Filter\n\n```json\n{\n \"eventType\":\"STATS\",\n \"server\":\"ip-172-31-24-152\",\n \"messagesProcessed\":10,\n \"errorsOccurred\":5\n}\n```\n\n * 'messagesProcessed' - the minimum number of successfully processed messages;\n * 'errorsOccurred' - the minimum number of errors occurred during messages processing.\n\n## Debug Rule Node Event Filter\n\n```json\n{\n \"eventType\":\"DEBUG_RULE_NODE\",\n \"msgDirectionType\":\"IN\",\n \"server\":\"ip-172-31-24-152\",\n \"dataSearch\":\"humidity\",\n \"metadataSearch\":\"deviceName\",\n \"entityName\":\"DEVICE\",\n \"relationType\":\"Success\",\n \"entityId\":\"de9d54a0-2b7a-11ec-a3cc-23386423d98f\",\n \"msgType\":\"POST_TELEMETRY_REQUEST\",\n \"isError\":\"false\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n## Debug Rule Chain Event Filter\n\n```json\n{\n \"eventType\":\"DEBUG_RULE_CHAIN\",\n \"msgDirectionType\":\"IN\",\n \"server\":\"ip-172-31-24-152\",\n \"dataSearch\":\"humidity\",\n \"metadataSearch\":\"deviceName\",\n \"entityName\":\"DEVICE\",\n \"relationType\":\"Success\",\n \"entityId\":\"de9d54a0-2b7a-11ec-a3cc-23386423d98f\",\n \"msgType\":\"POST_TELEMETRY_REQUEST\",\n \"isError\":\"false\",\n \"errorStr\":\"Error Message\"\n}\n```\n\n * 'msgDirectionType' - string value representing msg direction type (incoming to entity or outcoming from entity);\n * 'dataSearch' - the case insensitive 'contains' filter based on data (key and value) for the message;\n * 'metadataSearch' - the case insensitive 'contains' filter based on metadata (key and value) for the message;\n * 'entityName' - string value representing the entity type;\n * 'relationType' - string value representing the type of message routing;\n * 'entityId' - string value representing the entity id in the event body (originator of the message);\n * 'msgType' - string value representing the message type;\n * 'isError' - boolean value to filter the errors.\n\n## Debug Calculated Field Event Filter\n\n```json\n{\n \"eventType\":\"DEBUG_CALCULATED_FIELD\",\n \"server\":\"ip-172-31-24-152\",\n \"isError\":\"false\",\n \"errorStr\":\"Error Message\"\n \"entityId\":\"cf4b8741-f618-471f-ae08-d881ca7f9fe9\",\n \"msgId\":\"5cf7d3a0-aee7-40dd-a737-ade05528e7eb\",\n \"msgType\":\"POST_TELEMETRY_REQUEST\",\n \"arguments\":\"{\n \"x\": {\n \"ts\": 1739432016629,\n \"value\": 20\n },\n \"y\": {\n \"ts\": 1739429717656,\n \"value\": 12\n }\n }\",\n \"result\":\"{\n \"x + y\": 32\n }\",\n}\n```\n\n * 'entityId' - string value representing the entity id in the event body;\n * 'entityType' - string value representing the entity type;\n * 'msgId' - string value representing the message id in the rule engine;\n * 'msgType' - string value representing the message type;\n * 'arguments' - string value representing the arguments that were used in the calculation performed;\n * 'result' - string value representing the result of a calculation;\n * 'isError' - boolean value to filter the errors.\n\n", - "operationId": "getEventsByFilter", - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "tenantId", - "in": "query", - "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The value is not used in searching.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ts", - "id" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - }, - { - "name": "startTime", - "in": "query", - "description": "Timestamp. Events with creation time before it won't be queried.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTime", - "in": "query", - "description": "Timestamp. Events with creation time after it won't be queried.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - } + "group-permission-controller" ], + "summary": "Load User Group Permissions (loadUserGroupPermissionInfos)", + "description": "Enrich a list of group permission objects with the information about Role, User and Entity Groups. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "loadUserGroupPermissionInfos", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EventFilter" + "type": "array", + "description": "JSON array of group permission objects", + "items": { + "$ref": "#/components/schemas/GroupPermission" + } } } }, @@ -66186,7 +65758,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEventInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupPermissionInfo" + } } } } @@ -66322,67 +65897,38 @@ ] } }, - "/api/events/{entityType}/{entityId}/clear": { - "post": { + "/api/userGroup/{userGroupId}/groupPermissions": { + "get": { "tags": [ - "event-controller" + "group-permission-controller" ], - "summary": "Clear Events (clearEvents)", - "description": "Clears events by filter for specified entity.", - "operationId": "clearEvents", + "summary": "Get group permissions by User Group Id (getUserGroupPermissions)", + "description": "Returns a list of group permission objects that belongs to specified User Group Id. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getUserGroupPermissions", "parameters": [ { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityId", + "name": "userGroupId", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - }, - { - "name": "startTime", - "in": "query", - "description": "Timestamp. Events with creation time before it won't be queried.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTime", - "in": "query", - "description": "Timestamp. Events with creation time after it won't be queried.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EventFilter" - } - } - }, - "required": true - }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupPermissionInfo" + } + } + } + } }, "400": { "description": "Bad Request", @@ -66395,7 +65941,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -66515,135 +66061,44 @@ ] } }, - "/api/events/{entityType}/{entityId}/{eventType}": { - "get": { + "/api/image": { + "post": { "tags": [ - "event-controller" + "image-controller" ], - "summary": "Get Events by type (getEventsByType)", - "description": "Returns a page of events for specified entity by specifying event type. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. ", - "operationId": "getEventsByType", - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "eventType", - "in": "path", - "description": "A string value representing event type", - "required": true, - "schema": { - "type": "string" - }, - "example": "STATS" - }, - { - "name": "tenantId", - "in": "query", - "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The value is not used in searching.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ts", - "id" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - }, - { - "name": "startTime", - "in": "query", - "description": "Timestamp. Events with creation time before it won't be queried.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTime", - "in": "query", - "description": "Timestamp. Events with creation time after it won't be queried.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + "summary": "uploadImage", + "operationId": "uploadImage", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + }, + "title": { + "type": "string" + }, + "imageSubType": { + "type": "string" + } + }, + "required": [ + "file" + ] + } } } - ], + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataEventInfo" + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -66659,7 +66114,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -66779,35 +66234,30 @@ ] } }, - "/api/entityGroup/{entityGroupId}/groupPermissions": { - "get": { + "/api/image/import": { + "put": { "tags": [ - "group-permission-controller" + "image-controller" ], - "summary": "Get group permissions by Entity Group Id (getEntityGroupPermissions)", - "description": "Returns a list of group permission objects that is assigned for the specified Entity Group Id. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getEntityGroupPermissions", - "parameters": [ - { - "name": "entityGroupId", - "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "importImage", + "operationId": "importImage", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResourceExportData" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GroupPermissionInfo" - } + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -66943,31 +66393,101 @@ ] } }, - "/api/groupPermission": { - "post": { + "/api/images": { + "get": { "tags": [ - "group-permission-controller" + "image-controller" ], - "summary": "Create Or Update Group Permission (saveGroupPermission)", - "description": "Creates or Updates the Group Permission. When creating group permission, platform generates Group Permission Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Group Permission id will be present in the response. Specify existing Group Permission id to update the permission. Referencing non-existing Group Permission Id will cause 'Not Found' error.\n\nGroup permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "saveGroupPermission", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GroupPermission" - } + "summary": "getImages", + "operationId": "getImages", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "imageSubType", + "in": "query", + "description": "A string value representing resource sub-type.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "IMAGE", + "SCADA_SYMBOL" + ] + } + }, + { + "name": "includeSystemImages", + "in": "query", + "description": "Use 'true' to include system images. Disabled by default. Ignored for requests by users with system administrator authority.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the resource title.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "title", + "resourceType", + "tenantId" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GroupPermission" + "$ref": "#/components/schemas/PageDataTbResourceInfo" } } } @@ -66983,7 +66503,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -67103,31 +66623,36 @@ ] } }, - "/api/groupPermission/info/{groupPermissionId}": { + "/api/images/public/{publicResourceKey}": { "get": { "tags": [ - "group-permission-controller" + "image-controller" ], - "summary": "Get Group Permission Info (getGroupPermissionInfoById)", - "description": "Fetch the Group Permission Info object based on the provided Group Permission Id and the flag that controls what additional information to load: User or Entity Group. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getGroupPermissionInfoById", + "summary": "downloadPublicImage", + "operationId": "downloadPublicImage", "parameters": [ { - "name": "groupPermissionId", + "name": "publicResourceKey", "in": "path", - "description": "A string value representing the group permission id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "isUserGroup", - "in": "query", - "description": "Load additional information about User('true') or Entity Group('false).", - "required": true, + "name": "If-None-Match", + "in": "header", + "required": false, "schema": { - "type": "boolean" + "type": "string" + } + }, + { + "name": "Accept-Encoding", + "in": "header", + "required": false, + "schema": { + "type": "string" } } ], @@ -67135,9 +66660,10 @@ "200": { "description": "OK", "content": { - "application/json": { + "image/*": { "schema": { - "$ref": "#/components/schemas/GroupPermissionInfo" + "type": "string", + "format": "binary" } } } @@ -67273,32 +66799,61 @@ ] } }, - "/api/groupPermission/{groupPermissionId}": { + "/api/images/{type}/{key}": { "get": { "tags": [ - "group-permission-controller" + "image-controller" ], - "summary": "Get Group Permission (getGroupPermissionById)", - "description": "Fetch the Group Permission object based on the provided Group Permission Id. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getGroupPermissionById", + "summary": "downloadImage", + "operationId": "downloadImage", "parameters": [ { - "name": "groupPermissionId", + "name": "type", "in": "path", - "description": "A string value representing the group permission id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Type of the image: tenant or system", + "required": true, + "schema": { + "type": "string", + "enum": [ + "tenant", + "system" + ] + } + }, + { + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", "required": true, "schema": { "type": "string" } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "Accept-Encoding", + "in": "header", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { "200": { "description": "OK", "content": { - "application/json": { + "image/*": { "schema": { - "$ref": "#/components/schemas/GroupPermission" + "type": "string", + "format": "binary" } } } @@ -67433,27 +66988,64 @@ } ] }, - "delete": { + "put": { "tags": [ - "group-permission-controller" + "image-controller" ], - "summary": "Delete group permission (deleteGroupPermission)", - "description": "Deletes the group permission. Referencing non-existing group permission Id will cause an error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "deleteGroupPermission", + "summary": "updateImage", + "operationId": "updateImage", "parameters": [ { - "name": "groupPermissionId", + "name": "type", "in": "path", - "description": "A string value representing the group permission id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Type of the image: tenant or system", + "required": true, + "schema": { + "type": "string", + "enum": [ + "tenant", + "system" + ] + } + }, + { + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "file" + ] + } + } + } + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TbResourceInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -67584,40 +67176,52 @@ "ApiKeyForm": [] } ] - } - }, - "/api/userGroup/groupPermissions/info": { - "post": { + }, + "delete": { "tags": [ - "group-permission-controller" + "image-controller" ], - "summary": "Load User Group Permissions (loadUserGroupPermissionInfos)", - "description": "Enrich a list of group permission objects with the information about Role, User and Entity Groups. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "loadUserGroupPermissionInfos", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "description": "JSON array of group permission objects", - "items": { - "$ref": "#/components/schemas/GroupPermission" - } - } + "summary": "deleteImage", + "operationId": "deleteImage", + "parameters": [ + { + "name": "type", + "in": "path", + "description": "Type of the image: tenant or system", + "required": true, + "schema": { + "type": "string", + "enum": [ + "tenant", + "system" + ] } }, - "required": true - }, + { + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GroupPermissionInfo" - } + "$ref": "#/components/schemas/TbImageDeleteResult" } } } @@ -67633,7 +67237,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -67753,19 +67357,31 @@ ] } }, - "/api/userGroup/{userGroupId}/groupPermissions": { + "/api/images/{type}/{key}/export": { "get": { "tags": [ - "group-permission-controller" + "image-controller" ], - "summary": "Get group permissions by User Group Id (getUserGroupPermissions)", - "description": "Returns a list of group permission objects that belongs to specified User Group Id. Group permission entity represents list of allowed operations for certain User Group to perform against certain Entity Group. Basically, this entity wires three other entities: \n\n * Role that defines set of allowed operations;\n * User Group that defines set of users who may perform the operations; \n * Entity Group that defines set of entities which will be accessible to users;\n\n Group Permission Info object extends the Group Permissions with the full information about Role and User and/or Entity Groups. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getUserGroupPermissions", + "summary": "exportImage", + "operationId": "exportImage", "parameters": [ { - "name": "userGroupId", + "name": "type", "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Type of the image: tenant or system", + "required": true, + "schema": { + "type": "string", + "enum": [ + "tenant", + "system" + ] + } + }, + { + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", "required": true, "schema": { "type": "string" @@ -67778,10 +67394,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GroupPermissionInfo" - } + "$ref": "#/components/schemas/ResourceExportData" } } } @@ -67917,37 +67530,37 @@ ] } }, - "/api/image": { - "post": { + "/api/images/{type}/{key}/info": { + "get": { "tags": [ "image-controller" ], - "summary": "uploadImage", - "operationId": "uploadImage", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "format": "binary" - }, - "title": { - "type": "string" - }, - "imageSubType": { - "type": "string" - } - }, - "required": [ - "file" - ] - } + "summary": "getImageInfo", + "operationId": "getImageInfo", + "parameters": [ + { + "name": "type", + "in": "path", + "description": "Type of the image: tenant or system", + "required": true, + "schema": { + "type": "string", + "enum": [ + "tenant", + "system" + ] + } + }, + { + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { "description": "OK", @@ -67970,7 +67583,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -68088,20 +67701,42 @@ "ApiKeyForm": [] } ] - } - }, - "/api/image/import": { + }, "put": { "tags": [ "image-controller" ], - "summary": "importImage", - "operationId": "importImage", + "summary": "updateImageInfo", + "operationId": "updateImageInfo", + "parameters": [ + { + "name": "type", + "in": "path", + "description": "Type of the image: tenant or system", + "required": true, + "schema": { + "type": "string", + "enum": [ + "tenant", + "system" + ] + } + }, + { + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResourceExportData" + "$ref": "#/components/schemas/TbResourceInfo" } } }, @@ -68249,91 +67884,50 @@ ] } }, - "/api/images": { + "/api/images/{type}/{key}/preview": { "get": { "tags": [ "image-controller" ], - "summary": "getImages", - "operationId": "getImages", + "summary": "downloadImagePreview", + "operationId": "downloadImagePreview", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "type", + "in": "path", + "description": "Type of the image: tenant or system", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "imageSubType", - "in": "query", - "description": "A string value representing resource sub-type.", - "required": false, "schema": { "type": "string", "enum": [ - "IMAGE", - "SCADA_SYMBOL" + "tenant", + "system" ] } }, { - "name": "includeSystemImages", - "in": "query", - "description": "Use 'true' to include system images. Disabled by default. Ignored for requests by users with system administrator authority.", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the resource title.", - "required": false, + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "required": true, "schema": { "type": "string" } }, { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", + "name": "If-None-Match", + "in": "header", "required": false, "schema": { - "type": "string", - "enum": [ - "createdTime", - "title", - "resourceType", - "tenantId" - ] + "type": "string" } }, { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "name": "Accept-Encoding", + "in": "header", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "string" } } ], @@ -68341,9 +67935,10 @@ "200": { "description": "OK", "content": { - "application/json": { + "image/png": { "schema": { - "$ref": "#/components/schemas/PageDataTbResourceInfo" + "type": "string", + "format": "binary" } } } @@ -68479,36 +68074,42 @@ ] } }, - "/api/images/public/{publicResourceKey}": { - "get": { + "/api/images/{type}/{key}/public/{isPublic}": { + "put": { "tags": [ "image-controller" ], - "summary": "downloadPublicImage", - "operationId": "downloadPublicImage", + "summary": "updateImagePublicStatus", + "operationId": "updateImagePublicStatus", "parameters": [ { - "name": "publicResourceKey", + "name": "type", "in": "path", + "description": "Type of the image: tenant or system", "required": true, "schema": { - "type": "string" + "type": "string", + "enum": [ + "tenant", + "system" + ] } }, { - "name": "If-None-Match", - "in": "header", - "required": false, + "name": "key", + "in": "path", + "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "required": true, "schema": { "type": "string" } }, { - "name": "Accept-Encoding", - "in": "header", - "required": false, + "name": "isPublic", + "in": "path", + "required": true, "schema": { - "type": "string" + "type": "boolean" } } ], @@ -68516,10 +68117,9 @@ "200": { "description": "OK", "content": { - "image/*": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -68655,13 +68255,13 @@ ] } }, - "/api/images/{type}/{key}": { + "/api/noauth/whiteLabel/loginFavicon/{type}/{key}": { "get": { "tags": [ "image-controller" ], - "summary": "downloadImage", - "operationId": "downloadImage", + "summary": "downloadLoginFavicon", + "operationId": "downloadLoginFavicon", "parameters": [ { "name": "type", @@ -68834,22 +68434,16 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - }, - "put": { + } + } + }, + "/api/noauth/whiteLabel/loginLogo/{type}/{key}": { + "get": { "tags": [ "image-controller" ], - "summary": "updateImage", - "operationId": "updateImage", + "summary": "downloadLoginLogo", + "operationId": "downloadLoginLogo", "parameters": [ { "name": "type", @@ -68872,33 +68466,32 @@ "schema": { "type": "string" } - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "format": "binary" - } - }, - "required": [ - "file" - ] - } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "Accept-Encoding", + "in": "header", + "required": false, + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { "description": "OK", "content": { - "application/json": { + "image/*": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "type": "string", + "format": "binary" } } } @@ -69023,51 +68616,37 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - }, - "delete": { + } + } + }, + "/api/edge/integration/{edgeId}/missingAttributes": { + "get": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "deleteImage", - "operationId": "deleteImage", + "summary": "Find edge missing attributes for assigned integrations (findEdgeMissingAttributes)", + "description": "Returns list of edge attribute names that are missing in assigned integrations.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "findEdgeMissingAttributes", "parameters": [ { - "name": "type", - "in": "path", - "description": "Type of the image: tenant or system", - "required": true, - "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] - } - }, - { - "name": "key", + "name": "edgeId", "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "force", + "name": "integrationIds", "in": "query", - "required": false, + "description": "A list of assigned integration ids, separated by comma ','", + "required": true, "schema": { - "type": "boolean" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -69077,7 +68656,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbImageDeleteResult" + "type": "string" } } } @@ -69213,31 +68792,19 @@ ] } }, - "/api/images/{type}/{key}/export": { + "/api/edge/integration/{integrationId}/allMissingAttributes": { "get": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "exportImage", - "operationId": "exportImage", + "summary": "Find missing attributes for all related edges (findAllRelatedEdgesMissingAttributes)", + "description": "Returns list of attribute names of all related edges that are missing in the integration configuration.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "findAllRelatedEdgesMissingAttributes", "parameters": [ { - "name": "type", - "in": "path", - "description": "Type of the image: tenant or system", - "required": true, - "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] - } - }, - { - "name": "key", + "name": "integrationId", "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "description": "A string value representing the integration id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -69250,7 +68817,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResourceExportData" + "type": "string" } } } @@ -69386,31 +68953,26 @@ ] } }, - "/api/images/{type}/{key}/info": { - "get": { + "/api/edge/{edgeId}/integration/{integrationId}": { + "post": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "getImageInfo", - "operationId": "getImageInfo", + "summary": "Assign integration to edge (assignIntegrationToEdge)", + "description": "Creates assignment of an existing integration edge template to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment integration (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once integration will be delivered to edge service, it's going to start locally. \n\nOnly integration edge template can be assigned to edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "assignIntegrationToEdge", "parameters": [ { - "name": "type", + "name": "edgeId", "in": "path", - "description": "Type of the image: tenant or system", "required": true, "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] + "type": "string" } }, { - "name": "key", + "name": "integrationId", "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", "required": true, "schema": { "type": "string" @@ -69423,7 +68985,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "$ref": "#/components/schemas/Integration" } } } @@ -69439,7 +69001,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -69558,53 +69120,38 @@ } ] }, - "put": { + "delete": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "updateImageInfo", - "operationId": "updateImageInfo", + "summary": "Unassign integration from edge (unassignIntegrationFromEdge)", + "description": "Clears assignment of the integration to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove integration (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove integration locally.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "unassignIntegrationFromEdge", "parameters": [ { - "name": "type", + "name": "edgeId", "in": "path", - "description": "Type of the image: tenant or system", "required": true, "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] + "type": "string" } }, { - "name": "key", + "name": "integrationId", "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TbResourceInfo" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "$ref": "#/components/schemas/Integration" } } } @@ -69740,50 +69287,84 @@ ] } }, - "/api/images/{type}/{key}/preview": { + "/api/edge/{edgeId}/integrationInfos": { "get": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "downloadImagePreview", - "operationId": "downloadImagePreview", + "summary": "Get Edge Integrations (getEdgeIntegrationInfos)", + "description": "Returns a page of Integrations assigned to the specified edge. The integration object contains information about the Integration, including the heavyweight configuration object. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getEdgeIntegrationInfos", "parameters": [ { - "name": "type", + "name": "edgeId", "in": "path", - "description": "Type of the image: tenant or system", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] + "type": "string" } }, { - "name": "key", - "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { - "name": "If-None-Match", - "in": "header", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the integration name.", "required": false, "schema": { "type": "string" } }, { - "name": "Accept-Encoding", - "in": "header", + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "debugMode", + "allowCreateDevicesOrAssets", + "enabled", + "remote", + "routingKey", + "secret" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -69791,10 +69372,9 @@ "200": { "description": "OK", "content": { - "image/png": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/PageDataIntegrationInfo" } } } @@ -69930,42 +69510,84 @@ ] } }, - "/api/images/{type}/{key}/public/{isPublic}": { - "put": { + "/api/edge/{edgeId}/integrations": { + "get": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "updateImagePublicStatus", - "operationId": "updateImagePublicStatus", + "summary": "Get Edge Integrations (getEdgeIntegrations)", + "description": "Returns a page of Integrations assigned to the specified edge. The integration object contains information about the Integration, including the heavyweight configuration object. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getEdgeIntegrations", "parameters": [ { - "name": "type", + "name": "edgeId", "in": "path", - "description": "Type of the image: tenant or system", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] + "type": "string" } }, { - "name": "key", - "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { - "name": "isPublic", - "in": "path", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, "schema": { - "type": "boolean" + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the integration name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "debugMode", + "allowCreateDevicesOrAssets", + "enabled", + "remote", + "routingKey", + "secret" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -69975,7 +69597,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "$ref": "#/components/schemas/PageDataIntegration" } } } @@ -70111,61 +69733,31 @@ ] } }, - "/api/noauth/whiteLabel/loginFavicon/{type}/{key}": { - "get": { + "/api/integration": { + "post": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "downloadLoginFavicon", - "operationId": "downloadLoginFavicon", - "parameters": [ - { - "name": "type", - "in": "path", - "description": "Type of the image: tenant or system", - "required": true, - "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] - } - }, - { - "name": "key", - "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "schema": { - "type": "string" + "summary": "Create Or Update Integration (saveIntegration)", + "description": "Create or update the Integration. When creating integration, platform generates Integration Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created integration id will be present in the response. Specify existing Integration id to update the integration. Referencing non-existing integration Id will cause 'Not Found' error. Integration configuration is validated for each type of the integration before it can be created. \n\n# Integration Configuration\n\nIntegration configuration (**'configuration'** field) is the JSON object representing the special configuration per integration type with the connectivity fields and other important parameters dependent on the specific integration type. Let's review the configuration object for the MQTT Integration type below. \n\n```json\n{\n \"clientConfiguration\":{\n \"host\":\"broker.hivemq.com\",\n \"port\":1883,\n \"cleanSession\":false,\n \"ssl\":false,\n \"connectTimeoutSec\":10,\n \"clientId\":\"\",\n \"maxBytesInMessage\":32368,\n \"credentials\":{\n \"type\":\"anonymous\"\n }\n },\n \"downlinkTopicPattern\":\"${topic}\",\n \"topicFilters\":[\n {\n \"filter\":\"tb/mqtt-integration-tutorial/sensors/+/temperature\",\n \"qos\":0\n }\n ],\n \"metadata\":{\n }\n}\n```\n\nRemove 'id', 'tenantId' from the request body example (below) to create new Integration entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveIntegration", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Integration" + } } }, - { - "name": "Accept-Encoding", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { - "image/*": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/Integration" } } } @@ -70181,7 +69773,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -70290,67 +69882,38 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/noauth/whiteLabel/loginLogo/{type}/{key}": { - "get": { + "/api/integration/check": { + "post": { "tags": [ - "image-controller" + "integration-controller" ], - "summary": "downloadLoginLogo", - "operationId": "downloadLoginLogo", - "parameters": [ - { - "name": "type", - "in": "path", - "description": "Type of the image: tenant or system", - "required": true, - "schema": { - "type": "string", - "enum": [ - "tenant", - "system" - ] - } - }, - { - "name": "key", - "in": "path", - "description": "Image resource key, for example thermostats_dashboard_background.jpeg", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "schema": { - "type": "string" + "summary": "Check integration connectivity (checkIntegrationConnection)", + "description": "Checks if the connection to the integration is established. Throws an error if the connection is not established. Example: Failed to connect to MQTT broker at host:port.", + "operationId": "checkIntegrationConnection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Integration" + } } }, - { - "name": "Accept-Encoding", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { - "description": "OK", - "content": { - "image/*": { - "schema": { - "type": "string", - "format": "binary" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -70363,7 +69926,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -70472,38 +70035,34 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/edge/integration/{edgeId}/missingAttributes": { + "/api/integration/routingKey/{routingKey}": { "get": { "tags": [ "integration-controller" ], - "summary": "Find edge missing attributes for assigned integrations (findEdgeMissingAttributes)", - "description": "Returns list of edge attribute names that are missing in assigned integrations.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "findEdgeMissingAttributes", + "summary": "Get Integration by Routing Key (getIntegrationByRoutingKey)", + "description": "Fetch the Integration object based on the provided routing key. The server checks that the integration is owned by the same tenant. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getIntegrationByRoutingKey", "parameters": [ { - "name": "edgeId", + "name": "routingKey", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the integration routing key. For example, '542047e6-c1b2-112e-a87e-e49247c09d4b'", "required": true, "schema": { "type": "string" } - }, - { - "name": "integrationIds", - "in": "query", - "description": "A list of assigned integration ids, separated by comma ','", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } } ], "responses": { @@ -70512,7 +70071,7 @@ "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Integration" } } } @@ -70648,14 +70207,14 @@ ] } }, - "/api/edge/integration/{integrationId}/allMissingAttributes": { + "/api/integration/{integrationId}": { "get": { "tags": [ "integration-controller" ], - "summary": "Find missing attributes for all related edges (findAllRelatedEdgesMissingAttributes)", - "description": "Returns list of attribute names of all related edges that are missing in the integration configuration.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "findAllRelatedEdgesMissingAttributes", + "summary": "Get Integration (getIntegrationById)", + "description": "Fetch the Integration object based on the provided Integration Id. The server checks that the integration is owned by the same tenant. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getIntegrationById", "parameters": [ { "name": "integrationId", @@ -70673,7 +70232,7 @@ "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Integration" } } } @@ -70807,28 +70366,19 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edge/{edgeId}/integration/{integrationId}": { - "post": { + }, + "delete": { "tags": [ "integration-controller" ], - "summary": "Assign integration to edge (assignIntegrationToEdge)", - "description": "Creates assignment of an existing integration edge template to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment integration (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once integration will be delivered to edge service, it's going to start locally. \n\nOnly integration edge template can be assigned to edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "assignIntegrationToEdge", + "summary": "Delete integration (deleteIntegration)", + "description": "Deletes the integration and all the relations (from and to the integration). Referencing non-existing integration Id will cause an error. \n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "deleteIntegration", "parameters": [ - { - "name": "edgeId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "integrationId", "in": "path", + "description": "A string value representing the integration id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -70837,14 +70387,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Integration" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -70857,7 +70400,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -70975,30 +70518,88 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/integrationInfos": { + "get": { "tags": [ "integration-controller" ], - "summary": "Unassign integration from edge (unassignIntegrationFromEdge)", - "description": "Clears assignment of the integration to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove integration (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove integration locally.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "unassignIntegrationFromEdge", + "summary": "Get Integration Infos (getIntegrationInfos)", + "description": "Returns a page of integration infos owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getIntegrationInfos", "parameters": [ { - "name": "edgeId", - "in": "path", + "name": "isEdgeTemplate", + "in": "query", + "description": "Fetch edge template integrations", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "string", + "minimum": 1 } }, { - "name": "integrationId", - "in": "path", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the integration name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "debugMode", + "allowCreateDevicesOrAssets", + "enabled", + "remote", + "routingKey", + "secret" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -71007,7 +70608,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Integration" + "$ref": "#/components/schemas/PageDataIntegrationInfo" } } } @@ -71143,22 +70744,23 @@ ] } }, - "/api/edge/{edgeId}/integrationInfos": { + "/api/integrations": { "get": { "tags": [ "integration-controller" ], - "summary": "Get Edge Integrations (getEdgeIntegrationInfos)", - "description": "Returns a page of Integrations assigned to the specified edge. The integration object contains information about the Integration, including the heavyweight configuration object. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getEdgeIntegrationInfos", + "summary": "Get Integrations (getIntegrations)", + "description": "Returns a page of integrations owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getIntegrations", "parameters": [ { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "isEdgeTemplate", + "in": "query", + "description": "Fetch edge template integrations", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } }, { @@ -71167,8 +70769,8 @@ "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "minimum": 1 } }, { @@ -71177,8 +70779,8 @@ "description": "Sequence number of page starting from 0", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "minimum": 0 } }, { @@ -71230,7 +70832,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataIntegrationInfo" + "$ref": "#/components/schemas/PageDataIntegration" } } } @@ -71366,84 +70968,178 @@ ] } }, - "/api/edge/{edgeId}/integrations": { + "/api/integrations/converters/info": { "get": { "tags": [ "integration-controller" ], - "summary": "Get Edge Integrations (getEdgeIntegrations)", - "description": "Returns a page of Integrations assigned to the specified edge. The integration object contains information about the Integration, including the heavyweight configuration object. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getEdgeIntegrations", - "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Get Integrations Converters info (getIntegrationsConvertersInfo)", + "description": "Returns a JSON object containing information about existing tenant converters and converters available in library. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getIntegrationsConvertersInfo", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/IntegrationConvertersInfo" + } + } + } } }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the integration name.", - "required": false, - "schema": { - "type": "string" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "debugMode", - "allowCreateDevicesOrAssets", - "enabled", - "remote", - "routingKey", - "secret" - ] + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ { - "name": "sortOrder", + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + } + }, + "/api/integrations/list": { + "get": { + "tags": [ + "integration-controller" + ], + "summary": "Get Integrations By Ids (getIntegrationsByIds)", + "description": "Requested integrations must be owned by tenant which is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getIntegrationsByIds", + "parameters": [ + { + "name": "integrationIds", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, + "description": "A list of integration ids, separated by comma ','", + "required": true, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "array", + "items": { + "type": "string" + } } } ], @@ -71453,7 +71149,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataIntegration" + "type": "array", + "items": { + "$ref": "#/components/schemas/Integration" + } } } } @@ -71589,31 +71288,32 @@ ] } }, - "/api/integration": { - "post": { + "/api/job/{id}": { + "get": { "tags": [ - "integration-controller" + "job-controller" ], - "summary": "Create Or Update Integration (saveIntegration)", - "description": "Create or update the Integration. When creating integration, platform generates Integration Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created integration id will be present in the response. Specify existing Integration id to update the integration. Referencing non-existing integration Id will cause 'Not Found' error. Integration configuration is validated for each type of the integration before it can be created. \n\n# Integration Configuration\n\nIntegration configuration (**'configuration'** field) is the JSON object representing the special configuration per integration type with the connectivity fields and other important parameters dependent on the specific integration type. Let's review the configuration object for the MQTT Integration type below. \n\n```json\n{\n \"clientConfiguration\":{\n \"host\":\"broker.hivemq.com\",\n \"port\":1883,\n \"cleanSession\":false,\n \"ssl\":false,\n \"connectTimeoutSec\":10,\n \"clientId\":\"\",\n \"maxBytesInMessage\":32368,\n \"credentials\":{\n \"type\":\"anonymous\"\n }\n },\n \"downlinkTopicPattern\":\"${topic}\",\n \"topicFilters\":[\n {\n \"filter\":\"tb/mqtt-integration-tutorial/sensors/+/temperature\",\n \"qos\":0\n }\n ],\n \"metadata\":{\n }\n}\n```\n\nRemove 'id', 'tenantId' from the request body example (below) to create new Integration entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveIntegration", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Integration" - } + "summary": "Get job by id (getJobById)", + "description": "Fetches job info by id.\n\nExample of a RUNNING CF_REPROCESSING job response:\n```json\n{\n \"id\": {\n \"entityType\": \"JOB\",\n \"id\": \"475e94e0-2f2d-11f0-8240-91e99922a704\"\n },\n \"createdTime\": 1747053196590,\n \"tenantId\": {\n \"entityType\": \"TENANT\",\n \"id\": \"46859a00-2f2d-11f0-8240-91e99922a704\"\n },\n \"type\": \"CF_REPROCESSING\",\n \"key\": \"474e4130-2f2d-11f0-8240-91e99922a704\",\n \"entityId\": {\n \"entityType\": \"DEVICE_PROFILE\",\n \"id\": \"9fd41f20-31a1-11f0-933e-27998d6db02e\"\n },\n \"status\": \"RUNNING\",\n \"configuration\": {\n \"type\": \"CF_REPROCESSING\",\n \"calculatedFieldId\": {\n \"entityType\": \"CALCULATED_FIELD\",\n \"id\": \"474e4130-2f2d-11f0-8240-91e99922a704\"\n },\n \"startTs\": 1747051995760,\n \"endTs\": 1747052895760,\n \"tasksKey\": \"c3cdbd42-799e-4d3a-9aad-9310f767aa36\",\n \"toReprocess\": null\n },\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 1,\n \"failedCount\": 0,\n \"discardedCount\": 0,\n \"totalCount\": 2,\n \"results\": [],\n \"generalError\": null,\n \"startTs\": 1747323069445,\n \"finishTs\": 1747323070585,\n \"cancellationTs\": 0\n }\n}\n\n```\n\nExample of a CF_REPROCESSING job with failures:\n```json\n{\n ...,\n \"status\": \"FAILED\",\n ...,\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 0,\n \"failedCount\": 2,\n \"discardedCount\": 0,\n \"totalCount\": 2,\n \"results\": [\n {\n \"jobType\": \"CF_REPROCESSING\",\n \"key\": \"c3cdbd42-799e-4d3a-9aad-9310f767aa36\",\n \"success\": false,\n \"discarded\": false,\n \"failure\": {\n \"error\": \"Failed to fetch temperature: Failed to fetch timeseries data\",\n \"entityInfo\": {\n \"id\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"9fd41f20-31a1-11f0-933e-27998d6db02e\"\n },\n \"name\": \"Test device 1\"\n }\n }\n },\n {\n \"jobType\": \"CF_REPROCESSING\",\n \"key\": \"c3cdbd42-799e-4d3a-9aad-9310f767aa36\",\n \"success\": false,\n \"discarded\": false,\n \"failure\": {\n \"error\": \"Failed to fetch temperature: Failed to fetch timeseries data\",\n \"entityInfo\": {\n \"id\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"9ffc4090-31a1-11f0-933e-27998d6db02e\"\n },\n \"name\": \"Test device 2\"\n }\n }\n }\n ],\n \"generalError\": null,\n \"startTs\": 1747323069445,\n \"finishTs\": 1747323070585,\n \"cancellationTs\": 0\n }\n}\n\n```\n\nExample of a FAILED job result with general error:\n```json\n{\n ...,\n \"status\": \"FAILED\",\n ...,\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 1,\n \"failedCount\": 0,\n \"discardedCount\": 0,\n \"totalCount\": null,\n \"results\": [],\n \"generalError\": \"Timeout to find devices by profile\",\n \"cancellationTs\": 0\n }\n}\n\n```\n\nExample of a CANCELLED job result:\n```json\n{\n ...,\n \"status\": \"CANCELLED\",\n ...,\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 15,\n \"failedCount\": 0,\n \"discardedCount\": 85,\n \"totalCount\": 100,\n \"results\": [],\n \"generalError\": null,\n \"cancellationTs\": 1747065908414\n }\n}\n\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getJobById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Integration" + "$ref": "#/components/schemas/Job" } } } @@ -71629,7 +71329,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -71747,190 +71447,27 @@ "ApiKeyForm": [] } ] - } - }, - "/api/integration/check": { - "post": { - "tags": [ - "integration-controller" - ], - "summary": "Check integration connectivity (checkIntegrationConnection)", - "description": "Checks if the connection to the integration is established. Throws an error if the connection is not established. Example: Failed to connect to MQTT broker at host:port.", - "operationId": "checkIntegrationConnection", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Integration" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid request body", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - } - }, - "/api/integration/routingKey/{routingKey}": { - "get": { + }, + "delete": { "tags": [ - "integration-controller" + "job-controller" ], - "summary": "Get Integration by Routing Key (getIntegrationByRoutingKey)", - "description": "Fetch the Integration object based on the provided routing key. The server checks that the integration is owned by the same tenant. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getIntegrationByRoutingKey", + "summary": "deleteJob", + "operationId": "deleteJob", "parameters": [ { - "name": "routingKey", + "name": "id", "in": "path", - "description": "A string value representing the integration routing key. For example, '542047e6-c1b2-112e-a87e-e49247c09d4b'", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Integration" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -72063,35 +71600,28 @@ ] } }, - "/api/integration/{integrationId}": { - "get": { + "/api/job/{id}/cancel": { + "post": { "tags": [ - "integration-controller" + "job-controller" ], - "summary": "Get Integration (getIntegrationById)", - "description": "Fetch the Integration object based on the provided Integration Id. The server checks that the integration is owned by the same tenant. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getIntegrationById", + "summary": "Cancel job (cancelJob)", + "description": "Cancels the job. The status of the job must be QUEUED, PENDING or RUNNING.\n\nFor a running job, all the tasks not yet processed will be discarded.\n\nSee the example of a cancelled job result in getJobById method description.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "cancelJob", "parameters": [ { - "name": "integrationId", + "name": "id", "in": "path", - "description": "A string value representing the integration id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Integration" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -72104,7 +71634,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -72222,22 +71752,24 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/job/{id}/reprocess": { + "post": { "tags": [ - "integration-controller" + "job-controller" ], - "summary": "Delete integration (deleteIntegration)", - "description": "Deletes the integration and all the relations (from and to the integration). Referencing non-existing integration Id will cause an error. \n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "deleteIntegration", + "summary": "Reprocess job (reprocessJob)", + "description": "Reprocesses the job. Failures are located at job.result.results list. Platform iterates over this list and submits new tasks for them. Doesn't create new job entity but updates the existing one. Successfully reprocessed job will look the same as completed one.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "reprocessJob", "parameters": [ { - "name": "integrationId", + "name": "id", "in": "path", - "description": "A string value representing the integration id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], @@ -72256,7 +71788,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -72376,33 +71908,23 @@ ] } }, - "/api/integrationInfos": { + "/api/jobs": { "get": { "tags": [ - "integration-controller" + "job-controller" ], - "summary": "Get Integration Infos (getIntegrationInfos)", - "description": "Returns a page of integration infos owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getIntegrationInfos", + "summary": "Get jobs (getJobs)", + "description": "Returns the page of jobs.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getJobs", "parameters": [ - { - "name": "isEdgeTemplate", - "in": "query", - "description": "Fetch edge template integrations", - "required": false, - "schema": { - "type": "boolean", - "default": false - } - }, { "name": "pageSize", "in": "query", "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string", - "minimum": 1 + "type": "integer", + "format": "int32" } }, { @@ -72411,14 +71933,14 @@ "description": "Sequence number of page starting from 0", "required": true, "schema": { - "type": "string", - "minimum": 0 + "type": "integer", + "format": "int32" } }, { "name": "textSearch", "in": "query", - "description": "The case insensitive 'startsWith' filter based on the integration name.", + "description": "Case-insensitive 'substring' filter based on job's description", "required": false, "schema": { "type": "string" @@ -72430,18 +71952,7 @@ "description": "Property of entity to sort by", "required": false, "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "debugMode", - "allowCreateDevicesOrAssets", - "enabled", - "remote", - "routingKey", - "secret" - ] + "type": "string" } }, { @@ -72450,11 +71961,63 @@ "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "string" + } + }, + { + "name": "types", + "in": "query", + "description": "Comma-separated list of job types to include. If empty - all job types are included.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "statuses", + "in": "query", + "description": "Comma-separated list of job statuses to include. If empty - all job statuses are included.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "entities", + "in": "query", + "description": "Comma-separated list of entity ids. If empty - jobs for all entities are included.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "startTime", + "in": "query", + "description": "To only include jobs created after this timestamp.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "To only include jobs created before this timestamp.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } } ], @@ -72464,7 +72027,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataIntegrationInfo" + "$ref": "#/components/schemas/PageDataJob" } } } @@ -72600,113 +72163,228 @@ ] } }, - "/api/integrations": { - "get": { + "/api/auth/login": { + "post": { "tags": [ - "integration-controller" + "login-endpoint" ], - "summary": "Get Integrations (getIntegrations)", - "description": "Returns a page of integrations owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getIntegrations", - "parameters": [ - { - "name": "isEdgeTemplate", - "in": "query", - "description": "Fetch edge template integrations", - "required": false, - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 + "summary": "Login method to get user JWT token data", + "description": "Login method used to authenticate user and get JWT token data.\n\nValue of the response **token** field can be used as **X-Authorization** header value:\n\n`X-Authorization: Bearer $JWT_TOKEN_VALUE`.", + "operationId": "login", + "requestBody": { + "description": "Login request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginRequest" + } } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the integration name.", - "required": false, - "schema": { - "type": "string" + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } } }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "debugMode", - "allowCreateDevicesOrAssets", - "enabled", - "remote", - "routingKey", - "secret" - ] + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "bad-credentials": { + "summary": "Bad credentials", + "value": { + "message": "Invalid username or password", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "account-locked": { + "summary": "Locked account", + "value": { + "message": "User account is locked due to security policy", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "token-expired": { + "summary": "JWT token expired", + "value": { + "message": "Token has expired", + "errorCode": 11, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "authentication-failed": { + "summary": "General authentication error", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "account-disabled": { + "summary": "Disabled account", + "value": { + "message": "User account is not active", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "401 ": { + "description": "Unauthorized (**Expired credentials**)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardCredentialsExpiredResponse" + }, + "examples": { + "credentials-expired": { + "summary": "Expired credentials", + "value": { + "status": 401, + "message": "User password expired!", + "errorCode": 15, + "timestamp": 1609459200000, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "resetToken": "0F8fGvwuEd9OYZJF4ZfVbfSVdUX1Qe" + } + } + } + } } } + } + } + }, + "/api/auth/token": { + "post": { + "tags": [ + "login-endpoint" ], + "summary": "Refresh user JWT token data", + "description": "Method to refresh JWT token. Provide a valid refresh token to get a new JWT token.\n\nThe response contains a new token that can be used for authorization.\n\n`X-Authorization: Bearer $JWT_TOKEN_VALUE`", + "operationId": "refreshToken", + "requestBody": { + "description": "Refresh token request", + "content": { + "application/json": { + "schema": { + "properties": { + "refreshToken": {} + } + } + } + } + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataIntegration" + "$ref": "#/components/schemas/LoginResponse" } } } }, - "400": { - "description": "Bad Request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThingsboardErrorResponse" }, "examples": { - "error-code-400": { - "summary": "Bad Request", + "bad-credentials": { + "summary": "Bad credentials", "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, + "message": "Invalid username or password", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "account-locked": { + "summary": "Locked account", + "value": { + "message": "User account is locked due to security policy", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "token-expired": { + "summary": "JWT token expired", + "value": { + "message": "Token has expired", + "errorCode": 11, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "authentication-failed": { + "summary": "General authentication error", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + }, + "account-disabled": { + "summary": "Disabled account", + "value": { + "message": "User account is not active", + "errorCode": 10, + "status": 401, "subscriptionErrorCode": null, "subscriptionEntry": null, "subscriptionValue": null, @@ -72717,20 +72395,45 @@ } } }, - "401": { - "description": "Unauthorized", + "401 ": { + "description": "Unauthorized (**Expired credentials**)", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" + "$ref": "#/components/schemas/ThingsboardCredentialsExpiredResponse" }, "examples": { - "error-code-401": { - "summary": "Unauthorized", + "credentials-expired": { + "summary": "Expired credentials", "value": { - "message": "Authentication failed", - "errorCode": 10, "status": 401, + "message": "User password expired!", + "errorCode": 15, + "timestamp": 1609459200000, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "resetToken": "0F8fGvwuEd9OYZJF4ZfVbfSVdUX1Qe" + } + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, "subscriptionErrorCode": null, "subscriptionEntry": null, "subscriptionValue": null, @@ -72813,35 +72516,45 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/integrations/converters/info": { - "get": { + "/api/lwm2m/device-credentials": { + "post": { "tags": [ - "integration-controller" + "lwm-2m-controller" ], - "summary": "Get Integrations Converters info (getIntegrationsConvertersInfo)", - "description": "Returns a JSON object containing information about existing tenant converters and converters available in library. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getIntegrationsConvertersInfo", + "summary": "Save LwM2M device with credentials (saveLwm2mDeviceWithCredentials)", + "description": "Deprecated.", + "operationId": "saveLwm2mDeviceWithCredentials", + "parameters": [ + { + "name": "entityGroupId", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": {} + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/IntegrationConvertersInfo" - } + "$ref": "#/components/schemas/Device" } } } @@ -72857,7 +72570,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -72977,25 +72690,22 @@ ] } }, - "/api/integrations/list": { + "/api/lwm2m/deviceProfile/bootstrap/{isBootstrapServer}": { "get": { "tags": [ - "integration-controller" + "lwm-2m-controller" ], - "summary": "Get Integrations By Ids (getIntegrationsByIds)", - "description": "Requested integrations must be owned by tenant which is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getIntegrationsByIds", + "summary": "Get Lwm2m Bootstrap SecurityInfo (getLwm2mBootstrapSecurityInfo)", + "description": "Get the Lwm2m Bootstrap SecurityInfo object (of the current server) based on the provided isBootstrapServer parameter. If isBootstrapServer == true, get the parameters of the current Bootstrap Server. If isBootstrapServer == false, get the parameters of the current Lwm2m Server. Used for client settings when starting the client in Bootstrap mode. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getLwm2mBootstrapSecurityInfo", "parameters": [ { - "name": "integrationIds", - "in": "query", - "description": "A list of integration ids, separated by comma ','", + "name": "isBootstrapServer", + "in": "path", + "description": "A Boolean value representing the Server SecurityInfo for future Bootstrap client mode settings. Values: 'true' for Bootstrap Server; 'false' for Lwm2m Server. ", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "boolean" } } ], @@ -73005,10 +72715,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Integration" - } + "$ref": "#/components/schemas/LwM2MServerSecurityConfigDefault" } } } @@ -73144,32 +72851,21 @@ ] } }, - "/api/job/{id}": { + "/api/mail/config/template": { "get": { "tags": [ - "job-controller" - ], - "summary": "Get job by id (getJobById)", - "description": "Fetches job info by id.\n\nExample of a RUNNING CF_REPROCESSING job response:\n```json\n{\n \"id\": {\n \"entityType\": \"JOB\",\n \"id\": \"475e94e0-2f2d-11f0-8240-91e99922a704\"\n },\n \"createdTime\": 1747053196590,\n \"tenantId\": {\n \"entityType\": \"TENANT\",\n \"id\": \"46859a00-2f2d-11f0-8240-91e99922a704\"\n },\n \"type\": \"CF_REPROCESSING\",\n \"key\": \"474e4130-2f2d-11f0-8240-91e99922a704\",\n \"entityId\": {\n \"entityType\": \"DEVICE_PROFILE\",\n \"id\": \"9fd41f20-31a1-11f0-933e-27998d6db02e\"\n },\n \"status\": \"RUNNING\",\n \"configuration\": {\n \"type\": \"CF_REPROCESSING\",\n \"calculatedFieldId\": {\n \"entityType\": \"CALCULATED_FIELD\",\n \"id\": \"474e4130-2f2d-11f0-8240-91e99922a704\"\n },\n \"startTs\": 1747051995760,\n \"endTs\": 1747052895760,\n \"tasksKey\": \"c3cdbd42-799e-4d3a-9aad-9310f767aa36\",\n \"toReprocess\": null\n },\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 1,\n \"failedCount\": 0,\n \"discardedCount\": 0,\n \"totalCount\": 2,\n \"results\": [],\n \"generalError\": null,\n \"startTs\": 1747323069445,\n \"finishTs\": 1747323070585,\n \"cancellationTs\": 0\n }\n}\n\n```\n\nExample of a CF_REPROCESSING job with failures:\n```json\n{\n ...,\n \"status\": \"FAILED\",\n ...,\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 0,\n \"failedCount\": 2,\n \"discardedCount\": 0,\n \"totalCount\": 2,\n \"results\": [\n {\n \"jobType\": \"CF_REPROCESSING\",\n \"key\": \"c3cdbd42-799e-4d3a-9aad-9310f767aa36\",\n \"success\": false,\n \"discarded\": false,\n \"failure\": {\n \"error\": \"Failed to fetch temperature: Failed to fetch timeseries data\",\n \"entityInfo\": {\n \"id\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"9fd41f20-31a1-11f0-933e-27998d6db02e\"\n },\n \"name\": \"Test device 1\"\n }\n }\n },\n {\n \"jobType\": \"CF_REPROCESSING\",\n \"key\": \"c3cdbd42-799e-4d3a-9aad-9310f767aa36\",\n \"success\": false,\n \"discarded\": false,\n \"failure\": {\n \"error\": \"Failed to fetch temperature: Failed to fetch timeseries data\",\n \"entityInfo\": {\n \"id\": {\n \"entityType\": \"DEVICE\",\n \"id\": \"9ffc4090-31a1-11f0-933e-27998d6db02e\"\n },\n \"name\": \"Test device 2\"\n }\n }\n }\n ],\n \"generalError\": null,\n \"startTs\": 1747323069445,\n \"finishTs\": 1747323070585,\n \"cancellationTs\": 0\n }\n}\n\n```\n\nExample of a FAILED job result with general error:\n```json\n{\n ...,\n \"status\": \"FAILED\",\n ...,\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 1,\n \"failedCount\": 0,\n \"discardedCount\": 0,\n \"totalCount\": null,\n \"results\": [],\n \"generalError\": \"Timeout to find devices by profile\",\n \"cancellationTs\": 0\n }\n}\n\n```\n\nExample of a CANCELLED job result:\n```json\n{\n ...,\n \"status\": \"CANCELLED\",\n ...,\n \"result\": {\n \"jobType\": \"CF_REPROCESSING\",\n \"successfulCount\": 15,\n \"failedCount\": 0,\n \"discardedCount\": 85,\n \"totalCount\": 100,\n \"results\": [],\n \"generalError\": null,\n \"cancellationTs\": 1747065908414\n }\n}\n\n```\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getJobById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } + "mail-config-template-controller" ], + "summary": "Get the list of all OAuth2 client registration templates (getClientRegistrationTemplates)\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "description": "Mail configuration template is set of default smtp settings for mail server that specific provider supports", + "operationId": "getClientRegistrationTemplates", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Job" + "$ref": "#/components/schemas/JsonNode" } } } @@ -73303,27 +72999,50 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/mobile/bundle": { + "post": { "tags": [ - "job-controller" + "mobile-app-bundle-controller" ], - "summary": "deleteJob", - "operationId": "deleteJob", + "summary": "Save Or update Mobile app bundle (saveMobileAppBundle)", + "description": "Create or update the Mobile app bundle that represents tha pair of ANDROID and IOS app and mobile settings like oauth2 clients, self-registration and layout configuration.When creating mobile app bundle, platform generates Mobile App Bundle Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Mobile App Bundle Id will be present in the response. Referencing non-existing Mobile App Bundle Id will cause 'Not Found' error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveMobileAppBundle", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "oauth2ClientIds", + "in": "query", + "description": "A list of oauth2 client ids, separated by comma ','", + "required": false, "schema": { - "type": "string", - "format": "uuid" + "type": "array", + "items": { + "type": "string" + } } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MobileAppBundle" + } + } + }, + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MobileAppBundle" + } + } + } }, "400": { "description": "Bad Request", @@ -73336,7 +73055,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -73456,14 +73175,14 @@ ] } }, - "/api/job/{id}/cancel": { - "post": { + "/api/mobile/bundle/info/{id}": { + "get": { "tags": [ - "job-controller" + "mobile-app-bundle-controller" ], - "summary": "Cancel job (cancelJob)", - "description": "Cancels the job. The status of the job must be QUEUED, PENDING or RUNNING.\n\nFor a running job, all the tasks not yet processed will be discarded.\n\nSee the example of a cancelled job result in getJobById method description.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "cancelJob", + "summary": "Get mobile app bundle info by id (getMobileAppBundleInfoById)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getMobileAppBundleInfoById", "parameters": [ { "name": "id", @@ -73477,7 +73196,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MobileAppBundleInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -73490,7 +73216,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -73610,28 +73336,73 @@ ] } }, - "/api/job/{id}/reprocess": { - "post": { + "/api/mobile/bundle/infos": { + "get": { "tags": [ - "job-controller" + "mobile-app-bundle-controller" ], - "summary": "Reprocess job (reprocessJob)", - "description": "Reprocesses the job. Failures are located at job.result.results list. Platform iterates over this list and submits new tasks for them. Doesn't create new job entity but updates the existing one. Successfully reprocessed job will look the same as completed one.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "reprocessJob", + "summary": "Get mobile app bundle infos (getTenantMobileAppBundleInfos)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getTenantMobileAppBundleInfos", "parameters": [ { - "name": "id", - "in": "path", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on app's name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataMobileAppBundleInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -73644,7 +73415,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -73764,129 +73535,28 @@ ] } }, - "/api/jobs": { - "get": { + "/api/mobile/bundle/{id}": { + "delete": { "tags": [ - "job-controller" + "mobile-app-bundle-controller" ], - "summary": "Get jobs (getJobs)", - "description": "Returns the page of jobs.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getJobs", + "summary": "Delete Mobile App Bundle by ID (deleteMobileAppBundle)", + "description": "Deletes Mobile App Bundle by ID. Referencing non-existing mobile app bundle Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "deleteMobileAppBundle", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "id", + "in": "path", "required": true, "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on job's description", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "types", - "in": "query", - "description": "Comma-separated list of job types to include. If empty - all job types are included.", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "statuses", - "in": "query", - "description": "Comma-separated list of job statuses to include. If empty - all job statuses are included.", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "entities", - "in": "query", - "description": "Comma-separated list of entity ids. If empty - jobs for all entities are included.", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "startTime", - "in": "query", - "description": "To only include jobs created after this timestamp.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTime", - "in": "query", - "description": "To only include jobs created before this timestamp.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "format": "uuid" } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataJob" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -74019,97 +73689,57 @@ ] } }, - "/api/auth/login": { - "post": { + "/api/mobile/bundle/{id}/oauth2Clients": { + "put": { "tags": [ - "login-endpoint" + "mobile-app-bundle-controller" + ], + "summary": "Update oauth2 clients (updateMobileAppBundleOauth2Clients)", + "description": "Update oauth2 clients of the specified mobile app bundle.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "updateMobileAppBundleOauth2Clients", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } ], - "summary": "Login method to get user JWT token data", - "description": "Login method used to authenticate user and get JWT token data.\n\nValue of the response **token** field can be used as **X-Authorization** header value:\n\n`X-Authorization: Bearer $JWT_TOKEN_VALUE`.", - "operationId": "login", "requestBody": { - "description": "Login request", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoginRequest" + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } } } - } + }, + "required": true }, "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginResponse" - } - } - } + "description": "OK" }, - "401": { - "description": "Unauthorized", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ThingsboardErrorResponse" }, "examples": { - "authentication-failed": { - "summary": "General authentication error", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - }, - "account-disabled": { - "summary": "Disabled account", - "value": { - "message": "User account is not active", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - }, - "bad-credentials": { - "summary": "Bad credentials", - "value": { - "message": "Invalid username or password", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - }, - "account-locked": { - "summary": "Locked account", - "value": { - "message": "User account is locked due to security policy", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - }, - "token-expired": { - "summary": "JWT token expired", + "error-code-400": { + "summary": "Bad Request", "value": { - "message": "Token has expired", - "errorCode": 11, - "status": 401, + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, "subscriptionErrorCode": null, "subscriptionEntry": null, "subscriptionValue": null, @@ -74120,67 +73750,6 @@ } } }, - "401 ": { - "description": "Unauthorized (**Expired credentials**)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardCredentialsExpiredResponse" - }, - "examples": { - "credentials-expired": { - "summary": "Expired credentials", - "value": { - "status": 401, - "message": "User password expired!", - "errorCode": 15, - "timestamp": 1609459200000, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "resetToken": "HlBn0QKypFyPS4QTMdEFZ6RuU9vxIh" - } - } - } - } - } - } - } - } - }, - "/api/auth/token": { - "post": { - "tags": [ - "login-endpoint" - ], - "summary": "Refresh user JWT token data", - "description": "Method to refresh JWT token. Provide a valid refresh token to get a new JWT token.\n\nThe response contains a new token that can be used for authorization.\n\n`X-Authorization: Bearer $JWT_TOKEN_VALUE`", - "operationId": "refreshToken", - "requestBody": { - "description": "Refresh token request", - "content": { - "application/json": { - "schema": { - "properties": { - "refreshToken": { - - } - } - } - } - } - }, - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginResponse" - } - } - } - }, "401": { "description": "Unauthorized", "content": { @@ -74189,8 +73758,8 @@ "$ref": "#/components/schemas/ThingsboardErrorResponse" }, "examples": { - "authentication-failed": { - "summary": "General authentication error", + "error-code-401": { + "summary": "Unauthorized", "value": { "message": "Authentication failed", "errorCode": 10, @@ -74200,103 +73769,6 @@ "subscriptionValue": null, "timestamp": 1609459200000 } - }, - "account-disabled": { - "summary": "Disabled account", - "value": { - "message": "User account is not active", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - }, - "bad-credentials": { - "summary": "Bad credentials", - "value": { - "message": "Invalid username or password", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - }, - "account-locked": { - "summary": "Locked account", - "value": { - "message": "User account is locked due to security policy", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - }, - "token-expired": { - "summary": "JWT token expired", - "value": { - "message": "Token has expired", - "errorCode": 11, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401 ": { - "description": "Unauthorized (**Expired credentials**)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardCredentialsExpiredResponse" - }, - "examples": { - "credentials-expired": { - "summary": "Expired credentials", - "value": { - "status": 401, - "message": "User password expired!", - "errorCode": 15, - "timestamp": 1609459200000, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "resetToken": "HlBn0QKypFyPS4QTMdEFZ6RuU9vxIh" - } - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid request body", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } } } } @@ -74374,47 +73846,56 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/lwm2m/device-credentials": { - "post": { + "/api/mobile": { + "get": { "tags": [ - "lwm-2m-controller" + "mobile-app-controller" ], - "summary": "Save LwM2M device with credentials (saveLwm2mDeviceWithCredentials)", - "description": "Deprecated.", - "operationId": "saveLwm2mDeviceWithCredentials", + "summary": "Get user mobile app basic info (getUserMobileInfo)", + "description": "\n\nAvailable for any authorized user. ", + "operationId": "getUserMobileInfo", "parameters": [ { - "name": "entityGroupId", + "name": "pkgName", "in": "query", - "required": false, + "description": "Mobile application package name", + "required": true, "schema": { "type": "string" } + }, + { + "name": "platform", + "in": "query", + "description": "Platform type", + "required": true, + "schema": { + "type": "string", + "enum": [ + "ANDROID", + "IOS" + ] + } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - - } - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Device" + "$ref": "#/components/schemas/UserMobileInfo" } } } @@ -74430,7 +73911,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -74550,22 +74031,69 @@ ] } }, - "/api/lwm2m/deviceProfile/bootstrap/{isBootstrapServer}": { + "/api/mobile/app": { "get": { "tags": [ - "lwm-2m-controller" + "mobile-app-controller" ], - "summary": "Get Lwm2m Bootstrap SecurityInfo (getLwm2mBootstrapSecurityInfo)", - "description": "Get the Lwm2m Bootstrap SecurityInfo object (of the current server) based on the provided isBootstrapServer parameter. If isBootstrapServer == true, get the parameters of the current Bootstrap Server. If isBootstrapServer == false, get the parameters of the current Lwm2m Server. Used for client settings when starting the client in Bootstrap mode. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getLwm2mBootstrapSecurityInfo", + "summary": "Get mobile app infos (getTenantMobileApps)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getTenantMobileApps", "parameters": [ { - "name": "isBootstrapServer", - "in": "path", - "description": "A Boolean value representing the Server SecurityInfo for future Bootstrap client mode settings. Values: 'true' for Bootstrap Server; 'false' for Lwm2m Server. ", + "name": "platformType", + "in": "query", + "description": "Platform type: ANDROID or IOS", + "required": false, + "schema": { + "$ref": "#/components/schemas/PlatformType" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "boolean" + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on app's name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" } } ], @@ -74575,7 +74103,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LwM2MServerSecurityConfigDefault" + "$ref": "#/components/schemas/PageDataMobileApp" } } } @@ -74709,23 +74237,31 @@ "ApiKeyForm": [] } ] - } - }, - "/api/mail/config/template": { - "get": { + }, + "post": { "tags": [ - "mail-config-template-controller" + "mobile-app-controller" ], - "summary": "Get the list of all OAuth2 client registration templates (getClientRegistrationTemplates)\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "description": "Mail configuration template is set of default smtp settings for mail server that specific provider supports", - "operationId": "getClientRegistrationTemplates", + "summary": "Save Or update Mobile app (saveMobileApp)", + "description": "Create or update the Mobile app. When creating mobile app, platform generates Mobile App Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Mobile App Id will be present in the response. Specify existing Mobile App Id to update the mobile app. Referencing non-existing Mobile App Id will cause 'Not Found' error.\n\nThe pair of mobile app package name and platform type is unique for entire platform setup.\n\n\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveMobileApp", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MobileApp" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JsonNode" + "$ref": "#/components/schemas/MobileApp" } } } @@ -74741,7 +74277,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -74861,45 +74397,32 @@ ] } }, - "/api/mobile/bundle": { - "post": { + "/api/mobile/app/{id}": { + "get": { "tags": [ - "mobile-app-bundle-controller" + "mobile-app-controller" ], - "summary": "Save Or update Mobile app bundle (saveMobileAppBundle)", - "description": "Create or update the Mobile app bundle that represents tha pair of ANDROID and IOS app and mobile settings like oauth2 clients, self-registration and layout configuration.When creating mobile app bundle, platform generates Mobile App Bundle Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Mobile App Bundle Id will be present in the response. Referencing non-existing Mobile App Bundle Id will cause 'Not Found' error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveMobileAppBundle", + "summary": "Get mobile info by id (getMobileAppById)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getMobileAppById", "parameters": [ { - "name": "oauth2ClientIds", - "in": "query", - "description": "A list of oauth2 client ids, separated by comma ','", - "required": false, + "name": "id", + "in": "path", + "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string", + "format": "uuid" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MobileAppBundle" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MobileAppBundle" + "$ref": "#/components/schemas/MobileApp" } } } @@ -74915,7 +74438,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -75033,16 +74556,14 @@ "ApiKeyForm": [] } ] - } - }, - "/api/mobile/bundle/info/{id}": { - "get": { + }, + "delete": { "tags": [ - "mobile-app-bundle-controller" + "mobile-app-controller" ], - "summary": "Get mobile app bundle info by id (getMobileAppBundleInfoById)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getMobileAppBundleInfoById", + "summary": "Delete Mobile App by ID (deleteMobileApp)", + "description": "Deletes Mobile App by ID. Referencing non-existing mobile app Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "deleteMobileApp", "parameters": [ { "name": "id", @@ -75056,14 +74577,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MobileAppBundleInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -75196,70 +74710,189 @@ ] } }, - "/api/mobile/bundle/infos": { + "/api/noauth/mobile": { "get": { "tags": [ - "mobile-app-bundle-controller" + "mobile-app-controller" ], - "summary": "Get mobile app bundle infos (getTenantMobileAppBundleInfos)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getTenantMobileAppBundleInfos", + "summary": "Get mobile app login info (getLoginMobileInfo)", + "operationId": "getLoginMobileInfo", "parameters": [ { - "name": "pageSize", + "name": "pkgName", "in": "query", - "description": "Maximum amount of entities in a one page", + "description": "Mobile application package name", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } }, { - "name": "page", + "name": "platform", "in": "query", - "description": "Sequence number of page starting from 0", + "description": "Platform type", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "enum": [ + "ANDROID", + "IOS" + ] + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginMobileInfo" + } + } } }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on app's name", - "required": false, - "schema": { - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } } + } + } + }, + "/api/notification/deliveryMethods": { + "get": { + "tags": [ + "notification-controller" ], + "summary": "Get available delivery methods (getAvailableDeliveryMethods)", + "description": "Returns the list of delivery methods that are properly configured and are allowed to be used for sending notifications.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getAvailableDeliveryMethods", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataMobileAppBundleInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDeliveryMethod" + } } } } @@ -75395,22 +75028,34 @@ ] } }, - "/api/mobile/bundle/{id}": { - "delete": { + "/api/notification/entitiesLimitIncreaseRequest/{entityType}": { + "post": { "tags": [ - "mobile-app-bundle-controller" + "notification-controller" ], - "summary": "Delete Mobile App Bundle by ID (deleteMobileAppBundle)", - "description": "Deletes Mobile App Bundle by ID. Referencing non-existing mobile app bundle Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "deleteMobileAppBundle", + "summary": "Send entity limit increase request notification to System/Tenant administrators (sendEntitiesLimitIncreaseRequest)", + "description": "Send entity limit increase request notification by Tenant Administrator or Customer User to System/Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "sendEntitiesLimitIncreaseRequest", "parameters": [ { - "name": "id", + "name": "entityType", "in": "path", + "description": "Entity type", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "DEVICE", + "ASSET", + "CUSTOMER", + "USER", + "DASHBOARD", + "RULE_CHAIN", + "EDGE", + "INTEGRATION", + "CONVERTER", + "SCHEDULER_EVENT" + ] } } ], @@ -75429,7 +75074,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -75549,34 +75194,19 @@ ] } }, - "/api/mobile/bundle/{id}/oauth2Clients": { - "put": { + "/api/notification/request": { + "post": { "tags": [ - "mobile-app-bundle-controller" - ], - "summary": "Update oauth2 clients (updateMobileAppBundleOauth2Clients)", - "description": "Update oauth2 clients of the specified mobile app bundle.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "updateMobileAppBundleOauth2Clients", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } + "notification-controller" ], + "summary": "Create notification request (createNotificationRequest)", + "description": "Processes notification request.\nMandatory request properties are `targets` (list of targets ids to send notification to), and either `templateId` (existing notification template id) or `template` (to send notification without saving the template).\nOptionally, you can set `sendingDelayInSec` inside the `additionalConfig` field to schedule the notification.\n\nFor each enabled delivery method in the notification template, there must be a target in the `targets` list that supports this delivery method: if you chose `WEB`, `EMAIL` or `SMS` - there must be at least one target in `targets` of `PLATFORM_USERS` type.\nFor `SLACK` delivery method - you need to chose at least one `SLACK` notification target.\n\nNotification request object with `PROCESSING` status will be returned immediately, and the notification sending itself is done asynchronously. After all notifications are sent, the `status` of the request becomes `SENT`. Use `getNotificationRequestById` to see the notification request processing status and some sending stats. \n\nHere is an example of notification request to one target using saved template:\n```json\n{\n \"templateId\": {\n \"entityType\": \"NOTIFICATION_TEMPLATE\",\n \"id\": \"6dbc3670-e4dd-11ed-9401-dbcc5dff78be\"\n },\n \"targets\": [\n \"320e3ed0-d785-11ed-a06c-21dd57dd88ca\"\n ],\n \"additionalConfig\": {\n \"sendingDelayInSec\": 0\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "createNotificationRequest", "requestBody": { "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } + "$ref": "#/components/schemas/NotificationRequest" } } }, @@ -75584,7 +75214,14 @@ }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationRequest" + } + } + } }, "400": { "description": "Bad Request", @@ -75597,7 +75234,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -75717,45 +75354,44 @@ ] } }, - "/api/mobile": { - "get": { + "/api/notification/request/preview": { + "post": { "tags": [ - "mobile-app-controller" + "notification-controller" ], - "summary": "Get user mobile app basic info (getUserMobileInfo)", - "description": "\n\nAvailable for any authorized user. ", - "operationId": "getUserMobileInfo", + "summary": "Get notification request preview (getNotificationRequestPreview)", + "description": "Returns preview for notification request.\n\n`processedTemplates` shows how the notifications for each delivery method will look like for the first recipient of the corresponding notification target.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationRequestPreview", "parameters": [ { - "name": "pkgName", - "in": "query", - "description": "Mobile application package name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "platform", + "name": "recipientsPreviewSize", "in": "query", - "description": "Platform type", - "required": true, + "description": "Amount of the recipients to show in preview", + "required": false, "schema": { - "type": "string", - "enum": [ - "ANDROID", - "IOS" - ] + "type": "integer", + "format": "int32", + "default": 20 } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationRequest" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserMobileInfo" + "$ref": "#/components/schemas/NotificationRequestPreview" } } } @@ -75771,7 +75407,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -75891,69 +75527,22 @@ ] } }, - "/api/mobile/app": { + "/api/notification/request/{id}": { "get": { "tags": [ - "mobile-app-controller" + "notification-controller" ], - "summary": "Get mobile app infos (getTenantMobileApps)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getTenantMobileApps", + "summary": "Get notification request by id (getNotificationRequestById)", + "description": "Fetches notification request info by request id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationRequestById", "parameters": [ { - "name": "platformType", - "in": "query", - "description": "Platform type: ANDROID or IOS", - "required": false, - "schema": { - "$ref": "#/components/schemas/PlatformType" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "id", + "in": "path", "required": true, "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on app's name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], @@ -75963,7 +75552,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataMobileApp" + "$ref": "#/components/schemas/NotificationRequestInfo" } } } @@ -76098,33 +75687,27 @@ } ] }, - "post": { + "delete": { "tags": [ - "mobile-app-controller" + "notification-controller" ], - "summary": "Save Or update Mobile app (saveMobileApp)", - "description": "Create or update the Mobile app. When creating mobile app, platform generates Mobile App Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Mobile App Id will be present in the response. Specify existing Mobile App Id to update the mobile app. Referencing non-existing Mobile App Id will cause 'Not Found' error.\n\nThe pair of mobile app package name and platform type is unique for entire platform setup.\n\n\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveMobileApp", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MobileApp" - } + "summary": "Delete notification request (deleteNotificationRequest)", + "description": "Deletes notification request by its id.\n\nIf the request has status `SENT` - all sent notifications for this request will be deleted. If it is `SCHEDULED`, the request will be cancelled.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "deleteNotificationRequest", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } - }, - "required": true - }, + } + ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MobileApp" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -76137,7 +75720,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -76257,22 +75840,60 @@ ] } }, - "/api/mobile/app/{id}": { + "/api/notification/requests": { "get": { "tags": [ - "mobile-app-controller" + "notification-controller" ], - "summary": "Get mobile info by id (getMobileAppById)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getMobileAppById", + "summary": "Get notification requests (getNotificationRequests)", + "description": "Returns the page of notification requests submitted by users of this tenant or sysadmins.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationRequests", "parameters": [ { - "name": "id", - "in": "path", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filed based on the used template name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" } } ], @@ -76282,7 +75903,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MobileApp" + "$ref": "#/components/schemas/PageDataNotificationRequestInfo" } } } @@ -76416,22 +76037,29 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/notification/sendAddonAccessError/{addonType}": { + "post": { "tags": [ - "mobile-app-controller" + "notification-controller" ], - "summary": "Delete Mobile App by ID (deleteMobileApp)", - "description": "Deletes Mobile App by ID. Referencing non-existing mobile app Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "deleteMobileApp", + "summary": "Send add-on access error notification to System/Tenant administrators (sendAddonAccessError)", + "description": "Send add-on access error notification by Tenant Administrator or Customer User to System/Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "sendAddonAccessError", "parameters": [ { - "name": "id", + "name": "addonType", "in": "path", + "description": "Addon type", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "EDGE", + "TRENDZ", + "WHITE_LABELING" + ] } } ], @@ -76450,7 +76078,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -76570,47 +76198,33 @@ ] } }, - "/api/noauth/mobile": { - "get": { + "/api/notification/sendAddonAccessRequest/{addonType}": { + "post": { "tags": [ - "mobile-app-controller" + "notification-controller" ], - "summary": "Get mobile app login info (getLoginMobileInfo)", - "operationId": "getLoginMobileInfo", + "summary": "Send add-on access request notification to System/Tenant administrators (sendAddonAccessRequest)", + "description": "Send add-on access request notification by Tenant Administrator or Customer User to System/Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "sendAddonAccessRequest", "parameters": [ { - "name": "pkgName", - "in": "query", - "description": "Mobile application package name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "platform", - "in": "query", - "description": "Platform type", + "name": "addonType", + "in": "path", + "description": "Addon type", "required": true, "schema": { "type": "string", "enum": [ - "ANDROID", - "IOS" + "EDGE", + "TRENDZ", + "WHITE_LABELING" ] } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginMobileInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -76623,7 +76237,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -76732,30 +76346,39 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/notification/deliveryMethods": { - "get": { + "/api/notification/sendPlanUpgradeRequest/{planName}": { + "post": { "tags": [ "notification-controller" ], - "summary": "Get available delivery methods (getAvailableDeliveryMethods)", - "description": "Returns the list of delivery methods that are properly configured and are allowed to be used for sending notifications.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getAvailableDeliveryMethods", + "summary": "Send plan upgrade request notification to Tenant administrators (sendPlanUpgradeRequest)", + "description": "Send plan upgrade access request notification by Tenant user to Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "sendPlanUpgradeRequest", + "parameters": [ + { + "name": "planName", + "in": "path", + "description": "Plan name", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NotificationDeliveryMethod" - } - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -76768,7 +76391,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -76888,40 +76511,24 @@ ] } }, - "/api/notification/entitiesLimitIncreaseRequest/{entityType}": { - "post": { + "/api/notification/settings": { + "get": { "tags": [ "notification-controller" ], - "summary": "Send entity limit increase request notification to System/Tenant administrators (sendEntitiesLimitIncreaseRequest)", - "description": "Send entity limit increase request notification by Tenant Administrator or Customer User to System/Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "sendEntitiesLimitIncreaseRequest", - "parameters": [ - { - "name": "entityType", - "in": "path", - "description": "Entity type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "DEVICE", - "ASSET", - "CUSTOMER", - "USER", - "DASHBOARD", - "RULE_CHAIN", - "EDGE", - "INTEGRATION", - "CONVERTER", - "SCHEDULER_EVENT" - ] - } - } - ], + "summary": "Get notification settings (getNotificationSettings)", + "description": "Retrieves notification settings for this tenant or sysadmin.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationSettings", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationSettings" + } + } + } }, "400": { "description": "Bad Request", @@ -76934,7 +76541,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -77052,21 +76659,19 @@ "ApiKeyForm": [] } ] - } - }, - "/api/notification/request": { + }, "post": { "tags": [ "notification-controller" ], - "summary": "Create notification request (createNotificationRequest)", - "description": "Processes notification request.\nMandatory request properties are `targets` (list of targets ids to send notification to), and either `templateId` (existing notification template id) or `template` (to send notification without saving the template).\nOptionally, you can set `sendingDelayInSec` inside the `additionalConfig` field to schedule the notification.\n\nFor each enabled delivery method in the notification template, there must be a target in the `targets` list that supports this delivery method: if you chose `WEB`, `EMAIL` or `SMS` - there must be at least one target in `targets` of `PLATFORM_USERS` type.\nFor `SLACK` delivery method - you need to chose at least one `SLACK` notification target.\n\nNotification request object with `PROCESSING` status will be returned immediately, and the notification sending itself is done asynchronously. After all notifications are sent, the `status` of the request becomes `SENT`. Use `getNotificationRequestById` to see the notification request processing status and some sending stats. \n\nHere is an example of notification request to one target using saved template:\n```json\n{\n \"templateId\": {\n \"entityType\": \"NOTIFICATION_TEMPLATE\",\n \"id\": \"6dbc3670-e4dd-11ed-9401-dbcc5dff78be\"\n },\n \"targets\": [\n \"320e3ed0-d785-11ed-a06c-21dd57dd88ca\"\n ],\n \"additionalConfig\": {\n \"sendingDelayInSec\": 0\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "createNotificationRequest", + "summary": "Save notification settings (saveNotificationSettings)", + "description": "Saves notification settings for this tenant or sysadmin.\n`deliveryMethodsConfigs` of the settings must be specified.\n\nHere is an example of the notification settings with Slack configuration:\n```json\n{\n \"deliveryMethodsConfigs\": {\n \"SLACK\": {\n \"method\": \"SLACK\",\n \"botToken\": \"xoxb-....\"\n }\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveNotificationSettings", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationRequest" + "$ref": "#/components/schemas/NotificationSettings" } } }, @@ -77078,7 +76683,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationRequest" + "$ref": "#/components/schemas/NotificationSettings" } } } @@ -77214,32 +76819,165 @@ ] } }, - "/api/notification/request/preview": { - "post": { + "/api/notification/settings/user": { + "get": { "tags": [ "notification-controller" ], - "summary": "Get notification request preview (getNotificationRequestPreview)", - "description": "Returns preview for notification request.\n\n`processedTemplates` shows how the notifications for each delivery method will look like for the first recipient of the corresponding notification target.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationRequestPreview", - "parameters": [ - { - "name": "recipientsPreviewSize", - "in": "query", - "description": "Amount of the recipients to show in preview", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 20 + "summary": "getUserNotificationSettings", + "operationId": "getUserNotificationSettings", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserNotificationSettings" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } } } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + }, + "post": { + "tags": [ + "notification-controller" ], + "summary": "saveUserNotificationSettings", + "operationId": "saveUserNotificationSettings", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationRequest" + "$ref": "#/components/schemas/UserNotificationSettings" } } }, @@ -77251,7 +76989,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationRequestPreview" + "$ref": "#/components/schemas/UserNotificationSettings" } } } @@ -77387,14 +77125,14 @@ ] } }, - "/api/notification/request/{id}": { - "get": { + "/api/notification/{id}": { + "delete": { "tags": [ "notification-controller" ], - "summary": "Get notification request by id (getNotificationRequestById)", - "description": "Fetches notification request info by request id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationRequestById", + "summary": "Delete notification (deleteNotification)", + "description": "Deletes notification by its id.\n\nAvailable for any authorized user. ", + "operationId": "deleteNotification", "parameters": [ { "name": "id", @@ -77408,14 +77146,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationRequestInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -77546,14 +77277,16 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/notification/{id}/read": { + "put": { "tags": [ "notification-controller" ], - "summary": "Delete notification request (deleteNotificationRequest)", - "description": "Deletes notification request by its id.\n\nIf the request has status `SENT` - all sent notifications for this request will be deleted. If it is `SCHEDULED`, the request will be cancelled.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "deleteNotificationRequest", + "summary": "Mark notification as read (markNotificationAsRead)", + "description": "Marks notification as read by its id.\n\nAvailable for any authorized user. ", + "operationId": "markNotificationAsRead", "parameters": [ { "name": "id", @@ -77700,14 +77433,14 @@ ] } }, - "/api/notification/requests": { + "/api/notifications": { "get": { "tags": [ "notification-controller" ], - "summary": "Get notification requests (getNotificationRequests)", - "description": "Returns the page of notification requests submitted by users of this tenant or sysadmins.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationRequests", + "summary": "Get notifications (getNotifications)", + "description": "Returns the page of notifications for current user.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for any authorized user. \n\n**WebSocket API**:\n\nThere are 2 types of subscriptions: one for unread notifications count, another for unread notifications themselves.\n\nThe URI for opening WS session for notifications: `/api/ws/plugins/notifications`.\n\nSubscription command for unread notifications count:\n```\n{\n \"unreadCountSubCmd\": {\n \"cmdId\": 1234\n }\n}\n```\nTo subscribe for latest unread notifications:\n```\n{\n \"unreadSubCmd\": {\n \"cmdId\": 1234,\n \"limit\": 10\n }\n}\n```\nTo unsubscribe from any subscription:\n```\n{\n \"unsubCmd\": {\n \"cmdId\": 1234\n }\n}\n```\nTo mark certain notifications as read, use following command:\n```\n{\n \"markAsReadCmd\": {\n \"cmdId\": 1234,\n \"notifications\": [\n \"6f860330-7fc2-11ed-b855-7dd3b7d2faa9\",\n \"5b6dfee0-8d0d-11ed-b61f-35a57b03dade\"\n ]\n }\n}\n\n```\nTo mark all notifications as read:\n```\n{\n \"markAllAsReadCmd\": {\n \"cmdId\": 1234\n }\n}\n```\n\n\nUpdate structure for unread **notifications count subscription**:\n```\n{\n \"cmdId\": 1234,\n \"totalUnreadCount\": 55\n}\n```\nFor **notifications subscription**:\n- full update of latest unread notifications:\n```\n{\n \"cmdId\": 1234,\n \"notifications\": [\n {\n \"id\": {\n \"entityType\": \"NOTIFICATION\",\n \"id\": \"6f860330-7fc2-11ed-b855-7dd3b7d2faa9\"\n },\n ...\n }\n ],\n \"totalUnreadCount\": 1\n}\n```\n- when new notification arrives or shown notification is updated:\n```\n{\n \"cmdId\": 1234,\n \"update\": {\n \"id\": {\n \"entityType\": \"NOTIFICATION\",\n \"id\": \"6f860330-7fc2-11ed-b855-7dd3b7d2faa9\"\n },\n # updated notification info, text, subject etc.\n ...\n },\n \"totalUnreadCount\": 2\n}\n```\n- when unread notifications count changes:\n```\n{\n \"cmdId\": 1234,\n \"totalUnreadCount\": 5\n}\n```", + "operationId": "getNotifications", "parameters": [ { "name": "pageSize", @@ -77732,7 +77465,7 @@ { "name": "textSearch", "in": "query", - "description": "Case-insensitive 'substring' filed based on the used template name", + "description": "Case-insensitive 'substring' filter based on notification subject or text", "required": false, "schema": { "type": "string" @@ -77755,6 +77488,29 @@ "schema": { "type": "string" } + }, + { + "name": "unreadOnly", + "in": "query", + "description": "To search for unread notifications only", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "deliveryMethod", + "in": "query", + "description": "Delivery method", + "required": false, + "schema": { + "type": "string", + "enum": [ + "WEB", + "MOBILE_APP" + ] + } } ], "responses": { @@ -77763,7 +77519,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataNotificationRequestInfo" + "$ref": "#/components/schemas/PageDataNotification" } } } @@ -77899,26 +77655,25 @@ ] } }, - "/api/notification/sendAddonAccessError/{addonType}": { - "post": { + "/api/notifications/read": { + "put": { "tags": [ "notification-controller" ], - "summary": "Send add-on access error notification to System/Tenant administrators (sendAddonAccessError)", - "description": "Send add-on access error notification by Tenant Administrator or Customer User to System/Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "sendAddonAccessError", + "summary": "Mark all notifications as read (markAllNotificationsAsRead)", + "description": "Marks all unread notifications as read.\n\nAvailable for any authorized user. ", + "operationId": "markAllNotificationsAsRead", "parameters": [ { - "name": "addonType", - "in": "path", - "description": "Addon type", - "required": true, + "name": "deliveryMethod", + "in": "query", + "description": "Delivery method", + "required": false, "schema": { "type": "string", "enum": [ - "EDGE", - "TRENDZ", - "WHITE_LABELING" + "WEB", + "MOBILE_APP" ] } } @@ -77938,7 +77693,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -78058,187 +77813,40 @@ ] } }, - "/api/notification/sendAddonAccessRequest/{addonType}": { - "post": { + "/api/notifications/unread/count": { + "get": { "tags": [ "notification-controller" ], - "summary": "Send add-on access request notification to System/Tenant administrators (sendAddonAccessRequest)", - "description": "Send add-on access request notification by Tenant Administrator or Customer User to System/Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "sendAddonAccessRequest", + "summary": "Get unread notifications count (getUnreadNotificationsCount)", + "description": "Returns unread notifications count for chosen delivery method.\n\nAvailable for any authorized user. ", + "operationId": "getUnreadNotificationsCount", "parameters": [ { - "name": "addonType", - "in": "path", - "description": "Addon type", - "required": true, + "name": "deliveryMethod", + "in": "query", + "description": "Delivery method", + "required": false, "schema": { "type": "string", "enum": [ - "EDGE", - "TRENDZ", - "WHITE_LABELING" + "WEB", + "MOBILE_APP" ] } } ], "responses": { "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid request body", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } + "type": "integer", + "format": "int32" } } } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - } - }, - "/api/notification/sendPlanUpgradeRequest/{planName}": { - "post": { - "tags": [ - "notification-controller" - ], - "summary": "Send plan upgrade request notification to Tenant administrators (sendPlanUpgradeRequest)", - "description": "Send plan upgrade access request notification by Tenant user to Tenant administrators.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "sendPlanUpgradeRequest", - "parameters": [ - { - "name": "planName", - "in": "path", - "description": "Plan name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK" }, "400": { "description": "Bad Request", @@ -78251,7 +77859,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -78371,21 +77979,31 @@ ] } }, - "/api/notification/settings": { - "get": { + "/api/notification/rule": { + "post": { "tags": [ - "notification-controller" + "notification-rule-controller" ], - "summary": "Get notification settings (getNotificationSettings)", - "description": "Retrieves notification settings for this tenant or sysadmin.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationSettings", + "summary": "Save notification rule (saveNotificationRule)", + "description": "Creates or updates notification rule. \n\nMandatory properties are `name`, `templateId` (of a template with `notificationType` matching to rule's `triggerType`), `triggerType`, `triggerConfig` and `recipientConfig`. Additionally, you may specify rule `description` inside of `additionalConfig`.\n\nTrigger type of the rule cannot be changed. Available trigger types for tenant: `ENTITY_ACTION`, `ALARM`, `ALARM_COMMENT`, `ALARM_ASSIGNMENT`, `DEVICE_ACTIVITY`, `RULE_ENGINE_COMPONENT_LIFECYCLE_EVENT`.\nFor sysadmin, there are following trigger types available: `ENTITIES_LIMIT`, `API_USAGE_LIMIT`, `NEW_PLATFORM_VERSION`.\n\nHere is an example of notification rule to send notification when a device, asset or customer is created or deleted:\n```json\n{\n \"name\": \"Entity action\",\n \"templateId\": {\n \"entityType\": \"NOTIFICATION_TEMPLATE\",\n \"id\": \"32117320-d785-11ed-a06c-21dd57dd88ca\"\n },\n \"triggerType\": \"ENTITY_ACTION\",\n \"triggerConfig\": {\n \"entityTypes\": [\n \"CUSTOMER\",\n \"DEVICE\",\n \"ASSET\"\n ],\n \"created\": true,\n \"updated\": false,\n \"deleted\": true,\n \"triggerType\": \"ENTITY_ACTION\"\n },\n \"recipientsConfig\": {\n \"targets\": [\n \"320f2930-d785-11ed-a06c-21dd57dd88ca\"\n ],\n \"triggerType\": \"ENTITY_ACTION\"\n },\n \"additionalConfig\": {\n \"description\": \"Send notification to tenant admins or customer users when a device, asset or customer is created\"\n },\n \"templateName\": \"Entity action notification\",\n \"deliveryMethods\": [\n \"WEB\"\n ]\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveNotificationRule", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationRule" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationSettings" + "$ref": "#/components/schemas/NotificationRule" } } } @@ -78401,7 +78019,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -78519,31 +78137,34 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/notification/rule/{id}": { + "get": { "tags": [ - "notification-controller" + "notification-rule-controller" ], - "summary": "Save notification settings (saveNotificationSettings)", - "description": "Saves notification settings for this tenant or sysadmin.\n`deliveryMethodsConfigs` of the settings must be specified.\n\nHere is an example of the notification settings with Slack configuration:\n```json\n{\n \"deliveryMethodsConfigs\": {\n \"SLACK\": {\n \"method\": \"SLACK\",\n \"botToken\": \"xoxb-....\"\n }\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveNotificationSettings", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationSettings" - } + "summary": "Get notification rule by id (getNotificationRuleById)", + "description": "Fetches notification rule info by rule's id.\nIn addition to regular notification rule fields, there are `templateName` and `deliveryMethods` in the response.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationRuleById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationSettings" + "$ref": "#/components/schemas/NotificationRuleInfo" } } } @@ -78559,7 +78180,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -78677,25 +78298,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/notification/settings/user": { - "get": { + }, + "delete": { "tags": [ - "notification-controller" + "notification-rule-controller" + ], + "summary": "Delete notification rule (deleteNotificationRule)", + "description": "Deletes notification rule by id.\nCancels all related scheduled notification requests (e.g. due to escalation table)\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "deleteNotificationRule", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } ], - "summary": "getUserNotificationSettings", - "operationId": "getUserNotificationSettings", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserNotificationSettings" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -78826,30 +78450,72 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/notification/rules": { + "get": { "tags": [ - "notification-controller" + "notification-rule-controller" ], - "summary": "saveUserNotificationSettings", - "operationId": "saveUserNotificationSettings", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserNotificationSettings" - } + "summary": "Get notification rules (getNotificationRules)", + "description": "Returns the page of notification rules.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationRules", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on rule's name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserNotificationSettings" + "$ref": "#/components/schemas/PageDataNotificationRuleInfo" } } } @@ -78865,7 +78531,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -78985,28 +78651,34 @@ ] } }, - "/api/notification/{id}": { - "delete": { + "/api/notification/target": { + "post": { "tags": [ - "notification-controller" + "notification-target-controller" ], - "summary": "Delete notification (deleteNotification)", - "description": "Deletes notification by its id.\n\nAvailable for any authorized user. ", - "operationId": "deleteNotification", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" + "summary": "Save notification target (saveNotificationTarget)", + "description": "Creates or updates notification target.\n\nAvailable `configuration` types are `PLATFORM_USERS` and `SLACK`.\nFor `PLATFORM_USERS` the `usersFilter` must be specified. For tenant, there are following users filter types available: `USER_LIST`, `CUSTOMER_USERS`, `USER_GROUP_LIST`, `TENANT_ADMINISTRATORS`, `USER_ROLE`, `ALL_USERS`, `ORIGINATOR_ENTITY_OWNER_USERS`, `AFFECTED_USER`.\nFor sysadmin: `TENANT_ADMINISTRATORS`, `AFFECTED_TENANT_ADMINISTRATORS`, `SYSTEM_ADMINISTRATORS`, `ALL_USERS`.\n\nHere is an example of tenant-level notification target to send notification to customer's users:\n```json\n{\n \"name\": \"Users of Customer A\",\n \"configuration\": {\n \"type\": \"PLATFORM_USERS\",\n \"usersFilter\": {\n \"type\": \"CUSTOMER_USERS\",\n \"customerId\": \"32499a20-d785-11ed-a06c-21dd57dd88ca\"\n },\n \"description\": \"Users of Customer A\"\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveNotificationTarget", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTarget" + } } - } - ], + }, + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTarget" + } + } + } }, "400": { "description": "Bad Request", @@ -79019,7 +78691,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -79139,28 +78811,56 @@ ] } }, - "/api/notification/{id}/read": { - "put": { + "/api/notification/target/recipients": { + "post": { "tags": [ - "notification-controller" + "notification-target-controller" ], - "summary": "Mark notification as read (markNotificationAsRead)", - "description": "Marks notification as read by its id.\n\nAvailable for any authorized user. ", - "operationId": "markNotificationAsRead", + "summary": "Get recipients for notification target config (getRecipientsForNotificationTargetConfig)", + "description": "Returns the page of recipients for such notification target configuration.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getRecipientsForNotificationTargetConfig", "parameters": [ { - "name": "id", - "in": "path", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTarget" + } + } + }, + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataUser" + } + } + } }, "400": { "description": "Bad Request", @@ -79173,7 +78873,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -79293,83 +78993,22 @@ ] } }, - "/api/notifications": { + "/api/notification/target/{id}": { "get": { "tags": [ - "notification-controller" + "notification-target-controller" ], - "summary": "Get notifications (getNotifications)", - "description": "Returns the page of notifications for current user.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for any authorized user. \n\n**WebSocket API**:\n\nThere are 2 types of subscriptions: one for unread notifications count, another for unread notifications themselves.\n\nThe URI for opening WS session for notifications: `/api/ws/plugins/notifications`.\n\nSubscription command for unread notifications count:\n```\n{\n \"unreadCountSubCmd\": {\n \"cmdId\": 1234\n }\n}\n```\nTo subscribe for latest unread notifications:\n```\n{\n \"unreadSubCmd\": {\n \"cmdId\": 1234,\n \"limit\": 10\n }\n}\n```\nTo unsubscribe from any subscription:\n```\n{\n \"unsubCmd\": {\n \"cmdId\": 1234\n }\n}\n```\nTo mark certain notifications as read, use following command:\n```\n{\n \"markAsReadCmd\": {\n \"cmdId\": 1234,\n \"notifications\": [\n \"6f860330-7fc2-11ed-b855-7dd3b7d2faa9\",\n \"5b6dfee0-8d0d-11ed-b61f-35a57b03dade\"\n ]\n }\n}\n\n```\nTo mark all notifications as read:\n```\n{\n \"markAllAsReadCmd\": {\n \"cmdId\": 1234\n }\n}\n```\n\n\nUpdate structure for unread **notifications count subscription**:\n```\n{\n \"cmdId\": 1234,\n \"totalUnreadCount\": 55\n}\n```\nFor **notifications subscription**:\n- full update of latest unread notifications:\n```\n{\n \"cmdId\": 1234,\n \"notifications\": [\n {\n \"id\": {\n \"entityType\": \"NOTIFICATION\",\n \"id\": \"6f860330-7fc2-11ed-b855-7dd3b7d2faa9\"\n },\n ...\n }\n ],\n \"totalUnreadCount\": 1\n}\n```\n- when new notification arrives or shown notification is updated:\n```\n{\n \"cmdId\": 1234,\n \"update\": {\n \"id\": {\n \"entityType\": \"NOTIFICATION\",\n \"id\": \"6f860330-7fc2-11ed-b855-7dd3b7d2faa9\"\n },\n # updated notification info, text, subject etc.\n ...\n },\n \"totalUnreadCount\": 2\n}\n```\n- when unread notifications count changes:\n```\n{\n \"cmdId\": 1234,\n \"totalUnreadCount\": 5\n}\n```", - "operationId": "getNotifications", + "summary": "Get notification target by id (getNotificationTargetById)", + "description": "Fetches notification target by id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationTargetById", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "id", + "in": "path", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on notification subject or text", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "unreadOnly", - "in": "query", - "description": "To search for unread notifications only", - "required": false, - "schema": { - "type": "boolean", - "default": false - } - }, - { - "name": "deliveryMethod", - "in": "query", - "description": "Delivery method", - "required": false, "schema": { "type": "string", - "enum": [ - "WEB", - "MOBILE_APP" - ] + "format": "uuid" } } ], @@ -79379,7 +79018,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataNotification" + "$ref": "#/components/schemas/NotificationTarget" } } } @@ -79513,28 +79152,22 @@ "ApiKeyForm": [] } ] - } - }, - "/api/notifications/read": { - "put": { + }, + "delete": { "tags": [ - "notification-controller" + "notification-target-controller" ], - "summary": "Mark all notifications as read (markAllNotificationsAsRead)", - "description": "Marks all unread notifications as read.\n\nAvailable for any authorized user. ", - "operationId": "markAllNotificationsAsRead", + "summary": "Delete notification target by id (deleteNotificationTargetById)", + "description": "Deletes notification target by its id.\n\nThis target cannot be referenced by existing scheduled notification requests or any notification rules.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "deleteNotificationTargetById", "parameters": [ { - "name": "deliveryMethod", - "in": "query", - "description": "Delivery method", - "required": false, + "name": "id", + "in": "path", + "required": true, "schema": { "type": "string", - "enum": [ - "WEB", - "MOBILE_APP" - ] + "format": "uuid" } } ], @@ -79673,26 +79306,60 @@ ] } }, - "/api/notifications/unread/count": { + "/api/notification/targets": { "get": { "tags": [ - "notification-controller" + "notification-target-controller" ], - "summary": "Get unread notifications count (getUnreadNotificationsCount)", - "description": "Returns unread notifications count for chosen delivery method.\n\nAvailable for any authorized user. ", - "operationId": "getUnreadNotificationsCount", + "summary": "Get notification targets (getNotificationTargets)", + "description": "Returns the page of notification targets owned by sysadmin or tenant.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationTargets", "parameters": [ { - "name": "deliveryMethod", + "name": "pageSize", "in": "query", - "description": "Delivery method", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filed based on the target's name", "required": false, "schema": { - "type": "string", - "enum": [ - "WEB", - "MOBILE_APP" - ] + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" } } ], @@ -79702,8 +79369,7 @@ "content": { "application/json": { "schema": { - "type": "integer", - "format": "int32" + "$ref": "#/components/schemas/PageDataNotificationTarget" } } } @@ -79839,31 +79505,38 @@ ] } }, - "/api/notification/rule": { - "post": { + "/api/notification/targets/list": { + "get": { "tags": [ - "notification-rule-controller" + "notification-target-controller" ], - "summary": "Save notification rule (saveNotificationRule)", - "description": "Creates or updates notification rule. \n\nMandatory properties are `name`, `templateId` (of a template with `notificationType` matching to rule's `triggerType`), `triggerType`, `triggerConfig` and `recipientConfig`. Additionally, you may specify rule `description` inside of `additionalConfig`.\n\nTrigger type of the rule cannot be changed. Available trigger types for tenant: `ENTITY_ACTION`, `ALARM`, `ALARM_COMMENT`, `ALARM_ASSIGNMENT`, `DEVICE_ACTIVITY`, `RULE_ENGINE_COMPONENT_LIFECYCLE_EVENT`.\nFor sysadmin, there are following trigger types available: `ENTITIES_LIMIT`, `API_USAGE_LIMIT`, `NEW_PLATFORM_VERSION`.\n\nHere is an example of notification rule to send notification when a device, asset or customer is created or deleted:\n```json\n{\n \"name\": \"Entity action\",\n \"templateId\": {\n \"entityType\": \"NOTIFICATION_TEMPLATE\",\n \"id\": \"32117320-d785-11ed-a06c-21dd57dd88ca\"\n },\n \"triggerType\": \"ENTITY_ACTION\",\n \"triggerConfig\": {\n \"entityTypes\": [\n \"CUSTOMER\",\n \"DEVICE\",\n \"ASSET\"\n ],\n \"created\": true,\n \"updated\": false,\n \"deleted\": true,\n \"triggerType\": \"ENTITY_ACTION\"\n },\n \"recipientsConfig\": {\n \"targets\": [\n \"320f2930-d785-11ed-a06c-21dd57dd88ca\"\n ],\n \"triggerType\": \"ENTITY_ACTION\"\n },\n \"additionalConfig\": {\n \"description\": \"Send notification to tenant admins or customer users when a device, asset or customer is created\"\n },\n \"templateName\": \"Entity action notification\",\n \"deliveryMethods\": [\n \"WEB\"\n ]\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveNotificationRule", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationRule" + "summary": "Get notification targets by ids (getNotificationTargetsByIds)", + "description": "Returns the list of notification targets found by provided ids.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationTargetsByIds", + "parameters": [ + { + "name": "ids", + "in": "query", + "description": "Comma-separated list of uuids representing targets ids", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" } } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationRule" + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationTarget" + } } } } @@ -79879,7 +79552,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -79999,22 +79672,69 @@ ] } }, - "/api/notification/rule/{id}": { + "/api/notification/targets/notificationType/{notificationType}": { "get": { "tags": [ - "notification-rule-controller" + "notification-target-controller" ], - "summary": "Get notification rule by id (getNotificationRuleById)", - "description": "Fetches notification rule info by rule's id.\nIn addition to regular notification rule fields, there are `templateName` and `deliveryMethods` in the response.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationRuleById", + "summary": "Get notification targets by supported notification type (getNotificationTargetsBySupportedNotificationType)", + "description": "Returns the page of notification targets filtered by notification type that they can be used for.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationTargetsBySupportedNotificationType", "parameters": [ { - "name": "id", + "name": "notificationType", "in": "path", + "description": "Notification type to filter targets by", "required": true, "schema": { - "type": "string", - "format": "uuid" + "$ref": "#/components/schemas/NotificationType" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filed based on the target's name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" } } ], @@ -80024,7 +79744,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationRuleInfo" + "$ref": "#/components/schemas/PageDataNotificationTarget" } } } @@ -80158,28 +79878,48 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/notification/slack/conversations": { + "get": { "tags": [ - "notification-rule-controller" + "notification-template-controller" ], - "summary": "Delete notification rule (deleteNotificationRule)", - "description": "Deletes notification rule by id.\nCancels all related scheduled notification requests (e.g. due to escalation table)\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "deleteNotificationRule", + "summary": "List Slack conversations (listSlackConversations)", + "description": "List available Slack conversations by type.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "listSlackConversations", "parameters": [ { - "name": "id", - "in": "path", + "name": "type", + "in": "query", "required": true, "schema": { - "type": "string", - "format": "uuid" + "$ref": "#/components/schemas/SlackConversationType" + } + }, + { + "name": "token", + "in": "query", + "description": "Slack bot token. If absent - system Slack settings will be used", + "required": false, + "schema": { + "type": "string" } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SlackConversation" + } + } + } + } }, "400": { "description": "Bad Request", @@ -80312,70 +80052,31 @@ ] } }, - "/api/notification/rules": { - "get": { + "/api/notification/template": { + "post": { "tags": [ - "notification-rule-controller" + "notification-template-controller" ], - "summary": "Get notification rules (getNotificationRules)", - "description": "Returns the page of notification rules.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationRules", - "parameters": [ - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on rule's name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" + "summary": "Save notification template (saveNotificationTemplate)", + "description": "Creates or updates notification template.\n\nHere is an example of template to send notification via Web, SMS and Slack:\n```json\n{\n \"name\": \"Greetings\",\n \"notificationType\": \"GENERAL\",\n \"configuration\": {\n \"deliveryMethodsTemplates\": {\n \"WEB\": {\n \"enabled\": true,\n \"subject\": \"Greetings\",\n \"body\": \"Hi there, ${recipientTitle}\",\n \"additionalConfig\": {\n \"icon\": {\n \"enabled\": true,\n \"icon\": \"back_hand\",\n \"color\": \"#757575\"\n },\n \"actionButtonConfig\": {\n \"enabled\": false\n }\n },\n \"method\": \"WEB\"\n },\n \"SMS\": {\n \"enabled\": true,\n \"body\": \"Hi there, ${recipientTitle}\",\n \"method\": \"SMS\"\n },\n \"SLACK\": {\n \"enabled\": true,\n \"body\": \"Hi there, @${recipientTitle}\",\n \"method\": \"SLACK\"\n }\n }\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveNotificationTemplate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationTemplate" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataNotificationRuleInfo" + "$ref": "#/components/schemas/NotificationTemplate" } } } @@ -80391,7 +80092,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -80511,31 +80212,32 @@ ] } }, - "/api/notification/target": { - "post": { + "/api/notification/template/{id}": { + "get": { "tags": [ - "notification-target-controller" + "notification-template-controller" ], - "summary": "Save notification target (saveNotificationTarget)", - "description": "Creates or updates notification target.\n\nAvailable `configuration` types are `PLATFORM_USERS` and `SLACK`.\nFor `PLATFORM_USERS` the `usersFilter` must be specified. For tenant, there are following users filter types available: `USER_LIST`, `CUSTOMER_USERS`, `USER_GROUP_LIST`, `TENANT_ADMINISTRATORS`, `USER_ROLE`, `ALL_USERS`, `ORIGINATOR_ENTITY_OWNER_USERS`, `AFFECTED_USER`.\nFor sysadmin: `TENANT_ADMINISTRATORS`, `AFFECTED_TENANT_ADMINISTRATORS`, `SYSTEM_ADMINISTRATORS`, `ALL_USERS`.\n\nHere is an example of tenant-level notification target to send notification to customer's users:\n```json\n{\n \"name\": \"Users of Customer A\",\n \"configuration\": {\n \"type\": \"PLATFORM_USERS\",\n \"usersFilter\": {\n \"type\": \"CUSTOMER_USERS\",\n \"customerId\": \"32499a20-d785-11ed-a06c-21dd57dd88ca\"\n },\n \"description\": \"Users of Customer A\"\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveNotificationTarget", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationTarget" - } + "summary": "Get notification template by id (getNotificationTemplateById)", + "description": "Fetches notification template by id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationTemplateById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationTarget" + "$ref": "#/components/schemas/NotificationTemplate" } } } @@ -80551,7 +80253,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -80669,58 +80371,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/notification/target/recipients": { - "post": { + }, + "delete": { "tags": [ - "notification-target-controller" + "notification-template-controller" ], - "summary": "Get recipients for notification target config (getRecipientsForNotificationTargetConfig)", - "description": "Returns the page of recipients for such notification target configuration.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getRecipientsForNotificationTargetConfig", + "summary": "Delete notification template by id (deleteNotificationTemplateById", + "description": "Deletes notification template by its id.\n\nThis template cannot be referenced by existing scheduled notification requests or any notification rules.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "deleteNotificationTemplateById", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "id", + "in": "path", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string", + "format": "uuid" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationTarget" - } - } - }, - "required": true - }, "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataUser" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -80733,7 +80405,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -80853,22 +80525,72 @@ ] } }, - "/api/notification/target/{id}": { + "/api/notification/templates": { "get": { "tags": [ - "notification-target-controller" + "notification-template-controller" ], - "summary": "Get notification target by id (getNotificationTargetById)", - "description": "Fetches notification target by id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationTargetById", + "summary": "Get notification templates (getNotificationTemplates)", + "description": "Returns the page of notification templates owned by sysadmin or tenant.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getNotificationTemplates", "parameters": [ { - "name": "id", - "in": "path", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on template's name and notification type", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "notificationTypes", + "in": "query", + "description": "Comma-separated list of notification types to filter the templates", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } } } ], @@ -80878,7 +80600,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationTarget" + "$ref": "#/components/schemas/PageDataNotificationTemplate" } } } @@ -81012,28 +80734,29 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/oauth2/config/template": { + "get": { "tags": [ - "notification-target-controller" - ], - "summary": "Delete notification target by id (deleteNotificationTargetById)", - "description": "Deletes notification target by its id.\n\nThis target cannot be referenced by existing scheduled notification requests or any notification rules.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "deleteNotificationTargetById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } + "o-auth-2-config-template-controller" ], + "summary": "Get the list of all OAuth2 client registration templates (getOAuth2ClientRegistrationTemplates)\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "description": "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients", + "operationId": "getOAuth2ClientRegistrationTemplates", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OAuth2ClientRegistrationTemplate" + } + } + } + } }, "400": { "description": "Bad Request", @@ -81164,72 +80887,31 @@ "ApiKeyForm": [] } ] - } - }, - "/api/notification/targets": { - "get": { + }, + "post": { "tags": [ - "notification-target-controller" + "o-auth-2-config-template-controller" ], - "summary": "Get notification targets (getNotificationTargets)", - "description": "Returns the page of notification targets owned by sysadmin or tenant.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationTargets", - "parameters": [ - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filed based on the target's name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" + "summary": "Create or update OAuth2 client registration template (saveClientRegistrationTemplate)\n\nAvailable for users with 'SYS_ADMIN' authority.", + "description": "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients", + "operationId": "saveClientRegistrationTemplate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2ClientRegistrationTemplate" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataNotificationTarget" + "$ref": "#/components/schemas/OAuth2ClientRegistrationTemplate" } } } @@ -81245,7 +80927,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -81365,41 +81047,29 @@ ] } }, - "/api/notification/targets/list": { - "get": { + "/api/oauth2/config/template/{clientRegistrationTemplateId}": { + "delete": { "tags": [ - "notification-target-controller" + "o-auth-2-config-template-controller" ], - "summary": "Get notification targets by ids (getNotificationTargetsByIds)", - "description": "Returns the list of notification targets found by provided ids.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationTargetsByIds", + "summary": "Delete OAuth2 client registration template by id (deleteClientRegistrationTemplate)\n\nAvailable for users with 'SYS_ADMIN' authority.", + "description": "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients", + "operationId": "deleteClientRegistrationTemplate", "parameters": [ { - "name": "ids", - "in": "query", - "description": "Comma-separated list of uuids representing targets ids", + "name": "clientRegistrationTemplateId", + "in": "path", + "description": "String representation of client registration template id to delete", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } - } + "type": "string" + }, + "example": "139b1f81-2f5d-11ec-9dbe-9b627e1a88f4" } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NotificationTarget" - } - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -81532,69 +81202,36 @@ ] } }, - "/api/notification/targets/notificationType/{notificationType}": { - "get": { + "/api/noauth/oauth2Clients": { + "post": { "tags": [ - "notification-target-controller" + "o-auth-2-controller" ], - "summary": "Get notification targets by supported notification type (getNotificationTargetsBySupportedNotificationType)", - "description": "Returns the page of notification targets filtered by notification type that they can be used for.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationTargetsBySupportedNotificationType", + "summary": "Get OAuth2 clients (getOAuth2Clients)", + "description": "Get the list of OAuth2 clients to log in with, available for such domain scheme (HTTP or HTTPS) (if x-forwarded-proto request header is present - the scheme is known from it) and domain name and port (port may be known from x-forwarded-port header)", + "operationId": "getOAuth2Clients", "parameters": [ { - "name": "notificationType", - "in": "path", - "description": "Notification type to filter targets by", - "required": true, - "schema": { - "$ref": "#/components/schemas/NotificationType" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filed based on the target's name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", + "name": "pkgName", "in": "query", - "description": "Property of entity to sort by", + "description": "Mobile application package name, to find OAuth2 clients where there is configured mobile application with such package name", "required": false, "schema": { "type": "string" } }, { - "name": "sortOrder", + "name": "platform", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "Platform type to search OAuth2 clients for which the usage with this platform type is allowed in the settings. If platform type is not one of allowable values - it will just be ignored", "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "WEB", + "ANDROID", + "IOS" + ] } } ], @@ -81604,7 +81241,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataNotificationTarget" + "type": "array", + "items": { + "$ref": "#/components/schemas/OAuth2ClientLoginInfo" + } } } } @@ -81620,7 +81260,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -81729,54 +81369,34 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/notification/slack/conversations": { - "get": { + "/api/oauth2/client": { + "post": { "tags": [ - "notification-template-controller" + "o-auth-2-controller" ], - "summary": "List Slack conversations (listSlackConversations)", - "description": "List available Slack conversations by type.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "listSlackConversations", - "parameters": [ - { - "name": "type", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/SlackConversationType" + "summary": "Save OAuth2 Client (saveOAuth2Client)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "saveOAuth2Client", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Client" + } } }, - { - "name": "token", - "in": "query", - "description": "Slack bot token. If absent - system Slack settings will be used", - "required": false, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SlackConversation" - } + "$ref": "#/components/schemas/OAuth2Client" } } } @@ -81792,7 +81412,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -81912,31 +81532,70 @@ ] } }, - "/api/notification/template": { - "post": { + "/api/oauth2/client/infos": { + "get": { "tags": [ - "notification-template-controller" + "o-auth-2-controller" ], - "summary": "Save notification template (saveNotificationTemplate)", - "description": "Creates or updates notification template.\n\nHere is an example of template to send notification via Web, SMS and Slack:\n```json\n{\n \"name\": \"Greetings\",\n \"notificationType\": \"GENERAL\",\n \"configuration\": {\n \"deliveryMethodsTemplates\": {\n \"WEB\": {\n \"enabled\": true,\n \"subject\": \"Greetings\",\n \"body\": \"Hi there, ${recipientTitle}\",\n \"additionalConfig\": {\n \"icon\": {\n \"enabled\": true,\n \"icon\": \"back_hand\",\n \"color\": \"#757575\"\n },\n \"actionButtonConfig\": {\n \"enabled\": false\n }\n },\n \"method\": \"WEB\"\n },\n \"SMS\": {\n \"enabled\": true,\n \"body\": \"Hi there, ${recipientTitle}\",\n \"method\": \"SMS\"\n },\n \"SLACK\": {\n \"enabled\": true,\n \"body\": \"Hi there, @${recipientTitle}\",\n \"method\": \"SLACK\"\n }\n }\n }\n}\n```\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveNotificationTemplate", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationTemplate" - } + "summary": "Get OAuth2 Client infos (findOAuth2ClientInfos)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "findOAuth2ClientInfos", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on client's title", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationTemplate" + "$ref": "#/components/schemas/PageDataOAuth2ClientInfo" } } } @@ -81952,7 +81611,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -82072,22 +81731,25 @@ ] } }, - "/api/notification/template/{id}": { + "/api/oauth2/client/list": { "get": { "tags": [ - "notification-template-controller" + "o-auth-2-controller" ], - "summary": "Get notification template by id (getNotificationTemplateById)", - "description": "Fetches notification template by id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationTemplateById", + "summary": "Get OAuth2 Client infos By Ids (findTenantOAuth2ClientInfosByIds)", + "description": "Fetch OAuth2 Client info objects based on the provided ids. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "findTenantOAuth2ClientInfosByIds", "parameters": [ { - "name": "id", - "in": "path", + "name": "clientIds", + "in": "query", + "description": "A list of oauth2 ids, separated by comma ','", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -82097,7 +81759,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationTemplate" + "type": "array", + "items": { + "$ref": "#/components/schemas/OAuth2ClientInfo" + } } } } @@ -82231,14 +81896,16 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/oauth2/client/{id}": { + "get": { "tags": [ - "notification-template-controller" + "o-auth-2-controller" ], - "summary": "Delete notification template by id (deleteNotificationTemplateById", - "description": "Deletes notification template by its id.\n\nThis template cannot be referenced by existing scheduled notification requests or any notification rules.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "deleteNotificationTemplateById", + "summary": "Get OAuth2 Client by id (getOAuth2ClientById)", + "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getOAuth2ClientById", "parameters": [ { "name": "id", @@ -82252,7 +81919,14 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuth2Client" + } + } + } }, "400": { "description": "Bad Request", @@ -82383,87 +82057,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/notification/templates": { - "get": { + }, + "delete": { "tags": [ - "notification-template-controller" + "o-auth-2-controller" ], - "summary": "Get notification templates (getNotificationTemplates)", - "description": "Returns the page of notification templates owned by sysadmin or tenant.\n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getNotificationTemplates", + "summary": "Delete oauth2 client (deleteOauth2Client)", + "description": "Deletes the oauth2 client. Referencing non-existing oauth2 client Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "deleteOauth2Client", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "id", + "in": "path", "required": true, "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on template's name and notification type", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "notificationTypes", - "in": "query", - "description": "Comma-separated list of notification types to filter the templates", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string", + "format": "uuid" } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataNotificationTemplate" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -82596,24 +82211,21 @@ ] } }, - "/api/oauth2/config/template": { + "/api/oauth2/loginProcessingUrl": { "get": { "tags": [ - "o-auth-2-config-template-controller" + "o-auth-2-controller" ], - "summary": "Get the list of all OAuth2 client registration templates (getOAuth2ClientRegistrationTemplates)\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "description": "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients", - "operationId": "getOAuth2ClientRegistrationTemplates", + "summary": "Get OAuth2 log in processing URL (getLoginProcessingUrl)", + "description": "Returns the URL enclosed in double quotes. After successful authentication with OAuth2 provider, it makes a redirect to this path so that the platform can do further log in processing. This URL may be configured as 'security.oauth2.loginProcessingUrl' property in yml configuration file, or as 'SECURITY_OAUTH2_LOGIN_PROCESSING_URL' env variable. By default it is '/login/oauth2/code/'\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getLoginProcessingUrl", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OAuth2ClientRegistrationTemplate" - } + "type": "string" } } } @@ -82747,19 +82359,21 @@ "ApiKeyForm": [] } ] - }, + } + }, + "/api/otaPackage": { "post": { "tags": [ - "o-auth-2-config-template-controller" + "ota-package-controller" ], - "summary": "Create or update OAuth2 client registration template (saveClientRegistrationTemplate)\n\nAvailable for users with 'SYS_ADMIN' authority.", - "description": "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients", - "operationId": "saveClientRegistrationTemplate", + "summary": "Create Or Update OTA Package Info (saveOtaPackageInfo)", + "description": "Create or update the OTA Package Info. When creating OTA Package Info, platform generates OTA Package id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created OTA Package id will be present in the response. Specify existing OTA Package id to update the OTA Package Info. Referencing non-existing OTA Package Id will cause 'Not Found' error. \n\nOTA Package combination of the title with the version is unique in the scope of tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveOtaPackageInfo", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OAuth2ClientRegistrationTemplate" + "$ref": "#/components/schemas/SaveOtaPackageInfoRequest" } } }, @@ -82771,7 +82385,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OAuth2ClientRegistrationTemplate" + "$ref": "#/components/schemas/OtaPackageInfo" } } } @@ -82907,29 +82521,35 @@ ] } }, - "/api/oauth2/config/template/{clientRegistrationTemplateId}": { - "delete": { + "/api/otaPackage/info/{otaPackageId}": { + "get": { "tags": [ - "o-auth-2-config-template-controller" + "ota-package-controller" ], - "summary": "Delete OAuth2 client registration template by id (deleteClientRegistrationTemplate)\n\nAvailable for users with 'SYS_ADMIN' authority.", - "description": "Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients", - "operationId": "deleteClientRegistrationTemplate", + "summary": "Get OTA Package Info (getOtaPackageInfoById)", + "description": "Fetch the OTA Package Info object based on the provided OTA Package Id. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getOtaPackageInfoById", "parameters": [ { - "name": "clientRegistrationTemplateId", + "name": "otaPackageId", "in": "path", - "description": "String representation of client registration template id to delete", + "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" - }, - "example": "139b1f81-2f5d-11ec-9dbe-9b627e1a88f4" + } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OtaPackageInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -83062,37 +82682,23 @@ ] } }, - "/api/noauth/oauth2Clients": { - "post": { + "/api/otaPackage/{otaPackageId}": { + "get": { "tags": [ - "o-auth-2-controller" + "ota-package-controller" ], - "summary": "Get OAuth2 clients (getOAuth2Clients)", - "description": "Get the list of OAuth2 clients to log in with, available for such domain scheme (HTTP or HTTPS) (if x-forwarded-proto request header is present - the scheme is known from it) and domain name and port (port may be known from x-forwarded-port header)", - "operationId": "getOAuth2Clients", + "summary": "Get OTA Package (getOtaPackageById)", + "description": "Fetch the OTA Package object based on the provided OTA Package Id. The server checks that the OTA Package is owned by the same tenant. OTA Package is a heavyweight object that includes main information about the OTA Package and also data. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getOtaPackageById", "parameters": [ { - "name": "pkgName", - "in": "query", - "description": "Mobile application package name, to find OAuth2 clients where there is configured mobile application with such package name", - "required": false, + "name": "otaPackageId", + "in": "path", + "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { "type": "string" } - }, - { - "name": "platform", - "in": "query", - "description": "Platform type to search OAuth2 clients for which the usage with this platform type is allowed in the settings. If platform type is not one of allowable values - it will just be ignored", - "required": false, - "schema": { - "type": "string", - "enum": [ - "WEB", - "ANDROID", - "IOS" - ] - } } ], "responses": { @@ -83101,10 +82707,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OAuth2ClientLoginInfo" - } + "$ref": "#/components/schemas/OtaPackage" } } } @@ -83120,7 +82723,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -83229,26 +82832,79 @@ } } } - } - } - }, - "/api/oauth2/client": { + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] + }, "post": { "tags": [ - "o-auth-2-controller" + "ota-package-controller" + ], + "summary": "Save OTA Package data (saveOtaPackageData)", + "description": "Update the OTA Package. Adds the date to the existing OTA Package Info\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveOtaPackageData", + "parameters": [ + { + "name": "otaPackageId", + "in": "path", + "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "checksum", + "in": "query", + "description": "OTA Package checksum. For example, '0xd87f7e0c'", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "checksumAlgorithm", + "in": "query", + "description": "OTA Package checksum algorithm.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MD5", + "SHA256", + "SHA384", + "SHA512", + "CRC32", + "MURMUR3_32", + "MURMUR3_128" + ] + } + } ], - "summary": "Save OAuth2 Client (saveOAuth2Client)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "saveOAuth2Client", "requestBody": { "content": { - "application/json": { + "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/OAuth2Client" + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "OTA Package data." + } + }, + "required": [ + "file" + ] } } - }, - "required": true + } }, "responses": { "200": { @@ -83256,7 +82912,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OAuth2Client" + "$ref": "#/components/schemas/OtaPackageInfo" } } } @@ -83390,60 +83046,20 @@ "ApiKeyForm": [] } ] - } - }, - "/api/oauth2/client/infos": { - "get": { + }, + "delete": { "tags": [ - "o-auth-2-controller" + "ota-package-controller" ], - "summary": "Get OAuth2 Client infos (findOAuth2ClientInfos)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "findOAuth2ClientInfos", + "summary": "Delete OTA Package (deleteOtaPackage)", + "description": "Deletes the OTA Package. Referencing non-existing OTA Package Id will cause an error. Can't delete the OTA Package if it is referenced by existing devices or device profile.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteOtaPackage", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "otaPackageId", + "in": "path", + "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on client's title", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, "schema": { "type": "string" } @@ -83451,14 +83067,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataOAuth2ClientInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -83591,25 +83200,22 @@ ] } }, - "/api/oauth2/client/list": { + "/api/otaPackage/{otaPackageId}/download": { "get": { "tags": [ - "o-auth-2-controller" + "ota-package-controller" ], - "summary": "Get OAuth2 Client infos By Ids (findTenantOAuth2ClientInfosByIds)", - "description": "Fetch OAuth2 Client info objects based on the provided ids. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "findTenantOAuth2ClientInfosByIds", + "summary": "Download OTA Package (downloadOtaPackage)", + "description": "Download OTA Package based on the provided OTA Package Id.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "downloadOtaPackage", "parameters": [ { - "name": "clientIds", - "in": "query", - "description": "A list of oauth2 ids, separated by comma ','", + "name": "otaPackageId", + "in": "path", + "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" } } ], @@ -83619,10 +83225,8 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OAuth2ClientInfo" - } + "type": "string", + "format": "binary" } } } @@ -83758,22 +83362,75 @@ ] } }, - "/api/oauth2/client/{id}": { + "/api/otaPackages": { "get": { "tags": [ - "o-auth-2-controller" + "ota-package-controller" ], - "summary": "Get OAuth2 Client by id (getOAuth2ClientById)", - "description": "\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getOAuth2ClientById", + "summary": "Get OTA Package Infos (getOtaPackages)", + "description": "Returns a page of OTA Package Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getOtaPackages", "parameters": [ { - "name": "id", - "in": "path", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the ota package title.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "createdTime", + "type", + "title", + "version", + "tag", + "url", + "fileName", + "dataSize", + "checksum" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -83783,7 +83440,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OAuth2Client" + "$ref": "#/components/schemas/PageDataOtaPackageInfo" } } } @@ -83917,28 +83574,112 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/otaPackages/group/{groupId}/{type}": { + "get": { "tags": [ - "o-auth-2-controller" + "ota-package-controller" ], - "summary": "Delete oauth2 client (deleteOauth2Client)", - "description": "Deletes the oauth2 client. Referencing non-existing oauth2 client Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "deleteOauth2Client", + "summary": "Get group OTA Package Infos (getGroupOtaPackages)", + "description": "Returns a page of OTA Package Info objects owned by tenant, and by entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getGroupOtaPackages", "parameters": [ { - "name": "id", + "name": "groupId", "in": "path", + "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "path", + "description": "OTA Package type.", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "FIRMWARE", + "SOFTWARE" + ] + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the ota package title.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "type", + "title", + "version", + "tag", + "url", + "fileName", + "dataSize", + "checksum" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageDataOtaPackageInfo" + } + } + } }, "400": { "description": "Bad Request", @@ -84071,21 +83812,107 @@ ] } }, - "/api/oauth2/loginProcessingUrl": { + "/api/otaPackages/{deviceProfileId}/{type}": { "get": { "tags": [ - "o-auth-2-controller" + "ota-package-controller" + ], + "summary": "Get OTA Package Infos by Device Profile and Type (getOtaPackagesByDeviceProfileIdAndType)", + "description": "Returns a page of OTA Package Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getOtaPackagesByDeviceProfileIdAndType", + "parameters": [ + { + "name": "deviceProfileId", + "in": "path", + "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "path", + "description": "OTA Package type.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "FIRMWARE", + "SOFTWARE" + ] + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the ota package title.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "type", + "title", + "version", + "tag", + "url", + "fileName", + "dataSize", + "checksum" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } ], - "summary": "Get OAuth2 log in processing URL (getLoginProcessingUrl)", - "description": "Returns the URL enclosed in double quotes. After successful authentication with OAuth2 provider, it makes a redirect to this path so that the platform can do further log in processing. This URL may be configured as 'security.oauth2.loginProcessingUrl' property in yml configuration file, or as 'SECURITY_OAUTH2_LOGIN_PROCESSING_URL' env variable. By default it is '/login/oauth2/code/'\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getLoginProcessingUrl", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/PageDataOtaPackageInfo" } } } @@ -84221,34 +84048,59 @@ ] } }, - "/api/otaPackage": { + "/api/owner/CUSTOMER/{ownerId}/{entityType}/{entityId}": { "post": { "tags": [ - "ota-package-controller" + "owner-controller" + ], + "summary": "Change owner to customer (changeOwnerToCustomer)", + "description": "Tenant/Customer changes Owner to Customer or sub-Customer. Sub-Customer can`t perform this operation! \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "changeOwnerToCustomer", + "parameters": [ + { + "name": "ownerId", + "in": "path", + "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Create Or Update OTA Package Info (saveOtaPackageInfo)", - "description": "Create or update the OTA Package Info. When creating OTA Package Info, platform generates OTA Package id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created OTA Package id will be present in the response. Specify existing OTA Package id to update the OTA Package Info. Referencing non-existing OTA Package Id will cause 'Not Found' error. \n\nOTA Package combination of the title with the version is unique in the scope of tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveOtaPackageInfo", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SaveOtaPackageInfoRequest" + "type": "array", + "description": "An optional list of additional entity group ids", + "items": { + "type": "string" + } } } - }, - "required": true + } }, "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OtaPackageInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -84381,35 +84233,59 @@ ] } }, - "/api/otaPackage/info/{otaPackageId}": { - "get": { + "/api/owner/TENANT/{ownerId}/{entityType}/{entityId}": { + "post": { "tags": [ - "ota-package-controller" + "owner-controller" ], - "summary": "Get OTA Package Info (getOtaPackageInfoById)", - "description": "Fetch the OTA Package Info object based on the provided OTA Package Id. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getOtaPackageInfoById", + "summary": "Change owner to tenant (changeOwnerToTenant)", + "description": "Tenant changes Owner from Customer or sub-Customer to Tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "changeOwnerToTenant", "parameters": [ { - "name": "otaPackageId", + "name": "ownerId", "in": "path", - "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } } ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OtaPackageInfo" + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "An optional list of additional entity group ids", + "items": { + "type": "string" } } } + } + }, + "responses": { + "200": { + "description": "OK" }, "400": { "description": "Bad Request", @@ -84422,7 +84298,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -84542,32 +84418,21 @@ ] } }, - "/api/otaPackage/{otaPackageId}": { + "/api/mobile/qr/deepLink": { "get": { "tags": [ - "ota-package-controller" - ], - "summary": "Get OTA Package (getOtaPackageById)", - "description": "Fetch the OTA Package object based on the provided OTA Package Id. The server checks that the OTA Package is owned by the same tenant. OTA Package is a heavyweight object that includes main information about the OTA Package and also data. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getOtaPackageById", - "parameters": [ - { - "name": "otaPackageId", - "in": "path", - "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } + "qr-code-settings-controller" ], + "summary": "Get the deep link to the associated mobile application (getMobileAppDeepLink)", + "description": "Fetch the url that takes user to linked mobile application \n\nAvailable for any authorized user. ", + "operationId": "getMobileAppDeepLink", "responses": { "200": { "description": "OK", "content": { - "application/json": { + "text/plain": { "schema": { - "$ref": "#/components/schemas/OtaPackage" + "type": "string" } } } @@ -84701,78 +84566,23 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/mobile/qr/merged": { + "get": { "tags": [ - "ota-package-controller" - ], - "summary": "Save OTA Package data (saveOtaPackageData)", - "description": "Update the OTA Package. Adds the date to the existing OTA Package Info\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveOtaPackageData", - "parameters": [ - { - "name": "otaPackageId", - "in": "path", - "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "checksum", - "in": "query", - "description": "OTA Package checksum. For example, '0xd87f7e0c'", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "checksumAlgorithm", - "in": "query", - "description": "OTA Package checksum algorithm.", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MD5", - "SHA256", - "SHA384", - "SHA512", - "CRC32", - "MURMUR3_32", - "MURMUR3_128" - ] - } - } + "qr-code-settings-controller" ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "OTA Package data." - } - }, - "required": [ - "file" - ] - } - } - } - }, + "summary": "Get QR code configuration for home page (getMergedMobileAppSettings)", + "description": "The response payload contains ui configuration of qr code\n\nAvailable for any authorized user. ", + "operationId": "getMergedMobileAppSettings", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OtaPackageInfo" + "$ref": "#/components/schemas/QrCodeSettings" } } } @@ -84788,7 +84598,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -84906,28 +84716,26 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/mobile/qr/settings": { + "get": { "tags": [ - "ota-package-controller" - ], - "summary": "Delete OTA Package (deleteOtaPackage)", - "description": "Deletes the OTA Package. Referencing non-existing OTA Package Id will cause an error. Can't delete the OTA Package if it is referenced by existing devices or device profile.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteOtaPackage", - "parameters": [ - { - "name": "otaPackageId", - "in": "path", - "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } + "qr-code-settings-controller" ], + "summary": "Get Mobile application settings (getQrCodeSettings)", + "description": "The response payload contains configuration for android/iOS applications and platform qr code widget settings.\n\nAvailable for any authorized user. ", + "operationId": "getQrCodeSettings", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QrCodeSettings" + } + } + } }, "400": { "description": "Bad Request", @@ -85058,35 +84866,31 @@ "ApiKeyForm": [] } ] - } - }, - "/api/otaPackage/{otaPackageId}/download": { - "get": { + }, + "post": { "tags": [ - "ota-package-controller" + "qr-code-settings-controller" ], - "summary": "Download OTA Package (downloadOtaPackage)", - "description": "Download OTA Package based on the provided OTA Package Id.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "downloadOtaPackage", - "parameters": [ - { - "name": "otaPackageId", - "in": "path", - "description": "A string value representing the ota package id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Create Or Update the Mobile application settings (saveQrCodeSettings)", + "description": "The request payload contains configuration for android/iOS applications and platform qr code widget settings.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveQrCodeSettings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QrCodeSettings" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/QrCodeSettings" } } } @@ -85102,7 +84906,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -85222,76 +85026,21 @@ ] } }, - "/api/otaPackages": { + "/api/noauth/qr": { "get": { "tags": [ - "ota-package-controller" + "qr-code-settings-controller" ], - "summary": "Get OTA Package Infos (getOtaPackages)", - "description": "Returns a page of OTA Package Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getOtaPackages", + "summary": "getApplicationRedirect", + "operationId": "getApplicationRedirect", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "User-Agent", + "in": "header", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the ota package title.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "type", - "title", - "version", - "tag", - "url", - "fileName", - "dataSize", - "checksum" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -85300,7 +85049,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataOtaPackageInfo" + "type": "object" } } } @@ -85425,109 +85174,26 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/otaPackages/group/{groupId}/{type}": { + "/api/noauth/qr/{secret}": { "get": { "tags": [ - "ota-package-controller" + "qr-code-settings-controller" ], - "summary": "Get group OTA Package Infos (getGroupOtaPackages)", - "description": "Returns a page of OTA Package Info objects owned by tenant, and by entity group. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getGroupOtaPackages", + "summary": "Get User Token (getUserTokenByMobileSecret)", + "description": "Returns the token of the User based on the provided secret key.", + "operationId": "getUserTokenByMobileSecret", "parameters": [ { - "name": "groupId", - "in": "path", - "description": "A string value representing the Entity Group Id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "type", + "name": "secret", "in": "path", - "description": "OTA Package type.", - "required": true, - "schema": { - "type": "string", - "enum": [ - "FIRMWARE", - "SOFTWARE" - ] - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing short-lived secret key", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the ota package title.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "type", - "title", - "version", - "tag", - "url", - "fileName", - "dataSize", - "checksum" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -85536,7 +85202,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataOtaPackageInfo" + "$ref": "#/components/schemas/JwtPair" } } } @@ -85661,45 +85327,30 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/otaPackages/{deviceProfileId}/{type}": { + "/api/queues": { "get": { "tags": [ - "ota-package-controller" + "queue-controller" ], - "summary": "Get OTA Package Infos by Device Profile and Type (getOtaPackagesByDeviceProfileIdAndType)", - "description": "Returns a page of OTA Package Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. OTA Package Info is a lightweight object that includes main information about the OTA Package excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getOtaPackagesByDeviceProfileIdAndType", + "summary": "Get Queues (getTenantQueuesByServiceType)", + "description": "Returns a page of queues registered in the platform. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getTenantQueuesByServiceType", "parameters": [ { - "name": "deviceProfileId", - "in": "path", - "description": "A string value representing the device profile id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "path", - "description": "OTA Package type.", + "name": "serviceType", + "in": "query", + "description": "Service type (implemented only for the TB-RULE-ENGINE)", "required": true, "schema": { "type": "string", "enum": [ - "FIRMWARE", - "SOFTWARE" + "TB-RULE-ENGINE", + "TB-CORE", + "TB-TRANSPORT", + "JS-EXECUTOR" ] } }, @@ -85726,7 +85377,7 @@ { "name": "textSearch", "in": "query", - "description": "The case insensitive 'substring' filter based on the ota package title.", + "description": "The case insensitive 'substring' filter based on the queue name.", "required": false, "schema": { "type": "string" @@ -85741,14 +85392,8 @@ "type": "string", "enum": [ "createdTime", - "type", - "title", - "version", - "tag", - "url", - "fileName", - "dataSize", - "checksum" + "name", + "topic" ] } }, @@ -85772,7 +85417,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataOtaPackageInfo" + "$ref": "#/components/schemas/PageDataQueue" } } } @@ -85906,42 +85551,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/owner/CUSTOMER/{ownerId}/{entityType}/{entityId}": { + }, "post": { "tags": [ - "owner-controller" + "queue-controller" ], - "summary": "Change owner to customer (changeOwnerToCustomer)", - "description": "Tenant/Customer changes Owner to Customer or sub-Customer. Sub-Customer can`t perform this operation! \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "changeOwnerToCustomer", + "summary": "Create Or Update Queue (saveQueue)", + "description": "Create or update the Queue. When creating queue, platform generates Queue Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). Specify existing Queue id to update the queue. Referencing non-existing Queue Id will cause 'Not Found' error.\n\nQueue name is unique in the scope of sysadmin. Remove 'id', 'tenantId' from the request body example (below) to create new Queue entity. \n\nAvailable for users with 'SYS_ADMIN' authority.", + "operationId": "saveQueue", "parameters": [ { - "name": "ownerId", - "in": "path", - "description": "A string value representing the customer id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "serviceType", + "in": "query", + "description": "Service type (implemented only for the TB-RULE-ENGINE)", "required": true, "schema": { - "type": "string" + "type": "string", + "enum": [ + "TB-RULE-ENGINE", + "TB-CORE", + "TB-TRANSPORT", + "JS-EXECUTOR" + ] } } ], @@ -85949,18 +85580,22 @@ "content": { "application/json": { "schema": { - "type": "array", - "description": "An optional list of additional entity group ids", - "items": { - "type": "string" - } + "$ref": "#/components/schemas/Queue" } } - } + }, + "required": true }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Queue" + } + } + } }, "400": { "description": "Bad Request", @@ -86093,59 +85728,35 @@ ] } }, - "/api/owner/TENANT/{ownerId}/{entityType}/{entityId}": { - "post": { + "/api/queues/name/{queueName}": { + "get": { "tags": [ - "owner-controller" + "queue-controller" ], - "summary": "Change owner to tenant (changeOwnerToTenant)", - "description": "Tenant changes Owner from Customer or sub-Customer to Tenant. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "changeOwnerToTenant", + "summary": "Get Queue (getQueueByName)", + "description": "Fetch the Queue object based on the provided Queue name. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getQueueByName", "parameters": [ { - "name": "ownerId", - "in": "path", - "description": "A string value representing the tenant id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "entityId", + "name": "queueName", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the queue id. For example, 'Main'", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "description": "An optional list of additional entity group ids", - "items": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Queue" } } } - } - }, - "responses": { - "200": { - "description": "OK" }, "400": { "description": "Bad Request", @@ -86158,7 +85769,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -86278,21 +85889,32 @@ ] } }, - "/api/mobile/qr/deepLink": { + "/api/queues/{queueId}": { "get": { "tags": [ - "qr-code-settings-controller" + "queue-controller" + ], + "summary": "Get Queue (getQueueById)", + "description": "Fetch the Queue object based on the provided Queue Id. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getQueueById", + "parameters": [ + { + "name": "queueId", + "in": "path", + "description": "A string value representing the queue id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Get the deep link to the associated mobile application (getMobileAppDeepLink)", - "description": "Fetch the url that takes user to linked mobile application \n\nAvailable for any authorized user. ", - "operationId": "getMobileAppDeepLink", "responses": { "200": { "description": "OK", "content": { - "text/plain": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/Queue" } } } @@ -86426,26 +86048,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/mobile/qr/merged": { - "get": { + }, + "delete": { "tags": [ - "qr-code-settings-controller" + "queue-controller" + ], + "summary": "Delete Queue (deleteQueue)", + "description": "Deletes the Queue. \n\nAvailable for users with 'SYS_ADMIN' authority.", + "operationId": "deleteQueue", + "parameters": [ + { + "name": "queueId", + "in": "path", + "description": "A string value representing the queue id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Get QR code configuration for home page (getMergedMobileAppSettings)", - "description": "The response payload contains ui configuration of qr code\n\nAvailable for any authorized user. ", - "operationId": "getMergedMobileAppSettings", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QrCodeSettings" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -86578,21 +86202,77 @@ ] } }, - "/api/mobile/qr/settings": { + "/api/queueStats": { "get": { "tags": [ - "qr-code-settings-controller" + "queue-stats-controller" + ], + "summary": "Get Queue Stats entities (getTenantQueueStats)", + "description": "Returns a page of queue stats objects that are designed to collect queue statistics for every service. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getTenantQueueStats", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the queue name or service id.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } ], - "summary": "Get Mobile application settings (getQrCodeSettings)", - "description": "The response payload contains configuration for android/iOS applications and platform qr code widget settings.\n\nAvailable for any authorized user. ", - "operationId": "getQrCodeSettings", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/QrCodeSettings" + "$ref": "#/components/schemas/PageDataQueueStats" } } } @@ -86726,31 +86406,40 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/queueStats/list": { + "get": { "tags": [ - "qr-code-settings-controller" + "queue-stats-controller" ], - "summary": "Create Or Update the Mobile application settings (saveQrCodeSettings)", - "description": "The request payload contains configuration for android/iOS applications and platform qr code widget settings.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveQrCodeSettings", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QrCodeSettings" + "summary": "Get QueueStats By Ids (getQueueStatsByIds)", + "description": "Fetch the Queue stats objects based on the provided ids. ", + "operationId": "getQueueStatsByIds", + "parameters": [ + { + "name": "queueStatsIds", + "in": "query", + "description": "A list of queue stats ids, separated by comma ','", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" } } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/QrCodeSettings" + "type": "array", + "items": { + "$ref": "#/components/schemas/QueueStats" + } } } } @@ -86766,7 +86455,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -86886,17 +86575,19 @@ ] } }, - "/api/noauth/qr": { + "/api/queueStats/{queueStatsId}": { "get": { "tags": [ - "qr-code-settings-controller" + "queue-stats-controller" ], - "summary": "getApplicationRedirect", - "operationId": "getApplicationRedirect", + "summary": "Get Queue stats entity by id (getQueueStatsById)", + "description": "Fetch the Queue stats object based on the provided Queue stats id. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getQueueStatsById", "parameters": [ { - "name": "User-Agent", - "in": "header", + "name": "queueStatsId", + "in": "path", + "description": "A string value representing the queue stats id. For example, '687f294c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -86909,7 +86600,7 @@ "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/QueueStats" } } } @@ -87034,35 +86725,53 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/noauth/qr/{secret}": { - "get": { + "/api/v2/report": { + "post": { "tags": [ - "qr-code-settings-controller" + "report-controller" ], - "summary": "Get User Token (getUserTokenByMobileSecret)", - "description": "Returns the token of the User based on the provided secret key.", - "operationId": "getUserTokenByMobileSecret", - "parameters": [ - { - "name": "secret", - "in": "path", - "description": "A string value representing short-lived secret key", - "required": true, - "schema": { - "type": "string" + "summary": "createReport", + "operationId": "createReport", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + }, + "info": { + "type": "string" + } + }, + "required": [ + "file", + "info" + ] + } } } - ], + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JwtPair" + "$ref": "#/components/schemas/Report" } } } @@ -87078,7 +86787,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -87187,97 +86896,41 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/queues": { - "get": { + "/api/v2/report/request": { + "post": { "tags": [ - "queue-controller" + "report-controller" ], - "summary": "Get Queues (getTenantQueuesByServiceType)", - "description": "Returns a page of queues registered in the platform. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getTenantQueuesByServiceType", - "parameters": [ - { - "name": "serviceType", - "in": "query", - "description": "Service type (implemented only for the TB-RULE-ENGINE)", - "required": true, - "schema": { - "type": "string", - "enum": [ - "TB-RULE-ENGINE", - "TB-CORE", - "TB-TRANSPORT", - "JS-EXECUTOR" - ] - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the queue name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "topic" - ] + "summary": "requestReport", + "operationId": "requestReport", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportRequest" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataQueue" + "$ref": "#/components/schemas/Job" } } } @@ -87293,7 +86946,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -87411,36 +87064,21 @@ "ApiKeyForm": [] } ] - }, + } + }, + "/api/v2/report/test": { "post": { "tags": [ - "queue-controller" - ], - "summary": "Create Or Update Queue (saveQueue)", - "description": "Create or update the Queue. When creating queue, platform generates Queue Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). Specify existing Queue id to update the queue. Referencing non-existing Queue Id will cause 'Not Found' error.\n\nQueue name is unique in the scope of sysadmin. Remove 'id', 'tenantId' from the request body example (below) to create new Queue entity. \n\nAvailable for users with 'SYS_ADMIN' authority.", - "operationId": "saveQueue", - "parameters": [ - { - "name": "serviceType", - "in": "query", - "description": "Service type (implemented only for the TB-RULE-ENGINE)", - "required": true, - "schema": { - "type": "string", - "enum": [ - "TB-RULE-ENGINE", - "TB-CORE", - "TB-TRANSPORT", - "JS-EXECUTOR" - ] - } - } + "report-controller" ], + "summary": "Download test report (testReportAndDownload)", + "description": "Generate and download test report.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "testReportAndDownload", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Queue" + "$ref": "#/components/schemas/ReportRequest" } } }, @@ -87452,7 +87090,8 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Queue" + "type": "string", + "format": "binary" } } } @@ -87588,19 +87227,19 @@ ] } }, - "/api/queues/name/{queueName}": { + "/api/v2/report/{reportId}": { "get": { "tags": [ - "queue-controller" + "report-controller" ], - "summary": "Get Queue (getQueueByName)", - "description": "Fetch the Queue object based on the provided Queue name. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getQueueByName", + "summary": "Get Report (getReportById)", + "description": "Fetch the Report object based on the provided report Id. The platform uses Report to store generated reports information.Referencing non-existing Report Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getReportById", "parameters": [ { - "name": "queueName", + "name": "reportId", "in": "path", - "description": "A string value representing the queue id. For example, 'Main'", + "description": "A string value representing the report id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -87613,7 +87252,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Queue" + "$ref": "#/components/schemas/Report" } } } @@ -87747,24 +87386,175 @@ "ApiKeyForm": [] } ] + }, + "delete": { + "tags": [ + "report-controller" + ], + "summary": "Delete Report (deleteReport)", + "description": "Deletes the report. Referencing non-existing Report Id will cause 'Not Found' error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "deleteReport", + "parameters": [ + { + "name": "reportId", + "in": "path", + "description": "A string value representing the report id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-403": { + "summary": "Forbidden", + "value": { + "message": "You don't have permission to perform this operation!", + "errorCode": 20, + "status": 403, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-404": { + "summary": "Not Found", + "value": { + "message": "Requested item wasn't found!", + "errorCode": 32, + "status": 404, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-429": { + "summary": "Too Many Requests", + "value": { + "message": "Too many requests for current tenant!", + "errorCode": 33, + "status": 429, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } + } + } + } + } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/queues/{queueId}": { + "/api/v2/report/{reportId}/download": { "get": { "tags": [ - "queue-controller" + "report-controller" ], - "summary": "Get Queue (getQueueById)", - "description": "Fetch the Queue object based on the provided Queue Id. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getQueueById", + "summary": "downloadReport", + "operationId": "downloadReport", "parameters": [ { - "name": "queueId", + "name": "reportId", "in": "path", - "description": "A string value representing the queue id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], @@ -87774,7 +87564,8 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Queue" + "type": "string", + "format": "binary" } } } @@ -87908,28 +87699,42 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/v2/reportInfos": { + "get": { "tags": [ - "queue-controller" + "report-controller" ], - "summary": "Delete Queue (deleteQueue)", - "description": "Deletes the Queue. \n\nAvailable for users with 'SYS_ADMIN' authority.", - "operationId": "deleteQueue", + "summary": "getReportInfosByIds", + "operationId": "getReportInfosByIds", "parameters": [ { - "name": "queueId", - "in": "path", - "description": "A string value representing the queue id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "strReportIds", + "in": "query", + "description": "A list of report ids, separated by comma ','", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReportInfo" + } + } + } + } }, "400": { "description": "Bad Request", @@ -88062,15 +87867,43 @@ ] } }, - "/api/queueStats": { + "/api/v2/reportInfos/all": { "get": { "tags": [ - "queue-stats-controller" + "report-controller" ], - "summary": "Get Queue Stats entities (getTenantQueueStats)", - "description": "Returns a page of queue stats objects that are designed to collect queue statistics for every service. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getTenantQueueStats", + "summary": "getReportInfos", + "operationId": "getReportInfos", "parameters": [ + { + "name": "reportTemplateId", + "in": "query", + "description": "Report template id", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user used for report generation.", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeCustomers", + "in": "query", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" + } + }, { "name": "pageSize", "in": "query", @@ -88094,7 +87927,7 @@ { "name": "textSearch", "in": "query", - "description": "The case insensitive 'substring' filter based on the queue name or service id.", + "description": "Case-insensitive 'substring' filter based on report's name or customer title", "required": false, "schema": { "type": "string" @@ -88106,10 +87939,7 @@ "description": "Property of entity to sort by", "required": false, "schema": { - "type": "string", - "enum": [ - "createdTime" - ] + "type": "string" } }, { @@ -88118,11 +87948,7 @@ "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "string" } } ], @@ -88132,7 +87958,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataQueueStats" + "$ref": "#/components/schemas/PageDataReportInfo" } } } @@ -88268,187 +88094,57 @@ ] } }, - "/api/queueStats/list": { + "/api/v2/reports": { "get": { "tags": [ - "queue-stats-controller" + "report-controller" ], - "summary": "Get QueueStats By Ids (getQueueStatsByIds)", - "description": "Fetch the Queue stats objects based on the provided ids. ", - "operationId": "getQueueStatsByIds", + "summary": "getReports", + "operationId": "getReports", "parameters": [ { - "name": "queueStatsIds", + "name": "pageSize", "in": "query", - "description": "A list of queue stats ids, separated by comma ','", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueueStats" - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + "type": "integer", + "format": "int32" } }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on report's name or customer title", + "required": false, + "schema": { + "type": "string" } }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ { - "HttpLoginForm": [] + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } }, { - "ApiKeyForm": [] - } - ] - } - }, - "/api/queueStats/{queueStatsId}": { - "get": { - "tags": [ - "queue-stats-controller" - ], - "summary": "Get Queue stats entity by id (getQueueStatsById)", - "description": "Fetch the Queue stats object based on the provided Queue stats id. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getQueueStatsById", - "parameters": [ - { - "name": "queueStatsId", - "in": "path", - "description": "A string value representing the queue stats id. For example, '687f294c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, "schema": { "type": "string" } @@ -88460,7 +88156,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/QueueStats" + "$ref": "#/components/schemas/PageDataReport" } } } @@ -88596,34 +88292,23 @@ ] } }, - "/api/v2/report": { + "/api/reportTemplate": { "post": { "tags": [ - "report-controller" + "report-template-controller" ], - "summary": "createReport", - "operationId": "createReport", + "summary": "Save Report Template (saveReportTemplate)", + "description": "Creates or Updates report template. Report Template extends Report Template Info object and adds 'configuration' - a JSON structure of report template configuration. See the 'Model' tab of the Response Class for more details. When creating report template, platform generates report template Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created report template id will be present in the response. Specify existing report template id to update the report template. Referencing non-existing report template Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Report Template entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "saveReportTemplate", "requestBody": { "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "format": "binary" - }, - "info": { - "type": "string" - } - }, - "required": [ - "file", - "info" - ] + "$ref": "#/components/schemas/ReportTemplate" } } - } + }, + "required": true }, "responses": { "200": { @@ -88631,7 +88316,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Report" + "$ref": "#/components/schemas/ReportTemplate" } } } @@ -88767,30 +88452,32 @@ ] } }, - "/api/v2/report/request": { - "post": { + "/api/reportTemplate/info/{reportTemplateId}": { + "get": { "tags": [ - "report-controller" + "report-template-controller" ], - "summary": "requestReport", - "operationId": "requestReport", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportRequest" - } + "summary": "Get Report Template Info (getReportTemplateInfoById)", + "description": "Fetch the ReportTemplateInfo object based on the provided report template Id. Report Templates allows you to create reports according to the report template configuration. Report service uses report template configuration to generate report. See the 'Model' tab of the Response Class for more details. Referencing non-existing Report Template Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getReportTemplateInfoById", + "parameters": [ + { + "name": "reportTemplateId", + "in": "path", + "description": "A string value representing the report template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Job" + "$ref": "#/components/schemas/ReportTemplateInfo" } } } @@ -88806,7 +88493,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -88926,32 +88613,32 @@ ] } }, - "/api/v2/report/test": { - "post": { + "/api/reportTemplate/{reportTemplateId}": { + "get": { "tags": [ - "report-controller" + "report-template-controller" ], - "summary": "Download test report (testReportAndDownload)", - "description": "Generate and download test report.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "testReportAndDownload", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportRequest" - } + "summary": "Get Report Template (getReportTemplateById)", + "description": "Fetch the ReportTemplate object based on the provided report template Id. Report Template extends Report Template Info object and adds 'configuration' - a JSON structure of report template configuration. See the 'Model' tab of the Response Class for more details. Referencing non-existing Report Template Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getReportTemplateById", + "parameters": [ + { + "name": "reportTemplateId", + "in": "path", + "description": "A string value representing the report template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/ReportTemplate" } } } @@ -88967,7 +88654,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -89085,21 +88772,19 @@ "ApiKeyForm": [] } ] - } - }, - "/api/v2/report/{reportId}": { - "get": { + }, + "delete": { "tags": [ - "report-controller" + "report-template-controller" ], - "summary": "Get Report (getReportById)", - "description": "Fetch the Report object based on the provided report Id. The platform uses Report to store generated reports information.Referencing non-existing Report Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getReportById", + "summary": "Delete Report Template (deleteReportTemplate)", + "description": "Deletes the report template. Referencing non-existing Report Template Id will cause 'Not Found' error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "deleteReportTemplate", "parameters": [ { - "name": "reportId", + "name": "reportTemplateId", "in": "path", - "description": "A string value representing the report id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the report template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -89108,14 +88793,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Report" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -89246,175 +88924,112 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/reportTemplateInfos/all": { + "get": { "tags": [ - "report-controller" + "report-template-controller" ], - "summary": "Delete Report (deleteReport)", - "description": "Deletes the report. Referencing non-existing Report Id will cause 'Not Found' error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "deleteReport", + "summary": "Get All Report Templates for current user (getAllReportTemplateInfos)", + "description": "Returns a page of report template info objects owned by the tenant or the customer of a current user. Report Templates allows you to create reports according to the report template configuration. Report service uses report template configuration to generate report. See the 'Model' tab of the Response Class for more details. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getAllReportTemplateInfos", "parameters": [ { - "name": "reportId", - "in": "path", - "description": "A string value representing the report id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "typeList", + "in": "query", + "description": "A list of string values separated by comma ',' representing one of the ReportTemplateType enumeration value.", + "required": false, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } + "type": "array", + "items": { + "type": "string", + "enum": [ + "REPORT", + "SUB_REPORT" + ] } } }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } + { + "name": "formatList", + "in": "query", + "description": "A list of string values separated by comma ',' representing one of the TbReportFormat enumeration value.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "PDF", + "CSV" + ] } } }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "includeCustomers", + "in": "query", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" } }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } - } - }, - "security": [ + }, { - "HttpLoginForm": [] + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the report template name or customer title.", + "required": false, + "schema": { + "type": "string" + } }, { - "ApiKeyForm": [] - } - ] - } - }, - "/api/v2/report/{reportId}/download": { - "get": { - "tags": [ - "report-controller" - ], - "summary": "downloadReport", - "operationId": "downloadReport", - "parameters": [ + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "ownerName" + ] + } + }, { - "name": "reportId", - "in": "path", - "required": true, + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -89424,8 +89039,7 @@ "content": { "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/PageDataReportTemplateInfo" } } } @@ -89561,18 +89175,19 @@ ] } }, - "/api/v2/reportInfos": { + "/api/reportTemplates": { "get": { "tags": [ - "report-controller" + "report-template-controller" ], - "summary": "getReportInfosByIds", - "operationId": "getReportInfosByIds", + "summary": "Get report templates by Report Template Ids (getReportTemplatesByIds)", + "description": "Returns a list of ReportTemplateInfo objects based on the provided ids. Filters the list based on the user permissions. \n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getReportTemplatesByIds", "parameters": [ { - "name": "strReportIds", + "name": "reportTemplateIds", "in": "query", - "description": "A list of report ids, separated by comma ','", + "description": "A list of report template ids, separated by comma ','", "required": true, "schema": { "type": "array", @@ -89590,7 +89205,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/ReportInfo" + "$ref": "#/components/schemas/ReportTemplateInfo" } } } @@ -89727,98 +89342,31 @@ ] } }, - "/api/v2/reportInfos/all": { - "get": { + "/api/role": { + "post": { "tags": [ - "report-controller" + "role-controller" ], - "summary": "getReportInfos", - "operationId": "getReportInfos", - "parameters": [ - { - "name": "reportTemplateId", - "in": "query", - "description": "Report template id", - "required": false, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "userId", - "in": "query", - "description": "The user used for report generation.", - "required": false, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "includeCustomers", - "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on report's name or customer title", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" + "summary": "Create Or Update Role (saveRole)", + "description": "Creates or Updates the Role. When creating Role, platform generates Role Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Role id will be present in the response. Specify existing Role id to update the permission. Referencing non-existing Group Permission Id will cause 'Not Found' error.\n\nRole Contains a set of permissions. Role has two types. Generic Role may be assigned to the user group and will provide permissions for all entities of a certain type. Group Role may be assigned to both user and entity group and will provides permissions only for the entities that belong to specified entity group. The assignment of the Role to the User Group is done using [Group Permission Controller](/swagger-ui.html#/group-permission-controller).\n\nExample of Generic Role with read-only permissions for any resource and all permissions for the 'DEVICE' and 'PROFILE' resources is listed below: \n\n```json\n{\n \"name\": \"Read-Only User\",\n \"type\": \"GENERIC\",\n \"permissions\": {\n \"ALL\": [\n \"READ\",\n \"RPC_CALL\",\n \"READ_CREDENTIALS\",\n \"READ_ATTRIBUTES\",\n \"READ_TELEMETRY\"\n ],\n \"DEVICE\": [\n \"ALL\"\n ]\n \"PROFILE\": [\n \"ALL\"\n ]\n },\n \"additionalInfo\": {\n \"description\": \"Read-only permissions for everything, Write permissions for devices and own profile.\"\n }\n}\n```\n\nExample of Group Role with read-only permissions. Note that the group role has no association with the resources. The type of the resource is taken from the entity group that this role is assigned to: \n\n```json\n{\n \"name\": \"Entity Group Read-only User\",\n \"type\": \"GROUP\",\n \"permissions\": [\n \"READ\",\n \"RPC_CALL\",\n \"READ_CREDENTIALS\",\n \"READ_ATTRIBUTES\",\n \"READ_TELEMETRY\"\n ],\n \"additionalInfo\": {\n \"description\": \"Read-only permissions.\"\n }\n}\n```\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "saveRole", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Role" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataReportInfo" + "$ref": "#/components/schemas/Role" } } } @@ -89834,7 +89382,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -89954,57 +89502,20 @@ ] } }, - "/api/v2/reports": { + "/api/role/{roleId}": { "get": { "tags": [ - "report-controller" + "role-controller" ], - "summary": "getReports", - "operationId": "getReports", + "summary": "Get Role by Id (getRoleById)", + "description": "Fetch the Role object based on the provided Role Id. Role Contains a set of permissions. Role has two types. Generic Role may be assigned to the user group and will provide permissions for all entities of a certain type. Group Role may be assigned to both user and entity group and will provides permissions only for the entities that belong to specified entity group. The assignment of the Role to the User Group is done using [Group Permission Controller](/swagger-ui.html#/group-permission-controller). Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getRoleById", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "roleId", + "in": "path", + "description": "A string value representing the role id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on report's name or customer title", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, "schema": { "type": "string" } @@ -90016,7 +89527,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataReport" + "$ref": "#/components/schemas/Role" } } } @@ -90150,36 +89661,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/reportTemplate": { - "post": { + }, + "delete": { "tags": [ - "report-template-controller" + "role-controller" ], - "summary": "Save Report Template (saveReportTemplate)", - "description": "Creates or Updates report template. Report Template extends Report Template Info object and adds 'configuration' - a JSON structure of report template configuration. See the 'Model' tab of the Response Class for more details. When creating report template, platform generates report template Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created report template id will be present in the response. Specify existing report template id to update the report template. Referencing non-existing report template Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Report Template entity. \n\nAvailable for users with 'TENANT_ADMIN' authority.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "saveReportTemplate", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportTemplate" - } + "summary": "Delete role (deleteRole)", + "description": "Deletes the role. Referencing non-existing role Id will cause an error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "deleteRole", + "parameters": [ + { + "name": "roleId", + "in": "path", + "description": "A string value representing the role id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportTemplate" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -90192,7 +89695,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -90312,23 +89815,84 @@ ] } }, - "/api/reportTemplate/info/{reportTemplateId}": { + "/api/roles": { "get": { "tags": [ - "report-template-controller" + "role-controller" ], - "summary": "Get Report Template Info (getReportTemplateInfoById)", - "description": "Fetch the ReportTemplateInfo object based on the provided report template Id. Report Templates allows you to create reports according to the report template configuration. Report service uses report template configuration to generate report. See the 'Model' tab of the Response Class for more details. Referencing non-existing Report Template Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getReportTemplateInfoById", + "summary": "Get Roles (getRoles)", + "description": "Returns a page of roles that are available for the current user. Role Contains a set of permissions. Role has two types. Generic Role may be assigned to the user group and will provide permissions for all entities of a certain type. Group Role may be assigned to both user and entity group and will provides permissions only for the entities that belong to specified entity group. The assignment of the Role to the User Group is done using [Group Permission Controller](/swagger-ui.html#/group-permission-controller).You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getRoles", "parameters": [ { - "name": "reportTemplateId", - "in": "path", - "description": "A string value representing the report template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "string", + "minimum": 1 + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "type", + "in": "query", + "description": "Type of the role", + "required": false, + "schema": { + "type": "string", + "enum": [ + "GENERIC", + "GROUP" + ] + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the role name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "type", + "description" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -90337,7 +89901,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReportTemplateInfo" + "$ref": "#/components/schemas/PageDataRole" } } } @@ -90473,22 +90037,25 @@ ] } }, - "/api/reportTemplate/{reportTemplateId}": { + "/api/roles/list": { "get": { "tags": [ - "report-template-controller" + "role-controller" ], - "summary": "Get Report Template (getReportTemplateById)", - "description": "Fetch the ReportTemplate object based on the provided report template Id. Report Template extends Report Template Info object and adds 'configuration' - a JSON structure of report template configuration. See the 'Model' tab of the Response Class for more details. Referencing non-existing Report Template Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getReportTemplateById", + "summary": "Get Roles By Ids (getRolesByIds)", + "description": "Returns the list of rows based on their ids. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getRolesByIds", "parameters": [ { - "name": "reportTemplateId", - "in": "path", - "description": "A string value representing the report template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "roleIds", + "in": "query", + "description": "A list of role ids, separated by comma ','", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -90498,7 +90065,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ReportTemplate" + "type": "array", + "items": { + "$ref": "#/components/schemas/Role" + } } } } @@ -90632,28 +90202,48 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/plugins/rpc/oneway/{deviceId}": { + "post": { "tags": [ - "report-template-controller" + "rpc-v-1-controller" ], - "summary": "Delete Report Template (deleteReportTemplate)", - "description": "Deletes the report template. Referencing non-existing Report Template Id will cause 'Not Found' error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "deleteReportTemplate", + "summary": "Send one-way RPC request (handleOneWayDeviceRPCRequestV1)", + "description": "Deprecated. See 'Rpc V 2 Controller' instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "handleOneWayDeviceRPCRequestV1", "parameters": [ { - "name": "reportTemplateId", + "name": "deviceId", "in": "path", - "description": "A string value representing the report template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "A JSON value representing the RPC request." + } + } + }, + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } }, "400": { "description": "Bad Request", @@ -90666,7 +90256,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -90786,120 +90376,43 @@ ] } }, - "/api/reportTemplateInfos/all": { - "get": { + "/api/plugins/rpc/twoway/{deviceId}": { + "post": { "tags": [ - "report-template-controller" + "rpc-v-1-controller" ], - "summary": "Get All Report Templates for current user (getAllReportTemplateInfos)", - "description": "Returns a page of report template info objects owned by the tenant or the customer of a current user. Report Templates allows you to create reports according to the report template configuration. Report service uses report template configuration to generate report. See the 'Model' tab of the Response Class for more details. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getAllReportTemplateInfos", + "summary": "Send two-way RPC request (handleTwoWayDeviceRPCRequestV1)", + "description": "Deprecated. See 'Rpc V 2 Controller' instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "handleTwoWayDeviceRPCRequestV1", "parameters": [ { - "name": "typeList", - "in": "query", - "description": "A list of string values separated by comma ',' representing one of the ReportTemplateType enumeration value.", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "REPORT", - "SUB_REPORT" - ] - } - } - }, - { - "name": "formatList", - "in": "query", - "description": "A list of string values separated by comma ',' representing one of the TbReportFormat enumeration value.", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "PDF", - "CSV" - ] - } - } - }, - { - "name": "includeCustomers", - "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "deviceId", + "in": "path", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the report template name or customer title.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "ownerName" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "A JSON value representing the RPC request." + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataReportTemplateInfo" + "type": "string" } } } @@ -90915,7 +90428,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -91035,86 +90548,83 @@ ] } }, - "/api/reportTemplates": { - "get": { + "/api/rpc/oneway/{deviceId}": { + "post": { "tags": [ - "report-template-controller" + "rpc-v-2-controller" ], - "summary": "Get report templates by Report Template Ids (getReportTemplatesByIds)", - "description": "Returns a list of ReportTemplateInfo objects based on the provided ids. Filters the list based on the user permissions. \n\nAvailable for users with 'TENANT_ADMIN' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getReportTemplatesByIds", + "summary": "Send one-way RPC request (handleOneWayDeviceRPCRequestV2)", + "description": "Sends the one-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. \n\n```json\n{\n \"method\": \"setGpio\",\n \"params\": {\n \"pin\": 7,\n \"value\": 1\n },\n \"persistent\": false,\n \"timeout\": 5000\n}\n```\n\n### Server-side RPC structure\n\nThe body of server-side RPC request consists of multiple fields:\n\n* **method** - mandatory, name of the method to distinct the RPC calls.\n For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string.\n* **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed.\n* **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds).\n* **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present.\n* **persistent** - optional, indicates persistent RPC. The default value is \"false\".\n* **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side.\n* **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events.\n\n### RPC Result\nIn case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is either 200 OK if the message was sent to device, or 504 Gateway Timeout if device is offline.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "handleOneWayDeviceRPCRequestV2", "parameters": [ { - "name": "reportTemplateIds", - "in": "query", - "description": "A list of report template ids, separated by comma ','", + "name": "deviceId", + "in": "path", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "A JSON value representing the RPC request." + } + } + }, + "required": true + }, "responses": { "200": { - "description": "OK", + "description": "Persistent RPC request was saved to the database or lightweight RPC request was sent to the device.", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReportTemplateInfo" - } + "type": "string" } } } }, "400": { - "description": "Bad Request", + "description": "Invalid structure of the request.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } + "type": "string" } } } }, "401": { - "description": "Unauthorized", + "description": "User is not authorized to send the RPC request. Most likely, User belongs to different Customer or Tenant.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } + "type": "string" + } + } + } + }, + "413": { + "description": "Request payload is too large", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "504": { + "description": "Timeout to process the RPC call. Most likely, device is offline.", + "content": { + "application/json": { + "schema": { + "type": "string" } } } @@ -91202,31 +90712,107 @@ ] } }, - "/api/role": { - "post": { + "/api/rpc/persistent/device/{deviceId}": { + "get": { "tags": [ - "role-controller" + "rpc-v-2-controller" ], - "summary": "Create Or Update Role (saveRole)", - "description": "Creates or Updates the Role. When creating Role, platform generates Role Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Role id will be present in the response. Specify existing Role id to update the permission. Referencing non-existing Group Permission Id will cause 'Not Found' error.\n\nRole Contains a set of permissions. Role has two types. Generic Role may be assigned to the user group and will provide permissions for all entities of a certain type. Group Role may be assigned to both user and entity group and will provides permissions only for the entities that belong to specified entity group. The assignment of the Role to the User Group is done using [Group Permission Controller](/swagger-ui.html#/group-permission-controller).\n\nExample of Generic Role with read-only permissions for any resource and all permissions for the 'DEVICE' and 'PROFILE' resources is listed below: \n\n```json\n{\n \"name\": \"Read-Only User\",\n \"type\": \"GENERIC\",\n \"permissions\": {\n \"ALL\": [\n \"READ\",\n \"RPC_CALL\",\n \"READ_CREDENTIALS\",\n \"READ_ATTRIBUTES\",\n \"READ_TELEMETRY\"\n ],\n \"DEVICE\": [\n \"ALL\"\n ]\n \"PROFILE\": [\n \"ALL\"\n ]\n },\n \"additionalInfo\": {\n \"description\": \"Read-only permissions for everything, Write permissions for devices and own profile.\"\n }\n}\n```\n\nExample of Group Role with read-only permissions. Note that the group role has no association with the resources. The type of the resource is taken from the entity group that this role is assigned to: \n\n```json\n{\n \"name\": \"Entity Group Read-only User\",\n \"type\": \"GROUP\",\n \"permissions\": [\n \"READ\",\n \"RPC_CALL\",\n \"READ_CREDENTIALS\",\n \"READ_ATTRIBUTES\",\n \"READ_TELEMETRY\"\n ],\n \"additionalInfo\": {\n \"description\": \"Read-only permissions.\"\n }\n}\n```\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "saveRole", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Role" - } + "summary": "Get persistent RPC requests", + "description": "Allows to query RPC calls for specific device using pagination.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getPersistedRpcByDevice", + "parameters": [ + { + "name": "deviceId", + "in": "path", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "rpcStatus", + "in": "query", + "description": "Status of the RPC", + "required": false, + "schema": { + "type": "string", + "enum": [ + "QUEUED", + "SENT", + "DELIVERED", + "SUCCESSFUL", + "TIMEOUT", + "EXPIRED", + "FAILED" + ] + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Not implemented. Leave empty.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "expirationTime", + "request", + "response" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Role" + "type": "string" } } } @@ -91242,7 +90828,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -91362,19 +90948,19 @@ ] } }, - "/api/role/{roleId}": { + "/api/rpc/persistent/{rpcId}": { "get": { "tags": [ - "role-controller" + "rpc-v-2-controller" ], - "summary": "Get Role by Id (getRoleById)", - "description": "Fetch the Role object based on the provided Role Id. Role Contains a set of permissions. Role has two types. Generic Role may be assigned to the user group and will provide permissions for all entities of a certain type. Group Role may be assigned to both user and entity group and will provides permissions only for the entities that belong to specified entity group. The assignment of the Role to the User Group is done using [Group Permission Controller](/swagger-ui.html#/group-permission-controller). Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getRoleById", + "summary": "Get persistent RPC request", + "description": "Get information about the status of the RPC call.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "getPersistedRpc", "parameters": [ { - "name": "roleId", + "name": "rpcId", "in": "path", - "description": "A string value representing the role id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the rpc id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -91387,7 +90973,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Role" + "$ref": "#/components/schemas/Rpc" } } } @@ -91524,16 +91110,16 @@ }, "delete": { "tags": [ - "role-controller" + "rpc-v-2-controller" ], - "summary": "Delete role (deleteRole)", - "description": "Deletes the role. Referencing non-existing role Id will cause an error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "deleteRole", + "summary": "Delete persistent RPC", + "description": "Deletes the persistent RPC request.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteRpc", "parameters": [ { - "name": "roleId", + "name": "rpcId", "in": "path", - "description": "A string value representing the role id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the rpc id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -91675,141 +91261,83 @@ ] } }, - "/api/roles": { - "get": { + "/api/rpc/twoway/{deviceId}": { + "post": { "tags": [ - "role-controller" + "rpc-v-2-controller" ], - "summary": "Get Roles (getRoles)", - "description": "Returns a page of roles that are available for the current user. Role Contains a set of permissions. Role has two types. Generic Role may be assigned to the user group and will provide permissions for all entities of a certain type. Group Role may be assigned to both user and entity group and will provides permissions only for the entities that belong to specified entity group. The assignment of the Role to the User Group is done using [Group Permission Controller](/swagger-ui.html#/group-permission-controller).You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getRoles", + "summary": "Send two-way RPC request (handleTwoWayDeviceRPCRequestV2)", + "description": "Sends the two-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. \n\n```json\n{\n \"method\": \"setGpio\",\n \"params\": {\n \"pin\": 7,\n \"value\": 1\n },\n \"persistent\": false,\n \"timeout\": 5000\n}\n```\n\n### Server-side RPC structure\n\nThe body of server-side RPC request consists of multiple fields:\n\n* **method** - mandatory, name of the method to distinct the RPC calls.\n For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string.\n* **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed.\n* **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds).\n* **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present.\n* **persistent** - optional, indicates persistent RPC. The default value is \"false\".\n* **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side.\n* **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events.\n\n### RPC Result\nIn case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is the response from device, or 504 Gateway Timeout if device is offline.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "handleTwoWayDeviceRPCRequestV2", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "deviceId", + "in": "path", + "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "type", - "in": "query", - "description": "Type of the role", - "required": false, - "schema": { - "type": "string", - "enum": [ - "GENERIC", - "GROUP" - ] - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the role name.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "type", - "description" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "A JSON value representing the RPC request." + } + } + }, + "required": true + }, "responses": { "200": { - "description": "OK", + "description": "Persistent RPC request was saved to the database or lightweight RPC response received.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataRole" + "type": "string" } } } }, "400": { - "description": "Bad Request", + "description": "Invalid structure of the request.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } + "type": "string" } } } }, "401": { - "description": "Unauthorized", + "description": "User is not authorized to send the RPC request. Most likely, User belongs to different Customer or Tenant.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } + "type": "string" + } + } + } + }, + "413": { + "description": "Request payload is too large", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "504": { + "description": "Timeout to process the RPC call. Most likely, device is offline.", + "content": { + "application/json": { + "schema": { + "type": "string" } } } @@ -91897,25 +91425,29 @@ ] } }, - "/api/roles/list": { - "get": { + "/api/edge/{edgeId}/ruleChain/{ruleChainId}": { + "post": { "tags": [ - "role-controller" + "rule-chain-controller" ], - "summary": "Get Roles By Ids (getRolesByIds)", - "description": "Returns the list of rows based on their ids. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getRolesByIds", + "summary": "Assign rule chain to edge (assignRuleChainToEdge)", + "description": "Creates assignment of an existing rule chain to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment rule chain (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once rule chain will be delivered to edge service, it's going to start processing messages locally. \n\nOnly rule chain with type 'EDGE' can be assigned to edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "assignRuleChainToEdge", "parameters": [ { - "name": "roleIds", - "in": "query", - "description": "A list of role ids, separated by comma ','", + "name": "edgeId", + "in": "path", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" + } + }, + { + "name": "ruleChainId", + "in": "path", + "required": true, + "schema": { + "type": "string" } } ], @@ -91925,10 +91457,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Role" - } + "$ref": "#/components/schemas/RuleChain" } } } @@ -91944,7 +91473,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -92062,45 +91591,39 @@ "ApiKeyForm": [] } ] - } - }, - "/api/plugins/rpc/oneway/{deviceId}": { - "post": { + }, + "delete": { "tags": [ - "rpc-v-1-controller" + "rule-chain-controller" ], - "summary": "Send one-way RPC request (handleOneWayDeviceRPCRequestV1)", - "description": "Deprecated. See 'Rpc V 2 Controller' instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "handleOneWayDeviceRPCRequestV1", + "summary": "Unassign rule chain from edge (unassignRuleChainFromEdge)", + "description": "Clears assignment of the rule chain to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove rule chain (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove rule chain locally.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "unassignRuleChainFromEdge", "parameters": [ { - "name": "deviceId", + "name": "edgeId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "ruleChainId", "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/RuleChain" } } } @@ -92116,7 +91639,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -92236,43 +91759,88 @@ ] } }, - "/api/plugins/rpc/twoway/{deviceId}": { - "post": { + "/api/edge/{edgeId}/ruleChains": { + "get": { "tags": [ - "rpc-v-1-controller" + "rule-chain-controller" ], - "summary": "Send two-way RPC request (handleTwoWayDeviceRPCRequestV1)", - "description": "Deprecated. See 'Rpc V 2 Controller' instead.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "handleTwoWayDeviceRPCRequestV1", + "summary": "Get Edge Rule Chains (getEdgeRuleChains)", + "description": "Returns a page of Rule Chains assigned to the specified edge. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getEdgeRuleChains", "parameters": [ { - "name": "deviceId", + "name": "edgeId", "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." - } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the rule chain name.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "root" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/PageDataRuleChain" } } } @@ -92288,7 +91856,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -92408,31 +91976,19 @@ ] } }, - "/api/rpc/oneway/{deviceId}": { + "/api/ruleChain": { "post": { "tags": [ - "rpc-v-2-controller" - ], - "summary": "Send one-way RPC request (handleOneWayDeviceRPCRequestV2)", - "description": "Sends the one-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. \n\n```json\n{\n \"method\": \"setGpio\",\n \"params\": {\n \"pin\": 7,\n \"value\": 1\n },\n \"persistent\": false,\n \"timeout\": 5000\n}\n```\n\n### Server-side RPC structure\n\nThe body of server-side RPC request consists of multiple fields:\n\n* **method** - mandatory, name of the method to distinct the RPC calls.\n For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string.\n* **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed.\n* **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds).\n* **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present.\n* **persistent** - optional, indicates persistent RPC. The default value is \"false\".\n* **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side.\n* **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events.\n\n### RPC Result\nIn case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is either 200 OK if the message was sent to device, or 504 Gateway Timeout if device is offline.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "handleOneWayDeviceRPCRequestV2", - "parameters": [ - { - "name": "deviceId", - "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } + "rule-chain-controller" ], + "summary": "Create Or Update Rule Chain (saveRuleChain)", + "description": "Create or update the Rule Chain. When creating Rule Chain, platform generates Rule Chain Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Rule Chain Id will be present in the response. Specify existing Rule Chain id to update the rule chain. Referencing non-existing rule chain Id will cause 'Not Found' error.\n\nThe rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.Remove 'id', 'tenantId' from the request body example (below) to create new Rule Chain entity.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveRuleChain", "requestBody": { "content": { "application/json": { "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." + "$ref": "#/components/schemas/RuleChain" } } }, @@ -92440,51 +91996,59 @@ }, "responses": { "200": { - "description": "Persistent RPC request was saved to the database or lightweight RPC request was sent to the device.", + "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/RuleChain" } } } }, "400": { - "description": "Invalid structure of the request.", + "description": "Bad Request", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid request body", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } } } } }, "401": { - "description": "User is not authorized to send the RPC request. Most likely, User belongs to different Customer or Tenant.", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "413": { - "description": "Request payload is too large", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "504": { - "description": "Timeout to process the RPC call. Most likely, device is offline.", + "description": "Unauthorized", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } } } } @@ -92572,107 +92136,24 @@ ] } }, - "/api/rpc/persistent/device/{deviceId}": { + "/api/ruleChain/autoAssignToEdgeRuleChains": { "get": { "tags": [ - "rpc-v-2-controller" - ], - "summary": "Get persistent RPC requests", - "description": "Allows to query RPC calls for specific device using pagination.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getPersistedRpcByDevice", - "parameters": [ - { - "name": "deviceId", - "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "rpcStatus", - "in": "query", - "description": "Status of the RPC", - "required": false, - "schema": { - "type": "string", - "enum": [ - "QUEUED", - "SENT", - "DELIVERED", - "SUCCESSFUL", - "TIMEOUT", - "EXPIRED", - "FAILED" - ] - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Not implemented. Leave empty.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "expirationTime", - "request", - "response" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } + "rule-chain-controller" ], + "summary": "Get Auto Assign To Edge Rule Chains (getAutoAssignToEdgeRuleChains)", + "description": "Returns a list of Rule Chains that will be assigned to a newly created edge. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getAutoAssignToEdgeRuleChains", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "type": "array", + "items": { + "$ref": "#/components/schemas/RuleChain" + } } } } @@ -92808,32 +92289,31 @@ ] } }, - "/api/rpc/persistent/{rpcId}": { - "get": { + "/api/ruleChain/device/default": { + "post": { "tags": [ - "rpc-v-2-controller" + "rule-chain-controller" ], - "summary": "Get persistent RPC request", - "description": "Get information about the status of the RPC call.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "getPersistedRpc", - "parameters": [ - { - "name": "rpcId", - "in": "path", - "description": "A string value representing the rpc id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Create Default Rule Chain (setDeviceDefaultRuleChain)", + "description": "Create rule chain from template, based on the specified name in the request. Creates the rule chain based on the template that is used to create root rule chain. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "setDeviceDefaultRuleChain", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultRuleChainCreateRequest" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Rpc" + "$ref": "#/components/schemas/RuleChain" } } } @@ -92849,7 +92329,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -92967,28 +92447,48 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/ruleChain/metadata": { + "post": { "tags": [ - "rpc-v-2-controller" + "rule-chain-controller" ], - "summary": "Delete persistent RPC", - "description": "Deletes the persistent RPC request.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteRpc", + "summary": "Update Rule Chain Metadata", + "description": "Updates the rule chain metadata. The metadata object contains information about the rule nodes and their connections.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "saveRuleChainMetaData", "parameters": [ { - "name": "rpcId", - "in": "path", - "description": "A string value representing the rpc id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "updateRelated", + "in": "query", + "description": "Update related rule nodes.", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": true } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuleChainMetaData" + } + } + }, + "required": true + }, "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuleChainMetaData" + } + } + } }, "400": { "description": "Bad Request", @@ -93001,7 +92501,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -93121,83 +92621,69 @@ ] } }, - "/api/rpc/twoway/{deviceId}": { - "post": { + "/api/ruleChain/tbelEnabled": { + "get": { "tags": [ - "rpc-v-2-controller" - ], - "summary": "Send two-way RPC request (handleTwoWayDeviceRPCRequestV2)", - "description": "Sends the two-way remote-procedure call (RPC) request to device. Sends the one-way remote-procedure call (RPC) request to device. The RPC call is A JSON that contains the method name ('method'), parameters ('params') and multiple optional fields. See example below. We will review the properties of the RPC call one-by-one below. \n\n```json\n{\n \"method\": \"setGpio\",\n \"params\": {\n \"pin\": 7,\n \"value\": 1\n },\n \"persistent\": false,\n \"timeout\": 5000\n}\n```\n\n### Server-side RPC structure\n\nThe body of server-side RPC request consists of multiple fields:\n\n* **method** - mandatory, name of the method to distinct the RPC calls.\n For example, \"getCurrentTime\" or \"getWeatherForecast\". The value of the parameter is a string.\n* **params** - mandatory, parameters used for processing of the request. The value is a JSON. Leave empty JSON \"{}\" if no parameters needed.\n* **timeout** - optional, value of the processing timeout in milliseconds. The default value is 10000 (10 seconds). The minimum value is 5000 (5 seconds).\n* **expirationTime** - optional, value of the epoch time (in milliseconds, UTC timezone). Overrides **timeout** if present.\n* **persistent** - optional, indicates persistent RPC. The default value is \"false\".\n* **retries** - optional, defines how many times persistent RPC will be re-sent in case of failures on the network and/or device side.\n* **additionalInfo** - optional, defines metadata for the persistent RPC that will be added to the persistent RPC events.\n\n### RPC Result\nIn case of persistent RPC, the result of this call is 'rpcId' UUID. In case of lightweight RPC, the result of this call is the response from device, or 504 Gateway Timeout if device is offline.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "handleTwoWayDeviceRPCRequestV2", - "parameters": [ - { - "name": "deviceId", - "in": "path", - "description": "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } + "rule-chain-controller" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "A JSON value representing the RPC request." - } - } - }, - "required": true - }, + "summary": "Is TBEL script executor enabled", + "description": "Returns 'True' if the TBEL script execution is enabled\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "isTbelEnabled", "responses": { "200": { - "description": "Persistent RPC request was saved to the database or lightweight RPC response received.", + "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "type": "boolean" } } } }, "400": { - "description": "Invalid structure of the request.", + "description": "Bad Request", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-400": { + "summary": "Bad Request", + "value": { + "message": "Invalid UUID string: 123", + "errorCode": 31, + "status": 400, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } } } } }, "401": { - "description": "User is not authorized to send the RPC request. Most likely, User belongs to different Customer or Tenant.", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "413": { - "description": "Request payload is too large", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "504": { - "description": "Timeout to process the RPC call. Most likely, device is offline.", + "description": "Unauthorized", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ThingsboardErrorResponse" + }, + "examples": { + "error-code-401": { + "summary": "Unauthorized", + "value": { + "message": "Authentication failed", + "errorCode": 10, + "status": 401, + "subscriptionErrorCode": null, + "subscriptionEntry": null, + "subscriptionValue": null, + "timestamp": 1609459200000 + } + } } } } @@ -93285,39 +92771,43 @@ ] } }, - "/api/edge/{edgeId}/ruleChain/{ruleChainId}": { + "/api/ruleChain/testScript": { "post": { "tags": [ "rule-chain-controller" ], - "summary": "Assign rule chain to edge (assignRuleChainToEdge)", - "description": "Creates assignment of an existing rule chain to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment rule chain (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once rule chain will be delivered to edge service, it's going to start processing messages locally. \n\nOnly rule chain with type 'EDGE' can be assigned to edge.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "assignRuleChainToEdge", + "summary": "Test Script function", + "description": "Execute the Script function and return the result. The format of request: \n\n```json\n{\n \"script\": \"Your Function as String\",\n \"scriptType\": \"One of: update, generate, filter, switch, json, string\",\n \"argNames\": [\"msg\", \"metadata\", \"type\"],\n \"msg\": \"{\\\"temperature\\\": 42}\", \n \"metadata\": {\n \"deviceName\": \"Device A\",\n \"deviceType\": \"Thermometer\"\n },\n \"msgType\": \"POST_TELEMETRY_REQUEST\"\n}\n```\n\n Expected result JSON contains \"output\" and \"error\".\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "testRuleChainScript", "parameters": [ { - "name": "edgeId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "ruleChainId", - "in": "path", - "required": true, + "name": "scriptLang", + "in": "query", + "description": "Script language: JS or TBEL", + "required": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/ScriptLanguage" } } ], + "requestBody": { + "description": "Test JS request. See API call description above.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonNode" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChain" + "$ref": "#/components/schemas/JsonNode" } } } @@ -93451,26 +92941,21 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/ruleChain/{ruleChainId}": { + "get": { "tags": [ "rule-chain-controller" ], - "summary": "Unassign rule chain from edge (unassignRuleChainFromEdge)", - "description": "Clears assignment of the rule chain to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove rule chain (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove rule chain locally.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "unassignRuleChainFromEdge", + "summary": "Get Rule Chain (getRuleChainById)", + "description": "Fetch the Rule Chain object based on the provided Rule Chain Id. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getRuleChainById", "parameters": [ - { - "name": "edgeId", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "ruleChainId", "in": "path", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -93617,93 +93102,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edge/{edgeId}/ruleChains": { - "get": { + }, + "delete": { "tags": [ "rule-chain-controller" ], - "summary": "Get Edge Rule Chains (getEdgeRuleChains)", - "description": "Returns a page of Rule Chains assigned to the specified edge. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getEdgeRuleChains", + "summary": "Delete rule chain (deleteRuleChain)", + "description": "Deletes the rule chain. Referencing non-existing rule chain Id will cause an error. Referencing rule chain that is used in the device profiles will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteRuleChain", "parameters": [ { - "name": "edgeId", + "name": "ruleChainId", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the rule chain name.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "root" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataRuleChain" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -93836,24 +93256,25 @@ ] } }, - "/api/ruleChain": { + "/api/ruleChain/{ruleChainId}/autoAssignToEdge": { "post": { "tags": [ "rule-chain-controller" ], - "summary": "Create Or Update Rule Chain (saveRuleChain)", - "description": "Create or update the Rule Chain. When creating Rule Chain, platform generates Rule Chain Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Rule Chain Id will be present in the response. Specify existing Rule Chain id to update the rule chain. Referencing non-existing rule chain Id will cause 'Not Found' error.\n\nThe rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.Remove 'id', 'tenantId' from the request body example (below) to create new Rule Chain entity.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveRuleChain", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RuleChain" - } + "summary": "Set Auto Assign To Edge Rule Chain (setAutoAssignToEdgeRuleChain)", + "description": "Makes the rule chain to be automatically assigned for any new edge that will be created. Does not assign this rule chain for already created edges. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "setAutoAssignToEdgeRuleChain", + "parameters": [ + { + "name": "ruleChainId", + "in": "path", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", @@ -93994,179 +93415,25 @@ "ApiKeyForm": [] } ] - } - }, - "/api/ruleChain/autoAssignToEdgeRuleChains": { - "get": { + }, + "delete": { "tags": [ "rule-chain-controller" ], - "summary": "Get Auto Assign To Edge Rule Chains (getAutoAssignToEdgeRuleChains)", - "description": "Returns a list of Rule Chains that will be assigned to a newly created edge. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getAutoAssignToEdgeRuleChains", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RuleChain" - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, + "summary": "Unset Auto Assign To Edge Rule Chain (unsetAutoAssignToEdgeRuleChain)", + "description": "Removes the rule chain from the list of rule chains that are going to be automatically assigned for any new edge that will be created. Does not unassign this rule chain for already assigned edges. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "unsetAutoAssignToEdgeRuleChain", + "parameters": [ { - "ApiKeyForm": [] + "name": "ruleChainId", + "in": "path", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } } - ] - } - }, - "/api/ruleChain/device/default": { - "post": { - "tags": [ - "rule-chain-controller" ], - "summary": "Create Default Rule Chain (setDeviceDefaultRuleChain)", - "description": "Create rule chain from template, based on the specified name in the request. Creates the rule chain based on the template that is used to create root rule chain. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "setDeviceDefaultRuleChain", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DefaultRuleChainCreateRequest" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", @@ -94189,7 +93456,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -94309,43 +93576,32 @@ ] } }, - "/api/ruleChain/metadata": { + "/api/ruleChain/{ruleChainId}/edgeTemplateRoot": { "post": { "tags": [ "rule-chain-controller" ], - "summary": "Update Rule Chain Metadata", - "description": "Updates the rule chain metadata. The metadata object contains information about the rule nodes and their connections.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "saveRuleChainMetaData", + "summary": "Set Edge Template Root Rule Chain (setEdgeTemplateRootRuleChain)", + "description": "Makes the rule chain to be root rule chain for any new edge that will be created. Does not update root rule chain for already created edges. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "setEdgeTemplateRootRuleChain", "parameters": [ { - "name": "updateRelated", - "in": "query", - "description": "Update related rule nodes.", - "required": false, + "name": "ruleChainId", + "in": "path", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { - "type": "boolean", - "default": true + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RuleChainMetaData" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChainMetaData" + "$ref": "#/components/schemas/RuleChain" } } } @@ -94481,21 +93737,32 @@ ] } }, - "/api/ruleChain/tbelEnabled": { + "/api/ruleChain/{ruleChainId}/metadata": { "get": { "tags": [ "rule-chain-controller" ], - "summary": "Is TBEL script executor enabled", - "description": "Returns 'True' if the TBEL script execution is enabled\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "isTbelEnabled", + "summary": "Get Rule Chain (getRuleChainById)", + "description": "Fetch the Rule Chain Metadata object based on the provided Rule Chain Id. The metadata object contains information about the rule nodes and their connections.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getRuleChainMetaData", + "parameters": [ + { + "name": "ruleChainId", + "in": "path", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/RuleChainMetaData" } } } @@ -94631,43 +93898,36 @@ ] } }, - "/api/ruleChain/testScript": { - "post": { + "/api/ruleChain/{ruleChainId}/output/labels": { + "get": { "tags": [ "rule-chain-controller" ], - "summary": "Test Script function", - "description": "Execute the Script function and return the result. The format of request: \n\n```json\n{\n \"script\": \"Your Function as String\",\n \"scriptType\": \"One of: update, generate, filter, switch, json, string\",\n \"argNames\": [\"msg\", \"metadata\", \"type\"],\n \"msg\": \"{\\\"temperature\\\": 42}\", \n \"metadata\": {\n \"deviceName\": \"Device A\",\n \"deviceType\": \"Thermometer\"\n },\n \"msgType\": \"POST_TELEMETRY_REQUEST\"\n}\n```\n\n Expected result JSON contains \"output\" and \"error\".\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "testRuleChainScript", + "summary": "Get Rule Chain output labels (getRuleChainOutputLabels)", + "description": "Fetch the unique labels for the \"output\" Rule Nodes that belong to the Rule Chain based on the provided Rule Chain Id. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getRuleChainOutputLabels", "parameters": [ { - "name": "scriptLang", - "in": "query", - "description": "Script language: JS or TBEL", - "required": false, + "name": "ruleChainId", + "in": "path", + "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, "schema": { - "$ref": "#/components/schemas/ScriptLanguage" + "type": "string" } } ], - "requestBody": { - "description": "Test JS request. See API call description above.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JsonNode" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JsonNode" + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true } } } @@ -94683,7 +93943,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -94803,14 +94063,14 @@ ] } }, - "/api/ruleChain/{ruleChainId}": { + "/api/ruleChain/{ruleChainId}/output/labels/usage": { "get": { "tags": [ "rule-chain-controller" ], - "summary": "Get Rule Chain (getRuleChainById)", - "description": "Fetch the Rule Chain object based on the provided Rule Chain Id. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getRuleChainById", + "summary": "Get output labels usage (getRuleChainOutputLabelsUsage)", + "description": "Fetch the list of rule chains and the relation types (labels) they use to process output of the current rule chain based on the provided Rule Chain Id. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getRuleChainOutputLabelsUsage", "parameters": [ { "name": "ruleChainId", @@ -94828,162 +94088,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChain" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } + "type": "array", + "items": { + "$ref": "#/components/schemas/RuleChainOutputLabelsUsage" } } } } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - }, - "delete": { - "tags": [ - "rule-chain-controller" - ], - "summary": "Delete rule chain (deleteRuleChain)", - "description": "Deletes the rule chain. Referencing non-existing rule chain Id will cause an error. Referencing rule chain that is used in the device profiles will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteRuleChain", - "parameters": [ - { - "name": "ruleChainId", - "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK" }, "400": { "description": "Bad Request", @@ -95116,14 +94227,14 @@ ] } }, - "/api/ruleChain/{ruleChainId}/autoAssignToEdge": { + "/api/ruleChain/{ruleChainId}/root": { "post": { "tags": [ "rule-chain-controller" ], - "summary": "Set Auto Assign To Edge Rule Chain (setAutoAssignToEdgeRuleChain)", - "description": "Makes the rule chain to be automatically assigned for any new edge that will be created. Does not assign this rule chain for already created edges. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "setAutoAssignToEdgeRuleChain", + "summary": "Set Root Rule Chain (setRootRuleChain)", + "description": "Makes the rule chain to be root rule chain. Updates previous root rule chain as well. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "setRootRuleChain", "parameters": [ { "name": "ruleChainId", @@ -95275,23 +94386,85 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/ruleChains": { + "get": { "tags": [ "rule-chain-controller" ], - "summary": "Unset Auto Assign To Edge Rule Chain (unsetAutoAssignToEdgeRuleChain)", - "description": "Removes the rule chain from the list of rule chains that are going to be automatically assigned for any new edge that will be created. Does not unassign this rule chain for already assigned edges. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "unsetAutoAssignToEdgeRuleChain", + "summary": "Get Rule Chains (getRuleChains)", + "description": "Returns a page of Rule Chains owned by tenant. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getRuleChains", "parameters": [ { - "name": "ruleChainId", - "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "type", + "in": "query", + "description": "Rule chain type (CORE or EDGE)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "CORE", + "EDGE" + ] + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the rule chain name.", + "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "name", + "root" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { @@ -95300,7 +94473,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChain" + "$ref": "#/components/schemas/PageDataRuleChain" } } } @@ -95436,22 +94609,23 @@ ] } }, - "/api/ruleChain/{ruleChainId}/edgeTemplateRoot": { - "post": { + "/api/ruleChains/export": { + "get": { "tags": [ "rule-chain-controller" ], - "summary": "Set Edge Template Root Rule Chain (setEdgeTemplateRootRuleChain)", - "description": "Makes the rule chain to be root rule chain for any new edge that will be created. Does not update root rule chain for already created edges. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "setEdgeTemplateRootRuleChain", + "summary": "Export Rule Chains", + "description": "Exports all tenant rule chains as one JSON.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "exportRuleChains", "parameters": [ { - "name": "ruleChainId", - "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "limit", + "in": "query", + "description": "A limit of rule chains to export.", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } } ], @@ -95461,7 +94635,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChain" + "$ref": "#/components/schemas/RuleChainData" } } } @@ -95477,7 +94651,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -95597,32 +94771,46 @@ ] } }, - "/api/ruleChain/{ruleChainId}/metadata": { - "get": { + "/api/ruleChains/import": { + "post": { "tags": [ "rule-chain-controller" ], - "summary": "Get Rule Chain (getRuleChainById)", - "description": "Fetch the Rule Chain Metadata object based on the provided Rule Chain Id. The metadata object contains information about the rule nodes and their connections.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getRuleChainMetaData", + "summary": "Import Rule Chains", + "description": "Imports all tenant rule chains as one JSON.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "importRuleChains", "parameters": [ { - "name": "ruleChainId", - "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "overwrite", + "in": "query", + "description": "Enables overwrite for existing rule chains with the same name.", + "required": false, "schema": { - "type": "string" + "type": "boolean", + "default": false } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RuleChainData" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChainMetaData" + "type": "array", + "items": { + "$ref": "#/components/schemas/RuleChainImportResult" + } } } } @@ -95638,7 +94826,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -95758,22 +94946,25 @@ ] } }, - "/api/ruleChain/{ruleChainId}/output/labels": { + "/api/ruleChains/list": { "get": { "tags": [ "rule-chain-controller" ], - "summary": "Get Rule Chain output labels (getRuleChainOutputLabels)", - "description": "Fetch the unique labels for the \"output\" Rule Nodes that belong to the Rule Chain based on the provided Rule Chain Id. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getRuleChainOutputLabels", + "summary": "Get Rule Chains By Ids (getRuleChainsByIds)", + "description": "Requested rule chains must be owned by tenant which is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getRuleChainsByIds", "parameters": [ { - "name": "ruleChainId", - "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "ruleChainIds", + "in": "query", + "description": "A list of rule chain ids, separated by comma ','", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -95785,9 +94976,8 @@ "schema": { "type": "array", "items": { - "type": "string" - }, - "uniqueItems": true + "$ref": "#/components/schemas/RuleChain" + } } } } @@ -95923,19 +95113,19 @@ ] } }, - "/api/ruleChain/{ruleChainId}/output/labels/usage": { + "/api/ruleNode/{ruleNodeId}/debugIn": { "get": { "tags": [ "rule-chain-controller" ], - "summary": "Get output labels usage (getRuleChainOutputLabelsUsage)", - "description": "Fetch the list of rule chains and the relation types (labels) they use to process output of the current rule chain based on the provided Rule Chain Id. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getRuleChainOutputLabelsUsage", + "summary": "Get latest input message (getLatestRuleNodeDebugInput)", + "description": "Gets the input message from the debug events for specified Rule Chain Id. Referencing non-existing rule chain Id will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getLatestRuleNodeDebugInput", "parameters": [ { - "name": "ruleChainId", + "name": "ruleNodeId", "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the rule node id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -95948,10 +95138,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RuleChainOutputLabelsUsage" - } + "$ref": "#/components/schemas/JsonNode" } } } @@ -96087,32 +95274,32 @@ ] } }, - "/api/ruleChain/{ruleChainId}/root": { + "/api/rule-engine/": { "post": { "tags": [ - "rule-chain-controller" + "rule-engine-controller" ], - "summary": "Set Root Rule Chain (setRootRuleChain)", - "description": "Makes the rule chain to be root rule chain. Updates previous root rule chain as well. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "setRootRuleChain", - "parameters": [ - { - "name": "ruleChainId", - "in": "path", - "description": "A string value representing the rule chain id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Push user message to the rule engine (handleRuleEngineRequestForUser)", + "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses current User Id ( the one which credentials is used to perform the request) as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "handleRuleEngineRequestForUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "A JSON value representing the message." + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChain" + "type": "string" } } } @@ -96248,92 +95435,52 @@ ] } }, - "/api/ruleChains": { - "get": { + "/api/rule-engine/{entityType}/{entityId}": { + "post": { "tags": [ - "rule-chain-controller" + "rule-engine-controller" ], - "summary": "Get Rule Chains (getRuleChains)", - "description": "Returns a page of Rule Chains owned by tenant. The rule chain object is lightweight and contains general information about the rule chain. List of rule nodes and their connection is stored in a separate 'metadata' object.You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getRuleChains", + "summary": "Push entity message to the rule engine (handleRuleEngineRequestForEntity)", + "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "handleRuleEngineRequestForEntity", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", "required": true, "schema": { - "type": "integer", - "format": "int32" + "type": "string" } }, { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "type", - "in": "query", - "description": "Rule chain type (CORE or EDGE)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "CORE", - "EDGE" - ] - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the rule chain name.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "name", - "root" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "A JSON value representing the message." + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataRuleChain" + "type": "string" } } } @@ -96349,7 +95496,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -96469,19 +95616,46 @@ ] } }, - "/api/ruleChains/export": { - "get": { + "/api/rule-engine/{entityType}/{entityId}/{queueName}/{timeout}": { + "post": { "tags": [ - "rule-chain-controller" + "rule-engine-controller" ], - "summary": "Export Rule Chains", - "description": "Exports all tenant rule chains as one JSON.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "exportRuleChains", + "summary": "Push entity message with timeout and specified queue to the rule engine (handleRuleEngineRequestForEntityWithQueueAndTimeout)", + "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. If request sent for Device/Device Profile or Asset/Asset Profile entity, specified queue will be used instead of the queue selected in the device or asset profile. The platform expects the timeout value in milliseconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "handleRuleEngineRequestForEntityWithQueueAndTimeout", "parameters": [ { - "name": "limit", - "in": "query", - "description": "A limit of rule chains to export.", + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "queueName", + "in": "path", + "description": "Queue name to process the request in the rule engine", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "path", + "description": "Timeout to process the request in milliseconds", "required": true, "schema": { "type": "integer", @@ -96489,13 +95663,24 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "A JSON value representing the message." + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChainData" + "type": "string" } } } @@ -96511,7 +95696,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -96631,23 +95816,41 @@ ] } }, - "/api/ruleChains/import": { + "/api/rule-engine/{entityType}/{entityId}/{timeout}": { "post": { "tags": [ - "rule-chain-controller" + "rule-engine-controller" ], - "summary": "Import Rule Chains", - "description": "Imports all tenant rule chains as one JSON.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "importRuleChains", + "summary": "Push entity message with timeout to the rule engine (handleRuleEngineRequestForEntityWithTimeout)", + "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The platform expects the timeout value in milliseconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "handleRuleEngineRequestForEntityWithTimeout", "parameters": [ { - "name": "overwrite", - "in": "query", - "description": "Enables overwrite for existing rule chains with the same name.", - "required": false, + "name": "entityType", + "in": "path", + "description": "A string value representing the entity type. For example, 'DEVICE'", + "required": true, "schema": { - "type": "boolean", - "default": false + "type": "string" + } + }, + { + "name": "entityId", + "in": "path", + "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "path", + "description": "Timeout to process the request in milliseconds", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } } ], @@ -96655,7 +95858,8 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RuleChainData" + "type": "string", + "description": "A JSON value representing the message." } } }, @@ -96667,10 +95871,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RuleChainImportResult" - } + "type": "string" } } } @@ -96806,25 +96007,22 @@ ] } }, - "/api/ruleChains/list": { + "/api/edge/{edgeId}/allSchedulerEvents": { "get": { "tags": [ - "rule-chain-controller" + "scheduler-event-controller" ], - "summary": "Get Rule Chains By Ids (getRuleChainsByIds)", - "description": "Requested rule chains must be owned by tenant which is performing the request. \n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getRuleChainsByIds", + "summary": "Get All Edge Scheduler Events (getAllEdgeSchedulerEvents)", + "description": "Fetch the list of Scheduler Event Info objects based on the provided Edge entity. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. Scheduler Events allows you to schedule various types of events with flexible schedule configuration. Scheduler fires configured scheduler events according to their schedule. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getAllEdgeSchedulerEvents", "parameters": [ { - "name": "ruleChainIds", - "in": "query", - "description": "A list of rule chain ids, separated by comma ','", + "name": "edgeId", + "in": "path", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" } } ], @@ -96836,7 +96034,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/RuleChain" + "$ref": "#/components/schemas/SchedulerEventInfo" } } } @@ -96973,193 +96171,41 @@ ] } }, - "/api/ruleNode/{ruleNodeId}/debugIn": { - "get": { + "/api/edge/{edgeId}/schedulerEvent/{schedulerEventId}": { + "post": { "tags": [ - "rule-chain-controller" + "scheduler-event-controller" ], - "summary": "Get latest input message (getLatestRuleNodeDebugInput)", - "description": "Gets the input message from the debug events for specified Rule Chain Id. Referencing non-existing rule chain Id will cause an error. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getLatestRuleNodeDebugInput", + "summary": "Assign scheduler event to edge (assignSchedulerEventToEdge)", + "description": "Creates assignment of an existing scheduler event to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment scheduler event (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once scheduler event will be delivered to edge service, it is going to be available for usage on remote edge instance. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "assignSchedulerEventToEdge", "parameters": [ { - "name": "ruleNodeId", + "name": "edgeId", "in": "path", - "description": "A string value representing the rule node id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JsonNode" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] }, { - "ApiKeyForm": [] + "name": "schedulerEventId", + "in": "path", + "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } } - ] - } - }, - "/api/rule-engine/": { - "post": { - "tags": [ - "rule-engine-controller" ], - "summary": "Push user message to the rule engine (handleRuleEngineRequestForUser)", - "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses current User Id ( the one which credentials is used to perform the request) as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "handleRuleEngineRequestForUser", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "A JSON value representing the message." - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/SchedulerEventInfo" } } } @@ -97293,54 +96339,41 @@ "ApiKeyForm": [] } ] - } - }, - "/api/rule-engine/{entityType}/{entityId}": { - "post": { + }, + "delete": { "tags": [ - "rule-engine-controller" + "scheduler-event-controller" ], - "summary": "Push entity message to the rule engine (handleRuleEngineRequestForEntity)", - "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The default timeout of the request processing is 10 seconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "handleRuleEngineRequestForEntity", + "summary": "Unassign scheduler event from edge (unassignSchedulerEventFromEdge)", + "description": "Clears assignment of the scheduler event to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove entity group (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove entity group and entities inside this group locally.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "unassignSchedulerEventFromEdge", "parameters": [ { - "name": "entityType", + "name": "edgeId", "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "entityId", + "name": "schedulerEventId", "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "A JSON value representing the message." - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/SchedulerEventInfo" } } } @@ -97356,7 +96389,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -97476,71 +96509,83 @@ ] } }, - "/api/rule-engine/{entityType}/{entityId}/{queueName}/{timeout}": { - "post": { + "/api/edge/{edgeId}/schedulerEvents": { + "get": { "tags": [ - "rule-engine-controller" + "scheduler-event-controller" ], - "summary": "Push entity message with timeout and specified queue to the rule engine (handleRuleEngineRequestForEntityWithQueueAndTimeout)", - "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. If request sent for Device/Device Profile or Asset/Asset Profile entity, specified queue will be used instead of the queue selected in the device or asset profile. The platform expects the timeout value in milliseconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "handleRuleEngineRequestForEntityWithQueueAndTimeout", + "summary": "Get Edge Scheduler Events (getEdgeSchedulerEvents)", + "description": "Returns a page of Scheduler Events Info objects based on the provided Edge entity. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. Scheduler Events allows you to schedule various types of events with flexible schedule configuration. Scheduler fires configured scheduler events according to their schedule. See the 'Model' tab of the Response Class for more details. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getEdgeSchedulerEvents", "parameters": [ { - "name": "entityType", + "name": "edgeId", "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } }, { - "name": "entityId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "string", + "minimum": 1 } }, { - "name": "queueName", - "in": "path", - "description": "Queue name to process the request in the rule engine", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'startsWith' filter based on the scheduler event name.", + "required": false, "schema": { "type": "string" } }, { - "name": "timeout", - "in": "path", - "description": "Timeout to process the request in milliseconds", - "required": true, + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, "schema": { - "type": "integer", - "format": "int32" + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "A JSON value representing the message." - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/PageDataSchedulerEventInfo" } } } @@ -97556,7 +96601,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -97676,62 +96721,103 @@ ] } }, - "/api/rule-engine/{entityType}/{entityId}/{timeout}": { - "post": { + "/api/scheduledReports": { + "get": { "tags": [ - "rule-engine-controller" + "scheduler-event-controller" ], - "summary": "Push entity message with timeout to the rule engine (handleRuleEngineRequestForEntityWithTimeout)", - "description": "Creates the Message with type 'REST_API_REQUEST' and payload taken from the request body. Uses specified Entity Id as the Rule Engine message originator. This method allows you to extend the regular platform API with the power of Rule Engine. You may use default and custom rule nodes to handle the message. The generated message contains two important metadata fields:\n\n * **'serviceId'** to identify the platform server that received the request;\n * **'requestUUID'** to identify the request and route possible response from the Rule Engine;\n\nUse **'rest call reply'** rule node to push the reply from rule engine back as a REST API call response. The platform expects the timeout value in milliseconds.\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "handleRuleEngineRequestForEntityWithTimeout", + "summary": "Get Scheduled Report Events (getScheduledReportEvents)", + "description": "\n\nAvailable for users with 'TENANT_ADMIN' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getScheduledReportEvents", "parameters": [ { - "name": "entityType", - "in": "path", - "description": "A string value representing the entity type. For example, 'DEVICE'", + "name": "reportTemplateId", + "in": "query", + "description": "Report template id", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "userId", + "in": "query", + "description": "The user used for report generation.", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "includeCustomers", + "in": "query", + "description": "Include customer or sub-customer entities", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "string", + "minimum": 1 } }, { - "name": "entityId", - "in": "path", - "description": "A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", "required": true, + "schema": { + "type": "string", + "minimum": 0 + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the scheduler event name or customer title.", + "required": false, "schema": { "type": "string" } }, { - "name": "timeout", - "in": "path", - "description": "Timeout to process the request in milliseconds", - "required": true, + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, "schema": { - "type": "integer", - "format": "int32" + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "A JSON value representing the message." - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/PageDataScheduledReportInfo" } } } @@ -97747,7 +96833,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -97867,35 +96953,31 @@ ] } }, - "/api/edge/{edgeId}/allSchedulerEvents": { - "get": { + "/api/schedulerEvent": { + "post": { "tags": [ "scheduler-event-controller" ], - "summary": "Get All Edge Scheduler Events (getAllEdgeSchedulerEvents)", - "description": "Fetch the list of Scheduler Event Info objects based on the provided Edge entity. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. Scheduler Events allows you to schedule various types of events with flexible schedule configuration. Scheduler fires configured scheduler events according to their schedule. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getAllEdgeSchedulerEvents", - "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" + "summary": "Save Scheduler Event (saveSchedulerEvent)", + "description": "Creates or Updates scheduler event. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. When creating scheduler event, platform generates scheduler event Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created scheduler event id will be present in the response. Specify existing scheduler event id to update the scheduler event. Referencing non-existing scheduler event Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Scheduler Event entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "saveSchedulerEvent", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SchedulerEvent" + } } - } - ], + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SchedulerEventInfo" - } + "$ref": "#/components/schemas/SchedulerEvent" } } } @@ -97911,7 +96993,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -98031,24 +97113,15 @@ ] } }, - "/api/edge/{edgeId}/schedulerEvent/{schedulerEventId}": { - "post": { + "/api/schedulerEvent/info/{schedulerEventId}": { + "get": { "tags": [ "scheduler-event-controller" ], - "summary": "Assign scheduler event to edge (assignSchedulerEventToEdge)", - "description": "Creates assignment of an existing scheduler event to an instance of The Edge. Assignment works in async way - first, notification event pushed to edge service queue on platform. Second, remote edge service will receive a copy of assignment scheduler event (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once scheduler event will be delivered to edge service, it is going to be available for usage on remote edge instance. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "assignSchedulerEventToEdge", + "summary": "Get Scheduler Event With Customer Info (getSchedulerEventInfoById)", + "description": "Fetch the SchedulerEventWithCustomerInfo object based on the provided scheduler event Id. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. Referencing non-existing Scheduler Event Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSchedulerEventInfoById", "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "schedulerEventId", "in": "path", @@ -98065,7 +97138,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchedulerEventInfo" + "$ref": "#/components/schemas/SchedulerEventWithCustomerInfo" } } } @@ -98081,7 +97154,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -98199,24 +97272,17 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/schedulerEvent/{schedulerEventId}": { + "get": { "tags": [ "scheduler-event-controller" ], - "summary": "Unassign scheduler event from edge (unassignSchedulerEventFromEdge)", - "description": "Clears assignment of the scheduler event to the edge. Unassignment works in async way - first, 'unassign' notification event pushed to edge queue on platform. Second, remote edge service will receive an 'unassign' command to remove entity group (Edge will receive this instantly, if it's currently connected, or once it's going to be connected to platform). Third, once 'unassign' command will be delivered to edge service, it's going to remove entity group and entities inside this group locally.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "unassignSchedulerEventFromEdge", + "summary": "Get Scheduler Event (getSchedulerEventById)", + "description": "Fetch the SchedulerEvent object based on the provided scheduler event Id. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. Referencing non-existing Scheduler Event Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSchedulerEventById", "parameters": [ - { - "name": "edgeId", - "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "schedulerEventId", "in": "path", @@ -98233,7 +97299,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchedulerEventInfo" + "$ref": "#/components/schemas/SchedulerEvent" } } } @@ -98367,88 +97433,28 @@ "ApiKeyForm": [] } ] - } - }, - "/api/edge/{edgeId}/schedulerEvents": { - "get": { + }, + "delete": { "tags": [ "scheduler-event-controller" ], - "summary": "Get Edge Scheduler Events (getEdgeSchedulerEvents)", - "description": "Returns a page of Scheduler Events Info objects based on the provided Edge entity. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. Scheduler Events allows you to schedule various types of events with flexible schedule configuration. Scheduler fires configured scheduler events according to their schedule. See the 'Model' tab of the Response Class for more details. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getEdgeSchedulerEvents", + "summary": "Delete Scheduler Event (deleteSchedulerEvent)", + "description": "Deletes the scheduler event. Referencing non-existing Scheduler Event Id will cause 'Not Found' error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "deleteSchedulerEvent", "parameters": [ { - "name": "edgeId", + "name": "schedulerEventId", "in": "path", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'startsWith' filter based on the scheduler event name.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PageDataSchedulerEventInfo" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -98581,93 +97587,31 @@ ] } }, - "/api/scheduledReports": { - "get": { + "/api/schedulerEvent/{schedulerEventId}/enabled/{enabledValue}": { + "put": { "tags": [ "scheduler-event-controller" ], - "summary": "Get Scheduled Report Events (getScheduledReportEvents)", - "description": "\n\nAvailable for users with 'TENANT_ADMIN' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getScheduledReportEvents", + "summary": "Enable or disable Scheduler Event (enableSchedulerEvent)", + "description": "Updates scheduler event with enabled = true/false. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", + "operationId": "enableSchedulerEvent", "parameters": [ { - "name": "reportTemplateId", - "in": "query", - "description": "Report template id", - "required": false, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "userId", - "in": "query", - "description": "The user used for report generation.", - "required": false, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "includeCustomers", - "in": "query", - "description": "Include customer or sub-customer entities", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "string", - "minimum": 1 - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "schedulerEventId", + "in": "path", + "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "string", - "minimum": 0 - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the scheduler event name or customer title.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, "schema": { "type": "string" } }, { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, + "name": "enabledValue", + "in": "path", + "description": "Enabled or disabled scheduler", + "required": true, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "boolean" } } ], @@ -98677,7 +97621,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataScheduledReportInfo" + "$ref": "#/components/schemas/SchedulerEvent" } } } @@ -98813,31 +97757,89 @@ ] } }, - "/api/schedulerEvent": { - "post": { + "/api/schedulerEvents": { + "get": { "tags": [ "scheduler-event-controller" ], - "summary": "Save Scheduler Event (saveSchedulerEvent)", - "description": "Creates or Updates scheduler event. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. When creating scheduler event, platform generates scheduler event Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created scheduler event id will be present in the response. Specify existing scheduler event id to update the scheduler event. Referencing non-existing scheduler event Id will cause 'Not Found' error. Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Scheduler Event entity. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "saveSchedulerEvent", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SchedulerEvent" - } + "summary": "Get scheduler events (getSchedulerEvents)", + "description": "Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. \n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSchedulerEvents", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "required": true - }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on event's name, type, or customer's name", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "A string value representing the scheduler type. For example, 'generateReport'", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "edgeId", + "in": "query", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchedulerEvent" + "$ref": "#/components/schemas/PageDataSchedulerEventWithCustomerInfo" } } } @@ -98853,7 +97855,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -98973,20 +97975,20 @@ ] } }, - "/api/schedulerEvent/info/{schedulerEventId}": { + "/api/schedulerEvents/all": { "get": { "tags": [ "scheduler-event-controller" ], - "summary": "Get Scheduler Event With Customer Info (getSchedulerEventInfoById)", - "description": "Fetch the SchedulerEventWithCustomerInfo object based on the provided scheduler event Id. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. Referencing non-existing Scheduler Event Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSchedulerEventInfoById", + "summary": "Get all scheduler events (getAllSchedulerEvents)", + "description": "Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getAllSchedulerEvents", "parameters": [ { - "name": "schedulerEventId", - "in": "path", - "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, + "name": "type", + "in": "query", + "description": "A string value representing the scheduler type. For example, 'generateReport'", + "required": false, "schema": { "type": "string" } @@ -98998,7 +98000,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchedulerEventWithCustomerInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/SchedulerEventWithCustomerInfo" + } } } } @@ -99134,22 +98139,25 @@ ] } }, - "/api/schedulerEvent/{schedulerEventId}": { + "/api/schedulerEvents/list": { "get": { "tags": [ "scheduler-event-controller" ], - "summary": "Get Scheduler Event (getSchedulerEventById)", - "description": "Fetch the SchedulerEvent object based on the provided scheduler event Id. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. Referencing non-existing Scheduler Event Id will cause 'Not Found' error.\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSchedulerEventById", + "summary": "Get Scheduler Events By Ids (getSchedulerEventsByIds)", + "description": "Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Events allows you to schedule various types of events with flexible schedule configuration. Scheduler fires configured scheduler events according to their schedule. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSchedulerEventsByIds", "parameters": [ { - "name": "schedulerEventId", - "in": "path", - "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "schedulerEventIds", + "in": "query", + "description": "A list of scheduler event ids, separated by comma ','", "required": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -99159,7 +98167,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchedulerEvent" + "type": "array", + "items": { + "$ref": "#/components/schemas/SchedulerEventInfo" + } } } } @@ -99293,20 +98304,61 @@ "ApiKeyForm": [] } ] - }, - "delete": { + } + }, + "/api/schedulerEvents/startTime/{startTime}/endTime/{endTime}": { + "get": { "tags": [ "scheduler-event-controller" ], - "summary": "Delete Scheduler Event (deleteSchedulerEvent)", - "description": "Deletes the scheduler event. Referencing non-existing Scheduler Event Id will cause 'Not Found' error.\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "deleteSchedulerEvent", + "summary": "Get scheduler events (getSchedulerEventsByRange)", + "description": "Retrieves scheduler events filtering by event run time. Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. \n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSchedulerEventsByRange", "parameters": [ { - "name": "schedulerEventId", + "name": "startTime", "in": "path", - "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Start time filter in milliseconds for scheduler event run time", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "path", + "description": "End time filter in milliseconds for scheduler event run time", "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "type", + "in": "query", + "description": "A string value representing the scheduler type. For example, 'generateReport'", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "edgeId", + "in": "query", + "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "Case-insensitive 'substring' filter based on event's name, type, or customer's name", + "required": false, "schema": { "type": "string" } @@ -99314,7 +98366,17 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SchedulerEventWithCustomerInfo" + } + } + } + } }, "400": { "description": "Bad Request", @@ -99447,32 +98509,22 @@ ] } }, - "/api/schedulerEvent/{schedulerEventId}/enabled/{enabledValue}": { - "put": { + "/api/secret": { + "get": { "tags": [ - "scheduler-event-controller" + "secret-controller" ], - "summary": "Enable or disable Scheduler Event (enableSchedulerEvent)", - "description": "Updates scheduler event with enabled = true/false. Scheduler Event extends Scheduler Event Info object and adds 'configuration' - a JSON structure of scheduler event configuration. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.", - "operationId": "enableSchedulerEvent", + "summary": "Get Secret info by name (getSecretInfoByName)", + "description": "\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getSecretInfoByName", "parameters": [ { - "name": "schedulerEventId", - "in": "path", - "description": "A string value representing the scheduler id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "name", + "in": "query", "required": true, "schema": { "type": "string" } - }, - { - "name": "enabledValue", - "in": "path", - "description": "Enabled or disabled scheduler", - "required": true, - "schema": { - "type": "boolean" - } } ], "responses": { @@ -99481,7 +98533,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SchedulerEvent" + "$ref": "#/components/schemas/SecretInfo" } } } @@ -99615,91 +98667,31 @@ "ApiKeyForm": [] } ] - } - }, - "/api/schedulerEvents": { - "get": { + }, + "post": { "tags": [ - "scheduler-event-controller" + "secret-controller" ], - "summary": "Get scheduler events (getSchedulerEvents)", - "description": "Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. \n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSchedulerEvents", - "parameters": [ - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on event's name, type, or customer's name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "A string value representing the scheduler type. For example, 'generateReport'", - "required": false, - "schema": { - "type": "string" + "summary": "Save or Update Secret (saveSecret)", + "description": "Create or update the Secret. When creating secret, platform generates Secret Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Secret Id will be present in the response. Specify existing Secret Id to update the secret. Secret name is not updatable, only value could be changed. Referencing non-existing Secret Id will cause 'Not Found' error.\n\nSecret name is unique in the scope of tenant.", + "operationId": "saveSecret", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Secret" + } } }, - { - "name": "edgeId", - "in": "query", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": false, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataSchedulerEventWithCustomerInfo" + "$ref": "#/components/schemas/SecretInfo" } } } @@ -99715,7 +98707,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -99835,25 +98827,14 @@ ] } }, - "/api/schedulerEvents/all": { + "/api/secret/names": { "get": { "tags": [ - "scheduler-event-controller" - ], - "summary": "Get all scheduler events (getAllSchedulerEvents)", - "description": "Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getAllSchedulerEvents", - "parameters": [ - { - "name": "type", - "in": "query", - "description": "A string value representing the scheduler type. For example, 'generateReport'", - "required": false, - "schema": { - "type": "string" - } - } + "secret-controller" ], + "summary": "Get Tenant Secret names (getSecretNames)", + "description": "Returns a page of secret names owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getSecretNames", "responses": { "200": { "description": "OK", @@ -99862,7 +98843,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/SchedulerEventWithCustomerInfo" + "type": "string" } } } @@ -99999,25 +98980,22 @@ ] } }, - "/api/schedulerEvents/list": { - "get": { + "/api/secret/{id}": { + "delete": { "tags": [ - "scheduler-event-controller" + "secret-controller" ], - "summary": "Get Scheduler Events By Ids (getSchedulerEventsByIds)", - "description": "Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Events allows you to schedule various types of events with flexible schedule configuration. Scheduler fires configured scheduler events according to their schedule. See the 'Model' tab of the Response Class for more details. \n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSchedulerEventsByIds", + "summary": "Delete secret by ID (deleteSecret)", + "description": "Deletes the secret. Referencing non-existing Secret Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "deleteSecret", "parameters": [ { - "name": "schedulerEventIds", - "in": "query", - "description": "A list of scheduler event ids, separated by comma ','", + "name": "id", + "in": "path", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string", + "format": "uuid" } } ], @@ -100027,10 +99005,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SchedulerEventInfo" - } + "$ref": "#/components/schemas/TbSecretDeleteResult" } } } @@ -100166,74 +99141,43 @@ ] } }, - "/api/schedulerEvents/startTime/{startTime}/endTime/{endTime}": { - "get": { + "/api/secret/{id}/description": { + "put": { "tags": [ - "scheduler-event-controller" + "secret-controller" ], - "summary": "Get scheduler events (getSchedulerEventsByRange)", - "description": "Retrieves scheduler events filtering by event run time. Requested scheduler events must be owned by tenant or assigned to customer which user is performing the request. Scheduler Event With Customer Info extends Scheduler Event Info object and adds 'customerTitle' - a String value representing the title of the customer which user created a Scheduler Event and 'customerIsPublic' - a boolean parameter that specifies if customer is public. See the 'Model' tab of the Response Class for more details. \n\nYou can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\n\n\nAvailable for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSchedulerEventsByRange", + "summary": "Update Secret Description", + "description": "Updates the description of the existing Secret by secretId. Only the description can be updated. Referencing a non-existing Secret Id will cause a 'Not Found' error.", + "operationId": "updateSecretDescription", "parameters": [ { - "name": "startTime", - "in": "path", - "description": "Start time filter in milliseconds for scheduler event run time", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTime", + "name": "id", "in": "path", - "description": "End time filter in milliseconds for scheduler event run time", + "description": "Unique identifier of the Secret to update", "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "type", - "in": "query", - "description": "A string value representing the scheduler type. For example, 'generateReport'", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "edgeId", - "in": "query", - "description": "A string value representing the edge id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": false, "schema": { "type": "string", "format": "uuid" } - }, - { - "name": "textSearch", - "in": "query", - "description": "Case-insensitive 'substring' filter based on event's name, type, or customer's name", - "required": false, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string", + "description": "New description for the Secret" + } + } + } + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SchedulerEventWithCustomerInfo" - } + "$ref": "#/components/schemas/SecretInfo" } } } @@ -100369,21 +99313,22 @@ ] } }, - "/api/secret": { + "/api/secret/{id}/info": { "get": { "tags": [ "secret-controller" ], - "summary": "Get Secret info by name (getSecretInfoByName)", + "summary": "Get Secret info by Id (getSecretInfoById)", "description": "\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getSecretInfoByName", + "operationId": "getSecretInfoById", "parameters": [ { - "name": "name", - "in": "query", + "name": "id", + "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], @@ -100527,19 +99472,34 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/secret/{id}/value": { + "put": { "tags": [ "secret-controller" ], - "summary": "Save or Update Secret (saveSecret)", - "description": "Create or update the Secret. When creating secret, platform generates Secret Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Secret Id will be present in the response. Specify existing Secret Id to update the secret. Secret name is not updatable, only value could be changed. Referencing non-existing Secret Id will cause 'Not Found' error.\n\nSecret name is unique in the scope of tenant.", - "operationId": "saveSecret", + "summary": "Update Secret value", + "description": "Updates the value of the existing Secret by secretId. Referencing a non-existing Secret Id will cause a 'Not Found' error.", + "operationId": "updateSecretValue", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Unique identifier of the Secret to update", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Secret" + "type": "string", + "description": "New value for the Secret" } } }, @@ -100567,7 +99527,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -100687,24 +99647,77 @@ ] } }, - "/api/secret/names": { + "/api/secrets": { "get": { "tags": [ "secret-controller" ], - "summary": "Get Tenant Secret names (getSecretNames)", - "description": "Returns a page of secret names owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getSecretNames", + "summary": "Get Tenant Secret infos (getSecretInfos)", + "description": "Returns a page of secret infos owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getSecretInfos", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the secret name and description.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "name" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "string" - } + "$ref": "#/components/schemas/PageDataSecretInfo" } } } @@ -100840,22 +99853,29 @@ ] } }, - "/api/secret/{id}": { - "delete": { + "/api/noauth/selfRegistration/privacyPolicy": { + "get": { "tags": [ - "secret-controller" + "self-registration-controller" ], - "summary": "Delete secret by ID (deleteSecret)", - "description": "Deletes the secret. Referencing non-existing Secret Id will cause an error.\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "deleteSecret", + "summary": "Get Privacy Policy for Self Registration form (getPrivacyPolicy)", + "description": "Fetch the Privacy Policy based on the domain name from the request. Available for non-authorized users. ", + "operationId": "getPrivacyPolicy", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "pkgName", + "in": "query", + "required": false, "schema": { - "type": "string", - "format": "uuid" + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PlatformType" } } ], @@ -100865,7 +99885,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbSecretDeleteResult" + "type": "string" } } } @@ -100990,54 +100010,47 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/secret/{id}/description": { - "put": { + "/api/noauth/selfRegistration/signUpSelfRegistrationParams": { + "get": { "tags": [ - "secret-controller" + "self-registration-controller" ], - "summary": "Update Secret Description", - "description": "Updates the description of the existing Secret by secretId. Only the description can be updated. Referencing a non-existing Secret Id will cause a 'Not Found' error.", - "operationId": "updateSecretDescription", + "summary": "Get Self Registration form parameters without authentication (getSignUpSelfRegistrationParams)", + "description": "Fetch the Self Registration parameters based on the domain name from the request. Available for non-authorized users. Contains the information to customize the sign-up form.", + "operationId": "getSignUpSelfRegistrationParams", "parameters": [ { - "name": "id", - "in": "path", - "description": "Unique identifier of the Secret to update", - "required": true, + "name": "pkgName", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "platformType", + "in": "query", + "description": "Platform type", + "required": false, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "ANDROID", + "IOS" + ] } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "New description for the Secret" - } - } - } - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SecretInfo" + "$ref": "#/components/schemas/SignUpSelfRegistrationParams" } } } @@ -101162,33 +100175,32 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/secret/{id}/info": { + "/api/noauth/selfRegistration/termsOfUse": { "get": { "tags": [ - "secret-controller" + "self-registration-controller" ], - "summary": "Get Secret info by Id (getSecretInfoById)", - "description": "\n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getSecretInfoById", + "summary": "Get Terms of Use for Self Registration form (getTermsOfUse)", + "description": "Fetch the Terms of Use based on the domain name from the request. Available for non-authorized users. ", + "operationId": "getTermsOfUse", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "pkgName", + "in": "query", + "required": false, "schema": { - "type": "string", - "format": "uuid" + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/PlatformType" } } ], @@ -101198,7 +100210,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SecretInfo" + "type": "string" } } } @@ -101323,55 +100335,24 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/secret/{id}/value": { - "put": { + "/api/selfRegistration/selfRegistrationParams": { + "get": { "tags": [ - "secret-controller" - ], - "summary": "Update Secret value", - "description": "Updates the value of the existing Secret by secretId. Referencing a non-existing Secret Id will cause a 'Not Found' error.", - "operationId": "updateSecretValue", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Unique identifier of the Secret to update", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } + "self-registration-controller" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string", - "description": "New value for the Secret" - } - } - }, - "required": true - }, + "summary": "Get Self Registration parameters (getSelfRegistrationParams)", + "description": "Fetch the Self Registration parameters object for the tenant of the current user. \n\nAvailable for users with 'TENANT_ADMIN' authority.\n\nSecurity check is performed to verify that the user has 'READ' permission for the white labeling resource.", + "operationId": "getWebSelfRegistrationParams", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SecretInfo" + "$ref": "#/components/schemas/SelfRegistrationParams" } } } @@ -101505,79 +100486,31 @@ "ApiKeyForm": [] } ] - } - }, - "/api/secrets": { - "get": { + }, + "post": { "tags": [ - "secret-controller" + "self-registration-controller" ], - "summary": "Get Tenant Secret infos (getSecretInfos)", - "description": "Returns a page of secret infos owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getSecretInfos", - "parameters": [ - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the secret name and description.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "name" - ] + "summary": "Create Or Update Self Registration parameters (saveSelfRegistrationParams)", + "description": "Creates or Updates the Self Registration parameters. When creating, platform generates Admin Settings Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Admin Settings Id will be present in the response. Specify existing Admin Settings Id to update the Self Registration parameters. Referencing non-existing Admin Settings Id will cause 'Not Found' error.\n\nSelf Registration allows users to signup for using the platform and automatically create a Customer account for them. You may configure default dashboard and user roles that will be assigned for this Customer. This allows you to build out-of-the-box solutions for customers. Ability to white-label the login and main pages helps to brand the platform.\n\nAvailable for users with 'TENANT_ADMIN' authority.\n\nSecurity check is performed to verify that the user has 'WRITE' permission for the white labeling resource.", + "operationId": "saveWebSelfRegistrationParams", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WebSelfRegistrationParams" + } } }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataSecretInfo" + "$ref": "#/components/schemas/WebSelfRegistrationParams" } } } @@ -101593,7 +100526,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -101711,44 +100644,16 @@ "ApiKeyForm": [] } ] - } - }, - "/api/noauth/selfRegistration/privacyPolicy": { - "get": { + }, + "delete": { "tags": [ "self-registration-controller" ], - "summary": "Get Privacy Policy for Self Registration form (getPrivacyPolicy)", - "description": "Fetch the Privacy Policy based on the domain name from the request. Available for non-authorized users. ", - "operationId": "getPrivacyPolicy", - "parameters": [ - { - "name": "pkgName", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "platform", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/PlatformType" - } - } - ], + "summary": "deleteWebSelfRegistrationParams", + "operationId": "deleteWebSelfRegistrationParams", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -101870,28 +100775,46 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/noauth/selfRegistration/signUpSelfRegistrationParams": { - "get": { + "/api/noauth/activateByEmailCode": { + "post": { "tags": [ - "self-registration-controller" + "sign-up-controller" ], - "summary": "Get Self Registration form parameters without authentication (getSignUpSelfRegistrationParams)", - "description": "Fetch the Self Registration parameters based on the domain name from the request. Available for non-authorized users. Contains the information to customize the sign-up form.", - "operationId": "getSignUpSelfRegistrationParams", + "summary": "Activate and login using code from Email (activateUserByEmailCode)", + "description": "Activate the user using code(link) from the activation email and return the JWT Token. Sends the notification and email about user activation. Checks that user was not activated yet.", + "operationId": "activateUserByEmailCode", "parameters": [ + { + "name": "emailCode", + "in": "query", + "description": "Activation token.", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "pkgName", "in": "query", + "description": "Optional package name of the mobile application.", "required": false, "schema": { "type": "string" } }, { - "name": "platformType", + "name": "platform", "in": "query", "description": "Platform type", "required": false, @@ -101910,7 +100833,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SignUpSelfRegistrationParams" + "$ref": "#/components/schemas/JwtPair" } } } @@ -101926,7 +100849,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -102038,18 +100961,28 @@ } } }, - "/api/noauth/selfRegistration/termsOfUse": { + "/api/noauth/activateEmail": { "get": { "tags": [ - "self-registration-controller" + "sign-up-controller" ], - "summary": "Get Terms of Use for Self Registration form (getTermsOfUse)", - "description": "Fetch the Terms of Use based on the domain name from the request. Available for non-authorized users. ", - "operationId": "getTermsOfUse", + "summary": "Activate User using code from Email (activateEmail)", + "description": "Activate the user using code(link) from the activation email. Validates the code an redirects according to the signup flow. Checks that user was not activated yet.", + "operationId": "activateEmail", "parameters": [ + { + "name": "emailCode", + "in": "query", + "description": "Activation token.", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "pkgName", "in": "query", + "description": "Optional package name of the mobile application.", "required": false, "schema": { "type": "string" @@ -102058,9 +100991,14 @@ { "name": "platform", "in": "query", + "description": "Platform type", "required": false, "schema": { - "$ref": "#/components/schemas/PlatformType" + "type": "string", + "enum": [ + "ANDROID", + "IOS" + ] } } ], @@ -102198,21 +101136,52 @@ } } }, - "/api/selfRegistration/selfRegistrationParams": { - "get": { + "/api/noauth/cloud/activateByEmailCode": { + "post": { "tags": [ - "self-registration-controller" + "sign-up-controller" + ], + "summary": "activateCloudUserByEmailCode", + "operationId": "activateCloudUserByEmailCode", + "parameters": [ + { + "name": "emailCode", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pkgName", + "in": "query", + "description": "Optional package name of the mobile application.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "platform", + "in": "query", + "description": "Platform type", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ANDROID", + "IOS" + ] + } + } ], - "summary": "Get Self Registration parameters (getSelfRegistrationParams)", - "description": "Fetch the Self Registration parameters object for the tenant of the current user. \n\nAvailable for users with 'TENANT_ADMIN' authority.\n\nSecurity check is performed to verify that the user has 'READ' permission for the white labeling resource.", - "operationId": "getWebSelfRegistrationParams", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SelfRegistrationParams" + "$ref": "#/components/schemas/JwtPair" } } } @@ -102228,7 +101197,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -102337,40 +101306,55 @@ } } } - }, - "security": [ + } + } + }, + "/api/noauth/cloud/activateEmail": { + "get": { + "tags": [ + "sign-up-controller" + ], + "summary": "activateCloudEmail", + "operationId": "activateCloudEmail", + "parameters": [ { - "HttpLoginForm": [] + "name": "emailCode", + "in": "query", + "required": true, + "schema": { + "type": "string" + } }, { - "ApiKeyForm": [] - } - ] - }, - "post": { - "tags": [ - "self-registration-controller" - ], - "summary": "Create Or Update Self Registration parameters (saveSelfRegistrationParams)", - "description": "Creates or Updates the Self Registration parameters. When creating, platform generates Admin Settings Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Admin Settings Id will be present in the response. Specify existing Admin Settings Id to update the Self Registration parameters. Referencing non-existing Admin Settings Id will cause 'Not Found' error.\n\nSelf Registration allows users to signup for using the platform and automatically create a Customer account for them. You may configure default dashboard and user roles that will be assigned for this Customer. This allows you to build out-of-the-box solutions for customers. Ability to white-label the login and main pages helps to brand the platform.\n\nAvailable for users with 'TENANT_ADMIN' authority.\n\nSecurity check is performed to verify that the user has 'WRITE' permission for the white labeling resource.", - "operationId": "saveWebSelfRegistrationParams", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebSelfRegistrationParams" - } + "name": "pkgName", + "in": "query", + "description": "Optional package name of the mobile application.", + "required": false, + "schema": { + "type": "string" } }, - "required": true - }, + { + "name": "platform", + "in": "query", + "description": "Platform type", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ANDROID", + "IOS" + ] + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebSelfRegistrationParams" + "type": "string" } } } @@ -102386,7 +101370,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -102495,25 +101479,51 @@ } } } - }, - "security": [ + } + } + }, + "/api/noauth/cloud/login": { + "get": { + "tags": [ + "sign-up-controller" + ], + "summary": "Cloud mobile Login redirect (cloudMobileLogin)", + "description": "This method generates redirect to the special link that is handled by mobile application. Useful for email verification flow on cloud mobile app.", + "operationId": "cloudMobileLogin", + "parameters": [ { - "HttpLoginForm": [] + "name": "pkgName", + "in": "query", + "description": "Mobile app package name. Used to identify the application and build the redirect link.", + "required": true, + "schema": { + "type": "string" + } }, { - "ApiKeyForm": [] + "name": "platform", + "in": "query", + "description": "Platform type", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ANDROID", + "IOS" + ] + } } - ] - }, - "delete": { - "tags": [ - "self-registration-controller" ], - "summary": "deleteWebSelfRegistrationParams", - "operationId": "deleteWebSelfRegistrationParams", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } }, "400": { "description": "Bad Request", @@ -102635,30 +101645,20 @@ } } } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] + } } }, - "/api/noauth/activateByEmailCode": { + "/api/noauth/cloud/resendEmailActivation": { "post": { "tags": [ "sign-up-controller" ], - "summary": "Activate and login using code from Email (activateUserByEmailCode)", - "description": "Activate the user using code(link) from the activation email and return the JWT Token. Sends the notification and email about user activation. Checks that user was not activated yet.", - "operationId": "activateUserByEmailCode", + "summary": "resendCloudEmailActivation", + "operationId": "resendCloudEmailActivation", "parameters": [ { - "name": "emailCode", + "name": "email", "in": "query", - "description": "Activation token.", "required": true, "schema": { "type": "string" @@ -102667,7 +101667,6 @@ { "name": "pkgName", "in": "query", - "description": "Optional package name of the mobile application.", "required": false, "schema": { "type": "string" @@ -102689,14 +101688,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JwtPair" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -102821,29 +101813,20 @@ } } }, - "/api/noauth/activateEmail": { + "/api/noauth/login": { "get": { "tags": [ "sign-up-controller" ], - "summary": "Activate User using code from Email (activateEmail)", - "description": "Activate the user using code(link) from the activation email. Validates the code an redirects according to the signup flow. Checks that user was not activated yet.", - "operationId": "activateEmail", + "summary": "Mobile Login redirect (mobileLogin)", + "description": "This method generates redirect to the special link that is handled by mobile application. Useful for email verification flow on mobile app.", + "operationId": "mobileLogin", "parameters": [ - { - "name": "emailCode", - "in": "query", - "description": "Activation token.", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "pkgName", "in": "query", - "description": "Optional package name of the mobile application.", - "required": false, + "description": "Mobile app package name. Used to identify the application and build the redirect link.", + "required": true, "schema": { "type": "string" } @@ -102852,7 +101835,7 @@ "name": "platform", "in": "query", "description": "Platform type", - "required": false, + "required": true, "schema": { "type": "string", "enum": [ @@ -102996,21 +101979,24 @@ } } }, - "/api/noauth/cloud/activateByEmailCode": { + "/api/noauth/resendEmailActivation": { "post": { "tags": [ "sign-up-controller" ], - "summary": "activateCloudUserByEmailCode", - "operationId": "activateCloudUserByEmailCode", + "summary": "Resend Activation Email (resendEmailActivation)", + "description": "Request to resend the activation email for the user. Checks that user was not activated yet.", + "operationId": "resendEmailActivation", "parameters": [ { - "name": "emailCode", + "name": "email", "in": "query", + "description": "Email of the user.", "required": true, "schema": { "type": "string" - } + }, + "example": "john.doe@company.com" }, { "name": "pkgName", @@ -103037,14 +102023,7 @@ ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JwtPair" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -103169,52 +102148,31 @@ } } }, - "/api/noauth/cloud/activateEmail": { - "get": { + "/api/noauth/signup": { + "post": { "tags": [ "sign-up-controller" ], - "summary": "activateCloudEmail", - "operationId": "activateCloudEmail", - "parameters": [ - { - "name": "emailCode", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pkgName", - "in": "query", - "description": "Optional package name of the mobile application.", - "required": false, - "schema": { - "type": "string" + "summary": "User Sign Up (signUp)", + "description": "Process user sign up request. Creates the Customer and corresponding User based on self Registration parameters for the domain. See [Self Registration Controller](/swagger-ui.html#/self-registration-controller) for more details. The result is either 'SUCCESS' or 'INACTIVE_USER_EXISTS'. If Success, the user will receive an email with instruction to activate the account. The content of the email is customizable via the mail templates.", + "operationId": "signUp", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SignUpRequest" + } } }, - { - "name": "platform", - "in": "query", - "description": "Platform type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ANDROID", - "IOS" - ] - } - } - ], + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/SignUpResult" } } } @@ -103230,7 +102188,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -103342,45 +102300,20 @@ } } }, - "/api/noauth/cloud/login": { + "/api/noauth/signup/recaptchaParams": { "get": { "tags": [ "sign-up-controller" ], - "summary": "Cloud mobile Login redirect (cloudMobileLogin)", - "description": "This method generates redirect to the special link that is handled by mobile application. Useful for email verification flow on cloud mobile app.", - "operationId": "cloudMobileLogin", - "parameters": [ - { - "name": "pkgName", - "in": "query", - "description": "Mobile app package name. Used to identify the application and build the redirect link.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "platform", - "in": "query", - "description": "Platform type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ANDROID", - "IOS" - ] - } - } - ], + "summary": "getRecaptchaParams", + "operationId": "getRecaptchaParams", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/CaptchaClientParams" } } } @@ -103508,47 +102441,24 @@ } } }, - "/api/noauth/cloud/resendEmailActivation": { + "/api/signup/acceptPrivacyPolicy": { "post": { "tags": [ "sign-up-controller" ], - "summary": "resendCloudEmailActivation", - "operationId": "resendCloudEmailActivation", - "parameters": [ - { - "name": "email", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "pkgName", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "platform", - "in": "query", - "description": "Platform type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ANDROID", - "IOS" - ] - } - } - ], + "summary": "Accept privacy policy (acceptPrivacyPolicy)", + "description": "Accept privacy policy by the current user.", + "operationId": "acceptPrivacyPolicy", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JwtPair" + } + } + } }, "400": { "description": "Bad Request", @@ -103670,48 +102580,31 @@ } } } - } - } - }, - "/api/noauth/login": { - "get": { - "tags": [ - "sign-up-controller" - ], - "summary": "Mobile Login redirect (mobileLogin)", - "description": "This method generates redirect to the special link that is handled by mobile application. Useful for email verification flow on mobile app.", - "operationId": "mobileLogin", - "parameters": [ + }, + "security": [ { - "name": "pkgName", - "in": "query", - "description": "Mobile app package name. Used to identify the application and build the redirect link.", - "required": true, - "schema": { - "type": "string" - } + "HttpLoginForm": [] }, { - "name": "platform", - "in": "query", - "description": "Platform type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "ANDROID", - "IOS" - ] - } + "ApiKeyForm": [] } + ] + } + }, + "/api/signup/acceptPrivacyPolicyAndTermsOfUse": { + "post": { + "tags": [ + "sign-up-controller" ], + "summary": "acceptPrivacyPolicyAndTermsOfUse", + "operationId": "acceptPrivacyPolicyAndTermsOfUse", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/JwtPair" } } } @@ -103727,7 +102620,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -103836,54 +102729,35 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/noauth/resendEmailActivation": { + "/api/signup/acceptTermsOfUse": { "post": { "tags": [ "sign-up-controller" ], - "summary": "Resend Activation Email (resendEmailActivation)", - "description": "Request to resend the activation email for the user. Checks that user was not activated yet.", - "operationId": "resendEmailActivation", - "parameters": [ - { - "name": "email", - "in": "query", - "description": "Email of the user.", - "required": true, - "schema": { - "type": "string" - }, - "example": "john.doe@company.com" - }, - { - "name": "pkgName", - "in": "query", - "description": "Optional package name of the mobile application.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "platform", - "in": "query", - "description": "Platform type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ANDROID", - "IOS" - ] - } - } - ], + "summary": "Accept Terms of Use (acceptTermsOfUse)", + "description": "Accept Terms of Use by the current user.", + "operationId": "acceptTermsOfUse", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JwtPair" + } + } + } }, "400": { "description": "Bad Request", @@ -104005,34 +102879,31 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/noauth/signup": { - "post": { + "/api/signup/displayWelcome": { + "get": { "tags": [ "sign-up-controller" ], - "summary": "User Sign Up (signUp)", - "description": "Process user sign up request. Creates the Customer and corresponding User based on self Registration parameters for the domain. See [Self Registration Controller](/swagger-ui.html#/self-registration-controller) for more details. The result is either 'SUCCESS' or 'INACTIVE_USER_EXISTS'. If Success, the user will receive an email with instruction to activate the account. The content of the email is customizable via the mail templates.", - "operationId": "signUp", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SignUpRequest" - } - } - }, - "required": true - }, + "summary": "isDisplayWelcome", + "operationId": "isDisplayWelcome", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SignUpResult" + "type": "boolean" } } } @@ -104048,7 +102919,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -104157,26 +103028,27 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/noauth/signup/recaptchaParams": { - "get": { + "/api/signup/notDisplayWelcome": { + "post": { "tags": [ "sign-up-controller" ], - "summary": "getRecaptchaParams", - "operationId": "getRecaptchaParams", + "summary": "setNotDisplayWelcome", + "operationId": "setNotDisplayWelcome", "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CaptchaClientParams" - } - } - } + "description": "OK" }, "400": { "description": "Bad Request", @@ -104189,7 +103061,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -104298,24 +103170,32 @@ } } } - } + }, + "security": [ + { + "HttpLoginForm": [] + }, + { + "ApiKeyForm": [] + } + ] } }, - "/api/signup/acceptPrivacyPolicy": { - "post": { + "/api/signup/privacyPolicyAccepted": { + "get": { "tags": [ "sign-up-controller" ], - "summary": "Accept privacy policy (acceptPrivacyPolicy)", - "description": "Accept privacy policy by the current user.", - "operationId": "acceptPrivacyPolicy", + "summary": "Check privacy policy (privacyPolicyAccepted)", + "description": "Checks that current user accepted the privacy policy.", + "operationId": "privacyPolicyAccepted", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JwtPair" + "type": "boolean" } } } @@ -104331,7 +103211,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -104451,23 +103331,25 @@ ] } }, - "/api/signup/acceptPrivacyPolicyAndTermsOfUse": { + "/api/signup/tenantAccount": { "post": { "tags": [ "sign-up-controller" ], - "summary": "acceptPrivacyPolicyAndTermsOfUse", - "operationId": "acceptPrivacyPolicyAndTermsOfUse", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JwtPair" - } + "summary": "deleteTenantAccount", + "operationId": "deleteTenantAccount", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTenantRequest" } } + } + }, + "responses": { + "200": { + "description": "OK" }, "400": { "description": "Bad Request", @@ -104600,21 +103482,21 @@ ] } }, - "/api/signup/acceptTermsOfUse": { - "post": { + "/api/signup/termsOfUseAccepted": { + "get": { "tags": [ "sign-up-controller" ], - "summary": "Accept Terms of Use (acceptTermsOfUse)", - "description": "Accept Terms of Use by the current user.", - "operationId": "acceptTermsOfUse", + "summary": "Check Terms Of User (termsOfUseAccepted)", + "description": "Checks that current user accepted the privacy policy.", + "operationId": "termsOfUseAccepted", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JwtPair" + "type": "boolean" } } } @@ -104630,7 +103512,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -104750,20 +103632,32 @@ ] } }, - "/api/signup/displayWelcome": { + "/api/solutions/templates/details/{solutionTemplateId}": { "get": { "tags": [ - "sign-up-controller" + "solution-controller" + ], + "summary": "Get Solution template details (getSolutionTemplateDetails)", + "description": "Get a solution template details based on the provided id\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSolutionTemplateDetails", + "parameters": [ + { + "name": "solutionTemplateId", + "in": "path", + "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "isDisplayWelcome", - "operationId": "isDisplayWelcome", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/TenantSolutionTemplateDetails" } } } @@ -104899,16 +103793,27 @@ ] } }, - "/api/signup/notDisplayWelcome": { - "post": { + "/api/solutions/templates/infos": { + "get": { "tags": [ - "sign-up-controller" + "solution-controller" ], - "summary": "setNotDisplayWelcome", - "operationId": "setNotDisplayWelcome", + "summary": "Get Solution templates (getSolutionTemplateInfos)", + "description": "Get a list of solution template descriptors\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSolutionTemplateInfos", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TenantSolutionTemplateInfo" + } + } + } + } }, "400": { "description": "Bad Request", @@ -104921,7 +103826,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -105041,21 +103946,32 @@ ] } }, - "/api/signup/privacyPolicyAccepted": { + "/api/solutions/templates/instructions/{solutionTemplateId}": { "get": { "tags": [ - "sign-up-controller" + "solution-controller" + ], + "summary": "Get Solution Template Instructions (getSolutionTemplateInstructions)", + "description": "Get a solution template instructions based on the provided id\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", + "operationId": "getSolutionTemplateInstructions", + "parameters": [ + { + "name": "solutionTemplateId", + "in": "path", + "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Check privacy policy (privacyPolicyAccepted)", - "description": "Checks that current user accepted the privacy policy.", - "operationId": "privacyPolicyAccepted", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/TenantSolutionTemplateInstructions" } } } @@ -105191,22 +104107,25 @@ ] } }, - "/api/signup/tenantAccount": { - "post": { + "/api/solutions/templates/{solutionTemplateId}/delete": { + "delete": { "tags": [ - "sign-up-controller" + "solution-controller" ], - "summary": "deleteTenantAccount", - "operationId": "deleteTenantAccount", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteTenantRequest" - } + "summary": "Uninstall Solution Template (uninstallSolutionTemplate)", + "description": "Uninstall solution template based on the provided id\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", + "operationId": "uninstallSolutionTemplate", + "parameters": [ + { + "name": "solutionTemplateId", + "in": "path", + "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { "description": "OK" @@ -105222,7 +104141,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -105342,21 +104261,32 @@ ] } }, - "/api/signup/termsOfUseAccepted": { - "get": { + "/api/solutions/templates/{solutionTemplateId}/install": { + "post": { "tags": [ - "sign-up-controller" + "solution-controller" + ], + "summary": "Install Solution Template (installSolutionTemplate)", + "description": "Install solution template based on the provided id\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", + "operationId": "installSolutionTemplate", + "parameters": [ + { + "name": "solutionTemplateId", + "in": "path", + "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Check Terms Of User (termsOfUseAccepted)", - "description": "Checks that current user accepted the privacy policy.", - "operationId": "termsOfUseAccepted", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/SolutionInstallResponse" } } } @@ -105372,7 +104302,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -105492,32 +104422,20 @@ ] } }, - "/api/solutions/templates/details/{solutionTemplateId}": { + "/api/tenant/subscription": { "get": { "tags": [ - "solution-controller" - ], - "summary": "Get Solution template details (getSolutionTemplateDetails)", - "description": "Get a solution template details based on the provided id\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSolutionTemplateDetails", - "parameters": [ - { - "name": "solutionTemplateId", - "in": "path", - "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } + "subscription-controller" ], + "summary": "getTenantSubscription", + "operationId": "getTenantSubscription", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TenantSolutionTemplateDetails" + "$ref": "#/components/schemas/SubscriptionDetails" } } } @@ -105653,24 +104571,20 @@ ] } }, - "/api/solutions/templates/infos": { + "/api/tenant/subscription/mergedProfileConfig": { "get": { "tags": [ - "solution-controller" + "subscription-controller" ], - "summary": "Get Solution templates (getSolutionTemplateInfos)", - "description": "Get a list of solution template descriptors\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSolutionTemplateInfos", + "summary": "getMergedTenantProfileConfiguration", + "operationId": "getMergedTenantProfileConfiguration", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TenantSolutionTemplateInfo" - } + "$ref": "#/components/schemas/DefaultTenantProfileConfiguration" } } } @@ -105806,32 +104720,20 @@ ] } }, - "/api/solutions/templates/instructions/{solutionTemplateId}": { + "/api/tenant/subscription/trendzUsed": { "get": { "tags": [ - "solution-controller" - ], - "summary": "Get Solution Template Instructions (getSolutionTemplateInstructions)", - "description": "Get a solution template instructions based on the provided id\n\n Security check is performed to verify that the user has 'READ' permission for the entity (entities).", - "operationId": "getSolutionTemplateInstructions", - "parameters": [ - { - "name": "solutionTemplateId", - "in": "path", - "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } + "subscription-controller" ], + "summary": "trendzUsed", + "operationId": "trendzUsed", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TenantSolutionTemplateInstructions" + "type": "boolean" } } } @@ -105967,28 +104869,23 @@ ] } }, - "/api/solutions/templates/{solutionTemplateId}/delete": { - "delete": { + "/api/tenant/subscription/usage": { + "get": { "tags": [ - "solution-controller" - ], - "summary": "Uninstall Solution Template (uninstallSolutionTemplate)", - "description": "Uninstall solution template based on the provided id\n\n Security check is performed to verify that the user has 'DELETE' permission for the entity (entities).", - "operationId": "uninstallSolutionTemplate", - "parameters": [ - { - "name": "solutionTemplateId", - "in": "path", - "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } + "subscription-controller" ], + "summary": "getTenantSubscriptionUsage", + "operationId": "getTenantSubscriptionUsage", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriptionUsage" + } + } + } }, "400": { "description": "Bad Request", @@ -106121,19 +105018,17 @@ ] } }, - "/api/solutions/templates/{solutionTemplateId}/install": { - "post": { + "/api/tenantProfile/{tenantProfileId}/profileConfig": { + "get": { "tags": [ - "solution-controller" + "subscription-controller" ], - "summary": "Install Solution Template (installSolutionTemplate)", - "description": "Install solution template based on the provided id\n\n Security check is performed to verify that the user has 'WRITE' permission for the entity (entities).", - "operationId": "installSolutionTemplate", + "summary": "getTenantProfileConfigurationById", + "operationId": "getTenantProfileConfigurationById", "parameters": [ { - "name": "solutionTemplateId", + "name": "tenantProfileId", "in": "path", - "description": "A string value representing the solution template id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" @@ -106146,7 +105041,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SolutionInstallResponse" + "$ref": "#/components/schemas/DefaultTenantProfileConfiguration" } } } @@ -106162,7 +105057,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -106282,169 +105177,108 @@ ] } }, - "/api/tenant/subscription": { + "/api/resource": { "get": { "tags": [ - "subscription-controller" + "tb-resource-controller" ], - "summary": "getTenantSubscription", - "operationId": "getTenantSubscription", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SubscriptionDetails" - } - } + "summary": "Get Resource Infos (getResources)", + "description": "Returns a page of Resource Info objects owned by tenant or sysadmin. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Resource Info is a lightweight object that includes main information about the Resource excluding the heavyweight data. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getResources", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "resourceType", + "in": "query", + "description": "A string value representing the resource type.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "LWM2M_MODEL", + "JKS", + "PKCS_12", + "JS_MODULE" + ] } }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "resourceSubType", + "in": "query", + "description": "A string value representing the resource sub-type.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "EXTENSION", + "MODULE" + ] } }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the resource title.", + "required": false, + "schema": { + "type": "string" } }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ { - "HttpLoginForm": [] + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "createdTime", + "title", + "resourceType", + "tenantId" + ] + } }, { - "ApiKeyForm": [] + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } - ] - } - }, - "/api/tenant/subscription/mergedProfileConfig": { - "get": { - "tags": [ - "subscription-controller" ], - "summary": "getMergedTenantProfileConfiguration", - "operationId": "getMergedTenantProfileConfiguration", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DefaultTenantProfileConfiguration" + "$ref": "#/components/schemas/PageDataTbResourceInfo" } } } @@ -106578,22 +105412,31 @@ "ApiKeyForm": [] } ] - } - }, - "/api/tenant/subscription/trendzUsed": { - "get": { + }, + "post": { "tags": [ - "subscription-controller" + "tb-resource-controller" ], - "summary": "trendzUsed", - "operationId": "trendzUsed", + "summary": "Create Or Update Resource (saveResource)", + "description": "Create or update the Resource. When creating the Resource, platform generates Resource id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Resource id will be present in the response. Specify existing Resource id to update the Resource. Referencing non-existing Resource Id will cause 'Not Found' error. \n\nResource combination of the title with the key is unique in the scope of tenant. Remove 'id', 'tenantId' from the request body example (below) to create new Resource entity.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "saveResource", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TbResource" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -106609,7 +105452,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -106719,6 +105562,7 @@ } } }, + "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -106729,20 +105573,32 @@ ] } }, - "/api/tenant/subscription/usage": { + "/api/resource/info/{resourceId}": { "get": { "tags": [ - "subscription-controller" + "tb-resource-controller" + ], + "summary": "Get Resource Info (getResourceInfoById)", + "description": "Fetch the Resource Info object based on the provided Resource Id. Resource Info is a lightweight object that includes main information about the Resource excluding the heavyweight data. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getResourceInfoById", + "parameters": [ + { + "name": "resourceId", + "in": "path", + "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "getTenantSubscriptionUsage", - "operationId": "getTenantSubscriptionUsage", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SubscriptionUsage" + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -106878,30 +105734,41 @@ ] } }, - "/api/tenantProfile/{tenantProfileId}/profileConfig": { + "/api/resource/jks/{resourceId}/download": { "get": { "tags": [ - "subscription-controller" + "tb-resource-controller" ], - "summary": "getTenantProfileConfigurationById", - "operationId": "getTenantProfileConfigurationById", + "summary": "Download JKS Resource (downloadJksResourceIfChanged)", + "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "downloadJksResourceIfChanged", "parameters": [ { - "name": "tenantProfileId", + "name": "resourceId", "in": "path", + "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { "type": "string" } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { "200": { "description": "OK", "content": { - "application/json": { + "application/x-java-keystore": { "schema": { - "$ref": "#/components/schemas/DefaultTenantProfileConfiguration" + "type": "string", + "format": "binary" } } } @@ -107037,98 +105904,30 @@ ] } }, - "/api/resource": { + "/api/resource/js/{resourceId}/download": { "get": { "tags": [ "tb-resource-controller" ], - "summary": "Get Resource Infos (getResources)", - "description": "Returns a page of Resource Info objects owned by tenant or sysadmin. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Resource Info is a lightweight object that includes main information about the Resource excluding the heavyweight data. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getResources", + "summary": "Download JS Resource (downloadJsResourceIfChanged)", + "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for any authorized user. ", + "operationId": "downloadJsResourceIfChanged", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "resourceId", + "in": "path", + "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "resourceType", - "in": "query", - "description": "A string value representing the resource type.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "LWM2M_MODEL", - "JKS", - "PKCS_12", - "JS_MODULE" - ] - } - }, - { - "name": "resourceSubType", - "in": "query", - "description": "A string value representing the resource sub-type.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "EXTENSION", - "MODULE" - ] - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the resource title.", - "required": false, "schema": { "type": "string" } }, { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "title", - "resourceType", - "tenantId" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "name": "If-None-Match", + "in": "header", "required": false, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "string" } } ], @@ -107136,9 +105935,10 @@ "200": { "description": "OK", "content": { - "application/json": { + "application/javascript": { "schema": { - "$ref": "#/components/schemas/PageDataTbResourceInfo" + "type": "string", + "format": "binary" } } } @@ -107272,31 +106072,39 @@ "ApiKeyForm": [] } ] - }, - "post": { + } + }, + "/api/resource/list": { + "get": { "tags": [ "tb-resource-controller" ], - "summary": "Create Or Update Resource (saveResource)", - "description": "Create or update the Resource. When creating the Resource, platform generates Resource id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created Resource id will be present in the response. Specify existing Resource id to update the Resource. Referencing non-existing Resource Id will cause 'Not Found' error. \n\nResource combination of the title with the key is unique in the scope of tenant. Remove 'id', 'tenantId' from the request body example (below) to create new Resource entity.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "saveResource", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TbResource" + "summary": "Get Resource Infos by ids (getSystemOrTenantResourcesByIds)", + "operationId": "getSystemOrTenantResourcesByIds", + "parameters": [ + { + "name": "resourceIds", + "in": "query", + "description": "A list of resource ids, separated by comma ','", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" } } - }, - "required": true - }, + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/TbResourceInfo" + } } } } @@ -107312,7 +106120,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -107422,7 +106230,6 @@ } } }, - "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -107433,22 +106240,51 @@ ] } }, - "/api/resource/info/{resourceId}": { + "/api/resource/lwm2m": { "get": { "tags": [ "tb-resource-controller" ], - "summary": "Get Resource Info (getResourceInfoById)", - "description": "Fetch the Resource Info object based on the provided Resource Id. Resource Info is a lightweight object that includes main information about the Resource excluding the heavyweight data. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getResourceInfoById", + "summary": "Get LwM2M Objects (getLwm2mListObjects)", + "description": "Returns a page of LwM2M objects parsed from Resources with type 'LWM2M_MODEL' owned by tenant or sysadmin. You can specify parameters to filter the results. LwM2M Object is a object that includes information about the LwM2M model which can be used in transport configuration for the LwM2M device profile. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getLwm2mListObjects", "parameters": [ { - "name": "resourceId", - "in": "path", - "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", "required": true, "schema": { - "type": "string" + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": true, + "schema": { + "type": "string", + "enum": [ + "id", + "name" + ] + } + }, + { + "name": "objectIds", + "in": "query", + "description": "LwM2M Object ids.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } } } ], @@ -107458,7 +106294,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "type": "array", + "items": { + "$ref": "#/components/schemas/LwM2mObject" + } } } } @@ -107594,41 +106433,81 @@ ] } }, - "/api/resource/jks/{resourceId}/download": { + "/api/resource/lwm2m/page": { "get": { "tags": [ "tb-resource-controller" ], - "summary": "Download JKS Resource (downloadJksResourceIfChanged)", - "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "downloadJksResourceIfChanged", + "summary": "Get LwM2M Objects (getLwm2mListObjectsPage)", + "description": "Returns a page of LwM2M objects parsed from Resources with type 'LWM2M_MODEL' owned by tenant or sysadmin. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. LwM2M Object is a object that includes information about the LwM2M model which can be used in transport configuration for the LwM2M device profile. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getLwm2mListObjectsPage", "parameters": [ { - "name": "resourceId", - "in": "path", - "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "name": "pageSize", + "in": "query", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int32" } }, { - "name": "If-None-Match", - "in": "header", + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the resource title.", "required": false, "schema": { "type": "string" } + }, + { + "name": "sortProperty", + "in": "query", + "description": "Property of entity to sort by", + "required": false, + "schema": { + "type": "string", + "enum": [ + "id", + "name" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ASC", + "DESC" + ] + } } ], "responses": { "200": { "description": "OK", "content": { - "application/x-java-keystore": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "type": "array", + "items": { + "$ref": "#/components/schemas/LwM2mObject" + } } } } @@ -107764,14 +106643,14 @@ ] } }, - "/api/resource/js/{resourceId}/download": { + "/api/resource/lwm2m/{resourceId}/download": { "get": { "tags": [ "tb-resource-controller" ], - "summary": "Download JS Resource (downloadJsResourceIfChanged)", - "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for any authorized user. ", - "operationId": "downloadJsResourceIfChanged", + "summary": "Download LWM2M Resource (downloadLwm2mResourceIfChanged)", + "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "downloadLwm2mResourceIfChanged", "parameters": [ { "name": "resourceId", @@ -107795,7 +106674,7 @@ "200": { "description": "OK", "content": { - "application/javascript": { + "application/xml": { "schema": { "type": "string", "format": "binary" @@ -107934,24 +106813,30 @@ ] } }, - "/api/resource/list": { + "/api/resource/pkcs12/{resourceId}/download": { "get": { "tags": [ "tb-resource-controller" ], - "summary": "Get Resource Infos by ids (getSystemOrTenantResourcesByIds)", - "operationId": "getSystemOrTenantResourcesByIds", + "summary": "Download PKCS_12 Resource (downloadPkcs12ResourceIfChanged)", + "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "downloadPkcs12ResourceIfChanged", "parameters": [ { - "name": "resourceIds", - "in": "query", - "description": "A list of resource ids, separated by comma ','", + "name": "resourceId", + "in": "path", + "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string" + } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "schema": { + "type": "string" } } ], @@ -107959,12 +106844,10 @@ "200": { "description": "OK", "content": { - "application/json": { + "application/x-pkcs12": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TbResourceInfo" - } + "type": "string", + "format": "binary" } } } @@ -108100,51 +106983,70 @@ ] } }, - "/api/resource/lwm2m": { + "/api/resource/tenant": { "get": { "tags": [ "tb-resource-controller" ], - "summary": "Get LwM2M Objects (getLwm2mListObjects)", - "description": "Returns a page of LwM2M objects parsed from Resources with type 'LWM2M_MODEL' owned by tenant or sysadmin. You can specify parameters to filter the results. LwM2M Object is a object that includes information about the LwM2M model which can be used in transport configuration for the LwM2M device profile. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getLwm2mListObjects", + "summary": "Get All Resource Infos (getTenantResources)", + "description": "Returns a page of Resource Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Resource Info is a lightweight object that includes main information about the Resource excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' authority.", + "operationId": "getTenantResources", "parameters": [ { - "name": "sortOrder", + "name": "pageSize", "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "description": "Maximum amount of entities in a one page", "required": true, "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "type": "integer", + "format": "int32" + } + }, + { + "name": "page", + "in": "query", + "description": "Sequence number of page starting from 0", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "textSearch", + "in": "query", + "description": "The case insensitive 'substring' filter based on the resource title.", + "required": false, + "schema": { + "type": "string" } }, { "name": "sortProperty", "in": "query", "description": "Property of entity to sort by", - "required": true, + "required": false, "schema": { "type": "string", "enum": [ - "id", - "name" + "createdTime", + "title", + "resourceType", + "tenantId" ] } }, { - "name": "objectIds", + "name": "sortOrder", "in": "query", - "description": "LwM2M Object ids.", - "required": true, + "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", + "required": false, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "string", + "enum": [ + "ASC", + "DESC" + ] } } ], @@ -108154,10 +107056,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LwM2mObject" - } + "$ref": "#/components/schemas/PageDataTbResourceInfo" } } } @@ -108293,81 +107192,57 @@ ] } }, - "/api/resource/lwm2m/page": { - "get": { + "/api/resource/upload": { + "post": { "tags": [ "tb-resource-controller" ], - "summary": "Get LwM2M Objects (getLwm2mListObjectsPage)", - "description": "Returns a page of LwM2M objects parsed from Resources with type 'LWM2M_MODEL' owned by tenant or sysadmin. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. LwM2M Object is a object that includes information about the LwM2M model which can be used in transport configuration for the LwM2M device profile. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getLwm2mListObjectsPage", - "parameters": [ - { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the resource title.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "id", - "name" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] + "summary": "Upload Resource via Multipart File (uploadResource)", + "description": "Create the Resource using multipart file upload. \n\nResource combination of the title with the key is unique in the scope of tenant. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "uploadResource", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Resource title." + }, + "resourceType": { + "type": "string", + "description": "Resource type." + }, + "descriptor": { + "type": "string", + "description": "Resource descriptor (JSON)." + }, + "resourceSubType": { + "type": "string", + "description": "Resource sub type." + }, + "file": { + "type": "string", + "format": "binary", + "description": "Resource file." + } + }, + "required": [ + "file", + "resourceType" + ] + } } } - ], + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LwM2mObject" - } + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -108383,7 +107258,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid UUID string: 123", + "message": "Invalid request body", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -108503,41 +107378,51 @@ ] } }, - "/api/resource/lwm2m/{resourceId}/download": { - "get": { + "/api/resource/{id}/data": { + "put": { "tags": [ "tb-resource-controller" ], - "summary": "Download LWM2M Resource (downloadLwm2mResourceIfChanged)", - "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "downloadLwm2mResourceIfChanged", + "summary": "updateResourceData", + "operationId": "updateResourceData", "parameters": [ { - "name": "resourceId", + "name": "id", "in": "path", - "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Unique identifier of the Resource to update", "required": true, "schema": { - "type": "string" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "Resource file." + } + }, + "required": [ + "file" + ] + } + } + } + }, "responses": { "200": { "description": "OK", "content": { - "application/xml": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -108673,41 +107558,42 @@ ] } }, - "/api/resource/pkcs12/{resourceId}/download": { - "get": { + "/api/resource/{id}/info": { + "put": { "tags": [ "tb-resource-controller" ], - "summary": "Download PKCS_12 Resource (downloadPkcs12ResourceIfChanged)", - "description": "Download Resource based on the provided Resource Id or return 304 status code if resource was not changed.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "downloadPkcs12ResourceIfChanged", + "summary": "updateResourceInfo", + "operationId": "updateResourceInfo", "parameters": [ { - "name": "resourceId", + "name": "id", "in": "path", - "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "description": "Unique identifier of the Resource to update", "required": true, "schema": { - "type": "string" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TbResourceInfo" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { - "application/x-pkcs12": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/TbResourceInfo" } } } @@ -108843,71 +107729,23 @@ ] } }, - "/api/resource/tenant": { + "/api/resource/{resourceId}": { "get": { "tags": [ "tb-resource-controller" ], - "summary": "Get All Resource Infos (getTenantResources)", - "description": "Returns a page of Resource Info objects owned by tenant. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. Resource Info is a lightweight object that includes main information about the Resource excluding the heavyweight data. \n\nAvailable for users with 'TENANT_ADMIN' authority.", - "operationId": "getTenantResources", + "summary": "Get Resource (getResourceById)", + "description": "Fetch the Resource object based on the provided Resource Id. Resource is a heavyweight object that includes main information about the Resource and also data. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "getResourceById", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "Maximum amount of entities in a one page", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "page", - "in": "query", - "description": "Sequence number of page starting from 0", + "name": "resourceId", + "in": "path", + "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "textSearch", - "in": "query", - "description": "The case insensitive 'substring' filter based on the resource title.", - "required": false, "schema": { "type": "string" } - }, - { - "name": "sortProperty", - "in": "query", - "description": "Property of entity to sort by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "createdTime", - "title", - "resourceType", - "tenantId" - ] - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sort order. ASC (ASCENDING) or DESC (DESCENDING)", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } } ], "responses": { @@ -108916,7 +107754,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PageDataTbResourceInfo" + "$ref": "#/components/schemas/TbResource" } } } @@ -109042,6 +107880,7 @@ } } }, + "deprecated": true, "security": [ { "HttpLoginForm": [] @@ -109050,59 +107889,40 @@ "ApiKeyForm": [] } ] - } - }, - "/api/resource/upload": { - "post": { + }, + "delete": { "tags": [ "tb-resource-controller" ], - "summary": "Upload Resource via Multipart File (uploadResource)", - "description": "Create the Resource using multipart file upload. \n\nResource combination of the title with the key is unique in the scope of tenant. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "uploadResource", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "Resource title." - }, - "resourceType": { - "type": "string", - "description": "Resource type." - }, - "descriptor": { - "type": "string", - "description": "Resource descriptor (JSON)." - }, - "resourceSubType": { - "type": "string", - "description": "Resource sub type." - }, - "file": { - "type": "string", - "format": "binary", - "description": "Resource file." - } - }, - "required": [ - "file", - "resourceType" - ] - } + "summary": "Delete Resource (deleteResource)", + "description": "Deletes the Resource. Referencing non-existing Resource Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "deleteResource", + "parameters": [ + { + "name": "resourceId", + "in": "path", + "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "required": false, + "schema": { + "type": "boolean" } } - }, + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "$ref": "#/components/schemas/TbResourceDeleteResult" } } } @@ -109118,7 +107938,7 @@ "error-code-400": { "summary": "Bad Request", "value": { - "message": "Invalid request body", + "message": "Invalid UUID string: 123", "errorCode": 31, "status": 400, "subscriptionErrorCode": null, @@ -109238,51 +108058,33 @@ ] } }, - "/api/resource/{id}/data": { - "put": { + "/api/resource/{resourceId}/download": { + "get": { "tags": [ "tb-resource-controller" ], - "summary": "updateResourceData", - "operationId": "updateResourceData", + "summary": "Download Resource (downloadResource)", + "description": "Download Resource based on the provided Resource Id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", + "operationId": "downloadResource", "parameters": [ { - "name": "id", + "name": "resourceId", "in": "path", - "description": "Unique identifier of the Resource to update", + "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "Resource file." - } - }, - "required": [ - "file" - ] - } - } - } - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" + "type": "string", + "format": "binary" } } } @@ -109418,732 +108220,70 @@ ] } }, - "/api/resource/{id}/info": { - "put": { + "/api/resource/{resourceType}/{scope}/{key}": { + "get": { "tags": [ "tb-resource-controller" ], - "summary": "updateResourceInfo", - "operationId": "updateResourceInfo", + "summary": "Download resource (downloadResourceIfChanged)", + "description": "Download resource with a given type and key for the given scope\n\nAvailable for any authorized user. ", + "operationId": "downloadResourceIfChanged", "parameters": [ { - "name": "id", + "name": "resourceType", "in": "path", - "description": "Unique identifier of the Resource to update", + "description": "Type of the resource", "required": true, "schema": { "type": "string", - "format": "uuid" + "enum": [ + "lwm2m_model", + "jks", + "pkcs_12", + "js_module", + "dashboard" + ] } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TbResourceInfo" - } + }, + { + "name": "scope", + "in": "path", + "description": "Scope of the resource", + "required": true, + "schema": { + "type": "string", + "enum": [ + "system", + "tenant" + ] } }, - "required": true - }, + { + "name": "key", + "in": "path", + "description": "Key of the resource, e.g. 'extension.js'", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TbResourceInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - } - }, - "/api/resource/{resourceId}": { - "get": { - "tags": [ - "tb-resource-controller" - ], - "summary": "Get Resource (getResourceById)", - "description": "Fetch the Resource object based on the provided Resource Id. Resource is a heavyweight object that includes main information about the Resource and also data. \n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "getResourceById", - "parameters": [ - { - "name": "resourceId", - "in": "path", - "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TbResource" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "deprecated": true, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - }, - "delete": { - "tags": [ - "tb-resource-controller" - ], - "summary": "Delete Resource (deleteResource)", - "description": "Deletes the Resource. Referencing non-existing Resource Id will cause an error.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "deleteResource", - "parameters": [ - { - "name": "resourceId", - "in": "path", - "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "force", - "in": "query", - "required": false, - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TbResourceDeleteResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - } - }, - "/api/resource/{resourceId}/download": { - "get": { - "tags": [ - "tb-resource-controller" - ], - "summary": "Download Resource (downloadResource)", - "description": "Download Resource based on the provided Resource Id.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority.", - "operationId": "downloadResource", - "parameters": [ - { - "name": "resourceId", - "in": "path", - "description": "A string value representing the resource id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-400": { - "summary": "Bad Request", - "value": { - "message": "Invalid UUID string: 123", - "errorCode": 31, - "status": 400, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-401": { - "summary": "Unauthorized", - "value": { - "message": "Authentication failed", - "errorCode": 10, - "status": 401, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-403": { - "summary": "Forbidden", - "value": { - "message": "You don't have permission to perform this operation!", - "errorCode": 20, - "status": 403, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-404": { - "summary": "Not Found", - "value": { - "message": "Requested item wasn't found!", - "errorCode": 32, - "status": 404, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ThingsboardErrorResponse" - }, - "examples": { - "error-code-429": { - "summary": "Too Many Requests", - "value": { - "message": "Too many requests for current tenant!", - "errorCode": 33, - "status": 429, - "subscriptionErrorCode": null, - "subscriptionEntry": null, - "subscriptionValue": null, - "timestamp": 1609459200000 - } - } - } - } - } - } - }, - "security": [ - { - "HttpLoginForm": [] - }, - { - "ApiKeyForm": [] - } - ] - } - }, - "/api/resource/{resourceType}/{scope}/{key}": { - "get": { - "tags": [ - "tb-resource-controller" - ], - "summary": "Download resource (downloadResourceIfChanged)", - "description": "Download resource with a given type and key for the given scope\n\nAvailable for any authorized user. ", - "operationId": "downloadResourceIfChanged", - "parameters": [ - { - "name": "resourceType", - "in": "path", - "description": "Type of the resource", - "required": true, - "schema": { - "type": "string", - "enum": [ - "lwm2m_model", - "jks", - "pkcs_12", - "js_module", - "dashboard" - ] - } - }, - { - "name": "scope", - "in": "path", - "description": "Scope of the resource", - "required": true, - "schema": { - "type": "string", - "enum": [ - "system", - "tenant" - ] - } - }, - { - "name": "key", - "in": "path", - "description": "Key of the resource, e.g. 'extension.js'", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "string", - "format": "binary" + "type": "string", + "format": "binary" } } } @@ -135375,9 +133515,7 @@ "TS_ROLLING" ] }, - "ArrayNode": { - - }, + "ArrayNode": {}, "Asset": { "type": "object", "properties": { @@ -137754,9 +135892,7 @@ "ContactBasedObject": { "type": "object", "properties": { - "id": { - - }, + "id": {}, "createdTime": { "type": "integer", "format": "int64", @@ -143612,9 +141748,6 @@ "oauthEnabled": { "type": "boolean" }, - "notificationEnabled": { - "type": "boolean" - }, "whiteLabelingEnabled": { "type": "boolean" }, @@ -143623,6 +141756,9 @@ }, "emailEnabled": { "type": "boolean" + }, + "notificationEnabled": { + "type": "boolean" } } }, @@ -144318,9 +142454,7 @@ "HasIdObject": { "type": "object", "properties": { - "id": { - - } + "id": {} } }, "HeaderFooter": { @@ -145181,9 +143315,7 @@ }, "JsonNode": { "description": "A value representing the any type (object or primitive)", - "example": { - - } + "example": {} }, "JsonTransportPayloadConfiguration": { "allOf": [ @@ -146224,9 +144356,7 @@ "useOldApi": { "type": "boolean" }, - "id": { - - }, + "id": {}, "title": { "type": "string" }, @@ -148702,7 +146832,7 @@ "version": { "type": "string", "description": "OTA Package version.", - "example": 1 + "example": 1.0 }, "tag": { "type": "string", @@ -148866,7 +146996,7 @@ "version": { "type": "string", "description": "OTA Package version.", - "example": 1 + "example": 1.0 }, "tag": { "type": "string", @@ -149009,9 +147139,7 @@ "type" ] }, - "OutputStrategy": { - - }, + "OutputStrategy": {}, "PSKLwM2MBootstrapServerCredential": { "allOf": [ { @@ -152853,6 +150981,12 @@ "$ref": "#/components/schemas/TbReportFormat", "description": "Report format" }, + "entityAliases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityAlias" + } + }, "filters": { "type": "array", "items": { @@ -152870,12 +151004,6 @@ }, "timeDataPattern": { "type": "string" - }, - "entityAliases": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityAlias" - } } }, "required": [ @@ -153049,15 +151177,15 @@ "legendValueColor": { "type": "string" }, + "xaxis": { + "$ref": "#/components/schemas/TimeSeriesChartXAxisSettings" + }, "yaxes": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/TimeSeriesChartYAxisSettings" } }, - "xaxis": { - "$ref": "#/components/schemas/TimeSeriesChartXAxisSettings" - }, "thresholds": { "type": "array", "items": { @@ -154178,7 +152306,7 @@ "version": { "type": "string", "description": "OTA Package version.", - "example": 1 + "example": 1.0 }, "tag": { "type": "string", @@ -154854,9 +152982,7 @@ "MOBILE" ] }, - "ServerSentEventString": { - - }, + "ServerSentEventString": {}, "ShareGroupRequest": { "type": "object", "description": "The Share Group Request JSON", @@ -155989,11 +154115,33 @@ }, "SubscriptionEntry": { "description": "Subscription entry", - "enum": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 31] + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 30, + 31 + ] }, "SubscriptionExceptionErrorCode": { "description": "Subscription error code", - "enum": [1, 2, 3, 4, 5, 6, 7] + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ] }, "SubscriptionId": { "type": "object", @@ -156262,9 +154410,7 @@ } } }, - "SystemLevelUsersFilter": { - - }, + "SystemLevelUsersFilter": {}, "TableSortOrder": { "type": "object", "properties": { @@ -157521,7 +155667,24 @@ }, "ThingsboardErrorCode": { "description": "Platform error code", - "enum": [2, 10, 11, 15, 20, 30, 31, 32, 33, 34, 35, 40, 41, 45, 46, 50] + "enum": [ + 2, + 10, + 11, + 15, + 20, + 30, + 31, + 32, + 33, + 34, + 35, + 40, + 41, + 45, + 46, + 50 + ] }, "ThingsboardErrorResponse": { "properties": { @@ -158339,39 +156502,27 @@ "properties": { "metricSummaryItems": { "type": "array", - "items": { - - } + "items": {} }, "anomalyModelSummaryItems": { "type": "array", - "items": { - - } + "items": {} }, "calculationFieldSummaryItems": { "type": "array", - "items": { - - } + "items": {} }, "predictionModelSummaryItems": { "type": "array", - "items": { - - } + "items": {} }, "viewSummaryItems": { "type": "array", - "items": { - - } + "items": {} }, "aiSummaryItems": { "type": "array", - "items": { - - } + "items": {} } } }, @@ -158454,9 +156605,7 @@ }, "runtimeFilters": { "type": "array", - "items": { - - } + "items": {} } } }, @@ -158496,20 +156645,10 @@ "type": "integer", "format": "int64" }, - "value": { - - }, + "value": {}, "key": { "type": "string" }, - "doubleValue": { - "type": "number", - "format": "double" - }, - "longValue": { - "type": "integer", - "format": "int64" - }, "booleanValue": { "type": "boolean" }, @@ -158525,6 +156664,14 @@ "strValue": { "type": "string" }, + "longValue": { + "type": "integer", + "format": "int64" + }, + "doubleValue": { + "type": "number", + "format": "double" + }, "version": { "type": "integer", "format": "int64" @@ -159308,9 +157455,7 @@ } } }, - "Version": { - - }, + "Version": {}, "VersionCreateConfig": { "type": "object", "properties": { @@ -160326,10 +158471,10 @@ }, "ApiKeyForm": { "type": "apiKey", - "description": "Enter the API key value with 'ApiKey' prefix in format: **ApiKey \u003Cyour_api_key_value\u003E**\n\nExample: **ApiKey tb_5te51SkLRYpjGrujUGwqkjFvooWBlQpVe2An2Dr3w13wjfxDW**\n\n\u003Cbr\u003E**NOTE**: Use only ONE authentication method at a time. If both are authorized, JWT auth takes the priority.\u003Cbr\u003E\n", + "description": "Enter the API key value with 'ApiKey' prefix in format: **ApiKey **\n\nExample: **ApiKey tb_5te51SkLRYpjGrujUGwqkjFvooWBlQpVe2An2Dr3w13wjfxDW**\n\n
**NOTE**: Use only ONE authentication method at a time. If both are authorized, JWT auth takes the priority.
\n", "name": "X-Authorization", "in": "header" } } } -} \ No newline at end of file +} diff --git a/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java b/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java index 5060220e..fba9ed9c 100644 --- a/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java +++ b/paas/src/main/java/org/thingsboard/client/api/ThingsboardApi.java @@ -36122,157 +36122,6 @@ private HttpRequest.Builder getDefaultTenantProfileInfoRequestBuilder(Map headers) throws ApiException { - ApiResponse localVarResponse = getDeviceAttributesWithHttpInfo(deviceToken, clientKeys, sharedKeys, headers); - return localVarResponse.getData(); - } - - /** - * Get attributes (getDeviceAttributes) - * Returns all attributes that belong to device. Use optional 'clientKeys' and/or 'sharedKeys' parameter to return specific attributes. Example of the result: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param clientKeys Comma separated key names for attribute with client scope (required) - * @param sharedKeys Comma separated key names for attribute with shared scope (required) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse getDeviceAttributesWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String clientKeys, @javax.annotation.Nonnull String sharedKeys) throws ApiException { - return getDeviceAttributesWithHttpInfo(deviceToken, clientKeys, sharedKeys, null); - } - - /** - * Get attributes (getDeviceAttributes) - * Returns all attributes that belong to device. Use optional 'clientKeys' and/or 'sharedKeys' parameter to return specific attributes. Example of the result: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param clientKeys Comma separated key names for attribute with client scope (required) - * @param sharedKeys Comma separated key names for attribute with shared scope (required) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse getDeviceAttributesWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String clientKeys, @javax.annotation.Nonnull String sharedKeys, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getDeviceAttributesRequestBuilder(deviceToken, clientKeys, sharedKeys, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getDeviceAttributes", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getDeviceAttributesRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String clientKeys, @javax.annotation.Nonnull String sharedKeys, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling getDeviceAttributes"); - } - // verify the required parameter 'clientKeys' is set - if (clientKeys == null) { - throw new ApiException(400, "Missing the required parameter 'clientKeys' when calling getDeviceAttributes"); - } - // verify the required parameter 'sharedKeys' is set - if (sharedKeys == null) { - throw new ApiException(400, "Missing the required parameter 'sharedKeys' when calling getDeviceAttributes"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/attributes" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "clientKeys"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("clientKeys", clientKeys)); - localVarQueryParameterBaseName = "sharedKeys"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("sharedKeys", sharedKeys)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Get Device (getDeviceById) * Fetch the Device object based on the provided Device Id. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. Security check is performed to verify that the user has 'READ' permission for the entity (entities). @@ -44630,169 +44479,6 @@ private HttpRequest.Builder getFeaturesInfoRequestBuilder(Map he return localVarRequestBuilder; } - /** - * Get Device Firmware (getFirmware) - * Downloads the current firmware package.When the platform initiates firmware update, it informs the device by updating the 'fw_title', 'fw_version', 'fw_checksum' and 'fw_checksum_algorithm' shared attributes.The 'fw_title' and 'fw_version' parameters must be supplied in this request to double-check that the firmware that device is downloading matches the firmware it expects to download. This is important, since the administrator may change the firmware assignment while device is downloading the firmware. Optional 'chunk' and 'size' parameters may be used to download the firmware in chunks. For example, device may request first 16 KB of firmware using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the firmware, corresponds to the value of 'fw_title' attribute. (required) - * @param version Version of the firmware, corresponds to the value of 'fw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @return String - * @throws ApiException if fails to make API call - */ - public String getFirmware(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk) throws ApiException { - return getFirmware(deviceToken, title, version, size, chunk, null); - } - - /** - * Get Device Firmware (getFirmware) - * Downloads the current firmware package.When the platform initiates firmware update, it informs the device by updating the 'fw_title', 'fw_version', 'fw_checksum' and 'fw_checksum_algorithm' shared attributes.The 'fw_title' and 'fw_version' parameters must be supplied in this request to double-check that the firmware that device is downloading matches the firmware it expects to download. This is important, since the administrator may change the firmware assignment while device is downloading the firmware. Optional 'chunk' and 'size' parameters may be used to download the firmware in chunks. For example, device may request first 16 KB of firmware using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the firmware, corresponds to the value of 'fw_title' attribute. (required) - * @param version Version of the firmware, corresponds to the value of 'fw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String getFirmware(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk, Map headers) throws ApiException { - ApiResponse localVarResponse = getFirmwareWithHttpInfo(deviceToken, title, version, size, chunk, headers); - return localVarResponse.getData(); - } - - /** - * Get Device Firmware (getFirmware) - * Downloads the current firmware package.When the platform initiates firmware update, it informs the device by updating the 'fw_title', 'fw_version', 'fw_checksum' and 'fw_checksum_algorithm' shared attributes.The 'fw_title' and 'fw_version' parameters must be supplied in this request to double-check that the firmware that device is downloading matches the firmware it expects to download. This is important, since the administrator may change the firmware assignment while device is downloading the firmware. Optional 'chunk' and 'size' parameters may be used to download the firmware in chunks. For example, device may request first 16 KB of firmware using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the firmware, corresponds to the value of 'fw_title' attribute. (required) - * @param version Version of the firmware, corresponds to the value of 'fw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse getFirmwareWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk) throws ApiException { - return getFirmwareWithHttpInfo(deviceToken, title, version, size, chunk, null); - } - - /** - * Get Device Firmware (getFirmware) - * Downloads the current firmware package.When the platform initiates firmware update, it informs the device by updating the 'fw_title', 'fw_version', 'fw_checksum' and 'fw_checksum_algorithm' shared attributes.The 'fw_title' and 'fw_version' parameters must be supplied in this request to double-check that the firmware that device is downloading matches the firmware it expects to download. This is important, since the administrator may change the firmware assignment while device is downloading the firmware. Optional 'chunk' and 'size' parameters may be used to download the firmware in chunks. For example, device may request first 16 KB of firmware using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the firmware, corresponds to the value of 'fw_title' attribute. (required) - * @param version Version of the firmware, corresponds to the value of 'fw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without chunks. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse getFirmwareWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getFirmwareRequestBuilder(deviceToken, title, version, size, chunk, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getFirmware", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getFirmwareRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling getFirmware"); - } - // verify the required parameter 'title' is set - if (title == null) { - throw new ApiException(400, "Missing the required parameter 'title' when calling getFirmware"); - } - // verify the required parameter 'version' is set - if (version == null) { - throw new ApiException(400, "Missing the required parameter 'version' when calling getFirmware"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/firmware" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "title"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("title", title)); - localVarQueryParameterBaseName = "version"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("version", version)); - localVarQueryParameterBaseName = "size"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); - localVarQueryParameterBaseName = "chunk"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("chunk", chunk)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * getFirmwareById * @@ -60684,169 +60370,6 @@ private HttpRequest.Builder getSignUpSelfRegistrationParamsRequestBuilder(@javax return localVarRequestBuilder; } - /** - * Get Device Software (getSoftware) - * Downloads the current software package.When the platform initiates software update, it informs the device by updating the 'sw_title', 'sw_version', 'sw_checksum' and 'sw_checksum_algorithm' shared attributes.The 'sw_title' and 'sw_version' parameters must be supplied in this request to double-check that the software that device is downloading matches the software it expects to download. This is important, since the administrator may change the software assignment while device is downloading the software. Optional 'chunk' and 'size' parameters may be used to download the software in chunks. For example, device may request first 16 KB of software using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the software, corresponds to the value of 'sw_title' attribute. (required) - * @param version Version of the software, corresponds to the value of 'sw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @return String - * @throws ApiException if fails to make API call - */ - public String getSoftware(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk) throws ApiException { - return getSoftware(deviceToken, title, version, size, chunk, null); - } - - /** - * Get Device Software (getSoftware) - * Downloads the current software package.When the platform initiates software update, it informs the device by updating the 'sw_title', 'sw_version', 'sw_checksum' and 'sw_checksum_algorithm' shared attributes.The 'sw_title' and 'sw_version' parameters must be supplied in this request to double-check that the software that device is downloading matches the software it expects to download. This is important, since the administrator may change the software assignment while device is downloading the software. Optional 'chunk' and 'size' parameters may be used to download the software in chunks. For example, device may request first 16 KB of software using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the software, corresponds to the value of 'sw_title' attribute. (required) - * @param version Version of the software, corresponds to the value of 'sw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String getSoftware(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk, Map headers) throws ApiException { - ApiResponse localVarResponse = getSoftwareWithHttpInfo(deviceToken, title, version, size, chunk, headers); - return localVarResponse.getData(); - } - - /** - * Get Device Software (getSoftware) - * Downloads the current software package.When the platform initiates software update, it informs the device by updating the 'sw_title', 'sw_version', 'sw_checksum' and 'sw_checksum_algorithm' shared attributes.The 'sw_title' and 'sw_version' parameters must be supplied in this request to double-check that the software that device is downloading matches the software it expects to download. This is important, since the administrator may change the software assignment while device is downloading the software. Optional 'chunk' and 'size' parameters may be used to download the software in chunks. For example, device may request first 16 KB of software using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the software, corresponds to the value of 'sw_title' attribute. (required) - * @param version Version of the software, corresponds to the value of 'sw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse getSoftwareWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk) throws ApiException { - return getSoftwareWithHttpInfo(deviceToken, title, version, size, chunk, null); - } - - /** - * Get Device Software (getSoftware) - * Downloads the current software package.When the platform initiates software update, it informs the device by updating the 'sw_title', 'sw_version', 'sw_checksum' and 'sw_checksum_algorithm' shared attributes.The 'sw_title' and 'sw_version' parameters must be supplied in this request to double-check that the software that device is downloading matches the software it expects to download. This is important, since the administrator may change the software assignment while device is downloading the software. Optional 'chunk' and 'size' parameters may be used to download the software in chunks. For example, device may request first 16 KB of software using 'chunk'=0 and 'size'=16384. Next 16KB using 'chunk'=1 and 'size'=16384. The last chunk should have less bytes then requested using 'size' parameter. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param title Title of the software, corresponds to the value of 'sw_title' attribute. (required) - * @param version Version of the software, corresponds to the value of 'sw_version' attribute. (required) - * @param size Size of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @param chunk Index of the chunk. Optional. Omit to download the entire file without using chunks. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse getSoftwareWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getSoftwareRequestBuilder(deviceToken, title, version, size, chunk, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getSoftware", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getSoftwareRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String title, @javax.annotation.Nonnull String version, @javax.annotation.Nullable Integer size, @javax.annotation.Nullable Integer chunk, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling getSoftware"); - } - // verify the required parameter 'title' is set - if (title == null) { - throw new ApiException(400, "Missing the required parameter 'title' when calling getSoftware"); - } - // verify the required parameter 'version' is set - if (version == null) { - throw new ApiException(400, "Missing the required parameter 'version' when calling getSoftware"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/software" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "title"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("title", title)); - localVarQueryParameterBaseName = "version"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("version", version)); - localVarQueryParameterBaseName = "size"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); - localVarQueryParameterBaseName = "chunk"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("chunk", chunk)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Get Solution template details (getSolutionTemplateDetails) * Get a solution template details based on the provided id Security check is performed to verify that the user has 'READ' permission for the entity (entities). @@ -78424,387 +77947,6 @@ private HttpRequest.Builder performTrendzHealthcheckRequestBuilder(Map headers) throws ApiException { - ApiResponse localVarResponse = postDeviceAttributesWithHttpInfo(deviceToken, body, headers); - return localVarResponse.getData(); - } - - /** - * Post attributes (postDeviceAttributes) - * Post client attribute updates on behalf of device. Example of the request: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body JSON with attribute key-value pairs. See API call description for example. (required) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse postDeviceAttributesWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body) throws ApiException { - return postDeviceAttributesWithHttpInfo(deviceToken, body, null); - } - - /** - * Post attributes (postDeviceAttributes) - * Post client attribute updates on behalf of device. Example of the request: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body JSON with attribute key-value pairs. See API call description for example. (required) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse postDeviceAttributesWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postDeviceAttributesRequestBuilder(deviceToken, body, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("postDeviceAttributes", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder postDeviceAttributesRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling postDeviceAttributes"); - } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling postDeviceAttributes"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/attributes" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - - /** - * Send the RPC command (postRpcRequest) - * Send the RPC request to server. The request payload is a JSON document that contains 'method' and 'params'. For example: ```json {\"method\": \"sumOnServer\", \"params\":{\"a\":2, \"b\":2}} ``` The response contains arbitrary JSON with the RPC reply. For example: ```json {\"result\": 4} ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body The RPC request JSON (required) - * @return String - * @throws ApiException if fails to make API call - */ - public String postRpcRequest(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body) throws ApiException { - return postRpcRequest(deviceToken, body, null); - } - - /** - * Send the RPC command (postRpcRequest) - * Send the RPC request to server. The request payload is a JSON document that contains 'method' and 'params'. For example: ```json {\"method\": \"sumOnServer\", \"params\":{\"a\":2, \"b\":2}} ``` The response contains arbitrary JSON with the RPC reply. For example: ```json {\"result\": 4} ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body The RPC request JSON (required) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String postRpcRequest(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - ApiResponse localVarResponse = postRpcRequestWithHttpInfo(deviceToken, body, headers); - return localVarResponse.getData(); - } - - /** - * Send the RPC command (postRpcRequest) - * Send the RPC request to server. The request payload is a JSON document that contains 'method' and 'params'. For example: ```json {\"method\": \"sumOnServer\", \"params\":{\"a\":2, \"b\":2}} ``` The response contains arbitrary JSON with the RPC reply. For example: ```json {\"result\": 4} ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body The RPC request JSON (required) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse postRpcRequestWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body) throws ApiException { - return postRpcRequestWithHttpInfo(deviceToken, body, null); - } - - /** - * Send the RPC command (postRpcRequest) - * Send the RPC request to server. The request payload is a JSON document that contains 'method' and 'params'. For example: ```json {\"method\": \"sumOnServer\", \"params\":{\"a\":2, \"b\":2}} ``` The response contains arbitrary JSON with the RPC reply. For example: ```json {\"result\": 4} ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body The RPC request JSON (required) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse postRpcRequestWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postRpcRequestRequestBuilder(deviceToken, body, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("postRpcRequest", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder postRpcRequestRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling postRpcRequest"); - } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling postRpcRequest"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/rpc" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - - /** - * Post time series data (postTelemetry) - * Post time series data on behalf of device. Example of the request: The request payload is a JSON document with three possible formats: Simple format without timestamp. In such a case, current server time will be used: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` Single JSON object with timestamp: ```json {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}} ``` JSON array with timestamps: ```json [ {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}} ] ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (required) - * @return String - * @throws ApiException if fails to make API call - */ - public String postTelemetry(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body) throws ApiException { - return postTelemetry(deviceToken, body, null); - } - - /** - * Post time series data (postTelemetry) - * Post time series data on behalf of device. Example of the request: The request payload is a JSON document with three possible formats: Simple format without timestamp. In such a case, current server time will be used: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` Single JSON object with timestamp: ```json {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}} ``` JSON array with timestamps: ```json [ {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}} ] ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (required) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String postTelemetry(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - ApiResponse localVarResponse = postTelemetryWithHttpInfo(deviceToken, body, headers); - return localVarResponse.getData(); - } - - /** - * Post time series data (postTelemetry) - * Post time series data on behalf of device. Example of the request: The request payload is a JSON document with three possible formats: Simple format without timestamp. In such a case, current server time will be used: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` Single JSON object with timestamp: ```json {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}} ``` JSON array with timestamps: ```json [ {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}} ] ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (required) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse postTelemetryWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body) throws ApiException { - return postTelemetryWithHttpInfo(deviceToken, body, null); - } - - /** - * Post time series data (postTelemetry) - * Post time series data on behalf of device. Example of the request: The request payload is a JSON document with three possible formats: Simple format without timestamp. In such a case, current server time will be used: ```json { \"stringKey\":\"value1\", \"booleanKey\":true, \"doubleKey\":42.0, \"longKey\":73, \"jsonKey\": { \"someNumber\": 42, \"someArray\": [1,2,3], \"someNestedObject\": {\"key\": \"value\"} } } ``` Single JSON object with timestamp: ```json {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}} ``` JSON array with timestamps: ```json [ {\"ts\":1634712287000,\"values\":{\"temperature\":26, \"humidity\":87}}, {\"ts\":1634712588000,\"values\":{\"temperature\":25, \"humidity\":88}} ] ``` The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (required) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse postTelemetryWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = postTelemetryRequestBuilder(deviceToken, body, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("postTelemetry", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder postTelemetryRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling postTelemetry"); - } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling postTelemetry"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/telemetry" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Preview Login White Labeling configuration (saveWhiteLabelParams) * Merge the White Labeling configuration with the parent configuration and return the result. Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource. @@ -79161,173 +78303,50 @@ private HttpRequest.Builder processAssetBulkImportRequestBuilder(@javax.annotati } /** - * Import the bulk of devices (processDevicesBulkImport) - * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). - * @param bulkImportRequest (required) - * @return BulkImportResultDevice - * @throws ApiException if fails to make API call - */ - public BulkImportResultDevice processDevicesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { - return processDevicesBulkImport(bulkImportRequest, null); - } - - /** - * Import the bulk of devices (processDevicesBulkImport) - * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). - * @param bulkImportRequest (required) - * @param headers Optional headers to include in the request - * @return BulkImportResultDevice - * @throws ApiException if fails to make API call - */ - public BulkImportResultDevice processDevicesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { - ApiResponse localVarResponse = processDevicesBulkImportWithHttpInfo(bulkImportRequest, headers); - return localVarResponse.getData(); - } - - /** - * Import the bulk of devices (processDevicesBulkImport) - * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). - * @param bulkImportRequest (required) - * @return ApiResponse<BulkImportResultDevice> - * @throws ApiException if fails to make API call - */ - public ApiResponse processDevicesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { - return processDevicesBulkImportWithHttpInfo(bulkImportRequest, null); - } - - /** - * Import the bulk of devices (processDevicesBulkImport) - * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). - * @param bulkImportRequest (required) - * @param headers Optional headers to include in the request - * @return ApiResponse<BulkImportResultDevice> - * @throws ApiException if fails to make API call - */ - public ApiResponse processDevicesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = processDevicesBulkImportRequestBuilder(bulkImportRequest, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("processDevicesBulkImport", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - BulkImportResultDevice responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder processDevicesBulkImportRequestBuilder(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { - // verify the required parameter 'bulkImportRequest' is set - if (bulkImportRequest == null) { - throw new ApiException(400, "Missing the required parameter 'bulkImportRequest' when calling processDevicesBulkImport"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/device/bulk_import"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(bulkImportRequest); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - - /** - * Import the bulk of edges (processEdgesBulkImport) - * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * Import the bulk of devices (processDevicesBulkImport) + * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). * @param bulkImportRequest (required) - * @return BulkImportResultEdge + * @return BulkImportResultDevice * @throws ApiException if fails to make API call */ - public BulkImportResultEdge processEdgesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { - return processEdgesBulkImport(bulkImportRequest, null); + public BulkImportResultDevice processDevicesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { + return processDevicesBulkImport(bulkImportRequest, null); } /** - * Import the bulk of edges (processEdgesBulkImport) - * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * Import the bulk of devices (processDevicesBulkImport) + * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). * @param bulkImportRequest (required) * @param headers Optional headers to include in the request - * @return BulkImportResultEdge + * @return BulkImportResultDevice * @throws ApiException if fails to make API call */ - public BulkImportResultEdge processEdgesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { - ApiResponse localVarResponse = processEdgesBulkImportWithHttpInfo(bulkImportRequest, headers); + public BulkImportResultDevice processDevicesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = processDevicesBulkImportWithHttpInfo(bulkImportRequest, headers); return localVarResponse.getData(); } /** - * Import the bulk of edges (processEdgesBulkImport) - * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * Import the bulk of devices (processDevicesBulkImport) + * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). * @param bulkImportRequest (required) - * @return ApiResponse<BulkImportResultEdge> + * @return ApiResponse<BulkImportResultDevice> * @throws ApiException if fails to make API call */ - public ApiResponse processEdgesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { - return processEdgesBulkImportWithHttpInfo(bulkImportRequest, null); + public ApiResponse processDevicesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { + return processDevicesBulkImportWithHttpInfo(bulkImportRequest, null); } /** - * Import the bulk of edges (processEdgesBulkImport) - * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * Import the bulk of devices (processDevicesBulkImport) + * There's an ability to import the bulk of devices using the only .csv file. Security check is performed to verify that the user has 'WRITE' permission for the entity (entities). * @param bulkImportRequest (required) * @param headers Optional headers to include in the request - * @return ApiResponse<BulkImportResultEdge> + * @return ApiResponse<BulkImportResultDevice> * @throws ApiException if fails to make API call */ - public ApiResponse processEdgesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = processEdgesBulkImportRequestBuilder(bulkImportRequest, headers); + public ApiResponse processDevicesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = processDevicesBulkImportRequestBuilder(bulkImportRequest, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -79338,11 +78357,11 @@ public ApiResponse processEdgesBulkImportWithHttpInfo(@jav InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("processEdgesBulkImport", localVarResponse); + throw getApiException("processDevicesBulkImport", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); if (localVarResponseBody == null) { - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), null @@ -79352,10 +78371,10 @@ public ApiResponse processEdgesBulkImportWithHttpInfo(@jav String responseBody = new String(localVarResponseBody.readAllBytes()); - BulkImportResultEdge responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + BulkImportResultDevice responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - return new ApiResponse( + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), responseValue @@ -79374,15 +78393,15 @@ public ApiResponse processEdgesBulkImportWithHttpInfo(@jav } } - private HttpRequest.Builder processEdgesBulkImportRequestBuilder(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { + private HttpRequest.Builder processDevicesBulkImportRequestBuilder(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { // verify the required parameter 'bulkImportRequest' is set if (bulkImportRequest == null) { - throw new ApiException(400, "Missing the required parameter 'bulkImportRequest' when calling processEdgesBulkImport"); + throw new ApiException(400, "Missing the required parameter 'bulkImportRequest' when calling processDevicesBulkImport"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/edge/bulk_import"; + String localVarPath = "/api/device/bulk_import"; localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); @@ -79407,47 +78426,50 @@ private HttpRequest.Builder processEdgesBulkImportRequestBuilder(@javax.annotati } /** - * processSystemEdqsRequest - * - * @param toCoreEdqsRequest (required) + * Import the bulk of edges (processEdgesBulkImport) + * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * @param bulkImportRequest (required) + * @return BulkImportResultEdge * @throws ApiException if fails to make API call */ - public void processSystemEdqsRequest(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest) throws ApiException { - processSystemEdqsRequest(toCoreEdqsRequest, null); + public BulkImportResultEdge processEdgesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { + return processEdgesBulkImport(bulkImportRequest, null); } /** - * processSystemEdqsRequest - * - * @param toCoreEdqsRequest (required) + * Import the bulk of edges (processEdgesBulkImport) + * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * @param bulkImportRequest (required) * @param headers Optional headers to include in the request + * @return BulkImportResultEdge * @throws ApiException if fails to make API call */ - public void processSystemEdqsRequest(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest, Map headers) throws ApiException { - processSystemEdqsRequestWithHttpInfo(toCoreEdqsRequest, headers); + public BulkImportResultEdge processEdgesBulkImport(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = processEdgesBulkImportWithHttpInfo(bulkImportRequest, headers); + return localVarResponse.getData(); } /** - * processSystemEdqsRequest - * - * @param toCoreEdqsRequest (required) - * @return ApiResponse<Void> + * Import the bulk of edges (processEdgesBulkImport) + * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * @param bulkImportRequest (required) + * @return ApiResponse<BulkImportResultEdge> * @throws ApiException if fails to make API call */ - public ApiResponse processSystemEdqsRequestWithHttpInfo(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest) throws ApiException { - return processSystemEdqsRequestWithHttpInfo(toCoreEdqsRequest, null); + public ApiResponse processEdgesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest) throws ApiException { + return processEdgesBulkImportWithHttpInfo(bulkImportRequest, null); } /** - * processSystemEdqsRequest - * - * @param toCoreEdqsRequest (required) + * Import the bulk of edges (processEdgesBulkImport) + * There's an ability to import the bulk of edges using the only .csv file. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. + * @param bulkImportRequest (required) * @param headers Optional headers to include in the request - * @return ApiResponse<Void> + * @return ApiResponse<BulkImportResultEdge> * @throws ApiException if fails to make API call */ - public ApiResponse processSystemEdqsRequestWithHttpInfo(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = processSystemEdqsRequestRequestBuilder(toCoreEdqsRequest, headers); + public ApiResponse processEdgesBulkImportWithHttpInfo(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = processEdgesBulkImportRequestBuilder(bulkImportRequest, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -79458,16 +78480,27 @@ public ApiResponse processSystemEdqsRequestWithHttpInfo(@javax.annotation. InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("processSystemEdqsRequest", localVarResponse); + throw getApiException("processEdgesBulkImport", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody != null) { - localVarResponseBody.readAllBytes(); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); } - return new ApiResponse<>( + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + BulkImportResultEdge responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( localVarResponse.statusCode(), localVarResponse.headers().map(), - null + responseValue ); } finally { if (localVarResponseBody != null) { @@ -79483,15 +78516,15 @@ public ApiResponse processSystemEdqsRequestWithHttpInfo(@javax.annotation. } } - private HttpRequest.Builder processSystemEdqsRequestRequestBuilder(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest, Map headers) throws ApiException { - // verify the required parameter 'toCoreEdqsRequest' is set - if (toCoreEdqsRequest == null) { - throw new ApiException(400, "Missing the required parameter 'toCoreEdqsRequest' when calling processSystemEdqsRequest"); + private HttpRequest.Builder processEdgesBulkImportRequestBuilder(@javax.annotation.Nonnull BulkImportRequest bulkImportRequest, Map headers) throws ApiException { + // verify the required parameter 'bulkImportRequest' is set + if (bulkImportRequest == null) { + throw new ApiException(400, "Missing the required parameter 'bulkImportRequest' when calling processEdgesBulkImport"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/edqs/system/request"; + String localVarPath = "/api/edge/bulk_import"; localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); @@ -79499,7 +78532,7 @@ private HttpRequest.Builder processSystemEdqsRequestRequestBuilder(@javax.annota localVarRequestBuilder.header("Accept", "application/json"); try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(toCoreEdqsRequest); + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(bulkImportRequest); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); } catch (IOException e) { throw new ApiException(e); @@ -79516,50 +78549,47 @@ private HttpRequest.Builder processSystemEdqsRequestRequestBuilder(@javax.annota } /** - * Provision new device (provisionDevice) - * Exchange the provision request to the device credentials. See more info about provisioning in the corresponding 'Device provisioning' platform documentation.Requires valid JSON request with the following format: ```json { \"deviceName\": \"NEW_DEVICE_NAME\", \"provisionDeviceKey\": \"u7piawkboq8v32dmcmpp\", \"provisionDeviceSecret\": \"jpmwdn8ptlswmf4m29bw\" } ``` Where 'deviceName' is the name of enw or existing device which depends on the provisioning strategy. The 'provisionDeviceKey' and 'provisionDeviceSecret' matches info configured in one of the existing device profiles. The result of the successful call is the JSON object that contains new credentials: ```json { \"credentialsType\":\"ACCESS_TOKEN\", \"credentialsValue\":\"DEVICE_ACCESS_TOKEN\", \"status\":\"SUCCESS\" } ``` - * @param body JSON with provision request. See API call description for example. (required) - * @return String + * processSystemEdqsRequest + * + * @param toCoreEdqsRequest (required) * @throws ApiException if fails to make API call */ - public String provisionDevice(@javax.annotation.Nonnull String body) throws ApiException { - return provisionDevice(body, null); + public void processSystemEdqsRequest(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest) throws ApiException { + processSystemEdqsRequest(toCoreEdqsRequest, null); } /** - * Provision new device (provisionDevice) - * Exchange the provision request to the device credentials. See more info about provisioning in the corresponding 'Device provisioning' platform documentation.Requires valid JSON request with the following format: ```json { \"deviceName\": \"NEW_DEVICE_NAME\", \"provisionDeviceKey\": \"u7piawkboq8v32dmcmpp\", \"provisionDeviceSecret\": \"jpmwdn8ptlswmf4m29bw\" } ``` Where 'deviceName' is the name of enw or existing device which depends on the provisioning strategy. The 'provisionDeviceKey' and 'provisionDeviceSecret' matches info configured in one of the existing device profiles. The result of the successful call is the JSON object that contains new credentials: ```json { \"credentialsType\":\"ACCESS_TOKEN\", \"credentialsValue\":\"DEVICE_ACCESS_TOKEN\", \"status\":\"SUCCESS\" } ``` - * @param body JSON with provision request. See API call description for example. (required) + * processSystemEdqsRequest + * + * @param toCoreEdqsRequest (required) * @param headers Optional headers to include in the request - * @return String * @throws ApiException if fails to make API call */ - public String provisionDevice(@javax.annotation.Nonnull String body, Map headers) throws ApiException { - ApiResponse localVarResponse = provisionDeviceWithHttpInfo(body, headers); - return localVarResponse.getData(); + public void processSystemEdqsRequest(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest, Map headers) throws ApiException { + processSystemEdqsRequestWithHttpInfo(toCoreEdqsRequest, headers); } /** - * Provision new device (provisionDevice) - * Exchange the provision request to the device credentials. See more info about provisioning in the corresponding 'Device provisioning' platform documentation.Requires valid JSON request with the following format: ```json { \"deviceName\": \"NEW_DEVICE_NAME\", \"provisionDeviceKey\": \"u7piawkboq8v32dmcmpp\", \"provisionDeviceSecret\": \"jpmwdn8ptlswmf4m29bw\" } ``` Where 'deviceName' is the name of enw or existing device which depends on the provisioning strategy. The 'provisionDeviceKey' and 'provisionDeviceSecret' matches info configured in one of the existing device profiles. The result of the successful call is the JSON object that contains new credentials: ```json { \"credentialsType\":\"ACCESS_TOKEN\", \"credentialsValue\":\"DEVICE_ACCESS_TOKEN\", \"status\":\"SUCCESS\" } ``` - * @param body JSON with provision request. See API call description for example. (required) - * @return ApiResponse<String> + * processSystemEdqsRequest + * + * @param toCoreEdqsRequest (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse provisionDeviceWithHttpInfo(@javax.annotation.Nonnull String body) throws ApiException { - return provisionDeviceWithHttpInfo(body, null); + public ApiResponse processSystemEdqsRequestWithHttpInfo(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest) throws ApiException { + return processSystemEdqsRequestWithHttpInfo(toCoreEdqsRequest, null); } /** - * Provision new device (provisionDevice) - * Exchange the provision request to the device credentials. See more info about provisioning in the corresponding 'Device provisioning' platform documentation.Requires valid JSON request with the following format: ```json { \"deviceName\": \"NEW_DEVICE_NAME\", \"provisionDeviceKey\": \"u7piawkboq8v32dmcmpp\", \"provisionDeviceSecret\": \"jpmwdn8ptlswmf4m29bw\" } ``` Where 'deviceName' is the name of enw or existing device which depends on the provisioning strategy. The 'provisionDeviceKey' and 'provisionDeviceSecret' matches info configured in one of the existing device profiles. The result of the successful call is the JSON object that contains new credentials: ```json { \"credentialsType\":\"ACCESS_TOKEN\", \"credentialsValue\":\"DEVICE_ACCESS_TOKEN\", \"status\":\"SUCCESS\" } ``` - * @param body JSON with provision request. See API call description for example. (required) + * processSystemEdqsRequest + * + * @param toCoreEdqsRequest (required) * @param headers Optional headers to include in the request - * @return ApiResponse<String> + * @return ApiResponse<Void> * @throws ApiException if fails to make API call */ - public ApiResponse provisionDeviceWithHttpInfo(@javax.annotation.Nonnull String body, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = provisionDeviceRequestBuilder(body, headers); + public ApiResponse processSystemEdqsRequestWithHttpInfo(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = processSystemEdqsRequestRequestBuilder(toCoreEdqsRequest, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -79570,27 +78600,16 @@ public ApiResponse provisionDeviceWithHttpInfo(@javax.annotation.Nonnull InputStream localVarResponseBody = null; try { if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("provisionDevice", localVarResponse); + throw getApiException("processSystemEdqsRequest", localVarResponse); } localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( + return new ApiResponse<>( localVarResponse.statusCode(), localVarResponse.headers().map(), - responseValue + null ); } finally { if (localVarResponseBody != null) { @@ -79606,22 +78625,27 @@ public ApiResponse provisionDeviceWithHttpInfo(@javax.annotation.Nonnull } } - private HttpRequest.Builder provisionDeviceRequestBuilder(@javax.annotation.Nonnull String body, Map headers) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling provisionDevice"); + private HttpRequest.Builder processSystemEdqsRequestRequestBuilder(@javax.annotation.Nonnull ToCoreEdqsRequest toCoreEdqsRequest, Map headers) throws ApiException { + // verify the required parameter 'toCoreEdqsRequest' is set + if (toCoreEdqsRequest == null) { + throw new ApiException(400, "Missing the required parameter 'toCoreEdqsRequest' when calling processSystemEdqsRequest"); } HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/api/v1/provision"; + String localVarPath = "/api/edqs/system/request"; localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(toCoreEdqsRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } @@ -80416,142 +79440,6 @@ private HttpRequest.Builder removeMobileSessionRequestBuilder(@javax.annotation. return localVarRequestBuilder; } - /** - * Reply to RPC commands (replyToCommand) - * Replies to server originated RPC command identified by 'requestId' parameter. The response is arbitrary JSON. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param requestId RPC request id from the incoming RPC request (required) - * @param body Reply to the RPC request, JSON. For example: {\"status\":\"success\"} (required) - * @return String - * @throws ApiException if fails to make API call - */ - public String replyToCommand(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String requestId, @javax.annotation.Nonnull String body) throws ApiException { - return replyToCommand(deviceToken, requestId, body, null); - } - - /** - * Reply to RPC commands (replyToCommand) - * Replies to server originated RPC command identified by 'requestId' parameter. The response is arbitrary JSON. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param requestId RPC request id from the incoming RPC request (required) - * @param body Reply to the RPC request, JSON. For example: {\"status\":\"success\"} (required) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String replyToCommand(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String requestId, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - ApiResponse localVarResponse = replyToCommandWithHttpInfo(deviceToken, requestId, body, headers); - return localVarResponse.getData(); - } - - /** - * Reply to RPC commands (replyToCommand) - * Replies to server originated RPC command identified by 'requestId' parameter. The response is arbitrary JSON. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param requestId RPC request id from the incoming RPC request (required) - * @param body Reply to the RPC request, JSON. For example: {\"status\":\"success\"} (required) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse replyToCommandWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String requestId, @javax.annotation.Nonnull String body) throws ApiException { - return replyToCommandWithHttpInfo(deviceToken, requestId, body, null); - } - - /** - * Reply to RPC commands (replyToCommand) - * Replies to server originated RPC command identified by 'requestId' parameter. The response is arbitrary JSON. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param requestId RPC request id from the incoming RPC request (required) - * @param body Reply to the RPC request, JSON. For example: {\"status\":\"success\"} (required) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse replyToCommandWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String requestId, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = replyToCommandRequestBuilder(deviceToken, requestId, body, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("replyToCommand", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder replyToCommandRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nonnull String requestId, @javax.annotation.Nonnull String body, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling replyToCommand"); - } - // verify the required parameter 'requestId' is set - if (requestId == null) { - throw new ApiException(400, "Missing the required parameter 'requestId' when calling replyToCommand"); - } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling replyToCommand"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/rpc/{requestId}" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())) - .replace("{requestId}", ApiClient.urlEncode(requestId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Report action of User over the dashboard (reportUserDashboardAction) * Report action of User over the dashboard. Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority. @@ -83181,129 +82069,6 @@ private HttpRequest.Builder saveCalculatedFieldRequestBuilder(@javax.annotation. return localVarRequestBuilder; } - /** - * Save claiming information (saveClaimingInfo) - * Saves the information required for user to claim the device. See more info about claiming in the corresponding 'Claiming devices' platform documentation. Example of the request payload: ```json {\"secretKey\":\"value\", \"durationMs\":60000} ``` Note: both 'secretKey' and 'durationMs' is optional parameters. In case the secretKey is not specified, the empty string as a default value is used. In case the durationMs is not specified, the system parameter device.claim.duration is used. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (optional) - * @return String - * @throws ApiException if fails to make API call - */ - public String saveClaimingInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable String body) throws ApiException { - return saveClaimingInfo(deviceToken, body, null); - } - - /** - * Save claiming information (saveClaimingInfo) - * Saves the information required for user to claim the device. See more info about claiming in the corresponding 'Claiming devices' platform documentation. Example of the request payload: ```json {\"secretKey\":\"value\", \"durationMs\":60000} ``` Note: both 'secretKey' and 'durationMs' is optional parameters. In case the secretKey is not specified, the empty string as a default value is used. In case the durationMs is not specified, the system parameter device.claim.duration is used. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (optional) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String saveClaimingInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable String body, Map headers) throws ApiException { - ApiResponse localVarResponse = saveClaimingInfoWithHttpInfo(deviceToken, body, headers); - return localVarResponse.getData(); - } - - /** - * Save claiming information (saveClaimingInfo) - * Saves the information required for user to claim the device. See more info about claiming in the corresponding 'Claiming devices' platform documentation. Example of the request payload: ```json {\"secretKey\":\"value\", \"durationMs\":60000} ``` Note: both 'secretKey' and 'durationMs' is optional parameters. In case the secretKey is not specified, the empty string as a default value is used. In case the durationMs is not specified, the system parameter device.claim.duration is used. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (optional) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse saveClaimingInfoWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable String body) throws ApiException { - return saveClaimingInfoWithHttpInfo(deviceToken, body, null); - } - - /** - * Save claiming information (saveClaimingInfo) - * Saves the information required for user to claim the device. See more info about claiming in the corresponding 'Claiming devices' platform documentation. Example of the request payload: ```json {\"secretKey\":\"value\", \"durationMs\":60000} ``` Note: both 'secretKey' and 'durationMs' is optional parameters. In case the secretKey is not specified, the empty string as a default value is used. In case the durationMs is not specified, the system parameter device.claim.duration is used. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param body (optional) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse saveClaimingInfoWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable String body, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = saveClaimingInfoRequestBuilder(deviceToken, body, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("saveClaimingInfo", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder saveClaimingInfoRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable String body, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling saveClaimingInfo"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/claim" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Create or update OAuth2 client registration template (saveClientRegistrationTemplate) Available for users with 'SYS_ADMIN' authority. * Client registration template is OAuth2 provider configuration template with default settings for registering new OAuth2 clients @@ -94351,280 +93116,6 @@ private HttpRequest.Builder submitTwoFaAccountConfigRequestBuilder(@javax.annota return localVarRequestBuilder; } - /** - * Subscribe to attribute updates (subscribeToAttributes) (Deprecated) - * Subscribes to client and shared scope attribute updates using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @return String - * @throws ApiException if fails to make API call - */ - public String subscribeToAttributes(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout) throws ApiException { - return subscribeToAttributes(deviceToken, timeout, null); - } - - /** - * Subscribe to attribute updates (subscribeToAttributes) (Deprecated) - * Subscribes to client and shared scope attribute updates using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String subscribeToAttributes(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout, Map headers) throws ApiException { - ApiResponse localVarResponse = subscribeToAttributesWithHttpInfo(deviceToken, timeout, headers); - return localVarResponse.getData(); - } - - /** - * Subscribe to attribute updates (subscribeToAttributes) (Deprecated) - * Subscribes to client and shared scope attribute updates using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse subscribeToAttributesWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout) throws ApiException { - return subscribeToAttributesWithHttpInfo(deviceToken, timeout, null); - } - - /** - * Subscribe to attribute updates (subscribeToAttributes) (Deprecated) - * Subscribes to client and shared scope attribute updates using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse subscribeToAttributesWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = subscribeToAttributesRequestBuilder(deviceToken, timeout, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("subscribeToAttributes", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder subscribeToAttributesRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling subscribeToAttributes"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/attributes/updates" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "timeout"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - - /** - * Subscribe to RPC commands (subscribeToCommands) (Deprecated) - * Subscribes to RPC commands using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @return String - * @throws ApiException if fails to make API call - */ - public String subscribeToCommands(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout) throws ApiException { - return subscribeToCommands(deviceToken, timeout, null); - } - - /** - * Subscribe to RPC commands (subscribeToCommands) (Deprecated) - * Subscribes to RPC commands using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return String - * @throws ApiException if fails to make API call - */ - public String subscribeToCommands(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout, Map headers) throws ApiException { - ApiResponse localVarResponse = subscribeToCommandsWithHttpInfo(deviceToken, timeout, headers); - return localVarResponse.getData(); - } - - /** - * Subscribe to RPC commands (subscribeToCommands) (Deprecated) - * Subscribes to RPC commands using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse subscribeToCommandsWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout) throws ApiException { - return subscribeToCommandsWithHttpInfo(deviceToken, timeout, null); - } - - /** - * Subscribe to RPC commands (subscribeToCommands) (Deprecated) - * Subscribes to RPC commands using http long polling. Deprecated, since long polling is resource and network consuming. Consider using MQTT or CoAP protocol for light-weight real-time updates. The API call is designed to be used by device firmware and requires device access token ('deviceToken'). It is not recommended to use this API call by third-party scripts, rule-engine or platform widgets (use 'Telemetry Controller' instead). - * @param deviceToken Your device access token. (required) - * @param timeout Optional timeout of the long poll. Typically less then 60 seconds, since limited on the server side. (optional, default to 0) - * @param headers Optional headers to include in the request - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse subscribeToCommandsWithHttpInfo(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = subscribeToCommandsRequestBuilder(deviceToken, timeout, headers); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - InputStream localVarResponseBody = null; - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("subscribeToCommands", localVarResponse); - } - localVarResponseBody = ApiClient.getResponseBody(localVarResponse); - if (localVarResponseBody == null) { - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } - - - - String responseBody = new String(localVarResponseBody.readAllBytes()); - String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); - - - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - responseValue - ); - } finally { - if (localVarResponseBody != null) { - localVarResponseBody.close(); - } - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder subscribeToCommandsRequestBuilder(@javax.annotation.Nonnull String deviceToken, @javax.annotation.Nullable Long timeout, Map headers) throws ApiException { - // verify the required parameter 'deviceToken' is set - if (deviceToken == null) { - throw new ApiException(400, "Missing the required parameter 'deviceToken' when calling subscribeToCommands"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/api/v1/{deviceToken}/rpc" - .replace("{deviceToken}", ApiClient.urlEncode(deviceToken.toString())); - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "timeout"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("timeout", timeout)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - // Add custom headers if provided - localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** * Sync edge (syncEdge) * Starts synchronization process between edge and cloud. All entities that are assigned to particular edge are going to be send to remote edge service. Available for users with 'TENANT_ADMIN' authority. diff --git a/paas/src/main/java/org/thingsboard/client/model/CsvReportTemplateConfig.java b/paas/src/main/java/org/thingsboard/client/model/CsvReportTemplateConfig.java index 656fb616..c9723eef 100644 --- a/paas/src/main/java/org/thingsboard/client/model/CsvReportTemplateConfig.java +++ b/paas/src/main/java/org/thingsboard/client/model/CsvReportTemplateConfig.java @@ -64,6 +64,12 @@ public CsvReportTemplateConfig format(@javax.annotation.Nonnull TbReportFormat f return this; } + @Override + public CsvReportTemplateConfig entityAliases(@javax.annotation.Nullable List entityAliases) { + this.setEntityAliases(entityAliases); + return this; + } + @Override public CsvReportTemplateConfig filters(@javax.annotation.Nullable List filters) { this.setFilters(filters); @@ -88,12 +94,6 @@ public CsvReportTemplateConfig timeDataPattern(@javax.annotation.Nullable String return this; } - @Override - public CsvReportTemplateConfig entityAliases(@javax.annotation.Nullable List entityAliases) { - this.setEntityAliases(entityAliases); - return this; - } - /** * Return true if this CsvReportTemplateConfig object is equal to o. */ @@ -170,6 +170,16 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%sformat%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); } + // add `entityAliases` to the URL query string + if (getEntityAliases() != null) { + for (int i = 0; i < getEntityAliases().size(); i++) { + if (getEntityAliases().get(i) != null) { + joiner.add(getEntityAliases().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sentityAliases%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + // add `filters` to the URL query string if (getFilters() != null) { for (int i = 0; i < getFilters().size(); i++) { @@ -200,16 +210,6 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%stimeDataPattern%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTimeDataPattern())))); } - // add `entityAliases` to the URL query string - if (getEntityAliases() != null) { - for (int i = 0; i < getEntityAliases().size(); i++) { - if (getEntityAliases().get(i) != null) { - joiner.add(getEntityAliases().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sentityAliases%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); - } - } - } - return joiner.toString(); } static { diff --git a/paas/src/main/java/org/thingsboard/client/model/FeaturesInfo.java b/paas/src/main/java/org/thingsboard/client/model/FeaturesInfo.java index eab34c56..ba95bd5a 100644 --- a/paas/src/main/java/org/thingsboard/client/model/FeaturesInfo.java +++ b/paas/src/main/java/org/thingsboard/client/model/FeaturesInfo.java @@ -37,10 +37,10 @@ @JsonPropertyOrder({ FeaturesInfo.JSON_PROPERTY_SMS_ENABLED, FeaturesInfo.JSON_PROPERTY_OAUTH_ENABLED, - FeaturesInfo.JSON_PROPERTY_NOTIFICATION_ENABLED, FeaturesInfo.JSON_PROPERTY_WHITE_LABELING_ENABLED, FeaturesInfo.JSON_PROPERTY_TWO_FA_ENABLED, - FeaturesInfo.JSON_PROPERTY_EMAIL_ENABLED + FeaturesInfo.JSON_PROPERTY_EMAIL_ENABLED, + FeaturesInfo.JSON_PROPERTY_NOTIFICATION_ENABLED }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") public class FeaturesInfo { @@ -52,10 +52,6 @@ public class FeaturesInfo { @javax.annotation.Nullable private Boolean oauthEnabled; - public static final String JSON_PROPERTY_NOTIFICATION_ENABLED = "notificationEnabled"; - @javax.annotation.Nullable - private Boolean notificationEnabled; - public static final String JSON_PROPERTY_WHITE_LABELING_ENABLED = "whiteLabelingEnabled"; @javax.annotation.Nullable private Boolean whiteLabelingEnabled; @@ -68,6 +64,10 @@ public class FeaturesInfo { @javax.annotation.Nullable private Boolean emailEnabled; + public static final String JSON_PROPERTY_NOTIFICATION_ENABLED = "notificationEnabled"; + @javax.annotation.Nullable + private Boolean notificationEnabled; + public FeaturesInfo() { } @@ -119,30 +119,6 @@ public void setOauthEnabled(@javax.annotation.Nullable Boolean oauthEnabled) { } - public FeaturesInfo notificationEnabled(@javax.annotation.Nullable Boolean notificationEnabled) { - this.notificationEnabled = notificationEnabled; - return this; - } - - /** - * Get notificationEnabled - * @return notificationEnabled - */ - @javax.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NOTIFICATION_ENABLED, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getNotificationEnabled() { - return notificationEnabled; - } - - - @JsonProperty(value = JSON_PROPERTY_NOTIFICATION_ENABLED, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNotificationEnabled(@javax.annotation.Nullable Boolean notificationEnabled) { - this.notificationEnabled = notificationEnabled; - } - - public FeaturesInfo whiteLabelingEnabled(@javax.annotation.Nullable Boolean whiteLabelingEnabled) { this.whiteLabelingEnabled = whiteLabelingEnabled; return this; @@ -215,6 +191,30 @@ public void setEmailEnabled(@javax.annotation.Nullable Boolean emailEnabled) { } + public FeaturesInfo notificationEnabled(@javax.annotation.Nullable Boolean notificationEnabled) { + this.notificationEnabled = notificationEnabled; + return this; + } + + /** + * Get notificationEnabled + * @return notificationEnabled + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NOTIFICATION_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNotificationEnabled() { + return notificationEnabled; + } + + + @JsonProperty(value = JSON_PROPERTY_NOTIFICATION_ENABLED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotificationEnabled(@javax.annotation.Nullable Boolean notificationEnabled) { + this.notificationEnabled = notificationEnabled; + } + + /** * Return true if this FeaturesInfo object is equal to o. */ @@ -229,15 +229,15 @@ public boolean equals(Object o) { FeaturesInfo featuresInfo = (FeaturesInfo) o; return Objects.equals(this.smsEnabled, featuresInfo.smsEnabled) && Objects.equals(this.oauthEnabled, featuresInfo.oauthEnabled) && - Objects.equals(this.notificationEnabled, featuresInfo.notificationEnabled) && Objects.equals(this.whiteLabelingEnabled, featuresInfo.whiteLabelingEnabled) && Objects.equals(this.twoFaEnabled, featuresInfo.twoFaEnabled) && - Objects.equals(this.emailEnabled, featuresInfo.emailEnabled); + Objects.equals(this.emailEnabled, featuresInfo.emailEnabled) && + Objects.equals(this.notificationEnabled, featuresInfo.notificationEnabled); } @Override public int hashCode() { - return Objects.hash(smsEnabled, oauthEnabled, notificationEnabled, whiteLabelingEnabled, twoFaEnabled, emailEnabled); + return Objects.hash(smsEnabled, oauthEnabled, whiteLabelingEnabled, twoFaEnabled, emailEnabled, notificationEnabled); } @Override @@ -246,10 +246,10 @@ public String toString() { sb.append("class FeaturesInfo {\n"); sb.append(" smsEnabled: ").append(toIndentedString(smsEnabled)).append("\n"); sb.append(" oauthEnabled: ").append(toIndentedString(oauthEnabled)).append("\n"); - sb.append(" notificationEnabled: ").append(toIndentedString(notificationEnabled)).append("\n"); sb.append(" whiteLabelingEnabled: ").append(toIndentedString(whiteLabelingEnabled)).append("\n"); sb.append(" twoFaEnabled: ").append(toIndentedString(twoFaEnabled)).append("\n"); sb.append(" emailEnabled: ").append(toIndentedString(emailEnabled)).append("\n"); + sb.append(" notificationEnabled: ").append(toIndentedString(notificationEnabled)).append("\n"); sb.append("}"); return sb.toString(); } @@ -307,11 +307,6 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%soauthEnabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOauthEnabled())))); } - // add `notificationEnabled` to the URL query string - if (getNotificationEnabled() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%snotificationEnabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNotificationEnabled())))); - } - // add `whiteLabelingEnabled` to the URL query string if (getWhiteLabelingEnabled() != null) { joiner.add(String.format(java.util.Locale.ROOT, "%swhiteLabelingEnabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWhiteLabelingEnabled())))); @@ -327,6 +322,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%semailEnabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEmailEnabled())))); } + // add `notificationEnabled` to the URL query string + if (getNotificationEnabled() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%snotificationEnabled%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNotificationEnabled())))); + } + return joiner.toString(); } } diff --git a/paas/src/main/java/org/thingsboard/client/model/PdfReportTemplateConfig.java b/paas/src/main/java/org/thingsboard/client/model/PdfReportTemplateConfig.java index 4cfb2e01..83edb1a9 100644 --- a/paas/src/main/java/org/thingsboard/client/model/PdfReportTemplateConfig.java +++ b/paas/src/main/java/org/thingsboard/client/model/PdfReportTemplateConfig.java @@ -242,6 +242,12 @@ public PdfReportTemplateConfig format(@javax.annotation.Nonnull TbReportFormat f return this; } + @Override + public PdfReportTemplateConfig entityAliases(@javax.annotation.Nullable List entityAliases) { + this.setEntityAliases(entityAliases); + return this; + } + @Override public PdfReportTemplateConfig filters(@javax.annotation.Nullable List filters) { this.setFilters(filters); @@ -266,12 +272,6 @@ public PdfReportTemplateConfig timeDataPattern(@javax.annotation.Nullable String return this; } - @Override - public PdfReportTemplateConfig entityAliases(@javax.annotation.Nullable List entityAliases) { - this.setEntityAliases(entityAliases); - return this; - } - /** * Return true if this PdfReportTemplateConfig object is equal to o. */ @@ -361,6 +361,16 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%sformat%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); } + // add `entityAliases` to the URL query string + if (getEntityAliases() != null) { + for (int i = 0; i < getEntityAliases().size(); i++) { + if (getEntityAliases().get(i) != null) { + joiner.add(getEntityAliases().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sentityAliases%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + // add `filters` to the URL query string if (getFilters() != null) { for (int i = 0; i < getFilters().size(); i++) { @@ -391,16 +401,6 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%stimeDataPattern%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTimeDataPattern())))); } - // add `entityAliases` to the URL query string - if (getEntityAliases() != null) { - for (int i = 0; i < getEntityAliases().size(); i++) { - if (getEntityAliases().get(i) != null) { - joiner.add(getEntityAliases().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sentityAliases%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); - } - } - } - // add `pageSize` to the URL query string if (getPageSize() != null) { joiner.add(String.format(java.util.Locale.ROOT, "%spageSize%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPageSize())))); diff --git a/paas/src/main/java/org/thingsboard/client/model/ReportBarChartWithLabelsSettings.java b/paas/src/main/java/org/thingsboard/client/model/ReportBarChartWithLabelsSettings.java index 1b6bebc1..8c6f6170 100644 --- a/paas/src/main/java/org/thingsboard/client/model/ReportBarChartWithLabelsSettings.java +++ b/paas/src/main/java/org/thingsboard/client/model/ReportBarChartWithLabelsSettings.java @@ -507,14 +507,14 @@ public ReportBarChartWithLabelsSettings legendValueColor(@javax.annotation.Nulla } @Override - public ReportBarChartWithLabelsSettings yaxes(@javax.annotation.Nullable Map yaxes) { - this.setYaxes(yaxes); + public ReportBarChartWithLabelsSettings xaxis(@javax.annotation.Nullable TimeSeriesChartXAxisSettings xaxis) { + this.setXaxis(xaxis); return this; } @Override - public ReportBarChartWithLabelsSettings xaxis(@javax.annotation.Nullable TimeSeriesChartXAxisSettings xaxis) { - this.setXaxis(xaxis); + public ReportBarChartWithLabelsSettings yaxes(@javax.annotation.Nullable Map yaxes) { + this.setYaxes(yaxes); return this; } @@ -748,6 +748,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%slegendValueColor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLegendValueColor())))); } + // add `xaxis` to the URL query string + if (getXaxis() != null) { + joiner.add(getXaxis().toUrlQueryString(prefix + "xaxis" + suffix)); + } + // add `yaxes` to the URL query string if (getYaxes() != null) { for (String _key : getYaxes().keySet()) { @@ -758,11 +763,6 @@ public String toUrlQueryString(String prefix) { } } - // add `xaxis` to the URL query string - if (getXaxis() != null) { - joiner.add(getXaxis().toUrlQueryString(prefix + "xaxis" + suffix)); - } - // add `thresholds` to the URL query string if (getThresholds() != null) { for (int i = 0; i < getThresholds().size(); i++) { diff --git a/paas/src/main/java/org/thingsboard/client/model/ReportRangeChartSettings.java b/paas/src/main/java/org/thingsboard/client/model/ReportRangeChartSettings.java index 62693622..f0a3cb85 100644 --- a/paas/src/main/java/org/thingsboard/client/model/ReportRangeChartSettings.java +++ b/paas/src/main/java/org/thingsboard/client/model/ReportRangeChartSettings.java @@ -429,14 +429,14 @@ public ReportRangeChartSettings legendValueColor(@javax.annotation.Nullable Stri } @Override - public ReportRangeChartSettings yaxes(@javax.annotation.Nullable Map yaxes) { - this.setYaxes(yaxes); + public ReportRangeChartSettings xaxis(@javax.annotation.Nullable TimeSeriesChartXAxisSettings xaxis) { + this.setXaxis(xaxis); return this; } @Override - public ReportRangeChartSettings xaxis(@javax.annotation.Nullable TimeSeriesChartXAxisSettings xaxis) { - this.setXaxis(xaxis); + public ReportRangeChartSettings yaxes(@javax.annotation.Nullable Map yaxes) { + this.setYaxes(yaxes); return this; } @@ -664,6 +664,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%slegendValueColor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLegendValueColor())))); } + // add `xaxis` to the URL query string + if (getXaxis() != null) { + joiner.add(getXaxis().toUrlQueryString(prefix + "xaxis" + suffix)); + } + // add `yaxes` to the URL query string if (getYaxes() != null) { for (String _key : getYaxes().keySet()) { @@ -674,11 +679,6 @@ public String toUrlQueryString(String prefix) { } } - // add `xaxis` to the URL query string - if (getXaxis() != null) { - joiner.add(getXaxis().toUrlQueryString(prefix + "xaxis" + suffix)); - } - // add `thresholds` to the URL query string if (getThresholds() != null) { for (int i = 0; i < getThresholds().size(); i++) { diff --git a/paas/src/main/java/org/thingsboard/client/model/ReportTemplateConfig.java b/paas/src/main/java/org/thingsboard/client/model/ReportTemplateConfig.java index 4a60a202..fe29bd9e 100644 --- a/paas/src/main/java/org/thingsboard/client/model/ReportTemplateConfig.java +++ b/paas/src/main/java/org/thingsboard/client/model/ReportTemplateConfig.java @@ -46,11 +46,11 @@ */ @JsonPropertyOrder({ ReportTemplateConfig.JSON_PROPERTY_FORMAT, + ReportTemplateConfig.JSON_PROPERTY_ENTITY_ALIASES, ReportTemplateConfig.JSON_PROPERTY_FILTERS, ReportTemplateConfig.JSON_PROPERTY_NAME_PATTERN, ReportTemplateConfig.JSON_PROPERTY_COMPONENTS, - ReportTemplateConfig.JSON_PROPERTY_TIME_DATA_PATTERN, - ReportTemplateConfig.JSON_PROPERTY_ENTITY_ALIASES + ReportTemplateConfig.JSON_PROPERTY_TIME_DATA_PATTERN }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") @JsonIgnoreProperties( @@ -68,6 +68,10 @@ public class ReportTemplateConfig { @javax.annotation.Nonnull private TbReportFormat format; + public static final String JSON_PROPERTY_ENTITY_ALIASES = "entityAliases"; + @javax.annotation.Nullable + private List entityAliases = new ArrayList<>(); + public static final String JSON_PROPERTY_FILTERS = "filters"; @javax.annotation.Nullable private List filters = new ArrayList<>(); @@ -84,10 +88,6 @@ public class ReportTemplateConfig { @javax.annotation.Nullable private String timeDataPattern; - public static final String JSON_PROPERTY_ENTITY_ALIASES = "entityAliases"; - @javax.annotation.Nullable - private List entityAliases = new ArrayList<>(); - public ReportTemplateConfig() { } @@ -115,6 +115,38 @@ public void setFormat(@javax.annotation.Nonnull TbReportFormat format) { } + public ReportTemplateConfig entityAliases(@javax.annotation.Nullable List entityAliases) { + this.entityAliases = entityAliases; + return this; + } + + public ReportTemplateConfig addEntityAliasesItem(EntityAlias entityAliasesItem) { + if (this.entityAliases == null) { + this.entityAliases = new ArrayList<>(); + } + this.entityAliases.add(entityAliasesItem); + return this; + } + + /** + * Get entityAliases + * @return entityAliases + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENTITY_ALIASES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEntityAliases() { + return entityAliases; + } + + + @JsonProperty(value = JSON_PROPERTY_ENTITY_ALIASES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEntityAliases(@javax.annotation.Nullable List entityAliases) { + this.entityAliases = entityAliases; + } + + public ReportTemplateConfig filters(@javax.annotation.Nullable List filters) { this.filters = filters; return this; @@ -227,38 +259,6 @@ public void setTimeDataPattern(@javax.annotation.Nullable String timeDataPattern } - public ReportTemplateConfig entityAliases(@javax.annotation.Nullable List entityAliases) { - this.entityAliases = entityAliases; - return this; - } - - public ReportTemplateConfig addEntityAliasesItem(EntityAlias entityAliasesItem) { - if (this.entityAliases == null) { - this.entityAliases = new ArrayList<>(); - } - this.entityAliases.add(entityAliasesItem); - return this; - } - - /** - * Get entityAliases - * @return entityAliases - */ - @javax.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENTITY_ALIASES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getEntityAliases() { - return entityAliases; - } - - - @JsonProperty(value = JSON_PROPERTY_ENTITY_ALIASES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEntityAliases(@javax.annotation.Nullable List entityAliases) { - this.entityAliases = entityAliases; - } - - /** * Return true if this ReportTemplateConfig object is equal to o. */ @@ -272,16 +272,16 @@ public boolean equals(Object o) { } ReportTemplateConfig reportTemplateConfig = (ReportTemplateConfig) o; return Objects.equals(this.format, reportTemplateConfig.format) && + Objects.equals(this.entityAliases, reportTemplateConfig.entityAliases) && Objects.equals(this.filters, reportTemplateConfig.filters) && Objects.equals(this.namePattern, reportTemplateConfig.namePattern) && Objects.equals(this.components, reportTemplateConfig.components) && - Objects.equals(this.timeDataPattern, reportTemplateConfig.timeDataPattern) && - Objects.equals(this.entityAliases, reportTemplateConfig.entityAliases); + Objects.equals(this.timeDataPattern, reportTemplateConfig.timeDataPattern); } @Override public int hashCode() { - return Objects.hash(format, filters, namePattern, components, timeDataPattern, entityAliases); + return Objects.hash(format, entityAliases, filters, namePattern, components, timeDataPattern); } @Override @@ -289,11 +289,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReportTemplateConfig {\n"); sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" entityAliases: ").append(toIndentedString(entityAliases)).append("\n"); sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); sb.append(" namePattern: ").append(toIndentedString(namePattern)).append("\n"); sb.append(" components: ").append(toIndentedString(components)).append("\n"); sb.append(" timeDataPattern: ").append(toIndentedString(timeDataPattern)).append("\n"); - sb.append(" entityAliases: ").append(toIndentedString(entityAliases)).append("\n"); sb.append("}"); return sb.toString(); } @@ -346,6 +346,16 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%sformat%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFormat())))); } + // add `entityAliases` to the URL query string + if (getEntityAliases() != null) { + for (int i = 0; i < getEntityAliases().size(); i++) { + if (getEntityAliases().get(i) != null) { + joiner.add(getEntityAliases().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sentityAliases%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + // add `filters` to the URL query string if (getFilters() != null) { for (int i = 0; i < getFilters().size(); i++) { @@ -376,16 +386,6 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%stimeDataPattern%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTimeDataPattern())))); } - // add `entityAliases` to the URL query string - if (getEntityAliases() != null) { - for (int i = 0; i < getEntityAliases().size(); i++) { - if (getEntityAliases().get(i) != null) { - joiner.add(getEntityAliases().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sentityAliases%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); - } - } - } - return joiner.toString(); } static { diff --git a/paas/src/main/java/org/thingsboard/client/model/ReportTimeSeriesChartSettings.java b/paas/src/main/java/org/thingsboard/client/model/ReportTimeSeriesChartSettings.java index d6966038..f145248a 100644 --- a/paas/src/main/java/org/thingsboard/client/model/ReportTimeSeriesChartSettings.java +++ b/paas/src/main/java/org/thingsboard/client/model/ReportTimeSeriesChartSettings.java @@ -70,8 +70,8 @@ ReportTimeSeriesChartSettings.JSON_PROPERTY_LEGEND_LABEL_COLOR, ReportTimeSeriesChartSettings.JSON_PROPERTY_LEGEND_VALUE_FONT, ReportTimeSeriesChartSettings.JSON_PROPERTY_LEGEND_VALUE_COLOR, - ReportTimeSeriesChartSettings.JSON_PROPERTY_YAXES, ReportTimeSeriesChartSettings.JSON_PROPERTY_XAXIS, + ReportTimeSeriesChartSettings.JSON_PROPERTY_YAXES, ReportTimeSeriesChartSettings.JSON_PROPERTY_THRESHOLDS, ReportTimeSeriesChartSettings.JSON_PROPERTY_GRID, ReportTimeSeriesChartSettings.JSON_PROPERTY_Y_AXES, @@ -158,14 +158,14 @@ public class ReportTimeSeriesChartSettings { @javax.annotation.Nullable private String legendValueColor; - public static final String JSON_PROPERTY_YAXES = "yaxes"; - @javax.annotation.Nullable - private Map yaxes = new HashMap<>(); - public static final String JSON_PROPERTY_XAXIS = "xaxis"; @javax.annotation.Nullable private TimeSeriesChartXAxisSettings xaxis; + public static final String JSON_PROPERTY_YAXES = "yaxes"; + @javax.annotation.Nullable + private Map yaxes = new HashMap<>(); + public static final String JSON_PROPERTY_THRESHOLDS = "thresholds"; @javax.annotation.Nullable private List thresholds = new ArrayList<>(); @@ -589,6 +589,30 @@ public void setLegendValueColor(@javax.annotation.Nullable String legendValueCol } + public ReportTimeSeriesChartSettings xaxis(@javax.annotation.Nullable TimeSeriesChartXAxisSettings xaxis) { + this.xaxis = xaxis; + return this; + } + + /** + * Get xaxis + * @return xaxis + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_XAXIS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TimeSeriesChartXAxisSettings getXaxis() { + return xaxis; + } + + + @JsonProperty(value = JSON_PROPERTY_XAXIS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setXaxis(@javax.annotation.Nullable TimeSeriesChartXAxisSettings xaxis) { + this.xaxis = xaxis; + } + + public ReportTimeSeriesChartSettings yaxes(@javax.annotation.Nullable Map yaxes) { this.yaxes = yaxes; return this; @@ -621,30 +645,6 @@ public void setYaxes(@javax.annotation.Nullable Map thresholds) { this.thresholds = thresholds; return this; @@ -913,8 +913,8 @@ public boolean equals(Object o) { Objects.equals(this.legendLabelColor, reportTimeSeriesChartSettings.legendLabelColor) && Objects.equals(this.legendValueFont, reportTimeSeriesChartSettings.legendValueFont) && Objects.equals(this.legendValueColor, reportTimeSeriesChartSettings.legendValueColor) && - Objects.equals(this.yaxes, reportTimeSeriesChartSettings.yaxes) && Objects.equals(this.xaxis, reportTimeSeriesChartSettings.xaxis) && + Objects.equals(this.yaxes, reportTimeSeriesChartSettings.yaxes) && Objects.equals(this.thresholds, reportTimeSeriesChartSettings.thresholds) && Objects.equals(this.grid, reportTimeSeriesChartSettings.grid) && Objects.equals(this.yAxes, reportTimeSeriesChartSettings.yAxes) && @@ -928,7 +928,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(showTitle, title, titleFont, titleColor, titleAlignment, stack, comparisonEnabled, timeForComparison, comparisonCustomIntervalValue, showLegend, legendColumnTitleFont, legendColumnTitleColor, legendLabelFont, legendLabelColor, legendValueFont, legendValueColor, yaxes, xaxis, thresholds, grid, yAxes, xAxis, barWidthSettings, noAggregationBarWidthSettings, states, comparisonXAxis, legendConfig); + return Objects.hash(showTitle, title, titleFont, titleColor, titleAlignment, stack, comparisonEnabled, timeForComparison, comparisonCustomIntervalValue, showLegend, legendColumnTitleFont, legendColumnTitleColor, legendLabelFont, legendLabelColor, legendValueFont, legendValueColor, xaxis, yaxes, thresholds, grid, yAxes, xAxis, barWidthSettings, noAggregationBarWidthSettings, states, comparisonXAxis, legendConfig); } @Override @@ -951,8 +951,8 @@ public String toString() { sb.append(" legendLabelColor: ").append(toIndentedString(legendLabelColor)).append("\n"); sb.append(" legendValueFont: ").append(toIndentedString(legendValueFont)).append("\n"); sb.append(" legendValueColor: ").append(toIndentedString(legendValueColor)).append("\n"); - sb.append(" yaxes: ").append(toIndentedString(yaxes)).append("\n"); sb.append(" xaxis: ").append(toIndentedString(xaxis)).append("\n"); + sb.append(" yaxes: ").append(toIndentedString(yaxes)).append("\n"); sb.append(" thresholds: ").append(toIndentedString(thresholds)).append("\n"); sb.append(" grid: ").append(toIndentedString(grid)).append("\n"); sb.append(" yAxes: ").append(toIndentedString(yAxes)).append("\n"); @@ -1089,6 +1089,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%slegendValueColor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLegendValueColor())))); } + // add `xaxis` to the URL query string + if (getXaxis() != null) { + joiner.add(getXaxis().toUrlQueryString(prefix + "xaxis" + suffix)); + } + // add `yaxes` to the URL query string if (getYaxes() != null) { for (String _key : getYaxes().keySet()) { @@ -1099,11 +1104,6 @@ public String toUrlQueryString(String prefix) { } } - // add `xaxis` to the URL query string - if (getXaxis() != null) { - joiner.add(getXaxis().toUrlQueryString(prefix + "xaxis" + suffix)); - } - // add `thresholds` to the URL query string if (getThresholds() != null) { for (int i = 0; i < getThresholds().size(); i++) { diff --git a/paas/src/main/java/org/thingsboard/client/model/TsKvEntry.java b/paas/src/main/java/org/thingsboard/client/model/TsKvEntry.java index 3fefdd94..4c9de9ca 100644 --- a/paas/src/main/java/org/thingsboard/client/model/TsKvEntry.java +++ b/paas/src/main/java/org/thingsboard/client/model/TsKvEntry.java @@ -43,13 +43,13 @@ TsKvEntry.JSON_PROPERTY_TS, TsKvEntry.JSON_PROPERTY_VALUE, TsKvEntry.JSON_PROPERTY_KEY, - TsKvEntry.JSON_PROPERTY_DOUBLE_VALUE, - TsKvEntry.JSON_PROPERTY_LONG_VALUE, TsKvEntry.JSON_PROPERTY_BOOLEAN_VALUE, TsKvEntry.JSON_PROPERTY_VALUE_AS_STRING, TsKvEntry.JSON_PROPERTY_DATA_TYPE, TsKvEntry.JSON_PROPERTY_JSON_VALUE, TsKvEntry.JSON_PROPERTY_STR_VALUE, + TsKvEntry.JSON_PROPERTY_LONG_VALUE, + TsKvEntry.JSON_PROPERTY_DOUBLE_VALUE, TsKvEntry.JSON_PROPERTY_VERSION }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.20.0") @@ -65,14 +65,6 @@ public class TsKvEntry { @javax.annotation.Nullable private String key; - public static final String JSON_PROPERTY_DOUBLE_VALUE = "doubleValue"; - @javax.annotation.Nullable - private Double doubleValue; - - public static final String JSON_PROPERTY_LONG_VALUE = "longValue"; - @javax.annotation.Nullable - private Long longValue; - public static final String JSON_PROPERTY_BOOLEAN_VALUE = "booleanValue"; @javax.annotation.Nullable private Boolean booleanValue; @@ -93,6 +85,14 @@ public class TsKvEntry { @javax.annotation.Nullable private String strValue; + public static final String JSON_PROPERTY_LONG_VALUE = "longValue"; + @javax.annotation.Nullable + private Long longValue; + + public static final String JSON_PROPERTY_DOUBLE_VALUE = "doubleValue"; + @javax.annotation.Nullable + private Double doubleValue; + public static final String JSON_PROPERTY_VERSION = "version"; @javax.annotation.Nullable private Long version; @@ -180,54 +180,6 @@ public void setKey(@javax.annotation.Nullable String key) { } - public TsKvEntry doubleValue(@javax.annotation.Nullable Double doubleValue) { - this.doubleValue = doubleValue; - return this; - } - - /** - * Get doubleValue - * @return doubleValue - */ - @javax.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DOUBLE_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDoubleValue() { - return doubleValue; - } - - - @JsonProperty(value = JSON_PROPERTY_DOUBLE_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDoubleValue(@javax.annotation.Nullable Double doubleValue) { - this.doubleValue = doubleValue; - } - - - public TsKvEntry longValue(@javax.annotation.Nullable Long longValue) { - this.longValue = longValue; - return this; - } - - /** - * Get longValue - * @return longValue - */ - @javax.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LONG_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getLongValue() { - return longValue; - } - - - @JsonProperty(value = JSON_PROPERTY_LONG_VALUE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLongValue(@javax.annotation.Nullable Long longValue) { - this.longValue = longValue; - } - - public TsKvEntry booleanValue(@javax.annotation.Nullable Boolean booleanValue) { this.booleanValue = booleanValue; return this; @@ -348,6 +300,54 @@ public void setStrValue(@javax.annotation.Nullable String strValue) { } + public TsKvEntry longValue(@javax.annotation.Nullable Long longValue) { + this.longValue = longValue; + return this; + } + + /** + * Get longValue + * @return longValue + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LONG_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLongValue() { + return longValue; + } + + + @JsonProperty(value = JSON_PROPERTY_LONG_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLongValue(@javax.annotation.Nullable Long longValue) { + this.longValue = longValue; + } + + + public TsKvEntry doubleValue(@javax.annotation.Nullable Double doubleValue) { + this.doubleValue = doubleValue; + return this; + } + + /** + * Get doubleValue + * @return doubleValue + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DOUBLE_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDoubleValue() { + return doubleValue; + } + + + @JsonProperty(value = JSON_PROPERTY_DOUBLE_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDoubleValue(@javax.annotation.Nullable Double doubleValue) { + this.doubleValue = doubleValue; + } + + public TsKvEntry version(@javax.annotation.Nullable Long version) { this.version = version; return this; @@ -387,13 +387,13 @@ public boolean equals(Object o) { return Objects.equals(this.ts, tsKvEntry.ts) && equalsNullable(this.value, tsKvEntry.value) && Objects.equals(this.key, tsKvEntry.key) && - Objects.equals(this.doubleValue, tsKvEntry.doubleValue) && - Objects.equals(this.longValue, tsKvEntry.longValue) && Objects.equals(this.booleanValue, tsKvEntry.booleanValue) && Objects.equals(this.valueAsString, tsKvEntry.valueAsString) && Objects.equals(this.dataType, tsKvEntry.dataType) && Objects.equals(this.jsonValue, tsKvEntry.jsonValue) && Objects.equals(this.strValue, tsKvEntry.strValue) && + Objects.equals(this.longValue, tsKvEntry.longValue) && + Objects.equals(this.doubleValue, tsKvEntry.doubleValue) && Objects.equals(this.version, tsKvEntry.version); } @@ -403,7 +403,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(ts, hashCodeNullable(value), key, doubleValue, longValue, booleanValue, valueAsString, dataType, jsonValue, strValue, version); + return Objects.hash(ts, hashCodeNullable(value), key, booleanValue, valueAsString, dataType, jsonValue, strValue, longValue, doubleValue, version); } private static int hashCodeNullable(JsonNullable a) { @@ -420,13 +420,13 @@ public String toString() { sb.append(" ts: ").append(toIndentedString(ts)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); - sb.append(" longValue: ").append(toIndentedString(longValue)).append("\n"); sb.append(" booleanValue: ").append(toIndentedString(booleanValue)).append("\n"); sb.append(" valueAsString: ").append(toIndentedString(valueAsString)).append("\n"); sb.append(" dataType: ").append(toIndentedString(dataType)).append("\n"); sb.append(" jsonValue: ").append(toIndentedString(jsonValue)).append("\n"); sb.append(" strValue: ").append(toIndentedString(strValue)).append("\n"); + sb.append(" longValue: ").append(toIndentedString(longValue)).append("\n"); + sb.append(" doubleValue: ").append(toIndentedString(doubleValue)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append("}"); return sb.toString(); @@ -490,16 +490,6 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%skey%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getKey())))); } - // add `doubleValue` to the URL query string - if (getDoubleValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sdoubleValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDoubleValue())))); - } - - // add `longValue` to the URL query string - if (getLongValue() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%slongValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLongValue())))); - } - // add `booleanValue` to the URL query string if (getBooleanValue() != null) { joiner.add(String.format(java.util.Locale.ROOT, "%sbooleanValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBooleanValue())))); @@ -525,6 +515,16 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%sstrValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStrValue())))); } + // add `longValue` to the URL query string + if (getLongValue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slongValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLongValue())))); + } + + // add `doubleValue` to the URL query string + if (getDoubleValue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdoubleValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDoubleValue())))); + } + // add `version` to the URL query string if (getVersion() != null) { joiner.add(String.format(java.util.Locale.ROOT, "%sversion%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getVersion()))));