bosdyn-orbit 4.1.1__py3-none-any.whl → 5.0.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 +82 -4
- bosdyn/orbit/utils.py +23 -0
- {bosdyn_orbit-4.1.1.dist-info → bosdyn_orbit-5.0.0.dist-info}/METADATA +1 -1
- bosdyn_orbit-5.0.0.dist-info/RECORD +9 -0
- bosdyn_orbit-4.1.1.dist-info/RECORD +0 -9
- {bosdyn_orbit-4.1.1.dist-info → bosdyn_orbit-5.0.0.dist-info}/WHEEL +0 -0
- {bosdyn_orbit-4.1.1.dist-info → bosdyn_orbit-5.0.0.dist-info}/top_level.txt +0 -0
bosdyn/orbit/client.py
CHANGED
|
@@ -231,7 +231,7 @@ class Client():
|
|
|
231
231
|
Returns:
|
|
232
232
|
requests.Response: the response associated with the get request
|
|
233
233
|
"""
|
|
234
|
-
return self.get_resource(
|
|
234
|
+
return self.get_resource("site_walks/archive", params={"uuids": uuid}, **kwargs)
|
|
235
235
|
|
|
236
236
|
def get_site_elements(self, **kwargs) -> requests.Response:
|
|
237
237
|
""" Returns site elements on the specified instance.
|
|
@@ -381,6 +381,17 @@ class Client():
|
|
|
381
381
|
"""
|
|
382
382
|
return self.get_resource(f'runs/{uuid}', **kwargs)
|
|
383
383
|
|
|
384
|
+
def get_run_log(self, uuid: str, **kwargs) -> requests.Response:
|
|
385
|
+
""" Retrieves the log of a run.
|
|
386
|
+
|
|
387
|
+
Args:
|
|
388
|
+
uuid: the ID of the run.
|
|
389
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
390
|
+
Returns:
|
|
391
|
+
requests.Response: the response associated with the get request.
|
|
392
|
+
"""
|
|
393
|
+
return self.get_resource(f'runs/{uuid}/log', **kwargs)
|
|
394
|
+
|
|
384
395
|
def get_run_archives_by_id(self, uuid: str, **kwargs) -> requests.Response:
|
|
385
396
|
""" Given a runUuid, returns run archives.
|
|
386
397
|
|
|
@@ -472,6 +483,67 @@ class Client():
|
|
|
472
483
|
"""
|
|
473
484
|
return self.get_resource(f'robot-session/{robot_nickname}/session', **kwargs)
|
|
474
485
|
|
|
486
|
+
def get_anomalies(self, **kwargs) -> requests.Response:
|
|
487
|
+
""" Given a dictionary of query params, returns anomalies.
|
|
488
|
+
|
|
489
|
+
Args:
|
|
490
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
491
|
+
Raises:
|
|
492
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
493
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
494
|
+
Returns:
|
|
495
|
+
requests.Response: the response associated with the get request.
|
|
496
|
+
"""
|
|
497
|
+
return self.get_resource("anomalies", **kwargs)
|
|
498
|
+
|
|
499
|
+
def get_backup(self, task_id: str, **kwargs):
|
|
500
|
+
""" Retrieves a *.zip containing an Orbit backup.
|
|
501
|
+
|
|
502
|
+
Args:
|
|
503
|
+
task_id: the task ID returned from the post_backup_task method.
|
|
504
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
505
|
+
Raises:
|
|
506
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
507
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
508
|
+
Returns:
|
|
509
|
+
requests.Response: the response associated with the get request.
|
|
510
|
+
"""
|
|
511
|
+
return self.get_resource(f'backups/{task_id}', headers=OCTET_HEADER, **kwargs)
|
|
512
|
+
|
|
513
|
+
def get_backup_task(self, task_id: str, **kwargs):
|
|
514
|
+
""" Retrieves the status of a backup task started by the post_backup_task method.
|
|
515
|
+
|
|
516
|
+
Args:
|
|
517
|
+
task_id: the task ID returned from the post_backup_task method.
|
|
518
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
519
|
+
Raises:
|
|
520
|
+
RequestExceptions: exceptions thrown by the Requests library.
|
|
521
|
+
UnauthenticatedClientError: indicates that the client is not authenticated properly.
|
|
522
|
+
Returns:
|
|
523
|
+
requests.Response: the response associated with the get request.
|
|
524
|
+
"""
|
|
525
|
+
return self.get_resource(f'backup_tasks/{task_id}', **kwargs)
|
|
526
|
+
|
|
527
|
+
def get_run_statistics(self, **kwargs) -> requests.Response:
|
|
528
|
+
""" Retrieves session statistics.
|
|
529
|
+
|
|
530
|
+
Args:
|
|
531
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
532
|
+
Returns:
|
|
533
|
+
requests.Response: the response associated with the get request.
|
|
534
|
+
"""
|
|
535
|
+
return self.get_resource("run_statistics/sessions", **kwargs)
|
|
536
|
+
|
|
537
|
+
def get_run_statistics_session_summary(self, **kwargs) -> requests.Response:
|
|
538
|
+
""" Retrieves session summary.
|
|
539
|
+
|
|
540
|
+
Args:
|
|
541
|
+
kwargs(**): a variable number of keyword arguments for the get request.
|
|
542
|
+
Returns:
|
|
543
|
+
requests.Response: the response associated with the get request.
|
|
544
|
+
"""
|
|
545
|
+
return self.get_resource("run_statistics/sessions_summary", **kwargs)
|
|
546
|
+
|
|
475
547
|
def post_export_as_walk(self, site_walk_uuid: str, **kwargs) -> requests.Response:
|
|
476
548
|
""" Given a SiteWalk uuid, it exports the walks_pb2.Walk equivalent.
|
|
477
549
|
|
|
@@ -484,7 +556,7 @@ class Client():
|
|
|
484
556
|
Returns:
|
|
485
557
|
requests.Response: The response associated with the post request.
|
|
486
558
|
"""
|
|
487
|
-
return self.post_resource(
|
|
559
|
+
return self.post_resource('site_walks/export_as_walk',
|
|
488
560
|
json={"siteWalkUuid": site_walk_uuid}, **kwargs)
|
|
489
561
|
|
|
490
562
|
def post_import_from_walk(self, **kwargs) -> requests.Response:
|
|
@@ -789,7 +861,7 @@ class Client():
|
|
|
789
861
|
"includeMissions": include_missions,
|
|
790
862
|
"includeCaptures": include_captures,
|
|
791
863
|
}
|
|
792
|
-
return self.post_resource(
|
|
864
|
+
return self.post_resource('backup_tasks/', json=payload, **kwargs)
|
|
793
865
|
|
|
794
866
|
def patch_bulk_close_anomalies(self, element_ids: list[str], **kwargs) -> requests.Response:
|
|
795
867
|
""" Bulk close Anomalies by Element ID.
|
|
@@ -912,8 +984,14 @@ def create_client(options: 'argparse.Namespace') -> 'bosdyn.orbit.client.Client'
|
|
|
912
984
|
.format(options.verify))
|
|
913
985
|
verify = options.verify
|
|
914
986
|
|
|
987
|
+
# Sanitize the format of the cert option. Requests handles None, a single pathname,
|
|
988
|
+
# or a sequence of pathnames with two or more elements.
|
|
989
|
+
cert = options.cert
|
|
990
|
+
if isinstance(cert, (list, tuple)) and len(cert) == 1:
|
|
991
|
+
cert = cert[0]
|
|
992
|
+
|
|
915
993
|
# A client object represents a single instance.
|
|
916
|
-
client = Client(hostname=options.hostname, verify=verify, cert=
|
|
994
|
+
client = Client(hostname=options.hostname, verify=verify, cert=cert)
|
|
917
995
|
|
|
918
996
|
# The client needs to be authenticated before using its functions
|
|
919
997
|
client.authenticate_with_api_token()
|
bosdyn/orbit/utils.py
CHANGED
|
@@ -36,6 +36,29 @@ def get_api_token() -> str:
|
|
|
36
36
|
return api_token
|
|
37
37
|
|
|
38
38
|
|
|
39
|
+
def add_base_arguments(parser):
|
|
40
|
+
""" Adds the most common arguments to the parser
|
|
41
|
+
|
|
42
|
+
This includes the hostname, verify, and cert arguments.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
parser: the argument parser
|
|
46
|
+
"""
|
|
47
|
+
parser.add_argument('--hostname', help='IP address associated with the Orbit instance',
|
|
48
|
+
required=True, type=str)
|
|
49
|
+
parser.add_argument(
|
|
50
|
+
'--verify',
|
|
51
|
+
help=
|
|
52
|
+
"verify(path to a CA bundle or Boolean): controls whether we verify the server's TLS certificate",
|
|
53
|
+
default=True,
|
|
54
|
+
)
|
|
55
|
+
parser.add_argument(
|
|
56
|
+
'--cert', help=
|
|
57
|
+
"a client certificate file for authentication (a .pem file containing the certificate and "
|
|
58
|
+
"key pair, or two separate files containing the certificate and key respectively and in "
|
|
59
|
+
"that order)", nargs='+', default=None)
|
|
60
|
+
|
|
61
|
+
|
|
39
62
|
def get_latest_created_at_for_run_events(client: 'bosdyn.orbit.client.Client',
|
|
40
63
|
params: Dict = {}) -> datetime.datetime:
|
|
41
64
|
""" Given a dictionary of query params, returns the max created at time for run events
|
|
@@ -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=q-5tN2I79O1p7fJ4ps9AsVJ0yOHGeCrfs4LktyfrIi8,48988
|
|
4
|
+
bosdyn/orbit/exceptions.py,sha256=eaeHSlGh27JlZUEjcpLKxR1CNdW6Twp4e685pUgEjyQ,711
|
|
5
|
+
bosdyn/orbit/utils.py,sha256=n6tQFcII6JJ5aQt7lzNvXnLKM_Oc7l7VZT7gZp6CM1k,15178
|
|
6
|
+
bosdyn_orbit-5.0.0.dist-info/METADATA,sha256=9FncibzU5qz7lJHzN_f-9PQIJV9nLGJz0qpkODdIG6o,1894
|
|
7
|
+
bosdyn_orbit-5.0.0.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
8
|
+
bosdyn_orbit-5.0.0.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
|
|
9
|
+
bosdyn_orbit-5.0.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=aoAlBKjygn2x9rXySjQzTxtWz7CcHkv6FqjMf8jhv5I,45471
|
|
4
|
-
bosdyn/orbit/exceptions.py,sha256=eaeHSlGh27JlZUEjcpLKxR1CNdW6Twp4e685pUgEjyQ,711
|
|
5
|
-
bosdyn/orbit/utils.py,sha256=Vhgdxa9dVjua2LteszF3rgsoKcF7Sb0c5AqsArtYRWk,14333
|
|
6
|
-
bosdyn_orbit-4.1.1.dist-info/METADATA,sha256=G3qHTd_8jxL8VAuhyZFwqEMGPAbeFz37WhU62jwErlw,1894
|
|
7
|
-
bosdyn_orbit-4.1.1.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
8
|
-
bosdyn_orbit-4.1.1.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
|
|
9
|
-
bosdyn_orbit-4.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|