strongdm.svc
1# Copyright 2020 StrongDM Inc 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15 16# Code generated by protogen. DO NOT EDIT. 17 18import grpc 19from . import plumbing 20from . import models 21from .options_pb2 import * 22from .options_pb2_grpc import * 23from .spec_pb2 import * 24from .spec_pb2_grpc import * 25from .tags_pb2 import * 26from .tags_pb2_grpc import * 27from .access_requests_pb2 import * 28from .access_requests_pb2_grpc import * 29from .access_request_events_history_pb2 import * 30from .access_request_events_history_pb2_grpc import * 31from .access_requests_history_pb2 import * 32from .access_requests_history_pb2_grpc import * 33from .account_attachments_pb2 import * 34from .account_attachments_pb2_grpc import * 35from .account_attachments_history_pb2 import * 36from .account_attachments_history_pb2_grpc import * 37from .account_grants_pb2 import * 38from .account_grants_pb2_grpc import * 39from .account_grants_history_pb2 import * 40from .account_grants_history_pb2_grpc import * 41from .account_permissions_pb2 import * 42from .account_permissions_pb2_grpc import * 43from .account_resources_pb2 import * 44from .account_resources_pb2_grpc import * 45from .account_resources_history_pb2 import * 46from .account_resources_history_pb2_grpc import * 47from .accounts_pb2 import * 48from .accounts_pb2_grpc import * 49from .accounts_history_pb2 import * 50from .accounts_history_pb2_grpc import * 51from .activities_pb2 import * 52from .activities_pb2_grpc import * 53from .approval_workflow_approvers_pb2 import * 54from .approval_workflow_approvers_pb2_grpc import * 55from .approval_workflow_approvers_history_pb2 import * 56from .approval_workflow_approvers_history_pb2_grpc import * 57from .approval_workflow_steps_pb2 import * 58from .approval_workflow_steps_pb2_grpc import * 59from .approval_workflow_steps_history_pb2 import * 60from .approval_workflow_steps_history_pb2_grpc import * 61from .approval_workflows_pb2 import * 62from .approval_workflows_pb2_grpc import * 63from .approval_workflows_history_pb2 import * 64from .approval_workflows_history_pb2_grpc import * 65from .control_panel_pb2 import * 66from .control_panel_pb2_grpc import * 67from .drivers_pb2 import * 68from .drivers_pb2_grpc import * 69from .nodes_pb2 import * 70from .nodes_pb2_grpc import * 71from .nodes_history_pb2 import * 72from .nodes_history_pb2_grpc import * 73from .organization_history_pb2 import * 74from .organization_history_pb2_grpc import * 75from .peering_group_nodes_pb2 import * 76from .peering_group_nodes_pb2_grpc import * 77from .peering_group_peers_pb2 import * 78from .peering_group_peers_pb2_grpc import * 79from .peering_group_resources_pb2 import * 80from .peering_group_resources_pb2_grpc import * 81from .peering_groups_pb2 import * 82from .peering_groups_pb2_grpc import * 83from .queries_pb2 import * 84from .queries_pb2_grpc import * 85from .remote_identities_pb2 import * 86from .remote_identities_pb2_grpc import * 87from .remote_identities_history_pb2 import * 88from .remote_identities_history_pb2_grpc import * 89from .remote_identity_groups_pb2 import * 90from .remote_identity_groups_pb2_grpc import * 91from .remote_identity_groups_history_pb2 import * 92from .remote_identity_groups_history_pb2_grpc import * 93from .replays_pb2 import * 94from .replays_pb2_grpc import * 95from .resources_pb2 import * 96from .resources_pb2_grpc import * 97from .resources_history_pb2 import * 98from .resources_history_pb2_grpc import * 99from .role_resources_pb2 import * 100from .role_resources_pb2_grpc import * 101from .role_resources_history_pb2 import * 102from .role_resources_history_pb2_grpc import * 103from .roles_pb2 import * 104from .roles_pb2_grpc import * 105from .roles_history_pb2 import * 106from .roles_history_pb2_grpc import * 107from .secret_store_healths_pb2 import * 108from .secret_store_healths_pb2_grpc import * 109from .secret_store_types_pb2 import * 110from .secret_store_types_pb2_grpc import * 111from .secret_stores_pb2 import * 112from .secret_stores_pb2_grpc import * 113from .secret_stores_history_pb2 import * 114from .secret_stores_history_pb2_grpc import * 115from .workflow_approvers_pb2 import * 116from .workflow_approvers_pb2_grpc import * 117from .workflow_approvers_history_pb2 import * 118from .workflow_approvers_history_pb2_grpc import * 119from .workflow_assignments_pb2 import * 120from .workflow_assignments_pb2_grpc import * 121from .workflow_assignments_history_pb2 import * 122from .workflow_assignments_history_pb2_grpc import * 123from .workflow_roles_pb2 import * 124from .workflow_roles_pb2_grpc import * 125from .workflow_roles_history_pb2 import * 126from .workflow_roles_history_pb2_grpc import * 127from .workflows_pb2 import * 128from .workflows_pb2_grpc import * 129from .workflows_history_pb2 import * 130from .workflows_history_pb2_grpc import * 131import warnings 132import functools 133 134 135def deprecated(func): 136 """This is a decorator which can be used to mark functions 137 as deprecated. It will result in a warning being emitted 138 when the function is used.""" 139 @functools.wraps(func) 140 def new_func(*args, **kwargs): 141 warnings.warn("Call to deprecated function {}.".format(func.__name__), 142 category=DeprecationWarning, 143 stacklevel=2) 144 return func(*args, **kwargs) 145 146 return new_func 147 148 149class AccessRequests: 150 ''' 151 AccessRequests are requests for access to a resource that may match a Workflow. 152 See `strongdm.models.AccessRequest`. 153 ''' 154 def __init__(self, channel, client): 155 self.parent = client 156 self.stub = AccessRequestsStub(channel) 157 158 def list(self, filter, *args, timeout=None): 159 ''' 160 Lists existing access requests. 161 ''' 162 req = AccessRequestListRequest() 163 req.meta.CopyFrom(ListRequestMetadata()) 164 if self.parent.page_limit > 0: 165 req.meta.limit = self.parent.page_limit 166 if self.parent.snapshot_datetime is not None: 167 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 168 169 req.filter = plumbing.quote_filter_args(filter, *args) 170 171 def generator(svc, req): 172 tries = 0 173 while True: 174 try: 175 plumbing_response = svc.stub.List( 176 req, 177 metadata=svc.parent.get_metadata( 178 'AccessRequests.List', req), 179 timeout=timeout) 180 except Exception as e: 181 if self.parent.shouldRetry(tries, e): 182 tries += 1 183 self.parent.jitterSleep(tries) 184 continue 185 raise plumbing.convert_error_to_porcelain(e) from e 186 tries = 0 187 for plumbing_item in plumbing_response.access_requests: 188 yield plumbing.convert_access_request_to_porcelain( 189 plumbing_item) 190 if plumbing_response.meta.next_cursor == '': 191 break 192 req.meta.cursor = plumbing_response.meta.next_cursor 193 194 return generator(self, req) 195 196 197class SnapshotAccessRequests: 198 ''' 199 SnapshotAccessRequests exposes the read only methods of the AccessRequests 200 service for historical queries. 201 ''' 202 def __init__(self, access_requests): 203 self.access_requests = access_requests 204 205 def list(self, filter, *args, timeout=None): 206 ''' 207 Lists existing access requests. 208 ''' 209 return self.access_requests.list(filter, *args, timeout=timeout) 210 211 212class AccessRequestEventsHistory: 213 ''' 214 AccessRequestEventsHistory provides records of all changes to the state of an AccessRequest. 215 See `strongdm.models.AccessRequestEventHistory`. 216 ''' 217 def __init__(self, channel, client): 218 self.parent = client 219 self.stub = AccessRequestEventsHistoryStub(channel) 220 221 def list(self, filter, *args, timeout=None): 222 ''' 223 List gets a list of AccessRequestEventHistory records matching a given set of criteria. 224 ''' 225 req = AccessRequestEventHistoryListRequest() 226 req.meta.CopyFrom(ListRequestMetadata()) 227 if self.parent.page_limit > 0: 228 req.meta.limit = self.parent.page_limit 229 if self.parent.snapshot_datetime is not None: 230 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 231 232 req.filter = plumbing.quote_filter_args(filter, *args) 233 234 def generator(svc, req): 235 tries = 0 236 while True: 237 try: 238 plumbing_response = svc.stub.List( 239 req, 240 metadata=svc.parent.get_metadata( 241 'AccessRequestEventsHistory.List', req), 242 timeout=timeout) 243 except Exception as e: 244 if self.parent.shouldRetry(tries, e): 245 tries += 1 246 self.parent.jitterSleep(tries) 247 continue 248 raise plumbing.convert_error_to_porcelain(e) from e 249 tries = 0 250 for plumbing_item in plumbing_response.history: 251 yield plumbing.convert_access_request_event_history_to_porcelain( 252 plumbing_item) 253 if plumbing_response.meta.next_cursor == '': 254 break 255 req.meta.cursor = plumbing_response.meta.next_cursor 256 257 return generator(self, req) 258 259 260class AccessRequestsHistory: 261 ''' 262 AccessRequestsHistory provides records of all changes to the state of an AccessRequest. 263 See `strongdm.models.AccessRequestHistory`. 264 ''' 265 def __init__(self, channel, client): 266 self.parent = client 267 self.stub = AccessRequestsHistoryStub(channel) 268 269 def list(self, filter, *args, timeout=None): 270 ''' 271 List gets a list of AccessRequestHistory records matching a given set of criteria. 272 ''' 273 req = AccessRequestHistoryListRequest() 274 req.meta.CopyFrom(ListRequestMetadata()) 275 if self.parent.page_limit > 0: 276 req.meta.limit = self.parent.page_limit 277 if self.parent.snapshot_datetime is not None: 278 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 279 280 req.filter = plumbing.quote_filter_args(filter, *args) 281 282 def generator(svc, req): 283 tries = 0 284 while True: 285 try: 286 plumbing_response = svc.stub.List( 287 req, 288 metadata=svc.parent.get_metadata( 289 'AccessRequestsHistory.List', req), 290 timeout=timeout) 291 except Exception as e: 292 if self.parent.shouldRetry(tries, e): 293 tries += 1 294 self.parent.jitterSleep(tries) 295 continue 296 raise plumbing.convert_error_to_porcelain(e) from e 297 tries = 0 298 for plumbing_item in plumbing_response.history: 299 yield plumbing.convert_access_request_history_to_porcelain( 300 plumbing_item) 301 if plumbing_response.meta.next_cursor == '': 302 break 303 req.meta.cursor = plumbing_response.meta.next_cursor 304 305 return generator(self, req) 306 307 308class AccountAttachments: 309 ''' 310 AccountAttachments assign an account to a role. 311 See `strongdm.models.AccountAttachment`. 312 ''' 313 def __init__(self, channel, client): 314 self.parent = client 315 self.stub = AccountAttachmentsStub(channel) 316 317 def create(self, account_attachment, timeout=None): 318 ''' 319 Create registers a new AccountAttachment. 320 ''' 321 req = AccountAttachmentCreateRequest() 322 323 if account_attachment is not None: 324 req.account_attachment.CopyFrom( 325 plumbing.convert_account_attachment_to_plumbing( 326 account_attachment)) 327 tries = 0 328 plumbing_response = None 329 while True: 330 try: 331 plumbing_response = self.stub.Create( 332 req, 333 metadata=self.parent.get_metadata( 334 'AccountAttachments.Create', req), 335 timeout=timeout) 336 except Exception as e: 337 if self.parent.shouldRetry(tries, e): 338 tries += 1 339 self.parent.jitterSleep(tries) 340 continue 341 raise plumbing.convert_error_to_porcelain(e) from e 342 break 343 344 resp = models.AccountAttachmentCreateResponse() 345 resp.account_attachment = plumbing.convert_account_attachment_to_porcelain( 346 plumbing_response.account_attachment) 347 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 348 plumbing_response.meta) 349 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 350 plumbing_response.rate_limit) 351 return resp 352 353 def get(self, id, timeout=None): 354 ''' 355 Get reads one AccountAttachment by ID. 356 ''' 357 req = AccountAttachmentGetRequest() 358 if self.parent.snapshot_datetime is not None: 359 req.meta.CopyFrom(GetRequestMetadata()) 360 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 361 362 req.id = (id) 363 tries = 0 364 plumbing_response = None 365 while True: 366 try: 367 plumbing_response = self.stub.Get( 368 req, 369 metadata=self.parent.get_metadata('AccountAttachments.Get', 370 req), 371 timeout=timeout) 372 except Exception as e: 373 if self.parent.shouldRetry(tries, e): 374 tries += 1 375 self.parent.jitterSleep(tries) 376 continue 377 raise plumbing.convert_error_to_porcelain(e) from e 378 break 379 380 resp = models.AccountAttachmentGetResponse() 381 resp.account_attachment = plumbing.convert_account_attachment_to_porcelain( 382 plumbing_response.account_attachment) 383 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 384 plumbing_response.meta) 385 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 386 plumbing_response.rate_limit) 387 return resp 388 389 def delete(self, id, timeout=None): 390 ''' 391 Delete removes a AccountAttachment by ID. 392 ''' 393 req = AccountAttachmentDeleteRequest() 394 395 req.id = (id) 396 tries = 0 397 plumbing_response = None 398 while True: 399 try: 400 plumbing_response = self.stub.Delete( 401 req, 402 metadata=self.parent.get_metadata( 403 'AccountAttachments.Delete', req), 404 timeout=timeout) 405 except Exception as e: 406 if self.parent.shouldRetry(tries, e): 407 tries += 1 408 self.parent.jitterSleep(tries) 409 continue 410 raise plumbing.convert_error_to_porcelain(e) from e 411 break 412 413 resp = models.AccountAttachmentDeleteResponse() 414 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 415 plumbing_response.meta) 416 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 417 plumbing_response.rate_limit) 418 return resp 419 420 def list(self, filter, *args, timeout=None): 421 ''' 422 List gets a list of AccountAttachments matching a given set of criteria. 423 ''' 424 req = AccountAttachmentListRequest() 425 req.meta.CopyFrom(ListRequestMetadata()) 426 if self.parent.page_limit > 0: 427 req.meta.limit = self.parent.page_limit 428 if self.parent.snapshot_datetime is not None: 429 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 430 431 req.filter = plumbing.quote_filter_args(filter, *args) 432 433 def generator(svc, req): 434 tries = 0 435 while True: 436 try: 437 plumbing_response = svc.stub.List( 438 req, 439 metadata=svc.parent.get_metadata( 440 'AccountAttachments.List', req), 441 timeout=timeout) 442 except Exception as e: 443 if self.parent.shouldRetry(tries, e): 444 tries += 1 445 self.parent.jitterSleep(tries) 446 continue 447 raise plumbing.convert_error_to_porcelain(e) from e 448 tries = 0 449 for plumbing_item in plumbing_response.account_attachments: 450 yield plumbing.convert_account_attachment_to_porcelain( 451 plumbing_item) 452 if plumbing_response.meta.next_cursor == '': 453 break 454 req.meta.cursor = plumbing_response.meta.next_cursor 455 456 return generator(self, req) 457 458 459class SnapshotAccountAttachments: 460 ''' 461 SnapshotAccountAttachments exposes the read only methods of the AccountAttachments 462 service for historical queries. 463 ''' 464 def __init__(self, account_attachments): 465 self.account_attachments = account_attachments 466 467 def get(self, id, timeout=None): 468 ''' 469 Get reads one AccountAttachment by ID. 470 ''' 471 return self.account_attachments.get(id, timeout=timeout) 472 473 def list(self, filter, *args, timeout=None): 474 ''' 475 List gets a list of AccountAttachments matching a given set of criteria. 476 ''' 477 return self.account_attachments.list(filter, *args, timeout=timeout) 478 479 480class AccountAttachmentsHistory: 481 ''' 482 AccountAttachmentsHistory records all changes to the state of an AccountAttachment. 483 See `strongdm.models.AccountAttachmentHistory`. 484 ''' 485 def __init__(self, channel, client): 486 self.parent = client 487 self.stub = AccountAttachmentsHistoryStub(channel) 488 489 def list(self, filter, *args, timeout=None): 490 ''' 491 List gets a list of AccountAttachmentHistory records matching a given set of criteria. 492 ''' 493 req = AccountAttachmentHistoryListRequest() 494 req.meta.CopyFrom(ListRequestMetadata()) 495 if self.parent.page_limit > 0: 496 req.meta.limit = self.parent.page_limit 497 if self.parent.snapshot_datetime is not None: 498 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 499 500 req.filter = plumbing.quote_filter_args(filter, *args) 501 502 def generator(svc, req): 503 tries = 0 504 while True: 505 try: 506 plumbing_response = svc.stub.List( 507 req, 508 metadata=svc.parent.get_metadata( 509 'AccountAttachmentsHistory.List', req), 510 timeout=timeout) 511 except Exception as e: 512 if self.parent.shouldRetry(tries, e): 513 tries += 1 514 self.parent.jitterSleep(tries) 515 continue 516 raise plumbing.convert_error_to_porcelain(e) from e 517 tries = 0 518 for plumbing_item in plumbing_response.history: 519 yield plumbing.convert_account_attachment_history_to_porcelain( 520 plumbing_item) 521 if plumbing_response.meta.next_cursor == '': 522 break 523 req.meta.cursor = plumbing_response.meta.next_cursor 524 525 return generator(self, req) 526 527 528class AccountGrants: 529 ''' 530 AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource. 531 See `strongdm.models.AccountGrant`. 532 ''' 533 def __init__(self, channel, client): 534 self.parent = client 535 self.stub = AccountGrantsStub(channel) 536 537 def create(self, account_grant, timeout=None): 538 ''' 539 Create registers a new AccountGrant. 540 ''' 541 req = AccountGrantCreateRequest() 542 543 if account_grant is not None: 544 req.account_grant.CopyFrom( 545 plumbing.convert_account_grant_to_plumbing(account_grant)) 546 tries = 0 547 plumbing_response = None 548 while True: 549 try: 550 plumbing_response = self.stub.Create( 551 req, 552 metadata=self.parent.get_metadata('AccountGrants.Create', 553 req), 554 timeout=timeout) 555 except Exception as e: 556 if self.parent.shouldRetry(tries, e): 557 tries += 1 558 self.parent.jitterSleep(tries) 559 continue 560 raise plumbing.convert_error_to_porcelain(e) from e 561 break 562 563 resp = models.AccountGrantCreateResponse() 564 resp.account_grant = plumbing.convert_account_grant_to_porcelain( 565 plumbing_response.account_grant) 566 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 567 plumbing_response.meta) 568 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 569 plumbing_response.rate_limit) 570 return resp 571 572 def get(self, id, timeout=None): 573 ''' 574 Get reads one AccountGrant by ID. 575 ''' 576 req = AccountGrantGetRequest() 577 if self.parent.snapshot_datetime is not None: 578 req.meta.CopyFrom(GetRequestMetadata()) 579 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 580 581 req.id = (id) 582 tries = 0 583 plumbing_response = None 584 while True: 585 try: 586 plumbing_response = self.stub.Get( 587 req, 588 metadata=self.parent.get_metadata('AccountGrants.Get', 589 req), 590 timeout=timeout) 591 except Exception as e: 592 if self.parent.shouldRetry(tries, e): 593 tries += 1 594 self.parent.jitterSleep(tries) 595 continue 596 raise plumbing.convert_error_to_porcelain(e) from e 597 break 598 599 resp = models.AccountGrantGetResponse() 600 resp.account_grant = plumbing.convert_account_grant_to_porcelain( 601 plumbing_response.account_grant) 602 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 603 plumbing_response.meta) 604 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 605 plumbing_response.rate_limit) 606 return resp 607 608 def delete(self, id, timeout=None): 609 ''' 610 Delete removes a AccountGrant by ID. 611 ''' 612 req = AccountGrantDeleteRequest() 613 614 req.id = (id) 615 tries = 0 616 plumbing_response = None 617 while True: 618 try: 619 plumbing_response = self.stub.Delete( 620 req, 621 metadata=self.parent.get_metadata('AccountGrants.Delete', 622 req), 623 timeout=timeout) 624 except Exception as e: 625 if self.parent.shouldRetry(tries, e): 626 tries += 1 627 self.parent.jitterSleep(tries) 628 continue 629 raise plumbing.convert_error_to_porcelain(e) from e 630 break 631 632 resp = models.AccountGrantDeleteResponse() 633 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 634 plumbing_response.meta) 635 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 636 plumbing_response.rate_limit) 637 return resp 638 639 def list(self, filter, *args, timeout=None): 640 ''' 641 List gets a list of AccountGrants matching a given set of criteria. 642 ''' 643 req = AccountGrantListRequest() 644 req.meta.CopyFrom(ListRequestMetadata()) 645 if self.parent.page_limit > 0: 646 req.meta.limit = self.parent.page_limit 647 if self.parent.snapshot_datetime is not None: 648 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 649 650 req.filter = plumbing.quote_filter_args(filter, *args) 651 652 def generator(svc, req): 653 tries = 0 654 while True: 655 try: 656 plumbing_response = svc.stub.List( 657 req, 658 metadata=svc.parent.get_metadata( 659 'AccountGrants.List', req), 660 timeout=timeout) 661 except Exception as e: 662 if self.parent.shouldRetry(tries, e): 663 tries += 1 664 self.parent.jitterSleep(tries) 665 continue 666 raise plumbing.convert_error_to_porcelain(e) from e 667 tries = 0 668 for plumbing_item in plumbing_response.account_grants: 669 yield plumbing.convert_account_grant_to_porcelain( 670 plumbing_item) 671 if plumbing_response.meta.next_cursor == '': 672 break 673 req.meta.cursor = plumbing_response.meta.next_cursor 674 675 return generator(self, req) 676 677 678class SnapshotAccountGrants: 679 ''' 680 SnapshotAccountGrants exposes the read only methods of the AccountGrants 681 service for historical queries. 682 ''' 683 def __init__(self, account_grants): 684 self.account_grants = account_grants 685 686 def get(self, id, timeout=None): 687 ''' 688 Get reads one AccountGrant by ID. 689 ''' 690 return self.account_grants.get(id, timeout=timeout) 691 692 def list(self, filter, *args, timeout=None): 693 ''' 694 List gets a list of AccountGrants matching a given set of criteria. 695 ''' 696 return self.account_grants.list(filter, *args, timeout=timeout) 697 698 699class AccountGrantsHistory: 700 ''' 701 AccountGrantsHistory records all changes to the state of an AccountGrant. 702 See `strongdm.models.AccountGrantHistory`. 703 ''' 704 def __init__(self, channel, client): 705 self.parent = client 706 self.stub = AccountGrantsHistoryStub(channel) 707 708 def list(self, filter, *args, timeout=None): 709 ''' 710 List gets a list of AccountGrantHistory records matching a given set of criteria. 711 ''' 712 req = AccountGrantHistoryListRequest() 713 req.meta.CopyFrom(ListRequestMetadata()) 714 if self.parent.page_limit > 0: 715 req.meta.limit = self.parent.page_limit 716 if self.parent.snapshot_datetime is not None: 717 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 718 719 req.filter = plumbing.quote_filter_args(filter, *args) 720 721 def generator(svc, req): 722 tries = 0 723 while True: 724 try: 725 plumbing_response = svc.stub.List( 726 req, 727 metadata=svc.parent.get_metadata( 728 'AccountGrantsHistory.List', req), 729 timeout=timeout) 730 except Exception as e: 731 if self.parent.shouldRetry(tries, e): 732 tries += 1 733 self.parent.jitterSleep(tries) 734 continue 735 raise plumbing.convert_error_to_porcelain(e) from e 736 tries = 0 737 for plumbing_item in plumbing_response.history: 738 yield plumbing.convert_account_grant_history_to_porcelain( 739 plumbing_item) 740 if plumbing_response.meta.next_cursor == '': 741 break 742 req.meta.cursor = plumbing_response.meta.next_cursor 743 744 return generator(self, req) 745 746 747class AccountPermissions: 748 ''' 749 AccountPermissions records the granular permissions accounts have, allowing them to execute 750 relevant commands via StrongDM's APIs. 751 See `strongdm.models.AccountPermission`. 752 ''' 753 def __init__(self, channel, client): 754 self.parent = client 755 self.stub = AccountPermissionsStub(channel) 756 757 def list(self, filter, *args, timeout=None): 758 ''' 759 List gets a list of Permission records matching a given set of criteria. 760 ''' 761 req = AccountPermissionListRequest() 762 req.meta.CopyFrom(ListRequestMetadata()) 763 if self.parent.page_limit > 0: 764 req.meta.limit = self.parent.page_limit 765 if self.parent.snapshot_datetime is not None: 766 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 767 768 req.filter = plumbing.quote_filter_args(filter, *args) 769 770 def generator(svc, req): 771 tries = 0 772 while True: 773 try: 774 plumbing_response = svc.stub.List( 775 req, 776 metadata=svc.parent.get_metadata( 777 'AccountPermissions.List', req), 778 timeout=timeout) 779 except Exception as e: 780 if self.parent.shouldRetry(tries, e): 781 tries += 1 782 self.parent.jitterSleep(tries) 783 continue 784 raise plumbing.convert_error_to_porcelain(e) from e 785 tries = 0 786 for plumbing_item in plumbing_response.permissions: 787 yield plumbing.convert_account_permission_to_porcelain( 788 plumbing_item) 789 if plumbing_response.meta.next_cursor == '': 790 break 791 req.meta.cursor = plumbing_response.meta.next_cursor 792 793 return generator(self, req) 794 795 796class SnapshotAccountPermissions: 797 ''' 798 SnapshotAccountPermissions exposes the read only methods of the AccountPermissions 799 service for historical queries. 800 ''' 801 def __init__(self, account_permissions): 802 self.account_permissions = account_permissions 803 804 def list(self, filter, *args, timeout=None): 805 ''' 806 List gets a list of Permission records matching a given set of criteria. 807 ''' 808 return self.account_permissions.list(filter, *args, timeout=timeout) 809 810 811class AccountResources: 812 ''' 813 AccountResources enumerates the resources to which accounts have access. 814 The AccountResources service is read-only. 815 See `strongdm.models.AccountResource`. 816 ''' 817 def __init__(self, channel, client): 818 self.parent = client 819 self.stub = AccountResourcesStub(channel) 820 821 def list(self, filter, *args, timeout=None): 822 ''' 823 List gets a list of AccountResource records matching a given set of criteria. 824 ''' 825 req = AccountResourceListRequest() 826 req.meta.CopyFrom(ListRequestMetadata()) 827 if self.parent.page_limit > 0: 828 req.meta.limit = self.parent.page_limit 829 if self.parent.snapshot_datetime is not None: 830 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 831 832 req.filter = plumbing.quote_filter_args(filter, *args) 833 834 def generator(svc, req): 835 tries = 0 836 while True: 837 try: 838 plumbing_response = svc.stub.List( 839 req, 840 metadata=svc.parent.get_metadata( 841 'AccountResources.List', req), 842 timeout=timeout) 843 except Exception as e: 844 if self.parent.shouldRetry(tries, e): 845 tries += 1 846 self.parent.jitterSleep(tries) 847 continue 848 raise plumbing.convert_error_to_porcelain(e) from e 849 tries = 0 850 for plumbing_item in plumbing_response.account_resources: 851 yield plumbing.convert_account_resource_to_porcelain( 852 plumbing_item) 853 if plumbing_response.meta.next_cursor == '': 854 break 855 req.meta.cursor = plumbing_response.meta.next_cursor 856 857 return generator(self, req) 858 859 860class SnapshotAccountResources: 861 ''' 862 SnapshotAccountResources exposes the read only methods of the AccountResources 863 service for historical queries. 864 ''' 865 def __init__(self, account_resources): 866 self.account_resources = account_resources 867 868 def list(self, filter, *args, timeout=None): 869 ''' 870 List gets a list of AccountResource records matching a given set of criteria. 871 ''' 872 return self.account_resources.list(filter, *args, timeout=timeout) 873 874 875class AccountResourcesHistory: 876 ''' 877 AccountResourcesHistory records all changes to the state of a AccountResource. 878 See `strongdm.models.AccountResourceHistory`. 879 ''' 880 def __init__(self, channel, client): 881 self.parent = client 882 self.stub = AccountResourcesHistoryStub(channel) 883 884 def list(self, filter, *args, timeout=None): 885 ''' 886 List gets a list of AccountResourceHistory records matching a given set of criteria. 887 ''' 888 req = AccountResourceHistoryListRequest() 889 req.meta.CopyFrom(ListRequestMetadata()) 890 if self.parent.page_limit > 0: 891 req.meta.limit = self.parent.page_limit 892 if self.parent.snapshot_datetime is not None: 893 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 894 895 req.filter = plumbing.quote_filter_args(filter, *args) 896 897 def generator(svc, req): 898 tries = 0 899 while True: 900 try: 901 plumbing_response = svc.stub.List( 902 req, 903 metadata=svc.parent.get_metadata( 904 'AccountResourcesHistory.List', req), 905 timeout=timeout) 906 except Exception as e: 907 if self.parent.shouldRetry(tries, e): 908 tries += 1 909 self.parent.jitterSleep(tries) 910 continue 911 raise plumbing.convert_error_to_porcelain(e) from e 912 tries = 0 913 for plumbing_item in plumbing_response.history: 914 yield plumbing.convert_account_resource_history_to_porcelain( 915 plumbing_item) 916 if plumbing_response.meta.next_cursor == '': 917 break 918 req.meta.cursor = plumbing_response.meta.next_cursor 919 920 return generator(self, req) 921 922 923class Accounts: 924 ''' 925 Accounts are users that have access to strongDM. There are two types of accounts: 926 1. **Users:** humans who are authenticated through username and password or SSO. 927 2. **Service Accounts:** machines that are authenticated using a service token. 928 3. **Tokens** are access keys with permissions that can be used for authentication. 929 See: 930 `strongdm.models.Service` 931 `strongdm.models.Token` 932 `strongdm.models.User` 933 ''' 934 def __init__(self, channel, client): 935 self.parent = client 936 self.stub = AccountsStub(channel) 937 938 def create(self, account, timeout=None): 939 ''' 940 Create registers a new Account. 941 ''' 942 req = AccountCreateRequest() 943 944 if account is not None: 945 req.account.CopyFrom(plumbing.convert_account_to_plumbing(account)) 946 tries = 0 947 plumbing_response = None 948 while True: 949 try: 950 plumbing_response = self.stub.Create( 951 req, 952 metadata=self.parent.get_metadata('Accounts.Create', req), 953 timeout=timeout) 954 except Exception as e: 955 if self.parent.shouldRetry(tries, e): 956 tries += 1 957 self.parent.jitterSleep(tries) 958 continue 959 raise plumbing.convert_error_to_porcelain(e) from e 960 break 961 962 resp = models.AccountCreateResponse() 963 resp.access_key = (plumbing_response.access_key) 964 resp.account = plumbing.convert_account_to_porcelain( 965 plumbing_response.account) 966 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 967 plumbing_response.meta) 968 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 969 plumbing_response.rate_limit) 970 resp.secret_key = (plumbing_response.secret_key) 971 resp.token = (plumbing_response.token) 972 return resp 973 974 def get(self, id, timeout=None): 975 ''' 976 Get reads one Account by ID. 977 ''' 978 req = AccountGetRequest() 979 if self.parent.snapshot_datetime is not None: 980 req.meta.CopyFrom(GetRequestMetadata()) 981 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 982 983 req.id = (id) 984 tries = 0 985 plumbing_response = None 986 while True: 987 try: 988 plumbing_response = self.stub.Get( 989 req, 990 metadata=self.parent.get_metadata('Accounts.Get', req), 991 timeout=timeout) 992 except Exception as e: 993 if self.parent.shouldRetry(tries, e): 994 tries += 1 995 self.parent.jitterSleep(tries) 996 continue 997 raise plumbing.convert_error_to_porcelain(e) from e 998 break 999 1000 resp = models.AccountGetResponse() 1001 resp.account = plumbing.convert_account_to_porcelain( 1002 plumbing_response.account) 1003 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1004 plumbing_response.meta) 1005 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1006 plumbing_response.rate_limit) 1007 return resp 1008 1009 def update(self, account, timeout=None): 1010 ''' 1011 Update replaces all the fields of an Account by ID. 1012 ''' 1013 req = AccountUpdateRequest() 1014 1015 if account is not None: 1016 req.account.CopyFrom(plumbing.convert_account_to_plumbing(account)) 1017 tries = 0 1018 plumbing_response = None 1019 while True: 1020 try: 1021 plumbing_response = self.stub.Update( 1022 req, 1023 metadata=self.parent.get_metadata('Accounts.Update', req), 1024 timeout=timeout) 1025 except Exception as e: 1026 if self.parent.shouldRetry(tries, e): 1027 tries += 1 1028 self.parent.jitterSleep(tries) 1029 continue 1030 raise plumbing.convert_error_to_porcelain(e) from e 1031 break 1032 1033 resp = models.AccountUpdateResponse() 1034 resp.account = plumbing.convert_account_to_porcelain( 1035 plumbing_response.account) 1036 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 1037 plumbing_response.meta) 1038 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1039 plumbing_response.rate_limit) 1040 return resp 1041 1042 def delete(self, id, timeout=None): 1043 ''' 1044 Delete removes an Account by ID. 1045 ''' 1046 req = AccountDeleteRequest() 1047 1048 req.id = (id) 1049 tries = 0 1050 plumbing_response = None 1051 while True: 1052 try: 1053 plumbing_response = self.stub.Delete( 1054 req, 1055 metadata=self.parent.get_metadata('Accounts.Delete', req), 1056 timeout=timeout) 1057 except Exception as e: 1058 if self.parent.shouldRetry(tries, e): 1059 tries += 1 1060 self.parent.jitterSleep(tries) 1061 continue 1062 raise plumbing.convert_error_to_porcelain(e) from e 1063 break 1064 1065 resp = models.AccountDeleteResponse() 1066 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 1067 plumbing_response.meta) 1068 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1069 plumbing_response.rate_limit) 1070 return resp 1071 1072 def list(self, filter, *args, timeout=None): 1073 ''' 1074 List gets a list of Accounts matching a given set of criteria. 1075 ''' 1076 req = AccountListRequest() 1077 req.meta.CopyFrom(ListRequestMetadata()) 1078 if self.parent.page_limit > 0: 1079 req.meta.limit = self.parent.page_limit 1080 if self.parent.snapshot_datetime is not None: 1081 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1082 1083 req.filter = plumbing.quote_filter_args(filter, *args) 1084 1085 def generator(svc, req): 1086 tries = 0 1087 while True: 1088 try: 1089 plumbing_response = svc.stub.List( 1090 req, 1091 metadata=svc.parent.get_metadata('Accounts.List', req), 1092 timeout=timeout) 1093 except Exception as e: 1094 if self.parent.shouldRetry(tries, e): 1095 tries += 1 1096 self.parent.jitterSleep(tries) 1097 continue 1098 raise plumbing.convert_error_to_porcelain(e) from e 1099 tries = 0 1100 for plumbing_item in plumbing_response.accounts: 1101 yield plumbing.convert_account_to_porcelain(plumbing_item) 1102 if plumbing_response.meta.next_cursor == '': 1103 break 1104 req.meta.cursor = plumbing_response.meta.next_cursor 1105 1106 return generator(self, req) 1107 1108 1109class SnapshotAccounts: 1110 ''' 1111 SnapshotAccounts exposes the read only methods of the Accounts 1112 service for historical queries. 1113 ''' 1114 def __init__(self, accounts): 1115 self.accounts = accounts 1116 1117 def get(self, id, timeout=None): 1118 ''' 1119 Get reads one Account by ID. 1120 ''' 1121 return self.accounts.get(id, timeout=timeout) 1122 1123 def list(self, filter, *args, timeout=None): 1124 ''' 1125 List gets a list of Accounts matching a given set of criteria. 1126 ''' 1127 return self.accounts.list(filter, *args, timeout=timeout) 1128 1129 1130class AccountsHistory: 1131 ''' 1132 AccountsHistory records all changes to the state of an Account. 1133 See `strongdm.models.AccountHistory`. 1134 ''' 1135 def __init__(self, channel, client): 1136 self.parent = client 1137 self.stub = AccountsHistoryStub(channel) 1138 1139 def list(self, filter, *args, timeout=None): 1140 ''' 1141 List gets a list of AccountHistory records matching a given set of criteria. 1142 ''' 1143 req = AccountHistoryListRequest() 1144 req.meta.CopyFrom(ListRequestMetadata()) 1145 if self.parent.page_limit > 0: 1146 req.meta.limit = self.parent.page_limit 1147 if self.parent.snapshot_datetime is not None: 1148 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1149 1150 req.filter = plumbing.quote_filter_args(filter, *args) 1151 1152 def generator(svc, req): 1153 tries = 0 1154 while True: 1155 try: 1156 plumbing_response = svc.stub.List( 1157 req, 1158 metadata=svc.parent.get_metadata( 1159 'AccountsHistory.List', req), 1160 timeout=timeout) 1161 except Exception as e: 1162 if self.parent.shouldRetry(tries, e): 1163 tries += 1 1164 self.parent.jitterSleep(tries) 1165 continue 1166 raise plumbing.convert_error_to_porcelain(e) from e 1167 tries = 0 1168 for plumbing_item in plumbing_response.history: 1169 yield plumbing.convert_account_history_to_porcelain( 1170 plumbing_item) 1171 if plumbing_response.meta.next_cursor == '': 1172 break 1173 req.meta.cursor = plumbing_response.meta.next_cursor 1174 1175 return generator(self, req) 1176 1177 1178class Activities: 1179 ''' 1180 An Activity is a record of an action taken against a strongDM deployment, e.g. 1181 a user creation, resource deletion, sso configuration change, etc. The Activities 1182 service is read-only. 1183 See `strongdm.models.Activity`. 1184 ''' 1185 def __init__(self, channel, client): 1186 self.parent = client 1187 self.stub = ActivitiesStub(channel) 1188 1189 def get(self, id, timeout=None): 1190 ''' 1191 Get reads one Activity by ID. 1192 ''' 1193 req = ActivityGetRequest() 1194 if self.parent.snapshot_datetime is not None: 1195 req.meta.CopyFrom(GetRequestMetadata()) 1196 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1197 1198 req.id = (id) 1199 tries = 0 1200 plumbing_response = None 1201 while True: 1202 try: 1203 plumbing_response = self.stub.Get( 1204 req, 1205 metadata=self.parent.get_metadata('Activities.Get', req), 1206 timeout=timeout) 1207 except Exception as e: 1208 if self.parent.shouldRetry(tries, e): 1209 tries += 1 1210 self.parent.jitterSleep(tries) 1211 continue 1212 raise plumbing.convert_error_to_porcelain(e) from e 1213 break 1214 1215 resp = models.ActivityGetResponse() 1216 resp.activity = plumbing.convert_activity_to_porcelain( 1217 plumbing_response.activity) 1218 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1219 plumbing_response.meta) 1220 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1221 plumbing_response.rate_limit) 1222 return resp 1223 1224 def list(self, filter, *args, timeout=None): 1225 ''' 1226 List gets a list of Activities matching a given set of criteria. 1227 The 'before' and 'after' filters can be used to control the time 1228 range of the output activities. If not provided, one week of back 1229 of activities will be returned. 1230 ''' 1231 req = ActivityListRequest() 1232 req.meta.CopyFrom(ListRequestMetadata()) 1233 if self.parent.page_limit > 0: 1234 req.meta.limit = self.parent.page_limit 1235 if self.parent.snapshot_datetime is not None: 1236 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1237 1238 req.filter = plumbing.quote_filter_args(filter, *args) 1239 1240 def generator(svc, req): 1241 tries = 0 1242 while True: 1243 try: 1244 plumbing_response = svc.stub.List( 1245 req, 1246 metadata=svc.parent.get_metadata( 1247 'Activities.List', req), 1248 timeout=timeout) 1249 except Exception as e: 1250 if self.parent.shouldRetry(tries, e): 1251 tries += 1 1252 self.parent.jitterSleep(tries) 1253 continue 1254 raise plumbing.convert_error_to_porcelain(e) from e 1255 tries = 0 1256 for plumbing_item in plumbing_response.activities: 1257 yield plumbing.convert_activity_to_porcelain(plumbing_item) 1258 if plumbing_response.meta.next_cursor == '': 1259 break 1260 req.meta.cursor = plumbing_response.meta.next_cursor 1261 1262 return generator(self, req) 1263 1264 1265class ApprovalWorkflowApprovers: 1266 ''' 1267 ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep 1268 See `strongdm.models.ApprovalWorkflowApprover`. 1269 ''' 1270 def __init__(self, channel, client): 1271 self.parent = client 1272 self.stub = ApprovalWorkflowApproversStub(channel) 1273 1274 def create(self, approval_workflow_approver, timeout=None): 1275 ''' 1276 Create creates a new approval workflow approver. 1277 ''' 1278 req = ApprovalWorkflowApproverCreateRequest() 1279 1280 if approval_workflow_approver is not None: 1281 req.approval_workflow_approver.CopyFrom( 1282 plumbing.convert_approval_workflow_approver_to_plumbing( 1283 approval_workflow_approver)) 1284 tries = 0 1285 plumbing_response = None 1286 while True: 1287 try: 1288 plumbing_response = self.stub.Create( 1289 req, 1290 metadata=self.parent.get_metadata( 1291 'ApprovalWorkflowApprovers.Create', req), 1292 timeout=timeout) 1293 except Exception as e: 1294 if self.parent.shouldRetry(tries, e): 1295 tries += 1 1296 self.parent.jitterSleep(tries) 1297 continue 1298 raise plumbing.convert_error_to_porcelain(e) from e 1299 break 1300 1301 resp = models.ApprovalWorkflowApproverCreateResponse() 1302 resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain( 1303 plumbing_response.approval_workflow_approver) 1304 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1305 plumbing_response.rate_limit) 1306 return resp 1307 1308 def get(self, id, timeout=None): 1309 ''' 1310 Get reads one approval workflow approver by ID. 1311 ''' 1312 req = ApprovalWorkflowApproverGetRequest() 1313 if self.parent.snapshot_datetime is not None: 1314 req.meta.CopyFrom(GetRequestMetadata()) 1315 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1316 1317 req.id = (id) 1318 tries = 0 1319 plumbing_response = None 1320 while True: 1321 try: 1322 plumbing_response = self.stub.Get( 1323 req, 1324 metadata=self.parent.get_metadata( 1325 'ApprovalWorkflowApprovers.Get', req), 1326 timeout=timeout) 1327 except Exception as e: 1328 if self.parent.shouldRetry(tries, e): 1329 tries += 1 1330 self.parent.jitterSleep(tries) 1331 continue 1332 raise plumbing.convert_error_to_porcelain(e) from e 1333 break 1334 1335 resp = models.ApprovalWorkflowApproverGetResponse() 1336 resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain( 1337 plumbing_response.approval_workflow_approver) 1338 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1339 plumbing_response.meta) 1340 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1341 plumbing_response.rate_limit) 1342 return resp 1343 1344 def delete(self, id, timeout=None): 1345 ''' 1346 Delete deletes an existing approval workflow approver. 1347 ''' 1348 req = ApprovalWorkflowApproverDeleteRequest() 1349 1350 req.id = (id) 1351 tries = 0 1352 plumbing_response = None 1353 while True: 1354 try: 1355 plumbing_response = self.stub.Delete( 1356 req, 1357 metadata=self.parent.get_metadata( 1358 'ApprovalWorkflowApprovers.Delete', req), 1359 timeout=timeout) 1360 except Exception as e: 1361 if self.parent.shouldRetry(tries, e): 1362 tries += 1 1363 self.parent.jitterSleep(tries) 1364 continue 1365 raise plumbing.convert_error_to_porcelain(e) from e 1366 break 1367 1368 resp = models.ApprovalWorkflowApproverDeleteResponse() 1369 resp.id = (plumbing_response.id) 1370 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1371 plumbing_response.rate_limit) 1372 return resp 1373 1374 def list(self, filter, *args, timeout=None): 1375 ''' 1376 Lists existing approval workflow approvers. 1377 ''' 1378 req = ApprovalWorkflowApproverListRequest() 1379 req.meta.CopyFrom(ListRequestMetadata()) 1380 if self.parent.page_limit > 0: 1381 req.meta.limit = self.parent.page_limit 1382 if self.parent.snapshot_datetime is not None: 1383 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1384 1385 req.filter = plumbing.quote_filter_args(filter, *args) 1386 1387 def generator(svc, req): 1388 tries = 0 1389 while True: 1390 try: 1391 plumbing_response = svc.stub.List( 1392 req, 1393 metadata=svc.parent.get_metadata( 1394 'ApprovalWorkflowApprovers.List', req), 1395 timeout=timeout) 1396 except Exception as e: 1397 if self.parent.shouldRetry(tries, e): 1398 tries += 1 1399 self.parent.jitterSleep(tries) 1400 continue 1401 raise plumbing.convert_error_to_porcelain(e) from e 1402 tries = 0 1403 for plumbing_item in plumbing_response.approval_workflow_approvers: 1404 yield plumbing.convert_approval_workflow_approver_to_porcelain( 1405 plumbing_item) 1406 if plumbing_response.meta.next_cursor == '': 1407 break 1408 req.meta.cursor = plumbing_response.meta.next_cursor 1409 1410 return generator(self, req) 1411 1412 1413class SnapshotApprovalWorkflowApprovers: 1414 ''' 1415 SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers 1416 service for historical queries. 1417 ''' 1418 def __init__(self, approval_workflow_approvers): 1419 self.approval_workflow_approvers = approval_workflow_approvers 1420 1421 def get(self, id, timeout=None): 1422 ''' 1423 Get reads one approval workflow approver by ID. 1424 ''' 1425 return self.approval_workflow_approvers.get(id, timeout=timeout) 1426 1427 def list(self, filter, *args, timeout=None): 1428 ''' 1429 Lists existing approval workflow approvers. 1430 ''' 1431 return self.approval_workflow_approvers.list(filter, 1432 *args, 1433 timeout=timeout) 1434 1435 1436class ApprovalWorkflowApproversHistory: 1437 ''' 1438 ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover. 1439 See `strongdm.models.ApprovalWorkflowApproverHistory`. 1440 ''' 1441 def __init__(self, channel, client): 1442 self.parent = client 1443 self.stub = ApprovalWorkflowApproversHistoryStub(channel) 1444 1445 def list(self, filter, *args, timeout=None): 1446 ''' 1447 List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria. 1448 ''' 1449 req = ApprovalWorkflowApproverHistoryListRequest() 1450 req.meta.CopyFrom(ListRequestMetadata()) 1451 if self.parent.page_limit > 0: 1452 req.meta.limit = self.parent.page_limit 1453 if self.parent.snapshot_datetime is not None: 1454 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1455 1456 req.filter = plumbing.quote_filter_args(filter, *args) 1457 1458 def generator(svc, req): 1459 tries = 0 1460 while True: 1461 try: 1462 plumbing_response = svc.stub.List( 1463 req, 1464 metadata=svc.parent.get_metadata( 1465 'ApprovalWorkflowApproversHistory.List', req), 1466 timeout=timeout) 1467 except Exception as e: 1468 if self.parent.shouldRetry(tries, e): 1469 tries += 1 1470 self.parent.jitterSleep(tries) 1471 continue 1472 raise plumbing.convert_error_to_porcelain(e) from e 1473 tries = 0 1474 for plumbing_item in plumbing_response.history: 1475 yield plumbing.convert_approval_workflow_approver_history_to_porcelain( 1476 plumbing_item) 1477 if plumbing_response.meta.next_cursor == '': 1478 break 1479 req.meta.cursor = plumbing_response.meta.next_cursor 1480 1481 return generator(self, req) 1482 1483 1484class ApprovalWorkflowSteps: 1485 ''' 1486 ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow 1487 See `strongdm.models.ApprovalWorkflowStep`. 1488 ''' 1489 def __init__(self, channel, client): 1490 self.parent = client 1491 self.stub = ApprovalWorkflowStepsStub(channel) 1492 1493 def create(self, approval_workflow_step, timeout=None): 1494 ''' 1495 Create creates a new approval workflow step. 1496 ''' 1497 req = ApprovalWorkflowStepCreateRequest() 1498 1499 if approval_workflow_step is not None: 1500 req.approval_workflow_step.CopyFrom( 1501 plumbing.convert_approval_workflow_step_to_plumbing( 1502 approval_workflow_step)) 1503 tries = 0 1504 plumbing_response = None 1505 while True: 1506 try: 1507 plumbing_response = self.stub.Create( 1508 req, 1509 metadata=self.parent.get_metadata( 1510 'ApprovalWorkflowSteps.Create', req), 1511 timeout=timeout) 1512 except Exception as e: 1513 if self.parent.shouldRetry(tries, e): 1514 tries += 1 1515 self.parent.jitterSleep(tries) 1516 continue 1517 raise plumbing.convert_error_to_porcelain(e) from e 1518 break 1519 1520 resp = models.ApprovalWorkflowStepCreateResponse() 1521 resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain( 1522 plumbing_response.approval_workflow_step) 1523 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1524 plumbing_response.rate_limit) 1525 return resp 1526 1527 def get(self, id, timeout=None): 1528 ''' 1529 Get reads one approval workflow step by ID. 1530 ''' 1531 req = ApprovalWorkflowStepGetRequest() 1532 if self.parent.snapshot_datetime is not None: 1533 req.meta.CopyFrom(GetRequestMetadata()) 1534 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1535 1536 req.id = (id) 1537 tries = 0 1538 plumbing_response = None 1539 while True: 1540 try: 1541 plumbing_response = self.stub.Get( 1542 req, 1543 metadata=self.parent.get_metadata( 1544 'ApprovalWorkflowSteps.Get', req), 1545 timeout=timeout) 1546 except Exception as e: 1547 if self.parent.shouldRetry(tries, e): 1548 tries += 1 1549 self.parent.jitterSleep(tries) 1550 continue 1551 raise plumbing.convert_error_to_porcelain(e) from e 1552 break 1553 1554 resp = models.ApprovalWorkflowStepGetResponse() 1555 resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain( 1556 plumbing_response.approval_workflow_step) 1557 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1558 plumbing_response.meta) 1559 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1560 plumbing_response.rate_limit) 1561 return resp 1562 1563 def delete(self, id, timeout=None): 1564 ''' 1565 Delete deletes an existing approval workflow step. 1566 ''' 1567 req = ApprovalWorkflowStepDeleteRequest() 1568 1569 req.id = (id) 1570 tries = 0 1571 plumbing_response = None 1572 while True: 1573 try: 1574 plumbing_response = self.stub.Delete( 1575 req, 1576 metadata=self.parent.get_metadata( 1577 'ApprovalWorkflowSteps.Delete', req), 1578 timeout=timeout) 1579 except Exception as e: 1580 if self.parent.shouldRetry(tries, e): 1581 tries += 1 1582 self.parent.jitterSleep(tries) 1583 continue 1584 raise plumbing.convert_error_to_porcelain(e) from e 1585 break 1586 1587 resp = models.ApprovalWorkflowStepDeleteResponse() 1588 resp.id = (plumbing_response.id) 1589 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1590 plumbing_response.rate_limit) 1591 return resp 1592 1593 def list(self, filter, *args, timeout=None): 1594 ''' 1595 Lists existing approval workflow steps. 1596 ''' 1597 req = ApprovalWorkflowStepListRequest() 1598 req.meta.CopyFrom(ListRequestMetadata()) 1599 if self.parent.page_limit > 0: 1600 req.meta.limit = self.parent.page_limit 1601 if self.parent.snapshot_datetime is not None: 1602 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1603 1604 req.filter = plumbing.quote_filter_args(filter, *args) 1605 1606 def generator(svc, req): 1607 tries = 0 1608 while True: 1609 try: 1610 plumbing_response = svc.stub.List( 1611 req, 1612 metadata=svc.parent.get_metadata( 1613 'ApprovalWorkflowSteps.List', req), 1614 timeout=timeout) 1615 except Exception as e: 1616 if self.parent.shouldRetry(tries, e): 1617 tries += 1 1618 self.parent.jitterSleep(tries) 1619 continue 1620 raise plumbing.convert_error_to_porcelain(e) from e 1621 tries = 0 1622 for plumbing_item in plumbing_response.approval_workflow_steps: 1623 yield plumbing.convert_approval_workflow_step_to_porcelain( 1624 plumbing_item) 1625 if plumbing_response.meta.next_cursor == '': 1626 break 1627 req.meta.cursor = plumbing_response.meta.next_cursor 1628 1629 return generator(self, req) 1630 1631 1632class SnapshotApprovalWorkflowSteps: 1633 ''' 1634 SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps 1635 service for historical queries. 1636 ''' 1637 def __init__(self, approval_workflow_steps): 1638 self.approval_workflow_steps = approval_workflow_steps 1639 1640 def get(self, id, timeout=None): 1641 ''' 1642 Get reads one approval workflow step by ID. 1643 ''' 1644 return self.approval_workflow_steps.get(id, timeout=timeout) 1645 1646 def list(self, filter, *args, timeout=None): 1647 ''' 1648 Lists existing approval workflow steps. 1649 ''' 1650 return self.approval_workflow_steps.list(filter, 1651 *args, 1652 timeout=timeout) 1653 1654 1655class ApprovalWorkflowStepsHistory: 1656 ''' 1657 ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep. 1658 See `strongdm.models.ApprovalWorkflowStepHistory`. 1659 ''' 1660 def __init__(self, channel, client): 1661 self.parent = client 1662 self.stub = ApprovalWorkflowStepsHistoryStub(channel) 1663 1664 def list(self, filter, *args, timeout=None): 1665 ''' 1666 List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria. 1667 ''' 1668 req = ApprovalWorkflowStepHistoryListRequest() 1669 req.meta.CopyFrom(ListRequestMetadata()) 1670 if self.parent.page_limit > 0: 1671 req.meta.limit = self.parent.page_limit 1672 if self.parent.snapshot_datetime is not None: 1673 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1674 1675 req.filter = plumbing.quote_filter_args(filter, *args) 1676 1677 def generator(svc, req): 1678 tries = 0 1679 while True: 1680 try: 1681 plumbing_response = svc.stub.List( 1682 req, 1683 metadata=svc.parent.get_metadata( 1684 'ApprovalWorkflowStepsHistory.List', req), 1685 timeout=timeout) 1686 except Exception as e: 1687 if self.parent.shouldRetry(tries, e): 1688 tries += 1 1689 self.parent.jitterSleep(tries) 1690 continue 1691 raise plumbing.convert_error_to_porcelain(e) from e 1692 tries = 0 1693 for plumbing_item in plumbing_response.history: 1694 yield plumbing.convert_approval_workflow_step_history_to_porcelain( 1695 plumbing_item) 1696 if plumbing_response.meta.next_cursor == '': 1697 break 1698 req.meta.cursor = plumbing_response.meta.next_cursor 1699 1700 return generator(self, req) 1701 1702 1703class ApprovalWorkflows: 1704 ''' 1705 ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized 1706 approvers and be approved or denied. 1707 See `strongdm.models.ApprovalWorkflow`. 1708 ''' 1709 def __init__(self, channel, client): 1710 self.parent = client 1711 self.stub = ApprovalWorkflowsStub(channel) 1712 1713 def create(self, approval_workflow, timeout=None): 1714 ''' 1715 Create creates a new approval workflow and requires a name and approval mode for the approval workflow. 1716 ''' 1717 req = ApprovalWorkflowCreateRequest() 1718 1719 if approval_workflow is not None: 1720 req.approval_workflow.CopyFrom( 1721 plumbing.convert_approval_workflow_to_plumbing( 1722 approval_workflow)) 1723 tries = 0 1724 plumbing_response = None 1725 while True: 1726 try: 1727 plumbing_response = self.stub.Create( 1728 req, 1729 metadata=self.parent.get_metadata( 1730 'ApprovalWorkflows.Create', req), 1731 timeout=timeout) 1732 except Exception as e: 1733 if self.parent.shouldRetry(tries, e): 1734 tries += 1 1735 self.parent.jitterSleep(tries) 1736 continue 1737 raise plumbing.convert_error_to_porcelain(e) from e 1738 break 1739 1740 resp = models.ApprovalWorkflowCreateResponse() 1741 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1742 plumbing_response.approval_workflow) 1743 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1744 plumbing_response.rate_limit) 1745 return resp 1746 1747 def get(self, id, timeout=None): 1748 ''' 1749 Get reads one approval workflow by ID. 1750 ''' 1751 req = ApprovalWorkflowGetRequest() 1752 if self.parent.snapshot_datetime is not None: 1753 req.meta.CopyFrom(GetRequestMetadata()) 1754 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1755 1756 req.id = (id) 1757 tries = 0 1758 plumbing_response = None 1759 while True: 1760 try: 1761 plumbing_response = self.stub.Get( 1762 req, 1763 metadata=self.parent.get_metadata('ApprovalWorkflows.Get', 1764 req), 1765 timeout=timeout) 1766 except Exception as e: 1767 if self.parent.shouldRetry(tries, e): 1768 tries += 1 1769 self.parent.jitterSleep(tries) 1770 continue 1771 raise plumbing.convert_error_to_porcelain(e) from e 1772 break 1773 1774 resp = models.ApprovalWorkflowGetResponse() 1775 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1776 plumbing_response.approval_workflow) 1777 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1778 plumbing_response.meta) 1779 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1780 plumbing_response.rate_limit) 1781 return resp 1782 1783 def delete(self, id, timeout=None): 1784 ''' 1785 Delete deletes an existing approval workflow. 1786 ''' 1787 req = ApprovalWorkflowDeleteRequest() 1788 1789 req.id = (id) 1790 tries = 0 1791 plumbing_response = None 1792 while True: 1793 try: 1794 plumbing_response = self.stub.Delete( 1795 req, 1796 metadata=self.parent.get_metadata( 1797 'ApprovalWorkflows.Delete', req), 1798 timeout=timeout) 1799 except Exception as e: 1800 if self.parent.shouldRetry(tries, e): 1801 tries += 1 1802 self.parent.jitterSleep(tries) 1803 continue 1804 raise plumbing.convert_error_to_porcelain(e) from e 1805 break 1806 1807 resp = models.ApprovalWorkflowDeleteResponse() 1808 resp.id = (plumbing_response.id) 1809 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1810 plumbing_response.rate_limit) 1811 return resp 1812 1813 def update(self, approval_workflow, timeout=None): 1814 ''' 1815 Update updates an existing approval workflow. 1816 ''' 1817 req = ApprovalWorkflowUpdateRequest() 1818 1819 if approval_workflow is not None: 1820 req.approval_workflow.CopyFrom( 1821 plumbing.convert_approval_workflow_to_plumbing( 1822 approval_workflow)) 1823 tries = 0 1824 plumbing_response = None 1825 while True: 1826 try: 1827 plumbing_response = self.stub.Update( 1828 req, 1829 metadata=self.parent.get_metadata( 1830 'ApprovalWorkflows.Update', req), 1831 timeout=timeout) 1832 except Exception as e: 1833 if self.parent.shouldRetry(tries, e): 1834 tries += 1 1835 self.parent.jitterSleep(tries) 1836 continue 1837 raise plumbing.convert_error_to_porcelain(e) from e 1838 break 1839 1840 resp = models.ApprovalWorkflowUpdateResponse() 1841 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1842 plumbing_response.approval_workflow) 1843 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1844 plumbing_response.rate_limit) 1845 return resp 1846 1847 def list(self, filter, *args, timeout=None): 1848 ''' 1849 Lists existing approval workflows. 1850 ''' 1851 req = ApprovalWorkflowListRequest() 1852 req.meta.CopyFrom(ListRequestMetadata()) 1853 if self.parent.page_limit > 0: 1854 req.meta.limit = self.parent.page_limit 1855 if self.parent.snapshot_datetime is not None: 1856 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1857 1858 req.filter = plumbing.quote_filter_args(filter, *args) 1859 1860 def generator(svc, req): 1861 tries = 0 1862 while True: 1863 try: 1864 plumbing_response = svc.stub.List( 1865 req, 1866 metadata=svc.parent.get_metadata( 1867 'ApprovalWorkflows.List', req), 1868 timeout=timeout) 1869 except Exception as e: 1870 if self.parent.shouldRetry(tries, e): 1871 tries += 1 1872 self.parent.jitterSleep(tries) 1873 continue 1874 raise plumbing.convert_error_to_porcelain(e) from e 1875 tries = 0 1876 for plumbing_item in plumbing_response.approval_workflows: 1877 yield plumbing.convert_approval_workflow_to_porcelain( 1878 plumbing_item) 1879 if plumbing_response.meta.next_cursor == '': 1880 break 1881 req.meta.cursor = plumbing_response.meta.next_cursor 1882 1883 return generator(self, req) 1884 1885 1886class SnapshotApprovalWorkflows: 1887 ''' 1888 SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows 1889 service for historical queries. 1890 ''' 1891 def __init__(self, approval_workflows): 1892 self.approval_workflows = approval_workflows 1893 1894 def get(self, id, timeout=None): 1895 ''' 1896 Get reads one approval workflow by ID. 1897 ''' 1898 return self.approval_workflows.get(id, timeout=timeout) 1899 1900 def list(self, filter, *args, timeout=None): 1901 ''' 1902 Lists existing approval workflows. 1903 ''' 1904 return self.approval_workflows.list(filter, *args, timeout=timeout) 1905 1906 1907class ApprovalWorkflowsHistory: 1908 ''' 1909 ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow. 1910 See `strongdm.models.ApprovalWorkflowHistory`. 1911 ''' 1912 def __init__(self, channel, client): 1913 self.parent = client 1914 self.stub = ApprovalWorkflowsHistoryStub(channel) 1915 1916 def list(self, filter, *args, timeout=None): 1917 ''' 1918 List gets a list of ApprovalWorkflowHistory records matching a given set of criteria. 1919 ''' 1920 req = ApprovalWorkflowHistoryListRequest() 1921 req.meta.CopyFrom(ListRequestMetadata()) 1922 if self.parent.page_limit > 0: 1923 req.meta.limit = self.parent.page_limit 1924 if self.parent.snapshot_datetime is not None: 1925 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1926 1927 req.filter = plumbing.quote_filter_args(filter, *args) 1928 1929 def generator(svc, req): 1930 tries = 0 1931 while True: 1932 try: 1933 plumbing_response = svc.stub.List( 1934 req, 1935 metadata=svc.parent.get_metadata( 1936 'ApprovalWorkflowsHistory.List', req), 1937 timeout=timeout) 1938 except Exception as e: 1939 if self.parent.shouldRetry(tries, e): 1940 tries += 1 1941 self.parent.jitterSleep(tries) 1942 continue 1943 raise plumbing.convert_error_to_porcelain(e) from e 1944 tries = 0 1945 for plumbing_item in plumbing_response.history: 1946 yield plumbing.convert_approval_workflow_history_to_porcelain( 1947 plumbing_item) 1948 if plumbing_response.meta.next_cursor == '': 1949 break 1950 req.meta.cursor = plumbing_response.meta.next_cursor 1951 1952 return generator(self, req) 1953 1954 1955class ControlPanel: 1956 ''' 1957 ControlPanel contains all administrative controls. 1958 ''' 1959 def __init__(self, channel, client): 1960 self.parent = client 1961 self.stub = ControlPanelStub(channel) 1962 1963 def get_sshca_public_key(self, timeout=None): 1964 ''' 1965 GetSSHCAPublicKey retrieves the SSH CA public key. 1966 ''' 1967 req = ControlPanelGetSSHCAPublicKeyRequest() 1968 1969 tries = 0 1970 plumbing_response = None 1971 while True: 1972 try: 1973 plumbing_response = self.stub.GetSSHCAPublicKey( 1974 req, 1975 metadata=self.parent.get_metadata( 1976 'ControlPanel.GetSSHCAPublicKey', req), 1977 timeout=timeout) 1978 except Exception as e: 1979 if self.parent.shouldRetry(tries, e): 1980 tries += 1 1981 self.parent.jitterSleep(tries) 1982 continue 1983 raise plumbing.convert_error_to_porcelain(e) from e 1984 break 1985 1986 resp = models.ControlPanelGetSSHCAPublicKeyResponse() 1987 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1988 plumbing_response.meta) 1989 resp.public_key = (plumbing_response.public_key) 1990 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1991 plumbing_response.rate_limit) 1992 return resp 1993 1994 def get_rdpca_public_key(self, timeout=None): 1995 ''' 1996 GetRDPCAPublicKey retrieves the RDP CA public key. 1997 ''' 1998 req = ControlPanelGetRDPCAPublicKeyRequest() 1999 2000 tries = 0 2001 plumbing_response = None 2002 while True: 2003 try: 2004 plumbing_response = self.stub.GetRDPCAPublicKey( 2005 req, 2006 metadata=self.parent.get_metadata( 2007 'ControlPanel.GetRDPCAPublicKey', req), 2008 timeout=timeout) 2009 except Exception as e: 2010 if self.parent.shouldRetry(tries, e): 2011 tries += 1 2012 self.parent.jitterSleep(tries) 2013 continue 2014 raise plumbing.convert_error_to_porcelain(e) from e 2015 break 2016 2017 resp = models.ControlPanelGetRDPCAPublicKeyResponse() 2018 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2019 plumbing_response.meta) 2020 resp.public_key = (plumbing_response.public_key) 2021 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2022 plumbing_response.rate_limit) 2023 return resp 2024 2025 def verify_jwt(self, token, timeout=None): 2026 ''' 2027 VerifyJWT reports whether the given JWT token (x-sdm-token) is valid. 2028 ''' 2029 req = ControlPanelVerifyJWTRequest() 2030 2031 req.token = (token) 2032 tries = 0 2033 plumbing_response = None 2034 while True: 2035 try: 2036 plumbing_response = self.stub.VerifyJWT( 2037 req, 2038 metadata=self.parent.get_metadata('ControlPanel.VerifyJWT', 2039 req), 2040 timeout=timeout) 2041 except Exception as e: 2042 if self.parent.shouldRetry(tries, e): 2043 tries += 1 2044 self.parent.jitterSleep(tries) 2045 continue 2046 raise plumbing.convert_error_to_porcelain(e) from e 2047 break 2048 2049 resp = models.ControlPanelVerifyJWTResponse() 2050 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2051 plumbing_response.meta) 2052 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2053 plumbing_response.rate_limit) 2054 resp.valid = (plumbing_response.valid) 2055 return resp 2056 2057 2058class Nodes: 2059 ''' 2060 Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes: 2061 - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers. 2062 - **Relays** are used to extend the strongDM network into segmented subnets. They provide access to databases and servers but do not listen for incoming connections. 2063 See: 2064 `strongdm.models.Gateway` 2065 `strongdm.models.Relay` 2066 ''' 2067 def __init__(self, channel, client): 2068 self.parent = client 2069 self.stub = NodesStub(channel) 2070 2071 def create(self, node, timeout=None): 2072 ''' 2073 Create registers a new Node. 2074 ''' 2075 req = NodeCreateRequest() 2076 2077 if node is not None: 2078 req.node.CopyFrom(plumbing.convert_node_to_plumbing(node)) 2079 tries = 0 2080 plumbing_response = None 2081 while True: 2082 try: 2083 plumbing_response = self.stub.Create( 2084 req, 2085 metadata=self.parent.get_metadata('Nodes.Create', req), 2086 timeout=timeout) 2087 except Exception as e: 2088 if self.parent.shouldRetry(tries, e): 2089 tries += 1 2090 self.parent.jitterSleep(tries) 2091 continue 2092 raise plumbing.convert_error_to_porcelain(e) from e 2093 break 2094 2095 resp = models.NodeCreateResponse() 2096 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2097 plumbing_response.meta) 2098 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2099 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2100 plumbing_response.rate_limit) 2101 resp.token = (plumbing_response.token) 2102 return resp 2103 2104 def get(self, id, timeout=None): 2105 ''' 2106 Get reads one Node by ID. 2107 ''' 2108 req = NodeGetRequest() 2109 if self.parent.snapshot_datetime is not None: 2110 req.meta.CopyFrom(GetRequestMetadata()) 2111 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2112 2113 req.id = (id) 2114 tries = 0 2115 plumbing_response = None 2116 while True: 2117 try: 2118 plumbing_response = self.stub.Get( 2119 req, 2120 metadata=self.parent.get_metadata('Nodes.Get', req), 2121 timeout=timeout) 2122 except Exception as e: 2123 if self.parent.shouldRetry(tries, e): 2124 tries += 1 2125 self.parent.jitterSleep(tries) 2126 continue 2127 raise plumbing.convert_error_to_porcelain(e) from e 2128 break 2129 2130 resp = models.NodeGetResponse() 2131 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2132 plumbing_response.meta) 2133 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2134 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2135 plumbing_response.rate_limit) 2136 return resp 2137 2138 def update(self, node, timeout=None): 2139 ''' 2140 Update replaces all the fields of a Node by ID. 2141 ''' 2142 req = NodeUpdateRequest() 2143 2144 if node is not None: 2145 req.node.CopyFrom(plumbing.convert_node_to_plumbing(node)) 2146 tries = 0 2147 plumbing_response = None 2148 while True: 2149 try: 2150 plumbing_response = self.stub.Update( 2151 req, 2152 metadata=self.parent.get_metadata('Nodes.Update', req), 2153 timeout=timeout) 2154 except Exception as e: 2155 if self.parent.shouldRetry(tries, e): 2156 tries += 1 2157 self.parent.jitterSleep(tries) 2158 continue 2159 raise plumbing.convert_error_to_porcelain(e) from e 2160 break 2161 2162 resp = models.NodeUpdateResponse() 2163 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 2164 plumbing_response.meta) 2165 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2166 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2167 plumbing_response.rate_limit) 2168 return resp 2169 2170 def delete(self, id, timeout=None): 2171 ''' 2172 Delete removes a Node by ID. 2173 ''' 2174 req = NodeDeleteRequest() 2175 2176 req.id = (id) 2177 tries = 0 2178 plumbing_response = None 2179 while True: 2180 try: 2181 plumbing_response = self.stub.Delete( 2182 req, 2183 metadata=self.parent.get_metadata('Nodes.Delete', req), 2184 timeout=timeout) 2185 except Exception as e: 2186 if self.parent.shouldRetry(tries, e): 2187 tries += 1 2188 self.parent.jitterSleep(tries) 2189 continue 2190 raise plumbing.convert_error_to_porcelain(e) from e 2191 break 2192 2193 resp = models.NodeDeleteResponse() 2194 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2195 plumbing_response.meta) 2196 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2197 plumbing_response.rate_limit) 2198 return resp 2199 2200 def list(self, filter, *args, timeout=None): 2201 ''' 2202 List gets a list of Nodes matching a given set of criteria. 2203 ''' 2204 req = NodeListRequest() 2205 req.meta.CopyFrom(ListRequestMetadata()) 2206 if self.parent.page_limit > 0: 2207 req.meta.limit = self.parent.page_limit 2208 if self.parent.snapshot_datetime is not None: 2209 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2210 2211 req.filter = plumbing.quote_filter_args(filter, *args) 2212 2213 def generator(svc, req): 2214 tries = 0 2215 while True: 2216 try: 2217 plumbing_response = svc.stub.List( 2218 req, 2219 metadata=svc.parent.get_metadata('Nodes.List', req), 2220 timeout=timeout) 2221 except Exception as e: 2222 if self.parent.shouldRetry(tries, e): 2223 tries += 1 2224 self.parent.jitterSleep(tries) 2225 continue 2226 raise plumbing.convert_error_to_porcelain(e) from e 2227 tries = 0 2228 for plumbing_item in plumbing_response.nodes: 2229 yield plumbing.convert_node_to_porcelain(plumbing_item) 2230 if plumbing_response.meta.next_cursor == '': 2231 break 2232 req.meta.cursor = plumbing_response.meta.next_cursor 2233 2234 return generator(self, req) 2235 2236 2237class SnapshotNodes: 2238 ''' 2239 SnapshotNodes exposes the read only methods of the Nodes 2240 service for historical queries. 2241 ''' 2242 def __init__(self, nodes): 2243 self.nodes = nodes 2244 2245 def get(self, id, timeout=None): 2246 ''' 2247 Get reads one Node by ID. 2248 ''' 2249 return self.nodes.get(id, timeout=timeout) 2250 2251 def list(self, filter, *args, timeout=None): 2252 ''' 2253 List gets a list of Nodes matching a given set of criteria. 2254 ''' 2255 return self.nodes.list(filter, *args, timeout=timeout) 2256 2257 2258class NodesHistory: 2259 ''' 2260 NodesHistory records all changes to the state of a Node. 2261 See `strongdm.models.NodeHistory`. 2262 ''' 2263 def __init__(self, channel, client): 2264 self.parent = client 2265 self.stub = NodesHistoryStub(channel) 2266 2267 def list(self, filter, *args, timeout=None): 2268 ''' 2269 List gets a list of NodeHistory records matching a given set of criteria. 2270 ''' 2271 req = NodeHistoryListRequest() 2272 req.meta.CopyFrom(ListRequestMetadata()) 2273 if self.parent.page_limit > 0: 2274 req.meta.limit = self.parent.page_limit 2275 if self.parent.snapshot_datetime is not None: 2276 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2277 2278 req.filter = plumbing.quote_filter_args(filter, *args) 2279 2280 def generator(svc, req): 2281 tries = 0 2282 while True: 2283 try: 2284 plumbing_response = svc.stub.List( 2285 req, 2286 metadata=svc.parent.get_metadata( 2287 'NodesHistory.List', req), 2288 timeout=timeout) 2289 except Exception as e: 2290 if self.parent.shouldRetry(tries, e): 2291 tries += 1 2292 self.parent.jitterSleep(tries) 2293 continue 2294 raise plumbing.convert_error_to_porcelain(e) from e 2295 tries = 0 2296 for plumbing_item in plumbing_response.history: 2297 yield plumbing.convert_node_history_to_porcelain( 2298 plumbing_item) 2299 if plumbing_response.meta.next_cursor == '': 2300 break 2301 req.meta.cursor = plumbing_response.meta.next_cursor 2302 2303 return generator(self, req) 2304 2305 2306class OrganizationHistory: 2307 ''' 2308 OrganizationHistory records all changes to the state of an Organization. 2309 See `strongdm.models.OrganizationHistoryRecord`. 2310 ''' 2311 def __init__(self, channel, client): 2312 self.parent = client 2313 self.stub = OrganizationHistoryStub(channel) 2314 2315 def list(self, filter, *args, timeout=None): 2316 ''' 2317 List gets a list of OrganizationHistory records matching a given set of criteria. 2318 ''' 2319 req = OrganizationHistoryListRequest() 2320 req.meta.CopyFrom(ListRequestMetadata()) 2321 if self.parent.page_limit > 0: 2322 req.meta.limit = self.parent.page_limit 2323 if self.parent.snapshot_datetime is not None: 2324 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2325 2326 req.filter = plumbing.quote_filter_args(filter, *args) 2327 2328 def generator(svc, req): 2329 tries = 0 2330 while True: 2331 try: 2332 plumbing_response = svc.stub.List( 2333 req, 2334 metadata=svc.parent.get_metadata( 2335 'OrganizationHistory.List', req), 2336 timeout=timeout) 2337 except Exception as e: 2338 if self.parent.shouldRetry(tries, e): 2339 tries += 1 2340 self.parent.jitterSleep(tries) 2341 continue 2342 raise plumbing.convert_error_to_porcelain(e) from e 2343 tries = 0 2344 for plumbing_item in plumbing_response.history: 2345 yield plumbing.convert_organization_history_record_to_porcelain( 2346 plumbing_item) 2347 if plumbing_response.meta.next_cursor == '': 2348 break 2349 req.meta.cursor = plumbing_response.meta.next_cursor 2350 2351 return generator(self, req) 2352 2353 2354class PeeringGroupNodes: 2355 ''' 2356 PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group. 2357 See `strongdm.models.PeeringGroupNode`. 2358 ''' 2359 def __init__(self, channel, client): 2360 self.parent = client 2361 self.stub = PeeringGroupNodesStub(channel) 2362 2363 def create(self, peering_group_node, timeout=None): 2364 ''' 2365 Create attaches a Node to a PeeringGroup 2366 ''' 2367 req = PeeringGroupNodeCreateRequest() 2368 2369 if peering_group_node is not None: 2370 req.peering_group_node.CopyFrom( 2371 plumbing.convert_peering_group_node_to_plumbing( 2372 peering_group_node)) 2373 tries = 0 2374 plumbing_response = None 2375 while True: 2376 try: 2377 plumbing_response = self.stub.Create( 2378 req, 2379 metadata=self.parent.get_metadata( 2380 'PeeringGroupNodes.Create', req), 2381 timeout=timeout) 2382 except Exception as e: 2383 if self.parent.shouldRetry(tries, e): 2384 tries += 1 2385 self.parent.jitterSleep(tries) 2386 continue 2387 raise plumbing.convert_error_to_porcelain(e) from e 2388 break 2389 2390 resp = models.PeeringGroupNodeCreateResponse() 2391 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2392 plumbing_response.meta) 2393 resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain( 2394 plumbing_response.peering_group_node) 2395 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2396 plumbing_response.rate_limit) 2397 return resp 2398 2399 def delete(self, id, timeout=None): 2400 ''' 2401 Delete detaches a Node to a PeeringGroup. 2402 ''' 2403 req = PeeringGroupNodeDeleteRequest() 2404 2405 req.id = (id) 2406 tries = 0 2407 plumbing_response = None 2408 while True: 2409 try: 2410 plumbing_response = self.stub.Delete( 2411 req, 2412 metadata=self.parent.get_metadata( 2413 'PeeringGroupNodes.Delete', req), 2414 timeout=timeout) 2415 except Exception as e: 2416 if self.parent.shouldRetry(tries, e): 2417 tries += 1 2418 self.parent.jitterSleep(tries) 2419 continue 2420 raise plumbing.convert_error_to_porcelain(e) from e 2421 break 2422 2423 resp = models.PeeringGroupNodeDeleteResponse() 2424 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2425 plumbing_response.meta) 2426 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2427 plumbing_response.rate_limit) 2428 return resp 2429 2430 def get(self, id, timeout=None): 2431 ''' 2432 Get reads the information of one peering group to node attachment. 2433 ''' 2434 req = PeeringGroupNodeGetRequest() 2435 if self.parent.snapshot_datetime is not None: 2436 req.meta.CopyFrom(GetRequestMetadata()) 2437 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2438 2439 req.id = (id) 2440 tries = 0 2441 plumbing_response = None 2442 while True: 2443 try: 2444 plumbing_response = self.stub.Get( 2445 req, 2446 metadata=self.parent.get_metadata('PeeringGroupNodes.Get', 2447 req), 2448 timeout=timeout) 2449 except Exception as e: 2450 if self.parent.shouldRetry(tries, e): 2451 tries += 1 2452 self.parent.jitterSleep(tries) 2453 continue 2454 raise plumbing.convert_error_to_porcelain(e) from e 2455 break 2456 2457 resp = models.PeeringGroupNodeGetResponse() 2458 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2459 plumbing_response.meta) 2460 resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain( 2461 plumbing_response.peering_group_node) 2462 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2463 plumbing_response.rate_limit) 2464 return resp 2465 2466 def list(self, filter, *args, timeout=None): 2467 ''' 2468 List gets a list of peering group node attachments. 2469 ''' 2470 req = PeeringGroupNodeListRequest() 2471 req.meta.CopyFrom(ListRequestMetadata()) 2472 if self.parent.page_limit > 0: 2473 req.meta.limit = self.parent.page_limit 2474 if self.parent.snapshot_datetime is not None: 2475 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2476 2477 req.filter = plumbing.quote_filter_args(filter, *args) 2478 2479 def generator(svc, req): 2480 tries = 0 2481 while True: 2482 try: 2483 plumbing_response = svc.stub.List( 2484 req, 2485 metadata=svc.parent.get_metadata( 2486 'PeeringGroupNodes.List', req), 2487 timeout=timeout) 2488 except Exception as e: 2489 if self.parent.shouldRetry(tries, e): 2490 tries += 1 2491 self.parent.jitterSleep(tries) 2492 continue 2493 raise plumbing.convert_error_to_porcelain(e) from e 2494 tries = 0 2495 for plumbing_item in plumbing_response.peering_group_nodes: 2496 yield plumbing.convert_peering_group_node_to_porcelain( 2497 plumbing_item) 2498 if plumbing_response.meta.next_cursor == '': 2499 break 2500 req.meta.cursor = plumbing_response.meta.next_cursor 2501 2502 return generator(self, req) 2503 2504 2505class PeeringGroupPeers: 2506 ''' 2507 PeeringGroupPeers provides the building blocks necessary to link two peering groups. 2508 See `strongdm.models.PeeringGroupPeer`. 2509 ''' 2510 def __init__(self, channel, client): 2511 self.parent = client 2512 self.stub = PeeringGroupPeersStub(channel) 2513 2514 def create(self, peering_group_peer, timeout=None): 2515 ''' 2516 Create links two peering groups. 2517 ''' 2518 req = PeeringGroupPeerCreateRequest() 2519 2520 if peering_group_peer is not None: 2521 req.peering_group_peer.CopyFrom( 2522 plumbing.convert_peering_group_peer_to_plumbing( 2523 peering_group_peer)) 2524 tries = 0 2525 plumbing_response = None 2526 while True: 2527 try: 2528 plumbing_response = self.stub.Create( 2529 req, 2530 metadata=self.parent.get_metadata( 2531 'PeeringGroupPeers.Create', req), 2532 timeout=timeout) 2533 except Exception as e: 2534 if self.parent.shouldRetry(tries, e): 2535 tries += 1 2536 self.parent.jitterSleep(tries) 2537 continue 2538 raise plumbing.convert_error_to_porcelain(e) from e 2539 break 2540 2541 resp = models.PeeringGroupPeerCreateResponse() 2542 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2543 plumbing_response.meta) 2544 resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain( 2545 plumbing_response.peering_group_peer) 2546 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2547 plumbing_response.rate_limit) 2548 return resp 2549 2550 def delete(self, id, timeout=None): 2551 ''' 2552 Delete unlinks two peering groups. 2553 ''' 2554 req = PeeringGroupPeerDeleteRequest() 2555 2556 req.id = (id) 2557 tries = 0 2558 plumbing_response = None 2559 while True: 2560 try: 2561 plumbing_response = self.stub.Delete( 2562 req, 2563 metadata=self.parent.get_metadata( 2564 'PeeringGroupPeers.Delete', req), 2565 timeout=timeout) 2566 except Exception as e: 2567 if self.parent.shouldRetry(tries, e): 2568 tries += 1 2569 self.parent.jitterSleep(tries) 2570 continue 2571 raise plumbing.convert_error_to_porcelain(e) from e 2572 break 2573 2574 resp = models.PeeringGroupPeerDeleteResponse() 2575 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2576 plumbing_response.meta) 2577 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2578 plumbing_response.rate_limit) 2579 return resp 2580 2581 def get(self, id, timeout=None): 2582 ''' 2583 Get reads the information of one peering group link. 2584 ''' 2585 req = PeeringGroupPeerGetRequest() 2586 if self.parent.snapshot_datetime is not None: 2587 req.meta.CopyFrom(GetRequestMetadata()) 2588 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2589 2590 req.id = (id) 2591 tries = 0 2592 plumbing_response = None 2593 while True: 2594 try: 2595 plumbing_response = self.stub.Get( 2596 req, 2597 metadata=self.parent.get_metadata('PeeringGroupPeers.Get', 2598 req), 2599 timeout=timeout) 2600 except Exception as e: 2601 if self.parent.shouldRetry(tries, e): 2602 tries += 1 2603 self.parent.jitterSleep(tries) 2604 continue 2605 raise plumbing.convert_error_to_porcelain(e) from e 2606 break 2607 2608 resp = models.PeeringGroupPeerGetResponse() 2609 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2610 plumbing_response.meta) 2611 resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain( 2612 plumbing_response.peering_group_peer) 2613 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2614 plumbing_response.rate_limit) 2615 return resp 2616 2617 def list(self, filter, *args, timeout=None): 2618 ''' 2619 List gets a list of peering group links. 2620 ''' 2621 req = PeeringGroupPeerListRequest() 2622 req.meta.CopyFrom(ListRequestMetadata()) 2623 if self.parent.page_limit > 0: 2624 req.meta.limit = self.parent.page_limit 2625 if self.parent.snapshot_datetime is not None: 2626 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2627 2628 req.filter = plumbing.quote_filter_args(filter, *args) 2629 2630 def generator(svc, req): 2631 tries = 0 2632 while True: 2633 try: 2634 plumbing_response = svc.stub.List( 2635 req, 2636 metadata=svc.parent.get_metadata( 2637 'PeeringGroupPeers.List', req), 2638 timeout=timeout) 2639 except Exception as e: 2640 if self.parent.shouldRetry(tries, e): 2641 tries += 1 2642 self.parent.jitterSleep(tries) 2643 continue 2644 raise plumbing.convert_error_to_porcelain(e) from e 2645 tries = 0 2646 for plumbing_item in plumbing_response.peering_group_peers: 2647 yield plumbing.convert_peering_group_peer_to_porcelain( 2648 plumbing_item) 2649 if plumbing_response.meta.next_cursor == '': 2650 break 2651 req.meta.cursor = plumbing_response.meta.next_cursor 2652 2653 return generator(self, req) 2654 2655 2656class PeeringGroupResources: 2657 ''' 2658 PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group. 2659 See `strongdm.models.PeeringGroupResource`. 2660 ''' 2661 def __init__(self, channel, client): 2662 self.parent = client 2663 self.stub = PeeringGroupResourcesStub(channel) 2664 2665 def create(self, peering_group_resource, timeout=None): 2666 ''' 2667 Create attaches a Resource to a PeeringGroup 2668 ''' 2669 req = PeeringGroupResourceCreateRequest() 2670 2671 if peering_group_resource is not None: 2672 req.peering_group_resource.CopyFrom( 2673 plumbing.convert_peering_group_resource_to_plumbing( 2674 peering_group_resource)) 2675 tries = 0 2676 plumbing_response = None 2677 while True: 2678 try: 2679 plumbing_response = self.stub.Create( 2680 req, 2681 metadata=self.parent.get_metadata( 2682 'PeeringGroupResources.Create', req), 2683 timeout=timeout) 2684 except Exception as e: 2685 if self.parent.shouldRetry(tries, e): 2686 tries += 1 2687 self.parent.jitterSleep(tries) 2688 continue 2689 raise plumbing.convert_error_to_porcelain(e) from e 2690 break 2691 2692 resp = models.PeeringGroupResourceCreateResponse() 2693 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2694 plumbing_response.meta) 2695 resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain( 2696 plumbing_response.peering_group_resource) 2697 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2698 plumbing_response.rate_limit) 2699 return resp 2700 2701 def delete(self, id, timeout=None): 2702 ''' 2703 Delete detaches a Resource to a PeeringGroup 2704 ''' 2705 req = PeeringGroupResourceDeleteRequest() 2706 2707 req.id = (id) 2708 tries = 0 2709 plumbing_response = None 2710 while True: 2711 try: 2712 plumbing_response = self.stub.Delete( 2713 req, 2714 metadata=self.parent.get_metadata( 2715 'PeeringGroupResources.Delete', req), 2716 timeout=timeout) 2717 except Exception as e: 2718 if self.parent.shouldRetry(tries, e): 2719 tries += 1 2720 self.parent.jitterSleep(tries) 2721 continue 2722 raise plumbing.convert_error_to_porcelain(e) from e 2723 break 2724 2725 resp = models.PeeringGroupResourceDeleteResponse() 2726 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2727 plumbing_response.meta) 2728 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2729 plumbing_response.rate_limit) 2730 return resp 2731 2732 def get(self, id, timeout=None): 2733 ''' 2734 Get reads the information of one peering group to resource attachment. 2735 ''' 2736 req = PeeringGroupResourceGetRequest() 2737 if self.parent.snapshot_datetime is not None: 2738 req.meta.CopyFrom(GetRequestMetadata()) 2739 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2740 2741 req.id = (id) 2742 tries = 0 2743 plumbing_response = None 2744 while True: 2745 try: 2746 plumbing_response = self.stub.Get( 2747 req, 2748 metadata=self.parent.get_metadata( 2749 'PeeringGroupResources.Get', req), 2750 timeout=timeout) 2751 except Exception as e: 2752 if self.parent.shouldRetry(tries, e): 2753 tries += 1 2754 self.parent.jitterSleep(tries) 2755 continue 2756 raise plumbing.convert_error_to_porcelain(e) from e 2757 break 2758 2759 resp = models.PeeringGroupResourceGetResponse() 2760 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2761 plumbing_response.meta) 2762 resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain( 2763 plumbing_response.peering_group_resource) 2764 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2765 plumbing_response.rate_limit) 2766 return resp 2767 2768 def list(self, filter, *args, timeout=None): 2769 ''' 2770 List gets a list of peering group resource attachments. 2771 ''' 2772 req = PeeringGroupResourceListRequest() 2773 req.meta.CopyFrom(ListRequestMetadata()) 2774 if self.parent.page_limit > 0: 2775 req.meta.limit = self.parent.page_limit 2776 if self.parent.snapshot_datetime is not None: 2777 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2778 2779 req.filter = plumbing.quote_filter_args(filter, *args) 2780 2781 def generator(svc, req): 2782 tries = 0 2783 while True: 2784 try: 2785 plumbing_response = svc.stub.List( 2786 req, 2787 metadata=svc.parent.get_metadata( 2788 'PeeringGroupResources.List', req), 2789 timeout=timeout) 2790 except Exception as e: 2791 if self.parent.shouldRetry(tries, e): 2792 tries += 1 2793 self.parent.jitterSleep(tries) 2794 continue 2795 raise plumbing.convert_error_to_porcelain(e) from e 2796 tries = 0 2797 for plumbing_item in plumbing_response.peering_group_resources: 2798 yield plumbing.convert_peering_group_resource_to_porcelain( 2799 plumbing_item) 2800 if plumbing_response.meta.next_cursor == '': 2801 break 2802 req.meta.cursor = plumbing_response.meta.next_cursor 2803 2804 return generator(self, req) 2805 2806 2807class PeeringGroups: 2808 ''' 2809 PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing. 2810 See `strongdm.models.PeeringGroup`. 2811 ''' 2812 def __init__(self, channel, client): 2813 self.parent = client 2814 self.stub = PeeringGroupsStub(channel) 2815 2816 def create(self, peering_group, timeout=None): 2817 ''' 2818 Create registers a new PeeringGroup. 2819 ''' 2820 req = PeeringGroupCreateRequest() 2821 2822 if peering_group is not None: 2823 req.peering_group.CopyFrom( 2824 plumbing.convert_peering_group_to_plumbing(peering_group)) 2825 tries = 0 2826 plumbing_response = None 2827 while True: 2828 try: 2829 plumbing_response = self.stub.Create( 2830 req, 2831 metadata=self.parent.get_metadata('PeeringGroups.Create', 2832 req), 2833 timeout=timeout) 2834 except Exception as e: 2835 if self.parent.shouldRetry(tries, e): 2836 tries += 1 2837 self.parent.jitterSleep(tries) 2838 continue 2839 raise plumbing.convert_error_to_porcelain(e) from e 2840 break 2841 2842 resp = models.PeeringGroupCreateResponse() 2843 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2844 plumbing_response.meta) 2845 resp.peering_group = plumbing.convert_peering_group_to_porcelain( 2846 plumbing_response.peering_group) 2847 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2848 plumbing_response.rate_limit) 2849 return resp 2850 2851 def delete(self, id, timeout=None): 2852 ''' 2853 Delete removes a PeeringGroup by ID. 2854 ''' 2855 req = PeeringGroupDeleteRequest() 2856 2857 req.id = (id) 2858 tries = 0 2859 plumbing_response = None 2860 while True: 2861 try: 2862 plumbing_response = self.stub.Delete( 2863 req, 2864 metadata=self.parent.get_metadata('PeeringGroups.Delete', 2865 req), 2866 timeout=timeout) 2867 except Exception as e: 2868 if self.parent.shouldRetry(tries, e): 2869 tries += 1 2870 self.parent.jitterSleep(tries) 2871 continue 2872 raise plumbing.convert_error_to_porcelain(e) from e 2873 break 2874 2875 resp = models.PeeringGroupDeleteResponse() 2876 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2877 plumbing_response.meta) 2878 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2879 plumbing_response.rate_limit) 2880 return resp 2881 2882 def get(self, id, timeout=None): 2883 ''' 2884 Get reads one PeeringGroup by ID. It will load all its dependencies. 2885 ''' 2886 req = PeeringGroupGetRequest() 2887 if self.parent.snapshot_datetime is not None: 2888 req.meta.CopyFrom(GetRequestMetadata()) 2889 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2890 2891 req.id = (id) 2892 tries = 0 2893 plumbing_response = None 2894 while True: 2895 try: 2896 plumbing_response = self.stub.Get( 2897 req, 2898 metadata=self.parent.get_metadata('PeeringGroups.Get', 2899 req), 2900 timeout=timeout) 2901 except Exception as e: 2902 if self.parent.shouldRetry(tries, e): 2903 tries += 1 2904 self.parent.jitterSleep(tries) 2905 continue 2906 raise plumbing.convert_error_to_porcelain(e) from e 2907 break 2908 2909 resp = models.PeeringGroupGetResponse() 2910 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2911 plumbing_response.meta) 2912 resp.peering_group = plumbing.convert_peering_group_to_porcelain( 2913 plumbing_response.peering_group) 2914 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2915 plumbing_response.rate_limit) 2916 return resp 2917 2918 def list(self, filter, *args, timeout=None): 2919 ''' 2920 List gets a list of Peering Groups. 2921 ''' 2922 req = PeeringGroupListRequest() 2923 req.meta.CopyFrom(ListRequestMetadata()) 2924 if self.parent.page_limit > 0: 2925 req.meta.limit = self.parent.page_limit 2926 if self.parent.snapshot_datetime is not None: 2927 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2928 2929 req.filter = plumbing.quote_filter_args(filter, *args) 2930 2931 def generator(svc, req): 2932 tries = 0 2933 while True: 2934 try: 2935 plumbing_response = svc.stub.List( 2936 req, 2937 metadata=svc.parent.get_metadata( 2938 'PeeringGroups.List', req), 2939 timeout=timeout) 2940 except Exception as e: 2941 if self.parent.shouldRetry(tries, e): 2942 tries += 1 2943 self.parent.jitterSleep(tries) 2944 continue 2945 raise plumbing.convert_error_to_porcelain(e) from e 2946 tries = 0 2947 for plumbing_item in plumbing_response.peering_groups: 2948 yield plumbing.convert_peering_group_to_porcelain( 2949 plumbing_item) 2950 if plumbing_response.meta.next_cursor == '': 2951 break 2952 req.meta.cursor = plumbing_response.meta.next_cursor 2953 2954 return generator(self, req) 2955 2956 2957class Queries: 2958 ''' 2959 A Query is a record of a single client request to a resource, such as a SQL query. 2960 Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries. 2961 The Queries service is read-only. 2962 See `strongdm.models.Query`. 2963 ''' 2964 def __init__(self, channel, client): 2965 self.parent = client 2966 self.stub = QueriesStub(channel) 2967 2968 def list(self, filter, *args, timeout=None): 2969 ''' 2970 List gets a list of Queries matching a given set of criteria. 2971 ''' 2972 req = QueryListRequest() 2973 req.meta.CopyFrom(ListRequestMetadata()) 2974 if self.parent.page_limit > 0: 2975 req.meta.limit = self.parent.page_limit 2976 if self.parent.snapshot_datetime is not None: 2977 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2978 2979 req.filter = plumbing.quote_filter_args(filter, *args) 2980 2981 def generator(svc, req): 2982 tries = 0 2983 while True: 2984 try: 2985 plumbing_response = svc.stub.List( 2986 req, 2987 metadata=svc.parent.get_metadata('Queries.List', req), 2988 timeout=timeout) 2989 except Exception as e: 2990 if self.parent.shouldRetry(tries, e): 2991 tries += 1 2992 self.parent.jitterSleep(tries) 2993 continue 2994 raise plumbing.convert_error_to_porcelain(e) from e 2995 tries = 0 2996 for plumbing_item in plumbing_response.queries: 2997 yield plumbing.convert_query_to_porcelain(plumbing_item) 2998 if plumbing_response.meta.next_cursor == '': 2999 break 3000 req.meta.cursor = plumbing_response.meta.next_cursor 3001 3002 return generator(self, req) 3003 3004 3005class RemoteIdentities: 3006 ''' 3007 RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource. 3008 See `strongdm.models.RemoteIdentity`. 3009 ''' 3010 def __init__(self, channel, client): 3011 self.parent = client 3012 self.stub = RemoteIdentitiesStub(channel) 3013 3014 def create(self, remote_identity, timeout=None): 3015 ''' 3016 Create registers a new RemoteIdentity. 3017 ''' 3018 req = RemoteIdentityCreateRequest() 3019 3020 if remote_identity is not None: 3021 req.remote_identity.CopyFrom( 3022 plumbing.convert_remote_identity_to_plumbing(remote_identity)) 3023 tries = 0 3024 plumbing_response = None 3025 while True: 3026 try: 3027 plumbing_response = self.stub.Create( 3028 req, 3029 metadata=self.parent.get_metadata( 3030 'RemoteIdentities.Create', req), 3031 timeout=timeout) 3032 except Exception as e: 3033 if self.parent.shouldRetry(tries, e): 3034 tries += 1 3035 self.parent.jitterSleep(tries) 3036 continue 3037 raise plumbing.convert_error_to_porcelain(e) from e 3038 break 3039 3040 resp = models.RemoteIdentityCreateResponse() 3041 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 3042 plumbing_response.meta) 3043 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3044 plumbing_response.rate_limit) 3045 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3046 plumbing_response.remote_identity) 3047 return resp 3048 3049 def get(self, id, timeout=None): 3050 ''' 3051 Get reads one RemoteIdentity by ID. 3052 ''' 3053 req = RemoteIdentityGetRequest() 3054 if self.parent.snapshot_datetime is not None: 3055 req.meta.CopyFrom(GetRequestMetadata()) 3056 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3057 3058 req.id = (id) 3059 tries = 0 3060 plumbing_response = None 3061 while True: 3062 try: 3063 plumbing_response = self.stub.Get( 3064 req, 3065 metadata=self.parent.get_metadata('RemoteIdentities.Get', 3066 req), 3067 timeout=timeout) 3068 except Exception as e: 3069 if self.parent.shouldRetry(tries, e): 3070 tries += 1 3071 self.parent.jitterSleep(tries) 3072 continue 3073 raise plumbing.convert_error_to_porcelain(e) from e 3074 break 3075 3076 resp = models.RemoteIdentityGetResponse() 3077 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3078 plumbing_response.meta) 3079 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3080 plumbing_response.rate_limit) 3081 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3082 plumbing_response.remote_identity) 3083 return resp 3084 3085 def update(self, remote_identity, timeout=None): 3086 ''' 3087 Update replaces all the fields of a RemoteIdentity by ID. 3088 ''' 3089 req = RemoteIdentityUpdateRequest() 3090 3091 if remote_identity is not None: 3092 req.remote_identity.CopyFrom( 3093 plumbing.convert_remote_identity_to_plumbing(remote_identity)) 3094 tries = 0 3095 plumbing_response = None 3096 while True: 3097 try: 3098 plumbing_response = self.stub.Update( 3099 req, 3100 metadata=self.parent.get_metadata( 3101 'RemoteIdentities.Update', req), 3102 timeout=timeout) 3103 except Exception as e: 3104 if self.parent.shouldRetry(tries, e): 3105 tries += 1 3106 self.parent.jitterSleep(tries) 3107 continue 3108 raise plumbing.convert_error_to_porcelain(e) from e 3109 break 3110 3111 resp = models.RemoteIdentityUpdateResponse() 3112 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3113 plumbing_response.meta) 3114 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3115 plumbing_response.rate_limit) 3116 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3117 plumbing_response.remote_identity) 3118 return resp 3119 3120 def delete(self, id, timeout=None): 3121 ''' 3122 Delete removes a RemoteIdentity by ID. 3123 ''' 3124 req = RemoteIdentityDeleteRequest() 3125 3126 req.id = (id) 3127 tries = 0 3128 plumbing_response = None 3129 while True: 3130 try: 3131 plumbing_response = self.stub.Delete( 3132 req, 3133 metadata=self.parent.get_metadata( 3134 'RemoteIdentities.Delete', req), 3135 timeout=timeout) 3136 except Exception as e: 3137 if self.parent.shouldRetry(tries, e): 3138 tries += 1 3139 self.parent.jitterSleep(tries) 3140 continue 3141 raise plumbing.convert_error_to_porcelain(e) from e 3142 break 3143 3144 resp = models.RemoteIdentityDeleteResponse() 3145 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 3146 plumbing_response.meta) 3147 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3148 plumbing_response.rate_limit) 3149 return resp 3150 3151 def list(self, filter, *args, timeout=None): 3152 ''' 3153 List gets a list of RemoteIdentities matching a given set of criteria. 3154 ''' 3155 req = RemoteIdentityListRequest() 3156 req.meta.CopyFrom(ListRequestMetadata()) 3157 if self.parent.page_limit > 0: 3158 req.meta.limit = self.parent.page_limit 3159 if self.parent.snapshot_datetime is not None: 3160 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3161 3162 req.filter = plumbing.quote_filter_args(filter, *args) 3163 3164 def generator(svc, req): 3165 tries = 0 3166 while True: 3167 try: 3168 plumbing_response = svc.stub.List( 3169 req, 3170 metadata=svc.parent.get_metadata( 3171 'RemoteIdentities.List', req), 3172 timeout=timeout) 3173 except Exception as e: 3174 if self.parent.shouldRetry(tries, e): 3175 tries += 1 3176 self.parent.jitterSleep(tries) 3177 continue 3178 raise plumbing.convert_error_to_porcelain(e) from e 3179 tries = 0 3180 for plumbing_item in plumbing_response.remote_identities: 3181 yield plumbing.convert_remote_identity_to_porcelain( 3182 plumbing_item) 3183 if plumbing_response.meta.next_cursor == '': 3184 break 3185 req.meta.cursor = plumbing_response.meta.next_cursor 3186 3187 return generator(self, req) 3188 3189 3190class SnapshotRemoteIdentities: 3191 ''' 3192 SnapshotRemoteIdentities exposes the read only methods of the RemoteIdentities 3193 service for historical queries. 3194 ''' 3195 def __init__(self, remote_identities): 3196 self.remote_identities = remote_identities 3197 3198 def get(self, id, timeout=None): 3199 ''' 3200 Get reads one RemoteIdentity by ID. 3201 ''' 3202 return self.remote_identities.get(id, timeout=timeout) 3203 3204 def list(self, filter, *args, timeout=None): 3205 ''' 3206 List gets a list of RemoteIdentities matching a given set of criteria. 3207 ''' 3208 return self.remote_identities.list(filter, *args, timeout=timeout) 3209 3210 3211class RemoteIdentitiesHistory: 3212 ''' 3213 RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity. 3214 See `strongdm.models.RemoteIdentityHistory`. 3215 ''' 3216 def __init__(self, channel, client): 3217 self.parent = client 3218 self.stub = RemoteIdentitiesHistoryStub(channel) 3219 3220 def list(self, filter, *args, timeout=None): 3221 ''' 3222 List gets a list of RemoteIdentityHistory records matching a given set of criteria. 3223 ''' 3224 req = RemoteIdentityHistoryListRequest() 3225 req.meta.CopyFrom(ListRequestMetadata()) 3226 if self.parent.page_limit > 0: 3227 req.meta.limit = self.parent.page_limit 3228 if self.parent.snapshot_datetime is not None: 3229 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3230 3231 req.filter = plumbing.quote_filter_args(filter, *args) 3232 3233 def generator(svc, req): 3234 tries = 0 3235 while True: 3236 try: 3237 plumbing_response = svc.stub.List( 3238 req, 3239 metadata=svc.parent.get_metadata( 3240 'RemoteIdentitiesHistory.List', req), 3241 timeout=timeout) 3242 except Exception as e: 3243 if self.parent.shouldRetry(tries, e): 3244 tries += 1 3245 self.parent.jitterSleep(tries) 3246 continue 3247 raise plumbing.convert_error_to_porcelain(e) from e 3248 tries = 0 3249 for plumbing_item in plumbing_response.history: 3250 yield plumbing.convert_remote_identity_history_to_porcelain( 3251 plumbing_item) 3252 if plumbing_response.meta.next_cursor == '': 3253 break 3254 req.meta.cursor = plumbing_response.meta.next_cursor 3255 3256 return generator(self, req) 3257 3258 3259class RemoteIdentityGroups: 3260 ''' 3261 A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts. 3262 An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects. 3263 See `strongdm.models.RemoteIdentityGroup`. 3264 ''' 3265 def __init__(self, channel, client): 3266 self.parent = client 3267 self.stub = RemoteIdentityGroupsStub(channel) 3268 3269 def get(self, id, timeout=None): 3270 ''' 3271 Get reads one RemoteIdentityGroup by ID. 3272 ''' 3273 req = RemoteIdentityGroupGetRequest() 3274 if self.parent.snapshot_datetime is not None: 3275 req.meta.CopyFrom(GetRequestMetadata()) 3276 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3277 3278 req.id = (id) 3279 tries = 0 3280 plumbing_response = None 3281 while True: 3282 try: 3283 plumbing_response = self.stub.Get( 3284 req, 3285 metadata=self.parent.get_metadata( 3286 'RemoteIdentityGroups.Get', req), 3287 timeout=timeout) 3288 except Exception as e: 3289 if self.parent.shouldRetry(tries, e): 3290 tries += 1 3291 self.parent.jitterSleep(tries) 3292 continue 3293 raise plumbing.convert_error_to_porcelain(e) from e 3294 break 3295 3296 resp = models.RemoteIdentityGroupGetResponse() 3297 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3298 plumbing_response.meta) 3299 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3300 plumbing_response.rate_limit) 3301 resp.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain( 3302 plumbing_response.remote_identity_group) 3303 return resp 3304 3305 def list(self, filter, *args, timeout=None): 3306 ''' 3307 List gets a list of RemoteIdentityGroups matching a given set of criteria. 3308 ''' 3309 req = RemoteIdentityGroupListRequest() 3310 req.meta.CopyFrom(ListRequestMetadata()) 3311 if self.parent.page_limit > 0: 3312 req.meta.limit = self.parent.page_limit 3313 if self.parent.snapshot_datetime is not None: 3314 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3315 3316 req.filter = plumbing.quote_filter_args(filter, *args) 3317 3318 def generator(svc, req): 3319 tries = 0 3320 while True: 3321 try: 3322 plumbing_response = svc.stub.List( 3323 req, 3324 metadata=svc.parent.get_metadata( 3325 'RemoteIdentityGroups.List', req), 3326 timeout=timeout) 3327 except Exception as e: 3328 if self.parent.shouldRetry(tries, e): 3329 tries += 1 3330 self.parent.jitterSleep(tries) 3331 continue 3332 raise plumbing.convert_error_to_porcelain(e) from e 3333 tries = 0 3334 for plumbing_item in plumbing_response.remote_identity_groups: 3335 yield plumbing.convert_remote_identity_group_to_porcelain( 3336 plumbing_item) 3337 if plumbing_response.meta.next_cursor == '': 3338 break 3339 req.meta.cursor = plumbing_response.meta.next_cursor 3340 3341 return generator(self, req) 3342 3343 3344class SnapshotRemoteIdentityGroups: 3345 ''' 3346 SnapshotRemoteIdentityGroups exposes the read only methods of the RemoteIdentityGroups 3347 service for historical queries. 3348 ''' 3349 def __init__(self, remote_identity_groups): 3350 self.remote_identity_groups = remote_identity_groups 3351 3352 def get(self, id, timeout=None): 3353 ''' 3354 Get reads one RemoteIdentityGroup by ID. 3355 ''' 3356 return self.remote_identity_groups.get(id, timeout=timeout) 3357 3358 def list(self, filter, *args, timeout=None): 3359 ''' 3360 List gets a list of RemoteIdentityGroups matching a given set of criteria. 3361 ''' 3362 return self.remote_identity_groups.list(filter, *args, timeout=timeout) 3363 3364 3365class RemoteIdentityGroupsHistory: 3366 ''' 3367 RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup. 3368 See `strongdm.models.RemoteIdentityGroupHistory`. 3369 ''' 3370 def __init__(self, channel, client): 3371 self.parent = client 3372 self.stub = RemoteIdentityGroupsHistoryStub(channel) 3373 3374 def list(self, filter, *args, timeout=None): 3375 ''' 3376 List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria. 3377 ''' 3378 req = RemoteIdentityGroupHistoryListRequest() 3379 req.meta.CopyFrom(ListRequestMetadata()) 3380 if self.parent.page_limit > 0: 3381 req.meta.limit = self.parent.page_limit 3382 if self.parent.snapshot_datetime is not None: 3383 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3384 3385 req.filter = plumbing.quote_filter_args(filter, *args) 3386 3387 def generator(svc, req): 3388 tries = 0 3389 while True: 3390 try: 3391 plumbing_response = svc.stub.List( 3392 req, 3393 metadata=svc.parent.get_metadata( 3394 'RemoteIdentityGroupsHistory.List', req), 3395 timeout=timeout) 3396 except Exception as e: 3397 if self.parent.shouldRetry(tries, e): 3398 tries += 1 3399 self.parent.jitterSleep(tries) 3400 continue 3401 raise plumbing.convert_error_to_porcelain(e) from e 3402 tries = 0 3403 for plumbing_item in plumbing_response.history: 3404 yield plumbing.convert_remote_identity_group_history_to_porcelain( 3405 plumbing_item) 3406 if plumbing_response.meta.next_cursor == '': 3407 break 3408 req.meta.cursor = plumbing_response.meta.next_cursor 3409 3410 return generator(self, req) 3411 3412 3413class Replays: 3414 ''' 3415 A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session 3416 (otherwise referred to as a query). The Replays service is read-only. 3417 See `strongdm.models.ReplayChunk`. 3418 ''' 3419 def __init__(self, channel, client): 3420 self.parent = client 3421 self.stub = ReplaysStub(channel) 3422 3423 def list(self, filter, *args, timeout=None): 3424 ''' 3425 List gets a list of ReplayChunks for the Query ID specified by the filter criteria. 3426 ''' 3427 req = ReplayListRequest() 3428 req.meta.CopyFrom(ListRequestMetadata()) 3429 if self.parent.page_limit > 0: 3430 req.meta.limit = self.parent.page_limit 3431 if self.parent.snapshot_datetime is not None: 3432 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3433 3434 req.filter = plumbing.quote_filter_args(filter, *args) 3435 3436 def generator(svc, req): 3437 tries = 0 3438 while True: 3439 try: 3440 plumbing_response = svc.stub.List( 3441 req, 3442 metadata=svc.parent.get_metadata('Replays.List', req), 3443 timeout=timeout) 3444 except Exception as e: 3445 if self.parent.shouldRetry(tries, e): 3446 tries += 1 3447 self.parent.jitterSleep(tries) 3448 continue 3449 raise plumbing.convert_error_to_porcelain(e) from e 3450 tries = 0 3451 for plumbing_item in plumbing_response.chunks: 3452 yield plumbing.convert_replay_chunk_to_porcelain( 3453 plumbing_item) 3454 if plumbing_response.meta.next_cursor == '': 3455 break 3456 req.meta.cursor = plumbing_response.meta.next_cursor 3457 3458 return generator(self, req) 3459 3460 3461class Resources: 3462 ''' 3463 Resources are databases, servers, clusters, websites, or clouds that strongDM 3464 delegates access to. 3465 See: 3466 `strongdm.models.AKS` 3467 `strongdm.models.AKSBasicAuth` 3468 `strongdm.models.AKSServiceAccount` 3469 `strongdm.models.AKSServiceAccountUserImpersonation` 3470 `strongdm.models.AKSUserImpersonation` 3471 `strongdm.models.AmazonEKS` 3472 `strongdm.models.AmazonEKSInstanceProfile` 3473 `strongdm.models.AmazonEKSInstanceProfileUserImpersonation` 3474 `strongdm.models.AmazonEKSUserImpersonation` 3475 `strongdm.models.AmazonES` 3476 `strongdm.models.AmazonMQAMQP091` 3477 `strongdm.models.Athena` 3478 `strongdm.models.AuroraMysql` 3479 `strongdm.models.AuroraPostgres` 3480 `strongdm.models.AuroraPostgresIAM` 3481 `strongdm.models.AWS` 3482 `strongdm.models.AWSConsole` 3483 `strongdm.models.AWSConsoleStaticKeyPair` 3484 `strongdm.models.Azure` 3485 `strongdm.models.AzureCertificate` 3486 `strongdm.models.AzureMysql` 3487 `strongdm.models.AzurePostgres` 3488 `strongdm.models.AzurePostgresManagedIdentity` 3489 `strongdm.models.BigQuery` 3490 `strongdm.models.Cassandra` 3491 `strongdm.models.Citus` 3492 `strongdm.models.Clustrix` 3493 `strongdm.models.Cockroach` 3494 `strongdm.models.DB2I` 3495 `strongdm.models.DB2LUW` 3496 `strongdm.models.DocumentDBHost` 3497 `strongdm.models.DocumentDBReplicaSet` 3498 `strongdm.models.Druid` 3499 `strongdm.models.DynamoDB` 3500 `strongdm.models.Elastic` 3501 `strongdm.models.ElasticacheRedis` 3502 `strongdm.models.GCP` 3503 `strongdm.models.GoogleGKE` 3504 `strongdm.models.GoogleGKEUserImpersonation` 3505 `strongdm.models.Greenplum` 3506 `strongdm.models.HTTPAuth` 3507 `strongdm.models.HTTPBasicAuth` 3508 `strongdm.models.HTTPNoAuth` 3509 `strongdm.models.Kubernetes` 3510 `strongdm.models.KubernetesBasicAuth` 3511 `strongdm.models.KubernetesServiceAccount` 3512 `strongdm.models.KubernetesServiceAccountUserImpersonation` 3513 `strongdm.models.KubernetesUserImpersonation` 3514 `strongdm.models.Maria` 3515 `strongdm.models.Memcached` 3516 `strongdm.models.Memsql` 3517 `strongdm.models.MongoHost` 3518 `strongdm.models.MongoLegacyHost` 3519 `strongdm.models.MongoLegacyReplicaset` 3520 `strongdm.models.MongoReplicaSet` 3521 `strongdm.models.MongoShardedCluster` 3522 `strongdm.models.MTLSMysql` 3523 `strongdm.models.MTLSPostgres` 3524 `strongdm.models.Mysql` 3525 `strongdm.models.Neptune` 3526 `strongdm.models.NeptuneIAM` 3527 `strongdm.models.Oracle` 3528 `strongdm.models.Postgres` 3529 `strongdm.models.Presto` 3530 `strongdm.models.RabbitMQAMQP091` 3531 `strongdm.models.RawTCP` 3532 `strongdm.models.RDP` 3533 `strongdm.models.RDPCert` 3534 `strongdm.models.RDSPostgresIAM` 3535 `strongdm.models.Redis` 3536 `strongdm.models.Redshift` 3537 `strongdm.models.SingleStore` 3538 `strongdm.models.Snowflake` 3539 `strongdm.models.Snowsight` 3540 `strongdm.models.SQLServer` 3541 `strongdm.models.SQLServerAzureAD` 3542 `strongdm.models.SQLServerKerberosAD` 3543 `strongdm.models.SSH` 3544 `strongdm.models.SSHCert` 3545 `strongdm.models.SSHCustomerKey` 3546 `strongdm.models.Sybase` 3547 `strongdm.models.SybaseIQ` 3548 `strongdm.models.Teradata` 3549 `strongdm.models.Trino` 3550 ''' 3551 def __init__(self, channel, client): 3552 self.parent = client 3553 self.stub = ResourcesStub(channel) 3554 3555 def enumerate_tags(self, filter, *args, timeout=None): 3556 ''' 3557 EnumerateTags gets a list of the filter matching tags. 3558 ''' 3559 req = EnumerateTagsRequest() 3560 req.meta.CopyFrom(ListRequestMetadata()) 3561 if self.parent.page_limit > 0: 3562 req.meta.limit = self.parent.page_limit 3563 if self.parent.snapshot_datetime is not None: 3564 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3565 3566 req.filter = plumbing.quote_filter_args(filter, *args) 3567 3568 def generator(svc, req): 3569 tries = 0 3570 while True: 3571 try: 3572 plumbing_response = svc.stub.EnumerateTags( 3573 req, 3574 metadata=svc.parent.get_metadata( 3575 'Resources.EnumerateTags', req), 3576 timeout=timeout) 3577 except Exception as e: 3578 if self.parent.shouldRetry(tries, e): 3579 tries += 1 3580 self.parent.jitterSleep(tries) 3581 continue 3582 raise plumbing.convert_error_to_porcelain(e) from e 3583 tries = 0 3584 for plumbing_item in plumbing_response.matches: 3585 yield plumbing.convert_tag_to_porcelain(plumbing_item) 3586 if plumbing_response.meta.next_cursor == '': 3587 break 3588 req.meta.cursor = plumbing_response.meta.next_cursor 3589 3590 return generator(self, req) 3591 3592 def create(self, resource, timeout=None): 3593 ''' 3594 Create registers a new Resource. 3595 ''' 3596 req = ResourceCreateRequest() 3597 3598 if resource is not None: 3599 req.resource.CopyFrom( 3600 plumbing.convert_resource_to_plumbing(resource)) 3601 tries = 0 3602 plumbing_response = None 3603 while True: 3604 try: 3605 plumbing_response = self.stub.Create( 3606 req, 3607 metadata=self.parent.get_metadata('Resources.Create', req), 3608 timeout=timeout) 3609 except Exception as e: 3610 if self.parent.shouldRetry(tries, e): 3611 tries += 1 3612 self.parent.jitterSleep(tries) 3613 continue 3614 raise plumbing.convert_error_to_porcelain(e) from e 3615 break 3616 3617 resp = models.ResourceCreateResponse() 3618 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 3619 plumbing_response.meta) 3620 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3621 plumbing_response.rate_limit) 3622 resp.resource = plumbing.convert_resource_to_porcelain( 3623 plumbing_response.resource) 3624 return resp 3625 3626 def get(self, id, timeout=None): 3627 ''' 3628 Get reads one Resource by ID. 3629 ''' 3630 req = ResourceGetRequest() 3631 if self.parent.snapshot_datetime is not None: 3632 req.meta.CopyFrom(GetRequestMetadata()) 3633 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3634 3635 req.id = (id) 3636 tries = 0 3637 plumbing_response = None 3638 while True: 3639 try: 3640 plumbing_response = self.stub.Get( 3641 req, 3642 metadata=self.parent.get_metadata('Resources.Get', req), 3643 timeout=timeout) 3644 except Exception as e: 3645 if self.parent.shouldRetry(tries, e): 3646 tries += 1 3647 self.parent.jitterSleep(tries) 3648 continue 3649 raise plumbing.convert_error_to_porcelain(e) from e 3650 break 3651 3652 resp = models.ResourceGetResponse() 3653 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3654 plumbing_response.meta) 3655 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3656 plumbing_response.rate_limit) 3657 resp.resource = plumbing.convert_resource_to_porcelain( 3658 plumbing_response.resource) 3659 return resp 3660 3661 def update(self, resource, timeout=None): 3662 ''' 3663 Update replaces all the fields of a Resource by ID. 3664 ''' 3665 req = ResourceUpdateRequest() 3666 3667 if resource is not None: 3668 req.resource.CopyFrom( 3669 plumbing.convert_resource_to_plumbing(resource)) 3670 tries = 0 3671 plumbing_response = None 3672 while True: 3673 try: 3674 plumbing_response = self.stub.Update( 3675 req, 3676 metadata=self.parent.get_metadata('Resources.Update', req), 3677 timeout=timeout) 3678 except Exception as e: 3679 if self.parent.shouldRetry(tries, e): 3680 tries += 1 3681 self.parent.jitterSleep(tries) 3682 continue 3683 raise plumbing.convert_error_to_porcelain(e) from e 3684 break 3685 3686 resp = models.ResourceUpdateResponse() 3687 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3688 plumbing_response.meta) 3689 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3690 plumbing_response.rate_limit) 3691 resp.resource = plumbing.convert_resource_to_porcelain( 3692 plumbing_response.resource) 3693 return resp 3694 3695 def delete(self, id, timeout=None): 3696 ''' 3697 Delete removes a Resource by ID. 3698 ''' 3699 req = ResourceDeleteRequest() 3700 3701 req.id = (id) 3702 tries = 0 3703 plumbing_response = None 3704 while True: 3705 try: 3706 plumbing_response = self.stub.Delete( 3707 req, 3708 metadata=self.parent.get_metadata('Resources.Delete', req), 3709 timeout=timeout) 3710 except Exception as e: 3711 if self.parent.shouldRetry(tries, e): 3712 tries += 1 3713 self.parent.jitterSleep(tries) 3714 continue 3715 raise plumbing.convert_error_to_porcelain(e) from e 3716 break 3717 3718 resp = models.ResourceDeleteResponse() 3719 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 3720 plumbing_response.meta) 3721 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3722 plumbing_response.rate_limit) 3723 return resp 3724 3725 def list(self, filter, *args, timeout=None): 3726 ''' 3727 List gets a list of Resources matching a given set of criteria. 3728 ''' 3729 req = ResourceListRequest() 3730 req.meta.CopyFrom(ListRequestMetadata()) 3731 if self.parent.page_limit > 0: 3732 req.meta.limit = self.parent.page_limit 3733 if self.parent.snapshot_datetime is not None: 3734 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3735 3736 req.filter = plumbing.quote_filter_args(filter, *args) 3737 3738 def generator(svc, req): 3739 tries = 0 3740 while True: 3741 try: 3742 plumbing_response = svc.stub.List( 3743 req, 3744 metadata=svc.parent.get_metadata( 3745 'Resources.List', req), 3746 timeout=timeout) 3747 except Exception as e: 3748 if self.parent.shouldRetry(tries, e): 3749 tries += 1 3750 self.parent.jitterSleep(tries) 3751 continue 3752 raise plumbing.convert_error_to_porcelain(e) from e 3753 tries = 0 3754 for plumbing_item in plumbing_response.resources: 3755 yield plumbing.convert_resource_to_porcelain(plumbing_item) 3756 if plumbing_response.meta.next_cursor == '': 3757 break 3758 req.meta.cursor = plumbing_response.meta.next_cursor 3759 3760 return generator(self, req) 3761 3762 def healthcheck(self, id, timeout=None): 3763 ''' 3764 Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a 3765 large network of Nodes. The call will return immediately, and the updated health of the 3766 Resource can be retrieved via Get or List. 3767 ''' 3768 req = ResourceHealthcheckRequest() 3769 3770 req.id = (id) 3771 tries = 0 3772 plumbing_response = None 3773 while True: 3774 try: 3775 plumbing_response = self.stub.Healthcheck( 3776 req, 3777 metadata=self.parent.get_metadata('Resources.Healthcheck', 3778 req), 3779 timeout=timeout) 3780 except Exception as e: 3781 if self.parent.shouldRetry(tries, e): 3782 tries += 1 3783 self.parent.jitterSleep(tries) 3784 continue 3785 raise plumbing.convert_error_to_porcelain(e) from e 3786 break 3787 3788 resp = models.ResourceHealthcheckResponse() 3789 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3790 plumbing_response.meta) 3791 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3792 plumbing_response.rate_limit) 3793 return resp 3794 3795 3796class SnapshotResources: 3797 ''' 3798 SnapshotResources exposes the read only methods of the Resources 3799 service for historical queries. 3800 ''' 3801 def __init__(self, resources): 3802 self.resources = resources 3803 3804 def get(self, id, timeout=None): 3805 ''' 3806 Get reads one Resource by ID. 3807 ''' 3808 return self.resources.get(id, timeout=timeout) 3809 3810 def list(self, filter, *args, timeout=None): 3811 ''' 3812 List gets a list of Resources matching a given set of criteria. 3813 ''' 3814 return self.resources.list(filter, *args, timeout=timeout) 3815 3816 3817class ResourcesHistory: 3818 ''' 3819 ResourcesHistory records all changes to the state of a Resource. 3820 See `strongdm.models.ResourceHistory`. 3821 ''' 3822 def __init__(self, channel, client): 3823 self.parent = client 3824 self.stub = ResourcesHistoryStub(channel) 3825 3826 def list(self, filter, *args, timeout=None): 3827 ''' 3828 List gets a list of ResourceHistory records matching a given set of criteria. 3829 ''' 3830 req = ResourceHistoryListRequest() 3831 req.meta.CopyFrom(ListRequestMetadata()) 3832 if self.parent.page_limit > 0: 3833 req.meta.limit = self.parent.page_limit 3834 if self.parent.snapshot_datetime is not None: 3835 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3836 3837 req.filter = plumbing.quote_filter_args(filter, *args) 3838 3839 def generator(svc, req): 3840 tries = 0 3841 while True: 3842 try: 3843 plumbing_response = svc.stub.List( 3844 req, 3845 metadata=svc.parent.get_metadata( 3846 'ResourcesHistory.List', req), 3847 timeout=timeout) 3848 except Exception as e: 3849 if self.parent.shouldRetry(tries, e): 3850 tries += 1 3851 self.parent.jitterSleep(tries) 3852 continue 3853 raise plumbing.convert_error_to_porcelain(e) from e 3854 tries = 0 3855 for plumbing_item in plumbing_response.history: 3856 yield plumbing.convert_resource_history_to_porcelain( 3857 plumbing_item) 3858 if plumbing_response.meta.next_cursor == '': 3859 break 3860 req.meta.cursor = plumbing_response.meta.next_cursor 3861 3862 return generator(self, req) 3863 3864 3865class RoleResources: 3866 ''' 3867 RoleResources enumerates the resources to which roles have access. 3868 The RoleResources service is read-only. 3869 See `strongdm.models.RoleResource`. 3870 ''' 3871 def __init__(self, channel, client): 3872 self.parent = client 3873 self.stub = RoleResourcesStub(channel) 3874 3875 def list(self, filter, *args, timeout=None): 3876 ''' 3877 List gets a list of RoleResource records matching a given set of criteria. 3878 ''' 3879 req = RoleResourceListRequest() 3880 req.meta.CopyFrom(ListRequestMetadata()) 3881 if self.parent.page_limit > 0: 3882 req.meta.limit = self.parent.page_limit 3883 if self.parent.snapshot_datetime is not None: 3884 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3885 3886 req.filter = plumbing.quote_filter_args(filter, *args) 3887 3888 def generator(svc, req): 3889 tries = 0 3890 while True: 3891 try: 3892 plumbing_response = svc.stub.List( 3893 req, 3894 metadata=svc.parent.get_metadata( 3895 'RoleResources.List', req), 3896 timeout=timeout) 3897 except Exception as e: 3898 if self.parent.shouldRetry(tries, e): 3899 tries += 1 3900 self.parent.jitterSleep(tries) 3901 continue 3902 raise plumbing.convert_error_to_porcelain(e) from e 3903 tries = 0 3904 for plumbing_item in plumbing_response.role_resources: 3905 yield plumbing.convert_role_resource_to_porcelain( 3906 plumbing_item) 3907 if plumbing_response.meta.next_cursor == '': 3908 break 3909 req.meta.cursor = plumbing_response.meta.next_cursor 3910 3911 return generator(self, req) 3912 3913 3914class SnapshotRoleResources: 3915 ''' 3916 SnapshotRoleResources exposes the read only methods of the RoleResources 3917 service for historical queries. 3918 ''' 3919 def __init__(self, role_resources): 3920 self.role_resources = role_resources 3921 3922 def list(self, filter, *args, timeout=None): 3923 ''' 3924 List gets a list of RoleResource records matching a given set of criteria. 3925 ''' 3926 return self.role_resources.list(filter, *args, timeout=timeout) 3927 3928 3929class RoleResourcesHistory: 3930 ''' 3931 RoleResourcesHistory records all changes to the state of a RoleResource. 3932 See `strongdm.models.RoleResourceHistory`. 3933 ''' 3934 def __init__(self, channel, client): 3935 self.parent = client 3936 self.stub = RoleResourcesHistoryStub(channel) 3937 3938 def list(self, filter, *args, timeout=None): 3939 ''' 3940 List gets a list of RoleResourceHistory records matching a given set of criteria. 3941 ''' 3942 req = RoleResourceHistoryListRequest() 3943 req.meta.CopyFrom(ListRequestMetadata()) 3944 if self.parent.page_limit > 0: 3945 req.meta.limit = self.parent.page_limit 3946 if self.parent.snapshot_datetime is not None: 3947 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3948 3949 req.filter = plumbing.quote_filter_args(filter, *args) 3950 3951 def generator(svc, req): 3952 tries = 0 3953 while True: 3954 try: 3955 plumbing_response = svc.stub.List( 3956 req, 3957 metadata=svc.parent.get_metadata( 3958 'RoleResourcesHistory.List', req), 3959 timeout=timeout) 3960 except Exception as e: 3961 if self.parent.shouldRetry(tries, e): 3962 tries += 1 3963 self.parent.jitterSleep(tries) 3964 continue 3965 raise plumbing.convert_error_to_porcelain(e) from e 3966 tries = 0 3967 for plumbing_item in plumbing_response.history: 3968 yield plumbing.convert_role_resource_history_to_porcelain( 3969 plumbing_item) 3970 if plumbing_response.meta.next_cursor == '': 3971 break 3972 req.meta.cursor = plumbing_response.meta.next_cursor 3973 3974 return generator(self, req) 3975 3976 3977class Roles: 3978 ''' 3979 A Role has a list of access rules which determine which Resources the members 3980 of the Role have access to. An Account can be a member of multiple Roles via 3981 AccountAttachments. 3982 See `strongdm.models.Role`. 3983 ''' 3984 def __init__(self, channel, client): 3985 self.parent = client 3986 self.stub = RolesStub(channel) 3987 3988 def create(self, role, timeout=None): 3989 ''' 3990 Create registers a new Role. 3991 ''' 3992 req = RoleCreateRequest() 3993 3994 if role is not None: 3995 req.role.CopyFrom(plumbing.convert_role_to_plumbing(role)) 3996 tries = 0 3997 plumbing_response = None 3998 while True: 3999 try: 4000 plumbing_response = self.stub.Create( 4001 req, 4002 metadata=self.parent.get_metadata('Roles.Create', req), 4003 timeout=timeout) 4004 except Exception as e: 4005 if self.parent.shouldRetry(tries, e): 4006 tries += 1 4007 self.parent.jitterSleep(tries) 4008 continue 4009 raise plumbing.convert_error_to_porcelain(e) from e 4010 break 4011 4012 resp = models.RoleCreateResponse() 4013 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 4014 plumbing_response.meta) 4015 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4016 plumbing_response.rate_limit) 4017 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4018 return resp 4019 4020 def get(self, id, timeout=None): 4021 ''' 4022 Get reads one Role by ID. 4023 ''' 4024 req = RoleGetRequest() 4025 if self.parent.snapshot_datetime is not None: 4026 req.meta.CopyFrom(GetRequestMetadata()) 4027 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4028 4029 req.id = (id) 4030 tries = 0 4031 plumbing_response = None 4032 while True: 4033 try: 4034 plumbing_response = self.stub.Get( 4035 req, 4036 metadata=self.parent.get_metadata('Roles.Get', req), 4037 timeout=timeout) 4038 except Exception as e: 4039 if self.parent.shouldRetry(tries, e): 4040 tries += 1 4041 self.parent.jitterSleep(tries) 4042 continue 4043 raise plumbing.convert_error_to_porcelain(e) from e 4044 break 4045 4046 resp = models.RoleGetResponse() 4047 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4048 plumbing_response.meta) 4049 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4050 plumbing_response.rate_limit) 4051 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4052 return resp 4053 4054 def update(self, role, timeout=None): 4055 ''' 4056 Update replaces all the fields of a Role by ID. 4057 ''' 4058 req = RoleUpdateRequest() 4059 4060 if role is not None: 4061 req.role.CopyFrom(plumbing.convert_role_to_plumbing(role)) 4062 tries = 0 4063 plumbing_response = None 4064 while True: 4065 try: 4066 plumbing_response = self.stub.Update( 4067 req, 4068 metadata=self.parent.get_metadata('Roles.Update', req), 4069 timeout=timeout) 4070 except Exception as e: 4071 if self.parent.shouldRetry(tries, e): 4072 tries += 1 4073 self.parent.jitterSleep(tries) 4074 continue 4075 raise plumbing.convert_error_to_porcelain(e) from e 4076 break 4077 4078 resp = models.RoleUpdateResponse() 4079 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 4080 plumbing_response.meta) 4081 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4082 plumbing_response.rate_limit) 4083 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4084 return resp 4085 4086 def delete(self, id, timeout=None): 4087 ''' 4088 Delete removes a Role by ID. 4089 ''' 4090 req = RoleDeleteRequest() 4091 4092 req.id = (id) 4093 tries = 0 4094 plumbing_response = None 4095 while True: 4096 try: 4097 plumbing_response = self.stub.Delete( 4098 req, 4099 metadata=self.parent.get_metadata('Roles.Delete', req), 4100 timeout=timeout) 4101 except Exception as e: 4102 if self.parent.shouldRetry(tries, e): 4103 tries += 1 4104 self.parent.jitterSleep(tries) 4105 continue 4106 raise plumbing.convert_error_to_porcelain(e) from e 4107 break 4108 4109 resp = models.RoleDeleteResponse() 4110 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 4111 plumbing_response.meta) 4112 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4113 plumbing_response.rate_limit) 4114 return resp 4115 4116 def list(self, filter, *args, timeout=None): 4117 ''' 4118 List gets a list of Roles matching a given set of criteria. 4119 ''' 4120 req = RoleListRequest() 4121 req.meta.CopyFrom(ListRequestMetadata()) 4122 if self.parent.page_limit > 0: 4123 req.meta.limit = self.parent.page_limit 4124 if self.parent.snapshot_datetime is not None: 4125 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4126 4127 req.filter = plumbing.quote_filter_args(filter, *args) 4128 4129 def generator(svc, req): 4130 tries = 0 4131 while True: 4132 try: 4133 plumbing_response = svc.stub.List( 4134 req, 4135 metadata=svc.parent.get_metadata('Roles.List', req), 4136 timeout=timeout) 4137 except Exception as e: 4138 if self.parent.shouldRetry(tries, e): 4139 tries += 1 4140 self.parent.jitterSleep(tries) 4141 continue 4142 raise plumbing.convert_error_to_porcelain(e) from e 4143 tries = 0 4144 for plumbing_item in plumbing_response.roles: 4145 yield plumbing.convert_role_to_porcelain(plumbing_item) 4146 if plumbing_response.meta.next_cursor == '': 4147 break 4148 req.meta.cursor = plumbing_response.meta.next_cursor 4149 4150 return generator(self, req) 4151 4152 4153class SnapshotRoles: 4154 ''' 4155 SnapshotRoles exposes the read only methods of the Roles 4156 service for historical queries. 4157 ''' 4158 def __init__(self, roles): 4159 self.roles = roles 4160 4161 def get(self, id, timeout=None): 4162 ''' 4163 Get reads one Role by ID. 4164 ''' 4165 return self.roles.get(id, timeout=timeout) 4166 4167 def list(self, filter, *args, timeout=None): 4168 ''' 4169 List gets a list of Roles matching a given set of criteria. 4170 ''' 4171 return self.roles.list(filter, *args, timeout=timeout) 4172 4173 4174class RolesHistory: 4175 ''' 4176 RolesHistory records all changes to the state of a Role. 4177 See `strongdm.models.RoleHistory`. 4178 ''' 4179 def __init__(self, channel, client): 4180 self.parent = client 4181 self.stub = RolesHistoryStub(channel) 4182 4183 def list(self, filter, *args, timeout=None): 4184 ''' 4185 List gets a list of RoleHistory records matching a given set of criteria. 4186 ''' 4187 req = RoleHistoryListRequest() 4188 req.meta.CopyFrom(ListRequestMetadata()) 4189 if self.parent.page_limit > 0: 4190 req.meta.limit = self.parent.page_limit 4191 if self.parent.snapshot_datetime is not None: 4192 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4193 4194 req.filter = plumbing.quote_filter_args(filter, *args) 4195 4196 def generator(svc, req): 4197 tries = 0 4198 while True: 4199 try: 4200 plumbing_response = svc.stub.List( 4201 req, 4202 metadata=svc.parent.get_metadata( 4203 'RolesHistory.List', req), 4204 timeout=timeout) 4205 except Exception as e: 4206 if self.parent.shouldRetry(tries, e): 4207 tries += 1 4208 self.parent.jitterSleep(tries) 4209 continue 4210 raise plumbing.convert_error_to_porcelain(e) from e 4211 tries = 0 4212 for plumbing_item in plumbing_response.history: 4213 yield plumbing.convert_role_history_to_porcelain( 4214 plumbing_item) 4215 if plumbing_response.meta.next_cursor == '': 4216 break 4217 req.meta.cursor = plumbing_response.meta.next_cursor 4218 4219 return generator(self, req) 4220 4221 4222class SecretStoreHealths: 4223 ''' 4224 SecretStoreHealths exposes health states for secret stores. 4225 See `strongdm.models.SecretStoreHealth`. 4226 ''' 4227 def __init__(self, channel, client): 4228 self.parent = client 4229 self.stub = SecretStoreHealthsStub(channel) 4230 4231 def list(self, filter, *args, timeout=None): 4232 ''' 4233 List reports the health status of node to secret store pairs. 4234 ''' 4235 req = SecretStoreHealthListRequest() 4236 req.meta.CopyFrom(ListRequestMetadata()) 4237 if self.parent.page_limit > 0: 4238 req.meta.limit = self.parent.page_limit 4239 if self.parent.snapshot_datetime is not None: 4240 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4241 4242 req.filter = plumbing.quote_filter_args(filter, *args) 4243 4244 def generator(svc, req): 4245 tries = 0 4246 while True: 4247 try: 4248 plumbing_response = svc.stub.List( 4249 req, 4250 metadata=svc.parent.get_metadata( 4251 'SecretStoreHealths.List', req), 4252 timeout=timeout) 4253 except Exception as e: 4254 if self.parent.shouldRetry(tries, e): 4255 tries += 1 4256 self.parent.jitterSleep(tries) 4257 continue 4258 raise plumbing.convert_error_to_porcelain(e) from e 4259 tries = 0 4260 for plumbing_item in plumbing_response.secret_store_healths: 4261 yield plumbing.convert_secret_store_health_to_porcelain( 4262 plumbing_item) 4263 if plumbing_response.meta.next_cursor == '': 4264 break 4265 req.meta.cursor = plumbing_response.meta.next_cursor 4266 4267 return generator(self, req) 4268 4269 def healthcheck(self, secret_store_id, timeout=None): 4270 ''' 4271 Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes 4272 to propagate across a large network of Nodes. The call will return immediately, and the 4273 updated health of the Secret Store can be retrieved via List. 4274 ''' 4275 req = SecretStoreHealthcheckRequest() 4276 4277 req.secret_store_id = (secret_store_id) 4278 tries = 0 4279 plumbing_response = None 4280 while True: 4281 try: 4282 plumbing_response = self.stub.Healthcheck( 4283 req, 4284 metadata=self.parent.get_metadata( 4285 'SecretStoreHealths.Healthcheck', req), 4286 timeout=timeout) 4287 except Exception as e: 4288 if self.parent.shouldRetry(tries, e): 4289 tries += 1 4290 self.parent.jitterSleep(tries) 4291 continue 4292 raise plumbing.convert_error_to_porcelain(e) from e 4293 break 4294 4295 resp = models.SecretStoreHealthcheckResponse() 4296 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4297 plumbing_response.rate_limit) 4298 return resp 4299 4300 4301class SecretStores: 4302 ''' 4303 SecretStores are servers where resource secrets (passwords, keys) are stored. 4304 See: 4305 `strongdm.models.ActiveDirectoryStore` 4306 `strongdm.models.AWSStore` 4307 `strongdm.models.AWSCertX509Store` 4308 `strongdm.models.AzureStore` 4309 `strongdm.models.CyberarkConjurStore` 4310 `strongdm.models.CyberarkPAMStore` 4311 `strongdm.models.CyberarkPAMExperimentalStore` 4312 `strongdm.models.DelineaStore` 4313 `strongdm.models.GCPStore` 4314 `strongdm.models.GCPCertX509Store` 4315 `strongdm.models.KeyfactorX509Store` 4316 `strongdm.models.VaultAppRoleStore` 4317 `strongdm.models.VaultAppRoleCertSSHStore` 4318 `strongdm.models.VaultAppRoleCertX509Store` 4319 `strongdm.models.VaultTLSStore` 4320 `strongdm.models.VaultTLSCertSSHStore` 4321 `strongdm.models.VaultTLSCertX509Store` 4322 `strongdm.models.VaultTokenStore` 4323 `strongdm.models.VaultTokenCertSSHStore` 4324 `strongdm.models.VaultTokenCertX509Store` 4325 ''' 4326 def __init__(self, channel, client): 4327 self.parent = client 4328 self.stub = SecretStoresStub(channel) 4329 4330 def create(self, secret_store, timeout=None): 4331 req = SecretStoreCreateRequest() 4332 4333 if secret_store is not None: 4334 req.secret_store.CopyFrom( 4335 plumbing.convert_secret_store_to_plumbing(secret_store)) 4336 tries = 0 4337 plumbing_response = None 4338 while True: 4339 try: 4340 plumbing_response = self.stub.Create( 4341 req, 4342 metadata=self.parent.get_metadata('SecretStores.Create', 4343 req), 4344 timeout=timeout) 4345 except Exception as e: 4346 if self.parent.shouldRetry(tries, e): 4347 tries += 1 4348 self.parent.jitterSleep(tries) 4349 continue 4350 raise plumbing.convert_error_to_porcelain(e) from e 4351 break 4352 4353 resp = models.SecretStoreCreateResponse() 4354 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 4355 plumbing_response.meta) 4356 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4357 plumbing_response.rate_limit) 4358 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4359 plumbing_response.secret_store) 4360 return resp 4361 4362 def get(self, id, timeout=None): 4363 ''' 4364 Get reads one SecretStore by ID. 4365 ''' 4366 req = SecretStoreGetRequest() 4367 if self.parent.snapshot_datetime is not None: 4368 req.meta.CopyFrom(GetRequestMetadata()) 4369 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4370 4371 req.id = (id) 4372 tries = 0 4373 plumbing_response = None 4374 while True: 4375 try: 4376 plumbing_response = self.stub.Get( 4377 req, 4378 metadata=self.parent.get_metadata('SecretStores.Get', req), 4379 timeout=timeout) 4380 except Exception as e: 4381 if self.parent.shouldRetry(tries, e): 4382 tries += 1 4383 self.parent.jitterSleep(tries) 4384 continue 4385 raise plumbing.convert_error_to_porcelain(e) from e 4386 break 4387 4388 resp = models.SecretStoreGetResponse() 4389 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4390 plumbing_response.meta) 4391 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4392 plumbing_response.rate_limit) 4393 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4394 plumbing_response.secret_store) 4395 return resp 4396 4397 def update(self, secret_store, timeout=None): 4398 ''' 4399 Update replaces all the fields of a SecretStore by ID. 4400 ''' 4401 req = SecretStoreUpdateRequest() 4402 4403 if secret_store is not None: 4404 req.secret_store.CopyFrom( 4405 plumbing.convert_secret_store_to_plumbing(secret_store)) 4406 tries = 0 4407 plumbing_response = None 4408 while True: 4409 try: 4410 plumbing_response = self.stub.Update( 4411 req, 4412 metadata=self.parent.get_metadata('SecretStores.Update', 4413 req), 4414 timeout=timeout) 4415 except Exception as e: 4416 if self.parent.shouldRetry(tries, e): 4417 tries += 1 4418 self.parent.jitterSleep(tries) 4419 continue 4420 raise plumbing.convert_error_to_porcelain(e) from e 4421 break 4422 4423 resp = models.SecretStoreUpdateResponse() 4424 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 4425 plumbing_response.meta) 4426 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4427 plumbing_response.rate_limit) 4428 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4429 plumbing_response.secret_store) 4430 return resp 4431 4432 def delete(self, id, timeout=None): 4433 ''' 4434 Delete removes a SecretStore by ID. 4435 ''' 4436 req = SecretStoreDeleteRequest() 4437 4438 req.id = (id) 4439 tries = 0 4440 plumbing_response = None 4441 while True: 4442 try: 4443 plumbing_response = self.stub.Delete( 4444 req, 4445 metadata=self.parent.get_metadata('SecretStores.Delete', 4446 req), 4447 timeout=timeout) 4448 except Exception as e: 4449 if self.parent.shouldRetry(tries, e): 4450 tries += 1 4451 self.parent.jitterSleep(tries) 4452 continue 4453 raise plumbing.convert_error_to_porcelain(e) from e 4454 break 4455 4456 resp = models.SecretStoreDeleteResponse() 4457 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 4458 plumbing_response.meta) 4459 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4460 plumbing_response.rate_limit) 4461 return resp 4462 4463 def list(self, filter, *args, timeout=None): 4464 ''' 4465 List gets a list of SecretStores matching a given set of criteria. 4466 ''' 4467 req = SecretStoreListRequest() 4468 req.meta.CopyFrom(ListRequestMetadata()) 4469 if self.parent.page_limit > 0: 4470 req.meta.limit = self.parent.page_limit 4471 if self.parent.snapshot_datetime is not None: 4472 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4473 4474 req.filter = plumbing.quote_filter_args(filter, *args) 4475 4476 def generator(svc, req): 4477 tries = 0 4478 while True: 4479 try: 4480 plumbing_response = svc.stub.List( 4481 req, 4482 metadata=svc.parent.get_metadata( 4483 'SecretStores.List', req), 4484 timeout=timeout) 4485 except Exception as e: 4486 if self.parent.shouldRetry(tries, e): 4487 tries += 1 4488 self.parent.jitterSleep(tries) 4489 continue 4490 raise plumbing.convert_error_to_porcelain(e) from e 4491 tries = 0 4492 for plumbing_item in plumbing_response.secret_stores: 4493 yield plumbing.convert_secret_store_to_porcelain( 4494 plumbing_item) 4495 if plumbing_response.meta.next_cursor == '': 4496 break 4497 req.meta.cursor = plumbing_response.meta.next_cursor 4498 4499 return generator(self, req) 4500 4501 4502class SnapshotSecretStores: 4503 ''' 4504 SnapshotSecretStores exposes the read only methods of the SecretStores 4505 service for historical queries. 4506 ''' 4507 def __init__(self, secret_stores): 4508 self.secret_stores = secret_stores 4509 4510 def get(self, id, timeout=None): 4511 ''' 4512 Get reads one SecretStore by ID. 4513 ''' 4514 return self.secret_stores.get(id, timeout=timeout) 4515 4516 def list(self, filter, *args, timeout=None): 4517 ''' 4518 List gets a list of SecretStores matching a given set of criteria. 4519 ''' 4520 return self.secret_stores.list(filter, *args, timeout=timeout) 4521 4522 4523class SecretStoresHistory: 4524 ''' 4525 SecretStoresHistory records all changes to the state of a SecretStore. 4526 See `strongdm.models.SecretStoreHistory`. 4527 ''' 4528 def __init__(self, channel, client): 4529 self.parent = client 4530 self.stub = SecretStoresHistoryStub(channel) 4531 4532 def list(self, filter, *args, timeout=None): 4533 ''' 4534 List gets a list of SecretStoreHistory records matching a given set of criteria. 4535 ''' 4536 req = SecretStoreHistoryListRequest() 4537 req.meta.CopyFrom(ListRequestMetadata()) 4538 if self.parent.page_limit > 0: 4539 req.meta.limit = self.parent.page_limit 4540 if self.parent.snapshot_datetime is not None: 4541 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4542 4543 req.filter = plumbing.quote_filter_args(filter, *args) 4544 4545 def generator(svc, req): 4546 tries = 0 4547 while True: 4548 try: 4549 plumbing_response = svc.stub.List( 4550 req, 4551 metadata=svc.parent.get_metadata( 4552 'SecretStoresHistory.List', req), 4553 timeout=timeout) 4554 except Exception as e: 4555 if self.parent.shouldRetry(tries, e): 4556 tries += 1 4557 self.parent.jitterSleep(tries) 4558 continue 4559 raise plumbing.convert_error_to_porcelain(e) from e 4560 tries = 0 4561 for plumbing_item in plumbing_response.history: 4562 yield plumbing.convert_secret_store_history_to_porcelain( 4563 plumbing_item) 4564 if plumbing_response.meta.next_cursor == '': 4565 break 4566 req.meta.cursor = plumbing_response.meta.next_cursor 4567 4568 return generator(self, req) 4569 4570 4571class WorkflowApprovers: 4572 ''' 4573 WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow. 4574 See `strongdm.models.WorkflowApprover`. 4575 ''' 4576 def __init__(self, channel, client): 4577 self.parent = client 4578 self.stub = WorkflowApproversStub(channel) 4579 4580 def create(self, workflow_approver, timeout=None): 4581 ''' 4582 Create creates a new workflow approver 4583 ''' 4584 req = WorkflowApproversCreateRequest() 4585 4586 if workflow_approver is not None: 4587 req.workflow_approver.CopyFrom( 4588 plumbing.convert_workflow_approver_to_plumbing( 4589 workflow_approver)) 4590 tries = 0 4591 plumbing_response = None 4592 while True: 4593 try: 4594 plumbing_response = self.stub.Create( 4595 req, 4596 metadata=self.parent.get_metadata( 4597 'WorkflowApprovers.Create', req), 4598 timeout=timeout) 4599 except Exception as e: 4600 if self.parent.shouldRetry(tries, e): 4601 tries += 1 4602 self.parent.jitterSleep(tries) 4603 continue 4604 raise plumbing.convert_error_to_porcelain(e) from e 4605 break 4606 4607 resp = models.WorkflowApproversCreateResponse() 4608 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4609 plumbing_response.rate_limit) 4610 resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain( 4611 plumbing_response.workflow_approver) 4612 return resp 4613 4614 def get(self, id, timeout=None): 4615 ''' 4616 Get reads one workflow approver by ID. 4617 ''' 4618 req = WorkflowApproverGetRequest() 4619 if self.parent.snapshot_datetime is not None: 4620 req.meta.CopyFrom(GetRequestMetadata()) 4621 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4622 4623 req.id = (id) 4624 tries = 0 4625 plumbing_response = None 4626 while True: 4627 try: 4628 plumbing_response = self.stub.Get( 4629 req, 4630 metadata=self.parent.get_metadata('WorkflowApprovers.Get', 4631 req), 4632 timeout=timeout) 4633 except Exception as e: 4634 if self.parent.shouldRetry(tries, e): 4635 tries += 1 4636 self.parent.jitterSleep(tries) 4637 continue 4638 raise plumbing.convert_error_to_porcelain(e) from e 4639 break 4640 4641 resp = models.WorkflowApproverGetResponse() 4642 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4643 plumbing_response.meta) 4644 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4645 plumbing_response.rate_limit) 4646 resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain( 4647 plumbing_response.workflow_approver) 4648 return resp 4649 4650 def delete(self, id, timeout=None): 4651 ''' 4652 Delete deletes a workflow approver 4653 ''' 4654 req = WorkflowApproversDeleteRequest() 4655 4656 req.id = (id) 4657 tries = 0 4658 plumbing_response = None 4659 while True: 4660 try: 4661 plumbing_response = self.stub.Delete( 4662 req, 4663 metadata=self.parent.get_metadata( 4664 'WorkflowApprovers.Delete', req), 4665 timeout=timeout) 4666 except Exception as e: 4667 if self.parent.shouldRetry(tries, e): 4668 tries += 1 4669 self.parent.jitterSleep(tries) 4670 continue 4671 raise plumbing.convert_error_to_porcelain(e) from e 4672 break 4673 4674 resp = models.WorkflowApproversDeleteResponse() 4675 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4676 plumbing_response.rate_limit) 4677 return resp 4678 4679 def list(self, filter, *args, timeout=None): 4680 ''' 4681 Lists existing workflow approvers. 4682 ''' 4683 req = WorkflowApproversListRequest() 4684 req.meta.CopyFrom(ListRequestMetadata()) 4685 if self.parent.page_limit > 0: 4686 req.meta.limit = self.parent.page_limit 4687 if self.parent.snapshot_datetime is not None: 4688 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4689 4690 req.filter = plumbing.quote_filter_args(filter, *args) 4691 4692 def generator(svc, req): 4693 tries = 0 4694 while True: 4695 try: 4696 plumbing_response = svc.stub.List( 4697 req, 4698 metadata=svc.parent.get_metadata( 4699 'WorkflowApprovers.List', req), 4700 timeout=timeout) 4701 except Exception as e: 4702 if self.parent.shouldRetry(tries, e): 4703 tries += 1 4704 self.parent.jitterSleep(tries) 4705 continue 4706 raise plumbing.convert_error_to_porcelain(e) from e 4707 tries = 0 4708 for plumbing_item in plumbing_response.workflow_approvers: 4709 yield plumbing.convert_workflow_approver_to_porcelain( 4710 plumbing_item) 4711 if plumbing_response.meta.next_cursor == '': 4712 break 4713 req.meta.cursor = plumbing_response.meta.next_cursor 4714 4715 return generator(self, req) 4716 4717 4718class SnapshotWorkflowApprovers: 4719 ''' 4720 SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers 4721 service for historical queries. 4722 ''' 4723 def __init__(self, workflow_approvers): 4724 self.workflow_approvers = workflow_approvers 4725 4726 def get(self, id, timeout=None): 4727 ''' 4728 Get reads one workflow approver by ID. 4729 ''' 4730 return self.workflow_approvers.get(id, timeout=timeout) 4731 4732 def list(self, filter, *args, timeout=None): 4733 ''' 4734 Lists existing workflow approvers. 4735 ''' 4736 return self.workflow_approvers.list(filter, *args, timeout=timeout) 4737 4738 4739class WorkflowApproversHistory: 4740 ''' 4741 WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover. 4742 See `strongdm.models.WorkflowApproverHistory`. 4743 ''' 4744 def __init__(self, channel, client): 4745 self.parent = client 4746 self.stub = WorkflowApproversHistoryStub(channel) 4747 4748 def list(self, filter, *args, timeout=None): 4749 ''' 4750 List gets a list of WorkflowApproversHistory records matching a given set of criteria. 4751 ''' 4752 req = WorkflowApproversHistoryListRequest() 4753 req.meta.CopyFrom(ListRequestMetadata()) 4754 if self.parent.page_limit > 0: 4755 req.meta.limit = self.parent.page_limit 4756 if self.parent.snapshot_datetime is not None: 4757 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4758 4759 req.filter = plumbing.quote_filter_args(filter, *args) 4760 4761 def generator(svc, req): 4762 tries = 0 4763 while True: 4764 try: 4765 plumbing_response = svc.stub.List( 4766 req, 4767 metadata=svc.parent.get_metadata( 4768 'WorkflowApproversHistory.List', req), 4769 timeout=timeout) 4770 except Exception as e: 4771 if self.parent.shouldRetry(tries, e): 4772 tries += 1 4773 self.parent.jitterSleep(tries) 4774 continue 4775 raise plumbing.convert_error_to_porcelain(e) from e 4776 tries = 0 4777 for plumbing_item in plumbing_response.history: 4778 yield plumbing.convert_workflow_approver_history_to_porcelain( 4779 plumbing_item) 4780 if plumbing_response.meta.next_cursor == '': 4781 break 4782 req.meta.cursor = plumbing_response.meta.next_cursor 4783 4784 return generator(self, req) 4785 4786 4787class WorkflowAssignments: 4788 ''' 4789 WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request 4790 access to via the workflow. 4791 See `strongdm.models.WorkflowAssignment`. 4792 ''' 4793 def __init__(self, channel, client): 4794 self.parent = client 4795 self.stub = WorkflowAssignmentsStub(channel) 4796 4797 def list(self, filter, *args, timeout=None): 4798 ''' 4799 Lists existing workflow assignments. 4800 ''' 4801 req = WorkflowAssignmentsListRequest() 4802 req.meta.CopyFrom(ListRequestMetadata()) 4803 if self.parent.page_limit > 0: 4804 req.meta.limit = self.parent.page_limit 4805 if self.parent.snapshot_datetime is not None: 4806 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4807 4808 req.filter = plumbing.quote_filter_args(filter, *args) 4809 4810 def generator(svc, req): 4811 tries = 0 4812 while True: 4813 try: 4814 plumbing_response = svc.stub.List( 4815 req, 4816 metadata=svc.parent.get_metadata( 4817 'WorkflowAssignments.List', req), 4818 timeout=timeout) 4819 except Exception as e: 4820 if self.parent.shouldRetry(tries, e): 4821 tries += 1 4822 self.parent.jitterSleep(tries) 4823 continue 4824 raise plumbing.convert_error_to_porcelain(e) from e 4825 tries = 0 4826 for plumbing_item in plumbing_response.workflow_assignments: 4827 yield plumbing.convert_workflow_assignment_to_porcelain( 4828 plumbing_item) 4829 if plumbing_response.meta.next_cursor == '': 4830 break 4831 req.meta.cursor = plumbing_response.meta.next_cursor 4832 4833 return generator(self, req) 4834 4835 4836class SnapshotWorkflowAssignments: 4837 ''' 4838 SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments 4839 service for historical queries. 4840 ''' 4841 def __init__(self, workflow_assignments): 4842 self.workflow_assignments = workflow_assignments 4843 4844 def list(self, filter, *args, timeout=None): 4845 ''' 4846 Lists existing workflow assignments. 4847 ''' 4848 return self.workflow_assignments.list(filter, *args, timeout=timeout) 4849 4850 4851class WorkflowAssignmentsHistory: 4852 ''' 4853 WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment. 4854 See `strongdm.models.WorkflowAssignmentHistory`. 4855 ''' 4856 def __init__(self, channel, client): 4857 self.parent = client 4858 self.stub = WorkflowAssignmentsHistoryStub(channel) 4859 4860 def list(self, filter, *args, timeout=None): 4861 ''' 4862 List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria. 4863 ''' 4864 req = WorkflowAssignmentsHistoryListRequest() 4865 req.meta.CopyFrom(ListRequestMetadata()) 4866 if self.parent.page_limit > 0: 4867 req.meta.limit = self.parent.page_limit 4868 if self.parent.snapshot_datetime is not None: 4869 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4870 4871 req.filter = plumbing.quote_filter_args(filter, *args) 4872 4873 def generator(svc, req): 4874 tries = 0 4875 while True: 4876 try: 4877 plumbing_response = svc.stub.List( 4878 req, 4879 metadata=svc.parent.get_metadata( 4880 'WorkflowAssignmentsHistory.List', req), 4881 timeout=timeout) 4882 except Exception as e: 4883 if self.parent.shouldRetry(tries, e): 4884 tries += 1 4885 self.parent.jitterSleep(tries) 4886 continue 4887 raise plumbing.convert_error_to_porcelain(e) from e 4888 tries = 0 4889 for plumbing_item in plumbing_response.history: 4890 yield plumbing.convert_workflow_assignment_history_to_porcelain( 4891 plumbing_item) 4892 if plumbing_response.meta.next_cursor == '': 4893 break 4894 req.meta.cursor = plumbing_response.meta.next_cursor 4895 4896 return generator(self, req) 4897 4898 4899class WorkflowRoles: 4900 ''' 4901 WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of 4902 to request access to a resource via the workflow. 4903 See `strongdm.models.WorkflowRole`. 4904 ''' 4905 def __init__(self, channel, client): 4906 self.parent = client 4907 self.stub = WorkflowRolesStub(channel) 4908 4909 def create(self, workflow_role, timeout=None): 4910 ''' 4911 Create creates a new workflow role 4912 ''' 4913 req = WorkflowRolesCreateRequest() 4914 4915 if workflow_role is not None: 4916 req.workflow_role.CopyFrom( 4917 plumbing.convert_workflow_role_to_plumbing(workflow_role)) 4918 tries = 0 4919 plumbing_response = None 4920 while True: 4921 try: 4922 plumbing_response = self.stub.Create( 4923 req, 4924 metadata=self.parent.get_metadata('WorkflowRoles.Create', 4925 req), 4926 timeout=timeout) 4927 except Exception as e: 4928 if self.parent.shouldRetry(tries, e): 4929 tries += 1 4930 self.parent.jitterSleep(tries) 4931 continue 4932 raise plumbing.convert_error_to_porcelain(e) from e 4933 break 4934 4935 resp = models.WorkflowRolesCreateResponse() 4936 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4937 plumbing_response.rate_limit) 4938 resp.workflow_role = plumbing.convert_workflow_role_to_porcelain( 4939 plumbing_response.workflow_role) 4940 return resp 4941 4942 def get(self, id, timeout=None): 4943 ''' 4944 Get reads one workflow role by ID. 4945 ''' 4946 req = WorkflowRoleGetRequest() 4947 if self.parent.snapshot_datetime is not None: 4948 req.meta.CopyFrom(GetRequestMetadata()) 4949 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4950 4951 req.id = (id) 4952 tries = 0 4953 plumbing_response = None 4954 while True: 4955 try: 4956 plumbing_response = self.stub.Get( 4957 req, 4958 metadata=self.parent.get_metadata('WorkflowRoles.Get', 4959 req), 4960 timeout=timeout) 4961 except Exception as e: 4962 if self.parent.shouldRetry(tries, e): 4963 tries += 1 4964 self.parent.jitterSleep(tries) 4965 continue 4966 raise plumbing.convert_error_to_porcelain(e) from e 4967 break 4968 4969 resp = models.WorkflowRoleGetResponse() 4970 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4971 plumbing_response.meta) 4972 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4973 plumbing_response.rate_limit) 4974 resp.workflow_role = plumbing.convert_workflow_role_to_porcelain( 4975 plumbing_response.workflow_role) 4976 return resp 4977 4978 def delete(self, id, timeout=None): 4979 ''' 4980 Delete deletes a workflow role 4981 ''' 4982 req = WorkflowRolesDeleteRequest() 4983 4984 req.id = (id) 4985 tries = 0 4986 plumbing_response = None 4987 while True: 4988 try: 4989 plumbing_response = self.stub.Delete( 4990 req, 4991 metadata=self.parent.get_metadata('WorkflowRoles.Delete', 4992 req), 4993 timeout=timeout) 4994 except Exception as e: 4995 if self.parent.shouldRetry(tries, e): 4996 tries += 1 4997 self.parent.jitterSleep(tries) 4998 continue 4999 raise plumbing.convert_error_to_porcelain(e) from e 5000 break 5001 5002 resp = models.WorkflowRolesDeleteResponse() 5003 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5004 plumbing_response.rate_limit) 5005 return resp 5006 5007 def list(self, filter, *args, timeout=None): 5008 ''' 5009 Lists existing workflow roles. 5010 ''' 5011 req = WorkflowRolesListRequest() 5012 req.meta.CopyFrom(ListRequestMetadata()) 5013 if self.parent.page_limit > 0: 5014 req.meta.limit = self.parent.page_limit 5015 if self.parent.snapshot_datetime is not None: 5016 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5017 5018 req.filter = plumbing.quote_filter_args(filter, *args) 5019 5020 def generator(svc, req): 5021 tries = 0 5022 while True: 5023 try: 5024 plumbing_response = svc.stub.List( 5025 req, 5026 metadata=svc.parent.get_metadata( 5027 'WorkflowRoles.List', req), 5028 timeout=timeout) 5029 except Exception as e: 5030 if self.parent.shouldRetry(tries, e): 5031 tries += 1 5032 self.parent.jitterSleep(tries) 5033 continue 5034 raise plumbing.convert_error_to_porcelain(e) from e 5035 tries = 0 5036 for plumbing_item in plumbing_response.workflow_role: 5037 yield plumbing.convert_workflow_role_to_porcelain( 5038 plumbing_item) 5039 if plumbing_response.meta.next_cursor == '': 5040 break 5041 req.meta.cursor = plumbing_response.meta.next_cursor 5042 5043 return generator(self, req) 5044 5045 5046class SnapshotWorkflowRoles: 5047 ''' 5048 SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles 5049 service for historical queries. 5050 ''' 5051 def __init__(self, workflow_roles): 5052 self.workflow_roles = workflow_roles 5053 5054 def get(self, id, timeout=None): 5055 ''' 5056 Get reads one workflow role by ID. 5057 ''' 5058 return self.workflow_roles.get(id, timeout=timeout) 5059 5060 def list(self, filter, *args, timeout=None): 5061 ''' 5062 Lists existing workflow roles. 5063 ''' 5064 return self.workflow_roles.list(filter, *args, timeout=timeout) 5065 5066 5067class WorkflowRolesHistory: 5068 ''' 5069 WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole 5070 See `strongdm.models.WorkflowRoleHistory`. 5071 ''' 5072 def __init__(self, channel, client): 5073 self.parent = client 5074 self.stub = WorkflowRolesHistoryStub(channel) 5075 5076 def list(self, filter, *args, timeout=None): 5077 ''' 5078 List gets a list of WorkflowRolesHistory records matching a given set of criteria. 5079 ''' 5080 req = WorkflowRolesHistoryListRequest() 5081 req.meta.CopyFrom(ListRequestMetadata()) 5082 if self.parent.page_limit > 0: 5083 req.meta.limit = self.parent.page_limit 5084 if self.parent.snapshot_datetime is not None: 5085 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5086 5087 req.filter = plumbing.quote_filter_args(filter, *args) 5088 5089 def generator(svc, req): 5090 tries = 0 5091 while True: 5092 try: 5093 plumbing_response = svc.stub.List( 5094 req, 5095 metadata=svc.parent.get_metadata( 5096 'WorkflowRolesHistory.List', req), 5097 timeout=timeout) 5098 except Exception as e: 5099 if self.parent.shouldRetry(tries, e): 5100 tries += 1 5101 self.parent.jitterSleep(tries) 5102 continue 5103 raise plumbing.convert_error_to_porcelain(e) from e 5104 tries = 0 5105 for plumbing_item in plumbing_response.history: 5106 yield plumbing.convert_workflow_role_history_to_porcelain( 5107 plumbing_item) 5108 if plumbing_response.meta.next_cursor == '': 5109 break 5110 req.meta.cursor = plumbing_response.meta.next_cursor 5111 5112 return generator(self, req) 5113 5114 5115class Workflows: 5116 ''' 5117 Workflows are the collection of rules that define the resources to which access can be requested, 5118 the users that can request that access, and the mechanism for approving those requests which can either 5119 be automatic approval or a set of users authorized to approve the requests. 5120 See `strongdm.models.Workflow`. 5121 ''' 5122 def __init__(self, channel, client): 5123 self.parent = client 5124 self.stub = WorkflowsStub(channel) 5125 5126 def create(self, workflow, timeout=None): 5127 ''' 5128 Create creates a new workflow and requires a name for the workflow. 5129 ''' 5130 req = WorkflowCreateRequest() 5131 5132 if workflow is not None: 5133 req.workflow.CopyFrom( 5134 plumbing.convert_workflow_to_plumbing(workflow)) 5135 tries = 0 5136 plumbing_response = None 5137 while True: 5138 try: 5139 plumbing_response = self.stub.Create( 5140 req, 5141 metadata=self.parent.get_metadata('Workflows.Create', req), 5142 timeout=timeout) 5143 except Exception as e: 5144 if self.parent.shouldRetry(tries, e): 5145 tries += 1 5146 self.parent.jitterSleep(tries) 5147 continue 5148 raise plumbing.convert_error_to_porcelain(e) from e 5149 break 5150 5151 resp = models.WorkflowCreateResponse() 5152 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5153 plumbing_response.rate_limit) 5154 resp.workflow = plumbing.convert_workflow_to_porcelain( 5155 plumbing_response.workflow) 5156 return resp 5157 5158 def get(self, id, timeout=None): 5159 ''' 5160 Get reads one workflow by ID. 5161 ''' 5162 req = WorkflowGetRequest() 5163 if self.parent.snapshot_datetime is not None: 5164 req.meta.CopyFrom(GetRequestMetadata()) 5165 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5166 5167 req.id = (id) 5168 tries = 0 5169 plumbing_response = None 5170 while True: 5171 try: 5172 plumbing_response = self.stub.Get( 5173 req, 5174 metadata=self.parent.get_metadata('Workflows.Get', req), 5175 timeout=timeout) 5176 except Exception as e: 5177 if self.parent.shouldRetry(tries, e): 5178 tries += 1 5179 self.parent.jitterSleep(tries) 5180 continue 5181 raise plumbing.convert_error_to_porcelain(e) from e 5182 break 5183 5184 resp = models.WorkflowGetResponse() 5185 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 5186 plumbing_response.meta) 5187 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5188 plumbing_response.rate_limit) 5189 resp.workflow = plumbing.convert_workflow_to_porcelain( 5190 plumbing_response.workflow) 5191 return resp 5192 5193 def delete(self, id, timeout=None): 5194 ''' 5195 Delete deletes an existing workflow. 5196 ''' 5197 req = WorkflowDeleteRequest() 5198 5199 req.id = (id) 5200 tries = 0 5201 plumbing_response = None 5202 while True: 5203 try: 5204 plumbing_response = self.stub.Delete( 5205 req, 5206 metadata=self.parent.get_metadata('Workflows.Delete', req), 5207 timeout=timeout) 5208 except Exception as e: 5209 if self.parent.shouldRetry(tries, e): 5210 tries += 1 5211 self.parent.jitterSleep(tries) 5212 continue 5213 raise plumbing.convert_error_to_porcelain(e) from e 5214 break 5215 5216 resp = models.WorkflowDeleteResponse() 5217 resp.id = (plumbing_response.id) 5218 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5219 plumbing_response.rate_limit) 5220 return resp 5221 5222 def update(self, workflow, timeout=None): 5223 ''' 5224 Update updates an existing workflow. 5225 ''' 5226 req = WorkflowUpdateRequest() 5227 5228 if workflow is not None: 5229 req.workflow.CopyFrom( 5230 plumbing.convert_workflow_to_plumbing(workflow)) 5231 tries = 0 5232 plumbing_response = None 5233 while True: 5234 try: 5235 plumbing_response = self.stub.Update( 5236 req, 5237 metadata=self.parent.get_metadata('Workflows.Update', req), 5238 timeout=timeout) 5239 except Exception as e: 5240 if self.parent.shouldRetry(tries, e): 5241 tries += 1 5242 self.parent.jitterSleep(tries) 5243 continue 5244 raise plumbing.convert_error_to_porcelain(e) from e 5245 break 5246 5247 resp = models.WorkflowUpdateResponse() 5248 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5249 plumbing_response.rate_limit) 5250 resp.workflow = plumbing.convert_workflow_to_porcelain( 5251 plumbing_response.workflow) 5252 return resp 5253 5254 def list(self, filter, *args, timeout=None): 5255 ''' 5256 Lists existing workflows. 5257 ''' 5258 req = WorkflowListRequest() 5259 req.meta.CopyFrom(ListRequestMetadata()) 5260 if self.parent.page_limit > 0: 5261 req.meta.limit = self.parent.page_limit 5262 if self.parent.snapshot_datetime is not None: 5263 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5264 5265 req.filter = plumbing.quote_filter_args(filter, *args) 5266 5267 def generator(svc, req): 5268 tries = 0 5269 while True: 5270 try: 5271 plumbing_response = svc.stub.List( 5272 req, 5273 metadata=svc.parent.get_metadata( 5274 'Workflows.List', req), 5275 timeout=timeout) 5276 except Exception as e: 5277 if self.parent.shouldRetry(tries, e): 5278 tries += 1 5279 self.parent.jitterSleep(tries) 5280 continue 5281 raise plumbing.convert_error_to_porcelain(e) from e 5282 tries = 0 5283 for plumbing_item in plumbing_response.workflows: 5284 yield plumbing.convert_workflow_to_porcelain(plumbing_item) 5285 if plumbing_response.meta.next_cursor == '': 5286 break 5287 req.meta.cursor = plumbing_response.meta.next_cursor 5288 5289 return generator(self, req) 5290 5291 5292class SnapshotWorkflows: 5293 ''' 5294 SnapshotWorkflows exposes the read only methods of the Workflows 5295 service for historical queries. 5296 ''' 5297 def __init__(self, workflows): 5298 self.workflows = workflows 5299 5300 def get(self, id, timeout=None): 5301 ''' 5302 Get reads one workflow by ID. 5303 ''' 5304 return self.workflows.get(id, timeout=timeout) 5305 5306 def list(self, filter, *args, timeout=None): 5307 ''' 5308 Lists existing workflows. 5309 ''' 5310 return self.workflows.list(filter, *args, timeout=timeout) 5311 5312 5313class WorkflowsHistory: 5314 ''' 5315 WorkflowsHistory provides records of all changes to the state of a Workflow. 5316 See `strongdm.models.WorkflowHistory`. 5317 ''' 5318 def __init__(self, channel, client): 5319 self.parent = client 5320 self.stub = WorkflowsHistoryStub(channel) 5321 5322 def list(self, filter, *args, timeout=None): 5323 ''' 5324 List gets a list of WorkflowHistory records matching a given set of criteria. 5325 ''' 5326 req = WorkflowHistoryListRequest() 5327 req.meta.CopyFrom(ListRequestMetadata()) 5328 if self.parent.page_limit > 0: 5329 req.meta.limit = self.parent.page_limit 5330 if self.parent.snapshot_datetime is not None: 5331 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5332 5333 req.filter = plumbing.quote_filter_args(filter, *args) 5334 5335 def generator(svc, req): 5336 tries = 0 5337 while True: 5338 try: 5339 plumbing_response = svc.stub.List( 5340 req, 5341 metadata=svc.parent.get_metadata( 5342 'WorkflowsHistory.List', req), 5343 timeout=timeout) 5344 except Exception as e: 5345 if self.parent.shouldRetry(tries, e): 5346 tries += 1 5347 self.parent.jitterSleep(tries) 5348 continue 5349 raise plumbing.convert_error_to_porcelain(e) from e 5350 tries = 0 5351 for plumbing_item in plumbing_response.history: 5352 yield plumbing.convert_workflow_history_to_porcelain( 5353 plumbing_item) 5354 if plumbing_response.meta.next_cursor == '': 5355 break 5356 req.meta.cursor = plumbing_response.meta.next_cursor 5357 5358 return generator(self, req)
136def deprecated(func): 137 """This is a decorator which can be used to mark functions 138 as deprecated. It will result in a warning being emitted 139 when the function is used.""" 140 @functools.wraps(func) 141 def new_func(*args, **kwargs): 142 warnings.warn("Call to deprecated function {}.".format(func.__name__), 143 category=DeprecationWarning, 144 stacklevel=2) 145 return func(*args, **kwargs) 146 147 return new_func
This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
150class AccessRequests: 151 ''' 152 AccessRequests are requests for access to a resource that may match a Workflow. 153 See `strongdm.models.AccessRequest`. 154 ''' 155 def __init__(self, channel, client): 156 self.parent = client 157 self.stub = AccessRequestsStub(channel) 158 159 def list(self, filter, *args, timeout=None): 160 ''' 161 Lists existing access requests. 162 ''' 163 req = AccessRequestListRequest() 164 req.meta.CopyFrom(ListRequestMetadata()) 165 if self.parent.page_limit > 0: 166 req.meta.limit = self.parent.page_limit 167 if self.parent.snapshot_datetime is not None: 168 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 169 170 req.filter = plumbing.quote_filter_args(filter, *args) 171 172 def generator(svc, req): 173 tries = 0 174 while True: 175 try: 176 plumbing_response = svc.stub.List( 177 req, 178 metadata=svc.parent.get_metadata( 179 'AccessRequests.List', req), 180 timeout=timeout) 181 except Exception as e: 182 if self.parent.shouldRetry(tries, e): 183 tries += 1 184 self.parent.jitterSleep(tries) 185 continue 186 raise plumbing.convert_error_to_porcelain(e) from e 187 tries = 0 188 for plumbing_item in plumbing_response.access_requests: 189 yield plumbing.convert_access_request_to_porcelain( 190 plumbing_item) 191 if plumbing_response.meta.next_cursor == '': 192 break 193 req.meta.cursor = plumbing_response.meta.next_cursor 194 195 return generator(self, req)
AccessRequests are requests for access to a resource that may match a Workflow.
See strongdm.models.AccessRequest
.
159 def list(self, filter, *args, timeout=None): 160 ''' 161 Lists existing access requests. 162 ''' 163 req = AccessRequestListRequest() 164 req.meta.CopyFrom(ListRequestMetadata()) 165 if self.parent.page_limit > 0: 166 req.meta.limit = self.parent.page_limit 167 if self.parent.snapshot_datetime is not None: 168 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 169 170 req.filter = plumbing.quote_filter_args(filter, *args) 171 172 def generator(svc, req): 173 tries = 0 174 while True: 175 try: 176 plumbing_response = svc.stub.List( 177 req, 178 metadata=svc.parent.get_metadata( 179 'AccessRequests.List', req), 180 timeout=timeout) 181 except Exception as e: 182 if self.parent.shouldRetry(tries, e): 183 tries += 1 184 self.parent.jitterSleep(tries) 185 continue 186 raise plumbing.convert_error_to_porcelain(e) from e 187 tries = 0 188 for plumbing_item in plumbing_response.access_requests: 189 yield plumbing.convert_access_request_to_porcelain( 190 plumbing_item) 191 if plumbing_response.meta.next_cursor == '': 192 break 193 req.meta.cursor = plumbing_response.meta.next_cursor 194 195 return generator(self, req)
Lists existing access requests.
198class SnapshotAccessRequests: 199 ''' 200 SnapshotAccessRequests exposes the read only methods of the AccessRequests 201 service for historical queries. 202 ''' 203 def __init__(self, access_requests): 204 self.access_requests = access_requests 205 206 def list(self, filter, *args, timeout=None): 207 ''' 208 Lists existing access requests. 209 ''' 210 return self.access_requests.list(filter, *args, timeout=timeout)
SnapshotAccessRequests exposes the read only methods of the AccessRequests service for historical queries.
213class AccessRequestEventsHistory: 214 ''' 215 AccessRequestEventsHistory provides records of all changes to the state of an AccessRequest. 216 See `strongdm.models.AccessRequestEventHistory`. 217 ''' 218 def __init__(self, channel, client): 219 self.parent = client 220 self.stub = AccessRequestEventsHistoryStub(channel) 221 222 def list(self, filter, *args, timeout=None): 223 ''' 224 List gets a list of AccessRequestEventHistory records matching a given set of criteria. 225 ''' 226 req = AccessRequestEventHistoryListRequest() 227 req.meta.CopyFrom(ListRequestMetadata()) 228 if self.parent.page_limit > 0: 229 req.meta.limit = self.parent.page_limit 230 if self.parent.snapshot_datetime is not None: 231 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 232 233 req.filter = plumbing.quote_filter_args(filter, *args) 234 235 def generator(svc, req): 236 tries = 0 237 while True: 238 try: 239 plumbing_response = svc.stub.List( 240 req, 241 metadata=svc.parent.get_metadata( 242 'AccessRequestEventsHistory.List', req), 243 timeout=timeout) 244 except Exception as e: 245 if self.parent.shouldRetry(tries, e): 246 tries += 1 247 self.parent.jitterSleep(tries) 248 continue 249 raise plumbing.convert_error_to_porcelain(e) from e 250 tries = 0 251 for plumbing_item in plumbing_response.history: 252 yield plumbing.convert_access_request_event_history_to_porcelain( 253 plumbing_item) 254 if plumbing_response.meta.next_cursor == '': 255 break 256 req.meta.cursor = plumbing_response.meta.next_cursor 257 258 return generator(self, req)
AccessRequestEventsHistory provides records of all changes to the state of an AccessRequest.
See strongdm.models.AccessRequestEventHistory
.
222 def list(self, filter, *args, timeout=None): 223 ''' 224 List gets a list of AccessRequestEventHistory records matching a given set of criteria. 225 ''' 226 req = AccessRequestEventHistoryListRequest() 227 req.meta.CopyFrom(ListRequestMetadata()) 228 if self.parent.page_limit > 0: 229 req.meta.limit = self.parent.page_limit 230 if self.parent.snapshot_datetime is not None: 231 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 232 233 req.filter = plumbing.quote_filter_args(filter, *args) 234 235 def generator(svc, req): 236 tries = 0 237 while True: 238 try: 239 plumbing_response = svc.stub.List( 240 req, 241 metadata=svc.parent.get_metadata( 242 'AccessRequestEventsHistory.List', req), 243 timeout=timeout) 244 except Exception as e: 245 if self.parent.shouldRetry(tries, e): 246 tries += 1 247 self.parent.jitterSleep(tries) 248 continue 249 raise plumbing.convert_error_to_porcelain(e) from e 250 tries = 0 251 for plumbing_item in plumbing_response.history: 252 yield plumbing.convert_access_request_event_history_to_porcelain( 253 plumbing_item) 254 if plumbing_response.meta.next_cursor == '': 255 break 256 req.meta.cursor = plumbing_response.meta.next_cursor 257 258 return generator(self, req)
List gets a list of AccessRequestEventHistory records matching a given set of criteria.
261class AccessRequestsHistory: 262 ''' 263 AccessRequestsHistory provides records of all changes to the state of an AccessRequest. 264 See `strongdm.models.AccessRequestHistory`. 265 ''' 266 def __init__(self, channel, client): 267 self.parent = client 268 self.stub = AccessRequestsHistoryStub(channel) 269 270 def list(self, filter, *args, timeout=None): 271 ''' 272 List gets a list of AccessRequestHistory records matching a given set of criteria. 273 ''' 274 req = AccessRequestHistoryListRequest() 275 req.meta.CopyFrom(ListRequestMetadata()) 276 if self.parent.page_limit > 0: 277 req.meta.limit = self.parent.page_limit 278 if self.parent.snapshot_datetime is not None: 279 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 280 281 req.filter = plumbing.quote_filter_args(filter, *args) 282 283 def generator(svc, req): 284 tries = 0 285 while True: 286 try: 287 plumbing_response = svc.stub.List( 288 req, 289 metadata=svc.parent.get_metadata( 290 'AccessRequestsHistory.List', req), 291 timeout=timeout) 292 except Exception as e: 293 if self.parent.shouldRetry(tries, e): 294 tries += 1 295 self.parent.jitterSleep(tries) 296 continue 297 raise plumbing.convert_error_to_porcelain(e) from e 298 tries = 0 299 for plumbing_item in plumbing_response.history: 300 yield plumbing.convert_access_request_history_to_porcelain( 301 plumbing_item) 302 if plumbing_response.meta.next_cursor == '': 303 break 304 req.meta.cursor = plumbing_response.meta.next_cursor 305 306 return generator(self, req)
AccessRequestsHistory provides records of all changes to the state of an AccessRequest.
See strongdm.models.AccessRequestHistory
.
270 def list(self, filter, *args, timeout=None): 271 ''' 272 List gets a list of AccessRequestHistory records matching a given set of criteria. 273 ''' 274 req = AccessRequestHistoryListRequest() 275 req.meta.CopyFrom(ListRequestMetadata()) 276 if self.parent.page_limit > 0: 277 req.meta.limit = self.parent.page_limit 278 if self.parent.snapshot_datetime is not None: 279 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 280 281 req.filter = plumbing.quote_filter_args(filter, *args) 282 283 def generator(svc, req): 284 tries = 0 285 while True: 286 try: 287 plumbing_response = svc.stub.List( 288 req, 289 metadata=svc.parent.get_metadata( 290 'AccessRequestsHistory.List', req), 291 timeout=timeout) 292 except Exception as e: 293 if self.parent.shouldRetry(tries, e): 294 tries += 1 295 self.parent.jitterSleep(tries) 296 continue 297 raise plumbing.convert_error_to_porcelain(e) from e 298 tries = 0 299 for plumbing_item in plumbing_response.history: 300 yield plumbing.convert_access_request_history_to_porcelain( 301 plumbing_item) 302 if plumbing_response.meta.next_cursor == '': 303 break 304 req.meta.cursor = plumbing_response.meta.next_cursor 305 306 return generator(self, req)
List gets a list of AccessRequestHistory records matching a given set of criteria.
309class AccountAttachments: 310 ''' 311 AccountAttachments assign an account to a role. 312 See `strongdm.models.AccountAttachment`. 313 ''' 314 def __init__(self, channel, client): 315 self.parent = client 316 self.stub = AccountAttachmentsStub(channel) 317 318 def create(self, account_attachment, timeout=None): 319 ''' 320 Create registers a new AccountAttachment. 321 ''' 322 req = AccountAttachmentCreateRequest() 323 324 if account_attachment is not None: 325 req.account_attachment.CopyFrom( 326 plumbing.convert_account_attachment_to_plumbing( 327 account_attachment)) 328 tries = 0 329 plumbing_response = None 330 while True: 331 try: 332 plumbing_response = self.stub.Create( 333 req, 334 metadata=self.parent.get_metadata( 335 'AccountAttachments.Create', req), 336 timeout=timeout) 337 except Exception as e: 338 if self.parent.shouldRetry(tries, e): 339 tries += 1 340 self.parent.jitterSleep(tries) 341 continue 342 raise plumbing.convert_error_to_porcelain(e) from e 343 break 344 345 resp = models.AccountAttachmentCreateResponse() 346 resp.account_attachment = plumbing.convert_account_attachment_to_porcelain( 347 plumbing_response.account_attachment) 348 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 349 plumbing_response.meta) 350 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 351 plumbing_response.rate_limit) 352 return resp 353 354 def get(self, id, timeout=None): 355 ''' 356 Get reads one AccountAttachment by ID. 357 ''' 358 req = AccountAttachmentGetRequest() 359 if self.parent.snapshot_datetime is not None: 360 req.meta.CopyFrom(GetRequestMetadata()) 361 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 362 363 req.id = (id) 364 tries = 0 365 plumbing_response = None 366 while True: 367 try: 368 plumbing_response = self.stub.Get( 369 req, 370 metadata=self.parent.get_metadata('AccountAttachments.Get', 371 req), 372 timeout=timeout) 373 except Exception as e: 374 if self.parent.shouldRetry(tries, e): 375 tries += 1 376 self.parent.jitterSleep(tries) 377 continue 378 raise plumbing.convert_error_to_porcelain(e) from e 379 break 380 381 resp = models.AccountAttachmentGetResponse() 382 resp.account_attachment = plumbing.convert_account_attachment_to_porcelain( 383 plumbing_response.account_attachment) 384 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 385 plumbing_response.meta) 386 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 387 plumbing_response.rate_limit) 388 return resp 389 390 def delete(self, id, timeout=None): 391 ''' 392 Delete removes a AccountAttachment by ID. 393 ''' 394 req = AccountAttachmentDeleteRequest() 395 396 req.id = (id) 397 tries = 0 398 plumbing_response = None 399 while True: 400 try: 401 plumbing_response = self.stub.Delete( 402 req, 403 metadata=self.parent.get_metadata( 404 'AccountAttachments.Delete', req), 405 timeout=timeout) 406 except Exception as e: 407 if self.parent.shouldRetry(tries, e): 408 tries += 1 409 self.parent.jitterSleep(tries) 410 continue 411 raise plumbing.convert_error_to_porcelain(e) from e 412 break 413 414 resp = models.AccountAttachmentDeleteResponse() 415 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 416 plumbing_response.meta) 417 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 418 plumbing_response.rate_limit) 419 return resp 420 421 def list(self, filter, *args, timeout=None): 422 ''' 423 List gets a list of AccountAttachments matching a given set of criteria. 424 ''' 425 req = AccountAttachmentListRequest() 426 req.meta.CopyFrom(ListRequestMetadata()) 427 if self.parent.page_limit > 0: 428 req.meta.limit = self.parent.page_limit 429 if self.parent.snapshot_datetime is not None: 430 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 431 432 req.filter = plumbing.quote_filter_args(filter, *args) 433 434 def generator(svc, req): 435 tries = 0 436 while True: 437 try: 438 plumbing_response = svc.stub.List( 439 req, 440 metadata=svc.parent.get_metadata( 441 'AccountAttachments.List', req), 442 timeout=timeout) 443 except Exception as e: 444 if self.parent.shouldRetry(tries, e): 445 tries += 1 446 self.parent.jitterSleep(tries) 447 continue 448 raise plumbing.convert_error_to_porcelain(e) from e 449 tries = 0 450 for plumbing_item in plumbing_response.account_attachments: 451 yield plumbing.convert_account_attachment_to_porcelain( 452 plumbing_item) 453 if plumbing_response.meta.next_cursor == '': 454 break 455 req.meta.cursor = plumbing_response.meta.next_cursor 456 457 return generator(self, req)
AccountAttachments assign an account to a role.
See strongdm.models.AccountAttachment
.
318 def create(self, account_attachment, timeout=None): 319 ''' 320 Create registers a new AccountAttachment. 321 ''' 322 req = AccountAttachmentCreateRequest() 323 324 if account_attachment is not None: 325 req.account_attachment.CopyFrom( 326 plumbing.convert_account_attachment_to_plumbing( 327 account_attachment)) 328 tries = 0 329 plumbing_response = None 330 while True: 331 try: 332 plumbing_response = self.stub.Create( 333 req, 334 metadata=self.parent.get_metadata( 335 'AccountAttachments.Create', req), 336 timeout=timeout) 337 except Exception as e: 338 if self.parent.shouldRetry(tries, e): 339 tries += 1 340 self.parent.jitterSleep(tries) 341 continue 342 raise plumbing.convert_error_to_porcelain(e) from e 343 break 344 345 resp = models.AccountAttachmentCreateResponse() 346 resp.account_attachment = plumbing.convert_account_attachment_to_porcelain( 347 plumbing_response.account_attachment) 348 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 349 plumbing_response.meta) 350 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 351 plumbing_response.rate_limit) 352 return resp
Create registers a new AccountAttachment.
354 def get(self, id, timeout=None): 355 ''' 356 Get reads one AccountAttachment by ID. 357 ''' 358 req = AccountAttachmentGetRequest() 359 if self.parent.snapshot_datetime is not None: 360 req.meta.CopyFrom(GetRequestMetadata()) 361 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 362 363 req.id = (id) 364 tries = 0 365 plumbing_response = None 366 while True: 367 try: 368 plumbing_response = self.stub.Get( 369 req, 370 metadata=self.parent.get_metadata('AccountAttachments.Get', 371 req), 372 timeout=timeout) 373 except Exception as e: 374 if self.parent.shouldRetry(tries, e): 375 tries += 1 376 self.parent.jitterSleep(tries) 377 continue 378 raise plumbing.convert_error_to_porcelain(e) from e 379 break 380 381 resp = models.AccountAttachmentGetResponse() 382 resp.account_attachment = plumbing.convert_account_attachment_to_porcelain( 383 plumbing_response.account_attachment) 384 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 385 plumbing_response.meta) 386 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 387 plumbing_response.rate_limit) 388 return resp
Get reads one AccountAttachment by ID.
390 def delete(self, id, timeout=None): 391 ''' 392 Delete removes a AccountAttachment by ID. 393 ''' 394 req = AccountAttachmentDeleteRequest() 395 396 req.id = (id) 397 tries = 0 398 plumbing_response = None 399 while True: 400 try: 401 plumbing_response = self.stub.Delete( 402 req, 403 metadata=self.parent.get_metadata( 404 'AccountAttachments.Delete', req), 405 timeout=timeout) 406 except Exception as e: 407 if self.parent.shouldRetry(tries, e): 408 tries += 1 409 self.parent.jitterSleep(tries) 410 continue 411 raise plumbing.convert_error_to_porcelain(e) from e 412 break 413 414 resp = models.AccountAttachmentDeleteResponse() 415 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 416 plumbing_response.meta) 417 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 418 plumbing_response.rate_limit) 419 return resp
Delete removes a AccountAttachment by ID.
421 def list(self, filter, *args, timeout=None): 422 ''' 423 List gets a list of AccountAttachments matching a given set of criteria. 424 ''' 425 req = AccountAttachmentListRequest() 426 req.meta.CopyFrom(ListRequestMetadata()) 427 if self.parent.page_limit > 0: 428 req.meta.limit = self.parent.page_limit 429 if self.parent.snapshot_datetime is not None: 430 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 431 432 req.filter = plumbing.quote_filter_args(filter, *args) 433 434 def generator(svc, req): 435 tries = 0 436 while True: 437 try: 438 plumbing_response = svc.stub.List( 439 req, 440 metadata=svc.parent.get_metadata( 441 'AccountAttachments.List', req), 442 timeout=timeout) 443 except Exception as e: 444 if self.parent.shouldRetry(tries, e): 445 tries += 1 446 self.parent.jitterSleep(tries) 447 continue 448 raise plumbing.convert_error_to_porcelain(e) from e 449 tries = 0 450 for plumbing_item in plumbing_response.account_attachments: 451 yield plumbing.convert_account_attachment_to_porcelain( 452 plumbing_item) 453 if plumbing_response.meta.next_cursor == '': 454 break 455 req.meta.cursor = plumbing_response.meta.next_cursor 456 457 return generator(self, req)
List gets a list of AccountAttachments matching a given set of criteria.
460class SnapshotAccountAttachments: 461 ''' 462 SnapshotAccountAttachments exposes the read only methods of the AccountAttachments 463 service for historical queries. 464 ''' 465 def __init__(self, account_attachments): 466 self.account_attachments = account_attachments 467 468 def get(self, id, timeout=None): 469 ''' 470 Get reads one AccountAttachment by ID. 471 ''' 472 return self.account_attachments.get(id, timeout=timeout) 473 474 def list(self, filter, *args, timeout=None): 475 ''' 476 List gets a list of AccountAttachments matching a given set of criteria. 477 ''' 478 return self.account_attachments.list(filter, *args, timeout=timeout)
SnapshotAccountAttachments exposes the read only methods of the AccountAttachments service for historical queries.
468 def get(self, id, timeout=None): 469 ''' 470 Get reads one AccountAttachment by ID. 471 ''' 472 return self.account_attachments.get(id, timeout=timeout)
Get reads one AccountAttachment by ID.
474 def list(self, filter, *args, timeout=None): 475 ''' 476 List gets a list of AccountAttachments matching a given set of criteria. 477 ''' 478 return self.account_attachments.list(filter, *args, timeout=timeout)
List gets a list of AccountAttachments matching a given set of criteria.
481class AccountAttachmentsHistory: 482 ''' 483 AccountAttachmentsHistory records all changes to the state of an AccountAttachment. 484 See `strongdm.models.AccountAttachmentHistory`. 485 ''' 486 def __init__(self, channel, client): 487 self.parent = client 488 self.stub = AccountAttachmentsHistoryStub(channel) 489 490 def list(self, filter, *args, timeout=None): 491 ''' 492 List gets a list of AccountAttachmentHistory records matching a given set of criteria. 493 ''' 494 req = AccountAttachmentHistoryListRequest() 495 req.meta.CopyFrom(ListRequestMetadata()) 496 if self.parent.page_limit > 0: 497 req.meta.limit = self.parent.page_limit 498 if self.parent.snapshot_datetime is not None: 499 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 500 501 req.filter = plumbing.quote_filter_args(filter, *args) 502 503 def generator(svc, req): 504 tries = 0 505 while True: 506 try: 507 plumbing_response = svc.stub.List( 508 req, 509 metadata=svc.parent.get_metadata( 510 'AccountAttachmentsHistory.List', req), 511 timeout=timeout) 512 except Exception as e: 513 if self.parent.shouldRetry(tries, e): 514 tries += 1 515 self.parent.jitterSleep(tries) 516 continue 517 raise plumbing.convert_error_to_porcelain(e) from e 518 tries = 0 519 for plumbing_item in plumbing_response.history: 520 yield plumbing.convert_account_attachment_history_to_porcelain( 521 plumbing_item) 522 if plumbing_response.meta.next_cursor == '': 523 break 524 req.meta.cursor = plumbing_response.meta.next_cursor 525 526 return generator(self, req)
AccountAttachmentsHistory records all changes to the state of an AccountAttachment.
See strongdm.models.AccountAttachmentHistory
.
490 def list(self, filter, *args, timeout=None): 491 ''' 492 List gets a list of AccountAttachmentHistory records matching a given set of criteria. 493 ''' 494 req = AccountAttachmentHistoryListRequest() 495 req.meta.CopyFrom(ListRequestMetadata()) 496 if self.parent.page_limit > 0: 497 req.meta.limit = self.parent.page_limit 498 if self.parent.snapshot_datetime is not None: 499 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 500 501 req.filter = plumbing.quote_filter_args(filter, *args) 502 503 def generator(svc, req): 504 tries = 0 505 while True: 506 try: 507 plumbing_response = svc.stub.List( 508 req, 509 metadata=svc.parent.get_metadata( 510 'AccountAttachmentsHistory.List', req), 511 timeout=timeout) 512 except Exception as e: 513 if self.parent.shouldRetry(tries, e): 514 tries += 1 515 self.parent.jitterSleep(tries) 516 continue 517 raise plumbing.convert_error_to_porcelain(e) from e 518 tries = 0 519 for plumbing_item in plumbing_response.history: 520 yield plumbing.convert_account_attachment_history_to_porcelain( 521 plumbing_item) 522 if plumbing_response.meta.next_cursor == '': 523 break 524 req.meta.cursor = plumbing_response.meta.next_cursor 525 526 return generator(self, req)
List gets a list of AccountAttachmentHistory records matching a given set of criteria.
529class AccountGrants: 530 ''' 531 AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource. 532 See `strongdm.models.AccountGrant`. 533 ''' 534 def __init__(self, channel, client): 535 self.parent = client 536 self.stub = AccountGrantsStub(channel) 537 538 def create(self, account_grant, timeout=None): 539 ''' 540 Create registers a new AccountGrant. 541 ''' 542 req = AccountGrantCreateRequest() 543 544 if account_grant is not None: 545 req.account_grant.CopyFrom( 546 plumbing.convert_account_grant_to_plumbing(account_grant)) 547 tries = 0 548 plumbing_response = None 549 while True: 550 try: 551 plumbing_response = self.stub.Create( 552 req, 553 metadata=self.parent.get_metadata('AccountGrants.Create', 554 req), 555 timeout=timeout) 556 except Exception as e: 557 if self.parent.shouldRetry(tries, e): 558 tries += 1 559 self.parent.jitterSleep(tries) 560 continue 561 raise plumbing.convert_error_to_porcelain(e) from e 562 break 563 564 resp = models.AccountGrantCreateResponse() 565 resp.account_grant = plumbing.convert_account_grant_to_porcelain( 566 plumbing_response.account_grant) 567 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 568 plumbing_response.meta) 569 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 570 plumbing_response.rate_limit) 571 return resp 572 573 def get(self, id, timeout=None): 574 ''' 575 Get reads one AccountGrant by ID. 576 ''' 577 req = AccountGrantGetRequest() 578 if self.parent.snapshot_datetime is not None: 579 req.meta.CopyFrom(GetRequestMetadata()) 580 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 581 582 req.id = (id) 583 tries = 0 584 plumbing_response = None 585 while True: 586 try: 587 plumbing_response = self.stub.Get( 588 req, 589 metadata=self.parent.get_metadata('AccountGrants.Get', 590 req), 591 timeout=timeout) 592 except Exception as e: 593 if self.parent.shouldRetry(tries, e): 594 tries += 1 595 self.parent.jitterSleep(tries) 596 continue 597 raise plumbing.convert_error_to_porcelain(e) from e 598 break 599 600 resp = models.AccountGrantGetResponse() 601 resp.account_grant = plumbing.convert_account_grant_to_porcelain( 602 plumbing_response.account_grant) 603 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 604 plumbing_response.meta) 605 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 606 plumbing_response.rate_limit) 607 return resp 608 609 def delete(self, id, timeout=None): 610 ''' 611 Delete removes a AccountGrant by ID. 612 ''' 613 req = AccountGrantDeleteRequest() 614 615 req.id = (id) 616 tries = 0 617 plumbing_response = None 618 while True: 619 try: 620 plumbing_response = self.stub.Delete( 621 req, 622 metadata=self.parent.get_metadata('AccountGrants.Delete', 623 req), 624 timeout=timeout) 625 except Exception as e: 626 if self.parent.shouldRetry(tries, e): 627 tries += 1 628 self.parent.jitterSleep(tries) 629 continue 630 raise plumbing.convert_error_to_porcelain(e) from e 631 break 632 633 resp = models.AccountGrantDeleteResponse() 634 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 635 plumbing_response.meta) 636 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 637 plumbing_response.rate_limit) 638 return resp 639 640 def list(self, filter, *args, timeout=None): 641 ''' 642 List gets a list of AccountGrants matching a given set of criteria. 643 ''' 644 req = AccountGrantListRequest() 645 req.meta.CopyFrom(ListRequestMetadata()) 646 if self.parent.page_limit > 0: 647 req.meta.limit = self.parent.page_limit 648 if self.parent.snapshot_datetime is not None: 649 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 650 651 req.filter = plumbing.quote_filter_args(filter, *args) 652 653 def generator(svc, req): 654 tries = 0 655 while True: 656 try: 657 plumbing_response = svc.stub.List( 658 req, 659 metadata=svc.parent.get_metadata( 660 'AccountGrants.List', req), 661 timeout=timeout) 662 except Exception as e: 663 if self.parent.shouldRetry(tries, e): 664 tries += 1 665 self.parent.jitterSleep(tries) 666 continue 667 raise plumbing.convert_error_to_porcelain(e) from e 668 tries = 0 669 for plumbing_item in plumbing_response.account_grants: 670 yield plumbing.convert_account_grant_to_porcelain( 671 plumbing_item) 672 if plumbing_response.meta.next_cursor == '': 673 break 674 req.meta.cursor = plumbing_response.meta.next_cursor 675 676 return generator(self, req)
AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
See strongdm.models.AccountGrant
.
538 def create(self, account_grant, timeout=None): 539 ''' 540 Create registers a new AccountGrant. 541 ''' 542 req = AccountGrantCreateRequest() 543 544 if account_grant is not None: 545 req.account_grant.CopyFrom( 546 plumbing.convert_account_grant_to_plumbing(account_grant)) 547 tries = 0 548 plumbing_response = None 549 while True: 550 try: 551 plumbing_response = self.stub.Create( 552 req, 553 metadata=self.parent.get_metadata('AccountGrants.Create', 554 req), 555 timeout=timeout) 556 except Exception as e: 557 if self.parent.shouldRetry(tries, e): 558 tries += 1 559 self.parent.jitterSleep(tries) 560 continue 561 raise plumbing.convert_error_to_porcelain(e) from e 562 break 563 564 resp = models.AccountGrantCreateResponse() 565 resp.account_grant = plumbing.convert_account_grant_to_porcelain( 566 plumbing_response.account_grant) 567 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 568 plumbing_response.meta) 569 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 570 plumbing_response.rate_limit) 571 return resp
Create registers a new AccountGrant.
573 def get(self, id, timeout=None): 574 ''' 575 Get reads one AccountGrant by ID. 576 ''' 577 req = AccountGrantGetRequest() 578 if self.parent.snapshot_datetime is not None: 579 req.meta.CopyFrom(GetRequestMetadata()) 580 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 581 582 req.id = (id) 583 tries = 0 584 plumbing_response = None 585 while True: 586 try: 587 plumbing_response = self.stub.Get( 588 req, 589 metadata=self.parent.get_metadata('AccountGrants.Get', 590 req), 591 timeout=timeout) 592 except Exception as e: 593 if self.parent.shouldRetry(tries, e): 594 tries += 1 595 self.parent.jitterSleep(tries) 596 continue 597 raise plumbing.convert_error_to_porcelain(e) from e 598 break 599 600 resp = models.AccountGrantGetResponse() 601 resp.account_grant = plumbing.convert_account_grant_to_porcelain( 602 plumbing_response.account_grant) 603 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 604 plumbing_response.meta) 605 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 606 plumbing_response.rate_limit) 607 return resp
Get reads one AccountGrant by ID.
609 def delete(self, id, timeout=None): 610 ''' 611 Delete removes a AccountGrant by ID. 612 ''' 613 req = AccountGrantDeleteRequest() 614 615 req.id = (id) 616 tries = 0 617 plumbing_response = None 618 while True: 619 try: 620 plumbing_response = self.stub.Delete( 621 req, 622 metadata=self.parent.get_metadata('AccountGrants.Delete', 623 req), 624 timeout=timeout) 625 except Exception as e: 626 if self.parent.shouldRetry(tries, e): 627 tries += 1 628 self.parent.jitterSleep(tries) 629 continue 630 raise plumbing.convert_error_to_porcelain(e) from e 631 break 632 633 resp = models.AccountGrantDeleteResponse() 634 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 635 plumbing_response.meta) 636 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 637 plumbing_response.rate_limit) 638 return resp
Delete removes a AccountGrant by ID.
640 def list(self, filter, *args, timeout=None): 641 ''' 642 List gets a list of AccountGrants matching a given set of criteria. 643 ''' 644 req = AccountGrantListRequest() 645 req.meta.CopyFrom(ListRequestMetadata()) 646 if self.parent.page_limit > 0: 647 req.meta.limit = self.parent.page_limit 648 if self.parent.snapshot_datetime is not None: 649 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 650 651 req.filter = plumbing.quote_filter_args(filter, *args) 652 653 def generator(svc, req): 654 tries = 0 655 while True: 656 try: 657 plumbing_response = svc.stub.List( 658 req, 659 metadata=svc.parent.get_metadata( 660 'AccountGrants.List', req), 661 timeout=timeout) 662 except Exception as e: 663 if self.parent.shouldRetry(tries, e): 664 tries += 1 665 self.parent.jitterSleep(tries) 666 continue 667 raise plumbing.convert_error_to_porcelain(e) from e 668 tries = 0 669 for plumbing_item in plumbing_response.account_grants: 670 yield plumbing.convert_account_grant_to_porcelain( 671 plumbing_item) 672 if plumbing_response.meta.next_cursor == '': 673 break 674 req.meta.cursor = plumbing_response.meta.next_cursor 675 676 return generator(self, req)
List gets a list of AccountGrants matching a given set of criteria.
679class SnapshotAccountGrants: 680 ''' 681 SnapshotAccountGrants exposes the read only methods of the AccountGrants 682 service for historical queries. 683 ''' 684 def __init__(self, account_grants): 685 self.account_grants = account_grants 686 687 def get(self, id, timeout=None): 688 ''' 689 Get reads one AccountGrant by ID. 690 ''' 691 return self.account_grants.get(id, timeout=timeout) 692 693 def list(self, filter, *args, timeout=None): 694 ''' 695 List gets a list of AccountGrants matching a given set of criteria. 696 ''' 697 return self.account_grants.list(filter, *args, timeout=timeout)
SnapshotAccountGrants exposes the read only methods of the AccountGrants service for historical queries.
687 def get(self, id, timeout=None): 688 ''' 689 Get reads one AccountGrant by ID. 690 ''' 691 return self.account_grants.get(id, timeout=timeout)
Get reads one AccountGrant by ID.
693 def list(self, filter, *args, timeout=None): 694 ''' 695 List gets a list of AccountGrants matching a given set of criteria. 696 ''' 697 return self.account_grants.list(filter, *args, timeout=timeout)
List gets a list of AccountGrants matching a given set of criteria.
700class AccountGrantsHistory: 701 ''' 702 AccountGrantsHistory records all changes to the state of an AccountGrant. 703 See `strongdm.models.AccountGrantHistory`. 704 ''' 705 def __init__(self, channel, client): 706 self.parent = client 707 self.stub = AccountGrantsHistoryStub(channel) 708 709 def list(self, filter, *args, timeout=None): 710 ''' 711 List gets a list of AccountGrantHistory records matching a given set of criteria. 712 ''' 713 req = AccountGrantHistoryListRequest() 714 req.meta.CopyFrom(ListRequestMetadata()) 715 if self.parent.page_limit > 0: 716 req.meta.limit = self.parent.page_limit 717 if self.parent.snapshot_datetime is not None: 718 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 719 720 req.filter = plumbing.quote_filter_args(filter, *args) 721 722 def generator(svc, req): 723 tries = 0 724 while True: 725 try: 726 plumbing_response = svc.stub.List( 727 req, 728 metadata=svc.parent.get_metadata( 729 'AccountGrantsHistory.List', req), 730 timeout=timeout) 731 except Exception as e: 732 if self.parent.shouldRetry(tries, e): 733 tries += 1 734 self.parent.jitterSleep(tries) 735 continue 736 raise plumbing.convert_error_to_porcelain(e) from e 737 tries = 0 738 for plumbing_item in plumbing_response.history: 739 yield plumbing.convert_account_grant_history_to_porcelain( 740 plumbing_item) 741 if plumbing_response.meta.next_cursor == '': 742 break 743 req.meta.cursor = plumbing_response.meta.next_cursor 744 745 return generator(self, req)
AccountGrantsHistory records all changes to the state of an AccountGrant.
See strongdm.models.AccountGrantHistory
.
709 def list(self, filter, *args, timeout=None): 710 ''' 711 List gets a list of AccountGrantHistory records matching a given set of criteria. 712 ''' 713 req = AccountGrantHistoryListRequest() 714 req.meta.CopyFrom(ListRequestMetadata()) 715 if self.parent.page_limit > 0: 716 req.meta.limit = self.parent.page_limit 717 if self.parent.snapshot_datetime is not None: 718 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 719 720 req.filter = plumbing.quote_filter_args(filter, *args) 721 722 def generator(svc, req): 723 tries = 0 724 while True: 725 try: 726 plumbing_response = svc.stub.List( 727 req, 728 metadata=svc.parent.get_metadata( 729 'AccountGrantsHistory.List', req), 730 timeout=timeout) 731 except Exception as e: 732 if self.parent.shouldRetry(tries, e): 733 tries += 1 734 self.parent.jitterSleep(tries) 735 continue 736 raise plumbing.convert_error_to_porcelain(e) from e 737 tries = 0 738 for plumbing_item in plumbing_response.history: 739 yield plumbing.convert_account_grant_history_to_porcelain( 740 plumbing_item) 741 if plumbing_response.meta.next_cursor == '': 742 break 743 req.meta.cursor = plumbing_response.meta.next_cursor 744 745 return generator(self, req)
List gets a list of AccountGrantHistory records matching a given set of criteria.
748class AccountPermissions: 749 ''' 750 AccountPermissions records the granular permissions accounts have, allowing them to execute 751 relevant commands via StrongDM's APIs. 752 See `strongdm.models.AccountPermission`. 753 ''' 754 def __init__(self, channel, client): 755 self.parent = client 756 self.stub = AccountPermissionsStub(channel) 757 758 def list(self, filter, *args, timeout=None): 759 ''' 760 List gets a list of Permission records matching a given set of criteria. 761 ''' 762 req = AccountPermissionListRequest() 763 req.meta.CopyFrom(ListRequestMetadata()) 764 if self.parent.page_limit > 0: 765 req.meta.limit = self.parent.page_limit 766 if self.parent.snapshot_datetime is not None: 767 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 768 769 req.filter = plumbing.quote_filter_args(filter, *args) 770 771 def generator(svc, req): 772 tries = 0 773 while True: 774 try: 775 plumbing_response = svc.stub.List( 776 req, 777 metadata=svc.parent.get_metadata( 778 'AccountPermissions.List', req), 779 timeout=timeout) 780 except Exception as e: 781 if self.parent.shouldRetry(tries, e): 782 tries += 1 783 self.parent.jitterSleep(tries) 784 continue 785 raise plumbing.convert_error_to_porcelain(e) from e 786 tries = 0 787 for plumbing_item in plumbing_response.permissions: 788 yield plumbing.convert_account_permission_to_porcelain( 789 plumbing_item) 790 if plumbing_response.meta.next_cursor == '': 791 break 792 req.meta.cursor = plumbing_response.meta.next_cursor 793 794 return generator(self, req)
AccountPermissions records the granular permissions accounts have, allowing them to execute
relevant commands via StrongDM's APIs.
See strongdm.models.AccountPermission
.
758 def list(self, filter, *args, timeout=None): 759 ''' 760 List gets a list of Permission records matching a given set of criteria. 761 ''' 762 req = AccountPermissionListRequest() 763 req.meta.CopyFrom(ListRequestMetadata()) 764 if self.parent.page_limit > 0: 765 req.meta.limit = self.parent.page_limit 766 if self.parent.snapshot_datetime is not None: 767 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 768 769 req.filter = plumbing.quote_filter_args(filter, *args) 770 771 def generator(svc, req): 772 tries = 0 773 while True: 774 try: 775 plumbing_response = svc.stub.List( 776 req, 777 metadata=svc.parent.get_metadata( 778 'AccountPermissions.List', req), 779 timeout=timeout) 780 except Exception as e: 781 if self.parent.shouldRetry(tries, e): 782 tries += 1 783 self.parent.jitterSleep(tries) 784 continue 785 raise plumbing.convert_error_to_porcelain(e) from e 786 tries = 0 787 for plumbing_item in plumbing_response.permissions: 788 yield plumbing.convert_account_permission_to_porcelain( 789 plumbing_item) 790 if plumbing_response.meta.next_cursor == '': 791 break 792 req.meta.cursor = plumbing_response.meta.next_cursor 793 794 return generator(self, req)
List gets a list of Permission records matching a given set of criteria.
797class SnapshotAccountPermissions: 798 ''' 799 SnapshotAccountPermissions exposes the read only methods of the AccountPermissions 800 service for historical queries. 801 ''' 802 def __init__(self, account_permissions): 803 self.account_permissions = account_permissions 804 805 def list(self, filter, *args, timeout=None): 806 ''' 807 List gets a list of Permission records matching a given set of criteria. 808 ''' 809 return self.account_permissions.list(filter, *args, timeout=timeout)
SnapshotAccountPermissions exposes the read only methods of the AccountPermissions service for historical queries.
805 def list(self, filter, *args, timeout=None): 806 ''' 807 List gets a list of Permission records matching a given set of criteria. 808 ''' 809 return self.account_permissions.list(filter, *args, timeout=timeout)
List gets a list of Permission records matching a given set of criteria.
812class AccountResources: 813 ''' 814 AccountResources enumerates the resources to which accounts have access. 815 The AccountResources service is read-only. 816 See `strongdm.models.AccountResource`. 817 ''' 818 def __init__(self, channel, client): 819 self.parent = client 820 self.stub = AccountResourcesStub(channel) 821 822 def list(self, filter, *args, timeout=None): 823 ''' 824 List gets a list of AccountResource records matching a given set of criteria. 825 ''' 826 req = AccountResourceListRequest() 827 req.meta.CopyFrom(ListRequestMetadata()) 828 if self.parent.page_limit > 0: 829 req.meta.limit = self.parent.page_limit 830 if self.parent.snapshot_datetime is not None: 831 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 832 833 req.filter = plumbing.quote_filter_args(filter, *args) 834 835 def generator(svc, req): 836 tries = 0 837 while True: 838 try: 839 plumbing_response = svc.stub.List( 840 req, 841 metadata=svc.parent.get_metadata( 842 'AccountResources.List', req), 843 timeout=timeout) 844 except Exception as e: 845 if self.parent.shouldRetry(tries, e): 846 tries += 1 847 self.parent.jitterSleep(tries) 848 continue 849 raise plumbing.convert_error_to_porcelain(e) from e 850 tries = 0 851 for plumbing_item in plumbing_response.account_resources: 852 yield plumbing.convert_account_resource_to_porcelain( 853 plumbing_item) 854 if plumbing_response.meta.next_cursor == '': 855 break 856 req.meta.cursor = plumbing_response.meta.next_cursor 857 858 return generator(self, req)
AccountResources enumerates the resources to which accounts have access.
The AccountResources service is read-only.
See strongdm.models.AccountResource
.
822 def list(self, filter, *args, timeout=None): 823 ''' 824 List gets a list of AccountResource records matching a given set of criteria. 825 ''' 826 req = AccountResourceListRequest() 827 req.meta.CopyFrom(ListRequestMetadata()) 828 if self.parent.page_limit > 0: 829 req.meta.limit = self.parent.page_limit 830 if self.parent.snapshot_datetime is not None: 831 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 832 833 req.filter = plumbing.quote_filter_args(filter, *args) 834 835 def generator(svc, req): 836 tries = 0 837 while True: 838 try: 839 plumbing_response = svc.stub.List( 840 req, 841 metadata=svc.parent.get_metadata( 842 'AccountResources.List', req), 843 timeout=timeout) 844 except Exception as e: 845 if self.parent.shouldRetry(tries, e): 846 tries += 1 847 self.parent.jitterSleep(tries) 848 continue 849 raise plumbing.convert_error_to_porcelain(e) from e 850 tries = 0 851 for plumbing_item in plumbing_response.account_resources: 852 yield plumbing.convert_account_resource_to_porcelain( 853 plumbing_item) 854 if plumbing_response.meta.next_cursor == '': 855 break 856 req.meta.cursor = plumbing_response.meta.next_cursor 857 858 return generator(self, req)
List gets a list of AccountResource records matching a given set of criteria.
861class SnapshotAccountResources: 862 ''' 863 SnapshotAccountResources exposes the read only methods of the AccountResources 864 service for historical queries. 865 ''' 866 def __init__(self, account_resources): 867 self.account_resources = account_resources 868 869 def list(self, filter, *args, timeout=None): 870 ''' 871 List gets a list of AccountResource records matching a given set of criteria. 872 ''' 873 return self.account_resources.list(filter, *args, timeout=timeout)
SnapshotAccountResources exposes the read only methods of the AccountResources service for historical queries.
869 def list(self, filter, *args, timeout=None): 870 ''' 871 List gets a list of AccountResource records matching a given set of criteria. 872 ''' 873 return self.account_resources.list(filter, *args, timeout=timeout)
List gets a list of AccountResource records matching a given set of criteria.
876class AccountResourcesHistory: 877 ''' 878 AccountResourcesHistory records all changes to the state of a AccountResource. 879 See `strongdm.models.AccountResourceHistory`. 880 ''' 881 def __init__(self, channel, client): 882 self.parent = client 883 self.stub = AccountResourcesHistoryStub(channel) 884 885 def list(self, filter, *args, timeout=None): 886 ''' 887 List gets a list of AccountResourceHistory records matching a given set of criteria. 888 ''' 889 req = AccountResourceHistoryListRequest() 890 req.meta.CopyFrom(ListRequestMetadata()) 891 if self.parent.page_limit > 0: 892 req.meta.limit = self.parent.page_limit 893 if self.parent.snapshot_datetime is not None: 894 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 895 896 req.filter = plumbing.quote_filter_args(filter, *args) 897 898 def generator(svc, req): 899 tries = 0 900 while True: 901 try: 902 plumbing_response = svc.stub.List( 903 req, 904 metadata=svc.parent.get_metadata( 905 'AccountResourcesHistory.List', req), 906 timeout=timeout) 907 except Exception as e: 908 if self.parent.shouldRetry(tries, e): 909 tries += 1 910 self.parent.jitterSleep(tries) 911 continue 912 raise plumbing.convert_error_to_porcelain(e) from e 913 tries = 0 914 for plumbing_item in plumbing_response.history: 915 yield plumbing.convert_account_resource_history_to_porcelain( 916 plumbing_item) 917 if plumbing_response.meta.next_cursor == '': 918 break 919 req.meta.cursor = plumbing_response.meta.next_cursor 920 921 return generator(self, req)
AccountResourcesHistory records all changes to the state of a AccountResource.
See strongdm.models.AccountResourceHistory
.
885 def list(self, filter, *args, timeout=None): 886 ''' 887 List gets a list of AccountResourceHistory records matching a given set of criteria. 888 ''' 889 req = AccountResourceHistoryListRequest() 890 req.meta.CopyFrom(ListRequestMetadata()) 891 if self.parent.page_limit > 0: 892 req.meta.limit = self.parent.page_limit 893 if self.parent.snapshot_datetime is not None: 894 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 895 896 req.filter = plumbing.quote_filter_args(filter, *args) 897 898 def generator(svc, req): 899 tries = 0 900 while True: 901 try: 902 plumbing_response = svc.stub.List( 903 req, 904 metadata=svc.parent.get_metadata( 905 'AccountResourcesHistory.List', req), 906 timeout=timeout) 907 except Exception as e: 908 if self.parent.shouldRetry(tries, e): 909 tries += 1 910 self.parent.jitterSleep(tries) 911 continue 912 raise plumbing.convert_error_to_porcelain(e) from e 913 tries = 0 914 for plumbing_item in plumbing_response.history: 915 yield plumbing.convert_account_resource_history_to_porcelain( 916 plumbing_item) 917 if plumbing_response.meta.next_cursor == '': 918 break 919 req.meta.cursor = plumbing_response.meta.next_cursor 920 921 return generator(self, req)
List gets a list of AccountResourceHistory records matching a given set of criteria.
924class Accounts: 925 ''' 926 Accounts are users that have access to strongDM. There are two types of accounts: 927 1. **Users:** humans who are authenticated through username and password or SSO. 928 2. **Service Accounts:** machines that are authenticated using a service token. 929 3. **Tokens** are access keys with permissions that can be used for authentication. 930 See: 931 `strongdm.models.Service` 932 `strongdm.models.Token` 933 `strongdm.models.User` 934 ''' 935 def __init__(self, channel, client): 936 self.parent = client 937 self.stub = AccountsStub(channel) 938 939 def create(self, account, timeout=None): 940 ''' 941 Create registers a new Account. 942 ''' 943 req = AccountCreateRequest() 944 945 if account is not None: 946 req.account.CopyFrom(plumbing.convert_account_to_plumbing(account)) 947 tries = 0 948 plumbing_response = None 949 while True: 950 try: 951 plumbing_response = self.stub.Create( 952 req, 953 metadata=self.parent.get_metadata('Accounts.Create', req), 954 timeout=timeout) 955 except Exception as e: 956 if self.parent.shouldRetry(tries, e): 957 tries += 1 958 self.parent.jitterSleep(tries) 959 continue 960 raise plumbing.convert_error_to_porcelain(e) from e 961 break 962 963 resp = models.AccountCreateResponse() 964 resp.access_key = (plumbing_response.access_key) 965 resp.account = plumbing.convert_account_to_porcelain( 966 plumbing_response.account) 967 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 968 plumbing_response.meta) 969 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 970 plumbing_response.rate_limit) 971 resp.secret_key = (plumbing_response.secret_key) 972 resp.token = (plumbing_response.token) 973 return resp 974 975 def get(self, id, timeout=None): 976 ''' 977 Get reads one Account by ID. 978 ''' 979 req = AccountGetRequest() 980 if self.parent.snapshot_datetime is not None: 981 req.meta.CopyFrom(GetRequestMetadata()) 982 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 983 984 req.id = (id) 985 tries = 0 986 plumbing_response = None 987 while True: 988 try: 989 plumbing_response = self.stub.Get( 990 req, 991 metadata=self.parent.get_metadata('Accounts.Get', req), 992 timeout=timeout) 993 except Exception as e: 994 if self.parent.shouldRetry(tries, e): 995 tries += 1 996 self.parent.jitterSleep(tries) 997 continue 998 raise plumbing.convert_error_to_porcelain(e) from e 999 break 1000 1001 resp = models.AccountGetResponse() 1002 resp.account = plumbing.convert_account_to_porcelain( 1003 plumbing_response.account) 1004 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1005 plumbing_response.meta) 1006 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1007 plumbing_response.rate_limit) 1008 return resp 1009 1010 def update(self, account, timeout=None): 1011 ''' 1012 Update replaces all the fields of an Account by ID. 1013 ''' 1014 req = AccountUpdateRequest() 1015 1016 if account is not None: 1017 req.account.CopyFrom(plumbing.convert_account_to_plumbing(account)) 1018 tries = 0 1019 plumbing_response = None 1020 while True: 1021 try: 1022 plumbing_response = self.stub.Update( 1023 req, 1024 metadata=self.parent.get_metadata('Accounts.Update', req), 1025 timeout=timeout) 1026 except Exception as e: 1027 if self.parent.shouldRetry(tries, e): 1028 tries += 1 1029 self.parent.jitterSleep(tries) 1030 continue 1031 raise plumbing.convert_error_to_porcelain(e) from e 1032 break 1033 1034 resp = models.AccountUpdateResponse() 1035 resp.account = plumbing.convert_account_to_porcelain( 1036 plumbing_response.account) 1037 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 1038 plumbing_response.meta) 1039 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1040 plumbing_response.rate_limit) 1041 return resp 1042 1043 def delete(self, id, timeout=None): 1044 ''' 1045 Delete removes an Account by ID. 1046 ''' 1047 req = AccountDeleteRequest() 1048 1049 req.id = (id) 1050 tries = 0 1051 plumbing_response = None 1052 while True: 1053 try: 1054 plumbing_response = self.stub.Delete( 1055 req, 1056 metadata=self.parent.get_metadata('Accounts.Delete', req), 1057 timeout=timeout) 1058 except Exception as e: 1059 if self.parent.shouldRetry(tries, e): 1060 tries += 1 1061 self.parent.jitterSleep(tries) 1062 continue 1063 raise plumbing.convert_error_to_porcelain(e) from e 1064 break 1065 1066 resp = models.AccountDeleteResponse() 1067 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 1068 plumbing_response.meta) 1069 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1070 plumbing_response.rate_limit) 1071 return resp 1072 1073 def list(self, filter, *args, timeout=None): 1074 ''' 1075 List gets a list of Accounts matching a given set of criteria. 1076 ''' 1077 req = AccountListRequest() 1078 req.meta.CopyFrom(ListRequestMetadata()) 1079 if self.parent.page_limit > 0: 1080 req.meta.limit = self.parent.page_limit 1081 if self.parent.snapshot_datetime is not None: 1082 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1083 1084 req.filter = plumbing.quote_filter_args(filter, *args) 1085 1086 def generator(svc, req): 1087 tries = 0 1088 while True: 1089 try: 1090 plumbing_response = svc.stub.List( 1091 req, 1092 metadata=svc.parent.get_metadata('Accounts.List', req), 1093 timeout=timeout) 1094 except Exception as e: 1095 if self.parent.shouldRetry(tries, e): 1096 tries += 1 1097 self.parent.jitterSleep(tries) 1098 continue 1099 raise plumbing.convert_error_to_porcelain(e) from e 1100 tries = 0 1101 for plumbing_item in plumbing_response.accounts: 1102 yield plumbing.convert_account_to_porcelain(plumbing_item) 1103 if plumbing_response.meta.next_cursor == '': 1104 break 1105 req.meta.cursor = plumbing_response.meta.next_cursor 1106 1107 return generator(self, req)
Accounts are users that have access to strongDM. There are two types of accounts:
- Users: humans who are authenticated through username and password or SSO.
- Service Accounts: machines that are authenticated using a service token.
- Tokens are access keys with permissions that can be used for authentication.
See:
strongdm.models.Service
strongdm.models.Token
strongdm.models.User
939 def create(self, account, timeout=None): 940 ''' 941 Create registers a new Account. 942 ''' 943 req = AccountCreateRequest() 944 945 if account is not None: 946 req.account.CopyFrom(plumbing.convert_account_to_plumbing(account)) 947 tries = 0 948 plumbing_response = None 949 while True: 950 try: 951 plumbing_response = self.stub.Create( 952 req, 953 metadata=self.parent.get_metadata('Accounts.Create', req), 954 timeout=timeout) 955 except Exception as e: 956 if self.parent.shouldRetry(tries, e): 957 tries += 1 958 self.parent.jitterSleep(tries) 959 continue 960 raise plumbing.convert_error_to_porcelain(e) from e 961 break 962 963 resp = models.AccountCreateResponse() 964 resp.access_key = (plumbing_response.access_key) 965 resp.account = plumbing.convert_account_to_porcelain( 966 plumbing_response.account) 967 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 968 plumbing_response.meta) 969 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 970 plumbing_response.rate_limit) 971 resp.secret_key = (plumbing_response.secret_key) 972 resp.token = (plumbing_response.token) 973 return resp
Create registers a new Account.
975 def get(self, id, timeout=None): 976 ''' 977 Get reads one Account by ID. 978 ''' 979 req = AccountGetRequest() 980 if self.parent.snapshot_datetime is not None: 981 req.meta.CopyFrom(GetRequestMetadata()) 982 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 983 984 req.id = (id) 985 tries = 0 986 plumbing_response = None 987 while True: 988 try: 989 plumbing_response = self.stub.Get( 990 req, 991 metadata=self.parent.get_metadata('Accounts.Get', req), 992 timeout=timeout) 993 except Exception as e: 994 if self.parent.shouldRetry(tries, e): 995 tries += 1 996 self.parent.jitterSleep(tries) 997 continue 998 raise plumbing.convert_error_to_porcelain(e) from e 999 break 1000 1001 resp = models.AccountGetResponse() 1002 resp.account = plumbing.convert_account_to_porcelain( 1003 plumbing_response.account) 1004 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1005 plumbing_response.meta) 1006 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1007 plumbing_response.rate_limit) 1008 return resp
Get reads one Account by ID.
1010 def update(self, account, timeout=None): 1011 ''' 1012 Update replaces all the fields of an Account by ID. 1013 ''' 1014 req = AccountUpdateRequest() 1015 1016 if account is not None: 1017 req.account.CopyFrom(plumbing.convert_account_to_plumbing(account)) 1018 tries = 0 1019 plumbing_response = None 1020 while True: 1021 try: 1022 plumbing_response = self.stub.Update( 1023 req, 1024 metadata=self.parent.get_metadata('Accounts.Update', req), 1025 timeout=timeout) 1026 except Exception as e: 1027 if self.parent.shouldRetry(tries, e): 1028 tries += 1 1029 self.parent.jitterSleep(tries) 1030 continue 1031 raise plumbing.convert_error_to_porcelain(e) from e 1032 break 1033 1034 resp = models.AccountUpdateResponse() 1035 resp.account = plumbing.convert_account_to_porcelain( 1036 plumbing_response.account) 1037 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 1038 plumbing_response.meta) 1039 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1040 plumbing_response.rate_limit) 1041 return resp
Update replaces all the fields of an Account by ID.
1043 def delete(self, id, timeout=None): 1044 ''' 1045 Delete removes an Account by ID. 1046 ''' 1047 req = AccountDeleteRequest() 1048 1049 req.id = (id) 1050 tries = 0 1051 plumbing_response = None 1052 while True: 1053 try: 1054 plumbing_response = self.stub.Delete( 1055 req, 1056 metadata=self.parent.get_metadata('Accounts.Delete', req), 1057 timeout=timeout) 1058 except Exception as e: 1059 if self.parent.shouldRetry(tries, e): 1060 tries += 1 1061 self.parent.jitterSleep(tries) 1062 continue 1063 raise plumbing.convert_error_to_porcelain(e) from e 1064 break 1065 1066 resp = models.AccountDeleteResponse() 1067 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 1068 plumbing_response.meta) 1069 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1070 plumbing_response.rate_limit) 1071 return resp
Delete removes an Account by ID.
1073 def list(self, filter, *args, timeout=None): 1074 ''' 1075 List gets a list of Accounts matching a given set of criteria. 1076 ''' 1077 req = AccountListRequest() 1078 req.meta.CopyFrom(ListRequestMetadata()) 1079 if self.parent.page_limit > 0: 1080 req.meta.limit = self.parent.page_limit 1081 if self.parent.snapshot_datetime is not None: 1082 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1083 1084 req.filter = plumbing.quote_filter_args(filter, *args) 1085 1086 def generator(svc, req): 1087 tries = 0 1088 while True: 1089 try: 1090 plumbing_response = svc.stub.List( 1091 req, 1092 metadata=svc.parent.get_metadata('Accounts.List', req), 1093 timeout=timeout) 1094 except Exception as e: 1095 if self.parent.shouldRetry(tries, e): 1096 tries += 1 1097 self.parent.jitterSleep(tries) 1098 continue 1099 raise plumbing.convert_error_to_porcelain(e) from e 1100 tries = 0 1101 for plumbing_item in plumbing_response.accounts: 1102 yield plumbing.convert_account_to_porcelain(plumbing_item) 1103 if plumbing_response.meta.next_cursor == '': 1104 break 1105 req.meta.cursor = plumbing_response.meta.next_cursor 1106 1107 return generator(self, req)
List gets a list of Accounts matching a given set of criteria.
1110class SnapshotAccounts: 1111 ''' 1112 SnapshotAccounts exposes the read only methods of the Accounts 1113 service for historical queries. 1114 ''' 1115 def __init__(self, accounts): 1116 self.accounts = accounts 1117 1118 def get(self, id, timeout=None): 1119 ''' 1120 Get reads one Account by ID. 1121 ''' 1122 return self.accounts.get(id, timeout=timeout) 1123 1124 def list(self, filter, *args, timeout=None): 1125 ''' 1126 List gets a list of Accounts matching a given set of criteria. 1127 ''' 1128 return self.accounts.list(filter, *args, timeout=timeout)
SnapshotAccounts exposes the read only methods of the Accounts service for historical queries.
1118 def get(self, id, timeout=None): 1119 ''' 1120 Get reads one Account by ID. 1121 ''' 1122 return self.accounts.get(id, timeout=timeout)
Get reads one Account by ID.
1124 def list(self, filter, *args, timeout=None): 1125 ''' 1126 List gets a list of Accounts matching a given set of criteria. 1127 ''' 1128 return self.accounts.list(filter, *args, timeout=timeout)
List gets a list of Accounts matching a given set of criteria.
1131class AccountsHistory: 1132 ''' 1133 AccountsHistory records all changes to the state of an Account. 1134 See `strongdm.models.AccountHistory`. 1135 ''' 1136 def __init__(self, channel, client): 1137 self.parent = client 1138 self.stub = AccountsHistoryStub(channel) 1139 1140 def list(self, filter, *args, timeout=None): 1141 ''' 1142 List gets a list of AccountHistory records matching a given set of criteria. 1143 ''' 1144 req = AccountHistoryListRequest() 1145 req.meta.CopyFrom(ListRequestMetadata()) 1146 if self.parent.page_limit > 0: 1147 req.meta.limit = self.parent.page_limit 1148 if self.parent.snapshot_datetime is not None: 1149 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1150 1151 req.filter = plumbing.quote_filter_args(filter, *args) 1152 1153 def generator(svc, req): 1154 tries = 0 1155 while True: 1156 try: 1157 plumbing_response = svc.stub.List( 1158 req, 1159 metadata=svc.parent.get_metadata( 1160 'AccountsHistory.List', req), 1161 timeout=timeout) 1162 except Exception as e: 1163 if self.parent.shouldRetry(tries, e): 1164 tries += 1 1165 self.parent.jitterSleep(tries) 1166 continue 1167 raise plumbing.convert_error_to_porcelain(e) from e 1168 tries = 0 1169 for plumbing_item in plumbing_response.history: 1170 yield plumbing.convert_account_history_to_porcelain( 1171 plumbing_item) 1172 if plumbing_response.meta.next_cursor == '': 1173 break 1174 req.meta.cursor = plumbing_response.meta.next_cursor 1175 1176 return generator(self, req)
AccountsHistory records all changes to the state of an Account.
See strongdm.models.AccountHistory
.
1140 def list(self, filter, *args, timeout=None): 1141 ''' 1142 List gets a list of AccountHistory records matching a given set of criteria. 1143 ''' 1144 req = AccountHistoryListRequest() 1145 req.meta.CopyFrom(ListRequestMetadata()) 1146 if self.parent.page_limit > 0: 1147 req.meta.limit = self.parent.page_limit 1148 if self.parent.snapshot_datetime is not None: 1149 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1150 1151 req.filter = plumbing.quote_filter_args(filter, *args) 1152 1153 def generator(svc, req): 1154 tries = 0 1155 while True: 1156 try: 1157 plumbing_response = svc.stub.List( 1158 req, 1159 metadata=svc.parent.get_metadata( 1160 'AccountsHistory.List', req), 1161 timeout=timeout) 1162 except Exception as e: 1163 if self.parent.shouldRetry(tries, e): 1164 tries += 1 1165 self.parent.jitterSleep(tries) 1166 continue 1167 raise plumbing.convert_error_to_porcelain(e) from e 1168 tries = 0 1169 for plumbing_item in plumbing_response.history: 1170 yield plumbing.convert_account_history_to_porcelain( 1171 plumbing_item) 1172 if plumbing_response.meta.next_cursor == '': 1173 break 1174 req.meta.cursor = plumbing_response.meta.next_cursor 1175 1176 return generator(self, req)
List gets a list of AccountHistory records matching a given set of criteria.
1179class Activities: 1180 ''' 1181 An Activity is a record of an action taken against a strongDM deployment, e.g. 1182 a user creation, resource deletion, sso configuration change, etc. The Activities 1183 service is read-only. 1184 See `strongdm.models.Activity`. 1185 ''' 1186 def __init__(self, channel, client): 1187 self.parent = client 1188 self.stub = ActivitiesStub(channel) 1189 1190 def get(self, id, timeout=None): 1191 ''' 1192 Get reads one Activity by ID. 1193 ''' 1194 req = ActivityGetRequest() 1195 if self.parent.snapshot_datetime is not None: 1196 req.meta.CopyFrom(GetRequestMetadata()) 1197 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1198 1199 req.id = (id) 1200 tries = 0 1201 plumbing_response = None 1202 while True: 1203 try: 1204 plumbing_response = self.stub.Get( 1205 req, 1206 metadata=self.parent.get_metadata('Activities.Get', req), 1207 timeout=timeout) 1208 except Exception as e: 1209 if self.parent.shouldRetry(tries, e): 1210 tries += 1 1211 self.parent.jitterSleep(tries) 1212 continue 1213 raise plumbing.convert_error_to_porcelain(e) from e 1214 break 1215 1216 resp = models.ActivityGetResponse() 1217 resp.activity = plumbing.convert_activity_to_porcelain( 1218 plumbing_response.activity) 1219 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1220 plumbing_response.meta) 1221 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1222 plumbing_response.rate_limit) 1223 return resp 1224 1225 def list(self, filter, *args, timeout=None): 1226 ''' 1227 List gets a list of Activities matching a given set of criteria. 1228 The 'before' and 'after' filters can be used to control the time 1229 range of the output activities. If not provided, one week of back 1230 of activities will be returned. 1231 ''' 1232 req = ActivityListRequest() 1233 req.meta.CopyFrom(ListRequestMetadata()) 1234 if self.parent.page_limit > 0: 1235 req.meta.limit = self.parent.page_limit 1236 if self.parent.snapshot_datetime is not None: 1237 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1238 1239 req.filter = plumbing.quote_filter_args(filter, *args) 1240 1241 def generator(svc, req): 1242 tries = 0 1243 while True: 1244 try: 1245 plumbing_response = svc.stub.List( 1246 req, 1247 metadata=svc.parent.get_metadata( 1248 'Activities.List', req), 1249 timeout=timeout) 1250 except Exception as e: 1251 if self.parent.shouldRetry(tries, e): 1252 tries += 1 1253 self.parent.jitterSleep(tries) 1254 continue 1255 raise plumbing.convert_error_to_porcelain(e) from e 1256 tries = 0 1257 for plumbing_item in plumbing_response.activities: 1258 yield plumbing.convert_activity_to_porcelain(plumbing_item) 1259 if plumbing_response.meta.next_cursor == '': 1260 break 1261 req.meta.cursor = plumbing_response.meta.next_cursor 1262 1263 return generator(self, req)
An Activity is a record of an action taken against a strongDM deployment, e.g.
a user creation, resource deletion, sso configuration change, etc. The Activities
service is read-only.
See strongdm.models.Activity
.
1190 def get(self, id, timeout=None): 1191 ''' 1192 Get reads one Activity by ID. 1193 ''' 1194 req = ActivityGetRequest() 1195 if self.parent.snapshot_datetime is not None: 1196 req.meta.CopyFrom(GetRequestMetadata()) 1197 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1198 1199 req.id = (id) 1200 tries = 0 1201 plumbing_response = None 1202 while True: 1203 try: 1204 plumbing_response = self.stub.Get( 1205 req, 1206 metadata=self.parent.get_metadata('Activities.Get', req), 1207 timeout=timeout) 1208 except Exception as e: 1209 if self.parent.shouldRetry(tries, e): 1210 tries += 1 1211 self.parent.jitterSleep(tries) 1212 continue 1213 raise plumbing.convert_error_to_porcelain(e) from e 1214 break 1215 1216 resp = models.ActivityGetResponse() 1217 resp.activity = plumbing.convert_activity_to_porcelain( 1218 plumbing_response.activity) 1219 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1220 plumbing_response.meta) 1221 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1222 plumbing_response.rate_limit) 1223 return resp
Get reads one Activity by ID.
1225 def list(self, filter, *args, timeout=None): 1226 ''' 1227 List gets a list of Activities matching a given set of criteria. 1228 The 'before' and 'after' filters can be used to control the time 1229 range of the output activities. If not provided, one week of back 1230 of activities will be returned. 1231 ''' 1232 req = ActivityListRequest() 1233 req.meta.CopyFrom(ListRequestMetadata()) 1234 if self.parent.page_limit > 0: 1235 req.meta.limit = self.parent.page_limit 1236 if self.parent.snapshot_datetime is not None: 1237 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1238 1239 req.filter = plumbing.quote_filter_args(filter, *args) 1240 1241 def generator(svc, req): 1242 tries = 0 1243 while True: 1244 try: 1245 plumbing_response = svc.stub.List( 1246 req, 1247 metadata=svc.parent.get_metadata( 1248 'Activities.List', req), 1249 timeout=timeout) 1250 except Exception as e: 1251 if self.parent.shouldRetry(tries, e): 1252 tries += 1 1253 self.parent.jitterSleep(tries) 1254 continue 1255 raise plumbing.convert_error_to_porcelain(e) from e 1256 tries = 0 1257 for plumbing_item in plumbing_response.activities: 1258 yield plumbing.convert_activity_to_porcelain(plumbing_item) 1259 if plumbing_response.meta.next_cursor == '': 1260 break 1261 req.meta.cursor = plumbing_response.meta.next_cursor 1262 1263 return generator(self, req)
List gets a list of Activities matching a given set of criteria. The 'before' and 'after' filters can be used to control the time range of the output activities. If not provided, one week of back of activities will be returned.
1266class ApprovalWorkflowApprovers: 1267 ''' 1268 ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep 1269 See `strongdm.models.ApprovalWorkflowApprover`. 1270 ''' 1271 def __init__(self, channel, client): 1272 self.parent = client 1273 self.stub = ApprovalWorkflowApproversStub(channel) 1274 1275 def create(self, approval_workflow_approver, timeout=None): 1276 ''' 1277 Create creates a new approval workflow approver. 1278 ''' 1279 req = ApprovalWorkflowApproverCreateRequest() 1280 1281 if approval_workflow_approver is not None: 1282 req.approval_workflow_approver.CopyFrom( 1283 plumbing.convert_approval_workflow_approver_to_plumbing( 1284 approval_workflow_approver)) 1285 tries = 0 1286 plumbing_response = None 1287 while True: 1288 try: 1289 plumbing_response = self.stub.Create( 1290 req, 1291 metadata=self.parent.get_metadata( 1292 'ApprovalWorkflowApprovers.Create', req), 1293 timeout=timeout) 1294 except Exception as e: 1295 if self.parent.shouldRetry(tries, e): 1296 tries += 1 1297 self.parent.jitterSleep(tries) 1298 continue 1299 raise plumbing.convert_error_to_porcelain(e) from e 1300 break 1301 1302 resp = models.ApprovalWorkflowApproverCreateResponse() 1303 resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain( 1304 plumbing_response.approval_workflow_approver) 1305 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1306 plumbing_response.rate_limit) 1307 return resp 1308 1309 def get(self, id, timeout=None): 1310 ''' 1311 Get reads one approval workflow approver by ID. 1312 ''' 1313 req = ApprovalWorkflowApproverGetRequest() 1314 if self.parent.snapshot_datetime is not None: 1315 req.meta.CopyFrom(GetRequestMetadata()) 1316 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1317 1318 req.id = (id) 1319 tries = 0 1320 plumbing_response = None 1321 while True: 1322 try: 1323 plumbing_response = self.stub.Get( 1324 req, 1325 metadata=self.parent.get_metadata( 1326 'ApprovalWorkflowApprovers.Get', req), 1327 timeout=timeout) 1328 except Exception as e: 1329 if self.parent.shouldRetry(tries, e): 1330 tries += 1 1331 self.parent.jitterSleep(tries) 1332 continue 1333 raise plumbing.convert_error_to_porcelain(e) from e 1334 break 1335 1336 resp = models.ApprovalWorkflowApproverGetResponse() 1337 resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain( 1338 plumbing_response.approval_workflow_approver) 1339 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1340 plumbing_response.meta) 1341 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1342 plumbing_response.rate_limit) 1343 return resp 1344 1345 def delete(self, id, timeout=None): 1346 ''' 1347 Delete deletes an existing approval workflow approver. 1348 ''' 1349 req = ApprovalWorkflowApproverDeleteRequest() 1350 1351 req.id = (id) 1352 tries = 0 1353 plumbing_response = None 1354 while True: 1355 try: 1356 plumbing_response = self.stub.Delete( 1357 req, 1358 metadata=self.parent.get_metadata( 1359 'ApprovalWorkflowApprovers.Delete', req), 1360 timeout=timeout) 1361 except Exception as e: 1362 if self.parent.shouldRetry(tries, e): 1363 tries += 1 1364 self.parent.jitterSleep(tries) 1365 continue 1366 raise plumbing.convert_error_to_porcelain(e) from e 1367 break 1368 1369 resp = models.ApprovalWorkflowApproverDeleteResponse() 1370 resp.id = (plumbing_response.id) 1371 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1372 plumbing_response.rate_limit) 1373 return resp 1374 1375 def list(self, filter, *args, timeout=None): 1376 ''' 1377 Lists existing approval workflow approvers. 1378 ''' 1379 req = ApprovalWorkflowApproverListRequest() 1380 req.meta.CopyFrom(ListRequestMetadata()) 1381 if self.parent.page_limit > 0: 1382 req.meta.limit = self.parent.page_limit 1383 if self.parent.snapshot_datetime is not None: 1384 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1385 1386 req.filter = plumbing.quote_filter_args(filter, *args) 1387 1388 def generator(svc, req): 1389 tries = 0 1390 while True: 1391 try: 1392 plumbing_response = svc.stub.List( 1393 req, 1394 metadata=svc.parent.get_metadata( 1395 'ApprovalWorkflowApprovers.List', req), 1396 timeout=timeout) 1397 except Exception as e: 1398 if self.parent.shouldRetry(tries, e): 1399 tries += 1 1400 self.parent.jitterSleep(tries) 1401 continue 1402 raise plumbing.convert_error_to_porcelain(e) from e 1403 tries = 0 1404 for plumbing_item in plumbing_response.approval_workflow_approvers: 1405 yield plumbing.convert_approval_workflow_approver_to_porcelain( 1406 plumbing_item) 1407 if plumbing_response.meta.next_cursor == '': 1408 break 1409 req.meta.cursor = plumbing_response.meta.next_cursor 1410 1411 return generator(self, req)
ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep
See strongdm.models.ApprovalWorkflowApprover
.
1275 def create(self, approval_workflow_approver, timeout=None): 1276 ''' 1277 Create creates a new approval workflow approver. 1278 ''' 1279 req = ApprovalWorkflowApproverCreateRequest() 1280 1281 if approval_workflow_approver is not None: 1282 req.approval_workflow_approver.CopyFrom( 1283 plumbing.convert_approval_workflow_approver_to_plumbing( 1284 approval_workflow_approver)) 1285 tries = 0 1286 plumbing_response = None 1287 while True: 1288 try: 1289 plumbing_response = self.stub.Create( 1290 req, 1291 metadata=self.parent.get_metadata( 1292 'ApprovalWorkflowApprovers.Create', req), 1293 timeout=timeout) 1294 except Exception as e: 1295 if self.parent.shouldRetry(tries, e): 1296 tries += 1 1297 self.parent.jitterSleep(tries) 1298 continue 1299 raise plumbing.convert_error_to_porcelain(e) from e 1300 break 1301 1302 resp = models.ApprovalWorkflowApproverCreateResponse() 1303 resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain( 1304 plumbing_response.approval_workflow_approver) 1305 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1306 plumbing_response.rate_limit) 1307 return resp
Create creates a new approval workflow approver.
1309 def get(self, id, timeout=None): 1310 ''' 1311 Get reads one approval workflow approver by ID. 1312 ''' 1313 req = ApprovalWorkflowApproverGetRequest() 1314 if self.parent.snapshot_datetime is not None: 1315 req.meta.CopyFrom(GetRequestMetadata()) 1316 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1317 1318 req.id = (id) 1319 tries = 0 1320 plumbing_response = None 1321 while True: 1322 try: 1323 plumbing_response = self.stub.Get( 1324 req, 1325 metadata=self.parent.get_metadata( 1326 'ApprovalWorkflowApprovers.Get', req), 1327 timeout=timeout) 1328 except Exception as e: 1329 if self.parent.shouldRetry(tries, e): 1330 tries += 1 1331 self.parent.jitterSleep(tries) 1332 continue 1333 raise plumbing.convert_error_to_porcelain(e) from e 1334 break 1335 1336 resp = models.ApprovalWorkflowApproverGetResponse() 1337 resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain( 1338 plumbing_response.approval_workflow_approver) 1339 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1340 plumbing_response.meta) 1341 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1342 plumbing_response.rate_limit) 1343 return resp
Get reads one approval workflow approver by ID.
1345 def delete(self, id, timeout=None): 1346 ''' 1347 Delete deletes an existing approval workflow approver. 1348 ''' 1349 req = ApprovalWorkflowApproverDeleteRequest() 1350 1351 req.id = (id) 1352 tries = 0 1353 plumbing_response = None 1354 while True: 1355 try: 1356 plumbing_response = self.stub.Delete( 1357 req, 1358 metadata=self.parent.get_metadata( 1359 'ApprovalWorkflowApprovers.Delete', req), 1360 timeout=timeout) 1361 except Exception as e: 1362 if self.parent.shouldRetry(tries, e): 1363 tries += 1 1364 self.parent.jitterSleep(tries) 1365 continue 1366 raise plumbing.convert_error_to_porcelain(e) from e 1367 break 1368 1369 resp = models.ApprovalWorkflowApproverDeleteResponse() 1370 resp.id = (plumbing_response.id) 1371 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1372 plumbing_response.rate_limit) 1373 return resp
Delete deletes an existing approval workflow approver.
1375 def list(self, filter, *args, timeout=None): 1376 ''' 1377 Lists existing approval workflow approvers. 1378 ''' 1379 req = ApprovalWorkflowApproverListRequest() 1380 req.meta.CopyFrom(ListRequestMetadata()) 1381 if self.parent.page_limit > 0: 1382 req.meta.limit = self.parent.page_limit 1383 if self.parent.snapshot_datetime is not None: 1384 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1385 1386 req.filter = plumbing.quote_filter_args(filter, *args) 1387 1388 def generator(svc, req): 1389 tries = 0 1390 while True: 1391 try: 1392 plumbing_response = svc.stub.List( 1393 req, 1394 metadata=svc.parent.get_metadata( 1395 'ApprovalWorkflowApprovers.List', req), 1396 timeout=timeout) 1397 except Exception as e: 1398 if self.parent.shouldRetry(tries, e): 1399 tries += 1 1400 self.parent.jitterSleep(tries) 1401 continue 1402 raise plumbing.convert_error_to_porcelain(e) from e 1403 tries = 0 1404 for plumbing_item in plumbing_response.approval_workflow_approvers: 1405 yield plumbing.convert_approval_workflow_approver_to_porcelain( 1406 plumbing_item) 1407 if plumbing_response.meta.next_cursor == '': 1408 break 1409 req.meta.cursor = plumbing_response.meta.next_cursor 1410 1411 return generator(self, req)
Lists existing approval workflow approvers.
1414class SnapshotApprovalWorkflowApprovers: 1415 ''' 1416 SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers 1417 service for historical queries. 1418 ''' 1419 def __init__(self, approval_workflow_approvers): 1420 self.approval_workflow_approvers = approval_workflow_approvers 1421 1422 def get(self, id, timeout=None): 1423 ''' 1424 Get reads one approval workflow approver by ID. 1425 ''' 1426 return self.approval_workflow_approvers.get(id, timeout=timeout) 1427 1428 def list(self, filter, *args, timeout=None): 1429 ''' 1430 Lists existing approval workflow approvers. 1431 ''' 1432 return self.approval_workflow_approvers.list(filter, 1433 *args, 1434 timeout=timeout)
SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers service for historical queries.
1437class ApprovalWorkflowApproversHistory: 1438 ''' 1439 ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover. 1440 See `strongdm.models.ApprovalWorkflowApproverHistory`. 1441 ''' 1442 def __init__(self, channel, client): 1443 self.parent = client 1444 self.stub = ApprovalWorkflowApproversHistoryStub(channel) 1445 1446 def list(self, filter, *args, timeout=None): 1447 ''' 1448 List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria. 1449 ''' 1450 req = ApprovalWorkflowApproverHistoryListRequest() 1451 req.meta.CopyFrom(ListRequestMetadata()) 1452 if self.parent.page_limit > 0: 1453 req.meta.limit = self.parent.page_limit 1454 if self.parent.snapshot_datetime is not None: 1455 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1456 1457 req.filter = plumbing.quote_filter_args(filter, *args) 1458 1459 def generator(svc, req): 1460 tries = 0 1461 while True: 1462 try: 1463 plumbing_response = svc.stub.List( 1464 req, 1465 metadata=svc.parent.get_metadata( 1466 'ApprovalWorkflowApproversHistory.List', req), 1467 timeout=timeout) 1468 except Exception as e: 1469 if self.parent.shouldRetry(tries, e): 1470 tries += 1 1471 self.parent.jitterSleep(tries) 1472 continue 1473 raise plumbing.convert_error_to_porcelain(e) from e 1474 tries = 0 1475 for plumbing_item in plumbing_response.history: 1476 yield plumbing.convert_approval_workflow_approver_history_to_porcelain( 1477 plumbing_item) 1478 if plumbing_response.meta.next_cursor == '': 1479 break 1480 req.meta.cursor = plumbing_response.meta.next_cursor 1481 1482 return generator(self, req)
ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover.
See strongdm.models.ApprovalWorkflowApproverHistory
.
1446 def list(self, filter, *args, timeout=None): 1447 ''' 1448 List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria. 1449 ''' 1450 req = ApprovalWorkflowApproverHistoryListRequest() 1451 req.meta.CopyFrom(ListRequestMetadata()) 1452 if self.parent.page_limit > 0: 1453 req.meta.limit = self.parent.page_limit 1454 if self.parent.snapshot_datetime is not None: 1455 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1456 1457 req.filter = plumbing.quote_filter_args(filter, *args) 1458 1459 def generator(svc, req): 1460 tries = 0 1461 while True: 1462 try: 1463 plumbing_response = svc.stub.List( 1464 req, 1465 metadata=svc.parent.get_metadata( 1466 'ApprovalWorkflowApproversHistory.List', req), 1467 timeout=timeout) 1468 except Exception as e: 1469 if self.parent.shouldRetry(tries, e): 1470 tries += 1 1471 self.parent.jitterSleep(tries) 1472 continue 1473 raise plumbing.convert_error_to_porcelain(e) from e 1474 tries = 0 1475 for plumbing_item in plumbing_response.history: 1476 yield plumbing.convert_approval_workflow_approver_history_to_porcelain( 1477 plumbing_item) 1478 if plumbing_response.meta.next_cursor == '': 1479 break 1480 req.meta.cursor = plumbing_response.meta.next_cursor 1481 1482 return generator(self, req)
List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria.
1485class ApprovalWorkflowSteps: 1486 ''' 1487 ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow 1488 See `strongdm.models.ApprovalWorkflowStep`. 1489 ''' 1490 def __init__(self, channel, client): 1491 self.parent = client 1492 self.stub = ApprovalWorkflowStepsStub(channel) 1493 1494 def create(self, approval_workflow_step, timeout=None): 1495 ''' 1496 Create creates a new approval workflow step. 1497 ''' 1498 req = ApprovalWorkflowStepCreateRequest() 1499 1500 if approval_workflow_step is not None: 1501 req.approval_workflow_step.CopyFrom( 1502 plumbing.convert_approval_workflow_step_to_plumbing( 1503 approval_workflow_step)) 1504 tries = 0 1505 plumbing_response = None 1506 while True: 1507 try: 1508 plumbing_response = self.stub.Create( 1509 req, 1510 metadata=self.parent.get_metadata( 1511 'ApprovalWorkflowSteps.Create', req), 1512 timeout=timeout) 1513 except Exception as e: 1514 if self.parent.shouldRetry(tries, e): 1515 tries += 1 1516 self.parent.jitterSleep(tries) 1517 continue 1518 raise plumbing.convert_error_to_porcelain(e) from e 1519 break 1520 1521 resp = models.ApprovalWorkflowStepCreateResponse() 1522 resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain( 1523 plumbing_response.approval_workflow_step) 1524 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1525 plumbing_response.rate_limit) 1526 return resp 1527 1528 def get(self, id, timeout=None): 1529 ''' 1530 Get reads one approval workflow step by ID. 1531 ''' 1532 req = ApprovalWorkflowStepGetRequest() 1533 if self.parent.snapshot_datetime is not None: 1534 req.meta.CopyFrom(GetRequestMetadata()) 1535 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1536 1537 req.id = (id) 1538 tries = 0 1539 plumbing_response = None 1540 while True: 1541 try: 1542 plumbing_response = self.stub.Get( 1543 req, 1544 metadata=self.parent.get_metadata( 1545 'ApprovalWorkflowSteps.Get', req), 1546 timeout=timeout) 1547 except Exception as e: 1548 if self.parent.shouldRetry(tries, e): 1549 tries += 1 1550 self.parent.jitterSleep(tries) 1551 continue 1552 raise plumbing.convert_error_to_porcelain(e) from e 1553 break 1554 1555 resp = models.ApprovalWorkflowStepGetResponse() 1556 resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain( 1557 plumbing_response.approval_workflow_step) 1558 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1559 plumbing_response.meta) 1560 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1561 plumbing_response.rate_limit) 1562 return resp 1563 1564 def delete(self, id, timeout=None): 1565 ''' 1566 Delete deletes an existing approval workflow step. 1567 ''' 1568 req = ApprovalWorkflowStepDeleteRequest() 1569 1570 req.id = (id) 1571 tries = 0 1572 plumbing_response = None 1573 while True: 1574 try: 1575 plumbing_response = self.stub.Delete( 1576 req, 1577 metadata=self.parent.get_metadata( 1578 'ApprovalWorkflowSteps.Delete', req), 1579 timeout=timeout) 1580 except Exception as e: 1581 if self.parent.shouldRetry(tries, e): 1582 tries += 1 1583 self.parent.jitterSleep(tries) 1584 continue 1585 raise plumbing.convert_error_to_porcelain(e) from e 1586 break 1587 1588 resp = models.ApprovalWorkflowStepDeleteResponse() 1589 resp.id = (plumbing_response.id) 1590 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1591 plumbing_response.rate_limit) 1592 return resp 1593 1594 def list(self, filter, *args, timeout=None): 1595 ''' 1596 Lists existing approval workflow steps. 1597 ''' 1598 req = ApprovalWorkflowStepListRequest() 1599 req.meta.CopyFrom(ListRequestMetadata()) 1600 if self.parent.page_limit > 0: 1601 req.meta.limit = self.parent.page_limit 1602 if self.parent.snapshot_datetime is not None: 1603 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1604 1605 req.filter = plumbing.quote_filter_args(filter, *args) 1606 1607 def generator(svc, req): 1608 tries = 0 1609 while True: 1610 try: 1611 plumbing_response = svc.stub.List( 1612 req, 1613 metadata=svc.parent.get_metadata( 1614 'ApprovalWorkflowSteps.List', req), 1615 timeout=timeout) 1616 except Exception as e: 1617 if self.parent.shouldRetry(tries, e): 1618 tries += 1 1619 self.parent.jitterSleep(tries) 1620 continue 1621 raise plumbing.convert_error_to_porcelain(e) from e 1622 tries = 0 1623 for plumbing_item in plumbing_response.approval_workflow_steps: 1624 yield plumbing.convert_approval_workflow_step_to_porcelain( 1625 plumbing_item) 1626 if plumbing_response.meta.next_cursor == '': 1627 break 1628 req.meta.cursor = plumbing_response.meta.next_cursor 1629 1630 return generator(self, req)
ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow
See strongdm.models.ApprovalWorkflowStep
.
1494 def create(self, approval_workflow_step, timeout=None): 1495 ''' 1496 Create creates a new approval workflow step. 1497 ''' 1498 req = ApprovalWorkflowStepCreateRequest() 1499 1500 if approval_workflow_step is not None: 1501 req.approval_workflow_step.CopyFrom( 1502 plumbing.convert_approval_workflow_step_to_plumbing( 1503 approval_workflow_step)) 1504 tries = 0 1505 plumbing_response = None 1506 while True: 1507 try: 1508 plumbing_response = self.stub.Create( 1509 req, 1510 metadata=self.parent.get_metadata( 1511 'ApprovalWorkflowSteps.Create', req), 1512 timeout=timeout) 1513 except Exception as e: 1514 if self.parent.shouldRetry(tries, e): 1515 tries += 1 1516 self.parent.jitterSleep(tries) 1517 continue 1518 raise plumbing.convert_error_to_porcelain(e) from e 1519 break 1520 1521 resp = models.ApprovalWorkflowStepCreateResponse() 1522 resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain( 1523 plumbing_response.approval_workflow_step) 1524 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1525 plumbing_response.rate_limit) 1526 return resp
Create creates a new approval workflow step.
1528 def get(self, id, timeout=None): 1529 ''' 1530 Get reads one approval workflow step by ID. 1531 ''' 1532 req = ApprovalWorkflowStepGetRequest() 1533 if self.parent.snapshot_datetime is not None: 1534 req.meta.CopyFrom(GetRequestMetadata()) 1535 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1536 1537 req.id = (id) 1538 tries = 0 1539 plumbing_response = None 1540 while True: 1541 try: 1542 plumbing_response = self.stub.Get( 1543 req, 1544 metadata=self.parent.get_metadata( 1545 'ApprovalWorkflowSteps.Get', req), 1546 timeout=timeout) 1547 except Exception as e: 1548 if self.parent.shouldRetry(tries, e): 1549 tries += 1 1550 self.parent.jitterSleep(tries) 1551 continue 1552 raise plumbing.convert_error_to_porcelain(e) from e 1553 break 1554 1555 resp = models.ApprovalWorkflowStepGetResponse() 1556 resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain( 1557 plumbing_response.approval_workflow_step) 1558 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1559 plumbing_response.meta) 1560 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1561 plumbing_response.rate_limit) 1562 return resp
Get reads one approval workflow step by ID.
1564 def delete(self, id, timeout=None): 1565 ''' 1566 Delete deletes an existing approval workflow step. 1567 ''' 1568 req = ApprovalWorkflowStepDeleteRequest() 1569 1570 req.id = (id) 1571 tries = 0 1572 plumbing_response = None 1573 while True: 1574 try: 1575 plumbing_response = self.stub.Delete( 1576 req, 1577 metadata=self.parent.get_metadata( 1578 'ApprovalWorkflowSteps.Delete', req), 1579 timeout=timeout) 1580 except Exception as e: 1581 if self.parent.shouldRetry(tries, e): 1582 tries += 1 1583 self.parent.jitterSleep(tries) 1584 continue 1585 raise plumbing.convert_error_to_porcelain(e) from e 1586 break 1587 1588 resp = models.ApprovalWorkflowStepDeleteResponse() 1589 resp.id = (plumbing_response.id) 1590 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1591 plumbing_response.rate_limit) 1592 return resp
Delete deletes an existing approval workflow step.
1594 def list(self, filter, *args, timeout=None): 1595 ''' 1596 Lists existing approval workflow steps. 1597 ''' 1598 req = ApprovalWorkflowStepListRequest() 1599 req.meta.CopyFrom(ListRequestMetadata()) 1600 if self.parent.page_limit > 0: 1601 req.meta.limit = self.parent.page_limit 1602 if self.parent.snapshot_datetime is not None: 1603 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1604 1605 req.filter = plumbing.quote_filter_args(filter, *args) 1606 1607 def generator(svc, req): 1608 tries = 0 1609 while True: 1610 try: 1611 plumbing_response = svc.stub.List( 1612 req, 1613 metadata=svc.parent.get_metadata( 1614 'ApprovalWorkflowSteps.List', req), 1615 timeout=timeout) 1616 except Exception as e: 1617 if self.parent.shouldRetry(tries, e): 1618 tries += 1 1619 self.parent.jitterSleep(tries) 1620 continue 1621 raise plumbing.convert_error_to_porcelain(e) from e 1622 tries = 0 1623 for plumbing_item in plumbing_response.approval_workflow_steps: 1624 yield plumbing.convert_approval_workflow_step_to_porcelain( 1625 plumbing_item) 1626 if plumbing_response.meta.next_cursor == '': 1627 break 1628 req.meta.cursor = plumbing_response.meta.next_cursor 1629 1630 return generator(self, req)
Lists existing approval workflow steps.
1633class SnapshotApprovalWorkflowSteps: 1634 ''' 1635 SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps 1636 service for historical queries. 1637 ''' 1638 def __init__(self, approval_workflow_steps): 1639 self.approval_workflow_steps = approval_workflow_steps 1640 1641 def get(self, id, timeout=None): 1642 ''' 1643 Get reads one approval workflow step by ID. 1644 ''' 1645 return self.approval_workflow_steps.get(id, timeout=timeout) 1646 1647 def list(self, filter, *args, timeout=None): 1648 ''' 1649 Lists existing approval workflow steps. 1650 ''' 1651 return self.approval_workflow_steps.list(filter, 1652 *args, 1653 timeout=timeout)
SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps service for historical queries.
1656class ApprovalWorkflowStepsHistory: 1657 ''' 1658 ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep. 1659 See `strongdm.models.ApprovalWorkflowStepHistory`. 1660 ''' 1661 def __init__(self, channel, client): 1662 self.parent = client 1663 self.stub = ApprovalWorkflowStepsHistoryStub(channel) 1664 1665 def list(self, filter, *args, timeout=None): 1666 ''' 1667 List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria. 1668 ''' 1669 req = ApprovalWorkflowStepHistoryListRequest() 1670 req.meta.CopyFrom(ListRequestMetadata()) 1671 if self.parent.page_limit > 0: 1672 req.meta.limit = self.parent.page_limit 1673 if self.parent.snapshot_datetime is not None: 1674 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1675 1676 req.filter = plumbing.quote_filter_args(filter, *args) 1677 1678 def generator(svc, req): 1679 tries = 0 1680 while True: 1681 try: 1682 plumbing_response = svc.stub.List( 1683 req, 1684 metadata=svc.parent.get_metadata( 1685 'ApprovalWorkflowStepsHistory.List', req), 1686 timeout=timeout) 1687 except Exception as e: 1688 if self.parent.shouldRetry(tries, e): 1689 tries += 1 1690 self.parent.jitterSleep(tries) 1691 continue 1692 raise plumbing.convert_error_to_porcelain(e) from e 1693 tries = 0 1694 for plumbing_item in plumbing_response.history: 1695 yield plumbing.convert_approval_workflow_step_history_to_porcelain( 1696 plumbing_item) 1697 if plumbing_response.meta.next_cursor == '': 1698 break 1699 req.meta.cursor = plumbing_response.meta.next_cursor 1700 1701 return generator(self, req)
ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep.
See strongdm.models.ApprovalWorkflowStepHistory
.
1665 def list(self, filter, *args, timeout=None): 1666 ''' 1667 List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria. 1668 ''' 1669 req = ApprovalWorkflowStepHistoryListRequest() 1670 req.meta.CopyFrom(ListRequestMetadata()) 1671 if self.parent.page_limit > 0: 1672 req.meta.limit = self.parent.page_limit 1673 if self.parent.snapshot_datetime is not None: 1674 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1675 1676 req.filter = plumbing.quote_filter_args(filter, *args) 1677 1678 def generator(svc, req): 1679 tries = 0 1680 while True: 1681 try: 1682 plumbing_response = svc.stub.List( 1683 req, 1684 metadata=svc.parent.get_metadata( 1685 'ApprovalWorkflowStepsHistory.List', req), 1686 timeout=timeout) 1687 except Exception as e: 1688 if self.parent.shouldRetry(tries, e): 1689 tries += 1 1690 self.parent.jitterSleep(tries) 1691 continue 1692 raise plumbing.convert_error_to_porcelain(e) from e 1693 tries = 0 1694 for plumbing_item in plumbing_response.history: 1695 yield plumbing.convert_approval_workflow_step_history_to_porcelain( 1696 plumbing_item) 1697 if plumbing_response.meta.next_cursor == '': 1698 break 1699 req.meta.cursor = plumbing_response.meta.next_cursor 1700 1701 return generator(self, req)
List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria.
1704class ApprovalWorkflows: 1705 ''' 1706 ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized 1707 approvers and be approved or denied. 1708 See `strongdm.models.ApprovalWorkflow`. 1709 ''' 1710 def __init__(self, channel, client): 1711 self.parent = client 1712 self.stub = ApprovalWorkflowsStub(channel) 1713 1714 def create(self, approval_workflow, timeout=None): 1715 ''' 1716 Create creates a new approval workflow and requires a name and approval mode for the approval workflow. 1717 ''' 1718 req = ApprovalWorkflowCreateRequest() 1719 1720 if approval_workflow is not None: 1721 req.approval_workflow.CopyFrom( 1722 plumbing.convert_approval_workflow_to_plumbing( 1723 approval_workflow)) 1724 tries = 0 1725 plumbing_response = None 1726 while True: 1727 try: 1728 plumbing_response = self.stub.Create( 1729 req, 1730 metadata=self.parent.get_metadata( 1731 'ApprovalWorkflows.Create', req), 1732 timeout=timeout) 1733 except Exception as e: 1734 if self.parent.shouldRetry(tries, e): 1735 tries += 1 1736 self.parent.jitterSleep(tries) 1737 continue 1738 raise plumbing.convert_error_to_porcelain(e) from e 1739 break 1740 1741 resp = models.ApprovalWorkflowCreateResponse() 1742 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1743 plumbing_response.approval_workflow) 1744 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1745 plumbing_response.rate_limit) 1746 return resp 1747 1748 def get(self, id, timeout=None): 1749 ''' 1750 Get reads one approval workflow by ID. 1751 ''' 1752 req = ApprovalWorkflowGetRequest() 1753 if self.parent.snapshot_datetime is not None: 1754 req.meta.CopyFrom(GetRequestMetadata()) 1755 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1756 1757 req.id = (id) 1758 tries = 0 1759 plumbing_response = None 1760 while True: 1761 try: 1762 plumbing_response = self.stub.Get( 1763 req, 1764 metadata=self.parent.get_metadata('ApprovalWorkflows.Get', 1765 req), 1766 timeout=timeout) 1767 except Exception as e: 1768 if self.parent.shouldRetry(tries, e): 1769 tries += 1 1770 self.parent.jitterSleep(tries) 1771 continue 1772 raise plumbing.convert_error_to_porcelain(e) from e 1773 break 1774 1775 resp = models.ApprovalWorkflowGetResponse() 1776 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1777 plumbing_response.approval_workflow) 1778 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1779 plumbing_response.meta) 1780 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1781 plumbing_response.rate_limit) 1782 return resp 1783 1784 def delete(self, id, timeout=None): 1785 ''' 1786 Delete deletes an existing approval workflow. 1787 ''' 1788 req = ApprovalWorkflowDeleteRequest() 1789 1790 req.id = (id) 1791 tries = 0 1792 plumbing_response = None 1793 while True: 1794 try: 1795 plumbing_response = self.stub.Delete( 1796 req, 1797 metadata=self.parent.get_metadata( 1798 'ApprovalWorkflows.Delete', req), 1799 timeout=timeout) 1800 except Exception as e: 1801 if self.parent.shouldRetry(tries, e): 1802 tries += 1 1803 self.parent.jitterSleep(tries) 1804 continue 1805 raise plumbing.convert_error_to_porcelain(e) from e 1806 break 1807 1808 resp = models.ApprovalWorkflowDeleteResponse() 1809 resp.id = (plumbing_response.id) 1810 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1811 plumbing_response.rate_limit) 1812 return resp 1813 1814 def update(self, approval_workflow, timeout=None): 1815 ''' 1816 Update updates an existing approval workflow. 1817 ''' 1818 req = ApprovalWorkflowUpdateRequest() 1819 1820 if approval_workflow is not None: 1821 req.approval_workflow.CopyFrom( 1822 plumbing.convert_approval_workflow_to_plumbing( 1823 approval_workflow)) 1824 tries = 0 1825 plumbing_response = None 1826 while True: 1827 try: 1828 plumbing_response = self.stub.Update( 1829 req, 1830 metadata=self.parent.get_metadata( 1831 'ApprovalWorkflows.Update', req), 1832 timeout=timeout) 1833 except Exception as e: 1834 if self.parent.shouldRetry(tries, e): 1835 tries += 1 1836 self.parent.jitterSleep(tries) 1837 continue 1838 raise plumbing.convert_error_to_porcelain(e) from e 1839 break 1840 1841 resp = models.ApprovalWorkflowUpdateResponse() 1842 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1843 plumbing_response.approval_workflow) 1844 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1845 plumbing_response.rate_limit) 1846 return resp 1847 1848 def list(self, filter, *args, timeout=None): 1849 ''' 1850 Lists existing approval workflows. 1851 ''' 1852 req = ApprovalWorkflowListRequest() 1853 req.meta.CopyFrom(ListRequestMetadata()) 1854 if self.parent.page_limit > 0: 1855 req.meta.limit = self.parent.page_limit 1856 if self.parent.snapshot_datetime is not None: 1857 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1858 1859 req.filter = plumbing.quote_filter_args(filter, *args) 1860 1861 def generator(svc, req): 1862 tries = 0 1863 while True: 1864 try: 1865 plumbing_response = svc.stub.List( 1866 req, 1867 metadata=svc.parent.get_metadata( 1868 'ApprovalWorkflows.List', req), 1869 timeout=timeout) 1870 except Exception as e: 1871 if self.parent.shouldRetry(tries, e): 1872 tries += 1 1873 self.parent.jitterSleep(tries) 1874 continue 1875 raise plumbing.convert_error_to_porcelain(e) from e 1876 tries = 0 1877 for plumbing_item in plumbing_response.approval_workflows: 1878 yield plumbing.convert_approval_workflow_to_porcelain( 1879 plumbing_item) 1880 if plumbing_response.meta.next_cursor == '': 1881 break 1882 req.meta.cursor = plumbing_response.meta.next_cursor 1883 1884 return generator(self, req)
ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized
approvers and be approved or denied.
See strongdm.models.ApprovalWorkflow
.
1714 def create(self, approval_workflow, timeout=None): 1715 ''' 1716 Create creates a new approval workflow and requires a name and approval mode for the approval workflow. 1717 ''' 1718 req = ApprovalWorkflowCreateRequest() 1719 1720 if approval_workflow is not None: 1721 req.approval_workflow.CopyFrom( 1722 plumbing.convert_approval_workflow_to_plumbing( 1723 approval_workflow)) 1724 tries = 0 1725 plumbing_response = None 1726 while True: 1727 try: 1728 plumbing_response = self.stub.Create( 1729 req, 1730 metadata=self.parent.get_metadata( 1731 'ApprovalWorkflows.Create', req), 1732 timeout=timeout) 1733 except Exception as e: 1734 if self.parent.shouldRetry(tries, e): 1735 tries += 1 1736 self.parent.jitterSleep(tries) 1737 continue 1738 raise plumbing.convert_error_to_porcelain(e) from e 1739 break 1740 1741 resp = models.ApprovalWorkflowCreateResponse() 1742 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1743 plumbing_response.approval_workflow) 1744 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1745 plumbing_response.rate_limit) 1746 return resp
Create creates a new approval workflow and requires a name and approval mode for the approval workflow.
1748 def get(self, id, timeout=None): 1749 ''' 1750 Get reads one approval workflow by ID. 1751 ''' 1752 req = ApprovalWorkflowGetRequest() 1753 if self.parent.snapshot_datetime is not None: 1754 req.meta.CopyFrom(GetRequestMetadata()) 1755 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1756 1757 req.id = (id) 1758 tries = 0 1759 plumbing_response = None 1760 while True: 1761 try: 1762 plumbing_response = self.stub.Get( 1763 req, 1764 metadata=self.parent.get_metadata('ApprovalWorkflows.Get', 1765 req), 1766 timeout=timeout) 1767 except Exception as e: 1768 if self.parent.shouldRetry(tries, e): 1769 tries += 1 1770 self.parent.jitterSleep(tries) 1771 continue 1772 raise plumbing.convert_error_to_porcelain(e) from e 1773 break 1774 1775 resp = models.ApprovalWorkflowGetResponse() 1776 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1777 plumbing_response.approval_workflow) 1778 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1779 plumbing_response.meta) 1780 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1781 plumbing_response.rate_limit) 1782 return resp
Get reads one approval workflow by ID.
1784 def delete(self, id, timeout=None): 1785 ''' 1786 Delete deletes an existing approval workflow. 1787 ''' 1788 req = ApprovalWorkflowDeleteRequest() 1789 1790 req.id = (id) 1791 tries = 0 1792 plumbing_response = None 1793 while True: 1794 try: 1795 plumbing_response = self.stub.Delete( 1796 req, 1797 metadata=self.parent.get_metadata( 1798 'ApprovalWorkflows.Delete', req), 1799 timeout=timeout) 1800 except Exception as e: 1801 if self.parent.shouldRetry(tries, e): 1802 tries += 1 1803 self.parent.jitterSleep(tries) 1804 continue 1805 raise plumbing.convert_error_to_porcelain(e) from e 1806 break 1807 1808 resp = models.ApprovalWorkflowDeleteResponse() 1809 resp.id = (plumbing_response.id) 1810 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1811 plumbing_response.rate_limit) 1812 return resp
Delete deletes an existing approval workflow.
1814 def update(self, approval_workflow, timeout=None): 1815 ''' 1816 Update updates an existing approval workflow. 1817 ''' 1818 req = ApprovalWorkflowUpdateRequest() 1819 1820 if approval_workflow is not None: 1821 req.approval_workflow.CopyFrom( 1822 plumbing.convert_approval_workflow_to_plumbing( 1823 approval_workflow)) 1824 tries = 0 1825 plumbing_response = None 1826 while True: 1827 try: 1828 plumbing_response = self.stub.Update( 1829 req, 1830 metadata=self.parent.get_metadata( 1831 'ApprovalWorkflows.Update', req), 1832 timeout=timeout) 1833 except Exception as e: 1834 if self.parent.shouldRetry(tries, e): 1835 tries += 1 1836 self.parent.jitterSleep(tries) 1837 continue 1838 raise plumbing.convert_error_to_porcelain(e) from e 1839 break 1840 1841 resp = models.ApprovalWorkflowUpdateResponse() 1842 resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain( 1843 plumbing_response.approval_workflow) 1844 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1845 plumbing_response.rate_limit) 1846 return resp
Update updates an existing approval workflow.
1848 def list(self, filter, *args, timeout=None): 1849 ''' 1850 Lists existing approval workflows. 1851 ''' 1852 req = ApprovalWorkflowListRequest() 1853 req.meta.CopyFrom(ListRequestMetadata()) 1854 if self.parent.page_limit > 0: 1855 req.meta.limit = self.parent.page_limit 1856 if self.parent.snapshot_datetime is not None: 1857 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1858 1859 req.filter = plumbing.quote_filter_args(filter, *args) 1860 1861 def generator(svc, req): 1862 tries = 0 1863 while True: 1864 try: 1865 plumbing_response = svc.stub.List( 1866 req, 1867 metadata=svc.parent.get_metadata( 1868 'ApprovalWorkflows.List', req), 1869 timeout=timeout) 1870 except Exception as e: 1871 if self.parent.shouldRetry(tries, e): 1872 tries += 1 1873 self.parent.jitterSleep(tries) 1874 continue 1875 raise plumbing.convert_error_to_porcelain(e) from e 1876 tries = 0 1877 for plumbing_item in plumbing_response.approval_workflows: 1878 yield plumbing.convert_approval_workflow_to_porcelain( 1879 plumbing_item) 1880 if plumbing_response.meta.next_cursor == '': 1881 break 1882 req.meta.cursor = plumbing_response.meta.next_cursor 1883 1884 return generator(self, req)
Lists existing approval workflows.
1887class SnapshotApprovalWorkflows: 1888 ''' 1889 SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows 1890 service for historical queries. 1891 ''' 1892 def __init__(self, approval_workflows): 1893 self.approval_workflows = approval_workflows 1894 1895 def get(self, id, timeout=None): 1896 ''' 1897 Get reads one approval workflow by ID. 1898 ''' 1899 return self.approval_workflows.get(id, timeout=timeout) 1900 1901 def list(self, filter, *args, timeout=None): 1902 ''' 1903 Lists existing approval workflows. 1904 ''' 1905 return self.approval_workflows.list(filter, *args, timeout=timeout)
SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows service for historical queries.
1908class ApprovalWorkflowsHistory: 1909 ''' 1910 ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow. 1911 See `strongdm.models.ApprovalWorkflowHistory`. 1912 ''' 1913 def __init__(self, channel, client): 1914 self.parent = client 1915 self.stub = ApprovalWorkflowsHistoryStub(channel) 1916 1917 def list(self, filter, *args, timeout=None): 1918 ''' 1919 List gets a list of ApprovalWorkflowHistory records matching a given set of criteria. 1920 ''' 1921 req = ApprovalWorkflowHistoryListRequest() 1922 req.meta.CopyFrom(ListRequestMetadata()) 1923 if self.parent.page_limit > 0: 1924 req.meta.limit = self.parent.page_limit 1925 if self.parent.snapshot_datetime is not None: 1926 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1927 1928 req.filter = plumbing.quote_filter_args(filter, *args) 1929 1930 def generator(svc, req): 1931 tries = 0 1932 while True: 1933 try: 1934 plumbing_response = svc.stub.List( 1935 req, 1936 metadata=svc.parent.get_metadata( 1937 'ApprovalWorkflowsHistory.List', req), 1938 timeout=timeout) 1939 except Exception as e: 1940 if self.parent.shouldRetry(tries, e): 1941 tries += 1 1942 self.parent.jitterSleep(tries) 1943 continue 1944 raise plumbing.convert_error_to_porcelain(e) from e 1945 tries = 0 1946 for plumbing_item in plumbing_response.history: 1947 yield plumbing.convert_approval_workflow_history_to_porcelain( 1948 plumbing_item) 1949 if plumbing_response.meta.next_cursor == '': 1950 break 1951 req.meta.cursor = plumbing_response.meta.next_cursor 1952 1953 return generator(self, req)
ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow.
See strongdm.models.ApprovalWorkflowHistory
.
1917 def list(self, filter, *args, timeout=None): 1918 ''' 1919 List gets a list of ApprovalWorkflowHistory records matching a given set of criteria. 1920 ''' 1921 req = ApprovalWorkflowHistoryListRequest() 1922 req.meta.CopyFrom(ListRequestMetadata()) 1923 if self.parent.page_limit > 0: 1924 req.meta.limit = self.parent.page_limit 1925 if self.parent.snapshot_datetime is not None: 1926 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 1927 1928 req.filter = plumbing.quote_filter_args(filter, *args) 1929 1930 def generator(svc, req): 1931 tries = 0 1932 while True: 1933 try: 1934 plumbing_response = svc.stub.List( 1935 req, 1936 metadata=svc.parent.get_metadata( 1937 'ApprovalWorkflowsHistory.List', req), 1938 timeout=timeout) 1939 except Exception as e: 1940 if self.parent.shouldRetry(tries, e): 1941 tries += 1 1942 self.parent.jitterSleep(tries) 1943 continue 1944 raise plumbing.convert_error_to_porcelain(e) from e 1945 tries = 0 1946 for plumbing_item in plumbing_response.history: 1947 yield plumbing.convert_approval_workflow_history_to_porcelain( 1948 plumbing_item) 1949 if plumbing_response.meta.next_cursor == '': 1950 break 1951 req.meta.cursor = plumbing_response.meta.next_cursor 1952 1953 return generator(self, req)
List gets a list of ApprovalWorkflowHistory records matching a given set of criteria.
1956class ControlPanel: 1957 ''' 1958 ControlPanel contains all administrative controls. 1959 ''' 1960 def __init__(self, channel, client): 1961 self.parent = client 1962 self.stub = ControlPanelStub(channel) 1963 1964 def get_sshca_public_key(self, timeout=None): 1965 ''' 1966 GetSSHCAPublicKey retrieves the SSH CA public key. 1967 ''' 1968 req = ControlPanelGetSSHCAPublicKeyRequest() 1969 1970 tries = 0 1971 plumbing_response = None 1972 while True: 1973 try: 1974 plumbing_response = self.stub.GetSSHCAPublicKey( 1975 req, 1976 metadata=self.parent.get_metadata( 1977 'ControlPanel.GetSSHCAPublicKey', req), 1978 timeout=timeout) 1979 except Exception as e: 1980 if self.parent.shouldRetry(tries, e): 1981 tries += 1 1982 self.parent.jitterSleep(tries) 1983 continue 1984 raise plumbing.convert_error_to_porcelain(e) from e 1985 break 1986 1987 resp = models.ControlPanelGetSSHCAPublicKeyResponse() 1988 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1989 plumbing_response.meta) 1990 resp.public_key = (plumbing_response.public_key) 1991 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1992 plumbing_response.rate_limit) 1993 return resp 1994 1995 def get_rdpca_public_key(self, timeout=None): 1996 ''' 1997 GetRDPCAPublicKey retrieves the RDP CA public key. 1998 ''' 1999 req = ControlPanelGetRDPCAPublicKeyRequest() 2000 2001 tries = 0 2002 plumbing_response = None 2003 while True: 2004 try: 2005 plumbing_response = self.stub.GetRDPCAPublicKey( 2006 req, 2007 metadata=self.parent.get_metadata( 2008 'ControlPanel.GetRDPCAPublicKey', req), 2009 timeout=timeout) 2010 except Exception as e: 2011 if self.parent.shouldRetry(tries, e): 2012 tries += 1 2013 self.parent.jitterSleep(tries) 2014 continue 2015 raise plumbing.convert_error_to_porcelain(e) from e 2016 break 2017 2018 resp = models.ControlPanelGetRDPCAPublicKeyResponse() 2019 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2020 plumbing_response.meta) 2021 resp.public_key = (plumbing_response.public_key) 2022 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2023 plumbing_response.rate_limit) 2024 return resp 2025 2026 def verify_jwt(self, token, timeout=None): 2027 ''' 2028 VerifyJWT reports whether the given JWT token (x-sdm-token) is valid. 2029 ''' 2030 req = ControlPanelVerifyJWTRequest() 2031 2032 req.token = (token) 2033 tries = 0 2034 plumbing_response = None 2035 while True: 2036 try: 2037 plumbing_response = self.stub.VerifyJWT( 2038 req, 2039 metadata=self.parent.get_metadata('ControlPanel.VerifyJWT', 2040 req), 2041 timeout=timeout) 2042 except Exception as e: 2043 if self.parent.shouldRetry(tries, e): 2044 tries += 1 2045 self.parent.jitterSleep(tries) 2046 continue 2047 raise plumbing.convert_error_to_porcelain(e) from e 2048 break 2049 2050 resp = models.ControlPanelVerifyJWTResponse() 2051 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2052 plumbing_response.meta) 2053 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2054 plumbing_response.rate_limit) 2055 resp.valid = (plumbing_response.valid) 2056 return resp
ControlPanel contains all administrative controls.
1964 def get_sshca_public_key(self, timeout=None): 1965 ''' 1966 GetSSHCAPublicKey retrieves the SSH CA public key. 1967 ''' 1968 req = ControlPanelGetSSHCAPublicKeyRequest() 1969 1970 tries = 0 1971 plumbing_response = None 1972 while True: 1973 try: 1974 plumbing_response = self.stub.GetSSHCAPublicKey( 1975 req, 1976 metadata=self.parent.get_metadata( 1977 'ControlPanel.GetSSHCAPublicKey', req), 1978 timeout=timeout) 1979 except Exception as e: 1980 if self.parent.shouldRetry(tries, e): 1981 tries += 1 1982 self.parent.jitterSleep(tries) 1983 continue 1984 raise plumbing.convert_error_to_porcelain(e) from e 1985 break 1986 1987 resp = models.ControlPanelGetSSHCAPublicKeyResponse() 1988 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 1989 plumbing_response.meta) 1990 resp.public_key = (plumbing_response.public_key) 1991 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 1992 plumbing_response.rate_limit) 1993 return resp
GetSSHCAPublicKey retrieves the SSH CA public key.
1995 def get_rdpca_public_key(self, timeout=None): 1996 ''' 1997 GetRDPCAPublicKey retrieves the RDP CA public key. 1998 ''' 1999 req = ControlPanelGetRDPCAPublicKeyRequest() 2000 2001 tries = 0 2002 plumbing_response = None 2003 while True: 2004 try: 2005 plumbing_response = self.stub.GetRDPCAPublicKey( 2006 req, 2007 metadata=self.parent.get_metadata( 2008 'ControlPanel.GetRDPCAPublicKey', req), 2009 timeout=timeout) 2010 except Exception as e: 2011 if self.parent.shouldRetry(tries, e): 2012 tries += 1 2013 self.parent.jitterSleep(tries) 2014 continue 2015 raise plumbing.convert_error_to_porcelain(e) from e 2016 break 2017 2018 resp = models.ControlPanelGetRDPCAPublicKeyResponse() 2019 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2020 plumbing_response.meta) 2021 resp.public_key = (plumbing_response.public_key) 2022 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2023 plumbing_response.rate_limit) 2024 return resp
GetRDPCAPublicKey retrieves the RDP CA public key.
2026 def verify_jwt(self, token, timeout=None): 2027 ''' 2028 VerifyJWT reports whether the given JWT token (x-sdm-token) is valid. 2029 ''' 2030 req = ControlPanelVerifyJWTRequest() 2031 2032 req.token = (token) 2033 tries = 0 2034 plumbing_response = None 2035 while True: 2036 try: 2037 plumbing_response = self.stub.VerifyJWT( 2038 req, 2039 metadata=self.parent.get_metadata('ControlPanel.VerifyJWT', 2040 req), 2041 timeout=timeout) 2042 except Exception as e: 2043 if self.parent.shouldRetry(tries, e): 2044 tries += 1 2045 self.parent.jitterSleep(tries) 2046 continue 2047 raise plumbing.convert_error_to_porcelain(e) from e 2048 break 2049 2050 resp = models.ControlPanelVerifyJWTResponse() 2051 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2052 plumbing_response.meta) 2053 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2054 plumbing_response.rate_limit) 2055 resp.valid = (plumbing_response.valid) 2056 return resp
VerifyJWT reports whether the given JWT token (x-sdm-token) is valid.
2059class Nodes: 2060 ''' 2061 Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes: 2062 - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers. 2063 - **Relays** are used to extend the strongDM network into segmented subnets. They provide access to databases and servers but do not listen for incoming connections. 2064 See: 2065 `strongdm.models.Gateway` 2066 `strongdm.models.Relay` 2067 ''' 2068 def __init__(self, channel, client): 2069 self.parent = client 2070 self.stub = NodesStub(channel) 2071 2072 def create(self, node, timeout=None): 2073 ''' 2074 Create registers a new Node. 2075 ''' 2076 req = NodeCreateRequest() 2077 2078 if node is not None: 2079 req.node.CopyFrom(plumbing.convert_node_to_plumbing(node)) 2080 tries = 0 2081 plumbing_response = None 2082 while True: 2083 try: 2084 plumbing_response = self.stub.Create( 2085 req, 2086 metadata=self.parent.get_metadata('Nodes.Create', req), 2087 timeout=timeout) 2088 except Exception as e: 2089 if self.parent.shouldRetry(tries, e): 2090 tries += 1 2091 self.parent.jitterSleep(tries) 2092 continue 2093 raise plumbing.convert_error_to_porcelain(e) from e 2094 break 2095 2096 resp = models.NodeCreateResponse() 2097 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2098 plumbing_response.meta) 2099 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2100 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2101 plumbing_response.rate_limit) 2102 resp.token = (plumbing_response.token) 2103 return resp 2104 2105 def get(self, id, timeout=None): 2106 ''' 2107 Get reads one Node by ID. 2108 ''' 2109 req = NodeGetRequest() 2110 if self.parent.snapshot_datetime is not None: 2111 req.meta.CopyFrom(GetRequestMetadata()) 2112 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2113 2114 req.id = (id) 2115 tries = 0 2116 plumbing_response = None 2117 while True: 2118 try: 2119 plumbing_response = self.stub.Get( 2120 req, 2121 metadata=self.parent.get_metadata('Nodes.Get', req), 2122 timeout=timeout) 2123 except Exception as e: 2124 if self.parent.shouldRetry(tries, e): 2125 tries += 1 2126 self.parent.jitterSleep(tries) 2127 continue 2128 raise plumbing.convert_error_to_porcelain(e) from e 2129 break 2130 2131 resp = models.NodeGetResponse() 2132 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2133 plumbing_response.meta) 2134 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2135 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2136 plumbing_response.rate_limit) 2137 return resp 2138 2139 def update(self, node, timeout=None): 2140 ''' 2141 Update replaces all the fields of a Node by ID. 2142 ''' 2143 req = NodeUpdateRequest() 2144 2145 if node is not None: 2146 req.node.CopyFrom(plumbing.convert_node_to_plumbing(node)) 2147 tries = 0 2148 plumbing_response = None 2149 while True: 2150 try: 2151 plumbing_response = self.stub.Update( 2152 req, 2153 metadata=self.parent.get_metadata('Nodes.Update', req), 2154 timeout=timeout) 2155 except Exception as e: 2156 if self.parent.shouldRetry(tries, e): 2157 tries += 1 2158 self.parent.jitterSleep(tries) 2159 continue 2160 raise plumbing.convert_error_to_porcelain(e) from e 2161 break 2162 2163 resp = models.NodeUpdateResponse() 2164 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 2165 plumbing_response.meta) 2166 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2167 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2168 plumbing_response.rate_limit) 2169 return resp 2170 2171 def delete(self, id, timeout=None): 2172 ''' 2173 Delete removes a Node by ID. 2174 ''' 2175 req = NodeDeleteRequest() 2176 2177 req.id = (id) 2178 tries = 0 2179 plumbing_response = None 2180 while True: 2181 try: 2182 plumbing_response = self.stub.Delete( 2183 req, 2184 metadata=self.parent.get_metadata('Nodes.Delete', req), 2185 timeout=timeout) 2186 except Exception as e: 2187 if self.parent.shouldRetry(tries, e): 2188 tries += 1 2189 self.parent.jitterSleep(tries) 2190 continue 2191 raise plumbing.convert_error_to_porcelain(e) from e 2192 break 2193 2194 resp = models.NodeDeleteResponse() 2195 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2196 plumbing_response.meta) 2197 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2198 plumbing_response.rate_limit) 2199 return resp 2200 2201 def list(self, filter, *args, timeout=None): 2202 ''' 2203 List gets a list of Nodes matching a given set of criteria. 2204 ''' 2205 req = NodeListRequest() 2206 req.meta.CopyFrom(ListRequestMetadata()) 2207 if self.parent.page_limit > 0: 2208 req.meta.limit = self.parent.page_limit 2209 if self.parent.snapshot_datetime is not None: 2210 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2211 2212 req.filter = plumbing.quote_filter_args(filter, *args) 2213 2214 def generator(svc, req): 2215 tries = 0 2216 while True: 2217 try: 2218 plumbing_response = svc.stub.List( 2219 req, 2220 metadata=svc.parent.get_metadata('Nodes.List', req), 2221 timeout=timeout) 2222 except Exception as e: 2223 if self.parent.shouldRetry(tries, e): 2224 tries += 1 2225 self.parent.jitterSleep(tries) 2226 continue 2227 raise plumbing.convert_error_to_porcelain(e) from e 2228 tries = 0 2229 for plumbing_item in plumbing_response.nodes: 2230 yield plumbing.convert_node_to_porcelain(plumbing_item) 2231 if plumbing_response.meta.next_cursor == '': 2232 break 2233 req.meta.cursor = plumbing_response.meta.next_cursor 2234 2235 return generator(self, req)
Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
- Gateways are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
- Relays are used to extend the strongDM network into segmented subnets. They provide access to databases and servers but do not listen for incoming connections.
See:
strongdm.models.Gateway
strongdm.models.Relay
2072 def create(self, node, timeout=None): 2073 ''' 2074 Create registers a new Node. 2075 ''' 2076 req = NodeCreateRequest() 2077 2078 if node is not None: 2079 req.node.CopyFrom(plumbing.convert_node_to_plumbing(node)) 2080 tries = 0 2081 plumbing_response = None 2082 while True: 2083 try: 2084 plumbing_response = self.stub.Create( 2085 req, 2086 metadata=self.parent.get_metadata('Nodes.Create', req), 2087 timeout=timeout) 2088 except Exception as e: 2089 if self.parent.shouldRetry(tries, e): 2090 tries += 1 2091 self.parent.jitterSleep(tries) 2092 continue 2093 raise plumbing.convert_error_to_porcelain(e) from e 2094 break 2095 2096 resp = models.NodeCreateResponse() 2097 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2098 plumbing_response.meta) 2099 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2100 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2101 plumbing_response.rate_limit) 2102 resp.token = (plumbing_response.token) 2103 return resp
Create registers a new Node.
2105 def get(self, id, timeout=None): 2106 ''' 2107 Get reads one Node by ID. 2108 ''' 2109 req = NodeGetRequest() 2110 if self.parent.snapshot_datetime is not None: 2111 req.meta.CopyFrom(GetRequestMetadata()) 2112 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2113 2114 req.id = (id) 2115 tries = 0 2116 plumbing_response = None 2117 while True: 2118 try: 2119 plumbing_response = self.stub.Get( 2120 req, 2121 metadata=self.parent.get_metadata('Nodes.Get', req), 2122 timeout=timeout) 2123 except Exception as e: 2124 if self.parent.shouldRetry(tries, e): 2125 tries += 1 2126 self.parent.jitterSleep(tries) 2127 continue 2128 raise plumbing.convert_error_to_porcelain(e) from e 2129 break 2130 2131 resp = models.NodeGetResponse() 2132 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2133 plumbing_response.meta) 2134 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2135 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2136 plumbing_response.rate_limit) 2137 return resp
Get reads one Node by ID.
2139 def update(self, node, timeout=None): 2140 ''' 2141 Update replaces all the fields of a Node by ID. 2142 ''' 2143 req = NodeUpdateRequest() 2144 2145 if node is not None: 2146 req.node.CopyFrom(plumbing.convert_node_to_plumbing(node)) 2147 tries = 0 2148 plumbing_response = None 2149 while True: 2150 try: 2151 plumbing_response = self.stub.Update( 2152 req, 2153 metadata=self.parent.get_metadata('Nodes.Update', req), 2154 timeout=timeout) 2155 except Exception as e: 2156 if self.parent.shouldRetry(tries, e): 2157 tries += 1 2158 self.parent.jitterSleep(tries) 2159 continue 2160 raise plumbing.convert_error_to_porcelain(e) from e 2161 break 2162 2163 resp = models.NodeUpdateResponse() 2164 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 2165 plumbing_response.meta) 2166 resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node) 2167 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2168 plumbing_response.rate_limit) 2169 return resp
Update replaces all the fields of a Node by ID.
2171 def delete(self, id, timeout=None): 2172 ''' 2173 Delete removes a Node by ID. 2174 ''' 2175 req = NodeDeleteRequest() 2176 2177 req.id = (id) 2178 tries = 0 2179 plumbing_response = None 2180 while True: 2181 try: 2182 plumbing_response = self.stub.Delete( 2183 req, 2184 metadata=self.parent.get_metadata('Nodes.Delete', req), 2185 timeout=timeout) 2186 except Exception as e: 2187 if self.parent.shouldRetry(tries, e): 2188 tries += 1 2189 self.parent.jitterSleep(tries) 2190 continue 2191 raise plumbing.convert_error_to_porcelain(e) from e 2192 break 2193 2194 resp = models.NodeDeleteResponse() 2195 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2196 plumbing_response.meta) 2197 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2198 plumbing_response.rate_limit) 2199 return resp
Delete removes a Node by ID.
2201 def list(self, filter, *args, timeout=None): 2202 ''' 2203 List gets a list of Nodes matching a given set of criteria. 2204 ''' 2205 req = NodeListRequest() 2206 req.meta.CopyFrom(ListRequestMetadata()) 2207 if self.parent.page_limit > 0: 2208 req.meta.limit = self.parent.page_limit 2209 if self.parent.snapshot_datetime is not None: 2210 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2211 2212 req.filter = plumbing.quote_filter_args(filter, *args) 2213 2214 def generator(svc, req): 2215 tries = 0 2216 while True: 2217 try: 2218 plumbing_response = svc.stub.List( 2219 req, 2220 metadata=svc.parent.get_metadata('Nodes.List', req), 2221 timeout=timeout) 2222 except Exception as e: 2223 if self.parent.shouldRetry(tries, e): 2224 tries += 1 2225 self.parent.jitterSleep(tries) 2226 continue 2227 raise plumbing.convert_error_to_porcelain(e) from e 2228 tries = 0 2229 for plumbing_item in plumbing_response.nodes: 2230 yield plumbing.convert_node_to_porcelain(plumbing_item) 2231 if plumbing_response.meta.next_cursor == '': 2232 break 2233 req.meta.cursor = plumbing_response.meta.next_cursor 2234 2235 return generator(self, req)
List gets a list of Nodes matching a given set of criteria.
2238class SnapshotNodes: 2239 ''' 2240 SnapshotNodes exposes the read only methods of the Nodes 2241 service for historical queries. 2242 ''' 2243 def __init__(self, nodes): 2244 self.nodes = nodes 2245 2246 def get(self, id, timeout=None): 2247 ''' 2248 Get reads one Node by ID. 2249 ''' 2250 return self.nodes.get(id, timeout=timeout) 2251 2252 def list(self, filter, *args, timeout=None): 2253 ''' 2254 List gets a list of Nodes matching a given set of criteria. 2255 ''' 2256 return self.nodes.list(filter, *args, timeout=timeout)
SnapshotNodes exposes the read only methods of the Nodes service for historical queries.
2259class NodesHistory: 2260 ''' 2261 NodesHistory records all changes to the state of a Node. 2262 See `strongdm.models.NodeHistory`. 2263 ''' 2264 def __init__(self, channel, client): 2265 self.parent = client 2266 self.stub = NodesHistoryStub(channel) 2267 2268 def list(self, filter, *args, timeout=None): 2269 ''' 2270 List gets a list of NodeHistory records matching a given set of criteria. 2271 ''' 2272 req = NodeHistoryListRequest() 2273 req.meta.CopyFrom(ListRequestMetadata()) 2274 if self.parent.page_limit > 0: 2275 req.meta.limit = self.parent.page_limit 2276 if self.parent.snapshot_datetime is not None: 2277 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2278 2279 req.filter = plumbing.quote_filter_args(filter, *args) 2280 2281 def generator(svc, req): 2282 tries = 0 2283 while True: 2284 try: 2285 plumbing_response = svc.stub.List( 2286 req, 2287 metadata=svc.parent.get_metadata( 2288 'NodesHistory.List', req), 2289 timeout=timeout) 2290 except Exception as e: 2291 if self.parent.shouldRetry(tries, e): 2292 tries += 1 2293 self.parent.jitterSleep(tries) 2294 continue 2295 raise plumbing.convert_error_to_porcelain(e) from e 2296 tries = 0 2297 for plumbing_item in plumbing_response.history: 2298 yield plumbing.convert_node_history_to_porcelain( 2299 plumbing_item) 2300 if plumbing_response.meta.next_cursor == '': 2301 break 2302 req.meta.cursor = plumbing_response.meta.next_cursor 2303 2304 return generator(self, req)
NodesHistory records all changes to the state of a Node.
See strongdm.models.NodeHistory
.
2268 def list(self, filter, *args, timeout=None): 2269 ''' 2270 List gets a list of NodeHistory records matching a given set of criteria. 2271 ''' 2272 req = NodeHistoryListRequest() 2273 req.meta.CopyFrom(ListRequestMetadata()) 2274 if self.parent.page_limit > 0: 2275 req.meta.limit = self.parent.page_limit 2276 if self.parent.snapshot_datetime is not None: 2277 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2278 2279 req.filter = plumbing.quote_filter_args(filter, *args) 2280 2281 def generator(svc, req): 2282 tries = 0 2283 while True: 2284 try: 2285 plumbing_response = svc.stub.List( 2286 req, 2287 metadata=svc.parent.get_metadata( 2288 'NodesHistory.List', req), 2289 timeout=timeout) 2290 except Exception as e: 2291 if self.parent.shouldRetry(tries, e): 2292 tries += 1 2293 self.parent.jitterSleep(tries) 2294 continue 2295 raise plumbing.convert_error_to_porcelain(e) from e 2296 tries = 0 2297 for plumbing_item in plumbing_response.history: 2298 yield plumbing.convert_node_history_to_porcelain( 2299 plumbing_item) 2300 if plumbing_response.meta.next_cursor == '': 2301 break 2302 req.meta.cursor = plumbing_response.meta.next_cursor 2303 2304 return generator(self, req)
List gets a list of NodeHistory records matching a given set of criteria.
2307class OrganizationHistory: 2308 ''' 2309 OrganizationHistory records all changes to the state of an Organization. 2310 See `strongdm.models.OrganizationHistoryRecord`. 2311 ''' 2312 def __init__(self, channel, client): 2313 self.parent = client 2314 self.stub = OrganizationHistoryStub(channel) 2315 2316 def list(self, filter, *args, timeout=None): 2317 ''' 2318 List gets a list of OrganizationHistory records matching a given set of criteria. 2319 ''' 2320 req = OrganizationHistoryListRequest() 2321 req.meta.CopyFrom(ListRequestMetadata()) 2322 if self.parent.page_limit > 0: 2323 req.meta.limit = self.parent.page_limit 2324 if self.parent.snapshot_datetime is not None: 2325 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2326 2327 req.filter = plumbing.quote_filter_args(filter, *args) 2328 2329 def generator(svc, req): 2330 tries = 0 2331 while True: 2332 try: 2333 plumbing_response = svc.stub.List( 2334 req, 2335 metadata=svc.parent.get_metadata( 2336 'OrganizationHistory.List', req), 2337 timeout=timeout) 2338 except Exception as e: 2339 if self.parent.shouldRetry(tries, e): 2340 tries += 1 2341 self.parent.jitterSleep(tries) 2342 continue 2343 raise plumbing.convert_error_to_porcelain(e) from e 2344 tries = 0 2345 for plumbing_item in plumbing_response.history: 2346 yield plumbing.convert_organization_history_record_to_porcelain( 2347 plumbing_item) 2348 if plumbing_response.meta.next_cursor == '': 2349 break 2350 req.meta.cursor = plumbing_response.meta.next_cursor 2351 2352 return generator(self, req)
OrganizationHistory records all changes to the state of an Organization.
See strongdm.models.OrganizationHistoryRecord
.
2316 def list(self, filter, *args, timeout=None): 2317 ''' 2318 List gets a list of OrganizationHistory records matching a given set of criteria. 2319 ''' 2320 req = OrganizationHistoryListRequest() 2321 req.meta.CopyFrom(ListRequestMetadata()) 2322 if self.parent.page_limit > 0: 2323 req.meta.limit = self.parent.page_limit 2324 if self.parent.snapshot_datetime is not None: 2325 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2326 2327 req.filter = plumbing.quote_filter_args(filter, *args) 2328 2329 def generator(svc, req): 2330 tries = 0 2331 while True: 2332 try: 2333 plumbing_response = svc.stub.List( 2334 req, 2335 metadata=svc.parent.get_metadata( 2336 'OrganizationHistory.List', req), 2337 timeout=timeout) 2338 except Exception as e: 2339 if self.parent.shouldRetry(tries, e): 2340 tries += 1 2341 self.parent.jitterSleep(tries) 2342 continue 2343 raise plumbing.convert_error_to_porcelain(e) from e 2344 tries = 0 2345 for plumbing_item in plumbing_response.history: 2346 yield plumbing.convert_organization_history_record_to_porcelain( 2347 plumbing_item) 2348 if plumbing_response.meta.next_cursor == '': 2349 break 2350 req.meta.cursor = plumbing_response.meta.next_cursor 2351 2352 return generator(self, req)
List gets a list of OrganizationHistory records matching a given set of criteria.
2355class PeeringGroupNodes: 2356 ''' 2357 PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group. 2358 See `strongdm.models.PeeringGroupNode`. 2359 ''' 2360 def __init__(self, channel, client): 2361 self.parent = client 2362 self.stub = PeeringGroupNodesStub(channel) 2363 2364 def create(self, peering_group_node, timeout=None): 2365 ''' 2366 Create attaches a Node to a PeeringGroup 2367 ''' 2368 req = PeeringGroupNodeCreateRequest() 2369 2370 if peering_group_node is not None: 2371 req.peering_group_node.CopyFrom( 2372 plumbing.convert_peering_group_node_to_plumbing( 2373 peering_group_node)) 2374 tries = 0 2375 plumbing_response = None 2376 while True: 2377 try: 2378 plumbing_response = self.stub.Create( 2379 req, 2380 metadata=self.parent.get_metadata( 2381 'PeeringGroupNodes.Create', req), 2382 timeout=timeout) 2383 except Exception as e: 2384 if self.parent.shouldRetry(tries, e): 2385 tries += 1 2386 self.parent.jitterSleep(tries) 2387 continue 2388 raise plumbing.convert_error_to_porcelain(e) from e 2389 break 2390 2391 resp = models.PeeringGroupNodeCreateResponse() 2392 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2393 plumbing_response.meta) 2394 resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain( 2395 plumbing_response.peering_group_node) 2396 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2397 plumbing_response.rate_limit) 2398 return resp 2399 2400 def delete(self, id, timeout=None): 2401 ''' 2402 Delete detaches a Node to a PeeringGroup. 2403 ''' 2404 req = PeeringGroupNodeDeleteRequest() 2405 2406 req.id = (id) 2407 tries = 0 2408 plumbing_response = None 2409 while True: 2410 try: 2411 plumbing_response = self.stub.Delete( 2412 req, 2413 metadata=self.parent.get_metadata( 2414 'PeeringGroupNodes.Delete', req), 2415 timeout=timeout) 2416 except Exception as e: 2417 if self.parent.shouldRetry(tries, e): 2418 tries += 1 2419 self.parent.jitterSleep(tries) 2420 continue 2421 raise plumbing.convert_error_to_porcelain(e) from e 2422 break 2423 2424 resp = models.PeeringGroupNodeDeleteResponse() 2425 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2426 plumbing_response.meta) 2427 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2428 plumbing_response.rate_limit) 2429 return resp 2430 2431 def get(self, id, timeout=None): 2432 ''' 2433 Get reads the information of one peering group to node attachment. 2434 ''' 2435 req = PeeringGroupNodeGetRequest() 2436 if self.parent.snapshot_datetime is not None: 2437 req.meta.CopyFrom(GetRequestMetadata()) 2438 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2439 2440 req.id = (id) 2441 tries = 0 2442 plumbing_response = None 2443 while True: 2444 try: 2445 plumbing_response = self.stub.Get( 2446 req, 2447 metadata=self.parent.get_metadata('PeeringGroupNodes.Get', 2448 req), 2449 timeout=timeout) 2450 except Exception as e: 2451 if self.parent.shouldRetry(tries, e): 2452 tries += 1 2453 self.parent.jitterSleep(tries) 2454 continue 2455 raise plumbing.convert_error_to_porcelain(e) from e 2456 break 2457 2458 resp = models.PeeringGroupNodeGetResponse() 2459 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2460 plumbing_response.meta) 2461 resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain( 2462 plumbing_response.peering_group_node) 2463 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2464 plumbing_response.rate_limit) 2465 return resp 2466 2467 def list(self, filter, *args, timeout=None): 2468 ''' 2469 List gets a list of peering group node attachments. 2470 ''' 2471 req = PeeringGroupNodeListRequest() 2472 req.meta.CopyFrom(ListRequestMetadata()) 2473 if self.parent.page_limit > 0: 2474 req.meta.limit = self.parent.page_limit 2475 if self.parent.snapshot_datetime is not None: 2476 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2477 2478 req.filter = plumbing.quote_filter_args(filter, *args) 2479 2480 def generator(svc, req): 2481 tries = 0 2482 while True: 2483 try: 2484 plumbing_response = svc.stub.List( 2485 req, 2486 metadata=svc.parent.get_metadata( 2487 'PeeringGroupNodes.List', req), 2488 timeout=timeout) 2489 except Exception as e: 2490 if self.parent.shouldRetry(tries, e): 2491 tries += 1 2492 self.parent.jitterSleep(tries) 2493 continue 2494 raise plumbing.convert_error_to_porcelain(e) from e 2495 tries = 0 2496 for plumbing_item in plumbing_response.peering_group_nodes: 2497 yield plumbing.convert_peering_group_node_to_porcelain( 2498 plumbing_item) 2499 if plumbing_response.meta.next_cursor == '': 2500 break 2501 req.meta.cursor = plumbing_response.meta.next_cursor 2502 2503 return generator(self, req)
PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group.
See strongdm.models.PeeringGroupNode
.
2364 def create(self, peering_group_node, timeout=None): 2365 ''' 2366 Create attaches a Node to a PeeringGroup 2367 ''' 2368 req = PeeringGroupNodeCreateRequest() 2369 2370 if peering_group_node is not None: 2371 req.peering_group_node.CopyFrom( 2372 plumbing.convert_peering_group_node_to_plumbing( 2373 peering_group_node)) 2374 tries = 0 2375 plumbing_response = None 2376 while True: 2377 try: 2378 plumbing_response = self.stub.Create( 2379 req, 2380 metadata=self.parent.get_metadata( 2381 'PeeringGroupNodes.Create', req), 2382 timeout=timeout) 2383 except Exception as e: 2384 if self.parent.shouldRetry(tries, e): 2385 tries += 1 2386 self.parent.jitterSleep(tries) 2387 continue 2388 raise plumbing.convert_error_to_porcelain(e) from e 2389 break 2390 2391 resp = models.PeeringGroupNodeCreateResponse() 2392 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2393 plumbing_response.meta) 2394 resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain( 2395 plumbing_response.peering_group_node) 2396 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2397 plumbing_response.rate_limit) 2398 return resp
Create attaches a Node to a PeeringGroup
2400 def delete(self, id, timeout=None): 2401 ''' 2402 Delete detaches a Node to a PeeringGroup. 2403 ''' 2404 req = PeeringGroupNodeDeleteRequest() 2405 2406 req.id = (id) 2407 tries = 0 2408 plumbing_response = None 2409 while True: 2410 try: 2411 plumbing_response = self.stub.Delete( 2412 req, 2413 metadata=self.parent.get_metadata( 2414 'PeeringGroupNodes.Delete', req), 2415 timeout=timeout) 2416 except Exception as e: 2417 if self.parent.shouldRetry(tries, e): 2418 tries += 1 2419 self.parent.jitterSleep(tries) 2420 continue 2421 raise plumbing.convert_error_to_porcelain(e) from e 2422 break 2423 2424 resp = models.PeeringGroupNodeDeleteResponse() 2425 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2426 plumbing_response.meta) 2427 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2428 plumbing_response.rate_limit) 2429 return resp
Delete detaches a Node to a PeeringGroup.
2431 def get(self, id, timeout=None): 2432 ''' 2433 Get reads the information of one peering group to node attachment. 2434 ''' 2435 req = PeeringGroupNodeGetRequest() 2436 if self.parent.snapshot_datetime is not None: 2437 req.meta.CopyFrom(GetRequestMetadata()) 2438 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2439 2440 req.id = (id) 2441 tries = 0 2442 plumbing_response = None 2443 while True: 2444 try: 2445 plumbing_response = self.stub.Get( 2446 req, 2447 metadata=self.parent.get_metadata('PeeringGroupNodes.Get', 2448 req), 2449 timeout=timeout) 2450 except Exception as e: 2451 if self.parent.shouldRetry(tries, e): 2452 tries += 1 2453 self.parent.jitterSleep(tries) 2454 continue 2455 raise plumbing.convert_error_to_porcelain(e) from e 2456 break 2457 2458 resp = models.PeeringGroupNodeGetResponse() 2459 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2460 plumbing_response.meta) 2461 resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain( 2462 plumbing_response.peering_group_node) 2463 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2464 plumbing_response.rate_limit) 2465 return resp
Get reads the information of one peering group to node attachment.
2467 def list(self, filter, *args, timeout=None): 2468 ''' 2469 List gets a list of peering group node attachments. 2470 ''' 2471 req = PeeringGroupNodeListRequest() 2472 req.meta.CopyFrom(ListRequestMetadata()) 2473 if self.parent.page_limit > 0: 2474 req.meta.limit = self.parent.page_limit 2475 if self.parent.snapshot_datetime is not None: 2476 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2477 2478 req.filter = plumbing.quote_filter_args(filter, *args) 2479 2480 def generator(svc, req): 2481 tries = 0 2482 while True: 2483 try: 2484 plumbing_response = svc.stub.List( 2485 req, 2486 metadata=svc.parent.get_metadata( 2487 'PeeringGroupNodes.List', req), 2488 timeout=timeout) 2489 except Exception as e: 2490 if self.parent.shouldRetry(tries, e): 2491 tries += 1 2492 self.parent.jitterSleep(tries) 2493 continue 2494 raise plumbing.convert_error_to_porcelain(e) from e 2495 tries = 0 2496 for plumbing_item in plumbing_response.peering_group_nodes: 2497 yield plumbing.convert_peering_group_node_to_porcelain( 2498 plumbing_item) 2499 if plumbing_response.meta.next_cursor == '': 2500 break 2501 req.meta.cursor = plumbing_response.meta.next_cursor 2502 2503 return generator(self, req)
List gets a list of peering group node attachments.
2506class PeeringGroupPeers: 2507 ''' 2508 PeeringGroupPeers provides the building blocks necessary to link two peering groups. 2509 See `strongdm.models.PeeringGroupPeer`. 2510 ''' 2511 def __init__(self, channel, client): 2512 self.parent = client 2513 self.stub = PeeringGroupPeersStub(channel) 2514 2515 def create(self, peering_group_peer, timeout=None): 2516 ''' 2517 Create links two peering groups. 2518 ''' 2519 req = PeeringGroupPeerCreateRequest() 2520 2521 if peering_group_peer is not None: 2522 req.peering_group_peer.CopyFrom( 2523 plumbing.convert_peering_group_peer_to_plumbing( 2524 peering_group_peer)) 2525 tries = 0 2526 plumbing_response = None 2527 while True: 2528 try: 2529 plumbing_response = self.stub.Create( 2530 req, 2531 metadata=self.parent.get_metadata( 2532 'PeeringGroupPeers.Create', req), 2533 timeout=timeout) 2534 except Exception as e: 2535 if self.parent.shouldRetry(tries, e): 2536 tries += 1 2537 self.parent.jitterSleep(tries) 2538 continue 2539 raise plumbing.convert_error_to_porcelain(e) from e 2540 break 2541 2542 resp = models.PeeringGroupPeerCreateResponse() 2543 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2544 plumbing_response.meta) 2545 resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain( 2546 plumbing_response.peering_group_peer) 2547 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2548 plumbing_response.rate_limit) 2549 return resp 2550 2551 def delete(self, id, timeout=None): 2552 ''' 2553 Delete unlinks two peering groups. 2554 ''' 2555 req = PeeringGroupPeerDeleteRequest() 2556 2557 req.id = (id) 2558 tries = 0 2559 plumbing_response = None 2560 while True: 2561 try: 2562 plumbing_response = self.stub.Delete( 2563 req, 2564 metadata=self.parent.get_metadata( 2565 'PeeringGroupPeers.Delete', req), 2566 timeout=timeout) 2567 except Exception as e: 2568 if self.parent.shouldRetry(tries, e): 2569 tries += 1 2570 self.parent.jitterSleep(tries) 2571 continue 2572 raise plumbing.convert_error_to_porcelain(e) from e 2573 break 2574 2575 resp = models.PeeringGroupPeerDeleteResponse() 2576 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2577 plumbing_response.meta) 2578 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2579 plumbing_response.rate_limit) 2580 return resp 2581 2582 def get(self, id, timeout=None): 2583 ''' 2584 Get reads the information of one peering group link. 2585 ''' 2586 req = PeeringGroupPeerGetRequest() 2587 if self.parent.snapshot_datetime is not None: 2588 req.meta.CopyFrom(GetRequestMetadata()) 2589 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2590 2591 req.id = (id) 2592 tries = 0 2593 plumbing_response = None 2594 while True: 2595 try: 2596 plumbing_response = self.stub.Get( 2597 req, 2598 metadata=self.parent.get_metadata('PeeringGroupPeers.Get', 2599 req), 2600 timeout=timeout) 2601 except Exception as e: 2602 if self.parent.shouldRetry(tries, e): 2603 tries += 1 2604 self.parent.jitterSleep(tries) 2605 continue 2606 raise plumbing.convert_error_to_porcelain(e) from e 2607 break 2608 2609 resp = models.PeeringGroupPeerGetResponse() 2610 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2611 plumbing_response.meta) 2612 resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain( 2613 plumbing_response.peering_group_peer) 2614 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2615 plumbing_response.rate_limit) 2616 return resp 2617 2618 def list(self, filter, *args, timeout=None): 2619 ''' 2620 List gets a list of peering group links. 2621 ''' 2622 req = PeeringGroupPeerListRequest() 2623 req.meta.CopyFrom(ListRequestMetadata()) 2624 if self.parent.page_limit > 0: 2625 req.meta.limit = self.parent.page_limit 2626 if self.parent.snapshot_datetime is not None: 2627 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2628 2629 req.filter = plumbing.quote_filter_args(filter, *args) 2630 2631 def generator(svc, req): 2632 tries = 0 2633 while True: 2634 try: 2635 plumbing_response = svc.stub.List( 2636 req, 2637 metadata=svc.parent.get_metadata( 2638 'PeeringGroupPeers.List', req), 2639 timeout=timeout) 2640 except Exception as e: 2641 if self.parent.shouldRetry(tries, e): 2642 tries += 1 2643 self.parent.jitterSleep(tries) 2644 continue 2645 raise plumbing.convert_error_to_porcelain(e) from e 2646 tries = 0 2647 for plumbing_item in plumbing_response.peering_group_peers: 2648 yield plumbing.convert_peering_group_peer_to_porcelain( 2649 plumbing_item) 2650 if plumbing_response.meta.next_cursor == '': 2651 break 2652 req.meta.cursor = plumbing_response.meta.next_cursor 2653 2654 return generator(self, req)
PeeringGroupPeers provides the building blocks necessary to link two peering groups.
See strongdm.models.PeeringGroupPeer
.
2515 def create(self, peering_group_peer, timeout=None): 2516 ''' 2517 Create links two peering groups. 2518 ''' 2519 req = PeeringGroupPeerCreateRequest() 2520 2521 if peering_group_peer is not None: 2522 req.peering_group_peer.CopyFrom( 2523 plumbing.convert_peering_group_peer_to_plumbing( 2524 peering_group_peer)) 2525 tries = 0 2526 plumbing_response = None 2527 while True: 2528 try: 2529 plumbing_response = self.stub.Create( 2530 req, 2531 metadata=self.parent.get_metadata( 2532 'PeeringGroupPeers.Create', req), 2533 timeout=timeout) 2534 except Exception as e: 2535 if self.parent.shouldRetry(tries, e): 2536 tries += 1 2537 self.parent.jitterSleep(tries) 2538 continue 2539 raise plumbing.convert_error_to_porcelain(e) from e 2540 break 2541 2542 resp = models.PeeringGroupPeerCreateResponse() 2543 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2544 plumbing_response.meta) 2545 resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain( 2546 plumbing_response.peering_group_peer) 2547 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2548 plumbing_response.rate_limit) 2549 return resp
Create links two peering groups.
2551 def delete(self, id, timeout=None): 2552 ''' 2553 Delete unlinks two peering groups. 2554 ''' 2555 req = PeeringGroupPeerDeleteRequest() 2556 2557 req.id = (id) 2558 tries = 0 2559 plumbing_response = None 2560 while True: 2561 try: 2562 plumbing_response = self.stub.Delete( 2563 req, 2564 metadata=self.parent.get_metadata( 2565 'PeeringGroupPeers.Delete', req), 2566 timeout=timeout) 2567 except Exception as e: 2568 if self.parent.shouldRetry(tries, e): 2569 tries += 1 2570 self.parent.jitterSleep(tries) 2571 continue 2572 raise plumbing.convert_error_to_porcelain(e) from e 2573 break 2574 2575 resp = models.PeeringGroupPeerDeleteResponse() 2576 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2577 plumbing_response.meta) 2578 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2579 plumbing_response.rate_limit) 2580 return resp
Delete unlinks two peering groups.
2582 def get(self, id, timeout=None): 2583 ''' 2584 Get reads the information of one peering group link. 2585 ''' 2586 req = PeeringGroupPeerGetRequest() 2587 if self.parent.snapshot_datetime is not None: 2588 req.meta.CopyFrom(GetRequestMetadata()) 2589 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2590 2591 req.id = (id) 2592 tries = 0 2593 plumbing_response = None 2594 while True: 2595 try: 2596 plumbing_response = self.stub.Get( 2597 req, 2598 metadata=self.parent.get_metadata('PeeringGroupPeers.Get', 2599 req), 2600 timeout=timeout) 2601 except Exception as e: 2602 if self.parent.shouldRetry(tries, e): 2603 tries += 1 2604 self.parent.jitterSleep(tries) 2605 continue 2606 raise plumbing.convert_error_to_porcelain(e) from e 2607 break 2608 2609 resp = models.PeeringGroupPeerGetResponse() 2610 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2611 plumbing_response.meta) 2612 resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain( 2613 plumbing_response.peering_group_peer) 2614 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2615 plumbing_response.rate_limit) 2616 return resp
Get reads the information of one peering group link.
2618 def list(self, filter, *args, timeout=None): 2619 ''' 2620 List gets a list of peering group links. 2621 ''' 2622 req = PeeringGroupPeerListRequest() 2623 req.meta.CopyFrom(ListRequestMetadata()) 2624 if self.parent.page_limit > 0: 2625 req.meta.limit = self.parent.page_limit 2626 if self.parent.snapshot_datetime is not None: 2627 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2628 2629 req.filter = plumbing.quote_filter_args(filter, *args) 2630 2631 def generator(svc, req): 2632 tries = 0 2633 while True: 2634 try: 2635 plumbing_response = svc.stub.List( 2636 req, 2637 metadata=svc.parent.get_metadata( 2638 'PeeringGroupPeers.List', req), 2639 timeout=timeout) 2640 except Exception as e: 2641 if self.parent.shouldRetry(tries, e): 2642 tries += 1 2643 self.parent.jitterSleep(tries) 2644 continue 2645 raise plumbing.convert_error_to_porcelain(e) from e 2646 tries = 0 2647 for plumbing_item in plumbing_response.peering_group_peers: 2648 yield plumbing.convert_peering_group_peer_to_porcelain( 2649 plumbing_item) 2650 if plumbing_response.meta.next_cursor == '': 2651 break 2652 req.meta.cursor = plumbing_response.meta.next_cursor 2653 2654 return generator(self, req)
List gets a list of peering group links.
2657class PeeringGroupResources: 2658 ''' 2659 PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group. 2660 See `strongdm.models.PeeringGroupResource`. 2661 ''' 2662 def __init__(self, channel, client): 2663 self.parent = client 2664 self.stub = PeeringGroupResourcesStub(channel) 2665 2666 def create(self, peering_group_resource, timeout=None): 2667 ''' 2668 Create attaches a Resource to a PeeringGroup 2669 ''' 2670 req = PeeringGroupResourceCreateRequest() 2671 2672 if peering_group_resource is not None: 2673 req.peering_group_resource.CopyFrom( 2674 plumbing.convert_peering_group_resource_to_plumbing( 2675 peering_group_resource)) 2676 tries = 0 2677 plumbing_response = None 2678 while True: 2679 try: 2680 plumbing_response = self.stub.Create( 2681 req, 2682 metadata=self.parent.get_metadata( 2683 'PeeringGroupResources.Create', req), 2684 timeout=timeout) 2685 except Exception as e: 2686 if self.parent.shouldRetry(tries, e): 2687 tries += 1 2688 self.parent.jitterSleep(tries) 2689 continue 2690 raise plumbing.convert_error_to_porcelain(e) from e 2691 break 2692 2693 resp = models.PeeringGroupResourceCreateResponse() 2694 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2695 plumbing_response.meta) 2696 resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain( 2697 plumbing_response.peering_group_resource) 2698 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2699 plumbing_response.rate_limit) 2700 return resp 2701 2702 def delete(self, id, timeout=None): 2703 ''' 2704 Delete detaches a Resource to a PeeringGroup 2705 ''' 2706 req = PeeringGroupResourceDeleteRequest() 2707 2708 req.id = (id) 2709 tries = 0 2710 plumbing_response = None 2711 while True: 2712 try: 2713 plumbing_response = self.stub.Delete( 2714 req, 2715 metadata=self.parent.get_metadata( 2716 'PeeringGroupResources.Delete', req), 2717 timeout=timeout) 2718 except Exception as e: 2719 if self.parent.shouldRetry(tries, e): 2720 tries += 1 2721 self.parent.jitterSleep(tries) 2722 continue 2723 raise plumbing.convert_error_to_porcelain(e) from e 2724 break 2725 2726 resp = models.PeeringGroupResourceDeleteResponse() 2727 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2728 plumbing_response.meta) 2729 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2730 plumbing_response.rate_limit) 2731 return resp 2732 2733 def get(self, id, timeout=None): 2734 ''' 2735 Get reads the information of one peering group to resource attachment. 2736 ''' 2737 req = PeeringGroupResourceGetRequest() 2738 if self.parent.snapshot_datetime is not None: 2739 req.meta.CopyFrom(GetRequestMetadata()) 2740 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2741 2742 req.id = (id) 2743 tries = 0 2744 plumbing_response = None 2745 while True: 2746 try: 2747 plumbing_response = self.stub.Get( 2748 req, 2749 metadata=self.parent.get_metadata( 2750 'PeeringGroupResources.Get', req), 2751 timeout=timeout) 2752 except Exception as e: 2753 if self.parent.shouldRetry(tries, e): 2754 tries += 1 2755 self.parent.jitterSleep(tries) 2756 continue 2757 raise plumbing.convert_error_to_porcelain(e) from e 2758 break 2759 2760 resp = models.PeeringGroupResourceGetResponse() 2761 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2762 plumbing_response.meta) 2763 resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain( 2764 plumbing_response.peering_group_resource) 2765 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2766 plumbing_response.rate_limit) 2767 return resp 2768 2769 def list(self, filter, *args, timeout=None): 2770 ''' 2771 List gets a list of peering group resource attachments. 2772 ''' 2773 req = PeeringGroupResourceListRequest() 2774 req.meta.CopyFrom(ListRequestMetadata()) 2775 if self.parent.page_limit > 0: 2776 req.meta.limit = self.parent.page_limit 2777 if self.parent.snapshot_datetime is not None: 2778 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2779 2780 req.filter = plumbing.quote_filter_args(filter, *args) 2781 2782 def generator(svc, req): 2783 tries = 0 2784 while True: 2785 try: 2786 plumbing_response = svc.stub.List( 2787 req, 2788 metadata=svc.parent.get_metadata( 2789 'PeeringGroupResources.List', req), 2790 timeout=timeout) 2791 except Exception as e: 2792 if self.parent.shouldRetry(tries, e): 2793 tries += 1 2794 self.parent.jitterSleep(tries) 2795 continue 2796 raise plumbing.convert_error_to_porcelain(e) from e 2797 tries = 0 2798 for plumbing_item in plumbing_response.peering_group_resources: 2799 yield plumbing.convert_peering_group_resource_to_porcelain( 2800 plumbing_item) 2801 if plumbing_response.meta.next_cursor == '': 2802 break 2803 req.meta.cursor = plumbing_response.meta.next_cursor 2804 2805 return generator(self, req)
PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group.
See strongdm.models.PeeringGroupResource
.
2666 def create(self, peering_group_resource, timeout=None): 2667 ''' 2668 Create attaches a Resource to a PeeringGroup 2669 ''' 2670 req = PeeringGroupResourceCreateRequest() 2671 2672 if peering_group_resource is not None: 2673 req.peering_group_resource.CopyFrom( 2674 plumbing.convert_peering_group_resource_to_plumbing( 2675 peering_group_resource)) 2676 tries = 0 2677 plumbing_response = None 2678 while True: 2679 try: 2680 plumbing_response = self.stub.Create( 2681 req, 2682 metadata=self.parent.get_metadata( 2683 'PeeringGroupResources.Create', req), 2684 timeout=timeout) 2685 except Exception as e: 2686 if self.parent.shouldRetry(tries, e): 2687 tries += 1 2688 self.parent.jitterSleep(tries) 2689 continue 2690 raise plumbing.convert_error_to_porcelain(e) from e 2691 break 2692 2693 resp = models.PeeringGroupResourceCreateResponse() 2694 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2695 plumbing_response.meta) 2696 resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain( 2697 plumbing_response.peering_group_resource) 2698 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2699 plumbing_response.rate_limit) 2700 return resp
Create attaches a Resource to a PeeringGroup
2702 def delete(self, id, timeout=None): 2703 ''' 2704 Delete detaches a Resource to a PeeringGroup 2705 ''' 2706 req = PeeringGroupResourceDeleteRequest() 2707 2708 req.id = (id) 2709 tries = 0 2710 plumbing_response = None 2711 while True: 2712 try: 2713 plumbing_response = self.stub.Delete( 2714 req, 2715 metadata=self.parent.get_metadata( 2716 'PeeringGroupResources.Delete', req), 2717 timeout=timeout) 2718 except Exception as e: 2719 if self.parent.shouldRetry(tries, e): 2720 tries += 1 2721 self.parent.jitterSleep(tries) 2722 continue 2723 raise plumbing.convert_error_to_porcelain(e) from e 2724 break 2725 2726 resp = models.PeeringGroupResourceDeleteResponse() 2727 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2728 plumbing_response.meta) 2729 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2730 plumbing_response.rate_limit) 2731 return resp
Delete detaches a Resource to a PeeringGroup
2733 def get(self, id, timeout=None): 2734 ''' 2735 Get reads the information of one peering group to resource attachment. 2736 ''' 2737 req = PeeringGroupResourceGetRequest() 2738 if self.parent.snapshot_datetime is not None: 2739 req.meta.CopyFrom(GetRequestMetadata()) 2740 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2741 2742 req.id = (id) 2743 tries = 0 2744 plumbing_response = None 2745 while True: 2746 try: 2747 plumbing_response = self.stub.Get( 2748 req, 2749 metadata=self.parent.get_metadata( 2750 'PeeringGroupResources.Get', req), 2751 timeout=timeout) 2752 except Exception as e: 2753 if self.parent.shouldRetry(tries, e): 2754 tries += 1 2755 self.parent.jitterSleep(tries) 2756 continue 2757 raise plumbing.convert_error_to_porcelain(e) from e 2758 break 2759 2760 resp = models.PeeringGroupResourceGetResponse() 2761 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2762 plumbing_response.meta) 2763 resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain( 2764 plumbing_response.peering_group_resource) 2765 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2766 plumbing_response.rate_limit) 2767 return resp
Get reads the information of one peering group to resource attachment.
2769 def list(self, filter, *args, timeout=None): 2770 ''' 2771 List gets a list of peering group resource attachments. 2772 ''' 2773 req = PeeringGroupResourceListRequest() 2774 req.meta.CopyFrom(ListRequestMetadata()) 2775 if self.parent.page_limit > 0: 2776 req.meta.limit = self.parent.page_limit 2777 if self.parent.snapshot_datetime is not None: 2778 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2779 2780 req.filter = plumbing.quote_filter_args(filter, *args) 2781 2782 def generator(svc, req): 2783 tries = 0 2784 while True: 2785 try: 2786 plumbing_response = svc.stub.List( 2787 req, 2788 metadata=svc.parent.get_metadata( 2789 'PeeringGroupResources.List', req), 2790 timeout=timeout) 2791 except Exception as e: 2792 if self.parent.shouldRetry(tries, e): 2793 tries += 1 2794 self.parent.jitterSleep(tries) 2795 continue 2796 raise plumbing.convert_error_to_porcelain(e) from e 2797 tries = 0 2798 for plumbing_item in plumbing_response.peering_group_resources: 2799 yield plumbing.convert_peering_group_resource_to_porcelain( 2800 plumbing_item) 2801 if plumbing_response.meta.next_cursor == '': 2802 break 2803 req.meta.cursor = plumbing_response.meta.next_cursor 2804 2805 return generator(self, req)
List gets a list of peering group resource attachments.
2808class PeeringGroups: 2809 ''' 2810 PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing. 2811 See `strongdm.models.PeeringGroup`. 2812 ''' 2813 def __init__(self, channel, client): 2814 self.parent = client 2815 self.stub = PeeringGroupsStub(channel) 2816 2817 def create(self, peering_group, timeout=None): 2818 ''' 2819 Create registers a new PeeringGroup. 2820 ''' 2821 req = PeeringGroupCreateRequest() 2822 2823 if peering_group is not None: 2824 req.peering_group.CopyFrom( 2825 plumbing.convert_peering_group_to_plumbing(peering_group)) 2826 tries = 0 2827 plumbing_response = None 2828 while True: 2829 try: 2830 plumbing_response = self.stub.Create( 2831 req, 2832 metadata=self.parent.get_metadata('PeeringGroups.Create', 2833 req), 2834 timeout=timeout) 2835 except Exception as e: 2836 if self.parent.shouldRetry(tries, e): 2837 tries += 1 2838 self.parent.jitterSleep(tries) 2839 continue 2840 raise plumbing.convert_error_to_porcelain(e) from e 2841 break 2842 2843 resp = models.PeeringGroupCreateResponse() 2844 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2845 plumbing_response.meta) 2846 resp.peering_group = plumbing.convert_peering_group_to_porcelain( 2847 plumbing_response.peering_group) 2848 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2849 plumbing_response.rate_limit) 2850 return resp 2851 2852 def delete(self, id, timeout=None): 2853 ''' 2854 Delete removes a PeeringGroup by ID. 2855 ''' 2856 req = PeeringGroupDeleteRequest() 2857 2858 req.id = (id) 2859 tries = 0 2860 plumbing_response = None 2861 while True: 2862 try: 2863 plumbing_response = self.stub.Delete( 2864 req, 2865 metadata=self.parent.get_metadata('PeeringGroups.Delete', 2866 req), 2867 timeout=timeout) 2868 except Exception as e: 2869 if self.parent.shouldRetry(tries, e): 2870 tries += 1 2871 self.parent.jitterSleep(tries) 2872 continue 2873 raise plumbing.convert_error_to_porcelain(e) from e 2874 break 2875 2876 resp = models.PeeringGroupDeleteResponse() 2877 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2878 plumbing_response.meta) 2879 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2880 plumbing_response.rate_limit) 2881 return resp 2882 2883 def get(self, id, timeout=None): 2884 ''' 2885 Get reads one PeeringGroup by ID. It will load all its dependencies. 2886 ''' 2887 req = PeeringGroupGetRequest() 2888 if self.parent.snapshot_datetime is not None: 2889 req.meta.CopyFrom(GetRequestMetadata()) 2890 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2891 2892 req.id = (id) 2893 tries = 0 2894 plumbing_response = None 2895 while True: 2896 try: 2897 plumbing_response = self.stub.Get( 2898 req, 2899 metadata=self.parent.get_metadata('PeeringGroups.Get', 2900 req), 2901 timeout=timeout) 2902 except Exception as e: 2903 if self.parent.shouldRetry(tries, e): 2904 tries += 1 2905 self.parent.jitterSleep(tries) 2906 continue 2907 raise plumbing.convert_error_to_porcelain(e) from e 2908 break 2909 2910 resp = models.PeeringGroupGetResponse() 2911 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2912 plumbing_response.meta) 2913 resp.peering_group = plumbing.convert_peering_group_to_porcelain( 2914 plumbing_response.peering_group) 2915 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2916 plumbing_response.rate_limit) 2917 return resp 2918 2919 def list(self, filter, *args, timeout=None): 2920 ''' 2921 List gets a list of Peering Groups. 2922 ''' 2923 req = PeeringGroupListRequest() 2924 req.meta.CopyFrom(ListRequestMetadata()) 2925 if self.parent.page_limit > 0: 2926 req.meta.limit = self.parent.page_limit 2927 if self.parent.snapshot_datetime is not None: 2928 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2929 2930 req.filter = plumbing.quote_filter_args(filter, *args) 2931 2932 def generator(svc, req): 2933 tries = 0 2934 while True: 2935 try: 2936 plumbing_response = svc.stub.List( 2937 req, 2938 metadata=svc.parent.get_metadata( 2939 'PeeringGroups.List', req), 2940 timeout=timeout) 2941 except Exception as e: 2942 if self.parent.shouldRetry(tries, e): 2943 tries += 1 2944 self.parent.jitterSleep(tries) 2945 continue 2946 raise plumbing.convert_error_to_porcelain(e) from e 2947 tries = 0 2948 for plumbing_item in plumbing_response.peering_groups: 2949 yield plumbing.convert_peering_group_to_porcelain( 2950 plumbing_item) 2951 if plumbing_response.meta.next_cursor == '': 2952 break 2953 req.meta.cursor = plumbing_response.meta.next_cursor 2954 2955 return generator(self, req)
PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing.
See strongdm.models.PeeringGroup
.
2817 def create(self, peering_group, timeout=None): 2818 ''' 2819 Create registers a new PeeringGroup. 2820 ''' 2821 req = PeeringGroupCreateRequest() 2822 2823 if peering_group is not None: 2824 req.peering_group.CopyFrom( 2825 plumbing.convert_peering_group_to_plumbing(peering_group)) 2826 tries = 0 2827 plumbing_response = None 2828 while True: 2829 try: 2830 plumbing_response = self.stub.Create( 2831 req, 2832 metadata=self.parent.get_metadata('PeeringGroups.Create', 2833 req), 2834 timeout=timeout) 2835 except Exception as e: 2836 if self.parent.shouldRetry(tries, e): 2837 tries += 1 2838 self.parent.jitterSleep(tries) 2839 continue 2840 raise plumbing.convert_error_to_porcelain(e) from e 2841 break 2842 2843 resp = models.PeeringGroupCreateResponse() 2844 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 2845 plumbing_response.meta) 2846 resp.peering_group = plumbing.convert_peering_group_to_porcelain( 2847 plumbing_response.peering_group) 2848 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2849 plumbing_response.rate_limit) 2850 return resp
Create registers a new PeeringGroup.
2852 def delete(self, id, timeout=None): 2853 ''' 2854 Delete removes a PeeringGroup by ID. 2855 ''' 2856 req = PeeringGroupDeleteRequest() 2857 2858 req.id = (id) 2859 tries = 0 2860 plumbing_response = None 2861 while True: 2862 try: 2863 plumbing_response = self.stub.Delete( 2864 req, 2865 metadata=self.parent.get_metadata('PeeringGroups.Delete', 2866 req), 2867 timeout=timeout) 2868 except Exception as e: 2869 if self.parent.shouldRetry(tries, e): 2870 tries += 1 2871 self.parent.jitterSleep(tries) 2872 continue 2873 raise plumbing.convert_error_to_porcelain(e) from e 2874 break 2875 2876 resp = models.PeeringGroupDeleteResponse() 2877 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 2878 plumbing_response.meta) 2879 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2880 plumbing_response.rate_limit) 2881 return resp
Delete removes a PeeringGroup by ID.
2883 def get(self, id, timeout=None): 2884 ''' 2885 Get reads one PeeringGroup by ID. It will load all its dependencies. 2886 ''' 2887 req = PeeringGroupGetRequest() 2888 if self.parent.snapshot_datetime is not None: 2889 req.meta.CopyFrom(GetRequestMetadata()) 2890 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2891 2892 req.id = (id) 2893 tries = 0 2894 plumbing_response = None 2895 while True: 2896 try: 2897 plumbing_response = self.stub.Get( 2898 req, 2899 metadata=self.parent.get_metadata('PeeringGroups.Get', 2900 req), 2901 timeout=timeout) 2902 except Exception as e: 2903 if self.parent.shouldRetry(tries, e): 2904 tries += 1 2905 self.parent.jitterSleep(tries) 2906 continue 2907 raise plumbing.convert_error_to_porcelain(e) from e 2908 break 2909 2910 resp = models.PeeringGroupGetResponse() 2911 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 2912 plumbing_response.meta) 2913 resp.peering_group = plumbing.convert_peering_group_to_porcelain( 2914 plumbing_response.peering_group) 2915 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 2916 plumbing_response.rate_limit) 2917 return resp
Get reads one PeeringGroup by ID. It will load all its dependencies.
2919 def list(self, filter, *args, timeout=None): 2920 ''' 2921 List gets a list of Peering Groups. 2922 ''' 2923 req = PeeringGroupListRequest() 2924 req.meta.CopyFrom(ListRequestMetadata()) 2925 if self.parent.page_limit > 0: 2926 req.meta.limit = self.parent.page_limit 2927 if self.parent.snapshot_datetime is not None: 2928 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2929 2930 req.filter = plumbing.quote_filter_args(filter, *args) 2931 2932 def generator(svc, req): 2933 tries = 0 2934 while True: 2935 try: 2936 plumbing_response = svc.stub.List( 2937 req, 2938 metadata=svc.parent.get_metadata( 2939 'PeeringGroups.List', req), 2940 timeout=timeout) 2941 except Exception as e: 2942 if self.parent.shouldRetry(tries, e): 2943 tries += 1 2944 self.parent.jitterSleep(tries) 2945 continue 2946 raise plumbing.convert_error_to_porcelain(e) from e 2947 tries = 0 2948 for plumbing_item in plumbing_response.peering_groups: 2949 yield plumbing.convert_peering_group_to_porcelain( 2950 plumbing_item) 2951 if plumbing_response.meta.next_cursor == '': 2952 break 2953 req.meta.cursor = plumbing_response.meta.next_cursor 2954 2955 return generator(self, req)
List gets a list of Peering Groups.
2958class Queries: 2959 ''' 2960 A Query is a record of a single client request to a resource, such as a SQL query. 2961 Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries. 2962 The Queries service is read-only. 2963 See `strongdm.models.Query`. 2964 ''' 2965 def __init__(self, channel, client): 2966 self.parent = client 2967 self.stub = QueriesStub(channel) 2968 2969 def list(self, filter, *args, timeout=None): 2970 ''' 2971 List gets a list of Queries matching a given set of criteria. 2972 ''' 2973 req = QueryListRequest() 2974 req.meta.CopyFrom(ListRequestMetadata()) 2975 if self.parent.page_limit > 0: 2976 req.meta.limit = self.parent.page_limit 2977 if self.parent.snapshot_datetime is not None: 2978 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2979 2980 req.filter = plumbing.quote_filter_args(filter, *args) 2981 2982 def generator(svc, req): 2983 tries = 0 2984 while True: 2985 try: 2986 plumbing_response = svc.stub.List( 2987 req, 2988 metadata=svc.parent.get_metadata('Queries.List', req), 2989 timeout=timeout) 2990 except Exception as e: 2991 if self.parent.shouldRetry(tries, e): 2992 tries += 1 2993 self.parent.jitterSleep(tries) 2994 continue 2995 raise plumbing.convert_error_to_porcelain(e) from e 2996 tries = 0 2997 for plumbing_item in plumbing_response.queries: 2998 yield plumbing.convert_query_to_porcelain(plumbing_item) 2999 if plumbing_response.meta.next_cursor == '': 3000 break 3001 req.meta.cursor = plumbing_response.meta.next_cursor 3002 3003 return generator(self, req)
A Query is a record of a single client request to a resource, such as a SQL query.
Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries.
The Queries service is read-only.
See strongdm.models.Query
.
2969 def list(self, filter, *args, timeout=None): 2970 ''' 2971 List gets a list of Queries matching a given set of criteria. 2972 ''' 2973 req = QueryListRequest() 2974 req.meta.CopyFrom(ListRequestMetadata()) 2975 if self.parent.page_limit > 0: 2976 req.meta.limit = self.parent.page_limit 2977 if self.parent.snapshot_datetime is not None: 2978 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 2979 2980 req.filter = plumbing.quote_filter_args(filter, *args) 2981 2982 def generator(svc, req): 2983 tries = 0 2984 while True: 2985 try: 2986 plumbing_response = svc.stub.List( 2987 req, 2988 metadata=svc.parent.get_metadata('Queries.List', req), 2989 timeout=timeout) 2990 except Exception as e: 2991 if self.parent.shouldRetry(tries, e): 2992 tries += 1 2993 self.parent.jitterSleep(tries) 2994 continue 2995 raise plumbing.convert_error_to_porcelain(e) from e 2996 tries = 0 2997 for plumbing_item in plumbing_response.queries: 2998 yield plumbing.convert_query_to_porcelain(plumbing_item) 2999 if plumbing_response.meta.next_cursor == '': 3000 break 3001 req.meta.cursor = plumbing_response.meta.next_cursor 3002 3003 return generator(self, req)
List gets a list of Queries matching a given set of criteria.
3006class RemoteIdentities: 3007 ''' 3008 RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource. 3009 See `strongdm.models.RemoteIdentity`. 3010 ''' 3011 def __init__(self, channel, client): 3012 self.parent = client 3013 self.stub = RemoteIdentitiesStub(channel) 3014 3015 def create(self, remote_identity, timeout=None): 3016 ''' 3017 Create registers a new RemoteIdentity. 3018 ''' 3019 req = RemoteIdentityCreateRequest() 3020 3021 if remote_identity is not None: 3022 req.remote_identity.CopyFrom( 3023 plumbing.convert_remote_identity_to_plumbing(remote_identity)) 3024 tries = 0 3025 plumbing_response = None 3026 while True: 3027 try: 3028 plumbing_response = self.stub.Create( 3029 req, 3030 metadata=self.parent.get_metadata( 3031 'RemoteIdentities.Create', req), 3032 timeout=timeout) 3033 except Exception as e: 3034 if self.parent.shouldRetry(tries, e): 3035 tries += 1 3036 self.parent.jitterSleep(tries) 3037 continue 3038 raise plumbing.convert_error_to_porcelain(e) from e 3039 break 3040 3041 resp = models.RemoteIdentityCreateResponse() 3042 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 3043 plumbing_response.meta) 3044 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3045 plumbing_response.rate_limit) 3046 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3047 plumbing_response.remote_identity) 3048 return resp 3049 3050 def get(self, id, timeout=None): 3051 ''' 3052 Get reads one RemoteIdentity by ID. 3053 ''' 3054 req = RemoteIdentityGetRequest() 3055 if self.parent.snapshot_datetime is not None: 3056 req.meta.CopyFrom(GetRequestMetadata()) 3057 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3058 3059 req.id = (id) 3060 tries = 0 3061 plumbing_response = None 3062 while True: 3063 try: 3064 plumbing_response = self.stub.Get( 3065 req, 3066 metadata=self.parent.get_metadata('RemoteIdentities.Get', 3067 req), 3068 timeout=timeout) 3069 except Exception as e: 3070 if self.parent.shouldRetry(tries, e): 3071 tries += 1 3072 self.parent.jitterSleep(tries) 3073 continue 3074 raise plumbing.convert_error_to_porcelain(e) from e 3075 break 3076 3077 resp = models.RemoteIdentityGetResponse() 3078 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3079 plumbing_response.meta) 3080 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3081 plumbing_response.rate_limit) 3082 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3083 plumbing_response.remote_identity) 3084 return resp 3085 3086 def update(self, remote_identity, timeout=None): 3087 ''' 3088 Update replaces all the fields of a RemoteIdentity by ID. 3089 ''' 3090 req = RemoteIdentityUpdateRequest() 3091 3092 if remote_identity is not None: 3093 req.remote_identity.CopyFrom( 3094 plumbing.convert_remote_identity_to_plumbing(remote_identity)) 3095 tries = 0 3096 plumbing_response = None 3097 while True: 3098 try: 3099 plumbing_response = self.stub.Update( 3100 req, 3101 metadata=self.parent.get_metadata( 3102 'RemoteIdentities.Update', req), 3103 timeout=timeout) 3104 except Exception as e: 3105 if self.parent.shouldRetry(tries, e): 3106 tries += 1 3107 self.parent.jitterSleep(tries) 3108 continue 3109 raise plumbing.convert_error_to_porcelain(e) from e 3110 break 3111 3112 resp = models.RemoteIdentityUpdateResponse() 3113 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3114 plumbing_response.meta) 3115 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3116 plumbing_response.rate_limit) 3117 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3118 plumbing_response.remote_identity) 3119 return resp 3120 3121 def delete(self, id, timeout=None): 3122 ''' 3123 Delete removes a RemoteIdentity by ID. 3124 ''' 3125 req = RemoteIdentityDeleteRequest() 3126 3127 req.id = (id) 3128 tries = 0 3129 plumbing_response = None 3130 while True: 3131 try: 3132 plumbing_response = self.stub.Delete( 3133 req, 3134 metadata=self.parent.get_metadata( 3135 'RemoteIdentities.Delete', req), 3136 timeout=timeout) 3137 except Exception as e: 3138 if self.parent.shouldRetry(tries, e): 3139 tries += 1 3140 self.parent.jitterSleep(tries) 3141 continue 3142 raise plumbing.convert_error_to_porcelain(e) from e 3143 break 3144 3145 resp = models.RemoteIdentityDeleteResponse() 3146 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 3147 plumbing_response.meta) 3148 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3149 plumbing_response.rate_limit) 3150 return resp 3151 3152 def list(self, filter, *args, timeout=None): 3153 ''' 3154 List gets a list of RemoteIdentities matching a given set of criteria. 3155 ''' 3156 req = RemoteIdentityListRequest() 3157 req.meta.CopyFrom(ListRequestMetadata()) 3158 if self.parent.page_limit > 0: 3159 req.meta.limit = self.parent.page_limit 3160 if self.parent.snapshot_datetime is not None: 3161 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3162 3163 req.filter = plumbing.quote_filter_args(filter, *args) 3164 3165 def generator(svc, req): 3166 tries = 0 3167 while True: 3168 try: 3169 plumbing_response = svc.stub.List( 3170 req, 3171 metadata=svc.parent.get_metadata( 3172 'RemoteIdentities.List', req), 3173 timeout=timeout) 3174 except Exception as e: 3175 if self.parent.shouldRetry(tries, e): 3176 tries += 1 3177 self.parent.jitterSleep(tries) 3178 continue 3179 raise plumbing.convert_error_to_porcelain(e) from e 3180 tries = 0 3181 for plumbing_item in plumbing_response.remote_identities: 3182 yield plumbing.convert_remote_identity_to_porcelain( 3183 plumbing_item) 3184 if plumbing_response.meta.next_cursor == '': 3185 break 3186 req.meta.cursor = plumbing_response.meta.next_cursor 3187 3188 return generator(self, req)
RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource.
See strongdm.models.RemoteIdentity
.
3015 def create(self, remote_identity, timeout=None): 3016 ''' 3017 Create registers a new RemoteIdentity. 3018 ''' 3019 req = RemoteIdentityCreateRequest() 3020 3021 if remote_identity is not None: 3022 req.remote_identity.CopyFrom( 3023 plumbing.convert_remote_identity_to_plumbing(remote_identity)) 3024 tries = 0 3025 plumbing_response = None 3026 while True: 3027 try: 3028 plumbing_response = self.stub.Create( 3029 req, 3030 metadata=self.parent.get_metadata( 3031 'RemoteIdentities.Create', req), 3032 timeout=timeout) 3033 except Exception as e: 3034 if self.parent.shouldRetry(tries, e): 3035 tries += 1 3036 self.parent.jitterSleep(tries) 3037 continue 3038 raise plumbing.convert_error_to_porcelain(e) from e 3039 break 3040 3041 resp = models.RemoteIdentityCreateResponse() 3042 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 3043 plumbing_response.meta) 3044 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3045 plumbing_response.rate_limit) 3046 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3047 plumbing_response.remote_identity) 3048 return resp
Create registers a new RemoteIdentity.
3050 def get(self, id, timeout=None): 3051 ''' 3052 Get reads one RemoteIdentity by ID. 3053 ''' 3054 req = RemoteIdentityGetRequest() 3055 if self.parent.snapshot_datetime is not None: 3056 req.meta.CopyFrom(GetRequestMetadata()) 3057 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3058 3059 req.id = (id) 3060 tries = 0 3061 plumbing_response = None 3062 while True: 3063 try: 3064 plumbing_response = self.stub.Get( 3065 req, 3066 metadata=self.parent.get_metadata('RemoteIdentities.Get', 3067 req), 3068 timeout=timeout) 3069 except Exception as e: 3070 if self.parent.shouldRetry(tries, e): 3071 tries += 1 3072 self.parent.jitterSleep(tries) 3073 continue 3074 raise plumbing.convert_error_to_porcelain(e) from e 3075 break 3076 3077 resp = models.RemoteIdentityGetResponse() 3078 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3079 plumbing_response.meta) 3080 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3081 plumbing_response.rate_limit) 3082 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3083 plumbing_response.remote_identity) 3084 return resp
Get reads one RemoteIdentity by ID.
3086 def update(self, remote_identity, timeout=None): 3087 ''' 3088 Update replaces all the fields of a RemoteIdentity by ID. 3089 ''' 3090 req = RemoteIdentityUpdateRequest() 3091 3092 if remote_identity is not None: 3093 req.remote_identity.CopyFrom( 3094 plumbing.convert_remote_identity_to_plumbing(remote_identity)) 3095 tries = 0 3096 plumbing_response = None 3097 while True: 3098 try: 3099 plumbing_response = self.stub.Update( 3100 req, 3101 metadata=self.parent.get_metadata( 3102 'RemoteIdentities.Update', req), 3103 timeout=timeout) 3104 except Exception as e: 3105 if self.parent.shouldRetry(tries, e): 3106 tries += 1 3107 self.parent.jitterSleep(tries) 3108 continue 3109 raise plumbing.convert_error_to_porcelain(e) from e 3110 break 3111 3112 resp = models.RemoteIdentityUpdateResponse() 3113 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3114 plumbing_response.meta) 3115 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3116 plumbing_response.rate_limit) 3117 resp.remote_identity = plumbing.convert_remote_identity_to_porcelain( 3118 plumbing_response.remote_identity) 3119 return resp
Update replaces all the fields of a RemoteIdentity by ID.
3121 def delete(self, id, timeout=None): 3122 ''' 3123 Delete removes a RemoteIdentity by ID. 3124 ''' 3125 req = RemoteIdentityDeleteRequest() 3126 3127 req.id = (id) 3128 tries = 0 3129 plumbing_response = None 3130 while True: 3131 try: 3132 plumbing_response = self.stub.Delete( 3133 req, 3134 metadata=self.parent.get_metadata( 3135 'RemoteIdentities.Delete', req), 3136 timeout=timeout) 3137 except Exception as e: 3138 if self.parent.shouldRetry(tries, e): 3139 tries += 1 3140 self.parent.jitterSleep(tries) 3141 continue 3142 raise plumbing.convert_error_to_porcelain(e) from e 3143 break 3144 3145 resp = models.RemoteIdentityDeleteResponse() 3146 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 3147 plumbing_response.meta) 3148 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3149 plumbing_response.rate_limit) 3150 return resp
Delete removes a RemoteIdentity by ID.
3152 def list(self, filter, *args, timeout=None): 3153 ''' 3154 List gets a list of RemoteIdentities matching a given set of criteria. 3155 ''' 3156 req = RemoteIdentityListRequest() 3157 req.meta.CopyFrom(ListRequestMetadata()) 3158 if self.parent.page_limit > 0: 3159 req.meta.limit = self.parent.page_limit 3160 if self.parent.snapshot_datetime is not None: 3161 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3162 3163 req.filter = plumbing.quote_filter_args(filter, *args) 3164 3165 def generator(svc, req): 3166 tries = 0 3167 while True: 3168 try: 3169 plumbing_response = svc.stub.List( 3170 req, 3171 metadata=svc.parent.get_metadata( 3172 'RemoteIdentities.List', req), 3173 timeout=timeout) 3174 except Exception as e: 3175 if self.parent.shouldRetry(tries, e): 3176 tries += 1 3177 self.parent.jitterSleep(tries) 3178 continue 3179 raise plumbing.convert_error_to_porcelain(e) from e 3180 tries = 0 3181 for plumbing_item in plumbing_response.remote_identities: 3182 yield plumbing.convert_remote_identity_to_porcelain( 3183 plumbing_item) 3184 if plumbing_response.meta.next_cursor == '': 3185 break 3186 req.meta.cursor = plumbing_response.meta.next_cursor 3187 3188 return generator(self, req)
List gets a list of RemoteIdentities matching a given set of criteria.
3191class SnapshotRemoteIdentities: 3192 ''' 3193 SnapshotRemoteIdentities exposes the read only methods of the RemoteIdentities 3194 service for historical queries. 3195 ''' 3196 def __init__(self, remote_identities): 3197 self.remote_identities = remote_identities 3198 3199 def get(self, id, timeout=None): 3200 ''' 3201 Get reads one RemoteIdentity by ID. 3202 ''' 3203 return self.remote_identities.get(id, timeout=timeout) 3204 3205 def list(self, filter, *args, timeout=None): 3206 ''' 3207 List gets a list of RemoteIdentities matching a given set of criteria. 3208 ''' 3209 return self.remote_identities.list(filter, *args, timeout=timeout)
SnapshotRemoteIdentities exposes the read only methods of the RemoteIdentities service for historical queries.
3199 def get(self, id, timeout=None): 3200 ''' 3201 Get reads one RemoteIdentity by ID. 3202 ''' 3203 return self.remote_identities.get(id, timeout=timeout)
Get reads one RemoteIdentity by ID.
3205 def list(self, filter, *args, timeout=None): 3206 ''' 3207 List gets a list of RemoteIdentities matching a given set of criteria. 3208 ''' 3209 return self.remote_identities.list(filter, *args, timeout=timeout)
List gets a list of RemoteIdentities matching a given set of criteria.
3212class RemoteIdentitiesHistory: 3213 ''' 3214 RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity. 3215 See `strongdm.models.RemoteIdentityHistory`. 3216 ''' 3217 def __init__(self, channel, client): 3218 self.parent = client 3219 self.stub = RemoteIdentitiesHistoryStub(channel) 3220 3221 def list(self, filter, *args, timeout=None): 3222 ''' 3223 List gets a list of RemoteIdentityHistory records matching a given set of criteria. 3224 ''' 3225 req = RemoteIdentityHistoryListRequest() 3226 req.meta.CopyFrom(ListRequestMetadata()) 3227 if self.parent.page_limit > 0: 3228 req.meta.limit = self.parent.page_limit 3229 if self.parent.snapshot_datetime is not None: 3230 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3231 3232 req.filter = plumbing.quote_filter_args(filter, *args) 3233 3234 def generator(svc, req): 3235 tries = 0 3236 while True: 3237 try: 3238 plumbing_response = svc.stub.List( 3239 req, 3240 metadata=svc.parent.get_metadata( 3241 'RemoteIdentitiesHistory.List', req), 3242 timeout=timeout) 3243 except Exception as e: 3244 if self.parent.shouldRetry(tries, e): 3245 tries += 1 3246 self.parent.jitterSleep(tries) 3247 continue 3248 raise plumbing.convert_error_to_porcelain(e) from e 3249 tries = 0 3250 for plumbing_item in plumbing_response.history: 3251 yield plumbing.convert_remote_identity_history_to_porcelain( 3252 plumbing_item) 3253 if plumbing_response.meta.next_cursor == '': 3254 break 3255 req.meta.cursor = plumbing_response.meta.next_cursor 3256 3257 return generator(self, req)
RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity.
See strongdm.models.RemoteIdentityHistory
.
3221 def list(self, filter, *args, timeout=None): 3222 ''' 3223 List gets a list of RemoteIdentityHistory records matching a given set of criteria. 3224 ''' 3225 req = RemoteIdentityHistoryListRequest() 3226 req.meta.CopyFrom(ListRequestMetadata()) 3227 if self.parent.page_limit > 0: 3228 req.meta.limit = self.parent.page_limit 3229 if self.parent.snapshot_datetime is not None: 3230 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3231 3232 req.filter = plumbing.quote_filter_args(filter, *args) 3233 3234 def generator(svc, req): 3235 tries = 0 3236 while True: 3237 try: 3238 plumbing_response = svc.stub.List( 3239 req, 3240 metadata=svc.parent.get_metadata( 3241 'RemoteIdentitiesHistory.List', req), 3242 timeout=timeout) 3243 except Exception as e: 3244 if self.parent.shouldRetry(tries, e): 3245 tries += 1 3246 self.parent.jitterSleep(tries) 3247 continue 3248 raise plumbing.convert_error_to_porcelain(e) from e 3249 tries = 0 3250 for plumbing_item in plumbing_response.history: 3251 yield plumbing.convert_remote_identity_history_to_porcelain( 3252 plumbing_item) 3253 if plumbing_response.meta.next_cursor == '': 3254 break 3255 req.meta.cursor = plumbing_response.meta.next_cursor 3256 3257 return generator(self, req)
List gets a list of RemoteIdentityHistory records matching a given set of criteria.
3260class RemoteIdentityGroups: 3261 ''' 3262 A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts. 3263 An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects. 3264 See `strongdm.models.RemoteIdentityGroup`. 3265 ''' 3266 def __init__(self, channel, client): 3267 self.parent = client 3268 self.stub = RemoteIdentityGroupsStub(channel) 3269 3270 def get(self, id, timeout=None): 3271 ''' 3272 Get reads one RemoteIdentityGroup by ID. 3273 ''' 3274 req = RemoteIdentityGroupGetRequest() 3275 if self.parent.snapshot_datetime is not None: 3276 req.meta.CopyFrom(GetRequestMetadata()) 3277 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3278 3279 req.id = (id) 3280 tries = 0 3281 plumbing_response = None 3282 while True: 3283 try: 3284 plumbing_response = self.stub.Get( 3285 req, 3286 metadata=self.parent.get_metadata( 3287 'RemoteIdentityGroups.Get', req), 3288 timeout=timeout) 3289 except Exception as e: 3290 if self.parent.shouldRetry(tries, e): 3291 tries += 1 3292 self.parent.jitterSleep(tries) 3293 continue 3294 raise plumbing.convert_error_to_porcelain(e) from e 3295 break 3296 3297 resp = models.RemoteIdentityGroupGetResponse() 3298 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3299 plumbing_response.meta) 3300 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3301 plumbing_response.rate_limit) 3302 resp.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain( 3303 plumbing_response.remote_identity_group) 3304 return resp 3305 3306 def list(self, filter, *args, timeout=None): 3307 ''' 3308 List gets a list of RemoteIdentityGroups matching a given set of criteria. 3309 ''' 3310 req = RemoteIdentityGroupListRequest() 3311 req.meta.CopyFrom(ListRequestMetadata()) 3312 if self.parent.page_limit > 0: 3313 req.meta.limit = self.parent.page_limit 3314 if self.parent.snapshot_datetime is not None: 3315 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3316 3317 req.filter = plumbing.quote_filter_args(filter, *args) 3318 3319 def generator(svc, req): 3320 tries = 0 3321 while True: 3322 try: 3323 plumbing_response = svc.stub.List( 3324 req, 3325 metadata=svc.parent.get_metadata( 3326 'RemoteIdentityGroups.List', req), 3327 timeout=timeout) 3328 except Exception as e: 3329 if self.parent.shouldRetry(tries, e): 3330 tries += 1 3331 self.parent.jitterSleep(tries) 3332 continue 3333 raise plumbing.convert_error_to_porcelain(e) from e 3334 tries = 0 3335 for plumbing_item in plumbing_response.remote_identity_groups: 3336 yield plumbing.convert_remote_identity_group_to_porcelain( 3337 plumbing_item) 3338 if plumbing_response.meta.next_cursor == '': 3339 break 3340 req.meta.cursor = plumbing_response.meta.next_cursor 3341 3342 return generator(self, req)
A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts.
An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects.
See strongdm.models.RemoteIdentityGroup
.
3270 def get(self, id, timeout=None): 3271 ''' 3272 Get reads one RemoteIdentityGroup by ID. 3273 ''' 3274 req = RemoteIdentityGroupGetRequest() 3275 if self.parent.snapshot_datetime is not None: 3276 req.meta.CopyFrom(GetRequestMetadata()) 3277 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3278 3279 req.id = (id) 3280 tries = 0 3281 plumbing_response = None 3282 while True: 3283 try: 3284 plumbing_response = self.stub.Get( 3285 req, 3286 metadata=self.parent.get_metadata( 3287 'RemoteIdentityGroups.Get', req), 3288 timeout=timeout) 3289 except Exception as e: 3290 if self.parent.shouldRetry(tries, e): 3291 tries += 1 3292 self.parent.jitterSleep(tries) 3293 continue 3294 raise plumbing.convert_error_to_porcelain(e) from e 3295 break 3296 3297 resp = models.RemoteIdentityGroupGetResponse() 3298 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3299 plumbing_response.meta) 3300 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3301 plumbing_response.rate_limit) 3302 resp.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain( 3303 plumbing_response.remote_identity_group) 3304 return resp
Get reads one RemoteIdentityGroup by ID.
3306 def list(self, filter, *args, timeout=None): 3307 ''' 3308 List gets a list of RemoteIdentityGroups matching a given set of criteria. 3309 ''' 3310 req = RemoteIdentityGroupListRequest() 3311 req.meta.CopyFrom(ListRequestMetadata()) 3312 if self.parent.page_limit > 0: 3313 req.meta.limit = self.parent.page_limit 3314 if self.parent.snapshot_datetime is not None: 3315 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3316 3317 req.filter = plumbing.quote_filter_args(filter, *args) 3318 3319 def generator(svc, req): 3320 tries = 0 3321 while True: 3322 try: 3323 plumbing_response = svc.stub.List( 3324 req, 3325 metadata=svc.parent.get_metadata( 3326 'RemoteIdentityGroups.List', req), 3327 timeout=timeout) 3328 except Exception as e: 3329 if self.parent.shouldRetry(tries, e): 3330 tries += 1 3331 self.parent.jitterSleep(tries) 3332 continue 3333 raise plumbing.convert_error_to_porcelain(e) from e 3334 tries = 0 3335 for plumbing_item in plumbing_response.remote_identity_groups: 3336 yield plumbing.convert_remote_identity_group_to_porcelain( 3337 plumbing_item) 3338 if plumbing_response.meta.next_cursor == '': 3339 break 3340 req.meta.cursor = plumbing_response.meta.next_cursor 3341 3342 return generator(self, req)
List gets a list of RemoteIdentityGroups matching a given set of criteria.
3345class SnapshotRemoteIdentityGroups: 3346 ''' 3347 SnapshotRemoteIdentityGroups exposes the read only methods of the RemoteIdentityGroups 3348 service for historical queries. 3349 ''' 3350 def __init__(self, remote_identity_groups): 3351 self.remote_identity_groups = remote_identity_groups 3352 3353 def get(self, id, timeout=None): 3354 ''' 3355 Get reads one RemoteIdentityGroup by ID. 3356 ''' 3357 return self.remote_identity_groups.get(id, timeout=timeout) 3358 3359 def list(self, filter, *args, timeout=None): 3360 ''' 3361 List gets a list of RemoteIdentityGroups matching a given set of criteria. 3362 ''' 3363 return self.remote_identity_groups.list(filter, *args, timeout=timeout)
SnapshotRemoteIdentityGroups exposes the read only methods of the RemoteIdentityGroups service for historical queries.
3353 def get(self, id, timeout=None): 3354 ''' 3355 Get reads one RemoteIdentityGroup by ID. 3356 ''' 3357 return self.remote_identity_groups.get(id, timeout=timeout)
Get reads one RemoteIdentityGroup by ID.
3359 def list(self, filter, *args, timeout=None): 3360 ''' 3361 List gets a list of RemoteIdentityGroups matching a given set of criteria. 3362 ''' 3363 return self.remote_identity_groups.list(filter, *args, timeout=timeout)
List gets a list of RemoteIdentityGroups matching a given set of criteria.
3366class RemoteIdentityGroupsHistory: 3367 ''' 3368 RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup. 3369 See `strongdm.models.RemoteIdentityGroupHistory`. 3370 ''' 3371 def __init__(self, channel, client): 3372 self.parent = client 3373 self.stub = RemoteIdentityGroupsHistoryStub(channel) 3374 3375 def list(self, filter, *args, timeout=None): 3376 ''' 3377 List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria. 3378 ''' 3379 req = RemoteIdentityGroupHistoryListRequest() 3380 req.meta.CopyFrom(ListRequestMetadata()) 3381 if self.parent.page_limit > 0: 3382 req.meta.limit = self.parent.page_limit 3383 if self.parent.snapshot_datetime is not None: 3384 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3385 3386 req.filter = plumbing.quote_filter_args(filter, *args) 3387 3388 def generator(svc, req): 3389 tries = 0 3390 while True: 3391 try: 3392 plumbing_response = svc.stub.List( 3393 req, 3394 metadata=svc.parent.get_metadata( 3395 'RemoteIdentityGroupsHistory.List', req), 3396 timeout=timeout) 3397 except Exception as e: 3398 if self.parent.shouldRetry(tries, e): 3399 tries += 1 3400 self.parent.jitterSleep(tries) 3401 continue 3402 raise plumbing.convert_error_to_porcelain(e) from e 3403 tries = 0 3404 for plumbing_item in plumbing_response.history: 3405 yield plumbing.convert_remote_identity_group_history_to_porcelain( 3406 plumbing_item) 3407 if plumbing_response.meta.next_cursor == '': 3408 break 3409 req.meta.cursor = plumbing_response.meta.next_cursor 3410 3411 return generator(self, req)
RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup.
See strongdm.models.RemoteIdentityGroupHistory
.
3375 def list(self, filter, *args, timeout=None): 3376 ''' 3377 List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria. 3378 ''' 3379 req = RemoteIdentityGroupHistoryListRequest() 3380 req.meta.CopyFrom(ListRequestMetadata()) 3381 if self.parent.page_limit > 0: 3382 req.meta.limit = self.parent.page_limit 3383 if self.parent.snapshot_datetime is not None: 3384 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3385 3386 req.filter = plumbing.quote_filter_args(filter, *args) 3387 3388 def generator(svc, req): 3389 tries = 0 3390 while True: 3391 try: 3392 plumbing_response = svc.stub.List( 3393 req, 3394 metadata=svc.parent.get_metadata( 3395 'RemoteIdentityGroupsHistory.List', req), 3396 timeout=timeout) 3397 except Exception as e: 3398 if self.parent.shouldRetry(tries, e): 3399 tries += 1 3400 self.parent.jitterSleep(tries) 3401 continue 3402 raise plumbing.convert_error_to_porcelain(e) from e 3403 tries = 0 3404 for plumbing_item in plumbing_response.history: 3405 yield plumbing.convert_remote_identity_group_history_to_porcelain( 3406 plumbing_item) 3407 if plumbing_response.meta.next_cursor == '': 3408 break 3409 req.meta.cursor = plumbing_response.meta.next_cursor 3410 3411 return generator(self, req)
List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria.
3414class Replays: 3415 ''' 3416 A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session 3417 (otherwise referred to as a query). The Replays service is read-only. 3418 See `strongdm.models.ReplayChunk`. 3419 ''' 3420 def __init__(self, channel, client): 3421 self.parent = client 3422 self.stub = ReplaysStub(channel) 3423 3424 def list(self, filter, *args, timeout=None): 3425 ''' 3426 List gets a list of ReplayChunks for the Query ID specified by the filter criteria. 3427 ''' 3428 req = ReplayListRequest() 3429 req.meta.CopyFrom(ListRequestMetadata()) 3430 if self.parent.page_limit > 0: 3431 req.meta.limit = self.parent.page_limit 3432 if self.parent.snapshot_datetime is not None: 3433 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3434 3435 req.filter = plumbing.quote_filter_args(filter, *args) 3436 3437 def generator(svc, req): 3438 tries = 0 3439 while True: 3440 try: 3441 plumbing_response = svc.stub.List( 3442 req, 3443 metadata=svc.parent.get_metadata('Replays.List', req), 3444 timeout=timeout) 3445 except Exception as e: 3446 if self.parent.shouldRetry(tries, e): 3447 tries += 1 3448 self.parent.jitterSleep(tries) 3449 continue 3450 raise plumbing.convert_error_to_porcelain(e) from e 3451 tries = 0 3452 for plumbing_item in plumbing_response.chunks: 3453 yield plumbing.convert_replay_chunk_to_porcelain( 3454 plumbing_item) 3455 if plumbing_response.meta.next_cursor == '': 3456 break 3457 req.meta.cursor = plumbing_response.meta.next_cursor 3458 3459 return generator(self, req)
A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session
(otherwise referred to as a query). The Replays service is read-only.
See strongdm.models.ReplayChunk
.
3424 def list(self, filter, *args, timeout=None): 3425 ''' 3426 List gets a list of ReplayChunks for the Query ID specified by the filter criteria. 3427 ''' 3428 req = ReplayListRequest() 3429 req.meta.CopyFrom(ListRequestMetadata()) 3430 if self.parent.page_limit > 0: 3431 req.meta.limit = self.parent.page_limit 3432 if self.parent.snapshot_datetime is not None: 3433 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3434 3435 req.filter = plumbing.quote_filter_args(filter, *args) 3436 3437 def generator(svc, req): 3438 tries = 0 3439 while True: 3440 try: 3441 plumbing_response = svc.stub.List( 3442 req, 3443 metadata=svc.parent.get_metadata('Replays.List', req), 3444 timeout=timeout) 3445 except Exception as e: 3446 if self.parent.shouldRetry(tries, e): 3447 tries += 1 3448 self.parent.jitterSleep(tries) 3449 continue 3450 raise plumbing.convert_error_to_porcelain(e) from e 3451 tries = 0 3452 for plumbing_item in plumbing_response.chunks: 3453 yield plumbing.convert_replay_chunk_to_porcelain( 3454 plumbing_item) 3455 if plumbing_response.meta.next_cursor == '': 3456 break 3457 req.meta.cursor = plumbing_response.meta.next_cursor 3458 3459 return generator(self, req)
List gets a list of ReplayChunks for the Query ID specified by the filter criteria.
3462class Resources: 3463 ''' 3464 Resources are databases, servers, clusters, websites, or clouds that strongDM 3465 delegates access to. 3466 See: 3467 `strongdm.models.AKS` 3468 `strongdm.models.AKSBasicAuth` 3469 `strongdm.models.AKSServiceAccount` 3470 `strongdm.models.AKSServiceAccountUserImpersonation` 3471 `strongdm.models.AKSUserImpersonation` 3472 `strongdm.models.AmazonEKS` 3473 `strongdm.models.AmazonEKSInstanceProfile` 3474 `strongdm.models.AmazonEKSInstanceProfileUserImpersonation` 3475 `strongdm.models.AmazonEKSUserImpersonation` 3476 `strongdm.models.AmazonES` 3477 `strongdm.models.AmazonMQAMQP091` 3478 `strongdm.models.Athena` 3479 `strongdm.models.AuroraMysql` 3480 `strongdm.models.AuroraPostgres` 3481 `strongdm.models.AuroraPostgresIAM` 3482 `strongdm.models.AWS` 3483 `strongdm.models.AWSConsole` 3484 `strongdm.models.AWSConsoleStaticKeyPair` 3485 `strongdm.models.Azure` 3486 `strongdm.models.AzureCertificate` 3487 `strongdm.models.AzureMysql` 3488 `strongdm.models.AzurePostgres` 3489 `strongdm.models.AzurePostgresManagedIdentity` 3490 `strongdm.models.BigQuery` 3491 `strongdm.models.Cassandra` 3492 `strongdm.models.Citus` 3493 `strongdm.models.Clustrix` 3494 `strongdm.models.Cockroach` 3495 `strongdm.models.DB2I` 3496 `strongdm.models.DB2LUW` 3497 `strongdm.models.DocumentDBHost` 3498 `strongdm.models.DocumentDBReplicaSet` 3499 `strongdm.models.Druid` 3500 `strongdm.models.DynamoDB` 3501 `strongdm.models.Elastic` 3502 `strongdm.models.ElasticacheRedis` 3503 `strongdm.models.GCP` 3504 `strongdm.models.GoogleGKE` 3505 `strongdm.models.GoogleGKEUserImpersonation` 3506 `strongdm.models.Greenplum` 3507 `strongdm.models.HTTPAuth` 3508 `strongdm.models.HTTPBasicAuth` 3509 `strongdm.models.HTTPNoAuth` 3510 `strongdm.models.Kubernetes` 3511 `strongdm.models.KubernetesBasicAuth` 3512 `strongdm.models.KubernetesServiceAccount` 3513 `strongdm.models.KubernetesServiceAccountUserImpersonation` 3514 `strongdm.models.KubernetesUserImpersonation` 3515 `strongdm.models.Maria` 3516 `strongdm.models.Memcached` 3517 `strongdm.models.Memsql` 3518 `strongdm.models.MongoHost` 3519 `strongdm.models.MongoLegacyHost` 3520 `strongdm.models.MongoLegacyReplicaset` 3521 `strongdm.models.MongoReplicaSet` 3522 `strongdm.models.MongoShardedCluster` 3523 `strongdm.models.MTLSMysql` 3524 `strongdm.models.MTLSPostgres` 3525 `strongdm.models.Mysql` 3526 `strongdm.models.Neptune` 3527 `strongdm.models.NeptuneIAM` 3528 `strongdm.models.Oracle` 3529 `strongdm.models.Postgres` 3530 `strongdm.models.Presto` 3531 `strongdm.models.RabbitMQAMQP091` 3532 `strongdm.models.RawTCP` 3533 `strongdm.models.RDP` 3534 `strongdm.models.RDPCert` 3535 `strongdm.models.RDSPostgresIAM` 3536 `strongdm.models.Redis` 3537 `strongdm.models.Redshift` 3538 `strongdm.models.SingleStore` 3539 `strongdm.models.Snowflake` 3540 `strongdm.models.Snowsight` 3541 `strongdm.models.SQLServer` 3542 `strongdm.models.SQLServerAzureAD` 3543 `strongdm.models.SQLServerKerberosAD` 3544 `strongdm.models.SSH` 3545 `strongdm.models.SSHCert` 3546 `strongdm.models.SSHCustomerKey` 3547 `strongdm.models.Sybase` 3548 `strongdm.models.SybaseIQ` 3549 `strongdm.models.Teradata` 3550 `strongdm.models.Trino` 3551 ''' 3552 def __init__(self, channel, client): 3553 self.parent = client 3554 self.stub = ResourcesStub(channel) 3555 3556 def enumerate_tags(self, filter, *args, timeout=None): 3557 ''' 3558 EnumerateTags gets a list of the filter matching tags. 3559 ''' 3560 req = EnumerateTagsRequest() 3561 req.meta.CopyFrom(ListRequestMetadata()) 3562 if self.parent.page_limit > 0: 3563 req.meta.limit = self.parent.page_limit 3564 if self.parent.snapshot_datetime is not None: 3565 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3566 3567 req.filter = plumbing.quote_filter_args(filter, *args) 3568 3569 def generator(svc, req): 3570 tries = 0 3571 while True: 3572 try: 3573 plumbing_response = svc.stub.EnumerateTags( 3574 req, 3575 metadata=svc.parent.get_metadata( 3576 'Resources.EnumerateTags', req), 3577 timeout=timeout) 3578 except Exception as e: 3579 if self.parent.shouldRetry(tries, e): 3580 tries += 1 3581 self.parent.jitterSleep(tries) 3582 continue 3583 raise plumbing.convert_error_to_porcelain(e) from e 3584 tries = 0 3585 for plumbing_item in plumbing_response.matches: 3586 yield plumbing.convert_tag_to_porcelain(plumbing_item) 3587 if plumbing_response.meta.next_cursor == '': 3588 break 3589 req.meta.cursor = plumbing_response.meta.next_cursor 3590 3591 return generator(self, req) 3592 3593 def create(self, resource, timeout=None): 3594 ''' 3595 Create registers a new Resource. 3596 ''' 3597 req = ResourceCreateRequest() 3598 3599 if resource is not None: 3600 req.resource.CopyFrom( 3601 plumbing.convert_resource_to_plumbing(resource)) 3602 tries = 0 3603 plumbing_response = None 3604 while True: 3605 try: 3606 plumbing_response = self.stub.Create( 3607 req, 3608 metadata=self.parent.get_metadata('Resources.Create', req), 3609 timeout=timeout) 3610 except Exception as e: 3611 if self.parent.shouldRetry(tries, e): 3612 tries += 1 3613 self.parent.jitterSleep(tries) 3614 continue 3615 raise plumbing.convert_error_to_porcelain(e) from e 3616 break 3617 3618 resp = models.ResourceCreateResponse() 3619 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 3620 plumbing_response.meta) 3621 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3622 plumbing_response.rate_limit) 3623 resp.resource = plumbing.convert_resource_to_porcelain( 3624 plumbing_response.resource) 3625 return resp 3626 3627 def get(self, id, timeout=None): 3628 ''' 3629 Get reads one Resource by ID. 3630 ''' 3631 req = ResourceGetRequest() 3632 if self.parent.snapshot_datetime is not None: 3633 req.meta.CopyFrom(GetRequestMetadata()) 3634 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3635 3636 req.id = (id) 3637 tries = 0 3638 plumbing_response = None 3639 while True: 3640 try: 3641 plumbing_response = self.stub.Get( 3642 req, 3643 metadata=self.parent.get_metadata('Resources.Get', req), 3644 timeout=timeout) 3645 except Exception as e: 3646 if self.parent.shouldRetry(tries, e): 3647 tries += 1 3648 self.parent.jitterSleep(tries) 3649 continue 3650 raise plumbing.convert_error_to_porcelain(e) from e 3651 break 3652 3653 resp = models.ResourceGetResponse() 3654 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3655 plumbing_response.meta) 3656 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3657 plumbing_response.rate_limit) 3658 resp.resource = plumbing.convert_resource_to_porcelain( 3659 plumbing_response.resource) 3660 return resp 3661 3662 def update(self, resource, timeout=None): 3663 ''' 3664 Update replaces all the fields of a Resource by ID. 3665 ''' 3666 req = ResourceUpdateRequest() 3667 3668 if resource is not None: 3669 req.resource.CopyFrom( 3670 plumbing.convert_resource_to_plumbing(resource)) 3671 tries = 0 3672 plumbing_response = None 3673 while True: 3674 try: 3675 plumbing_response = self.stub.Update( 3676 req, 3677 metadata=self.parent.get_metadata('Resources.Update', req), 3678 timeout=timeout) 3679 except Exception as e: 3680 if self.parent.shouldRetry(tries, e): 3681 tries += 1 3682 self.parent.jitterSleep(tries) 3683 continue 3684 raise plumbing.convert_error_to_porcelain(e) from e 3685 break 3686 3687 resp = models.ResourceUpdateResponse() 3688 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3689 plumbing_response.meta) 3690 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3691 plumbing_response.rate_limit) 3692 resp.resource = plumbing.convert_resource_to_porcelain( 3693 plumbing_response.resource) 3694 return resp 3695 3696 def delete(self, id, timeout=None): 3697 ''' 3698 Delete removes a Resource by ID. 3699 ''' 3700 req = ResourceDeleteRequest() 3701 3702 req.id = (id) 3703 tries = 0 3704 plumbing_response = None 3705 while True: 3706 try: 3707 plumbing_response = self.stub.Delete( 3708 req, 3709 metadata=self.parent.get_metadata('Resources.Delete', req), 3710 timeout=timeout) 3711 except Exception as e: 3712 if self.parent.shouldRetry(tries, e): 3713 tries += 1 3714 self.parent.jitterSleep(tries) 3715 continue 3716 raise plumbing.convert_error_to_porcelain(e) from e 3717 break 3718 3719 resp = models.ResourceDeleteResponse() 3720 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 3721 plumbing_response.meta) 3722 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3723 plumbing_response.rate_limit) 3724 return resp 3725 3726 def list(self, filter, *args, timeout=None): 3727 ''' 3728 List gets a list of Resources matching a given set of criteria. 3729 ''' 3730 req = ResourceListRequest() 3731 req.meta.CopyFrom(ListRequestMetadata()) 3732 if self.parent.page_limit > 0: 3733 req.meta.limit = self.parent.page_limit 3734 if self.parent.snapshot_datetime is not None: 3735 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3736 3737 req.filter = plumbing.quote_filter_args(filter, *args) 3738 3739 def generator(svc, req): 3740 tries = 0 3741 while True: 3742 try: 3743 plumbing_response = svc.stub.List( 3744 req, 3745 metadata=svc.parent.get_metadata( 3746 'Resources.List', req), 3747 timeout=timeout) 3748 except Exception as e: 3749 if self.parent.shouldRetry(tries, e): 3750 tries += 1 3751 self.parent.jitterSleep(tries) 3752 continue 3753 raise plumbing.convert_error_to_porcelain(e) from e 3754 tries = 0 3755 for plumbing_item in plumbing_response.resources: 3756 yield plumbing.convert_resource_to_porcelain(plumbing_item) 3757 if plumbing_response.meta.next_cursor == '': 3758 break 3759 req.meta.cursor = plumbing_response.meta.next_cursor 3760 3761 return generator(self, req) 3762 3763 def healthcheck(self, id, timeout=None): 3764 ''' 3765 Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a 3766 large network of Nodes. The call will return immediately, and the updated health of the 3767 Resource can be retrieved via Get or List. 3768 ''' 3769 req = ResourceHealthcheckRequest() 3770 3771 req.id = (id) 3772 tries = 0 3773 plumbing_response = None 3774 while True: 3775 try: 3776 plumbing_response = self.stub.Healthcheck( 3777 req, 3778 metadata=self.parent.get_metadata('Resources.Healthcheck', 3779 req), 3780 timeout=timeout) 3781 except Exception as e: 3782 if self.parent.shouldRetry(tries, e): 3783 tries += 1 3784 self.parent.jitterSleep(tries) 3785 continue 3786 raise plumbing.convert_error_to_porcelain(e) from e 3787 break 3788 3789 resp = models.ResourceHealthcheckResponse() 3790 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3791 plumbing_response.meta) 3792 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3793 plumbing_response.rate_limit) 3794 return resp
Resources are databases, servers, clusters, websites, or clouds that strongDM
delegates access to.
See:
strongdm.models.AKS
strongdm.models.AKSBasicAuth
strongdm.models.AKSServiceAccount
strongdm.models.AKSServiceAccountUserImpersonation
strongdm.models.AKSUserImpersonation
strongdm.models.AmazonEKS
strongdm.models.AmazonEKSInstanceProfile
strongdm.models.AmazonEKSInstanceProfileUserImpersonation
strongdm.models.AmazonEKSUserImpersonation
strongdm.models.AmazonES
strongdm.models.AmazonMQAMQP091
strongdm.models.Athena
strongdm.models.AuroraMysql
strongdm.models.AuroraPostgres
strongdm.models.AuroraPostgresIAM
strongdm.models.AWS
strongdm.models.AWSConsole
strongdm.models.AWSConsoleStaticKeyPair
strongdm.models.Azure
strongdm.models.AzureCertificate
strongdm.models.AzureMysql
strongdm.models.AzurePostgres
strongdm.models.AzurePostgresManagedIdentity
strongdm.models.BigQuery
strongdm.models.Cassandra
strongdm.models.Citus
strongdm.models.Clustrix
strongdm.models.Cockroach
strongdm.models.DB2I
strongdm.models.DB2LUW
strongdm.models.DocumentDBHost
strongdm.models.DocumentDBReplicaSet
strongdm.models.Druid
strongdm.models.DynamoDB
strongdm.models.Elastic
strongdm.models.ElasticacheRedis
strongdm.models.GCP
strongdm.models.GoogleGKE
strongdm.models.GoogleGKEUserImpersonation
strongdm.models.Greenplum
strongdm.models.HTTPAuth
strongdm.models.HTTPBasicAuth
strongdm.models.HTTPNoAuth
strongdm.models.Kubernetes
strongdm.models.KubernetesBasicAuth
strongdm.models.KubernetesServiceAccount
strongdm.models.KubernetesServiceAccountUserImpersonation
strongdm.models.KubernetesUserImpersonation
strongdm.models.Maria
strongdm.models.Memcached
strongdm.models.Memsql
strongdm.models.MongoHost
strongdm.models.MongoLegacyHost
strongdm.models.MongoLegacyReplicaset
strongdm.models.MongoReplicaSet
strongdm.models.MongoShardedCluster
strongdm.models.MTLSMysql
strongdm.models.MTLSPostgres
strongdm.models.Mysql
strongdm.models.Neptune
strongdm.models.NeptuneIAM
strongdm.models.Oracle
strongdm.models.Postgres
strongdm.models.Presto
strongdm.models.RabbitMQAMQP091
strongdm.models.RawTCP
strongdm.models.RDP
strongdm.models.RDPCert
strongdm.models.RDSPostgresIAM
strongdm.models.Redis
strongdm.models.Redshift
strongdm.models.SingleStore
strongdm.models.Snowflake
strongdm.models.Snowsight
strongdm.models.SQLServer
strongdm.models.SQLServerAzureAD
strongdm.models.SQLServerKerberosAD
strongdm.models.SSH
strongdm.models.SSHCert
strongdm.models.SSHCustomerKey
strongdm.models.Sybase
strongdm.models.SybaseIQ
strongdm.models.Teradata
strongdm.models.Trino
3593 def create(self, resource, timeout=None): 3594 ''' 3595 Create registers a new Resource. 3596 ''' 3597 req = ResourceCreateRequest() 3598 3599 if resource is not None: 3600 req.resource.CopyFrom( 3601 plumbing.convert_resource_to_plumbing(resource)) 3602 tries = 0 3603 plumbing_response = None 3604 while True: 3605 try: 3606 plumbing_response = self.stub.Create( 3607 req, 3608 metadata=self.parent.get_metadata('Resources.Create', req), 3609 timeout=timeout) 3610 except Exception as e: 3611 if self.parent.shouldRetry(tries, e): 3612 tries += 1 3613 self.parent.jitterSleep(tries) 3614 continue 3615 raise plumbing.convert_error_to_porcelain(e) from e 3616 break 3617 3618 resp = models.ResourceCreateResponse() 3619 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 3620 plumbing_response.meta) 3621 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3622 plumbing_response.rate_limit) 3623 resp.resource = plumbing.convert_resource_to_porcelain( 3624 plumbing_response.resource) 3625 return resp
Create registers a new Resource.
3627 def get(self, id, timeout=None): 3628 ''' 3629 Get reads one Resource by ID. 3630 ''' 3631 req = ResourceGetRequest() 3632 if self.parent.snapshot_datetime is not None: 3633 req.meta.CopyFrom(GetRequestMetadata()) 3634 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3635 3636 req.id = (id) 3637 tries = 0 3638 plumbing_response = None 3639 while True: 3640 try: 3641 plumbing_response = self.stub.Get( 3642 req, 3643 metadata=self.parent.get_metadata('Resources.Get', req), 3644 timeout=timeout) 3645 except Exception as e: 3646 if self.parent.shouldRetry(tries, e): 3647 tries += 1 3648 self.parent.jitterSleep(tries) 3649 continue 3650 raise plumbing.convert_error_to_porcelain(e) from e 3651 break 3652 3653 resp = models.ResourceGetResponse() 3654 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 3655 plumbing_response.meta) 3656 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3657 plumbing_response.rate_limit) 3658 resp.resource = plumbing.convert_resource_to_porcelain( 3659 plumbing_response.resource) 3660 return resp
Get reads one Resource by ID.
3662 def update(self, resource, timeout=None): 3663 ''' 3664 Update replaces all the fields of a Resource by ID. 3665 ''' 3666 req = ResourceUpdateRequest() 3667 3668 if resource is not None: 3669 req.resource.CopyFrom( 3670 plumbing.convert_resource_to_plumbing(resource)) 3671 tries = 0 3672 plumbing_response = None 3673 while True: 3674 try: 3675 plumbing_response = self.stub.Update( 3676 req, 3677 metadata=self.parent.get_metadata('Resources.Update', req), 3678 timeout=timeout) 3679 except Exception as e: 3680 if self.parent.shouldRetry(tries, e): 3681 tries += 1 3682 self.parent.jitterSleep(tries) 3683 continue 3684 raise plumbing.convert_error_to_porcelain(e) from e 3685 break 3686 3687 resp = models.ResourceUpdateResponse() 3688 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3689 plumbing_response.meta) 3690 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3691 plumbing_response.rate_limit) 3692 resp.resource = plumbing.convert_resource_to_porcelain( 3693 plumbing_response.resource) 3694 return resp
Update replaces all the fields of a Resource by ID.
3696 def delete(self, id, timeout=None): 3697 ''' 3698 Delete removes a Resource by ID. 3699 ''' 3700 req = ResourceDeleteRequest() 3701 3702 req.id = (id) 3703 tries = 0 3704 plumbing_response = None 3705 while True: 3706 try: 3707 plumbing_response = self.stub.Delete( 3708 req, 3709 metadata=self.parent.get_metadata('Resources.Delete', req), 3710 timeout=timeout) 3711 except Exception as e: 3712 if self.parent.shouldRetry(tries, e): 3713 tries += 1 3714 self.parent.jitterSleep(tries) 3715 continue 3716 raise plumbing.convert_error_to_porcelain(e) from e 3717 break 3718 3719 resp = models.ResourceDeleteResponse() 3720 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 3721 plumbing_response.meta) 3722 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3723 plumbing_response.rate_limit) 3724 return resp
Delete removes a Resource by ID.
3726 def list(self, filter, *args, timeout=None): 3727 ''' 3728 List gets a list of Resources matching a given set of criteria. 3729 ''' 3730 req = ResourceListRequest() 3731 req.meta.CopyFrom(ListRequestMetadata()) 3732 if self.parent.page_limit > 0: 3733 req.meta.limit = self.parent.page_limit 3734 if self.parent.snapshot_datetime is not None: 3735 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3736 3737 req.filter = plumbing.quote_filter_args(filter, *args) 3738 3739 def generator(svc, req): 3740 tries = 0 3741 while True: 3742 try: 3743 plumbing_response = svc.stub.List( 3744 req, 3745 metadata=svc.parent.get_metadata( 3746 'Resources.List', req), 3747 timeout=timeout) 3748 except Exception as e: 3749 if self.parent.shouldRetry(tries, e): 3750 tries += 1 3751 self.parent.jitterSleep(tries) 3752 continue 3753 raise plumbing.convert_error_to_porcelain(e) from e 3754 tries = 0 3755 for plumbing_item in plumbing_response.resources: 3756 yield plumbing.convert_resource_to_porcelain(plumbing_item) 3757 if plumbing_response.meta.next_cursor == '': 3758 break 3759 req.meta.cursor = plumbing_response.meta.next_cursor 3760 3761 return generator(self, req)
List gets a list of Resources matching a given set of criteria.
3763 def healthcheck(self, id, timeout=None): 3764 ''' 3765 Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a 3766 large network of Nodes. The call will return immediately, and the updated health of the 3767 Resource can be retrieved via Get or List. 3768 ''' 3769 req = ResourceHealthcheckRequest() 3770 3771 req.id = (id) 3772 tries = 0 3773 plumbing_response = None 3774 while True: 3775 try: 3776 plumbing_response = self.stub.Healthcheck( 3777 req, 3778 metadata=self.parent.get_metadata('Resources.Healthcheck', 3779 req), 3780 timeout=timeout) 3781 except Exception as e: 3782 if self.parent.shouldRetry(tries, e): 3783 tries += 1 3784 self.parent.jitterSleep(tries) 3785 continue 3786 raise plumbing.convert_error_to_porcelain(e) from e 3787 break 3788 3789 resp = models.ResourceHealthcheckResponse() 3790 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 3791 plumbing_response.meta) 3792 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 3793 plumbing_response.rate_limit) 3794 return resp
Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a large network of Nodes. The call will return immediately, and the updated health of the Resource can be retrieved via Get or List.
3797class SnapshotResources: 3798 ''' 3799 SnapshotResources exposes the read only methods of the Resources 3800 service for historical queries. 3801 ''' 3802 def __init__(self, resources): 3803 self.resources = resources 3804 3805 def get(self, id, timeout=None): 3806 ''' 3807 Get reads one Resource by ID. 3808 ''' 3809 return self.resources.get(id, timeout=timeout) 3810 3811 def list(self, filter, *args, timeout=None): 3812 ''' 3813 List gets a list of Resources matching a given set of criteria. 3814 ''' 3815 return self.resources.list(filter, *args, timeout=timeout)
SnapshotResources exposes the read only methods of the Resources service for historical queries.
3805 def get(self, id, timeout=None): 3806 ''' 3807 Get reads one Resource by ID. 3808 ''' 3809 return self.resources.get(id, timeout=timeout)
Get reads one Resource by ID.
3811 def list(self, filter, *args, timeout=None): 3812 ''' 3813 List gets a list of Resources matching a given set of criteria. 3814 ''' 3815 return self.resources.list(filter, *args, timeout=timeout)
List gets a list of Resources matching a given set of criteria.
3818class ResourcesHistory: 3819 ''' 3820 ResourcesHistory records all changes to the state of a Resource. 3821 See `strongdm.models.ResourceHistory`. 3822 ''' 3823 def __init__(self, channel, client): 3824 self.parent = client 3825 self.stub = ResourcesHistoryStub(channel) 3826 3827 def list(self, filter, *args, timeout=None): 3828 ''' 3829 List gets a list of ResourceHistory records matching a given set of criteria. 3830 ''' 3831 req = ResourceHistoryListRequest() 3832 req.meta.CopyFrom(ListRequestMetadata()) 3833 if self.parent.page_limit > 0: 3834 req.meta.limit = self.parent.page_limit 3835 if self.parent.snapshot_datetime is not None: 3836 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3837 3838 req.filter = plumbing.quote_filter_args(filter, *args) 3839 3840 def generator(svc, req): 3841 tries = 0 3842 while True: 3843 try: 3844 plumbing_response = svc.stub.List( 3845 req, 3846 metadata=svc.parent.get_metadata( 3847 'ResourcesHistory.List', req), 3848 timeout=timeout) 3849 except Exception as e: 3850 if self.parent.shouldRetry(tries, e): 3851 tries += 1 3852 self.parent.jitterSleep(tries) 3853 continue 3854 raise plumbing.convert_error_to_porcelain(e) from e 3855 tries = 0 3856 for plumbing_item in plumbing_response.history: 3857 yield plumbing.convert_resource_history_to_porcelain( 3858 plumbing_item) 3859 if plumbing_response.meta.next_cursor == '': 3860 break 3861 req.meta.cursor = plumbing_response.meta.next_cursor 3862 3863 return generator(self, req)
ResourcesHistory records all changes to the state of a Resource.
See strongdm.models.ResourceHistory
.
3827 def list(self, filter, *args, timeout=None): 3828 ''' 3829 List gets a list of ResourceHistory records matching a given set of criteria. 3830 ''' 3831 req = ResourceHistoryListRequest() 3832 req.meta.CopyFrom(ListRequestMetadata()) 3833 if self.parent.page_limit > 0: 3834 req.meta.limit = self.parent.page_limit 3835 if self.parent.snapshot_datetime is not None: 3836 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3837 3838 req.filter = plumbing.quote_filter_args(filter, *args) 3839 3840 def generator(svc, req): 3841 tries = 0 3842 while True: 3843 try: 3844 plumbing_response = svc.stub.List( 3845 req, 3846 metadata=svc.parent.get_metadata( 3847 'ResourcesHistory.List', req), 3848 timeout=timeout) 3849 except Exception as e: 3850 if self.parent.shouldRetry(tries, e): 3851 tries += 1 3852 self.parent.jitterSleep(tries) 3853 continue 3854 raise plumbing.convert_error_to_porcelain(e) from e 3855 tries = 0 3856 for plumbing_item in plumbing_response.history: 3857 yield plumbing.convert_resource_history_to_porcelain( 3858 plumbing_item) 3859 if plumbing_response.meta.next_cursor == '': 3860 break 3861 req.meta.cursor = plumbing_response.meta.next_cursor 3862 3863 return generator(self, req)
List gets a list of ResourceHistory records matching a given set of criteria.
3866class RoleResources: 3867 ''' 3868 RoleResources enumerates the resources to which roles have access. 3869 The RoleResources service is read-only. 3870 See `strongdm.models.RoleResource`. 3871 ''' 3872 def __init__(self, channel, client): 3873 self.parent = client 3874 self.stub = RoleResourcesStub(channel) 3875 3876 def list(self, filter, *args, timeout=None): 3877 ''' 3878 List gets a list of RoleResource records matching a given set of criteria. 3879 ''' 3880 req = RoleResourceListRequest() 3881 req.meta.CopyFrom(ListRequestMetadata()) 3882 if self.parent.page_limit > 0: 3883 req.meta.limit = self.parent.page_limit 3884 if self.parent.snapshot_datetime is not None: 3885 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3886 3887 req.filter = plumbing.quote_filter_args(filter, *args) 3888 3889 def generator(svc, req): 3890 tries = 0 3891 while True: 3892 try: 3893 plumbing_response = svc.stub.List( 3894 req, 3895 metadata=svc.parent.get_metadata( 3896 'RoleResources.List', req), 3897 timeout=timeout) 3898 except Exception as e: 3899 if self.parent.shouldRetry(tries, e): 3900 tries += 1 3901 self.parent.jitterSleep(tries) 3902 continue 3903 raise plumbing.convert_error_to_porcelain(e) from e 3904 tries = 0 3905 for plumbing_item in plumbing_response.role_resources: 3906 yield plumbing.convert_role_resource_to_porcelain( 3907 plumbing_item) 3908 if plumbing_response.meta.next_cursor == '': 3909 break 3910 req.meta.cursor = plumbing_response.meta.next_cursor 3911 3912 return generator(self, req)
RoleResources enumerates the resources to which roles have access.
The RoleResources service is read-only.
See strongdm.models.RoleResource
.
3876 def list(self, filter, *args, timeout=None): 3877 ''' 3878 List gets a list of RoleResource records matching a given set of criteria. 3879 ''' 3880 req = RoleResourceListRequest() 3881 req.meta.CopyFrom(ListRequestMetadata()) 3882 if self.parent.page_limit > 0: 3883 req.meta.limit = self.parent.page_limit 3884 if self.parent.snapshot_datetime is not None: 3885 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3886 3887 req.filter = plumbing.quote_filter_args(filter, *args) 3888 3889 def generator(svc, req): 3890 tries = 0 3891 while True: 3892 try: 3893 plumbing_response = svc.stub.List( 3894 req, 3895 metadata=svc.parent.get_metadata( 3896 'RoleResources.List', req), 3897 timeout=timeout) 3898 except Exception as e: 3899 if self.parent.shouldRetry(tries, e): 3900 tries += 1 3901 self.parent.jitterSleep(tries) 3902 continue 3903 raise plumbing.convert_error_to_porcelain(e) from e 3904 tries = 0 3905 for plumbing_item in plumbing_response.role_resources: 3906 yield plumbing.convert_role_resource_to_porcelain( 3907 plumbing_item) 3908 if plumbing_response.meta.next_cursor == '': 3909 break 3910 req.meta.cursor = plumbing_response.meta.next_cursor 3911 3912 return generator(self, req)
List gets a list of RoleResource records matching a given set of criteria.
3915class SnapshotRoleResources: 3916 ''' 3917 SnapshotRoleResources exposes the read only methods of the RoleResources 3918 service for historical queries. 3919 ''' 3920 def __init__(self, role_resources): 3921 self.role_resources = role_resources 3922 3923 def list(self, filter, *args, timeout=None): 3924 ''' 3925 List gets a list of RoleResource records matching a given set of criteria. 3926 ''' 3927 return self.role_resources.list(filter, *args, timeout=timeout)
SnapshotRoleResources exposes the read only methods of the RoleResources service for historical queries.
3923 def list(self, filter, *args, timeout=None): 3924 ''' 3925 List gets a list of RoleResource records matching a given set of criteria. 3926 ''' 3927 return self.role_resources.list(filter, *args, timeout=timeout)
List gets a list of RoleResource records matching a given set of criteria.
3930class RoleResourcesHistory: 3931 ''' 3932 RoleResourcesHistory records all changes to the state of a RoleResource. 3933 See `strongdm.models.RoleResourceHistory`. 3934 ''' 3935 def __init__(self, channel, client): 3936 self.parent = client 3937 self.stub = RoleResourcesHistoryStub(channel) 3938 3939 def list(self, filter, *args, timeout=None): 3940 ''' 3941 List gets a list of RoleResourceHistory records matching a given set of criteria. 3942 ''' 3943 req = RoleResourceHistoryListRequest() 3944 req.meta.CopyFrom(ListRequestMetadata()) 3945 if self.parent.page_limit > 0: 3946 req.meta.limit = self.parent.page_limit 3947 if self.parent.snapshot_datetime is not None: 3948 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3949 3950 req.filter = plumbing.quote_filter_args(filter, *args) 3951 3952 def generator(svc, req): 3953 tries = 0 3954 while True: 3955 try: 3956 plumbing_response = svc.stub.List( 3957 req, 3958 metadata=svc.parent.get_metadata( 3959 'RoleResourcesHistory.List', req), 3960 timeout=timeout) 3961 except Exception as e: 3962 if self.parent.shouldRetry(tries, e): 3963 tries += 1 3964 self.parent.jitterSleep(tries) 3965 continue 3966 raise plumbing.convert_error_to_porcelain(e) from e 3967 tries = 0 3968 for plumbing_item in plumbing_response.history: 3969 yield plumbing.convert_role_resource_history_to_porcelain( 3970 plumbing_item) 3971 if plumbing_response.meta.next_cursor == '': 3972 break 3973 req.meta.cursor = plumbing_response.meta.next_cursor 3974 3975 return generator(self, req)
RoleResourcesHistory records all changes to the state of a RoleResource.
See strongdm.models.RoleResourceHistory
.
3939 def list(self, filter, *args, timeout=None): 3940 ''' 3941 List gets a list of RoleResourceHistory records matching a given set of criteria. 3942 ''' 3943 req = RoleResourceHistoryListRequest() 3944 req.meta.CopyFrom(ListRequestMetadata()) 3945 if self.parent.page_limit > 0: 3946 req.meta.limit = self.parent.page_limit 3947 if self.parent.snapshot_datetime is not None: 3948 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 3949 3950 req.filter = plumbing.quote_filter_args(filter, *args) 3951 3952 def generator(svc, req): 3953 tries = 0 3954 while True: 3955 try: 3956 plumbing_response = svc.stub.List( 3957 req, 3958 metadata=svc.parent.get_metadata( 3959 'RoleResourcesHistory.List', req), 3960 timeout=timeout) 3961 except Exception as e: 3962 if self.parent.shouldRetry(tries, e): 3963 tries += 1 3964 self.parent.jitterSleep(tries) 3965 continue 3966 raise plumbing.convert_error_to_porcelain(e) from e 3967 tries = 0 3968 for plumbing_item in plumbing_response.history: 3969 yield plumbing.convert_role_resource_history_to_porcelain( 3970 plumbing_item) 3971 if plumbing_response.meta.next_cursor == '': 3972 break 3973 req.meta.cursor = plumbing_response.meta.next_cursor 3974 3975 return generator(self, req)
List gets a list of RoleResourceHistory records matching a given set of criteria.
3978class Roles: 3979 ''' 3980 A Role has a list of access rules which determine which Resources the members 3981 of the Role have access to. An Account can be a member of multiple Roles via 3982 AccountAttachments. 3983 See `strongdm.models.Role`. 3984 ''' 3985 def __init__(self, channel, client): 3986 self.parent = client 3987 self.stub = RolesStub(channel) 3988 3989 def create(self, role, timeout=None): 3990 ''' 3991 Create registers a new Role. 3992 ''' 3993 req = RoleCreateRequest() 3994 3995 if role is not None: 3996 req.role.CopyFrom(plumbing.convert_role_to_plumbing(role)) 3997 tries = 0 3998 plumbing_response = None 3999 while True: 4000 try: 4001 plumbing_response = self.stub.Create( 4002 req, 4003 metadata=self.parent.get_metadata('Roles.Create', req), 4004 timeout=timeout) 4005 except Exception as e: 4006 if self.parent.shouldRetry(tries, e): 4007 tries += 1 4008 self.parent.jitterSleep(tries) 4009 continue 4010 raise plumbing.convert_error_to_porcelain(e) from e 4011 break 4012 4013 resp = models.RoleCreateResponse() 4014 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 4015 plumbing_response.meta) 4016 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4017 plumbing_response.rate_limit) 4018 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4019 return resp 4020 4021 def get(self, id, timeout=None): 4022 ''' 4023 Get reads one Role by ID. 4024 ''' 4025 req = RoleGetRequest() 4026 if self.parent.snapshot_datetime is not None: 4027 req.meta.CopyFrom(GetRequestMetadata()) 4028 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4029 4030 req.id = (id) 4031 tries = 0 4032 plumbing_response = None 4033 while True: 4034 try: 4035 plumbing_response = self.stub.Get( 4036 req, 4037 metadata=self.parent.get_metadata('Roles.Get', req), 4038 timeout=timeout) 4039 except Exception as e: 4040 if self.parent.shouldRetry(tries, e): 4041 tries += 1 4042 self.parent.jitterSleep(tries) 4043 continue 4044 raise plumbing.convert_error_to_porcelain(e) from e 4045 break 4046 4047 resp = models.RoleGetResponse() 4048 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4049 plumbing_response.meta) 4050 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4051 plumbing_response.rate_limit) 4052 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4053 return resp 4054 4055 def update(self, role, timeout=None): 4056 ''' 4057 Update replaces all the fields of a Role by ID. 4058 ''' 4059 req = RoleUpdateRequest() 4060 4061 if role is not None: 4062 req.role.CopyFrom(plumbing.convert_role_to_plumbing(role)) 4063 tries = 0 4064 plumbing_response = None 4065 while True: 4066 try: 4067 plumbing_response = self.stub.Update( 4068 req, 4069 metadata=self.parent.get_metadata('Roles.Update', req), 4070 timeout=timeout) 4071 except Exception as e: 4072 if self.parent.shouldRetry(tries, e): 4073 tries += 1 4074 self.parent.jitterSleep(tries) 4075 continue 4076 raise plumbing.convert_error_to_porcelain(e) from e 4077 break 4078 4079 resp = models.RoleUpdateResponse() 4080 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 4081 plumbing_response.meta) 4082 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4083 plumbing_response.rate_limit) 4084 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4085 return resp 4086 4087 def delete(self, id, timeout=None): 4088 ''' 4089 Delete removes a Role by ID. 4090 ''' 4091 req = RoleDeleteRequest() 4092 4093 req.id = (id) 4094 tries = 0 4095 plumbing_response = None 4096 while True: 4097 try: 4098 plumbing_response = self.stub.Delete( 4099 req, 4100 metadata=self.parent.get_metadata('Roles.Delete', req), 4101 timeout=timeout) 4102 except Exception as e: 4103 if self.parent.shouldRetry(tries, e): 4104 tries += 1 4105 self.parent.jitterSleep(tries) 4106 continue 4107 raise plumbing.convert_error_to_porcelain(e) from e 4108 break 4109 4110 resp = models.RoleDeleteResponse() 4111 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 4112 plumbing_response.meta) 4113 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4114 plumbing_response.rate_limit) 4115 return resp 4116 4117 def list(self, filter, *args, timeout=None): 4118 ''' 4119 List gets a list of Roles matching a given set of criteria. 4120 ''' 4121 req = RoleListRequest() 4122 req.meta.CopyFrom(ListRequestMetadata()) 4123 if self.parent.page_limit > 0: 4124 req.meta.limit = self.parent.page_limit 4125 if self.parent.snapshot_datetime is not None: 4126 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4127 4128 req.filter = plumbing.quote_filter_args(filter, *args) 4129 4130 def generator(svc, req): 4131 tries = 0 4132 while True: 4133 try: 4134 plumbing_response = svc.stub.List( 4135 req, 4136 metadata=svc.parent.get_metadata('Roles.List', req), 4137 timeout=timeout) 4138 except Exception as e: 4139 if self.parent.shouldRetry(tries, e): 4140 tries += 1 4141 self.parent.jitterSleep(tries) 4142 continue 4143 raise plumbing.convert_error_to_porcelain(e) from e 4144 tries = 0 4145 for plumbing_item in plumbing_response.roles: 4146 yield plumbing.convert_role_to_porcelain(plumbing_item) 4147 if plumbing_response.meta.next_cursor == '': 4148 break 4149 req.meta.cursor = plumbing_response.meta.next_cursor 4150 4151 return generator(self, req)
A Role has a list of access rules which determine which Resources the members
of the Role have access to. An Account can be a member of multiple Roles via
AccountAttachments.
See strongdm.models.Role
.
3989 def create(self, role, timeout=None): 3990 ''' 3991 Create registers a new Role. 3992 ''' 3993 req = RoleCreateRequest() 3994 3995 if role is not None: 3996 req.role.CopyFrom(plumbing.convert_role_to_plumbing(role)) 3997 tries = 0 3998 plumbing_response = None 3999 while True: 4000 try: 4001 plumbing_response = self.stub.Create( 4002 req, 4003 metadata=self.parent.get_metadata('Roles.Create', req), 4004 timeout=timeout) 4005 except Exception as e: 4006 if self.parent.shouldRetry(tries, e): 4007 tries += 1 4008 self.parent.jitterSleep(tries) 4009 continue 4010 raise plumbing.convert_error_to_porcelain(e) from e 4011 break 4012 4013 resp = models.RoleCreateResponse() 4014 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 4015 plumbing_response.meta) 4016 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4017 plumbing_response.rate_limit) 4018 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4019 return resp
Create registers a new Role.
4021 def get(self, id, timeout=None): 4022 ''' 4023 Get reads one Role by ID. 4024 ''' 4025 req = RoleGetRequest() 4026 if self.parent.snapshot_datetime is not None: 4027 req.meta.CopyFrom(GetRequestMetadata()) 4028 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4029 4030 req.id = (id) 4031 tries = 0 4032 plumbing_response = None 4033 while True: 4034 try: 4035 plumbing_response = self.stub.Get( 4036 req, 4037 metadata=self.parent.get_metadata('Roles.Get', req), 4038 timeout=timeout) 4039 except Exception as e: 4040 if self.parent.shouldRetry(tries, e): 4041 tries += 1 4042 self.parent.jitterSleep(tries) 4043 continue 4044 raise plumbing.convert_error_to_porcelain(e) from e 4045 break 4046 4047 resp = models.RoleGetResponse() 4048 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4049 plumbing_response.meta) 4050 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4051 plumbing_response.rate_limit) 4052 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4053 return resp
Get reads one Role by ID.
4055 def update(self, role, timeout=None): 4056 ''' 4057 Update replaces all the fields of a Role by ID. 4058 ''' 4059 req = RoleUpdateRequest() 4060 4061 if role is not None: 4062 req.role.CopyFrom(plumbing.convert_role_to_plumbing(role)) 4063 tries = 0 4064 plumbing_response = None 4065 while True: 4066 try: 4067 plumbing_response = self.stub.Update( 4068 req, 4069 metadata=self.parent.get_metadata('Roles.Update', req), 4070 timeout=timeout) 4071 except Exception as e: 4072 if self.parent.shouldRetry(tries, e): 4073 tries += 1 4074 self.parent.jitterSleep(tries) 4075 continue 4076 raise plumbing.convert_error_to_porcelain(e) from e 4077 break 4078 4079 resp = models.RoleUpdateResponse() 4080 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 4081 plumbing_response.meta) 4082 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4083 plumbing_response.rate_limit) 4084 resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role) 4085 return resp
Update replaces all the fields of a Role by ID.
4087 def delete(self, id, timeout=None): 4088 ''' 4089 Delete removes a Role by ID. 4090 ''' 4091 req = RoleDeleteRequest() 4092 4093 req.id = (id) 4094 tries = 0 4095 plumbing_response = None 4096 while True: 4097 try: 4098 plumbing_response = self.stub.Delete( 4099 req, 4100 metadata=self.parent.get_metadata('Roles.Delete', req), 4101 timeout=timeout) 4102 except Exception as e: 4103 if self.parent.shouldRetry(tries, e): 4104 tries += 1 4105 self.parent.jitterSleep(tries) 4106 continue 4107 raise plumbing.convert_error_to_porcelain(e) from e 4108 break 4109 4110 resp = models.RoleDeleteResponse() 4111 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 4112 plumbing_response.meta) 4113 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4114 plumbing_response.rate_limit) 4115 return resp
Delete removes a Role by ID.
4117 def list(self, filter, *args, timeout=None): 4118 ''' 4119 List gets a list of Roles matching a given set of criteria. 4120 ''' 4121 req = RoleListRequest() 4122 req.meta.CopyFrom(ListRequestMetadata()) 4123 if self.parent.page_limit > 0: 4124 req.meta.limit = self.parent.page_limit 4125 if self.parent.snapshot_datetime is not None: 4126 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4127 4128 req.filter = plumbing.quote_filter_args(filter, *args) 4129 4130 def generator(svc, req): 4131 tries = 0 4132 while True: 4133 try: 4134 plumbing_response = svc.stub.List( 4135 req, 4136 metadata=svc.parent.get_metadata('Roles.List', req), 4137 timeout=timeout) 4138 except Exception as e: 4139 if self.parent.shouldRetry(tries, e): 4140 tries += 1 4141 self.parent.jitterSleep(tries) 4142 continue 4143 raise plumbing.convert_error_to_porcelain(e) from e 4144 tries = 0 4145 for plumbing_item in plumbing_response.roles: 4146 yield plumbing.convert_role_to_porcelain(plumbing_item) 4147 if plumbing_response.meta.next_cursor == '': 4148 break 4149 req.meta.cursor = plumbing_response.meta.next_cursor 4150 4151 return generator(self, req)
List gets a list of Roles matching a given set of criteria.
4154class SnapshotRoles: 4155 ''' 4156 SnapshotRoles exposes the read only methods of the Roles 4157 service for historical queries. 4158 ''' 4159 def __init__(self, roles): 4160 self.roles = roles 4161 4162 def get(self, id, timeout=None): 4163 ''' 4164 Get reads one Role by ID. 4165 ''' 4166 return self.roles.get(id, timeout=timeout) 4167 4168 def list(self, filter, *args, timeout=None): 4169 ''' 4170 List gets a list of Roles matching a given set of criteria. 4171 ''' 4172 return self.roles.list(filter, *args, timeout=timeout)
SnapshotRoles exposes the read only methods of the Roles service for historical queries.
4175class RolesHistory: 4176 ''' 4177 RolesHistory records all changes to the state of a Role. 4178 See `strongdm.models.RoleHistory`. 4179 ''' 4180 def __init__(self, channel, client): 4181 self.parent = client 4182 self.stub = RolesHistoryStub(channel) 4183 4184 def list(self, filter, *args, timeout=None): 4185 ''' 4186 List gets a list of RoleHistory records matching a given set of criteria. 4187 ''' 4188 req = RoleHistoryListRequest() 4189 req.meta.CopyFrom(ListRequestMetadata()) 4190 if self.parent.page_limit > 0: 4191 req.meta.limit = self.parent.page_limit 4192 if self.parent.snapshot_datetime is not None: 4193 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4194 4195 req.filter = plumbing.quote_filter_args(filter, *args) 4196 4197 def generator(svc, req): 4198 tries = 0 4199 while True: 4200 try: 4201 plumbing_response = svc.stub.List( 4202 req, 4203 metadata=svc.parent.get_metadata( 4204 'RolesHistory.List', req), 4205 timeout=timeout) 4206 except Exception as e: 4207 if self.parent.shouldRetry(tries, e): 4208 tries += 1 4209 self.parent.jitterSleep(tries) 4210 continue 4211 raise plumbing.convert_error_to_porcelain(e) from e 4212 tries = 0 4213 for plumbing_item in plumbing_response.history: 4214 yield plumbing.convert_role_history_to_porcelain( 4215 plumbing_item) 4216 if plumbing_response.meta.next_cursor == '': 4217 break 4218 req.meta.cursor = plumbing_response.meta.next_cursor 4219 4220 return generator(self, req)
RolesHistory records all changes to the state of a Role.
See strongdm.models.RoleHistory
.
4184 def list(self, filter, *args, timeout=None): 4185 ''' 4186 List gets a list of RoleHistory records matching a given set of criteria. 4187 ''' 4188 req = RoleHistoryListRequest() 4189 req.meta.CopyFrom(ListRequestMetadata()) 4190 if self.parent.page_limit > 0: 4191 req.meta.limit = self.parent.page_limit 4192 if self.parent.snapshot_datetime is not None: 4193 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4194 4195 req.filter = plumbing.quote_filter_args(filter, *args) 4196 4197 def generator(svc, req): 4198 tries = 0 4199 while True: 4200 try: 4201 plumbing_response = svc.stub.List( 4202 req, 4203 metadata=svc.parent.get_metadata( 4204 'RolesHistory.List', req), 4205 timeout=timeout) 4206 except Exception as e: 4207 if self.parent.shouldRetry(tries, e): 4208 tries += 1 4209 self.parent.jitterSleep(tries) 4210 continue 4211 raise plumbing.convert_error_to_porcelain(e) from e 4212 tries = 0 4213 for plumbing_item in plumbing_response.history: 4214 yield plumbing.convert_role_history_to_porcelain( 4215 plumbing_item) 4216 if plumbing_response.meta.next_cursor == '': 4217 break 4218 req.meta.cursor = plumbing_response.meta.next_cursor 4219 4220 return generator(self, req)
List gets a list of RoleHistory records matching a given set of criteria.
4223class SecretStoreHealths: 4224 ''' 4225 SecretStoreHealths exposes health states for secret stores. 4226 See `strongdm.models.SecretStoreHealth`. 4227 ''' 4228 def __init__(self, channel, client): 4229 self.parent = client 4230 self.stub = SecretStoreHealthsStub(channel) 4231 4232 def list(self, filter, *args, timeout=None): 4233 ''' 4234 List reports the health status of node to secret store pairs. 4235 ''' 4236 req = SecretStoreHealthListRequest() 4237 req.meta.CopyFrom(ListRequestMetadata()) 4238 if self.parent.page_limit > 0: 4239 req.meta.limit = self.parent.page_limit 4240 if self.parent.snapshot_datetime is not None: 4241 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4242 4243 req.filter = plumbing.quote_filter_args(filter, *args) 4244 4245 def generator(svc, req): 4246 tries = 0 4247 while True: 4248 try: 4249 plumbing_response = svc.stub.List( 4250 req, 4251 metadata=svc.parent.get_metadata( 4252 'SecretStoreHealths.List', req), 4253 timeout=timeout) 4254 except Exception as e: 4255 if self.parent.shouldRetry(tries, e): 4256 tries += 1 4257 self.parent.jitterSleep(tries) 4258 continue 4259 raise plumbing.convert_error_to_porcelain(e) from e 4260 tries = 0 4261 for plumbing_item in plumbing_response.secret_store_healths: 4262 yield plumbing.convert_secret_store_health_to_porcelain( 4263 plumbing_item) 4264 if plumbing_response.meta.next_cursor == '': 4265 break 4266 req.meta.cursor = plumbing_response.meta.next_cursor 4267 4268 return generator(self, req) 4269 4270 def healthcheck(self, secret_store_id, timeout=None): 4271 ''' 4272 Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes 4273 to propagate across a large network of Nodes. The call will return immediately, and the 4274 updated health of the Secret Store can be retrieved via List. 4275 ''' 4276 req = SecretStoreHealthcheckRequest() 4277 4278 req.secret_store_id = (secret_store_id) 4279 tries = 0 4280 plumbing_response = None 4281 while True: 4282 try: 4283 plumbing_response = self.stub.Healthcheck( 4284 req, 4285 metadata=self.parent.get_metadata( 4286 'SecretStoreHealths.Healthcheck', req), 4287 timeout=timeout) 4288 except Exception as e: 4289 if self.parent.shouldRetry(tries, e): 4290 tries += 1 4291 self.parent.jitterSleep(tries) 4292 continue 4293 raise plumbing.convert_error_to_porcelain(e) from e 4294 break 4295 4296 resp = models.SecretStoreHealthcheckResponse() 4297 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4298 plumbing_response.rate_limit) 4299 return resp
SecretStoreHealths exposes health states for secret stores.
See strongdm.models.SecretStoreHealth
.
4232 def list(self, filter, *args, timeout=None): 4233 ''' 4234 List reports the health status of node to secret store pairs. 4235 ''' 4236 req = SecretStoreHealthListRequest() 4237 req.meta.CopyFrom(ListRequestMetadata()) 4238 if self.parent.page_limit > 0: 4239 req.meta.limit = self.parent.page_limit 4240 if self.parent.snapshot_datetime is not None: 4241 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4242 4243 req.filter = plumbing.quote_filter_args(filter, *args) 4244 4245 def generator(svc, req): 4246 tries = 0 4247 while True: 4248 try: 4249 plumbing_response = svc.stub.List( 4250 req, 4251 metadata=svc.parent.get_metadata( 4252 'SecretStoreHealths.List', req), 4253 timeout=timeout) 4254 except Exception as e: 4255 if self.parent.shouldRetry(tries, e): 4256 tries += 1 4257 self.parent.jitterSleep(tries) 4258 continue 4259 raise plumbing.convert_error_to_porcelain(e) from e 4260 tries = 0 4261 for plumbing_item in plumbing_response.secret_store_healths: 4262 yield plumbing.convert_secret_store_health_to_porcelain( 4263 plumbing_item) 4264 if plumbing_response.meta.next_cursor == '': 4265 break 4266 req.meta.cursor = plumbing_response.meta.next_cursor 4267 4268 return generator(self, req)
List reports the health status of node to secret store pairs.
4270 def healthcheck(self, secret_store_id, timeout=None): 4271 ''' 4272 Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes 4273 to propagate across a large network of Nodes. The call will return immediately, and the 4274 updated health of the Secret Store can be retrieved via List. 4275 ''' 4276 req = SecretStoreHealthcheckRequest() 4277 4278 req.secret_store_id = (secret_store_id) 4279 tries = 0 4280 plumbing_response = None 4281 while True: 4282 try: 4283 plumbing_response = self.stub.Healthcheck( 4284 req, 4285 metadata=self.parent.get_metadata( 4286 'SecretStoreHealths.Healthcheck', req), 4287 timeout=timeout) 4288 except Exception as e: 4289 if self.parent.shouldRetry(tries, e): 4290 tries += 1 4291 self.parent.jitterSleep(tries) 4292 continue 4293 raise plumbing.convert_error_to_porcelain(e) from e 4294 break 4295 4296 resp = models.SecretStoreHealthcheckResponse() 4297 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4298 plumbing_response.rate_limit) 4299 return resp
Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes to propagate across a large network of Nodes. The call will return immediately, and the updated health of the Secret Store can be retrieved via List.
4302class SecretStores: 4303 ''' 4304 SecretStores are servers where resource secrets (passwords, keys) are stored. 4305 See: 4306 `strongdm.models.ActiveDirectoryStore` 4307 `strongdm.models.AWSStore` 4308 `strongdm.models.AWSCertX509Store` 4309 `strongdm.models.AzureStore` 4310 `strongdm.models.CyberarkConjurStore` 4311 `strongdm.models.CyberarkPAMStore` 4312 `strongdm.models.CyberarkPAMExperimentalStore` 4313 `strongdm.models.DelineaStore` 4314 `strongdm.models.GCPStore` 4315 `strongdm.models.GCPCertX509Store` 4316 `strongdm.models.KeyfactorX509Store` 4317 `strongdm.models.VaultAppRoleStore` 4318 `strongdm.models.VaultAppRoleCertSSHStore` 4319 `strongdm.models.VaultAppRoleCertX509Store` 4320 `strongdm.models.VaultTLSStore` 4321 `strongdm.models.VaultTLSCertSSHStore` 4322 `strongdm.models.VaultTLSCertX509Store` 4323 `strongdm.models.VaultTokenStore` 4324 `strongdm.models.VaultTokenCertSSHStore` 4325 `strongdm.models.VaultTokenCertX509Store` 4326 ''' 4327 def __init__(self, channel, client): 4328 self.parent = client 4329 self.stub = SecretStoresStub(channel) 4330 4331 def create(self, secret_store, timeout=None): 4332 req = SecretStoreCreateRequest() 4333 4334 if secret_store is not None: 4335 req.secret_store.CopyFrom( 4336 plumbing.convert_secret_store_to_plumbing(secret_store)) 4337 tries = 0 4338 plumbing_response = None 4339 while True: 4340 try: 4341 plumbing_response = self.stub.Create( 4342 req, 4343 metadata=self.parent.get_metadata('SecretStores.Create', 4344 req), 4345 timeout=timeout) 4346 except Exception as e: 4347 if self.parent.shouldRetry(tries, e): 4348 tries += 1 4349 self.parent.jitterSleep(tries) 4350 continue 4351 raise plumbing.convert_error_to_porcelain(e) from e 4352 break 4353 4354 resp = models.SecretStoreCreateResponse() 4355 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 4356 plumbing_response.meta) 4357 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4358 plumbing_response.rate_limit) 4359 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4360 plumbing_response.secret_store) 4361 return resp 4362 4363 def get(self, id, timeout=None): 4364 ''' 4365 Get reads one SecretStore by ID. 4366 ''' 4367 req = SecretStoreGetRequest() 4368 if self.parent.snapshot_datetime is not None: 4369 req.meta.CopyFrom(GetRequestMetadata()) 4370 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4371 4372 req.id = (id) 4373 tries = 0 4374 plumbing_response = None 4375 while True: 4376 try: 4377 plumbing_response = self.stub.Get( 4378 req, 4379 metadata=self.parent.get_metadata('SecretStores.Get', req), 4380 timeout=timeout) 4381 except Exception as e: 4382 if self.parent.shouldRetry(tries, e): 4383 tries += 1 4384 self.parent.jitterSleep(tries) 4385 continue 4386 raise plumbing.convert_error_to_porcelain(e) from e 4387 break 4388 4389 resp = models.SecretStoreGetResponse() 4390 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4391 plumbing_response.meta) 4392 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4393 plumbing_response.rate_limit) 4394 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4395 plumbing_response.secret_store) 4396 return resp 4397 4398 def update(self, secret_store, timeout=None): 4399 ''' 4400 Update replaces all the fields of a SecretStore by ID. 4401 ''' 4402 req = SecretStoreUpdateRequest() 4403 4404 if secret_store is not None: 4405 req.secret_store.CopyFrom( 4406 plumbing.convert_secret_store_to_plumbing(secret_store)) 4407 tries = 0 4408 plumbing_response = None 4409 while True: 4410 try: 4411 plumbing_response = self.stub.Update( 4412 req, 4413 metadata=self.parent.get_metadata('SecretStores.Update', 4414 req), 4415 timeout=timeout) 4416 except Exception as e: 4417 if self.parent.shouldRetry(tries, e): 4418 tries += 1 4419 self.parent.jitterSleep(tries) 4420 continue 4421 raise plumbing.convert_error_to_porcelain(e) from e 4422 break 4423 4424 resp = models.SecretStoreUpdateResponse() 4425 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 4426 plumbing_response.meta) 4427 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4428 plumbing_response.rate_limit) 4429 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4430 plumbing_response.secret_store) 4431 return resp 4432 4433 def delete(self, id, timeout=None): 4434 ''' 4435 Delete removes a SecretStore by ID. 4436 ''' 4437 req = SecretStoreDeleteRequest() 4438 4439 req.id = (id) 4440 tries = 0 4441 plumbing_response = None 4442 while True: 4443 try: 4444 plumbing_response = self.stub.Delete( 4445 req, 4446 metadata=self.parent.get_metadata('SecretStores.Delete', 4447 req), 4448 timeout=timeout) 4449 except Exception as e: 4450 if self.parent.shouldRetry(tries, e): 4451 tries += 1 4452 self.parent.jitterSleep(tries) 4453 continue 4454 raise plumbing.convert_error_to_porcelain(e) from e 4455 break 4456 4457 resp = models.SecretStoreDeleteResponse() 4458 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 4459 plumbing_response.meta) 4460 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4461 plumbing_response.rate_limit) 4462 return resp 4463 4464 def list(self, filter, *args, timeout=None): 4465 ''' 4466 List gets a list of SecretStores matching a given set of criteria. 4467 ''' 4468 req = SecretStoreListRequest() 4469 req.meta.CopyFrom(ListRequestMetadata()) 4470 if self.parent.page_limit > 0: 4471 req.meta.limit = self.parent.page_limit 4472 if self.parent.snapshot_datetime is not None: 4473 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4474 4475 req.filter = plumbing.quote_filter_args(filter, *args) 4476 4477 def generator(svc, req): 4478 tries = 0 4479 while True: 4480 try: 4481 plumbing_response = svc.stub.List( 4482 req, 4483 metadata=svc.parent.get_metadata( 4484 'SecretStores.List', req), 4485 timeout=timeout) 4486 except Exception as e: 4487 if self.parent.shouldRetry(tries, e): 4488 tries += 1 4489 self.parent.jitterSleep(tries) 4490 continue 4491 raise plumbing.convert_error_to_porcelain(e) from e 4492 tries = 0 4493 for plumbing_item in plumbing_response.secret_stores: 4494 yield plumbing.convert_secret_store_to_porcelain( 4495 plumbing_item) 4496 if plumbing_response.meta.next_cursor == '': 4497 break 4498 req.meta.cursor = plumbing_response.meta.next_cursor 4499 4500 return generator(self, req)
SecretStores are servers where resource secrets (passwords, keys) are stored.
See:
strongdm.models.ActiveDirectoryStore
strongdm.models.AWSStore
strongdm.models.AWSCertX509Store
strongdm.models.AzureStore
strongdm.models.CyberarkConjurStore
strongdm.models.CyberarkPAMStore
strongdm.models.CyberarkPAMExperimentalStore
strongdm.models.DelineaStore
strongdm.models.GCPStore
strongdm.models.GCPCertX509Store
strongdm.models.KeyfactorX509Store
strongdm.models.VaultAppRoleStore
strongdm.models.VaultAppRoleCertSSHStore
strongdm.models.VaultAppRoleCertX509Store
strongdm.models.VaultTLSStore
strongdm.models.VaultTLSCertSSHStore
strongdm.models.VaultTLSCertX509Store
strongdm.models.VaultTokenStore
strongdm.models.VaultTokenCertSSHStore
strongdm.models.VaultTokenCertX509Store
4331 def create(self, secret_store, timeout=None): 4332 req = SecretStoreCreateRequest() 4333 4334 if secret_store is not None: 4335 req.secret_store.CopyFrom( 4336 plumbing.convert_secret_store_to_plumbing(secret_store)) 4337 tries = 0 4338 plumbing_response = None 4339 while True: 4340 try: 4341 plumbing_response = self.stub.Create( 4342 req, 4343 metadata=self.parent.get_metadata('SecretStores.Create', 4344 req), 4345 timeout=timeout) 4346 except Exception as e: 4347 if self.parent.shouldRetry(tries, e): 4348 tries += 1 4349 self.parent.jitterSleep(tries) 4350 continue 4351 raise plumbing.convert_error_to_porcelain(e) from e 4352 break 4353 4354 resp = models.SecretStoreCreateResponse() 4355 resp.meta = plumbing.convert_create_response_metadata_to_porcelain( 4356 plumbing_response.meta) 4357 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4358 plumbing_response.rate_limit) 4359 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4360 plumbing_response.secret_store) 4361 return resp
4363 def get(self, id, timeout=None): 4364 ''' 4365 Get reads one SecretStore by ID. 4366 ''' 4367 req = SecretStoreGetRequest() 4368 if self.parent.snapshot_datetime is not None: 4369 req.meta.CopyFrom(GetRequestMetadata()) 4370 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4371 4372 req.id = (id) 4373 tries = 0 4374 plumbing_response = None 4375 while True: 4376 try: 4377 plumbing_response = self.stub.Get( 4378 req, 4379 metadata=self.parent.get_metadata('SecretStores.Get', req), 4380 timeout=timeout) 4381 except Exception as e: 4382 if self.parent.shouldRetry(tries, e): 4383 tries += 1 4384 self.parent.jitterSleep(tries) 4385 continue 4386 raise plumbing.convert_error_to_porcelain(e) from e 4387 break 4388 4389 resp = models.SecretStoreGetResponse() 4390 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4391 plumbing_response.meta) 4392 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4393 plumbing_response.rate_limit) 4394 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4395 plumbing_response.secret_store) 4396 return resp
Get reads one SecretStore by ID.
4398 def update(self, secret_store, timeout=None): 4399 ''' 4400 Update replaces all the fields of a SecretStore by ID. 4401 ''' 4402 req = SecretStoreUpdateRequest() 4403 4404 if secret_store is not None: 4405 req.secret_store.CopyFrom( 4406 plumbing.convert_secret_store_to_plumbing(secret_store)) 4407 tries = 0 4408 plumbing_response = None 4409 while True: 4410 try: 4411 plumbing_response = self.stub.Update( 4412 req, 4413 metadata=self.parent.get_metadata('SecretStores.Update', 4414 req), 4415 timeout=timeout) 4416 except Exception as e: 4417 if self.parent.shouldRetry(tries, e): 4418 tries += 1 4419 self.parent.jitterSleep(tries) 4420 continue 4421 raise plumbing.convert_error_to_porcelain(e) from e 4422 break 4423 4424 resp = models.SecretStoreUpdateResponse() 4425 resp.meta = plumbing.convert_update_response_metadata_to_porcelain( 4426 plumbing_response.meta) 4427 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4428 plumbing_response.rate_limit) 4429 resp.secret_store = plumbing.convert_secret_store_to_porcelain( 4430 plumbing_response.secret_store) 4431 return resp
Update replaces all the fields of a SecretStore by ID.
4433 def delete(self, id, timeout=None): 4434 ''' 4435 Delete removes a SecretStore by ID. 4436 ''' 4437 req = SecretStoreDeleteRequest() 4438 4439 req.id = (id) 4440 tries = 0 4441 plumbing_response = None 4442 while True: 4443 try: 4444 plumbing_response = self.stub.Delete( 4445 req, 4446 metadata=self.parent.get_metadata('SecretStores.Delete', 4447 req), 4448 timeout=timeout) 4449 except Exception as e: 4450 if self.parent.shouldRetry(tries, e): 4451 tries += 1 4452 self.parent.jitterSleep(tries) 4453 continue 4454 raise plumbing.convert_error_to_porcelain(e) from e 4455 break 4456 4457 resp = models.SecretStoreDeleteResponse() 4458 resp.meta = plumbing.convert_delete_response_metadata_to_porcelain( 4459 plumbing_response.meta) 4460 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4461 plumbing_response.rate_limit) 4462 return resp
Delete removes a SecretStore by ID.
4464 def list(self, filter, *args, timeout=None): 4465 ''' 4466 List gets a list of SecretStores matching a given set of criteria. 4467 ''' 4468 req = SecretStoreListRequest() 4469 req.meta.CopyFrom(ListRequestMetadata()) 4470 if self.parent.page_limit > 0: 4471 req.meta.limit = self.parent.page_limit 4472 if self.parent.snapshot_datetime is not None: 4473 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4474 4475 req.filter = plumbing.quote_filter_args(filter, *args) 4476 4477 def generator(svc, req): 4478 tries = 0 4479 while True: 4480 try: 4481 plumbing_response = svc.stub.List( 4482 req, 4483 metadata=svc.parent.get_metadata( 4484 'SecretStores.List', req), 4485 timeout=timeout) 4486 except Exception as e: 4487 if self.parent.shouldRetry(tries, e): 4488 tries += 1 4489 self.parent.jitterSleep(tries) 4490 continue 4491 raise plumbing.convert_error_to_porcelain(e) from e 4492 tries = 0 4493 for plumbing_item in plumbing_response.secret_stores: 4494 yield plumbing.convert_secret_store_to_porcelain( 4495 plumbing_item) 4496 if plumbing_response.meta.next_cursor == '': 4497 break 4498 req.meta.cursor = plumbing_response.meta.next_cursor 4499 4500 return generator(self, req)
List gets a list of SecretStores matching a given set of criteria.
4503class SnapshotSecretStores: 4504 ''' 4505 SnapshotSecretStores exposes the read only methods of the SecretStores 4506 service for historical queries. 4507 ''' 4508 def __init__(self, secret_stores): 4509 self.secret_stores = secret_stores 4510 4511 def get(self, id, timeout=None): 4512 ''' 4513 Get reads one SecretStore by ID. 4514 ''' 4515 return self.secret_stores.get(id, timeout=timeout) 4516 4517 def list(self, filter, *args, timeout=None): 4518 ''' 4519 List gets a list of SecretStores matching a given set of criteria. 4520 ''' 4521 return self.secret_stores.list(filter, *args, timeout=timeout)
SnapshotSecretStores exposes the read only methods of the SecretStores service for historical queries.
4511 def get(self, id, timeout=None): 4512 ''' 4513 Get reads one SecretStore by ID. 4514 ''' 4515 return self.secret_stores.get(id, timeout=timeout)
Get reads one SecretStore by ID.
4517 def list(self, filter, *args, timeout=None): 4518 ''' 4519 List gets a list of SecretStores matching a given set of criteria. 4520 ''' 4521 return self.secret_stores.list(filter, *args, timeout=timeout)
List gets a list of SecretStores matching a given set of criteria.
4524class SecretStoresHistory: 4525 ''' 4526 SecretStoresHistory records all changes to the state of a SecretStore. 4527 See `strongdm.models.SecretStoreHistory`. 4528 ''' 4529 def __init__(self, channel, client): 4530 self.parent = client 4531 self.stub = SecretStoresHistoryStub(channel) 4532 4533 def list(self, filter, *args, timeout=None): 4534 ''' 4535 List gets a list of SecretStoreHistory records matching a given set of criteria. 4536 ''' 4537 req = SecretStoreHistoryListRequest() 4538 req.meta.CopyFrom(ListRequestMetadata()) 4539 if self.parent.page_limit > 0: 4540 req.meta.limit = self.parent.page_limit 4541 if self.parent.snapshot_datetime is not None: 4542 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4543 4544 req.filter = plumbing.quote_filter_args(filter, *args) 4545 4546 def generator(svc, req): 4547 tries = 0 4548 while True: 4549 try: 4550 plumbing_response = svc.stub.List( 4551 req, 4552 metadata=svc.parent.get_metadata( 4553 'SecretStoresHistory.List', req), 4554 timeout=timeout) 4555 except Exception as e: 4556 if self.parent.shouldRetry(tries, e): 4557 tries += 1 4558 self.parent.jitterSleep(tries) 4559 continue 4560 raise plumbing.convert_error_to_porcelain(e) from e 4561 tries = 0 4562 for plumbing_item in plumbing_response.history: 4563 yield plumbing.convert_secret_store_history_to_porcelain( 4564 plumbing_item) 4565 if plumbing_response.meta.next_cursor == '': 4566 break 4567 req.meta.cursor = plumbing_response.meta.next_cursor 4568 4569 return generator(self, req)
SecretStoresHistory records all changes to the state of a SecretStore.
See strongdm.models.SecretStoreHistory
.
4533 def list(self, filter, *args, timeout=None): 4534 ''' 4535 List gets a list of SecretStoreHistory records matching a given set of criteria. 4536 ''' 4537 req = SecretStoreHistoryListRequest() 4538 req.meta.CopyFrom(ListRequestMetadata()) 4539 if self.parent.page_limit > 0: 4540 req.meta.limit = self.parent.page_limit 4541 if self.parent.snapshot_datetime is not None: 4542 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4543 4544 req.filter = plumbing.quote_filter_args(filter, *args) 4545 4546 def generator(svc, req): 4547 tries = 0 4548 while True: 4549 try: 4550 plumbing_response = svc.stub.List( 4551 req, 4552 metadata=svc.parent.get_metadata( 4553 'SecretStoresHistory.List', req), 4554 timeout=timeout) 4555 except Exception as e: 4556 if self.parent.shouldRetry(tries, e): 4557 tries += 1 4558 self.parent.jitterSleep(tries) 4559 continue 4560 raise plumbing.convert_error_to_porcelain(e) from e 4561 tries = 0 4562 for plumbing_item in plumbing_response.history: 4563 yield plumbing.convert_secret_store_history_to_porcelain( 4564 plumbing_item) 4565 if plumbing_response.meta.next_cursor == '': 4566 break 4567 req.meta.cursor = plumbing_response.meta.next_cursor 4568 4569 return generator(self, req)
List gets a list of SecretStoreHistory records matching a given set of criteria.
4572class WorkflowApprovers: 4573 ''' 4574 WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow. 4575 See `strongdm.models.WorkflowApprover`. 4576 ''' 4577 def __init__(self, channel, client): 4578 self.parent = client 4579 self.stub = WorkflowApproversStub(channel) 4580 4581 def create(self, workflow_approver, timeout=None): 4582 ''' 4583 Create creates a new workflow approver 4584 ''' 4585 req = WorkflowApproversCreateRequest() 4586 4587 if workflow_approver is not None: 4588 req.workflow_approver.CopyFrom( 4589 plumbing.convert_workflow_approver_to_plumbing( 4590 workflow_approver)) 4591 tries = 0 4592 plumbing_response = None 4593 while True: 4594 try: 4595 plumbing_response = self.stub.Create( 4596 req, 4597 metadata=self.parent.get_metadata( 4598 'WorkflowApprovers.Create', req), 4599 timeout=timeout) 4600 except Exception as e: 4601 if self.parent.shouldRetry(tries, e): 4602 tries += 1 4603 self.parent.jitterSleep(tries) 4604 continue 4605 raise plumbing.convert_error_to_porcelain(e) from e 4606 break 4607 4608 resp = models.WorkflowApproversCreateResponse() 4609 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4610 plumbing_response.rate_limit) 4611 resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain( 4612 plumbing_response.workflow_approver) 4613 return resp 4614 4615 def get(self, id, timeout=None): 4616 ''' 4617 Get reads one workflow approver by ID. 4618 ''' 4619 req = WorkflowApproverGetRequest() 4620 if self.parent.snapshot_datetime is not None: 4621 req.meta.CopyFrom(GetRequestMetadata()) 4622 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4623 4624 req.id = (id) 4625 tries = 0 4626 plumbing_response = None 4627 while True: 4628 try: 4629 plumbing_response = self.stub.Get( 4630 req, 4631 metadata=self.parent.get_metadata('WorkflowApprovers.Get', 4632 req), 4633 timeout=timeout) 4634 except Exception as e: 4635 if self.parent.shouldRetry(tries, e): 4636 tries += 1 4637 self.parent.jitterSleep(tries) 4638 continue 4639 raise plumbing.convert_error_to_porcelain(e) from e 4640 break 4641 4642 resp = models.WorkflowApproverGetResponse() 4643 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4644 plumbing_response.meta) 4645 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4646 plumbing_response.rate_limit) 4647 resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain( 4648 plumbing_response.workflow_approver) 4649 return resp 4650 4651 def delete(self, id, timeout=None): 4652 ''' 4653 Delete deletes a workflow approver 4654 ''' 4655 req = WorkflowApproversDeleteRequest() 4656 4657 req.id = (id) 4658 tries = 0 4659 plumbing_response = None 4660 while True: 4661 try: 4662 plumbing_response = self.stub.Delete( 4663 req, 4664 metadata=self.parent.get_metadata( 4665 'WorkflowApprovers.Delete', req), 4666 timeout=timeout) 4667 except Exception as e: 4668 if self.parent.shouldRetry(tries, e): 4669 tries += 1 4670 self.parent.jitterSleep(tries) 4671 continue 4672 raise plumbing.convert_error_to_porcelain(e) from e 4673 break 4674 4675 resp = models.WorkflowApproversDeleteResponse() 4676 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4677 plumbing_response.rate_limit) 4678 return resp 4679 4680 def list(self, filter, *args, timeout=None): 4681 ''' 4682 Lists existing workflow approvers. 4683 ''' 4684 req = WorkflowApproversListRequest() 4685 req.meta.CopyFrom(ListRequestMetadata()) 4686 if self.parent.page_limit > 0: 4687 req.meta.limit = self.parent.page_limit 4688 if self.parent.snapshot_datetime is not None: 4689 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4690 4691 req.filter = plumbing.quote_filter_args(filter, *args) 4692 4693 def generator(svc, req): 4694 tries = 0 4695 while True: 4696 try: 4697 plumbing_response = svc.stub.List( 4698 req, 4699 metadata=svc.parent.get_metadata( 4700 'WorkflowApprovers.List', req), 4701 timeout=timeout) 4702 except Exception as e: 4703 if self.parent.shouldRetry(tries, e): 4704 tries += 1 4705 self.parent.jitterSleep(tries) 4706 continue 4707 raise plumbing.convert_error_to_porcelain(e) from e 4708 tries = 0 4709 for plumbing_item in plumbing_response.workflow_approvers: 4710 yield plumbing.convert_workflow_approver_to_porcelain( 4711 plumbing_item) 4712 if plumbing_response.meta.next_cursor == '': 4713 break 4714 req.meta.cursor = plumbing_response.meta.next_cursor 4715 4716 return generator(self, req)
WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow.
See strongdm.models.WorkflowApprover
.
4581 def create(self, workflow_approver, timeout=None): 4582 ''' 4583 Create creates a new workflow approver 4584 ''' 4585 req = WorkflowApproversCreateRequest() 4586 4587 if workflow_approver is not None: 4588 req.workflow_approver.CopyFrom( 4589 plumbing.convert_workflow_approver_to_plumbing( 4590 workflow_approver)) 4591 tries = 0 4592 plumbing_response = None 4593 while True: 4594 try: 4595 plumbing_response = self.stub.Create( 4596 req, 4597 metadata=self.parent.get_metadata( 4598 'WorkflowApprovers.Create', req), 4599 timeout=timeout) 4600 except Exception as e: 4601 if self.parent.shouldRetry(tries, e): 4602 tries += 1 4603 self.parent.jitterSleep(tries) 4604 continue 4605 raise plumbing.convert_error_to_porcelain(e) from e 4606 break 4607 4608 resp = models.WorkflowApproversCreateResponse() 4609 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4610 plumbing_response.rate_limit) 4611 resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain( 4612 plumbing_response.workflow_approver) 4613 return resp
Create creates a new workflow approver
4615 def get(self, id, timeout=None): 4616 ''' 4617 Get reads one workflow approver by ID. 4618 ''' 4619 req = WorkflowApproverGetRequest() 4620 if self.parent.snapshot_datetime is not None: 4621 req.meta.CopyFrom(GetRequestMetadata()) 4622 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4623 4624 req.id = (id) 4625 tries = 0 4626 plumbing_response = None 4627 while True: 4628 try: 4629 plumbing_response = self.stub.Get( 4630 req, 4631 metadata=self.parent.get_metadata('WorkflowApprovers.Get', 4632 req), 4633 timeout=timeout) 4634 except Exception as e: 4635 if self.parent.shouldRetry(tries, e): 4636 tries += 1 4637 self.parent.jitterSleep(tries) 4638 continue 4639 raise plumbing.convert_error_to_porcelain(e) from e 4640 break 4641 4642 resp = models.WorkflowApproverGetResponse() 4643 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4644 plumbing_response.meta) 4645 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4646 plumbing_response.rate_limit) 4647 resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain( 4648 plumbing_response.workflow_approver) 4649 return resp
Get reads one workflow approver by ID.
4651 def delete(self, id, timeout=None): 4652 ''' 4653 Delete deletes a workflow approver 4654 ''' 4655 req = WorkflowApproversDeleteRequest() 4656 4657 req.id = (id) 4658 tries = 0 4659 plumbing_response = None 4660 while True: 4661 try: 4662 plumbing_response = self.stub.Delete( 4663 req, 4664 metadata=self.parent.get_metadata( 4665 'WorkflowApprovers.Delete', req), 4666 timeout=timeout) 4667 except Exception as e: 4668 if self.parent.shouldRetry(tries, e): 4669 tries += 1 4670 self.parent.jitterSleep(tries) 4671 continue 4672 raise plumbing.convert_error_to_porcelain(e) from e 4673 break 4674 4675 resp = models.WorkflowApproversDeleteResponse() 4676 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4677 plumbing_response.rate_limit) 4678 return resp
Delete deletes a workflow approver
4680 def list(self, filter, *args, timeout=None): 4681 ''' 4682 Lists existing workflow approvers. 4683 ''' 4684 req = WorkflowApproversListRequest() 4685 req.meta.CopyFrom(ListRequestMetadata()) 4686 if self.parent.page_limit > 0: 4687 req.meta.limit = self.parent.page_limit 4688 if self.parent.snapshot_datetime is not None: 4689 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4690 4691 req.filter = plumbing.quote_filter_args(filter, *args) 4692 4693 def generator(svc, req): 4694 tries = 0 4695 while True: 4696 try: 4697 plumbing_response = svc.stub.List( 4698 req, 4699 metadata=svc.parent.get_metadata( 4700 'WorkflowApprovers.List', req), 4701 timeout=timeout) 4702 except Exception as e: 4703 if self.parent.shouldRetry(tries, e): 4704 tries += 1 4705 self.parent.jitterSleep(tries) 4706 continue 4707 raise plumbing.convert_error_to_porcelain(e) from e 4708 tries = 0 4709 for plumbing_item in plumbing_response.workflow_approvers: 4710 yield plumbing.convert_workflow_approver_to_porcelain( 4711 plumbing_item) 4712 if plumbing_response.meta.next_cursor == '': 4713 break 4714 req.meta.cursor = plumbing_response.meta.next_cursor 4715 4716 return generator(self, req)
Lists existing workflow approvers.
4719class SnapshotWorkflowApprovers: 4720 ''' 4721 SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers 4722 service for historical queries. 4723 ''' 4724 def __init__(self, workflow_approvers): 4725 self.workflow_approvers = workflow_approvers 4726 4727 def get(self, id, timeout=None): 4728 ''' 4729 Get reads one workflow approver by ID. 4730 ''' 4731 return self.workflow_approvers.get(id, timeout=timeout) 4732 4733 def list(self, filter, *args, timeout=None): 4734 ''' 4735 Lists existing workflow approvers. 4736 ''' 4737 return self.workflow_approvers.list(filter, *args, timeout=timeout)
SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers service for historical queries.
4740class WorkflowApproversHistory: 4741 ''' 4742 WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover. 4743 See `strongdm.models.WorkflowApproverHistory`. 4744 ''' 4745 def __init__(self, channel, client): 4746 self.parent = client 4747 self.stub = WorkflowApproversHistoryStub(channel) 4748 4749 def list(self, filter, *args, timeout=None): 4750 ''' 4751 List gets a list of WorkflowApproversHistory records matching a given set of criteria. 4752 ''' 4753 req = WorkflowApproversHistoryListRequest() 4754 req.meta.CopyFrom(ListRequestMetadata()) 4755 if self.parent.page_limit > 0: 4756 req.meta.limit = self.parent.page_limit 4757 if self.parent.snapshot_datetime is not None: 4758 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4759 4760 req.filter = plumbing.quote_filter_args(filter, *args) 4761 4762 def generator(svc, req): 4763 tries = 0 4764 while True: 4765 try: 4766 plumbing_response = svc.stub.List( 4767 req, 4768 metadata=svc.parent.get_metadata( 4769 'WorkflowApproversHistory.List', req), 4770 timeout=timeout) 4771 except Exception as e: 4772 if self.parent.shouldRetry(tries, e): 4773 tries += 1 4774 self.parent.jitterSleep(tries) 4775 continue 4776 raise plumbing.convert_error_to_porcelain(e) from e 4777 tries = 0 4778 for plumbing_item in plumbing_response.history: 4779 yield plumbing.convert_workflow_approver_history_to_porcelain( 4780 plumbing_item) 4781 if plumbing_response.meta.next_cursor == '': 4782 break 4783 req.meta.cursor = plumbing_response.meta.next_cursor 4784 4785 return generator(self, req)
WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover.
See strongdm.models.WorkflowApproverHistory
.
4749 def list(self, filter, *args, timeout=None): 4750 ''' 4751 List gets a list of WorkflowApproversHistory records matching a given set of criteria. 4752 ''' 4753 req = WorkflowApproversHistoryListRequest() 4754 req.meta.CopyFrom(ListRequestMetadata()) 4755 if self.parent.page_limit > 0: 4756 req.meta.limit = self.parent.page_limit 4757 if self.parent.snapshot_datetime is not None: 4758 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4759 4760 req.filter = plumbing.quote_filter_args(filter, *args) 4761 4762 def generator(svc, req): 4763 tries = 0 4764 while True: 4765 try: 4766 plumbing_response = svc.stub.List( 4767 req, 4768 metadata=svc.parent.get_metadata( 4769 'WorkflowApproversHistory.List', req), 4770 timeout=timeout) 4771 except Exception as e: 4772 if self.parent.shouldRetry(tries, e): 4773 tries += 1 4774 self.parent.jitterSleep(tries) 4775 continue 4776 raise plumbing.convert_error_to_porcelain(e) from e 4777 tries = 0 4778 for plumbing_item in plumbing_response.history: 4779 yield plumbing.convert_workflow_approver_history_to_porcelain( 4780 plumbing_item) 4781 if plumbing_response.meta.next_cursor == '': 4782 break 4783 req.meta.cursor = plumbing_response.meta.next_cursor 4784 4785 return generator(self, req)
List gets a list of WorkflowApproversHistory records matching a given set of criteria.
4788class WorkflowAssignments: 4789 ''' 4790 WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request 4791 access to via the workflow. 4792 See `strongdm.models.WorkflowAssignment`. 4793 ''' 4794 def __init__(self, channel, client): 4795 self.parent = client 4796 self.stub = WorkflowAssignmentsStub(channel) 4797 4798 def list(self, filter, *args, timeout=None): 4799 ''' 4800 Lists existing workflow assignments. 4801 ''' 4802 req = WorkflowAssignmentsListRequest() 4803 req.meta.CopyFrom(ListRequestMetadata()) 4804 if self.parent.page_limit > 0: 4805 req.meta.limit = self.parent.page_limit 4806 if self.parent.snapshot_datetime is not None: 4807 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4808 4809 req.filter = plumbing.quote_filter_args(filter, *args) 4810 4811 def generator(svc, req): 4812 tries = 0 4813 while True: 4814 try: 4815 plumbing_response = svc.stub.List( 4816 req, 4817 metadata=svc.parent.get_metadata( 4818 'WorkflowAssignments.List', req), 4819 timeout=timeout) 4820 except Exception as e: 4821 if self.parent.shouldRetry(tries, e): 4822 tries += 1 4823 self.parent.jitterSleep(tries) 4824 continue 4825 raise plumbing.convert_error_to_porcelain(e) from e 4826 tries = 0 4827 for plumbing_item in plumbing_response.workflow_assignments: 4828 yield plumbing.convert_workflow_assignment_to_porcelain( 4829 plumbing_item) 4830 if plumbing_response.meta.next_cursor == '': 4831 break 4832 req.meta.cursor = plumbing_response.meta.next_cursor 4833 4834 return generator(self, req)
WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request
access to via the workflow.
See strongdm.models.WorkflowAssignment
.
4798 def list(self, filter, *args, timeout=None): 4799 ''' 4800 Lists existing workflow assignments. 4801 ''' 4802 req = WorkflowAssignmentsListRequest() 4803 req.meta.CopyFrom(ListRequestMetadata()) 4804 if self.parent.page_limit > 0: 4805 req.meta.limit = self.parent.page_limit 4806 if self.parent.snapshot_datetime is not None: 4807 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4808 4809 req.filter = plumbing.quote_filter_args(filter, *args) 4810 4811 def generator(svc, req): 4812 tries = 0 4813 while True: 4814 try: 4815 plumbing_response = svc.stub.List( 4816 req, 4817 metadata=svc.parent.get_metadata( 4818 'WorkflowAssignments.List', req), 4819 timeout=timeout) 4820 except Exception as e: 4821 if self.parent.shouldRetry(tries, e): 4822 tries += 1 4823 self.parent.jitterSleep(tries) 4824 continue 4825 raise plumbing.convert_error_to_porcelain(e) from e 4826 tries = 0 4827 for plumbing_item in plumbing_response.workflow_assignments: 4828 yield plumbing.convert_workflow_assignment_to_porcelain( 4829 plumbing_item) 4830 if plumbing_response.meta.next_cursor == '': 4831 break 4832 req.meta.cursor = plumbing_response.meta.next_cursor 4833 4834 return generator(self, req)
Lists existing workflow assignments.
4837class SnapshotWorkflowAssignments: 4838 ''' 4839 SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments 4840 service for historical queries. 4841 ''' 4842 def __init__(self, workflow_assignments): 4843 self.workflow_assignments = workflow_assignments 4844 4845 def list(self, filter, *args, timeout=None): 4846 ''' 4847 Lists existing workflow assignments. 4848 ''' 4849 return self.workflow_assignments.list(filter, *args, timeout=timeout)
SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments service for historical queries.
4852class WorkflowAssignmentsHistory: 4853 ''' 4854 WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment. 4855 See `strongdm.models.WorkflowAssignmentHistory`. 4856 ''' 4857 def __init__(self, channel, client): 4858 self.parent = client 4859 self.stub = WorkflowAssignmentsHistoryStub(channel) 4860 4861 def list(self, filter, *args, timeout=None): 4862 ''' 4863 List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria. 4864 ''' 4865 req = WorkflowAssignmentsHistoryListRequest() 4866 req.meta.CopyFrom(ListRequestMetadata()) 4867 if self.parent.page_limit > 0: 4868 req.meta.limit = self.parent.page_limit 4869 if self.parent.snapshot_datetime is not None: 4870 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4871 4872 req.filter = plumbing.quote_filter_args(filter, *args) 4873 4874 def generator(svc, req): 4875 tries = 0 4876 while True: 4877 try: 4878 plumbing_response = svc.stub.List( 4879 req, 4880 metadata=svc.parent.get_metadata( 4881 'WorkflowAssignmentsHistory.List', req), 4882 timeout=timeout) 4883 except Exception as e: 4884 if self.parent.shouldRetry(tries, e): 4885 tries += 1 4886 self.parent.jitterSleep(tries) 4887 continue 4888 raise plumbing.convert_error_to_porcelain(e) from e 4889 tries = 0 4890 for plumbing_item in plumbing_response.history: 4891 yield plumbing.convert_workflow_assignment_history_to_porcelain( 4892 plumbing_item) 4893 if plumbing_response.meta.next_cursor == '': 4894 break 4895 req.meta.cursor = plumbing_response.meta.next_cursor 4896 4897 return generator(self, req)
WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment.
See strongdm.models.WorkflowAssignmentHistory
.
4861 def list(self, filter, *args, timeout=None): 4862 ''' 4863 List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria. 4864 ''' 4865 req = WorkflowAssignmentsHistoryListRequest() 4866 req.meta.CopyFrom(ListRequestMetadata()) 4867 if self.parent.page_limit > 0: 4868 req.meta.limit = self.parent.page_limit 4869 if self.parent.snapshot_datetime is not None: 4870 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4871 4872 req.filter = plumbing.quote_filter_args(filter, *args) 4873 4874 def generator(svc, req): 4875 tries = 0 4876 while True: 4877 try: 4878 plumbing_response = svc.stub.List( 4879 req, 4880 metadata=svc.parent.get_metadata( 4881 'WorkflowAssignmentsHistory.List', req), 4882 timeout=timeout) 4883 except Exception as e: 4884 if self.parent.shouldRetry(tries, e): 4885 tries += 1 4886 self.parent.jitterSleep(tries) 4887 continue 4888 raise plumbing.convert_error_to_porcelain(e) from e 4889 tries = 0 4890 for plumbing_item in plumbing_response.history: 4891 yield plumbing.convert_workflow_assignment_history_to_porcelain( 4892 plumbing_item) 4893 if plumbing_response.meta.next_cursor == '': 4894 break 4895 req.meta.cursor = plumbing_response.meta.next_cursor 4896 4897 return generator(self, req)
List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.
4900class WorkflowRoles: 4901 ''' 4902 WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of 4903 to request access to a resource via the workflow. 4904 See `strongdm.models.WorkflowRole`. 4905 ''' 4906 def __init__(self, channel, client): 4907 self.parent = client 4908 self.stub = WorkflowRolesStub(channel) 4909 4910 def create(self, workflow_role, timeout=None): 4911 ''' 4912 Create creates a new workflow role 4913 ''' 4914 req = WorkflowRolesCreateRequest() 4915 4916 if workflow_role is not None: 4917 req.workflow_role.CopyFrom( 4918 plumbing.convert_workflow_role_to_plumbing(workflow_role)) 4919 tries = 0 4920 plumbing_response = None 4921 while True: 4922 try: 4923 plumbing_response = self.stub.Create( 4924 req, 4925 metadata=self.parent.get_metadata('WorkflowRoles.Create', 4926 req), 4927 timeout=timeout) 4928 except Exception as e: 4929 if self.parent.shouldRetry(tries, e): 4930 tries += 1 4931 self.parent.jitterSleep(tries) 4932 continue 4933 raise plumbing.convert_error_to_porcelain(e) from e 4934 break 4935 4936 resp = models.WorkflowRolesCreateResponse() 4937 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4938 plumbing_response.rate_limit) 4939 resp.workflow_role = plumbing.convert_workflow_role_to_porcelain( 4940 plumbing_response.workflow_role) 4941 return resp 4942 4943 def get(self, id, timeout=None): 4944 ''' 4945 Get reads one workflow role by ID. 4946 ''' 4947 req = WorkflowRoleGetRequest() 4948 if self.parent.snapshot_datetime is not None: 4949 req.meta.CopyFrom(GetRequestMetadata()) 4950 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4951 4952 req.id = (id) 4953 tries = 0 4954 plumbing_response = None 4955 while True: 4956 try: 4957 plumbing_response = self.stub.Get( 4958 req, 4959 metadata=self.parent.get_metadata('WorkflowRoles.Get', 4960 req), 4961 timeout=timeout) 4962 except Exception as e: 4963 if self.parent.shouldRetry(tries, e): 4964 tries += 1 4965 self.parent.jitterSleep(tries) 4966 continue 4967 raise plumbing.convert_error_to_porcelain(e) from e 4968 break 4969 4970 resp = models.WorkflowRoleGetResponse() 4971 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4972 plumbing_response.meta) 4973 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4974 plumbing_response.rate_limit) 4975 resp.workflow_role = plumbing.convert_workflow_role_to_porcelain( 4976 plumbing_response.workflow_role) 4977 return resp 4978 4979 def delete(self, id, timeout=None): 4980 ''' 4981 Delete deletes a workflow role 4982 ''' 4983 req = WorkflowRolesDeleteRequest() 4984 4985 req.id = (id) 4986 tries = 0 4987 plumbing_response = None 4988 while True: 4989 try: 4990 plumbing_response = self.stub.Delete( 4991 req, 4992 metadata=self.parent.get_metadata('WorkflowRoles.Delete', 4993 req), 4994 timeout=timeout) 4995 except Exception as e: 4996 if self.parent.shouldRetry(tries, e): 4997 tries += 1 4998 self.parent.jitterSleep(tries) 4999 continue 5000 raise plumbing.convert_error_to_porcelain(e) from e 5001 break 5002 5003 resp = models.WorkflowRolesDeleteResponse() 5004 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5005 plumbing_response.rate_limit) 5006 return resp 5007 5008 def list(self, filter, *args, timeout=None): 5009 ''' 5010 Lists existing workflow roles. 5011 ''' 5012 req = WorkflowRolesListRequest() 5013 req.meta.CopyFrom(ListRequestMetadata()) 5014 if self.parent.page_limit > 0: 5015 req.meta.limit = self.parent.page_limit 5016 if self.parent.snapshot_datetime is not None: 5017 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5018 5019 req.filter = plumbing.quote_filter_args(filter, *args) 5020 5021 def generator(svc, req): 5022 tries = 0 5023 while True: 5024 try: 5025 plumbing_response = svc.stub.List( 5026 req, 5027 metadata=svc.parent.get_metadata( 5028 'WorkflowRoles.List', req), 5029 timeout=timeout) 5030 except Exception as e: 5031 if self.parent.shouldRetry(tries, e): 5032 tries += 1 5033 self.parent.jitterSleep(tries) 5034 continue 5035 raise plumbing.convert_error_to_porcelain(e) from e 5036 tries = 0 5037 for plumbing_item in plumbing_response.workflow_role: 5038 yield plumbing.convert_workflow_role_to_porcelain( 5039 plumbing_item) 5040 if plumbing_response.meta.next_cursor == '': 5041 break 5042 req.meta.cursor = plumbing_response.meta.next_cursor 5043 5044 return generator(self, req)
WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
to request access to a resource via the workflow.
See strongdm.models.WorkflowRole
.
4910 def create(self, workflow_role, timeout=None): 4911 ''' 4912 Create creates a new workflow role 4913 ''' 4914 req = WorkflowRolesCreateRequest() 4915 4916 if workflow_role is not None: 4917 req.workflow_role.CopyFrom( 4918 plumbing.convert_workflow_role_to_plumbing(workflow_role)) 4919 tries = 0 4920 plumbing_response = None 4921 while True: 4922 try: 4923 plumbing_response = self.stub.Create( 4924 req, 4925 metadata=self.parent.get_metadata('WorkflowRoles.Create', 4926 req), 4927 timeout=timeout) 4928 except Exception as e: 4929 if self.parent.shouldRetry(tries, e): 4930 tries += 1 4931 self.parent.jitterSleep(tries) 4932 continue 4933 raise plumbing.convert_error_to_porcelain(e) from e 4934 break 4935 4936 resp = models.WorkflowRolesCreateResponse() 4937 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4938 plumbing_response.rate_limit) 4939 resp.workflow_role = plumbing.convert_workflow_role_to_porcelain( 4940 plumbing_response.workflow_role) 4941 return resp
Create creates a new workflow role
4943 def get(self, id, timeout=None): 4944 ''' 4945 Get reads one workflow role by ID. 4946 ''' 4947 req = WorkflowRoleGetRequest() 4948 if self.parent.snapshot_datetime is not None: 4949 req.meta.CopyFrom(GetRequestMetadata()) 4950 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 4951 4952 req.id = (id) 4953 tries = 0 4954 plumbing_response = None 4955 while True: 4956 try: 4957 plumbing_response = self.stub.Get( 4958 req, 4959 metadata=self.parent.get_metadata('WorkflowRoles.Get', 4960 req), 4961 timeout=timeout) 4962 except Exception as e: 4963 if self.parent.shouldRetry(tries, e): 4964 tries += 1 4965 self.parent.jitterSleep(tries) 4966 continue 4967 raise plumbing.convert_error_to_porcelain(e) from e 4968 break 4969 4970 resp = models.WorkflowRoleGetResponse() 4971 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 4972 plumbing_response.meta) 4973 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 4974 plumbing_response.rate_limit) 4975 resp.workflow_role = plumbing.convert_workflow_role_to_porcelain( 4976 plumbing_response.workflow_role) 4977 return resp
Get reads one workflow role by ID.
4979 def delete(self, id, timeout=None): 4980 ''' 4981 Delete deletes a workflow role 4982 ''' 4983 req = WorkflowRolesDeleteRequest() 4984 4985 req.id = (id) 4986 tries = 0 4987 plumbing_response = None 4988 while True: 4989 try: 4990 plumbing_response = self.stub.Delete( 4991 req, 4992 metadata=self.parent.get_metadata('WorkflowRoles.Delete', 4993 req), 4994 timeout=timeout) 4995 except Exception as e: 4996 if self.parent.shouldRetry(tries, e): 4997 tries += 1 4998 self.parent.jitterSleep(tries) 4999 continue 5000 raise plumbing.convert_error_to_porcelain(e) from e 5001 break 5002 5003 resp = models.WorkflowRolesDeleteResponse() 5004 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5005 plumbing_response.rate_limit) 5006 return resp
Delete deletes a workflow role
5008 def list(self, filter, *args, timeout=None): 5009 ''' 5010 Lists existing workflow roles. 5011 ''' 5012 req = WorkflowRolesListRequest() 5013 req.meta.CopyFrom(ListRequestMetadata()) 5014 if self.parent.page_limit > 0: 5015 req.meta.limit = self.parent.page_limit 5016 if self.parent.snapshot_datetime is not None: 5017 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5018 5019 req.filter = plumbing.quote_filter_args(filter, *args) 5020 5021 def generator(svc, req): 5022 tries = 0 5023 while True: 5024 try: 5025 plumbing_response = svc.stub.List( 5026 req, 5027 metadata=svc.parent.get_metadata( 5028 'WorkflowRoles.List', req), 5029 timeout=timeout) 5030 except Exception as e: 5031 if self.parent.shouldRetry(tries, e): 5032 tries += 1 5033 self.parent.jitterSleep(tries) 5034 continue 5035 raise plumbing.convert_error_to_porcelain(e) from e 5036 tries = 0 5037 for plumbing_item in plumbing_response.workflow_role: 5038 yield plumbing.convert_workflow_role_to_porcelain( 5039 plumbing_item) 5040 if plumbing_response.meta.next_cursor == '': 5041 break 5042 req.meta.cursor = plumbing_response.meta.next_cursor 5043 5044 return generator(self, req)
Lists existing workflow roles.
5047class SnapshotWorkflowRoles: 5048 ''' 5049 SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles 5050 service for historical queries. 5051 ''' 5052 def __init__(self, workflow_roles): 5053 self.workflow_roles = workflow_roles 5054 5055 def get(self, id, timeout=None): 5056 ''' 5057 Get reads one workflow role by ID. 5058 ''' 5059 return self.workflow_roles.get(id, timeout=timeout) 5060 5061 def list(self, filter, *args, timeout=None): 5062 ''' 5063 Lists existing workflow roles. 5064 ''' 5065 return self.workflow_roles.list(filter, *args, timeout=timeout)
SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles service for historical queries.
5068class WorkflowRolesHistory: 5069 ''' 5070 WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole 5071 See `strongdm.models.WorkflowRoleHistory`. 5072 ''' 5073 def __init__(self, channel, client): 5074 self.parent = client 5075 self.stub = WorkflowRolesHistoryStub(channel) 5076 5077 def list(self, filter, *args, timeout=None): 5078 ''' 5079 List gets a list of WorkflowRolesHistory records matching a given set of criteria. 5080 ''' 5081 req = WorkflowRolesHistoryListRequest() 5082 req.meta.CopyFrom(ListRequestMetadata()) 5083 if self.parent.page_limit > 0: 5084 req.meta.limit = self.parent.page_limit 5085 if self.parent.snapshot_datetime is not None: 5086 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5087 5088 req.filter = plumbing.quote_filter_args(filter, *args) 5089 5090 def generator(svc, req): 5091 tries = 0 5092 while True: 5093 try: 5094 plumbing_response = svc.stub.List( 5095 req, 5096 metadata=svc.parent.get_metadata( 5097 'WorkflowRolesHistory.List', req), 5098 timeout=timeout) 5099 except Exception as e: 5100 if self.parent.shouldRetry(tries, e): 5101 tries += 1 5102 self.parent.jitterSleep(tries) 5103 continue 5104 raise plumbing.convert_error_to_porcelain(e) from e 5105 tries = 0 5106 for plumbing_item in plumbing_response.history: 5107 yield plumbing.convert_workflow_role_history_to_porcelain( 5108 plumbing_item) 5109 if plumbing_response.meta.next_cursor == '': 5110 break 5111 req.meta.cursor = plumbing_response.meta.next_cursor 5112 5113 return generator(self, req)
WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole
See strongdm.models.WorkflowRoleHistory
.
5077 def list(self, filter, *args, timeout=None): 5078 ''' 5079 List gets a list of WorkflowRolesHistory records matching a given set of criteria. 5080 ''' 5081 req = WorkflowRolesHistoryListRequest() 5082 req.meta.CopyFrom(ListRequestMetadata()) 5083 if self.parent.page_limit > 0: 5084 req.meta.limit = self.parent.page_limit 5085 if self.parent.snapshot_datetime is not None: 5086 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5087 5088 req.filter = plumbing.quote_filter_args(filter, *args) 5089 5090 def generator(svc, req): 5091 tries = 0 5092 while True: 5093 try: 5094 plumbing_response = svc.stub.List( 5095 req, 5096 metadata=svc.parent.get_metadata( 5097 'WorkflowRolesHistory.List', req), 5098 timeout=timeout) 5099 except Exception as e: 5100 if self.parent.shouldRetry(tries, e): 5101 tries += 1 5102 self.parent.jitterSleep(tries) 5103 continue 5104 raise plumbing.convert_error_to_porcelain(e) from e 5105 tries = 0 5106 for plumbing_item in plumbing_response.history: 5107 yield plumbing.convert_workflow_role_history_to_porcelain( 5108 plumbing_item) 5109 if plumbing_response.meta.next_cursor == '': 5110 break 5111 req.meta.cursor = plumbing_response.meta.next_cursor 5112 5113 return generator(self, req)
List gets a list of WorkflowRolesHistory records matching a given set of criteria.
5116class Workflows: 5117 ''' 5118 Workflows are the collection of rules that define the resources to which access can be requested, 5119 the users that can request that access, and the mechanism for approving those requests which can either 5120 be automatic approval or a set of users authorized to approve the requests. 5121 See `strongdm.models.Workflow`. 5122 ''' 5123 def __init__(self, channel, client): 5124 self.parent = client 5125 self.stub = WorkflowsStub(channel) 5126 5127 def create(self, workflow, timeout=None): 5128 ''' 5129 Create creates a new workflow and requires a name for the workflow. 5130 ''' 5131 req = WorkflowCreateRequest() 5132 5133 if workflow is not None: 5134 req.workflow.CopyFrom( 5135 plumbing.convert_workflow_to_plumbing(workflow)) 5136 tries = 0 5137 plumbing_response = None 5138 while True: 5139 try: 5140 plumbing_response = self.stub.Create( 5141 req, 5142 metadata=self.parent.get_metadata('Workflows.Create', req), 5143 timeout=timeout) 5144 except Exception as e: 5145 if self.parent.shouldRetry(tries, e): 5146 tries += 1 5147 self.parent.jitterSleep(tries) 5148 continue 5149 raise plumbing.convert_error_to_porcelain(e) from e 5150 break 5151 5152 resp = models.WorkflowCreateResponse() 5153 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5154 plumbing_response.rate_limit) 5155 resp.workflow = plumbing.convert_workflow_to_porcelain( 5156 plumbing_response.workflow) 5157 return resp 5158 5159 def get(self, id, timeout=None): 5160 ''' 5161 Get reads one workflow by ID. 5162 ''' 5163 req = WorkflowGetRequest() 5164 if self.parent.snapshot_datetime is not None: 5165 req.meta.CopyFrom(GetRequestMetadata()) 5166 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5167 5168 req.id = (id) 5169 tries = 0 5170 plumbing_response = None 5171 while True: 5172 try: 5173 plumbing_response = self.stub.Get( 5174 req, 5175 metadata=self.parent.get_metadata('Workflows.Get', req), 5176 timeout=timeout) 5177 except Exception as e: 5178 if self.parent.shouldRetry(tries, e): 5179 tries += 1 5180 self.parent.jitterSleep(tries) 5181 continue 5182 raise plumbing.convert_error_to_porcelain(e) from e 5183 break 5184 5185 resp = models.WorkflowGetResponse() 5186 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 5187 plumbing_response.meta) 5188 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5189 plumbing_response.rate_limit) 5190 resp.workflow = plumbing.convert_workflow_to_porcelain( 5191 plumbing_response.workflow) 5192 return resp 5193 5194 def delete(self, id, timeout=None): 5195 ''' 5196 Delete deletes an existing workflow. 5197 ''' 5198 req = WorkflowDeleteRequest() 5199 5200 req.id = (id) 5201 tries = 0 5202 plumbing_response = None 5203 while True: 5204 try: 5205 plumbing_response = self.stub.Delete( 5206 req, 5207 metadata=self.parent.get_metadata('Workflows.Delete', req), 5208 timeout=timeout) 5209 except Exception as e: 5210 if self.parent.shouldRetry(tries, e): 5211 tries += 1 5212 self.parent.jitterSleep(tries) 5213 continue 5214 raise plumbing.convert_error_to_porcelain(e) from e 5215 break 5216 5217 resp = models.WorkflowDeleteResponse() 5218 resp.id = (plumbing_response.id) 5219 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5220 plumbing_response.rate_limit) 5221 return resp 5222 5223 def update(self, workflow, timeout=None): 5224 ''' 5225 Update updates an existing workflow. 5226 ''' 5227 req = WorkflowUpdateRequest() 5228 5229 if workflow is not None: 5230 req.workflow.CopyFrom( 5231 plumbing.convert_workflow_to_plumbing(workflow)) 5232 tries = 0 5233 plumbing_response = None 5234 while True: 5235 try: 5236 plumbing_response = self.stub.Update( 5237 req, 5238 metadata=self.parent.get_metadata('Workflows.Update', req), 5239 timeout=timeout) 5240 except Exception as e: 5241 if self.parent.shouldRetry(tries, e): 5242 tries += 1 5243 self.parent.jitterSleep(tries) 5244 continue 5245 raise plumbing.convert_error_to_porcelain(e) from e 5246 break 5247 5248 resp = models.WorkflowUpdateResponse() 5249 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5250 plumbing_response.rate_limit) 5251 resp.workflow = plumbing.convert_workflow_to_porcelain( 5252 plumbing_response.workflow) 5253 return resp 5254 5255 def list(self, filter, *args, timeout=None): 5256 ''' 5257 Lists existing workflows. 5258 ''' 5259 req = WorkflowListRequest() 5260 req.meta.CopyFrom(ListRequestMetadata()) 5261 if self.parent.page_limit > 0: 5262 req.meta.limit = self.parent.page_limit 5263 if self.parent.snapshot_datetime is not None: 5264 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5265 5266 req.filter = plumbing.quote_filter_args(filter, *args) 5267 5268 def generator(svc, req): 5269 tries = 0 5270 while True: 5271 try: 5272 plumbing_response = svc.stub.List( 5273 req, 5274 metadata=svc.parent.get_metadata( 5275 'Workflows.List', req), 5276 timeout=timeout) 5277 except Exception as e: 5278 if self.parent.shouldRetry(tries, e): 5279 tries += 1 5280 self.parent.jitterSleep(tries) 5281 continue 5282 raise plumbing.convert_error_to_porcelain(e) from e 5283 tries = 0 5284 for plumbing_item in plumbing_response.workflows: 5285 yield plumbing.convert_workflow_to_porcelain(plumbing_item) 5286 if plumbing_response.meta.next_cursor == '': 5287 break 5288 req.meta.cursor = plumbing_response.meta.next_cursor 5289 5290 return generator(self, req)
Workflows are the collection of rules that define the resources to which access can be requested,
the users that can request that access, and the mechanism for approving those requests which can either
be automatic approval or a set of users authorized to approve the requests.
See strongdm.models.Workflow
.
5127 def create(self, workflow, timeout=None): 5128 ''' 5129 Create creates a new workflow and requires a name for the workflow. 5130 ''' 5131 req = WorkflowCreateRequest() 5132 5133 if workflow is not None: 5134 req.workflow.CopyFrom( 5135 plumbing.convert_workflow_to_plumbing(workflow)) 5136 tries = 0 5137 plumbing_response = None 5138 while True: 5139 try: 5140 plumbing_response = self.stub.Create( 5141 req, 5142 metadata=self.parent.get_metadata('Workflows.Create', req), 5143 timeout=timeout) 5144 except Exception as e: 5145 if self.parent.shouldRetry(tries, e): 5146 tries += 1 5147 self.parent.jitterSleep(tries) 5148 continue 5149 raise plumbing.convert_error_to_porcelain(e) from e 5150 break 5151 5152 resp = models.WorkflowCreateResponse() 5153 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5154 plumbing_response.rate_limit) 5155 resp.workflow = plumbing.convert_workflow_to_porcelain( 5156 plumbing_response.workflow) 5157 return resp
Create creates a new workflow and requires a name for the workflow.
5159 def get(self, id, timeout=None): 5160 ''' 5161 Get reads one workflow by ID. 5162 ''' 5163 req = WorkflowGetRequest() 5164 if self.parent.snapshot_datetime is not None: 5165 req.meta.CopyFrom(GetRequestMetadata()) 5166 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5167 5168 req.id = (id) 5169 tries = 0 5170 plumbing_response = None 5171 while True: 5172 try: 5173 plumbing_response = self.stub.Get( 5174 req, 5175 metadata=self.parent.get_metadata('Workflows.Get', req), 5176 timeout=timeout) 5177 except Exception as e: 5178 if self.parent.shouldRetry(tries, e): 5179 tries += 1 5180 self.parent.jitterSleep(tries) 5181 continue 5182 raise plumbing.convert_error_to_porcelain(e) from e 5183 break 5184 5185 resp = models.WorkflowGetResponse() 5186 resp.meta = plumbing.convert_get_response_metadata_to_porcelain( 5187 plumbing_response.meta) 5188 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5189 plumbing_response.rate_limit) 5190 resp.workflow = plumbing.convert_workflow_to_porcelain( 5191 plumbing_response.workflow) 5192 return resp
Get reads one workflow by ID.
5194 def delete(self, id, timeout=None): 5195 ''' 5196 Delete deletes an existing workflow. 5197 ''' 5198 req = WorkflowDeleteRequest() 5199 5200 req.id = (id) 5201 tries = 0 5202 plumbing_response = None 5203 while True: 5204 try: 5205 plumbing_response = self.stub.Delete( 5206 req, 5207 metadata=self.parent.get_metadata('Workflows.Delete', req), 5208 timeout=timeout) 5209 except Exception as e: 5210 if self.parent.shouldRetry(tries, e): 5211 tries += 1 5212 self.parent.jitterSleep(tries) 5213 continue 5214 raise plumbing.convert_error_to_porcelain(e) from e 5215 break 5216 5217 resp = models.WorkflowDeleteResponse() 5218 resp.id = (plumbing_response.id) 5219 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5220 plumbing_response.rate_limit) 5221 return resp
Delete deletes an existing workflow.
5223 def update(self, workflow, timeout=None): 5224 ''' 5225 Update updates an existing workflow. 5226 ''' 5227 req = WorkflowUpdateRequest() 5228 5229 if workflow is not None: 5230 req.workflow.CopyFrom( 5231 plumbing.convert_workflow_to_plumbing(workflow)) 5232 tries = 0 5233 plumbing_response = None 5234 while True: 5235 try: 5236 plumbing_response = self.stub.Update( 5237 req, 5238 metadata=self.parent.get_metadata('Workflows.Update', req), 5239 timeout=timeout) 5240 except Exception as e: 5241 if self.parent.shouldRetry(tries, e): 5242 tries += 1 5243 self.parent.jitterSleep(tries) 5244 continue 5245 raise plumbing.convert_error_to_porcelain(e) from e 5246 break 5247 5248 resp = models.WorkflowUpdateResponse() 5249 resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain( 5250 plumbing_response.rate_limit) 5251 resp.workflow = plumbing.convert_workflow_to_porcelain( 5252 plumbing_response.workflow) 5253 return resp
Update updates an existing workflow.
5255 def list(self, filter, *args, timeout=None): 5256 ''' 5257 Lists existing workflows. 5258 ''' 5259 req = WorkflowListRequest() 5260 req.meta.CopyFrom(ListRequestMetadata()) 5261 if self.parent.page_limit > 0: 5262 req.meta.limit = self.parent.page_limit 5263 if self.parent.snapshot_datetime is not None: 5264 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5265 5266 req.filter = plumbing.quote_filter_args(filter, *args) 5267 5268 def generator(svc, req): 5269 tries = 0 5270 while True: 5271 try: 5272 plumbing_response = svc.stub.List( 5273 req, 5274 metadata=svc.parent.get_metadata( 5275 'Workflows.List', req), 5276 timeout=timeout) 5277 except Exception as e: 5278 if self.parent.shouldRetry(tries, e): 5279 tries += 1 5280 self.parent.jitterSleep(tries) 5281 continue 5282 raise plumbing.convert_error_to_porcelain(e) from e 5283 tries = 0 5284 for plumbing_item in plumbing_response.workflows: 5285 yield plumbing.convert_workflow_to_porcelain(plumbing_item) 5286 if plumbing_response.meta.next_cursor == '': 5287 break 5288 req.meta.cursor = plumbing_response.meta.next_cursor 5289 5290 return generator(self, req)
Lists existing workflows.
5293class SnapshotWorkflows: 5294 ''' 5295 SnapshotWorkflows exposes the read only methods of the Workflows 5296 service for historical queries. 5297 ''' 5298 def __init__(self, workflows): 5299 self.workflows = workflows 5300 5301 def get(self, id, timeout=None): 5302 ''' 5303 Get reads one workflow by ID. 5304 ''' 5305 return self.workflows.get(id, timeout=timeout) 5306 5307 def list(self, filter, *args, timeout=None): 5308 ''' 5309 Lists existing workflows. 5310 ''' 5311 return self.workflows.list(filter, *args, timeout=timeout)
SnapshotWorkflows exposes the read only methods of the Workflows service for historical queries.
5314class WorkflowsHistory: 5315 ''' 5316 WorkflowsHistory provides records of all changes to the state of a Workflow. 5317 See `strongdm.models.WorkflowHistory`. 5318 ''' 5319 def __init__(self, channel, client): 5320 self.parent = client 5321 self.stub = WorkflowsHistoryStub(channel) 5322 5323 def list(self, filter, *args, timeout=None): 5324 ''' 5325 List gets a list of WorkflowHistory records matching a given set of criteria. 5326 ''' 5327 req = WorkflowHistoryListRequest() 5328 req.meta.CopyFrom(ListRequestMetadata()) 5329 if self.parent.page_limit > 0: 5330 req.meta.limit = self.parent.page_limit 5331 if self.parent.snapshot_datetime is not None: 5332 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5333 5334 req.filter = plumbing.quote_filter_args(filter, *args) 5335 5336 def generator(svc, req): 5337 tries = 0 5338 while True: 5339 try: 5340 plumbing_response = svc.stub.List( 5341 req, 5342 metadata=svc.parent.get_metadata( 5343 'WorkflowsHistory.List', req), 5344 timeout=timeout) 5345 except Exception as e: 5346 if self.parent.shouldRetry(tries, e): 5347 tries += 1 5348 self.parent.jitterSleep(tries) 5349 continue 5350 raise plumbing.convert_error_to_porcelain(e) from e 5351 tries = 0 5352 for plumbing_item in plumbing_response.history: 5353 yield plumbing.convert_workflow_history_to_porcelain( 5354 plumbing_item) 5355 if plumbing_response.meta.next_cursor == '': 5356 break 5357 req.meta.cursor = plumbing_response.meta.next_cursor 5358 5359 return generator(self, req)
WorkflowsHistory provides records of all changes to the state of a Workflow.
See strongdm.models.WorkflowHistory
.
5323 def list(self, filter, *args, timeout=None): 5324 ''' 5325 List gets a list of WorkflowHistory records matching a given set of criteria. 5326 ''' 5327 req = WorkflowHistoryListRequest() 5328 req.meta.CopyFrom(ListRequestMetadata()) 5329 if self.parent.page_limit > 0: 5330 req.meta.limit = self.parent.page_limit 5331 if self.parent.snapshot_datetime is not None: 5332 req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime) 5333 5334 req.filter = plumbing.quote_filter_args(filter, *args) 5335 5336 def generator(svc, req): 5337 tries = 0 5338 while True: 5339 try: 5340 plumbing_response = svc.stub.List( 5341 req, 5342 metadata=svc.parent.get_metadata( 5343 'WorkflowsHistory.List', req), 5344 timeout=timeout) 5345 except Exception as e: 5346 if self.parent.shouldRetry(tries, e): 5347 tries += 1 5348 self.parent.jitterSleep(tries) 5349 continue 5350 raise plumbing.convert_error_to_porcelain(e) from e 5351 tries = 0 5352 for plumbing_item in plumbing_response.history: 5353 yield plumbing.convert_workflow_history_to_porcelain( 5354 plumbing_item) 5355 if plumbing_response.meta.next_cursor == '': 5356 break 5357 req.meta.cursor = plumbing_response.meta.next_cursor 5358 5359 return generator(self, req)
List gets a list of WorkflowHistory records matching a given set of criteria.