0
# Dashboard Operations
1
2
Dashboard creation, sharing, widget linking, template management, and access control for visualizing and interacting with IoT data.
3
4
## Core Imports
5
6
```python
7
from iot_api_client.api import DashboardsV2Api
8
from iot_api_client.models import (
9
Dashboardv2,
10
ArduinoDashboardv2,
11
ArduinoDashboardv2template,
12
Sharerequest,
13
Widgetlink,
14
Clone
15
)
16
```
17
18
## Capabilities
19
20
### Dashboard CRUD Operations
21
22
Core dashboard management operations for creating, reading, updating, and deleting dashboards.
23
24
```python { .api }
25
class DashboardsV2Api:
26
def dashboards_v2_create(self, dashboardv2: Dashboardv2, x_organization: str = None) -> ArduinoDashboardv2:
27
"""
28
Create a new dashboard.
29
30
Args:
31
dashboardv2: Dashboard creation payload
32
x_organization: Organization ID for organization-level access
33
34
Returns:
35
ArduinoDashboardv2: Created dashboard object
36
"""
37
38
def dashboards_v2_list(self, x_organization: str = None) -> List[ArduinoDashboardv2]:
39
"""
40
Returns the list of dashboards.
41
42
Args:
43
x_organization: Organization ID for organization-level access
44
45
Returns:
46
List[ArduinoDashboardv2]: List of dashboard objects
47
"""
48
49
def dashboards_v2_show(self, id: str, x_organization: str = None) -> ArduinoDashboardv2:
50
"""
51
Show dashboard details.
52
53
Args:
54
id: Dashboard ID
55
x_organization: Organization ID for organization-level access
56
57
Returns:
58
ArduinoDashboardv2: Dashboard object
59
"""
60
61
def dashboards_v2_update(self, id: str, dashboardv2: Dashboardv2, x_organization: str = None) -> ArduinoDashboardv2:
62
"""
63
Updates a dashboard.
64
65
Args:
66
id: Dashboard ID
67
dashboardv2: Dashboard update payload
68
x_organization: Organization ID for organization-level access
69
70
Returns:
71
ArduinoDashboardv2: Updated dashboard object
72
"""
73
74
def dashboards_v2_delete(self, id: str, x_organization: str = None) -> None:
75
"""
76
Delete a dashboard.
77
78
Args:
79
id: Dashboard ID
80
x_organization: Organization ID for organization-level access
81
"""
82
```
83
84
### Dashboard Cloning
85
86
Clone existing dashboards with their widgets and configurations.
87
88
```python { .api }
89
class DashboardsV2Api:
90
def dashboards_v2_clone(self, dashboard_id: str, x_organization: str = None) -> ArduinoDashboardv2:
91
"""
92
Clone a dashboard.
93
94
Args:
95
dashboard_id: Dashboard ID to clone
96
x_organization: Organization ID for organization-level access
97
98
Returns:
99
ArduinoDashboardv2: Cloned dashboard object
100
"""
101
```
102
103
### Dashboard Sharing
104
105
Share dashboards with other users and manage access permissions.
106
107
```python { .api }
108
class DashboardsV2Api:
109
def dashboards_v2_share(self, id: str, sharerequest: Sharerequest, x_organization: str = None) -> None:
110
"""
111
Share a dashboard.
112
113
Args:
114
id: Dashboard ID
115
sharerequest: Share request payload
116
x_organization: Organization ID for organization-level access
117
"""
118
119
def dashboards_v2_list_shares(self, id: str, x_organization: str = None) -> List[ArduinoDashboardshare]:
120
"""
121
List users that have access to the dashboard.
122
123
Args:
124
id: Dashboard ID
125
x_organization: Organization ID for organization-level access
126
127
Returns:
128
List[ArduinoDashboardshare]: List of users with access
129
"""
130
131
def dashboards_v2_request_access(self, id: str, sharerequest: Sharerequest, x_organization: str = None) -> None:
132
"""
133
Request access to a dashboard.
134
135
Args:
136
id: Dashboard ID
137
sharerequest: Access request payload
138
x_organization: Organization ID for organization-level access
139
"""
140
141
def dashboards_v2_delete_share(self, id: str, user_id: str, x_organization: str = None) -> None:
142
"""
143
Delete a dashboard share.
144
145
Args:
146
id: Dashboard ID
147
user_id: User ID to remove access from
148
x_organization: Organization ID for organization-level access
149
"""
150
```
151
152
### Widget Management
153
154
Link widget variables to thing properties for dynamic data visualization.
155
156
```python { .api }
157
class DashboardsV2Api:
158
def dashboards_v2_link(self, id: str, widget_id: str, widgetlink: Widgetlink, x_organization: str = None) -> None:
159
"""
160
Link widget variables to thing properties.
161
162
Args:
163
id: Dashboard ID
164
widget_id: Widget ID to link
165
widgetlink: Widget link configuration
166
x_organization: Organization ID for organization-level access
167
"""
168
```
169
170
### Dashboard Templates
171
172
Generate and manage dashboard templates.
173
174
```python { .api }
175
class DashboardsV2Api:
176
def dashboards_v2_template(self, id: str, x_organization: str = None) -> ArduinoDashboardv2template:
177
"""
178
Get dashboard template.
179
180
Args:
181
id: Dashboard ID
182
x_organization: Organization ID for organization-level access
183
184
Returns:
185
ArduinoDashboardv2template: Dashboard template
186
"""
187
```
188
189
## Usage Examples
190
191
### Creating a Dashboard
192
193
```python
194
from iot_api_client.models import Dashboardv2
195
196
dashboard_data = Dashboardv2(
197
name="My IoT Dashboard",
198
description="Temperature monitoring dashboard",
199
widgets=[]
200
)
201
202
dashboard = dashboards_api.dashboards_v2_create(dashboard_data)
203
print(f"Created dashboard: {dashboard.name} (ID: {dashboard.id})")
204
```
205
206
### Sharing a Dashboard
207
208
```python
209
from iot_api_client.models import Sharerequest
210
211
share_request = Sharerequest(
212
message="Please access this dashboard",
213
user_id="user@example.com"
214
)
215
216
dashboards_api.dashboards_v2_share("dashboard-id", share_request)
217
```
218
219
### Linking Widget to Property
220
221
```python
222
from iot_api_client.models import Widgetlink
223
224
widget_link = Widgetlink(
225
thing_id="thing-id",
226
property_id="property-id",
227
variable_name="temperature"
228
)
229
230
dashboards_api.dashboards_v2_link("dashboard-id", "widget-id", widget_link)
231
```
232
233
### Cloning a Dashboard
234
235
```python
236
cloned_dashboard = dashboards_api.dashboards_v2_clone("original-dashboard-id")
237
print(f"Cloned dashboard: {cloned_dashboard.name}")
238
```
239
240
## Types
241
242
```python { .api }
243
class Dashboardv2:
244
name: str
245
description: str
246
widgets: List[ArduinoWidgetv2]
247
248
class ArduinoDashboardv2:
249
created_at: datetime
250
description: str
251
href: str
252
id: str
253
name: str
254
organization_id: str
255
owner_id: str
256
shared_by: List[ArduinoDashboardshare]
257
updated_at: datetime
258
user_id: str
259
widgets: List[ArduinoWidgetv2]
260
261
class ArduinoDashboardv2template:
262
name: str
263
description: str
264
widgets: List[ArduinoWidgetv2template]
265
266
class Sharerequest:
267
message: str
268
user_id: str
269
270
class Widgetlink:
271
thing_id: str
272
property_id: str
273
variable_name: str
274
275
class ArduinoWidgetv2:
276
height: int
277
id: str
278
name: str
279
options: Dict[str, Any]
280
type: str
281
variables: List[ArduinoLinkedvariable]
282
width: int
283
x: int
284
y: int
285
```