bosdyn-orbit 5.0.1.2__py3-none-any.whl → 5.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bosdyn/orbit/client.py +611 -590
- {bosdyn_orbit-5.0.1.2.dist-info → bosdyn_orbit-5.1.1.dist-info}/METADATA +1 -1
- bosdyn_orbit-5.1.1.dist-info/RECORD +9 -0
- bosdyn_orbit-5.0.1.2.dist-info/RECORD +0 -9
- {bosdyn_orbit-5.0.1.2.dist-info → bosdyn_orbit-5.1.1.dist-info}/WHEEL +0 -0
- {bosdyn_orbit-5.0.1.2.dist-info → bosdyn_orbit-5.1.1.dist-info}/top_level.txt +0 -0
bosdyn/orbit/client.py
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# is subject to the terms and conditions of the Boston Dynamics Software
|
|
5
5
|
# Development Kit License (20191101-BDSDK-SL).
|
|
6
6
|
|
|
7
|
-
"""
|
|
8
|
-
"""
|
|
7
|
+
"""The client uses a web API to send HTTPs requests to a number of REStful endpoints using the
|
|
8
|
+
Requests library."""
|
|
9
9
|
import warnings
|
|
10
10
|
from typing import Dict, Iterable
|
|
11
11
|
|
|
@@ -19,21 +19,21 @@ OCTET_HEADER = {'Content-type': 'application/octet-stream', 'Accept': 'applicati
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class Client():
|
|
22
|
-
"""Client for the Orbit web API"""
|
|
22
|
+
"""Client for the Orbit web API."""
|
|
23
23
|
|
|
24
24
|
def __init__(self, hostname: str, verify: bool = True, cert: str = None):
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
"""Initializes the attributes of the Client object.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
hostname: the IP address associated with the instance
|
|
29
|
+
verify(path to a CA bundle or Boolean): controls whether we verify the server’s TLS certificate
|
|
30
|
+
Note that verify=False makes your application vulnerable to man-in-the-middle (MitM) attacks.
|
|
31
|
+
Defaults to True.
|
|
32
|
+
cert(.pem file or a tuple with ('cert', 'key') pair): a local cert to use as client side certificate
|
|
33
|
+
Note that the private key to your local certificate must be unencrypted because Requests does not support using encrypted keys.
|
|
34
|
+
Defaults to None. For additional configurations, use the member Session object "_session" in accordance with Requests library.
|
|
35
|
+
Raises:
|
|
36
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
37
37
|
"""
|
|
38
38
|
# The hostname of the instance
|
|
39
39
|
self._hostname = hostname
|
|
@@ -53,13 +53,13 @@ class Client():
|
|
|
53
53
|
self._is_authenticated = False
|
|
54
54
|
|
|
55
55
|
def authenticate_with_api_token(self, api_token: str = None) -> requests.Response:
|
|
56
|
-
"""
|
|
57
|
-
|
|
56
|
+
"""Authorizes the client using the provided API token obtained from the instance. Must call
|
|
57
|
+
before using other client functions.
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
Args:
|
|
60
|
+
api_token: the API token obtained from the instance.
|
|
61
|
+
Raises:
|
|
62
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
63
63
|
"""
|
|
64
64
|
if not api_token:
|
|
65
65
|
api_token = utils.get_api_token()
|
|
@@ -78,346 +78,363 @@ class Client():
|
|
|
78
78
|
return authenticate_response
|
|
79
79
|
|
|
80
80
|
def get_resource(self, path: str, **kwargs) -> requests.Response:
|
|
81
|
-
"""
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
"""Base function for getting a resource in /api/v0/.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
path: the path appended to /api/v0/.
|
|
85
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
86
|
+
Raises:
|
|
87
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
88
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
89
|
+
Returns:
|
|
90
|
+
requests.Response: the response associated with the get request.
|
|
91
91
|
"""
|
|
92
92
|
if not self._is_authenticated:
|
|
93
93
|
raise UnauthenticatedClientError()
|
|
94
94
|
return self._session.get(f'https://{self._hostname}/api/v0/{path}/', **kwargs)
|
|
95
95
|
|
|
96
|
+
def get_resource_from_data_acquisition(self, path: str, **kwargs) -> requests.Response:
|
|
97
|
+
"""Base function for getting a resource in data acquisition.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
path: the path to the resource.
|
|
101
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
102
|
+
Raises:
|
|
103
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
104
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
105
|
+
Returns:
|
|
106
|
+
requests.Response: the response associated with the get request.
|
|
107
|
+
"""
|
|
108
|
+
if not self._is_authenticated:
|
|
109
|
+
raise UnauthenticatedClientError()
|
|
110
|
+
return self._session.get(f'https://{self._hostname}/{path}', **kwargs)
|
|
111
|
+
|
|
96
112
|
def post_resource(self, path: str, **kwargs) -> requests.Response:
|
|
97
|
-
"""
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
"""Base function for posting a resource in /api/v0/.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
path: the path appended to /api/v0/
|
|
117
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
118
|
+
Raises:
|
|
119
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
120
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
121
|
+
Returns:
|
|
122
|
+
The response associated with the post request.
|
|
107
123
|
"""
|
|
108
124
|
if not self._is_authenticated and path != "login":
|
|
109
125
|
raise UnauthenticatedClientError()
|
|
110
126
|
return self._session.post(f'https://{self._hostname}/api/v0/{path}', **kwargs)
|
|
111
127
|
|
|
112
128
|
def patch_resource(self, path: str, **kwargs) -> requests.Response:
|
|
113
|
-
"""
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
"""Base function for patching a resource in /api/v0/
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
path: the path appended to /api/v0/
|
|
133
|
+
kwargs(**): a variable number of keyword arguments for the patch request
|
|
134
|
+
Raises:
|
|
135
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
136
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
137
|
+
Returns:
|
|
138
|
+
The response associated with the patch request.
|
|
123
139
|
"""
|
|
124
140
|
if not self._is_authenticated and path != "login":
|
|
125
141
|
raise UnauthenticatedClientError()
|
|
126
142
|
return self._session.patch(f'https://{self._hostname}/api/v0/{path}', **kwargs)
|
|
127
143
|
|
|
128
144
|
def delete_resource(self, path: str, **kwargs) -> requests.Response:
|
|
129
|
-
"""
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
145
|
+
"""Base function for deleting a resource in /api/v0/.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
path: the path appended to /api/v0/
|
|
149
|
+
kwargs(**): a variable number of keyword arguments for the delete request.
|
|
150
|
+
Raises:
|
|
151
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
152
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
153
|
+
Returns:
|
|
154
|
+
The response associated with the delete request
|
|
139
155
|
"""
|
|
140
156
|
if not self._is_authenticated:
|
|
141
157
|
raise UnauthenticatedClientError()
|
|
142
158
|
return self._session.delete(f'https://{self._hostname}/api/v0/{path}', **kwargs)
|
|
143
159
|
|
|
144
160
|
def get_version(self, **kwargs) -> requests.Response:
|
|
145
|
-
"""
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
"""Retrieves version info.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
165
|
+
Raises:
|
|
166
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
167
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
168
|
+
Returns:
|
|
169
|
+
requests.Response: the response associated with the get request.
|
|
154
170
|
"""
|
|
155
171
|
return self.get_resource("version", **kwargs)
|
|
156
172
|
|
|
157
173
|
def get_system_time(self, **kwargs) -> requests.Response:
|
|
158
|
-
"""
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
174
|
+
"""Returns the current system time.
|
|
175
|
+
|
|
176
|
+
Args:
|
|
177
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
178
|
+
Raises:
|
|
179
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
180
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
181
|
+
Returns:
|
|
182
|
+
requests.Response: the response associated with the get request.
|
|
167
183
|
"""
|
|
168
184
|
return self.get_resource("settings/system-time", **kwargs)
|
|
169
185
|
|
|
170
186
|
def get_robots(self, **kwargs) -> requests.Response:
|
|
171
|
-
"""
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
187
|
+
"""Returns robots on the specified instance.
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
191
|
+
Raises:
|
|
192
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
193
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
194
|
+
Returns:
|
|
195
|
+
requests.Response: the response associated with the get request.
|
|
180
196
|
"""
|
|
181
197
|
return self.get_resource("robots", **kwargs)
|
|
182
198
|
|
|
183
199
|
def get_robot_by_hostname(self, hostname: str, **kwargs) -> requests.Response:
|
|
184
|
-
"""
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
200
|
+
"""Returns a robot on given a hostname of a specific robot.
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
hostname: the IP address associated with the desired robot on the instance.
|
|
204
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
205
|
+
Raises:
|
|
206
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
207
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
208
|
+
Returns:
|
|
209
|
+
requests.Response: the response associated with the get request.
|
|
194
210
|
"""
|
|
195
211
|
return self.get_resource(f'robots/{hostname}', **kwargs)
|
|
196
212
|
|
|
197
213
|
def get_site_walks(self, **kwargs) -> requests.Response:
|
|
198
|
-
"""
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
214
|
+
"""Returns site walks on the specified instance.
|
|
215
|
+
|
|
216
|
+
Args:
|
|
217
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
218
|
+
Raises:
|
|
219
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
220
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
221
|
+
Returns:
|
|
222
|
+
requests.Response: the response associated with the get request.
|
|
207
223
|
"""
|
|
208
224
|
return self.get_resource("site_walks", **kwargs)
|
|
209
225
|
|
|
210
226
|
def get_site_walk_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
211
|
-
"""
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
227
|
+
"""Given a SiteWalk uuid, returns a SiteWalk on the specified instance.
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
uuid: the ID associated with the SiteWalk.
|
|
231
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
232
|
+
Raises:
|
|
233
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
234
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
235
|
+
Returns:
|
|
236
|
+
requests.Response: the response associated with the get request.
|
|
221
237
|
"""
|
|
222
238
|
return self.get_resource(f'site_walks/{uuid}', **kwargs)
|
|
223
239
|
|
|
224
240
|
def get_site_walk_archive_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
225
|
-
"""
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
241
|
+
"""Returns SiteWalk as a zip archive which represents a collection of graph and mission
|
|
242
|
+
data.
|
|
243
|
+
|
|
244
|
+
Args:
|
|
245
|
+
kwargs(**): a variable number of keyword arguments for the get request
|
|
246
|
+
Raises:
|
|
247
|
+
RequestExceptions: exceptions thrown by the Requests library
|
|
248
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly
|
|
249
|
+
Returns:
|
|
250
|
+
requests.Response: the response associated with the get request
|
|
234
251
|
"""
|
|
235
252
|
return self.get_resource("site_walks/archive", params={"uuids": uuid}, **kwargs)
|
|
236
253
|
|
|
237
254
|
def get_site_elements(self, **kwargs) -> requests.Response:
|
|
238
|
-
"""
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
255
|
+
"""Returns site elements on the specified instance.
|
|
256
|
+
|
|
257
|
+
Args:
|
|
258
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
259
|
+
Raises:
|
|
260
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
261
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
262
|
+
Returns:
|
|
263
|
+
requests.Response: the response associated with the get request.
|
|
247
264
|
"""
|
|
248
265
|
return self.get_resource("site_elements", **kwargs)
|
|
249
266
|
|
|
250
267
|
def get_site_element_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
251
|
-
"""
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
268
|
+
"""Given a SiteElement uuid, returns a SiteElement on the specified instance.
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
uuid: the ID associated with the SiteElement.
|
|
272
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
273
|
+
Raises:
|
|
274
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
275
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
276
|
+
Returns:
|
|
277
|
+
requests.Response: the response associated with the get request.
|
|
261
278
|
"""
|
|
262
279
|
return self.get_resource(f'site_elements/{uuid}', **kwargs)
|
|
263
280
|
|
|
264
281
|
def get_site_docks(self, **kwargs) -> requests.Response:
|
|
265
|
-
"""
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
282
|
+
"""Returns site docks on the specified instance.
|
|
283
|
+
|
|
284
|
+
Args:
|
|
285
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
286
|
+
Raises:
|
|
287
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
288
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
289
|
+
Returns:
|
|
290
|
+
requests.Response: the response associated with the get request.
|
|
274
291
|
"""
|
|
275
292
|
return self.get_resource("site_docks", **kwargs)
|
|
276
293
|
|
|
277
294
|
def get_site_dock_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
278
|
-
"""
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
295
|
+
"""Given a SiteDock uuid, returns a SiteDock on the specified instance.
|
|
296
|
+
|
|
297
|
+
Args:
|
|
298
|
+
uuid: the ID associated with the SiteDock
|
|
299
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
300
|
+
Raises:
|
|
301
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
302
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
303
|
+
Returns:
|
|
304
|
+
requests.Response: the response associated with the get request.
|
|
288
305
|
"""
|
|
289
306
|
return self.get_resource(f'site_docks/{uuid}', **kwargs)
|
|
290
307
|
|
|
291
308
|
def get_calendar(self, **kwargs) -> requests.Response:
|
|
292
|
-
"""
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
309
|
+
"""Returns calendar events on the specified instance.
|
|
310
|
+
|
|
311
|
+
Args:
|
|
312
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
313
|
+
Raises:
|
|
314
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
315
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
316
|
+
Returns:
|
|
317
|
+
requests.Response: the response associated with the get request.
|
|
301
318
|
"""
|
|
302
319
|
return self.get_resource("calendar/schedule", **kwargs)
|
|
303
320
|
|
|
304
321
|
def get_run_events(self, **kwargs) -> requests.Response:
|
|
305
|
-
"""
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
322
|
+
"""Given a dictionary of query params, returns run events.
|
|
323
|
+
|
|
324
|
+
Args:
|
|
325
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
326
|
+
Raises:
|
|
327
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
328
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
329
|
+
Returns:
|
|
330
|
+
requests.Response: the response associated with the get request.
|
|
314
331
|
"""
|
|
315
332
|
return self.get_resource("run_events", **kwargs)
|
|
316
333
|
|
|
317
334
|
def get_run_event_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
318
|
-
"""
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
335
|
+
"""Given a runEventUuid, returns a run event.
|
|
336
|
+
|
|
337
|
+
Args:
|
|
338
|
+
uuid: the ID associated with the run event.
|
|
339
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
340
|
+
Raises:
|
|
341
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
342
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
343
|
+
Returns:
|
|
344
|
+
requests.Response: the response associated with the get request.
|
|
328
345
|
"""
|
|
329
346
|
return self.get_resource(f'run_events/{uuid}', **kwargs)
|
|
330
347
|
|
|
331
348
|
def get_run_captures(self, **kwargs) -> requests.Response:
|
|
332
|
-
"""
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
349
|
+
"""Given a dictionary of query params, returns run captures.
|
|
350
|
+
|
|
351
|
+
Args:
|
|
352
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
353
|
+
Raises:
|
|
354
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
355
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
356
|
+
Returns:
|
|
357
|
+
requests.Response: the response associated with the get request.
|
|
341
358
|
"""
|
|
342
359
|
return self.get_resource("run_captures", **kwargs)
|
|
343
360
|
|
|
344
361
|
def get_run_capture_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
345
|
-
"""
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
362
|
+
"""Given a runCaptureUuid, returns a run capture.
|
|
363
|
+
|
|
364
|
+
Args:
|
|
365
|
+
uuid: the ID associated with the run capture
|
|
366
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
367
|
+
Raises:
|
|
368
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
369
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
370
|
+
Returns:
|
|
371
|
+
requests.Response: the response associated with the get request.
|
|
355
372
|
"""
|
|
356
373
|
return self.get_resource(f'run_captures/{uuid}', **kwargs)
|
|
357
374
|
|
|
358
375
|
def get_runs(self, **kwargs) -> requests.Response:
|
|
359
|
-
"""
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
376
|
+
"""Given a dictionary of query params, returns runs.
|
|
377
|
+
|
|
378
|
+
Args:
|
|
379
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
380
|
+
Raises:
|
|
381
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
382
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
383
|
+
Returns:
|
|
384
|
+
requests.Response: the response associated with the get request.
|
|
368
385
|
"""
|
|
369
386
|
return self.get_resource("runs", **kwargs)
|
|
370
387
|
|
|
371
388
|
def get_run_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
372
|
-
"""
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
389
|
+
"""Given a runUuid, returns a run.
|
|
390
|
+
|
|
391
|
+
Args:
|
|
392
|
+
uuid: the ID associated with the run
|
|
393
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
394
|
+
Raises:
|
|
395
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
396
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
397
|
+
Returns:
|
|
398
|
+
requests.Response: the response associated with the get request.
|
|
382
399
|
"""
|
|
383
400
|
return self.get_resource(f'runs/{uuid}', **kwargs)
|
|
384
401
|
|
|
385
402
|
def get_run_log(self, uuid: str, **kwargs) -> requests.Response:
|
|
386
|
-
"""
|
|
403
|
+
"""Retrieves the log of a run.
|
|
387
404
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
405
|
+
Args:
|
|
406
|
+
uuid: the ID of the run.
|
|
407
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
408
|
+
Returns:
|
|
409
|
+
requests.Response: the response associated with the get request.
|
|
393
410
|
"""
|
|
394
411
|
return self.get_resource(f'runs/{uuid}/log', **kwargs)
|
|
395
412
|
|
|
396
413
|
def get_run_archives_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
397
|
-
"""
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
414
|
+
"""Given a runUuid, returns run archives.
|
|
415
|
+
|
|
416
|
+
Args:
|
|
417
|
+
uuid: the ID associated with the run
|
|
418
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
419
|
+
Raises:
|
|
420
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
421
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
422
|
+
Returns:
|
|
423
|
+
requests.Response: the response associated with the get request.
|
|
407
424
|
"""
|
|
408
425
|
return self.get_resource(f'run_archives/{uuid}', **kwargs)
|
|
409
426
|
|
|
410
427
|
def get_image(self, url: str, **kwargs) -> 'urllib3.response.HTTPResponse':
|
|
411
|
-
"""
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
428
|
+
"""Given a data capture url, returns a decoded image.
|
|
429
|
+
|
|
430
|
+
Args:
|
|
431
|
+
url: the url associated with the data capture in the form of https://hostname + RunCapture["dataUrl"].
|
|
432
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
433
|
+
Raises:
|
|
434
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
435
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
436
|
+
Returns:
|
|
437
|
+
urllib3.response.HTTPResponse: the decoded response associated with the get request
|
|
421
438
|
"""
|
|
422
439
|
if not self._is_authenticated:
|
|
423
440
|
raise UnauthenticatedClientError()
|
|
@@ -427,16 +444,16 @@ class Client():
|
|
|
427
444
|
return response.raw
|
|
428
445
|
|
|
429
446
|
def get_image_response(self, url: str, **kwargs) -> requests.Response:
|
|
430
|
-
"""
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
447
|
+
"""Given a data capture url, returns an image response.
|
|
448
|
+
|
|
449
|
+
Args:
|
|
450
|
+
url: the url associated with the data capture in the form of https://hostname + RunCapture["dataUrl"]
|
|
451
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
452
|
+
Raises:
|
|
453
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
454
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
455
|
+
Returns:
|
|
456
|
+
requests.Response: the image response associated with the get request
|
|
440
457
|
"""
|
|
441
458
|
if not self._is_authenticated:
|
|
442
459
|
raise UnauthenticatedClientError()
|
|
@@ -444,184 +461,185 @@ class Client():
|
|
|
444
461
|
return response
|
|
445
462
|
|
|
446
463
|
def get_webhook(self, **kwargs) -> requests.Response:
|
|
447
|
-
"""
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
464
|
+
"""Returns webhook on the specified instance.
|
|
465
|
+
|
|
466
|
+
Args:
|
|
467
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
468
|
+
Raises:
|
|
469
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
470
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
471
|
+
Returns:
|
|
472
|
+
requests.Response: the response associated with the get request.
|
|
456
473
|
"""
|
|
457
474
|
return self.get_resource("webhooks", **kwargs)
|
|
458
475
|
|
|
459
476
|
def get_webhook_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
460
|
-
"""
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
477
|
+
"""Given a uuid, returns a specific webhook instance.
|
|
478
|
+
|
|
479
|
+
Args:
|
|
480
|
+
uuid: the ID associated with the webhook
|
|
481
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
482
|
+
Raises:
|
|
483
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
484
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
485
|
+
Returns:
|
|
486
|
+
requests.Response: the response associated with the get request.
|
|
470
487
|
"""
|
|
471
488
|
return self.get_resource(f'webhooks/{uuid}', **kwargs)
|
|
472
489
|
|
|
473
490
|
def get_robot_info(self, robot_nickname: str, **kwargs) -> requests.Response:
|
|
474
|
-
"""
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
491
|
+
"""Given a robot nickname, returns information about the robot.
|
|
492
|
+
|
|
493
|
+
Args:
|
|
494
|
+
robot_nickname: the nickname of the robot
|
|
495
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
496
|
+
Raises:
|
|
497
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
498
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
499
|
+
Returns:
|
|
500
|
+
requests.Response: The response associated with the post request.
|
|
484
501
|
"""
|
|
485
502
|
return self.get_resource(f'robot-session/{robot_nickname}/session', **kwargs)
|
|
486
503
|
|
|
487
504
|
def get_anomalies(self, **kwargs) -> requests.Response:
|
|
488
|
-
"""
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
505
|
+
"""Given a dictionary of query params, returns anomalies.
|
|
506
|
+
|
|
507
|
+
Args:
|
|
508
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
509
|
+
Raises:
|
|
510
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
511
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
512
|
+
Returns:
|
|
513
|
+
requests.Response: the response associated with the get request.
|
|
497
514
|
"""
|
|
498
515
|
return self.get_resource("anomalies", **kwargs)
|
|
499
516
|
|
|
500
517
|
def get_backup(self, task_id: str, **kwargs):
|
|
501
|
-
"""
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
518
|
+
"""Retrieves a zip file containing an Orbit backup.
|
|
519
|
+
|
|
520
|
+
Args:
|
|
521
|
+
task_id: the task ID returned from the post_backup_task method.
|
|
522
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
523
|
+
Raises:
|
|
524
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
525
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
526
|
+
Returns:
|
|
527
|
+
requests.Response: the response associated with the get request.
|
|
511
528
|
"""
|
|
512
529
|
return self.get_resource(f'backups/{task_id}', headers=OCTET_HEADER, **kwargs)
|
|
513
530
|
|
|
514
531
|
def get_backup_task(self, task_id: str, **kwargs):
|
|
515
|
-
"""
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
532
|
+
"""Retrieves the status of a backup task started by the post_backup_task method.
|
|
533
|
+
|
|
534
|
+
Args:
|
|
535
|
+
task_id: the task ID returned from the post_backup_task method.
|
|
536
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
537
|
+
Raises:
|
|
538
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
539
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
540
|
+
Returns:
|
|
541
|
+
requests.Response: the response associated with the get request.
|
|
525
542
|
"""
|
|
526
543
|
return self.get_resource(f'backup_tasks/{task_id}', **kwargs)
|
|
527
544
|
|
|
528
545
|
def get_run_statistics(self, **kwargs) -> requests.Response:
|
|
529
|
-
"""
|
|
546
|
+
"""Retrieves session statistics.
|
|
530
547
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
548
|
+
Args:
|
|
549
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
550
|
+
Returns:
|
|
551
|
+
requests.Response: the response associated with the get request.
|
|
535
552
|
"""
|
|
536
553
|
return self.get_resource("run_statistics/sessions", **kwargs)
|
|
537
554
|
|
|
538
555
|
def get_run_statistics_session_summary(self, **kwargs) -> requests.Response:
|
|
539
|
-
"""
|
|
556
|
+
"""Retrieves session summary.
|
|
540
557
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
558
|
+
Args:
|
|
559
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
560
|
+
Returns:
|
|
561
|
+
requests.Response: the response associated with the get request.
|
|
545
562
|
"""
|
|
546
563
|
return self.get_resource("run_statistics/sessions_summary", **kwargs)
|
|
547
564
|
|
|
548
565
|
def post_export_as_walk(self, site_walk_uuid: str, **kwargs) -> requests.Response:
|
|
549
|
-
"""
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
566
|
+
"""Given a SiteWalk uuid, it exports the walks_pb2.Walk equivalent.
|
|
567
|
+
|
|
568
|
+
Args:
|
|
569
|
+
site_walk_uuid: the ID associated with the SiteWalk.
|
|
570
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
571
|
+
Raises:
|
|
572
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
573
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly
|
|
574
|
+
Returns:
|
|
575
|
+
requests.Response: The response associated with the post request.
|
|
559
576
|
"""
|
|
560
577
|
return self.post_resource('site_walks/export_as_walk',
|
|
561
578
|
json={"siteWalkUuid": site_walk_uuid}, **kwargs)
|
|
562
579
|
|
|
563
580
|
def post_import_from_walk(self, **kwargs) -> requests.Response:
|
|
564
|
-
"""
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
581
|
+
"""Given a walk data, imports it to the specified instance.
|
|
582
|
+
|
|
583
|
+
Args:
|
|
584
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
585
|
+
Raises:
|
|
586
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
587
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
588
|
+
Returns:
|
|
589
|
+
requests.Response: The response associated with the post request.
|
|
573
590
|
"""
|
|
574
591
|
return self.post_resource("site_walks/import_from_walk", **kwargs)
|
|
575
592
|
|
|
576
593
|
def post_site_element(self, **kwargs) -> requests.Response:
|
|
577
|
-
"""
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
594
|
+
"""Create a SiteElement. It also updates a pre-existing SiteElement using the associated
|
|
595
|
+
UUID.
|
|
596
|
+
|
|
597
|
+
Args:
|
|
598
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
599
|
+
Raises:
|
|
600
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
601
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
602
|
+
Returns:
|
|
603
|
+
requests.Response: The response associated with the post request.
|
|
586
604
|
"""
|
|
587
605
|
return self.post_resource("site_elements", **kwargs)
|
|
588
606
|
|
|
589
607
|
def post_site_walk(self, **kwargs) -> requests.Response:
|
|
590
|
-
"""
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
608
|
+
"""Create a SiteWalk. It also updates a pre-existing SiteWalk using the associated UUID.
|
|
609
|
+
|
|
610
|
+
Args:
|
|
611
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
612
|
+
Raises:
|
|
613
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
614
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
615
|
+
Returns:
|
|
616
|
+
requests.Response: The response associated with the post request.
|
|
599
617
|
"""
|
|
600
618
|
return self.post_resource("site_walks", **kwargs)
|
|
601
619
|
|
|
602
620
|
def post_site_dock(self, **kwargs) -> requests.Response:
|
|
603
|
-
"""
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
621
|
+
"""Create a SiteElement. It also updates a pre-existing SiteDock using the associated UUID.
|
|
622
|
+
|
|
623
|
+
Args:
|
|
624
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
625
|
+
Raises:
|
|
626
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
627
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
628
|
+
Returns:
|
|
629
|
+
requests.Response: The response associated with the post request.
|
|
612
630
|
"""
|
|
613
631
|
return self.post_resource("site_docks", **kwargs)
|
|
614
632
|
|
|
615
633
|
def post_robot(self, **kwargs) -> requests.Response:
|
|
616
|
-
"""
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
634
|
+
"""Add a robot to the specified instance.
|
|
635
|
+
|
|
636
|
+
Args:
|
|
637
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
638
|
+
Raises:
|
|
639
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
640
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
641
|
+
Returns:
|
|
642
|
+
requests.Response: The response associated with the post request.
|
|
625
643
|
"""
|
|
626
644
|
return self.post_resource("robots", **kwargs)
|
|
627
645
|
|
|
@@ -631,31 +649,32 @@ class Client():
|
|
|
631
649
|
blackout_times: Iterable[Dict[str,
|
|
632
650
|
int]] = None, disable_reason: str = None,
|
|
633
651
|
event_id: str = None, **kwargs) -> requests.Response:
|
|
634
|
-
"""
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
652
|
+
"""This function serves two purposes. It creates a new calendar event on using the following
|
|
653
|
+
arguments when Event ID is not specified. When the Event ID associated with a pre-existing
|
|
654
|
+
calendar event is specified, the function overwrites the attributes of the pre-existing
|
|
655
|
+
calendar event.
|
|
656
|
+
|
|
657
|
+
Args:
|
|
658
|
+
nickname: the name associated with the robot.
|
|
659
|
+
time_ms: the first kickoff time in terms of milliseconds since epoch.
|
|
660
|
+
repeat_ms:the delay time in milliseconds for repeating calendar events.
|
|
661
|
+
mission_id: the UUID associated with the mission( also known as SiteWalk).
|
|
662
|
+
force_acquire_estop: instructs the system to force acquire the estop when the mission kicks off.
|
|
663
|
+
require_docked: determines whether the event will require the robot to be docked to start.
|
|
664
|
+
schedule_name: the desired name of the calendar event.
|
|
665
|
+
blackout_times: a specification for a time period over the course of a week when a schedule should not run
|
|
666
|
+
specified as list of a dictionary defined as {"startMs": <int>, "endMs" : <int>}
|
|
667
|
+
with startMs (inclusive) being the millisecond offset from the beginning of the week (Sunday) when this blackout period starts
|
|
668
|
+
and endMs (exclusive) being the millisecond offset from beginning of the week(Sunday) when this blackout period ends.
|
|
669
|
+
disable_reason: (optional) a reason for disabling the calendar event.
|
|
670
|
+
event_id: the auto-generated ID for a calendar event that is already posted on the instance.
|
|
671
|
+
This is only useful when editing a pre-existing calendar event.
|
|
672
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
673
|
+
Raises:
|
|
674
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
675
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
676
|
+
Returns:
|
|
677
|
+
requests.Response: The response associated with the post request.
|
|
659
678
|
"""
|
|
660
679
|
# Check if the input contains the json param that is constructed outside the function
|
|
661
680
|
if 'json' in kwargs:
|
|
@@ -684,33 +703,33 @@ class Client():
|
|
|
684
703
|
return self.post_resource("calendar/schedule", json=payload, **kwargs)
|
|
685
704
|
|
|
686
705
|
def post_calendar_events_disable_all(self, disable_reason: str, **kwargs) -> requests.Response:
|
|
687
|
-
"""
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
706
|
+
"""Disable all scheduled missions.
|
|
707
|
+
|
|
708
|
+
Args:
|
|
709
|
+
disable_reason: Reason for disabling all scheduled missions.
|
|
710
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
711
|
+
Raises:
|
|
712
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
713
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
714
|
+
Returns:
|
|
715
|
+
requests.Response: The response associated with the post request.
|
|
697
716
|
"""
|
|
698
717
|
return self.post_resource("calendar/disable-enable", json={"disableReason": disable_reason},
|
|
699
718
|
**kwargs)
|
|
700
719
|
|
|
701
720
|
def post_calendar_event_disable_by_id(self, event_id: str, disable_reason: str,
|
|
702
721
|
**kwargs) -> requests.Response:
|
|
703
|
-
"""
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
722
|
+
"""Disable specific scheduled mission by event ID.
|
|
723
|
+
|
|
724
|
+
Args:
|
|
725
|
+
event_id: eventId associated with a mission to disable.
|
|
726
|
+
disable_reason: Reason for disabling a scheduled mission.
|
|
727
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
728
|
+
Raises:
|
|
729
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
730
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
731
|
+
Returns:
|
|
732
|
+
requests.Response: The response associated with the post request.
|
|
714
733
|
"""
|
|
715
734
|
return self.post_resource("calendar/disable-enable", json={
|
|
716
735
|
"disableReason": disable_reason,
|
|
@@ -718,29 +737,29 @@ class Client():
|
|
|
718
737
|
}, **kwargs)
|
|
719
738
|
|
|
720
739
|
def post_calendar_events_enable_all(self, **kwargs) -> requests.Response:
|
|
721
|
-
"""
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
740
|
+
"""Enable all scheduled missions.
|
|
741
|
+
|
|
742
|
+
Args:
|
|
743
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
744
|
+
Raises:
|
|
745
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
746
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
747
|
+
Returns:
|
|
748
|
+
requests.Response: The response associated with the post request.
|
|
730
749
|
"""
|
|
731
750
|
return self.post_resource("calendar/disable-enable", json={"disableReason": ""}, **kwargs)
|
|
732
751
|
|
|
733
752
|
def post_calendar_event_enable_by_id(self, event_id: str, **kwargs) -> requests.Response:
|
|
734
|
-
"""
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
753
|
+
"""Enable specific scheduled mission by event ID.
|
|
754
|
+
|
|
755
|
+
Args:
|
|
756
|
+
event_id: eventId associated with a mission to enable.
|
|
757
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
758
|
+
Raises:
|
|
759
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
760
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
761
|
+
Returns:
|
|
762
|
+
requests.Response: The response associated with the post request.
|
|
744
763
|
"""
|
|
745
764
|
return self.post_resource("calendar/disable-enable", json={
|
|
746
765
|
"disableReason": "",
|
|
@@ -748,45 +767,45 @@ class Client():
|
|
|
748
767
|
}, **kwargs)
|
|
749
768
|
|
|
750
769
|
def post_webhook(self, **kwargs) -> requests.Response:
|
|
751
|
-
"""
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
770
|
+
"""Create a webhook instance.
|
|
771
|
+
|
|
772
|
+
Args:
|
|
773
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
774
|
+
Raises:
|
|
775
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
776
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
777
|
+
Returns:
|
|
778
|
+
requests.Response: The response associated with the post request.
|
|
760
779
|
"""
|
|
761
780
|
return self.post_resource("webhooks", **kwargs)
|
|
762
781
|
|
|
763
782
|
def post_webhook_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
764
|
-
"""
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
783
|
+
"""Update an existing webhook instance.
|
|
784
|
+
|
|
785
|
+
Args:
|
|
786
|
+
uuid: the ID associated with the desired webhook instance.
|
|
787
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
788
|
+
Raises:
|
|
789
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
790
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
791
|
+
Returns:
|
|
792
|
+
requests.Response: The response associated with the post request.
|
|
774
793
|
"""
|
|
775
794
|
return self.post_resource(f'webhooks/{uuid}', **kwargs)
|
|
776
795
|
|
|
777
796
|
def post_return_to_dock_mission(self, robot_nickname: str, site_dock_uuid: str,
|
|
778
797
|
**kwargs) -> requests.Response:
|
|
779
|
-
"""
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
798
|
+
"""Generate a mission to send the robot back to the dock.
|
|
799
|
+
|
|
800
|
+
Args:
|
|
801
|
+
robot_nickname: the nickname of the robot.
|
|
802
|
+
site_dock_uuid: the uuid of the dock to send robot to.
|
|
803
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
804
|
+
Raises:
|
|
805
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
806
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
807
|
+
Returns:
|
|
808
|
+
requests.Response: The response associated with the post request.
|
|
790
809
|
"""
|
|
791
810
|
return self.post_resource('graph/send-robot', json={
|
|
792
811
|
"nickname": robot_nickname,
|
|
@@ -798,24 +817,24 @@ class Client():
|
|
|
798
817
|
force_acquire_estop: bool = False,
|
|
799
818
|
skip_initialization: bool = True, walk=None,
|
|
800
819
|
**kwargs) -> requests.Response:
|
|
801
|
-
"""
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
820
|
+
"""Dispatch the robot to a mission given a mission uuid.
|
|
821
|
+
|
|
822
|
+
Args:
|
|
823
|
+
robot_nickname: the nickname of the robot.
|
|
824
|
+
driver_id: the current driver ID of the mission.
|
|
825
|
+
mission_uuid: Deprecated. Use 'walk' instead.
|
|
826
|
+
delete_mission: DEPRECATED and no longer supported. Instead, use a temporary walk file that will not be reused.
|
|
827
|
+
force_acquire_estop: whether to force acquire E-stop from the previous client.
|
|
828
|
+
skip_initialization: whether to skip initialization when starting the return to dock mission.
|
|
829
|
+
walk: the walk to dispatch the robot to. If this is set, mission_uuid should be None.
|
|
830
|
+
kwargs(**): a variable number of keyword arguments for the post request.
|
|
831
|
+
Raises:
|
|
832
|
+
ValueError: if neither or both of mission_uuid and walk are set.
|
|
833
|
+
AssertionError: if delete_mission is set to True.
|
|
834
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
835
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
836
|
+
Returns:
|
|
837
|
+
requests.Response: The response associated with the post request.
|
|
819
838
|
"""
|
|
820
839
|
# Payload required for dispatching a mission
|
|
821
840
|
if (mission_uuid is not None and walk is not None) or (mission_uuid is None and
|
|
@@ -870,17 +889,17 @@ class Client():
|
|
|
870
889
|
|
|
871
890
|
def post_backup_task(self, include_missions: bool, include_captures: bool,
|
|
872
891
|
**kwargs) -> requests.Response:
|
|
873
|
-
"""
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
892
|
+
"""Starts creating a backup zip file.
|
|
893
|
+
|
|
894
|
+
Args:
|
|
895
|
+
include_missions: Specifies whether to include missions and maps in the backup.
|
|
896
|
+
include_captures: Specifies whether to include all inspection data captures in the backup.
|
|
897
|
+
**kwargs: Additional keyword arguments for the backup request.
|
|
898
|
+
Raises:
|
|
899
|
+
RequestExceptions: Exceptions thrown by the Requests library.
|
|
900
|
+
UnauthenticatedClientError: Indicates that the client is not authenticated properly.
|
|
901
|
+
Returns:
|
|
902
|
+
requests.Response: The response associated with the backup request.
|
|
884
903
|
"""
|
|
885
904
|
payload = {
|
|
886
905
|
"includeMissions": include_missions,
|
|
@@ -888,17 +907,17 @@ class Client():
|
|
|
888
907
|
}
|
|
889
908
|
return self.post_resource('backup_tasks/', json=payload, **kwargs)
|
|
890
909
|
|
|
891
|
-
def patch_bulk_close_anomalies(self, element_ids: list
|
|
892
|
-
"""
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
910
|
+
def patch_bulk_close_anomalies(self, element_ids: list, **kwargs) -> requests.Response:
|
|
911
|
+
"""Bulk close Anomalies by Element ID.
|
|
912
|
+
|
|
913
|
+
Args:
|
|
914
|
+
element_ids: the element ids of each anomaly to be closed.
|
|
915
|
+
kwargs(**): a variable number of keyword arguments for the patch request.
|
|
916
|
+
Raises:
|
|
917
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
918
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
919
|
+
Returns:
|
|
920
|
+
requests.Response: The response associated with the patch request.
|
|
902
921
|
"""
|
|
903
922
|
return self.patch_resource('anomalies', json={
|
|
904
923
|
"command": "close",
|
|
@@ -907,98 +926,100 @@ class Client():
|
|
|
907
926
|
|
|
908
927
|
def patch_anomaly_by_id(self, anomaly_uuid: str, patched_fields: dict,
|
|
909
928
|
**kwargs) -> requests.Response:
|
|
910
|
-
"""
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
929
|
+
"""Patch an Anomaly by uuid.
|
|
930
|
+
|
|
931
|
+
Args:
|
|
932
|
+
anomaly_uuid: The uuid of the anomaly to patch fields in.
|
|
933
|
+
patched_fields: A dictionary of fields and new values to change in the specified anomaly.
|
|
934
|
+
kwargs(**): a variable number of keyword arguments for the patch request.
|
|
935
|
+
Raises:
|
|
936
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
937
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
938
|
+
Returns:
|
|
939
|
+
requests.Response: The response associated with the patch request.
|
|
921
940
|
"""
|
|
922
941
|
return self.patch_resource(f'anomalies/{anomaly_uuid}', json=patched_fields, **kwargs)
|
|
923
942
|
|
|
924
943
|
def delete_site_walk(self, uuid: str, **kwargs) -> requests.Response:
|
|
925
|
-
"""
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
944
|
+
"""Given a SiteWalk uuid, deletes the SiteWalk associated with the uuid on the specified
|
|
945
|
+
instance.
|
|
946
|
+
|
|
947
|
+
Args:
|
|
948
|
+
uuid: the ID associated with the desired SiteWalk
|
|
949
|
+
kwargs(**): a variable number of keyword arguments for the delete request.
|
|
950
|
+
Raises:
|
|
951
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
952
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
953
|
+
Returns:
|
|
954
|
+
requests.Response: the response associated with the delete request.
|
|
935
955
|
"""
|
|
936
956
|
return self.delete_resource(f'site_walks/{uuid}', **kwargs)
|
|
937
957
|
|
|
938
958
|
def delete_robot(self, robot_hostname: str, **kwargs) -> requests.Response:
|
|
939
|
-
"""
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
959
|
+
"""Given a robot hostname, deletes the robot associated with the hostname on the specified
|
|
960
|
+
instance.
|
|
961
|
+
|
|
962
|
+
Args:
|
|
963
|
+
robot_hostname: the IP address associated with the robot.
|
|
964
|
+
kwargs(**): a variable number of keyword arguments for the delete request.
|
|
965
|
+
Raises:
|
|
966
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
967
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
968
|
+
Returns:
|
|
969
|
+
requests.Response: the response associated with the delete request.
|
|
949
970
|
"""
|
|
950
971
|
return self.delete_resource(f'robots/{robot_hostname}', **kwargs)
|
|
951
972
|
|
|
952
973
|
def delete_calendar_event(self, event_id: str, **kwargs) -> requests.Response:
|
|
953
|
-
"""
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
974
|
+
"""Delete the specified calendar event on the specified instance.
|
|
975
|
+
|
|
976
|
+
Args:
|
|
977
|
+
event_id(string): the ID associated with the calendar event.
|
|
978
|
+
kwargs(**): a variable number of keyword arguments for the delete request.
|
|
979
|
+
Raises:
|
|
980
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
981
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
982
|
+
Returns:
|
|
983
|
+
requests.Response: the response associated with the delete request.
|
|
963
984
|
"""
|
|
964
985
|
return self.delete_resource(f'calendar/schedule/{event_id}', **kwargs)
|
|
965
986
|
|
|
966
987
|
def delete_webhook(self, uuid: str, **kwargs) -> requests.Response:
|
|
967
|
-
"""
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
988
|
+
"""Delete the specified webhook instance on the specified instance.
|
|
989
|
+
|
|
990
|
+
Args:
|
|
991
|
+
uuid: the ID associated with the desired webhook.
|
|
992
|
+
kwargs(**): a variable number of keyword arguments for the delete request.
|
|
993
|
+
Raises:
|
|
994
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
995
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
996
|
+
Returns:
|
|
997
|
+
requests.Response: the response associated with the delete request.
|
|
977
998
|
"""
|
|
978
999
|
return self.delete_resource(f'webhooks/{uuid}', **kwargs)
|
|
979
1000
|
|
|
980
1001
|
def delete_backup(self, task_id: str, **kwargs):
|
|
981
|
-
"""
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1002
|
+
"""Deletes the backup zip file from the Orbit instance.
|
|
1003
|
+
|
|
1004
|
+
Args:
|
|
1005
|
+
hostname: the IP address associated with the desired robot on the instance.
|
|
1006
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
1007
|
+
Raises:
|
|
1008
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
1009
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
1010
|
+
Returns:
|
|
1011
|
+
requests.Response: the response associated with the get request.
|
|
991
1012
|
"""
|
|
992
1013
|
return self.delete_resource(f'backups/{task_id}', **kwargs)
|
|
993
1014
|
|
|
994
1015
|
|
|
995
1016
|
def create_client(options: 'argparse.Namespace') -> 'bosdyn.orbit.client.Client':
|
|
996
|
-
"""
|
|
1017
|
+
"""Creates a client object.
|
|
997
1018
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1019
|
+
Args:
|
|
1020
|
+
options: User input containing hostname, verification, and certification info.
|
|
1021
|
+
Returns:
|
|
1022
|
+
client: 'bosdyn.orbit.client.Client' object
|
|
1002
1023
|
"""
|
|
1003
1024
|
# Determine the value for the argument "verify"
|
|
1004
1025
|
if options.verify in ["True", "False"]:
|