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 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
- """ The client uses a web API to send HTTPs requests to a number of REStful endpoints using the Requests library.
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
- """ 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.
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
- """ Authorizes the client using the provided API token obtained from the instance.
57
- Must call before using other client functions.
56
+ """Authorizes the client using the provided API token obtained from the instance. Must call
57
+ before using other client functions.
58
58
 
59
- Args:
60
- api_token: the API token obtained from the instance.
61
- Raises:
62
- RequestExceptions: exceptions thrown by the Requests library.
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
- """ 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.
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
- """ Base function for posting a resource in /api/v0/.
98
-
99
- Args:
100
- path: the path appended to /api/v0/
101
- kwargs(**): a variable number of keyword arguments for the post request.
102
- Raises:
103
- RequestExceptions: exceptions thrown by the Requests library.
104
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
105
- Returns:
106
- The response associated with the post request.
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
- """ Base function for patching 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 patch 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 patch request.
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
- """ Base function for deleting 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 delete 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 delete request
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
- """ Retrieves version info.
146
-
147
- Args:
148
- kwargs(**): a variable number of keyword arguments for the get request.
149
- Raises:
150
- RequestExceptions: exceptions thrown by the Requests library.
151
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
152
- Returns:
153
- requests.Response: the response associated with the get request.
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
- """ Returns the current system time.
159
-
160
- Args:
161
- kwargs(**): a variable number of keyword arguments for the get request.
162
- Raises:
163
- RequestExceptions: exceptions thrown by the Requests library.
164
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
165
- Returns:
166
- requests.Response: the response associated with the get request.
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
- """ Returns robots on the specified instance.
172
-
173
- Args:
174
- kwargs(**): a variable number of keyword arguments for the get request.
175
- Raises:
176
- RequestExceptions: exceptions thrown by the Requests library.
177
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
178
- Returns:
179
- requests.Response: the response associated with the get request.
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
- """ Returns a robot on given a hostname of a specific robot.
185
-
186
- Args:
187
- hostname: the IP address associated with the desired robot on the instance.
188
- kwargs(**): a variable number of keyword arguments for the get request.
189
- Raises:
190
- RequestExceptions: exceptions thrown by the Requests library.
191
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
192
- Returns:
193
- requests.Response: the response associated with the get request.
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
- """ Returns site walks on the specified instance.
199
-
200
- Args:
201
- kwargs(**): a variable number of keyword arguments for the get request.
202
- Raises:
203
- RequestExceptions: exceptions thrown by the Requests library.
204
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
205
- Returns:
206
- requests.Response: the response associated with the get request.
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
- """ Given a SiteWalk uuid, returns a SiteWalk on the specified instance.
212
-
213
- Args:
214
- uuid: the ID associated with the SiteWalk.
215
- kwargs(**): a variable number of keyword arguments for the get request.
216
- Raises:
217
- RequestExceptions: exceptions thrown by the Requests library.
218
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
219
- Returns:
220
- requests.Response: the response associated with the get request.
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
- """ Returns SiteWalk as a zip archive which represents a collection of graph and mission data
226
-
227
- Args:
228
- kwargs(**): a variable number of keyword arguments for the get request
229
- Raises:
230
- RequestExceptions: exceptions thrown by the Requests library
231
- UnauthenticatedClientError: indicates that the client is not authenticated properly
232
- Returns:
233
- requests.Response: the response associated with the get request
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
- """ Returns site elements on the specified instance.
239
-
240
- Args:
241
- kwargs(**): a variable number of keyword arguments for the get request.
242
- Raises:
243
- RequestExceptions: exceptions thrown by the Requests library.
244
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
245
- Returns:
246
- requests.Response: the response associated with the get request.
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
- """ Given a SiteElement uuid, returns a SiteElement on the specified instance.
252
-
253
- Args:
254
- uuid: the ID associated with the SiteElement.
255
- kwargs(**): a variable number of keyword arguments for the get request.
256
- Raises:
257
- RequestExceptions: exceptions thrown by the Requests library.
258
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
259
- Returns:
260
- requests.Response: the response associated with the get request.
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
- """ Returns site docks on the specified instance.
266
-
267
- Args:
268
- kwargs(**): a variable number of keyword arguments for the get request.
269
- Raises:
270
- RequestExceptions: exceptions thrown by the Requests library.
271
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
272
- Returns:
273
- requests.Response: the response associated with the get request.
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
- """ Given a SiteDock uuid, returns a SiteDock on the specified instance.
279
-
280
- Args:
281
- uuid: the ID associated with the SiteDock
282
- kwargs(**): a variable number of keyword arguments for the get request.
283
- Raises:
284
- RequestExceptions: exceptions thrown by the Requests library.
285
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
286
- Returns:
287
- requests.Response: the response associated with the get request.
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
- """ Returns calendar events on the specified instance.
293
-
294
- Args:
295
- kwargs(**): a variable number of keyword arguments for the get request.
296
- Raises:
297
- RequestExceptions: exceptions thrown by the Requests library.
298
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
299
- Returns:
300
- requests.Response: the response associated with the get request.
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
- """ Given a dictionary of query params, returns run events.
306
-
307
- Args:
308
- kwargs(**): a variable number of keyword arguments for the get request.
309
- Raises:
310
- RequestExceptions: exceptions thrown by the Requests library.
311
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
312
- Returns:
313
- requests.Response: the response associated with the get request.
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
- """ Given a runEventUuid, returns a run event.
319
-
320
- Args:
321
- uuid: the ID associated with the run event.
322
- kwargs(**): a variable number of keyword arguments for the get request.
323
- Raises:
324
- RequestExceptions: exceptions thrown by the Requests library.
325
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
326
- Returns:
327
- requests.Response: the response associated with the get request.
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
- """ Given a dictionary of query params, returns run captures.
333
-
334
- Args:
335
- kwargs(**): a variable number of keyword arguments for the get request.
336
- Raises:
337
- RequestExceptions: exceptions thrown by the Requests library.
338
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
339
- Returns:
340
- requests.Response: the response associated with the get request.
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
- """ Given a runCaptureUuid, returns a run capture.
346
-
347
- Args:
348
- uuid: the ID associated with the run capture
349
- kwargs(**): a variable number of keyword arguments for the get request.
350
- Raises:
351
- RequestExceptions: exceptions thrown by the Requests library.
352
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
353
- Returns:
354
- requests.Response: the response associated with the get request.
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
- """ Given a dictionary of query params, returns runs.
360
-
361
- Args:
362
- kwargs(**): a variable number of keyword arguments for the get request.
363
- Raises:
364
- RequestExceptions: exceptions thrown by the Requests library.
365
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
366
- Returns:
367
- requests.Response: the response associated with the get request.
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
- """ Given a runUuid, returns a run.
373
-
374
- Args:
375
- uuid: the ID associated with the run
376
- kwargs(**): a variable number of keyword arguments for the get request.
377
- Raises:
378
- RequestExceptions: exceptions thrown by the Requests library.
379
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
380
- Returns:
381
- requests.Response: the response associated with the get request.
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
- """ Retrieves the log of a run.
403
+ """Retrieves the log of a run.
387
404
 
388
- Args:
389
- uuid: the ID of the run.
390
- kwargs(**): a variable number of keyword arguments for the get request.
391
- Returns:
392
- requests.Response: the response associated with the get request.
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
- """ Given a runUuid, returns run archives.
398
-
399
- Args:
400
- uuid: the ID associated with the run
401
- kwargs(**): a variable number of keyword arguments for the get request.
402
- Raises:
403
- RequestExceptions: exceptions thrown by the Requests library.
404
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
405
- Returns:
406
- requests.Response: the response associated with the get request.
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
- """ Given a data capture url, returns a decoded image.
412
-
413
- Args:
414
- url: the url associated with the data capture in the form of https://hostname + RunCapture["dataUrl"].
415
- kwargs(**): a variable number of keyword arguments for the get request.
416
- Raises:
417
- RequestExceptions: exceptions thrown by the Requests library.
418
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
419
- Returns:
420
- urllib3.response.HTTPResponse: the decoded response associated with the get request
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
- """ Given a data capture url, returns an image response.
431
-
432
- Args:
433
- url: the url associated with the data capture in the form of https://hostname + RunCapture["dataUrl"]
434
- kwargs(**): a variable number of keyword arguments for the get request.
435
- Raises:
436
- RequestExceptions: exceptions thrown by the Requests library.
437
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
438
- Returns:
439
- requests.Response: the image response associated with the get request
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
- """ Returns webhook on the specified instance.
448
-
449
- Args:
450
- kwargs(**): a variable number of keyword arguments for the get request.
451
- Raises:
452
- RequestExceptions: exceptions thrown by the Requests library.
453
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
454
- Returns:
455
- requests.Response: the response associated with the get request.
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
- """ Given a uuid, returns a specific webhook instance.
461
-
462
- Args:
463
- uuid: the ID associated with the webhook
464
- kwargs(**): a variable number of keyword arguments for the get request.
465
- Raises:
466
- RequestExceptions: exceptions thrown by the Requests library.
467
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
468
- Returns:
469
- requests.Response: the response associated with the get request.
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
- """ Given a robot nickname, returns information about the robot.
475
-
476
- Args:
477
- robot_nickname: the nickname of the robot
478
- kwargs(**): a variable number of keyword arguments for the get request.
479
- Raises:
480
- RequestExceptions: exceptions thrown by the Requests library.
481
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
482
- Returns:
483
- requests.Response: The response associated with the post request.
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
- """ Given a dictionary of query params, returns anomalies.
489
-
490
- Args:
491
- kwargs(**): a variable number of keyword arguments for the get request.
492
- Raises:
493
- RequestExceptions: exceptions thrown by the Requests library.
494
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
495
- Returns:
496
- requests.Response: the response associated with the get request.
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
- """ Retrieves a *.zip containing an Orbit backup.
502
-
503
- Args:
504
- task_id: the task ID returned from the post_backup_task method.
505
- kwargs(**): a variable number of keyword arguments for the get request.
506
- Raises:
507
- RequestExceptions: exceptions thrown by the Requests library.
508
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
509
- Returns:
510
- requests.Response: the response associated with the get request.
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
- """ Retrieves the status of a backup task started by the post_backup_task method.
516
-
517
- Args:
518
- task_id: the task ID returned from the post_backup_task method.
519
- kwargs(**): a variable number of keyword arguments for the get request.
520
- Raises:
521
- RequestExceptions: exceptions thrown by the Requests library.
522
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
523
- Returns:
524
- requests.Response: the response associated with the get request.
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
- """ Retrieves session statistics.
546
+ """Retrieves session statistics.
530
547
 
531
- Args:
532
- kwargs(**): a variable number of keyword arguments for the get request.
533
- Returns:
534
- requests.Response: the response associated with the get request.
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
- """ Retrieves session summary.
556
+ """Retrieves session summary.
540
557
 
541
- Args:
542
- kwargs(**): a variable number of keyword arguments for the get request.
543
- Returns:
544
- requests.Response: the response associated with the get request.
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
- """ Given a SiteWalk uuid, it exports the walks_pb2.Walk equivalent.
550
-
551
- Args:
552
- site_walk_uuid: the ID associated with the SiteWalk.
553
- kwargs(**): a variable number of keyword arguments for the get request.
554
- Raises:
555
- RequestExceptions: exceptions thrown by the Requests library.
556
- UnauthenticatedClientError: indicates that the client is not authenticated properly
557
- Returns:
558
- requests.Response: The response associated with the post request.
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
- """ Given a walk data, imports it to the specified instance.
565
-
566
- Args:
567
- kwargs(**): a variable number of keyword arguments for the post request.
568
- Raises:
569
- RequestExceptions: exceptions thrown by the Requests library.
570
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
571
- Returns:
572
- requests.Response: The response associated with the post request.
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
- """ Create a SiteElement. It also updates a pre-existing SiteElement using the associated UUID.
578
-
579
- Args:
580
- kwargs(**): a variable number of keyword arguments for the post request.
581
- Raises:
582
- RequestExceptions: exceptions thrown by the Requests library.
583
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
584
- Returns:
585
- requests.Response: The response associated with the post request.
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
- """ Create a SiteWalk. It also updates a pre-existing SiteWalk using the associated UUID.
591
-
592
- Args:
593
- kwargs(**): a variable number of keyword arguments for the post request.
594
- Raises:
595
- RequestExceptions: exceptions thrown by the Requests library.
596
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
597
- Returns:
598
- requests.Response: The response associated with the post request.
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
- """ Create a SiteElement. It also updates a pre-existing SiteDock using the associated UUID.
604
-
605
- Args:
606
- kwargs(**): a variable number of keyword arguments for the post request.
607
- Raises:
608
- RequestExceptions: exceptions thrown by the Requests library.
609
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
610
- Returns:
611
- requests.Response: The response associated with the post request.
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
- """ Add a robot to the specified instance.
617
-
618
- Args:
619
- kwargs(**): a variable number of keyword arguments for the post request.
620
- Raises:
621
- RequestExceptions: exceptions thrown by the Requests library.
622
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
623
- Returns:
624
- requests.Response: The response associated with the post request.
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
- """ This function serves two purposes. It creates a new calendar event on using the following arguments
635
- when Event ID is not specified. When the Event ID associated with a pre-existing calendar event is specified,
636
- the function overwrites the attributes of the pre-existing calendar event.
637
-
638
- Args:
639
- nickname: the name associated with the robot.
640
- time_ms: the first kickoff time in terms of milliseconds since epoch.
641
- repeat_ms:the delay time in milliseconds for repeating calendar events.
642
- mission_id: the UUID associated with the mission( also known as SiteWalk).
643
- force_acquire_estop: instructs the system to force acquire the estop when the mission kicks off.
644
- require_docked: determines whether the event will require the robot to be docked to start.
645
- schedule_name: the desired name of the calendar event.
646
- blackout_times: a specification for a time period over the course of a week when a schedule should not run
647
- specified as list of a dictionary defined as {"startMs": <int>, "endMs" : <int>}
648
- with startMs (inclusive) being the millisecond offset from the beginning of the week (Sunday) when this blackout period starts
649
- and endMs (exclusive) being the millisecond offset from beginning of the week(Sunday) when this blackout period ends.
650
- disable_reason: (optional) a reason for disabling the calendar event.
651
- event_id: the auto-generated ID for a calendar event that is already posted on the instance.
652
- This is only useful when editing a pre-existing calendar event.
653
- kwargs(**): a variable number of keyword arguments for the post request.
654
- Raises:
655
- RequestExceptions: exceptions thrown by the Requests library.
656
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
657
- Returns:
658
- requests.Response: The response associated with the post request.
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
- """ Disable all scheduled missions.
688
-
689
- Args:
690
- disable_reason: Reason for disabling all scheduled missions.
691
- kwargs(**): a variable number of keyword arguments for the post request.
692
- Raises:
693
- RequestExceptions: exceptions thrown by the Requests library.
694
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
695
- Returns:
696
- requests.Response: The response associated with the post request.
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
- """ Disable specific scheduled mission by event ID.
704
-
705
- Args:
706
- event_id: eventId associated with a mission to disable.
707
- disable_reason: Reason for disabling a scheduled mission.
708
- kwargs(**): a variable number of keyword arguments for the post request.
709
- Raises:
710
- RequestExceptions: exceptions thrown by the Requests library.
711
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
712
- Returns:
713
- requests.Response: The response associated with the post request.
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
- """ Enable all scheduled missions.
722
-
723
- Args:
724
- kwargs(**): a variable number of keyword arguments for the post request.
725
- Raises:
726
- RequestExceptions: exceptions thrown by the Requests library.
727
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
728
- Returns:
729
- requests.Response: The response associated with the post request.
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
- """ Enable specific scheduled mission by event ID.
735
-
736
- Args:
737
- event_id: eventId associated with a mission to enable.
738
- kwargs(**): a variable number of keyword arguments for the post request.
739
- Raises:
740
- RequestExceptions: exceptions thrown by the Requests library.
741
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
742
- Returns:
743
- requests.Response: The response associated with the post request.
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
- """ Create a webhook instance.
752
-
753
- Args:
754
- kwargs(**): a variable number of keyword arguments for the post request.
755
- Raises:
756
- RequestExceptions: exceptions thrown by the Requests library.
757
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
758
- Returns:
759
- requests.Response: The response associated with the post request.
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
- """ Update an existing webhook instance.
765
-
766
- Args:
767
- uuid: the ID associated with the desired webhook instance.
768
- kwargs(**): a variable number of keyword arguments for the post request.
769
- Raises:
770
- RequestExceptions: exceptions thrown by the Requests library.
771
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
772
- Returns:
773
- requests.Response: The response associated with the post request.
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
- """ Generate a mission to send the robot back to the dock.
780
-
781
- Args:
782
- robot_nickname: the nickname of the robot.
783
- site_dock_uuid: the uuid of the dock to send robot to.
784
- kwargs(**): a variable number of keyword arguments for the post request.
785
- Raises:
786
- RequestExceptions: exceptions thrown by the Requests library.
787
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
788
- Returns:
789
- requests.Response: The response associated with the post request.
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
- """ Dispatch the robot to a mission given a mission uuid.
802
-
803
- Args:
804
- robot_nickname: the nickname of the robot.
805
- driver_id: the current driver ID of the mission.
806
- mission_uuid: Deprecated. Use 'walk' instead.
807
- delete_mission: DEPRECATED and no longer supported. Instead, use a temporary walk file that will not be reused.
808
- force_acquire_estop: whether to force acquire E-stop from the previous client.
809
- skip_initialization: whether to skip initialization when starting the return to dock mission.
810
- walk: the walk to dispatch the robot to. If this is set, mission_uuid should be None.
811
- kwargs(**): a variable number of keyword arguments for the post request.
812
- Raises:
813
- ValueError: if neither or both of mission_uuid and walk are set.
814
- AssertionError: if delete_mission is set to True.
815
- RequestExceptions: exceptions thrown by the Requests library.
816
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
817
- Returns:
818
- requests.Response: The response associated with the post request.
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
- """ Starts creating a backup zip file.
874
-
875
- Args:
876
- include_missions: Specifies whether to include missions and maps in the backup.
877
- include_captures: Specifies whether to include all inspection data captures in the backup.
878
- **kwargs: Additional keyword arguments for the backup request.
879
- Raises:
880
- RequestExceptions: Exceptions thrown by the Requests library.
881
- UnauthenticatedClientError: Indicates that the client is not authenticated properly.
882
- Returns:
883
- requests.Response: The response associated with the backup request.
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[str], **kwargs) -> requests.Response:
892
- """ Bulk close Anomalies by Element ID.
893
-
894
- Args:
895
- element_ids: the element ids of each anomaly to be closed.
896
- kwargs(**): a variable number of keyword arguments for the patch request.
897
- Raises:
898
- RequestExceptions: exceptions thrown by the Requests library.
899
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
900
- Returns:
901
- requests.Response: The response associated with the patch request.
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
- """ Patch an Anomaly by uuid.
911
-
912
- Args:
913
- anomaly_uuid: The uuid of the anomaly to patch fields in.
914
- patched_fields: A dictionary of fields and new values to change in the specified anomaly.
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.
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
- """ Given a SiteWalk uuid, deletes the SiteWalk associated with the uuid on the specified instance.
926
-
927
- Args:
928
- uuid: the ID associated with the desired SiteWalk
929
- kwargs(**): a variable number of keyword arguments for the delete request.
930
- Raises:
931
- RequestExceptions: exceptions thrown by the Requests library.
932
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
933
- Returns:
934
- requests.Response: the response associated with the delete request.
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
- """ Given a robot hostname, deletes the robot associated with the hostname on the specified instance
940
-
941
- Args:
942
- robot_hostname: the IP address associated with the robot.
943
- kwargs(**): a variable number of keyword arguments for the delete request.
944
- Raises:
945
- RequestExceptions: exceptions thrown by the Requests library.
946
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
947
- Returns:
948
- requests.Response: the response associated with the delete request.
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
- """ Delete the specified calendar event on the specified instance.
954
-
955
- Args:
956
- event_id(string): the ID associated with the calendar event.
957
- kwargs(**): a variable number of keyword arguments for the delete request.
958
- Raises:
959
- RequestExceptions: exceptions thrown by the Requests library.
960
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
961
- Returns:
962
- requests.Response: the response associated with the delete request.
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
- """ Delete the specified webhook instance on the specified instance.
968
-
969
- Args:
970
- uuid: the ID associated with the desired webhook.
971
- kwargs(**): a variable number of keyword arguments for the delete request.
972
- Raises:
973
- RequestExceptions: exceptions thrown by the Requests library.
974
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
975
- Returns:
976
- requests.Response: the response associated with the delete request.
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
- """ Deletes the backup zip file from the Orbit instance.
982
-
983
- Args:
984
- hostname: the IP address associated with the desired robot on the instance.
985
- kwargs(**): a variable number of keyword arguments for the get request.
986
- Raises:
987
- RequestExceptions: exceptions thrown by the Requests library.
988
- UnauthenticatedClientError: indicates that the client is not authenticated properly.
989
- Returns:
990
- requests.Response: the response associated with the get request.
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
- """ Creates a client object.
1017
+ """Creates a client object.
997
1018
 
998
- Args:
999
- options: User input containing hostname, verification, and certification info.
1000
- Returns:
1001
- client: 'bosdyn.orbit.client.Client' object
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"]: