Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/configure_vcs_access.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
62 changes: 33 additions & 29 deletions examples/example_application.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
datefmt='%Y-%m-%d %H:%M:%S')

# ThingsBoard REST API URL
url = "http://localhost:8080"
url = "http://192.168.1.201:8380"

# Default Tenant Administrator credentials
username = "[email protected]"
Expand All @@ -37,34 +37,38 @@ def main():
# Auth with credentials
rest_client.login(username=username, password=password)

# Creating an Asset
default_asset_profile_id = rest_client.get_default_asset_profile_info().id
asset = Asset(name="Building 1", label="Building 1",
asset_profile_id=default_asset_profile_id)
asset = rest_client.save_asset(asset)

logging.info("Asset was created:\n%r\n", asset)

# Creating a Device
# Also, you can use default Device Profile:
# default_device_profile_id = rest_client.get_default_device_profile_info().id
device_profile = DeviceProfile(name="Thermometer",
type="DEFAULT",
transport_type="DEFAULT",
profile_data=DeviceProfileData(configuration={"type": "DEFAULT"},
transport_configuration={"type": "DEFAULT"}))
device_profile = rest_client.save_device_profile(device_profile)
device = Device(name="Thermometer 1", label="Thermometer 1",
device_profile_id=device_profile.id)
device = rest_client.save_device(device)
print(rest_client.save_device_attributes(DeviceId('34416c10-bba7-11ef-9c05-3598fcc4571c', 'DEVICE'), 'SHARED_SCOPE', {'temperature': 45.0}))

logging.info(" Device was created:\n%r\n", device)

# Creating relations from device to asset
relation = EntityRelation(_from=asset.id, to=device.id, type="Contains")
rest_client.save_relation(relation)

logging.info(" Relation was created:\n%r\n", relation)
# Creating an Asset
# default_asset_profile_id = rest_client.get_default_asset_profile_info().id
# asset = Asset(name="Building 1", label="Building 1",
# asset_profile_id=default_asset_profile_id)
# asset = rest_client.save_asset(asset)
#
# logging.info("Asset was created:\n%r\n", asset)
#
# rest_client.process_devices_bulk_import()
#
# # Creating a Device
# # Also, you can use default Device Profile:
# # default_device_profile_id = rest_client.get_default_device_profile_info().id
# device_profile = DeviceProfile(name="Thermometer",
# type="DEFAULT",
# transport_type="DEFAULT",
# profile_data=DeviceProfileData(configuration={"type": "DEFAULT"},
# transport_configuration={"type": "DEFAULT"}))
# device_profile = rest_client.save_device_profile(device_profile)
# device = Device(name="Thermometer 1", label="Thermometer 1",
# device_profile_id=device_profile.id)
# device = rest_client.save_device(device)
#
# logging.info(" Device was created:\n%r\n", device)
#
# # Creating relations from device to asset
# relation = EntityRelation(_from=asset.id, to=device.id, type="Contains")
# rest_client.save_relation(relation)
#
# logging.info(" Relation was created:\n%r\n", relation)
except ApiException as e:
logging.exception(e)

Expand Down
2 changes: 1 addition & 1 deletion examples/example_application_2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/load_all_entities_from_vcs_ce.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/load_all_entities_from_vcs_pe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/load_all_entities_to_vcs_ce.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/load_all_entities_to_vcs_pe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/version_control_complex_example_ce.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/version_control_complex_example_pe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/version_control_single_device_example_ce.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/version_control_single_device_example_pe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tb_rest_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tb_rest_client/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
17 changes: 17 additions & 0 deletions tb_rest_client/api/api_ce/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import

from .o_auth_2_config_template_controller_api import OAuth2ConfigTemplateControllerApi
Expand Down Expand Up @@ -47,3 +61,6 @@
from .queue_stats_controller_api import QueueStatsControllerApi
from .domain_controller_api import DomainControllerApi
from .mobile_app_controller_api import MobileAppControllerApi
from .mobile_app_bundle_controller_api import MobileAppBundleControllerApi
from .qr_code_settings_controller_api import QrCodeSettingsControllerApi
from .rule_engine_controller_api import RuleEngineControllerApi
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/admin_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/alarm_comment_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/alarm_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/asset_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/asset_profile_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/audit_log_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/auth_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/customer_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/dashboard_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/device_api_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/device_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions tb_rest_client/api/api_ce/device_profile_controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

ThingsBoard open-source IoT platform REST API documentation. # noqa: E501

OpenAPI spec version: 3.7.0
OpenAPI spec version: 3.9.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

# Copyright 2024. ThingsBoard
# Copyright 2025. ThingsBoard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading