bosdyn-orbit 4.0.3__py3-none-any.whl → 4.1.0__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 CHANGED
@@ -26,13 +26,13 @@ class Client():
26
26
  Args:
27
27
  hostname: the IP address associated with the instance
28
28
  verify(path to a CA bundle or Boolean): controls whether we verify the server’s TLS certificate
29
- Note that verify=False makes your application vulnerable to man-in-the-middle (MitM) attacks
30
- Defaults to True
29
+ Note that verify=False makes your application vulnerable to man-in-the-middle (MitM) attacks.
30
+ Defaults to True.
31
31
  cert(.pem file or a tuple with ('cert', 'key') pair): a local cert to use as client side certificate
32
32
  Note that the private key to your local certificate must be unencrypted because Requests does not support using encrypted keys.
33
- Defaults to None. For additional configurations, use the member Session object "_session" in accordance with Requests library
33
+ Defaults to None. For additional configurations, use the member Session object "_session" in accordance with Requests library.
34
34
  Raises:
35
- RequestExceptions: exceptions thrown by the Requests library
35
+ RequestExceptions: exceptions thrown by the Requests library.
36
36
  """
37
37
  # The hostname of the instance
38
38
  self._hostname = hostname
@@ -56,9 +56,9 @@ class Client():
56
56
  Must call before using other client functions.
57
57
 
58
58
  Args:
59
- api_token: the API token obtained from the instance
59
+ api_token: the API token obtained from the instance.
60
60
  Raises:
61
- RequestExceptions: exceptions thrown by the Requests library
61
+ RequestExceptions: exceptions thrown by the Requests library.
62
62
  """
63
63
  if not api_token:
64
64
  api_token = utils.get_api_token()
@@ -77,46 +77,62 @@ class Client():
77
77
  return authenticate_response
78
78
 
79
79
  def get_resource(self, path: str, **kwargs) -> requests.Response:
80
- """ Base function for getting a resource in /api/v0/
80
+ """ Base function for getting a resource in /api/v0/.
81
81
 
82
82
  Args:
83
- path: the path appended to /api/v0/
84
- kwargs(**): a variable number of keyword arguments for the get request
83
+ path: the path appended to /api/v0/.
84
+ kwargs(**): a variable number of keyword arguments for the get request.
85
85
  Raises:
86
- RequestExceptions: exceptions thrown by the Requests library
87
- UnauthenticatedClientError: indicates that the client is not authenticated properly
86
+ RequestExceptions: exceptions thrown by the Requests library.
87
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
88
88
  Returns:
89
- requests.Response: the response associated with the get request
89
+ requests.Response: the response associated with the get request.
90
90
  """
91
91
  if not self._is_authenticated:
92
92
  raise UnauthenticatedClientError()
93
93
  return self._session.get(f'https://{self._hostname}/api/v0/{path}/', **kwargs)
94
94
 
95
95
  def post_resource(self, path: str, **kwargs) -> requests.Response:
96
- """ Base function for posting a resource in /api/v0/
96
+ """ Base function for posting a resource in /api/v0/.
97
97
 
98
98
  Args:
99
99
  path: the path appended to /api/v0/
100
- kwargs(**): a variable number of keyword arguments for the post request
100
+ kwargs(**): a variable number of keyword arguments for the post request.
101
101
  Raises:
102
- RequestExceptions: exceptions thrown by the Requests library
103
- UnauthenticatedClientError: indicates that the client is not authenticated properly
102
+ RequestExceptions: exceptions thrown by the Requests library.
103
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
104
104
  Returns:
105
- The response associated with the post request
105
+ The response associated with the post request.
106
106
  """
107
107
  if not self._is_authenticated and path != "login":
108
108
  raise UnauthenticatedClientError()
109
109
  return self._session.post(f'https://{self._hostname}/api/v0/{path}', **kwargs)
110
110
 
111
+ def patch_resource(self, path: str, **kwargs) -> requests.Response:
112
+ """ Base function for patching a resource in /api/v0/
113
+
114
+ Args:
115
+ path: the path appended to /api/v0/
116
+ kwargs(**): a variable number of keyword arguments for the patch request
117
+ Raises:
118
+ RequestExceptions: exceptions thrown by the Requests library.
119
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
120
+ Returns:
121
+ The response associated with the patch request.
122
+ """
123
+ if not self._is_authenticated and path != "login":
124
+ raise UnauthenticatedClientError()
125
+ return self._session.patch(f'https://{self._hostname}/api/v0/{path}', **kwargs)
126
+
111
127
  def delete_resource(self, path: str, **kwargs) -> requests.Response:
112
- """ Base function for deleting a resource in /api/v0/
128
+ """ Base function for deleting a resource in /api/v0/.
113
129
 
114
130
  Args:
115
131
  path: the path appended to /api/v0/
116
- kwargs(**): a variable number of keyword arguments for the delete request
132
+ kwargs(**): a variable number of keyword arguments for the delete request.
117
133
  Raises:
118
- RequestExceptions: exceptions thrown by the Requests library
119
- UnauthenticatedClientError: indicates that the client is not authenticated properly
134
+ RequestExceptions: exceptions thrown by the Requests library.
135
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
120
136
  Returns:
121
137
  The response associated with the delete request
122
138
  """
@@ -128,12 +144,12 @@ class Client():
128
144
  """ Retrieves version info.
129
145
 
130
146
  Args:
131
- kwargs(**): a variable number of keyword arguments for the get request
147
+ kwargs(**): a variable number of keyword arguments for the get request.
132
148
  Raises:
133
- RequestExceptions: exceptions thrown by the Requests library
134
- UnauthenticatedClientError: indicates that the client is not authenticated properly
149
+ RequestExceptions: exceptions thrown by the Requests library.
150
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
135
151
  Returns:
136
- requests.Response: the response associated with the get request
152
+ requests.Response: the response associated with the get request.
137
153
  """
138
154
  return self.get_resource("version", **kwargs)
139
155
 
@@ -141,12 +157,12 @@ class Client():
141
157
  """ Returns the current system time.
142
158
 
143
159
  Args:
144
- kwargs(**): a variable number of keyword arguments for the get request
160
+ kwargs(**): a variable number of keyword arguments for the get request.
145
161
  Raises:
146
- RequestExceptions: exceptions thrown by the Requests library
147
- UnauthenticatedClientError: indicates that the client is not authenticated properly
162
+ RequestExceptions: exceptions thrown by the Requests library.
163
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
148
164
  Returns:
149
- requests.Response: the response associated with the get request
165
+ requests.Response: the response associated with the get request.
150
166
  """
151
167
  return self.get_resource("settings/system-time", **kwargs)
152
168
 
@@ -154,12 +170,12 @@ class Client():
154
170
  """ Returns robots on the specified instance.
155
171
 
156
172
  Args:
157
- kwargs(**): a variable number of keyword arguments for the get request
173
+ kwargs(**): a variable number of keyword arguments for the get request.
158
174
  Raises:
159
- RequestExceptions: exceptions thrown by the Requests library
160
- UnauthenticatedClientError: indicates that the client is not authenticated properly
175
+ RequestExceptions: exceptions thrown by the Requests library.
176
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
161
177
  Returns:
162
- requests.Response: the response associated with the get request
178
+ requests.Response: the response associated with the get request.
163
179
  """
164
180
  return self.get_resource("robots", **kwargs)
165
181
 
@@ -167,45 +183,45 @@ class Client():
167
183
  """ Returns a robot on given a hostname of a specific robot.
168
184
 
169
185
  Args:
170
- hostname: the IP address associated with the desired robot on the instance
171
- kwargs(**): a variable number of keyword arguments for the get request
186
+ hostname: the IP address associated with the desired robot on the instance.
187
+ kwargs(**): a variable number of keyword arguments for the get request.
172
188
  Raises:
173
- RequestExceptions: exceptions thrown by the Requests library
174
- UnauthenticatedClientError: indicates that the client is not authenticated properly
189
+ RequestExceptions: exceptions thrown by the Requests library.
190
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
175
191
  Returns:
176
- requests.Response: the response associated with the get request
192
+ requests.Response: the response associated with the get request.
177
193
  """
178
194
  return self.get_resource(f'robots/{hostname}', **kwargs)
179
195
 
180
196
  def get_site_walks(self, **kwargs) -> requests.Response:
181
- """ Returns site walks on the specified instance
197
+ """ Returns site walks on the specified instance.
182
198
 
183
199
  Args:
184
- kwargs(**): a variable number of keyword arguments for the get request
200
+ kwargs(**): a variable number of keyword arguments for the get request.
185
201
  Raises:
186
- RequestExceptions: exceptions thrown by the Requests library
187
- UnauthenticatedClientError: indicates that the client is not authenticated properly
202
+ RequestExceptions: exceptions thrown by the Requests library.
203
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
188
204
  Returns:
189
- requests.Response: the response associated with the get request
205
+ requests.Response: the response associated with the get request.
190
206
  """
191
207
  return self.get_resource("site_walks", **kwargs)
192
208
 
193
209
  def get_site_walk_by_id(self, uuid: str, **kwargs) -> requests.Response:
194
- """ Given a site walk uuid, returns a site walk on the specified instance
210
+ """ Given a SiteWalk uuid, returns a SiteWalk on the specified instance.
195
211
 
196
212
  Args:
197
- uuid: the ID associated with the site walk
198
- kwargs(**): a variable number of keyword arguments for the get request
213
+ uuid: the ID associated with the SiteWalk.
214
+ kwargs(**): a variable number of keyword arguments for the get request.
199
215
  Raises:
200
- RequestExceptions: exceptions thrown by the Requests library
201
- UnauthenticatedClientError: indicates that the client is not authenticated properly
216
+ RequestExceptions: exceptions thrown by the Requests library.
217
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
202
218
  Returns:
203
- requests.Response: the response associated with the get request
219
+ requests.Response: the response associated with the get request.
204
220
  """
205
221
  return self.get_resource(f'site_walks/{uuid}', **kwargs)
206
222
 
207
- def get_site_elements(self, **kwargs) -> requests.Response:
208
- """ Returns site elements on the specified instance
223
+ def get_site_walk_archive_by_id(self, uuid: str, **kwargs) -> requests.Response:
224
+ """ Returns SiteWalk as a zip archive which represents a collection of graph and mission data
209
225
 
210
226
  Args:
211
227
  kwargs(**): a variable number of keyword arguments for the get request
@@ -215,166 +231,179 @@ class Client():
215
231
  Returns:
216
232
  requests.Response: the response associated with the get request
217
233
  """
234
+ return self.get_resource(f"site_walks/archive", params={"uuids": uuid}, **kwargs)
235
+
236
+ def get_site_elements(self, **kwargs) -> requests.Response:
237
+ """ Returns site elements on the specified instance.
238
+
239
+ Args:
240
+ kwargs(**): a variable number of keyword arguments for the get request.
241
+ Raises:
242
+ RequestExceptions: exceptions thrown by the Requests library.
243
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
244
+ Returns:
245
+ requests.Response: the response associated with the get request.
246
+ """
218
247
  return self.get_resource("site_elements", **kwargs)
219
248
 
220
249
  def get_site_element_by_id(self, uuid: str, **kwargs) -> requests.Response:
221
- """ Given a site element uuid, returns a site element on the specified instance
250
+ """ Given a SiteElement uuid, returns a SiteElement on the specified instance.
222
251
 
223
252
  Args:
224
- uuid: the ID associated with the site element
225
- kwargs(**): a variable number of keyword arguments for the get request
253
+ uuid: the ID associated with the SiteElement.
254
+ kwargs(**): a variable number of keyword arguments for the get request.
226
255
  Raises:
227
- RequestExceptions: exceptions thrown by the Requests library
228
- UnauthenticatedClientError: indicates that the client is not authenticated properly
256
+ RequestExceptions: exceptions thrown by the Requests library.
257
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
229
258
  Returns:
230
- requests.Response: the response associated with the get request
259
+ requests.Response: the response associated with the get request.
231
260
  """
232
261
  return self.get_resource(f'site_elements/{uuid}', **kwargs)
233
262
 
234
263
  def get_site_docks(self, **kwargs) -> requests.Response:
235
- """ Returns site docks on the specified instance
264
+ """ Returns site docks on the specified instance.
236
265
 
237
266
  Args:
238
- kwargs(**): a variable number of keyword arguments for the get request
267
+ kwargs(**): a variable number of keyword arguments for the get request.
239
268
  Raises:
240
- RequestExceptions: exceptions thrown by the Requests library
241
- UnauthenticatedClientError: indicates that the client is not authenticated properly
269
+ RequestExceptions: exceptions thrown by the Requests library.
270
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
242
271
  Returns:
243
- requests.Response: the response associated with the get request
272
+ requests.Response: the response associated with the get request.
244
273
  """
245
274
  return self.get_resource("site_docks", **kwargs)
246
275
 
247
276
  def get_site_dock_by_id(self, uuid: str, **kwargs) -> requests.Response:
248
- """ Given a site dock uuid, returns a site dock on the specified instance
277
+ """ Given a SiteDock uuid, returns a SiteDock on the specified instance.
249
278
 
250
279
  Args:
251
- uuid: the ID associated with the site dock
252
- kwargs(**): a variable number of keyword arguments for the get request
280
+ uuid: the ID associated with the SiteDock
281
+ kwargs(**): a variable number of keyword arguments for the get request.
253
282
  Raises:
254
- RequestExceptions: exceptions thrown by the Requests library
255
- UnauthenticatedClientError: indicates that the client is not authenticated properly
283
+ RequestExceptions: exceptions thrown by the Requests library.
284
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
256
285
  Returns:
257
- requests.Response: the response associated with the get request
286
+ requests.Response: the response associated with the get request.
258
287
  """
259
288
  return self.get_resource(f'site_docks/{uuid}', **kwargs)
260
289
 
261
290
  def get_calendar(self, **kwargs) -> requests.Response:
262
- """ Returns calendar events on the specified instance
291
+ """ Returns calendar events on the specified instance.
263
292
 
264
293
  Args:
265
- kwargs(**): a variable number of keyword arguments for the get request
294
+ kwargs(**): a variable number of keyword arguments for the get request.
266
295
  Raises:
267
- RequestExceptions: exceptions thrown by the Requests library
268
- UnauthenticatedClientError: indicates that the client is not authenticated properly
296
+ RequestExceptions: exceptions thrown by the Requests library.
297
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
269
298
  Returns:
270
- requests.Response: the response associated with the get request
299
+ requests.Response: the response associated with the get request.
271
300
  """
272
301
  return self.get_resource("calendar/schedule", **kwargs)
273
302
 
274
303
  def get_run_events(self, **kwargs) -> requests.Response:
275
- """ Given a dictionary of query params, returns run events
304
+ """ Given a dictionary of query params, returns run events.
276
305
 
277
306
  Args:
278
- kwargs(**): a variable number of keyword arguments for the get request
307
+ kwargs(**): a variable number of keyword arguments for the get request.
279
308
  Raises:
280
- RequestExceptions: exceptions thrown by the Requests library
281
- UnauthenticatedClientError: indicates that the client is not authenticated properly
309
+ RequestExceptions: exceptions thrown by the Requests library.
310
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
282
311
  Returns:
283
- requests.Response: the response associated with the get request
312
+ requests.Response: the response associated with the get request.
284
313
  """
285
314
  return self.get_resource("run_events", **kwargs)
286
315
 
287
316
  def get_run_event_by_id(self, uuid: str, **kwargs) -> requests.Response:
288
- """ Given a runEventUuid, returns a run event
317
+ """ Given a runEventUuid, returns a run event.
289
318
 
290
319
  Args:
291
- uuid: the ID associated with the run event
292
- kwargs(**): a variable number of keyword arguments for the get request
320
+ uuid: the ID associated with the run event.
321
+ kwargs(**): a variable number of keyword arguments for the get request.
293
322
  Raises:
294
- RequestExceptions: exceptions thrown by the Requests library
295
- UnauthenticatedClientError: indicates that the client is not authenticated properly
323
+ RequestExceptions: exceptions thrown by the Requests library.
324
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
296
325
  Returns:
297
- requests.Response: the response associated with the get request
326
+ requests.Response: the response associated with the get request.
298
327
  """
299
328
  return self.get_resource(f'run_events/{uuid}', **kwargs)
300
329
 
301
330
  def get_run_captures(self, **kwargs) -> requests.Response:
302
- """ Given a dictionary of query params, returns run captures
331
+ """ Given a dictionary of query params, returns run captures.
303
332
 
304
333
  Args:
305
- kwargs(**): a variable number of keyword arguments for the get request
334
+ kwargs(**): a variable number of keyword arguments for the get request.
306
335
  Raises:
307
- RequestExceptions: exceptions thrown by the Requests library
308
- UnauthenticatedClientError: indicates that the client is not authenticated properly
336
+ RequestExceptions: exceptions thrown by the Requests library.
337
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
309
338
  Returns:
310
- requests.Response: the response associated with the get request
339
+ requests.Response: the response associated with the get request.
311
340
  """
312
341
  return self.get_resource("run_captures", **kwargs)
313
342
 
314
343
  def get_run_capture_by_id(self, uuid: str, **kwargs) -> requests.Response:
315
- """ Given a runCaptureUuid, returns a run capture
344
+ """ Given a runCaptureUuid, returns a run capture.
316
345
 
317
346
  Args:
318
347
  uuid: the ID associated with the run capture
319
- kwargs(**): a variable number of keyword arguments for the get request
348
+ kwargs(**): a variable number of keyword arguments for the get request.
320
349
  Raises:
321
- RequestExceptions: exceptions thrown by the Requests library
322
- UnauthenticatedClientError: indicates that the client is not authenticated properly
350
+ RequestExceptions: exceptions thrown by the Requests library.
351
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
323
352
  Returns:
324
- requests.Response: the response associated with the get request
353
+ requests.Response: the response associated with the get request.
325
354
  """
326
355
  return self.get_resource(f'run_captures/{uuid}', **kwargs)
327
356
 
328
357
  def get_runs(self, **kwargs) -> requests.Response:
329
- """ Given a dictionary of query params, returns runs
358
+ """ Given a dictionary of query params, returns runs.
330
359
 
331
360
  Args:
332
- kwargs(**): a variable number of keyword arguments for the get request
361
+ kwargs(**): a variable number of keyword arguments for the get request.
333
362
  Raises:
334
- RequestExceptions: exceptions thrown by the Requests library
335
- UnauthenticatedClientError: indicates that the client is not authenticated properly
363
+ RequestExceptions: exceptions thrown by the Requests library.
364
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
336
365
  Returns:
337
- requests.Response: the response associated with the get request
366
+ requests.Response: the response associated with the get request.
338
367
  """
339
368
  return self.get_resource("runs", **kwargs)
340
369
 
341
370
  def get_run_by_id(self, uuid: str, **kwargs) -> requests.Response:
342
- """ Given a runUuid, returns a run
371
+ """ Given a runUuid, returns a run.
343
372
 
344
373
  Args:
345
374
  uuid: the ID associated with the run
346
- kwargs(**): a variable number of keyword arguments for the get request
375
+ kwargs(**): a variable number of keyword arguments for the get request.
347
376
  Raises:
348
- RequestExceptions: exceptions thrown by the Requests library
349
- UnauthenticatedClientError: indicates that the client is not authenticated properly
377
+ RequestExceptions: exceptions thrown by the Requests library.
378
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
350
379
  Returns:
351
- requests.Response: the response associated with the get request
380
+ requests.Response: the response associated with the get request.
352
381
  """
353
382
  return self.get_resource(f'runs/{uuid}', **kwargs)
354
383
 
355
384
  def get_run_archives_by_id(self, uuid: str, **kwargs) -> requests.Response:
356
- """ Given a runUuid, returns run archives
385
+ """ Given a runUuid, returns run archives.
357
386
 
358
387
  Args:
359
388
  uuid: the ID associated with the run
360
- kwargs(**): a variable number of keyword arguments for the get request
389
+ kwargs(**): a variable number of keyword arguments for the get request.
361
390
  Raises:
362
- RequestExceptions: exceptions thrown by the Requests library
363
- UnauthenticatedClientError: indicates that the client is not authenticated properly
391
+ RequestExceptions: exceptions thrown by the Requests library.
392
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
364
393
  Returns:
365
- requests.Response: the response associated with the get request
394
+ requests.Response: the response associated with the get request.
366
395
  """
367
396
  return self.get_resource(f'run_archives/{uuid}', **kwargs)
368
397
 
369
398
  def get_image(self, url: str, **kwargs) -> 'urllib3.response.HTTPResponse':
370
- """ Given a data capture url, returns a decoded image
399
+ """ Given a data capture url, returns a decoded image.
371
400
 
372
401
  Args:
373
402
  url: the url associated with the data capture in the form of https://hostname + RunCapture["dataUrl"].
374
- kwargs(**): a variable number of keyword arguments for the get request
403
+ kwargs(**): a variable number of keyword arguments for the get request.
375
404
  Raises:
376
- RequestExceptions: exceptions thrown by the Requests library
377
- UnauthenticatedClientError: indicates that the client is not authenticated properly
405
+ RequestExceptions: exceptions thrown by the Requests library.
406
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
378
407
  Returns:
379
408
  urllib3.response.HTTPResponse: the decoded response associated with the get request
380
409
  """
@@ -386,14 +415,14 @@ class Client():
386
415
  return response.raw
387
416
 
388
417
  def get_image_response(self, url: str, **kwargs) -> requests.Response:
389
- """ Given a data capture url, returns an image response
418
+ """ Given a data capture url, returns an image response.
390
419
 
391
420
  Args:
392
421
  url: the url associated with the data capture in the form of https://hostname + RunCapture["dataUrl"]
393
- kwargs(**): a variable number of keyword arguments for the get request
422
+ kwargs(**): a variable number of keyword arguments for the get request.
394
423
  Raises:
395
- RequestExceptions: exceptions thrown by the Requests library
396
- UnauthenticatedClientError: indicates that the client is not authenticated properly
424
+ RequestExceptions: exceptions thrown by the Requests library.
425
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
397
426
  Returns:
398
427
  requests.Response: the image response associated with the get request
399
428
  """
@@ -403,122 +432,123 @@ class Client():
403
432
  return response
404
433
 
405
434
  def get_webhook(self, **kwargs) -> requests.Response:
406
- """ Returns webhook on the specified instance
435
+ """ Returns webhook on the specified instance.
407
436
 
408
437
  Args:
409
- kwargs(**): a variable number of keyword arguments for the get request
438
+ kwargs(**): a variable number of keyword arguments for the get request.
410
439
  Raises:
411
- RequestExceptions: exceptions thrown by the Requests library
412
- UnauthenticatedClientError: indicates that the client is not authenticated properly
440
+ RequestExceptions: exceptions thrown by the Requests library.
441
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
413
442
  Returns:
414
- requests.Response: the response associated with the get request
443
+ requests.Response: the response associated with the get request.
415
444
  """
416
445
  return self.get_resource("webhooks", **kwargs)
417
446
 
418
447
  def get_webhook_by_id(self, uuid: str, **kwargs) -> requests.Response:
419
- """ Given a uuid, returns a specific webhook instance
448
+ """ Given a uuid, returns a specific webhook instance.
420
449
 
421
450
  Args:
422
451
  uuid: the ID associated with the webhook
423
- kwargs(**): a variable number of keyword arguments for the get request
452
+ kwargs(**): a variable number of keyword arguments for the get request.
424
453
  Raises:
425
- RequestExceptions: exceptions thrown by the Requests library
426
- UnauthenticatedClientError: indicates that the client is not authenticated properly
454
+ RequestExceptions: exceptions thrown by the Requests library.
455
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
427
456
  Returns:
428
- requests.Response: the response associated with the get request
457
+ requests.Response: the response associated with the get request.
429
458
  """
430
459
  return self.get_resource(f'webhooks/{uuid}', **kwargs)
431
460
 
432
461
  def get_robot_info(self, robot_nickname: str, **kwargs) -> requests.Response:
433
- """ Given a robot nickname, returns information about the robot
462
+ """ Given a robot nickname, returns information about the robot.
434
463
 
435
464
  Args:
436
465
  robot_nickname: the nickname of the robot
437
- kwargs(**): a variable number of keyword arguments for the get request
466
+ kwargs(**): a variable number of keyword arguments for the get request.
438
467
  Raises:
439
- RequestExceptions: exceptions thrown by the Requests library
440
- UnauthenticatedClientError: indicates that the client is not authenticated properly
468
+ RequestExceptions: exceptions thrown by the Requests library.
469
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
441
470
  Returns:
442
- requests.Response: the response associated with the post request
471
+ requests.Response: The response associated with the post request.
443
472
  """
444
473
  return self.get_resource(f'robot-session/{robot_nickname}/session', **kwargs)
445
474
 
446
475
  def post_export_as_walk(self, site_walk_uuid: str, **kwargs) -> requests.Response:
447
- """ Given a site walk uuid, it exports the walks_pb2.Walk equivalent
476
+ """ Given a SiteWalk uuid, it exports the walks_pb2.Walk equivalent.
448
477
 
449
478
  Args:
450
- site_walk_uuid: the ID associated with the site walk
451
- kwargs(**): a variable number of keyword arguments for the get request
479
+ site_walk_uuid: the ID associated with the SiteWalk.
480
+ kwargs(**): a variable number of keyword arguments for the get request.
452
481
  Raises:
453
- RequestExceptions: exceptions thrown by the Requests library
482
+ RequestExceptions: exceptions thrown by the Requests library.
454
483
  UnauthenticatedClientError: indicates that the client is not authenticated properly
455
484
  Returns:
456
- requests.Response: the response associated with the post request
485
+ requests.Response: The response associated with the post request.
457
486
  """
458
- return self.post_resource(f'site_walks/export_as_walk/{site_walk_uuid}', **kwargs)
487
+ return self.post_resource(f'site_walks/export_as_walk',
488
+ json={"siteWalkUuid": site_walk_uuid}, **kwargs)
459
489
 
460
490
  def post_import_from_walk(self, **kwargs) -> requests.Response:
461
- """ Given a walk data, imports it to the specified instance
491
+ """ Given a walk data, imports it to the specified instance.
462
492
 
463
493
  Args:
464
- kwargs(**): a variable number of keyword arguments for the post request
494
+ kwargs(**): a variable number of keyword arguments for the post request.
465
495
  Raises:
466
- RequestExceptions: exceptions thrown by the Requests library
467
- UnauthenticatedClientError: indicates that the client is not authenticated properly
496
+ RequestExceptions: exceptions thrown by the Requests library.
497
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
468
498
  Returns:
469
- requests.Response: the response associated with the post request
499
+ requests.Response: The response associated with the post request.
470
500
  """
471
501
  return self.post_resource("site_walks/import_from_walk", **kwargs)
472
502
 
473
503
  def post_site_element(self, **kwargs) -> requests.Response:
474
- """ Create a site element. It also updates a pre-existing Site Element using the associated UUID.
504
+ """ Create a SiteElement. It also updates a pre-existing SiteElement using the associated UUID.
475
505
 
476
506
  Args:
477
- kwargs(**): a variable number of keyword arguments for the post request
507
+ kwargs(**): a variable number of keyword arguments for the post request.
478
508
  Raises:
479
- RequestExceptions: exceptions thrown by the Requests library
480
- UnauthenticatedClientError: indicates that the client is not authenticated properly
509
+ RequestExceptions: exceptions thrown by the Requests library.
510
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
481
511
  Returns:
482
- requests.Response: the response associated with the post request
512
+ requests.Response: The response associated with the post request.
483
513
  """
484
514
  return self.post_resource("site_elements", **kwargs)
485
515
 
486
516
  def post_site_walk(self, **kwargs) -> requests.Response:
487
- """ Create a site walk. It also updates a pre-existing Site Walk using the associated UUID.
517
+ """ Create a SiteWalk. It also updates a pre-existing SiteWalk using the associated UUID.
488
518
 
489
519
  Args:
490
- kwargs(**): a variable number of keyword arguments for the post request
520
+ kwargs(**): a variable number of keyword arguments for the post request.
491
521
  Raises:
492
- RequestExceptions: exceptions thrown by the Requests library
493
- UnauthenticatedClientError: indicates that the client is not authenticated properly
522
+ RequestExceptions: exceptions thrown by the Requests library.
523
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
494
524
  Returns:
495
- requests.Response: the response associated with the post request
525
+ requests.Response: The response associated with the post request.
496
526
  """
497
527
  return self.post_resource("site_walks", **kwargs)
498
528
 
499
529
  def post_site_dock(self, **kwargs) -> requests.Response:
500
- """ Create a site element. It also updates a pre-existing Site Dock using the associated UUID.
530
+ """ Create a SiteElement. It also updates a pre-existing SiteDock using the associated UUID.
501
531
 
502
532
  Args:
503
- kwargs(**): a variable number of keyword arguments for the post request
533
+ kwargs(**): a variable number of keyword arguments for the post request.
504
534
  Raises:
505
- RequestExceptions: exceptions thrown by the Requests library
506
- UnauthenticatedClientError: indicates that the client is not authenticated properly
535
+ RequestExceptions: exceptions thrown by the Requests library.
536
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
507
537
  Returns:
508
- requests.Response: the response associated with the post request
538
+ requests.Response: The response associated with the post request.
509
539
  """
510
540
  return self.post_resource("site_docks", **kwargs)
511
541
 
512
542
  def post_robot(self, **kwargs) -> requests.Response:
513
- """ Add a robot to the specified instance
543
+ """ Add a robot to the specified instance.
514
544
 
515
545
  Args:
516
- kwargs(**): a variable number of keyword arguments for the post request
546
+ kwargs(**): a variable number of keyword arguments for the post request.
517
547
  Raises:
518
- RequestExceptions: exceptions thrown by the Requests library
519
- UnauthenticatedClientError: indicates that the client is not authenticated properly
548
+ RequestExceptions: exceptions thrown by the Requests library.
549
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
520
550
  Returns:
521
- requests.Response: the response associated with the post request
551
+ requests.Response: The response associated with the post request.
522
552
  """
523
553
  return self.post_resource("robots", **kwargs)
524
554
 
@@ -533,26 +563,26 @@ class Client():
533
563
  the function overwrites the attributes of the pre-existing calendar event.
534
564
 
535
565
  Args:
536
- nickname: the name associated with the robot
537
- time_ms: the first kickoff time in terms of milliseconds since epoch
538
- repeat_ms:the delay time in milliseconds for repeating calendar events
539
- mission_id: the UUID associated with the mission( also known as Site Walk)
540
- force_acquire_estop: instructs the system to force acquire the estop when the mission kicks off
541
- require_docked: determines whether the event will require the robot to be docked to start
542
- schedule_name: the desired name of the calendar event
566
+ nickname: the name associated with the robot.
567
+ time_ms: the first kickoff time in terms of milliseconds since epoch.
568
+ repeat_ms:the delay time in milliseconds for repeating calendar events.
569
+ mission_id: the UUID associated with the mission( also known as SiteWalk).
570
+ force_acquire_estop: instructs the system to force acquire the estop when the mission kicks off.
571
+ require_docked: determines whether the event will require the robot to be docked to start.
572
+ schedule_name: the desired name of the calendar event.
543
573
  blackout_times: a specification for a time period over the course of a week when a schedule should not run
544
574
  specified as list of a dictionary defined as {"startMs": <int>, "endMs" : <int>}
545
575
  with startMs (inclusive) being the millisecond offset from the beginning of the week (Sunday) when this blackout period starts
546
- and endMs (exclusive) being the millisecond offset from beginning of the week(Sunday) when this blackout period ends
547
- disable_reason: (optional) a reason for disabling the calendar event
576
+ and endMs (exclusive) being the millisecond offset from beginning of the week(Sunday) when this blackout period ends.
577
+ disable_reason: (optional) a reason for disabling the calendar event.
548
578
  event_id: the auto-generated ID for a calendar event that is already posted on the instance.
549
579
  This is only useful when editing a pre-existing calendar event.
550
- kwargs(**): a variable number of keyword arguments for the post request
580
+ kwargs(**): a variable number of keyword arguments for the post request.
551
581
  Raises:
552
- RequestExceptions: exceptions thrown by the Requests library
553
- UnauthenticatedClientError: indicates that the client is not authenticated properly
582
+ RequestExceptions: exceptions thrown by the Requests library.
583
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
554
584
  Returns:
555
- requests.Response: the response associated with the post request
585
+ requests.Response: The response associated with the post request.
556
586
  """
557
587
  # Check if the input contains the json param that is constructed outside the function
558
588
  if 'json' in kwargs:
@@ -581,33 +611,33 @@ class Client():
581
611
  return self.post_resource("calendar/schedule", json=payload, **kwargs)
582
612
 
583
613
  def post_calendar_events_disable_all(self, disable_reason: str, **kwargs) -> requests.Response:
584
- """ Disable all scheduled missions
614
+ """ Disable all scheduled missions.
585
615
 
586
616
  Args:
587
- disable_reason: Reason for disabling all scheduled missions
588
- kwargs(**): a variable number of keyword arguments for the post request
617
+ disable_reason: Reason for disabling all scheduled missions.
618
+ kwargs(**): a variable number of keyword arguments for the post request.
589
619
  Raises:
590
- RequestExceptions: exceptions thrown by the Requests library
591
- UnauthenticatedClientError: indicates that the client is not authenticated properly
620
+ RequestExceptions: exceptions thrown by the Requests library.
621
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
592
622
  Returns:
593
- requests.Response: the response associated with the post request
623
+ requests.Response: The response associated with the post request.
594
624
  """
595
625
  return self.post_resource("calendar/disable-enable", json={"disableReason": disable_reason},
596
626
  **kwargs)
597
627
 
598
628
  def post_calendar_event_disable_by_id(self, event_id: str, disable_reason: str,
599
629
  **kwargs) -> requests.Response:
600
- """ Disable specific scheduled mission by event ID
630
+ """ Disable specific scheduled mission by event ID.
601
631
 
602
632
  Args:
603
- event_id: eventId associated with a mission to disable
604
- disable_reason: Reason for disabling a scheduled mission
605
- kwargs(**): a variable number of keyword arguments for the post request
633
+ event_id: eventId associated with a mission to disable.
634
+ disable_reason: Reason for disabling a scheduled mission.
635
+ kwargs(**): a variable number of keyword arguments for the post request.
606
636
  Raises:
607
- RequestExceptions: exceptions thrown by the Requests library
608
- UnauthenticatedClientError: indicates that the client is not authenticated properly
637
+ RequestExceptions: exceptions thrown by the Requests library.
638
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
609
639
  Returns:
610
- requests.Response: the response associated with the post request
640
+ requests.Response: The response associated with the post request.
611
641
  """
612
642
  return self.post_resource("calendar/disable-enable", json={
613
643
  "disableReason": disable_reason,
@@ -615,29 +645,29 @@ class Client():
615
645
  }, **kwargs)
616
646
 
617
647
  def post_calendar_events_enable_all(self, **kwargs) -> requests.Response:
618
- """ Enable all scheduled missions
648
+ """ Enable all scheduled missions.
619
649
 
620
650
  Args:
621
- kwargs(**): a variable number of keyword arguments for the post request
651
+ kwargs(**): a variable number of keyword arguments for the post request.
622
652
  Raises:
623
- RequestExceptions: exceptions thrown by the Requests library
624
- UnauthenticatedClientError: indicates that the client is not authenticated properly
653
+ RequestExceptions: exceptions thrown by the Requests library.
654
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
625
655
  Returns:
626
- requests.Response: the response associated with the post request
656
+ requests.Response: The response associated with the post request.
627
657
  """
628
658
  return self.post_resource("calendar/disable-enable", json={"disableReason": ""}, **kwargs)
629
659
 
630
660
  def post_calendar_event_enable_by_id(self, event_id: str, **kwargs) -> requests.Response:
631
- """ Enable specific scheduled mission by event ID
661
+ """ Enable specific scheduled mission by event ID.
632
662
 
633
663
  Args:
634
- event_id: eventId associated with a mission to enable
635
- kwargs(**): a variable number of keyword arguments for the post request
664
+ event_id: eventId associated with a mission to enable.
665
+ kwargs(**): a variable number of keyword arguments for the post request.
636
666
  Raises:
637
- RequestExceptions: exceptions thrown by the Requests library
638
- UnauthenticatedClientError: indicates that the client is not authenticated properly
667
+ RequestExceptions: exceptions thrown by the Requests library.
668
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
639
669
  Returns:
640
- requests.Response: the response associated with the post request
670
+ requests.Response: The response associated with the post request.
641
671
  """
642
672
  return self.post_resource("calendar/disable-enable", json={
643
673
  "disableReason": "",
@@ -645,45 +675,45 @@ class Client():
645
675
  }, **kwargs)
646
676
 
647
677
  def post_webhook(self, **kwargs) -> requests.Response:
648
- """ Create a webhook instance
678
+ """ Create a webhook instance.
649
679
 
650
680
  Args:
651
- kwargs(**): a variable number of keyword arguments for the post request
681
+ kwargs(**): a variable number of keyword arguments for the post request.
652
682
  Raises:
653
- RequestExceptions: exceptions thrown by the Requests library
654
- UnauthenticatedClientError: indicates that the client is not authenticated properly
683
+ RequestExceptions: exceptions thrown by the Requests library.
684
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
655
685
  Returns:
656
- requests.Response: the response associated with the post request
686
+ requests.Response: The response associated with the post request.
657
687
  """
658
688
  return self.post_resource("webhooks", **kwargs)
659
689
 
660
690
  def post_webhook_by_id(self, uuid: str, **kwargs) -> requests.Response:
661
- """ Update an existing webhook instance
691
+ """ Update an existing webhook instance.
662
692
 
663
693
  Args:
664
- uuid: the ID associated with the desired webhook instance
665
- kwargs(**): a variable number of keyword arguments for the post request
694
+ uuid: the ID associated with the desired webhook instance.
695
+ kwargs(**): a variable number of keyword arguments for the post request.
666
696
  Raises:
667
- RequestExceptions: exceptions thrown by the Requests library
668
- UnauthenticatedClientError: indicates that the client is not authenticated properly
697
+ RequestExceptions: exceptions thrown by the Requests library.
698
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
669
699
  Returns:
670
- requests.Response: the response associated with the post request
700
+ requests.Response: The response associated with the post request.
671
701
  """
672
702
  return self.post_resource(f'webhooks/{uuid}', **kwargs)
673
703
 
674
704
  def post_return_to_dock_mission(self, robot_nickname: str, site_dock_uuid: str,
675
705
  **kwargs) -> requests.Response:
676
- """ Generate a mission to send the robot back to the dock
706
+ """ Generate a mission to send the robot back to the dock.
677
707
 
678
708
  Args:
679
- robot_nickname: the nickname of the robot
680
- site_dock_uuid: the uuid of the dock to send robot to
681
- kwargs(**): a variable number of keyword arguments for the post request
709
+ robot_nickname: the nickname of the robot.
710
+ site_dock_uuid: the uuid of the dock to send robot to.
711
+ kwargs(**): a variable number of keyword arguments for the post request.
682
712
  Raises:
683
- RequestExceptions: exceptions thrown by the Requests library
684
- UnauthenticatedClientError: indicates that the client is not authenticated properly
713
+ RequestExceptions: exceptions thrown by the Requests library.
714
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
685
715
  Returns:
686
- requests.Response: the response associated with the post request
716
+ requests.Response: The response associated with the post request.
687
717
  """
688
718
  return self.post_resource('graph/send-robot', json={
689
719
  "nickname": robot_nickname,
@@ -692,21 +722,22 @@ class Client():
692
722
 
693
723
  def post_dispatch_mission_to_robot(self, robot_nickname: str, driver_id: str, mission_uuid: str,
694
724
  delete_mission: bool, force_acquire_estop: bool,
695
- **kwargs) -> requests.Response:
696
- """ Dispatch the robot to a mission given a mission uuid
725
+ skip_initialization: bool, **kwargs) -> requests.Response:
726
+ """ Dispatch the robot to a mission given a mission uuid.
697
727
 
698
728
  Args:
699
- robot_nickname: the nickname of the robot
700
- driver_id: the current driver ID of the mission
701
- mission_uuid: uuid of the mission(also known as Site Walk) to dispatch
702
- delete_mission: whether to delete the mission after playback
703
- force_acquire_estop: whether to force acquire E-stop from the previous client
704
- kwargs(**): a variable number of keyword arguments for the post request
729
+ robot_nickname: the nickname of the robot.
730
+ driver_id: the current driver ID of the mission.
731
+ mission_uuid: uuid of the mission(also known as SiteWalk) to dispatch.
732
+ delete_mission: whether to delete the mission after playback.
733
+ force_acquire_estop: whether to force acquire E-stop from the previous client.
734
+ skip_initialization: whether to skip initialization when starting the return to dock mission.
735
+ kwargs(**): a variable number of keyword arguments for the post request.
705
736
  Raises:
706
- RequestExceptions: exceptions thrown by the Requests library
707
- UnauthenticatedClientError: indicates that the client is not authenticated properly
737
+ RequestExceptions: exceptions thrown by the Requests library.
738
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
708
739
  Returns:
709
- requests.Response: the response associated with the post request
740
+ requests.Response: The response associated with the post request.
710
741
  """
711
742
  # Payload required for dispatching a mission
712
743
  payload = {
@@ -729,7 +760,8 @@ class Client():
729
760
  "missionId": mission_uuid,
730
761
  "forceAcquireEstop": force_acquire_estop,
731
762
  "deleteMission": delete_mission,
732
- "requireDocked": False
763
+ "requireDocked": False,
764
+ "skipInitialization": skip_initialization
733
765
  },
734
766
  "eventMetadata": {
735
767
  "name": "API Triggered Mission"
@@ -739,17 +771,70 @@ class Client():
739
771
  f'calendar/mission/dispatch/{robot_nickname}?currentDriverId={driver_id}', json=payload,
740
772
  **kwargs)
741
773
 
774
+ def post_backup_task(self, include_missions: bool, include_captures: bool,
775
+ **kwargs) -> requests.Response:
776
+ """ Starts creating a backup zip file.
777
+
778
+ Args:
779
+ include_missions: Specifies whether to include missions and maps in the backup.
780
+ include_captures: Specifies whether to include all inspection data captures in the backup.
781
+ **kwargs: Additional keyword arguments for the backup request.
782
+ Raises:
783
+ RequestExceptions: Exceptions thrown by the Requests library.
784
+ UnauthenticatedClientError: Indicates that the client is not authenticated properly.
785
+ Returns:
786
+ requests.Response: The response associated with the backup request.
787
+ """
788
+ payload = {
789
+ "includeMissions": include_missions,
790
+ "includeCaptures": include_captures,
791
+ }
792
+ return self.post_resource(f'backup_tasks/', json=payload, **kwargs)
793
+
794
+ def patch_bulk_close_anomalies(self, element_ids: list[str], **kwargs) -> requests.Response:
795
+ """ Bulk close Anomalies by Element ID.
796
+
797
+ Args:
798
+ element_ids: the element ids of each anomaly to be closed.
799
+ kwargs(**): a variable number of keyword arguments for the patch request.
800
+ Raises:
801
+ RequestExceptions: exceptions thrown by the Requests library.
802
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
803
+ Returns:
804
+ requests.Response: The response associated with the patch request.
805
+ """
806
+ return self.patch_resource('anomalies', json={
807
+ "command": "close",
808
+ "elementIds": element_ids
809
+ }, **kwargs)
810
+
811
+ def patch_anomaly_by_id(self, anomaly_uuid: str, patched_fields: dict,
812
+ **kwargs) -> requests.Response:
813
+ """ Patch an Anomaly by uuid.
814
+
815
+ Args:
816
+ anomaly_uuid: The uuid of the anomaly to patch fields in.
817
+ patched_fields: A dictionary of fields and new values to change in the specified anomaly.
818
+ kwargs(**): a variable number of keyword arguments for the patch request.
819
+ Raises:
820
+ RequestExceptions: exceptions thrown by the Requests library.
821
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
822
+ Returns:
823
+ requests.Response: The response associated with the patch request.
824
+ """
825
+ return self.patch_resource(f'anomalies/{anomaly_uuid}', json=patched_fields, **kwargs)
826
+
742
827
  def delete_site_walk(self, uuid: str, **kwargs) -> requests.Response:
743
- """ Given a site walk uuid, deletes the site walk associated with the uuid on the specified instance
828
+ """ Given a SiteWalk uuid, deletes the SiteWalk associated with the uuid on the specified instance.
744
829
 
745
830
  Args:
746
- uuid: the ID associated with the desired site walk
747
- kwargs(**): a variable number of keyword arguments for the delete request
831
+ uuid: the ID associated with the desired SiteWalk
832
+ kwargs(**): a variable number of keyword arguments for the delete request.
748
833
  Raises:
749
- RequestExceptions: exceptions thrown by the Requests library
750
- UnauthenticatedClientError: indicates that the client is not authenticated properly
834
+ RequestExceptions: exceptions thrown by the Requests library.
835
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
751
836
  Returns:
752
- requests.Response: the response associated with the delete request
837
+ requests.Response: the response associated with the delete request.
753
838
  """
754
839
  return self.delete_resource(f'site_walks/{uuid}', **kwargs)
755
840
 
@@ -757,44 +842,58 @@ class Client():
757
842
  """ Given a robot hostname, deletes the robot associated with the hostname on the specified instance
758
843
 
759
844
  Args:
760
- robot_hostname: the IP address associated with the robot
761
- kwargs(**): a variable number of keyword arguments for the delete request
845
+ robot_hostname: the IP address associated with the robot.
846
+ kwargs(**): a variable number of keyword arguments for the delete request.
762
847
  Raises:
763
- RequestExceptions: exceptions thrown by the Requests library
764
- UnauthenticatedClientError: indicates that the client is not authenticated properly
848
+ RequestExceptions: exceptions thrown by the Requests library.
849
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
765
850
  Returns:
766
- requests.Response: the response associated with the delete request
851
+ requests.Response: the response associated with the delete request.
767
852
  """
768
853
  return self.delete_resource(f'robots/{robot_hostname}', **kwargs)
769
854
 
770
855
  def delete_calendar_event(self, event_id: str, **kwargs) -> requests.Response:
771
- """ Delete the specified calendar event on the specified instance
856
+ """ Delete the specified calendar event on the specified instance.
772
857
 
773
858
  Args:
774
- event_id(string): the ID associated with the calendar event
775
- kwargs(**): a variable number of keyword arguments for the delete request
859
+ event_id(string): the ID associated with the calendar event.
860
+ kwargs(**): a variable number of keyword arguments for the delete request.
776
861
  Raises:
777
- RequestExceptions: exceptions thrown by the Requests library
778
- UnauthenticatedClientError: indicates that the client is not authenticated properly
862
+ RequestExceptions: exceptions thrown by the Requests library.
863
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
779
864
  Returns:
780
- requests.Response: the response associated with the delete request
865
+ requests.Response: the response associated with the delete request.
781
866
  """
782
867
  return self.delete_resource(f'calendar/schedule/{event_id}', **kwargs)
783
868
 
784
869
  def delete_webhook(self, uuid: str, **kwargs) -> requests.Response:
785
- """ Delete the specified webhook instance on the specified instance
870
+ """ Delete the specified webhook instance on the specified instance.
786
871
 
787
872
  Args:
788
- uuid: the ID associated with the desired webhook
789
- kwargs(**): a variable number of keyword arguments for the delete request
873
+ uuid: the ID associated with the desired webhook.
874
+ kwargs(**): a variable number of keyword arguments for the delete request.
790
875
  Raises:
791
- RequestExceptions: exceptions thrown by the Requests library
792
- UnauthenticatedClientError: indicates that the client is not authenticated properly
876
+ RequestExceptions: exceptions thrown by the Requests library.
877
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
793
878
  Returns:
794
- requests.Response: the response associated with the delete request
879
+ requests.Response: the response associated with the delete request.
795
880
  """
796
881
  return self.delete_resource(f'webhooks/{uuid}', **kwargs)
797
882
 
883
+ def delete_backup(self, task_id: str, **kwargs):
884
+ """ Deletes the backup zip file from the Orbit instance.
885
+
886
+ Args:
887
+ hostname: the IP address associated with the desired robot on the instance.
888
+ kwargs(**): a variable number of keyword arguments for the get request.
889
+ Raises:
890
+ RequestExceptions: exceptions thrown by the Requests library.
891
+ UnauthenticatedClientError: indicates that the client is not authenticated properly.
892
+ Returns:
893
+ requests.Response: the response associated with the get request.
894
+ """
895
+ return self.delete_resource(f'backups/{task_id}', **kwargs)
896
+
798
897
 
799
898
  def create_client(options: 'argparse.Namespace') -> 'bosdyn.orbit.client.Client':
800
899
  """ Creates a client object.
@@ -809,7 +908,7 @@ def create_client(options: 'argparse.Namespace') -> 'bosdyn.orbit.client.Client'
809
908
  verify = options.verify == "True"
810
909
  else:
811
910
  print(
812
- "The provided value for the argument verify [%s] is not either 'True' or 'False'. Assuming verify is set to 'path/to/CA bundle'"
911
+ "The provided value for the argument verify [{}] is not either 'True' or 'False'. Assuming verify is set to 'path/to/CA bundle'"
813
912
  .format(options.verify))
814
913
  verify = options.verify
815
914
 
bosdyn/orbit/utils.py CHANGED
@@ -304,3 +304,24 @@ def validate_webhook_payload(payload: Dict, signature_header: str, secret: str,
304
304
  if not time_safe_equal:
305
305
  raise WebhookSignatureVerificationError(
306
306
  "The received HMAC did not match the expected value")
307
+
308
+
309
+ def print_json_response(response: 'requests.Response') -> bool:
310
+ """ A helper function to print the json response.
311
+
312
+ Args:
313
+ options(Namespace) : parsed args used for configuration options.
314
+ Returns:
315
+ Boolean that indicates the response is okay with status code 200.
316
+ """
317
+ if response.ok:
318
+ try:
319
+ json_data = response.json()
320
+ print(f"JSON Response: {json_data}")
321
+ return True
322
+ except ValueError:
323
+ print("Response is ok but not in JSON format.")
324
+ return False
325
+ else:
326
+ print(f"Request failed with status : {response.text}")
327
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bosdyn-orbit
3
- Version: 4.0.3
3
+ Version: 4.1.0
4
4
  Summary: Boston Dynamics API Orbit Client
5
5
  Home-page: https://dev.bostondynamics.com/docs/orbit/
6
6
  Author: Boston Dynamics
@@ -0,0 +1,9 @@
1
+ bosdyn/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
2
+ bosdyn/orbit/__init__.py,sha256=L_VSEXjtWZNHVHs3Jdr_TF2pJ2ju2yysAi0-YZsbJoU,266
3
+ bosdyn/orbit/client.py,sha256=aoAlBKjygn2x9rXySjQzTxtWz7CcHkv6FqjMf8jhv5I,45471
4
+ bosdyn/orbit/exceptions.py,sha256=eaeHSlGh27JlZUEjcpLKxR1CNdW6Twp4e685pUgEjyQ,711
5
+ bosdyn/orbit/utils.py,sha256=Vhgdxa9dVjua2LteszF3rgsoKcF7Sb0c5AqsArtYRWk,14333
6
+ bosdyn_orbit-4.1.0.dist-info/METADATA,sha256=PYEsgEKmezV9HBt9E3dY9czd84XFPy_CJM0z2EKX_GY,1894
7
+ bosdyn_orbit-4.1.0.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
8
+ bosdyn_orbit-4.1.0.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
9
+ bosdyn_orbit-4.1.0.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- bosdyn/__init__.py,sha256=CMQioQKK1NlMk3kZuY49b_Aw-JyvDeOtuqOCAul1I0s,330
2
- bosdyn/orbit/__init__.py,sha256=L_VSEXjtWZNHVHs3Jdr_TF2pJ2ju2yysAi0-YZsbJoU,266
3
- bosdyn/orbit/client.py,sha256=7WoQodp9bgIiyB2o7bmqd9snj6ny5rfYPnUJuj0B-qA,40131
4
- bosdyn/orbit/exceptions.py,sha256=eaeHSlGh27JlZUEjcpLKxR1CNdW6Twp4e685pUgEjyQ,711
5
- bosdyn/orbit/utils.py,sha256=i9nEEpdceD3HecLQKw7jQGQ5qR7bNWwMrcsxVpt4TJ4,13666
6
- bosdyn_orbit-4.0.3.dist-info/METADATA,sha256=7opwvVeS9Peh2eerBqMS495EeW153_4qufeVXjEjXdM,1894
7
- bosdyn_orbit-4.0.3.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
8
- bosdyn_orbit-4.0.3.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
9
- bosdyn_orbit-4.0.3.dist-info/RECORD,,