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 .health_checks_pb2 import *
  70from .health_checks_pb2_grpc import *
  71from .identity_aliases_pb2 import *
  72from .identity_aliases_pb2_grpc import *
  73from .identity_aliases_history_pb2 import *
  74from .identity_aliases_history_pb2_grpc import *
  75from .identity_sets_pb2 import *
  76from .identity_sets_pb2_grpc import *
  77from .identity_sets_history_pb2 import *
  78from .identity_sets_history_pb2_grpc import *
  79from .nodes_pb2 import *
  80from .nodes_pb2_grpc import *
  81from .nodes_history_pb2 import *
  82from .nodes_history_pb2_grpc import *
  83from .organization_history_pb2 import *
  84from .organization_history_pb2_grpc import *
  85from .peering_group_nodes_pb2 import *
  86from .peering_group_nodes_pb2_grpc import *
  87from .peering_group_peers_pb2 import *
  88from .peering_group_peers_pb2_grpc import *
  89from .peering_group_resources_pb2 import *
  90from .peering_group_resources_pb2_grpc import *
  91from .peering_groups_pb2 import *
  92from .peering_groups_pb2_grpc import *
  93from .policies_pb2 import *
  94from .policies_pb2_grpc import *
  95from .policies_history_pb2 import *
  96from .policies_history_pb2_grpc import *
  97from .proxy_cluster_keys_pb2 import *
  98from .proxy_cluster_keys_pb2_grpc import *
  99from .queries_pb2 import *
 100from .queries_pb2_grpc import *
 101from .remote_identities_pb2 import *
 102from .remote_identities_pb2_grpc import *
 103from .remote_identities_history_pb2 import *
 104from .remote_identities_history_pb2_grpc import *
 105from .remote_identity_groups_pb2 import *
 106from .remote_identity_groups_pb2_grpc import *
 107from .remote_identity_groups_history_pb2 import *
 108from .remote_identity_groups_history_pb2_grpc import *
 109from .replays_pb2 import *
 110from .replays_pb2_grpc import *
 111from .resources_pb2 import *
 112from .resources_pb2_grpc import *
 113from .resources_history_pb2 import *
 114from .resources_history_pb2_grpc import *
 115from .role_resources_pb2 import *
 116from .role_resources_pb2_grpc import *
 117from .role_resources_history_pb2 import *
 118from .role_resources_history_pb2_grpc import *
 119from .roles_pb2 import *
 120from .roles_pb2_grpc import *
 121from .roles_history_pb2 import *
 122from .roles_history_pb2_grpc import *
 123from .secret_store_types_pb2 import *
 124from .secret_store_types_pb2_grpc import *
 125from .secret_stores_pb2 import *
 126from .secret_stores_pb2_grpc import *
 127from .secret_store_healths_pb2 import *
 128from .secret_store_healths_pb2_grpc import *
 129from .secret_stores_history_pb2 import *
 130from .secret_stores_history_pb2_grpc import *
 131from .workflow_approvers_pb2 import *
 132from .workflow_approvers_pb2_grpc import *
 133from .workflow_approvers_history_pb2 import *
 134from .workflow_approvers_history_pb2_grpc import *
 135from .workflow_assignments_pb2 import *
 136from .workflow_assignments_pb2_grpc import *
 137from .workflow_assignments_history_pb2 import *
 138from .workflow_assignments_history_pb2_grpc import *
 139from .workflow_roles_pb2 import *
 140from .workflow_roles_pb2_grpc import *
 141from .workflow_roles_history_pb2 import *
 142from .workflow_roles_history_pb2_grpc import *
 143from .workflows_pb2 import *
 144from .workflows_pb2_grpc import *
 145from .workflows_history_pb2 import *
 146from .workflows_history_pb2_grpc import *
 147import warnings
 148import functools
 149
 150
 151def deprecated(func):
 152    """This is a decorator which can be used to mark functions
 153    as deprecated. It will result in a warning being emitted
 154    when the function is used."""
 155    @functools.wraps(func)
 156    def new_func(*args, **kwargs):
 157        warnings.warn("Call to deprecated function {}.".format(func.__name__),
 158                      category=DeprecationWarning,
 159                      stacklevel=2)
 160        return func(*args, **kwargs)
 161
 162    return new_func
 163
 164
 165class AccessRequests:
 166    '''
 167     AccessRequests are requests for access to a resource that may match a Workflow.
 168    See `strongdm.models.AccessRequest`.
 169    '''
 170    def __init__(self, channel, client):
 171        self.parent = client
 172        self.stub = AccessRequestsStub(channel)
 173
 174    def list(self, filter, *args, timeout=None):
 175        '''
 176         Lists existing access requests.
 177        '''
 178        req = AccessRequestListRequest()
 179        req.meta.CopyFrom(ListRequestMetadata())
 180        if self.parent.page_limit > 0:
 181            req.meta.limit = self.parent.page_limit
 182        if self.parent.snapshot_datetime is not None:
 183            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 184
 185        req.filter = plumbing.quote_filter_args(filter, *args)
 186
 187        def generator(svc, req):
 188            tries = 0
 189            while True:
 190                try:
 191                    plumbing_response = svc.stub.List(
 192                        req,
 193                        metadata=svc.parent.get_metadata(
 194                            'AccessRequests.List', req),
 195                        timeout=timeout)
 196                except Exception as e:
 197                    if self.parent.shouldRetry(tries, e):
 198                        tries += 1
 199                        self.parent.jitterSleep(tries)
 200                        continue
 201                    raise plumbing.convert_error_to_porcelain(e) from e
 202                tries = 0
 203                for plumbing_item in plumbing_response.access_requests:
 204                    yield plumbing.convert_access_request_to_porcelain(
 205                        plumbing_item)
 206                if plumbing_response.meta.next_cursor == '':
 207                    break
 208                req.meta.cursor = plumbing_response.meta.next_cursor
 209
 210        return generator(self, req)
 211
 212
 213class SnapshotAccessRequests:
 214    '''
 215    SnapshotAccessRequests exposes the read only methods of the AccessRequests
 216    service for historical queries.
 217    '''
 218    def __init__(self, access_requests):
 219        self.access_requests = access_requests
 220
 221    def list(self, filter, *args, timeout=None):
 222        '''
 223         Lists existing access requests.
 224        '''
 225        return self.access_requests.list(filter, *args, timeout=timeout)
 226
 227
 228class AccessRequestEventsHistory:
 229    '''
 230     AccessRequestEventsHistory provides records of all changes to the state of an AccessRequest.
 231    See `strongdm.models.AccessRequestEventHistory`.
 232    '''
 233    def __init__(self, channel, client):
 234        self.parent = client
 235        self.stub = AccessRequestEventsHistoryStub(channel)
 236
 237    def list(self, filter, *args, timeout=None):
 238        '''
 239         List gets a list of AccessRequestEventHistory records matching a given set of criteria.
 240        '''
 241        req = AccessRequestEventHistoryListRequest()
 242        req.meta.CopyFrom(ListRequestMetadata())
 243        if self.parent.page_limit > 0:
 244            req.meta.limit = self.parent.page_limit
 245        if self.parent.snapshot_datetime is not None:
 246            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 247
 248        req.filter = plumbing.quote_filter_args(filter, *args)
 249
 250        def generator(svc, req):
 251            tries = 0
 252            while True:
 253                try:
 254                    plumbing_response = svc.stub.List(
 255                        req,
 256                        metadata=svc.parent.get_metadata(
 257                            'AccessRequestEventsHistory.List', req),
 258                        timeout=timeout)
 259                except Exception as e:
 260                    if self.parent.shouldRetry(tries, e):
 261                        tries += 1
 262                        self.parent.jitterSleep(tries)
 263                        continue
 264                    raise plumbing.convert_error_to_porcelain(e) from e
 265                tries = 0
 266                for plumbing_item in plumbing_response.history:
 267                    yield plumbing.convert_access_request_event_history_to_porcelain(
 268                        plumbing_item)
 269                if plumbing_response.meta.next_cursor == '':
 270                    break
 271                req.meta.cursor = plumbing_response.meta.next_cursor
 272
 273        return generator(self, req)
 274
 275
 276class AccessRequestsHistory:
 277    '''
 278     AccessRequestsHistory provides records of all changes to the state of an AccessRequest.
 279    See `strongdm.models.AccessRequestHistory`.
 280    '''
 281    def __init__(self, channel, client):
 282        self.parent = client
 283        self.stub = AccessRequestsHistoryStub(channel)
 284
 285    def list(self, filter, *args, timeout=None):
 286        '''
 287         List gets a list of AccessRequestHistory records matching a given set of criteria.
 288        '''
 289        req = AccessRequestHistoryListRequest()
 290        req.meta.CopyFrom(ListRequestMetadata())
 291        if self.parent.page_limit > 0:
 292            req.meta.limit = self.parent.page_limit
 293        if self.parent.snapshot_datetime is not None:
 294            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 295
 296        req.filter = plumbing.quote_filter_args(filter, *args)
 297
 298        def generator(svc, req):
 299            tries = 0
 300            while True:
 301                try:
 302                    plumbing_response = svc.stub.List(
 303                        req,
 304                        metadata=svc.parent.get_metadata(
 305                            'AccessRequestsHistory.List', req),
 306                        timeout=timeout)
 307                except Exception as e:
 308                    if self.parent.shouldRetry(tries, e):
 309                        tries += 1
 310                        self.parent.jitterSleep(tries)
 311                        continue
 312                    raise plumbing.convert_error_to_porcelain(e) from e
 313                tries = 0
 314                for plumbing_item in plumbing_response.history:
 315                    yield plumbing.convert_access_request_history_to_porcelain(
 316                        plumbing_item)
 317                if plumbing_response.meta.next_cursor == '':
 318                    break
 319                req.meta.cursor = plumbing_response.meta.next_cursor
 320
 321        return generator(self, req)
 322
 323
 324class AccountAttachments:
 325    '''
 326     AccountAttachments assign an account to a role.
 327    See `strongdm.models.AccountAttachment`.
 328    '''
 329    def __init__(self, channel, client):
 330        self.parent = client
 331        self.stub = AccountAttachmentsStub(channel)
 332
 333    def create(self, account_attachment, timeout=None):
 334        '''
 335         Create registers a new AccountAttachment.
 336        '''
 337        req = AccountAttachmentCreateRequest()
 338
 339        if account_attachment is not None:
 340            req.account_attachment.CopyFrom(
 341                plumbing.convert_account_attachment_to_plumbing(
 342                    account_attachment))
 343        tries = 0
 344        plumbing_response = None
 345        while True:
 346            try:
 347                plumbing_response = self.stub.Create(
 348                    req,
 349                    metadata=self.parent.get_metadata(
 350                        'AccountAttachments.Create', req),
 351                    timeout=timeout)
 352            except Exception as e:
 353                if self.parent.shouldRetry(tries, e):
 354                    tries += 1
 355                    self.parent.jitterSleep(tries)
 356                    continue
 357                raise plumbing.convert_error_to_porcelain(e) from e
 358            break
 359
 360        resp = models.AccountAttachmentCreateResponse()
 361        resp.account_attachment = plumbing.convert_account_attachment_to_porcelain(
 362            plumbing_response.account_attachment)
 363        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
 364            plumbing_response.meta)
 365        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 366            plumbing_response.rate_limit)
 367        return resp
 368
 369    def get(self, id, timeout=None):
 370        '''
 371         Get reads one AccountAttachment by ID.
 372        '''
 373        req = AccountAttachmentGetRequest()
 374        if self.parent.snapshot_datetime is not None:
 375            req.meta.CopyFrom(GetRequestMetadata())
 376            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 377
 378        req.id = (id)
 379        tries = 0
 380        plumbing_response = None
 381        while True:
 382            try:
 383                plumbing_response = self.stub.Get(
 384                    req,
 385                    metadata=self.parent.get_metadata('AccountAttachments.Get',
 386                                                      req),
 387                    timeout=timeout)
 388            except Exception as e:
 389                if self.parent.shouldRetry(tries, e):
 390                    tries += 1
 391                    self.parent.jitterSleep(tries)
 392                    continue
 393                raise plumbing.convert_error_to_porcelain(e) from e
 394            break
 395
 396        resp = models.AccountAttachmentGetResponse()
 397        resp.account_attachment = plumbing.convert_account_attachment_to_porcelain(
 398            plumbing_response.account_attachment)
 399        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
 400            plumbing_response.meta)
 401        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 402            plumbing_response.rate_limit)
 403        return resp
 404
 405    def delete(self, id, timeout=None):
 406        '''
 407         Delete removes a AccountAttachment by ID.
 408        '''
 409        req = AccountAttachmentDeleteRequest()
 410
 411        req.id = (id)
 412        tries = 0
 413        plumbing_response = None
 414        while True:
 415            try:
 416                plumbing_response = self.stub.Delete(
 417                    req,
 418                    metadata=self.parent.get_metadata(
 419                        'AccountAttachments.Delete', req),
 420                    timeout=timeout)
 421            except Exception as e:
 422                if self.parent.shouldRetry(tries, e):
 423                    tries += 1
 424                    self.parent.jitterSleep(tries)
 425                    continue
 426                raise plumbing.convert_error_to_porcelain(e) from e
 427            break
 428
 429        resp = models.AccountAttachmentDeleteResponse()
 430        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
 431            plumbing_response.meta)
 432        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 433            plumbing_response.rate_limit)
 434        return resp
 435
 436    def list(self, filter, *args, timeout=None):
 437        '''
 438         List gets a list of AccountAttachments matching a given set of criteria.
 439        '''
 440        req = AccountAttachmentListRequest()
 441        req.meta.CopyFrom(ListRequestMetadata())
 442        if self.parent.page_limit > 0:
 443            req.meta.limit = self.parent.page_limit
 444        if self.parent.snapshot_datetime is not None:
 445            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 446
 447        req.filter = plumbing.quote_filter_args(filter, *args)
 448
 449        def generator(svc, req):
 450            tries = 0
 451            while True:
 452                try:
 453                    plumbing_response = svc.stub.List(
 454                        req,
 455                        metadata=svc.parent.get_metadata(
 456                            'AccountAttachments.List', req),
 457                        timeout=timeout)
 458                except Exception as e:
 459                    if self.parent.shouldRetry(tries, e):
 460                        tries += 1
 461                        self.parent.jitterSleep(tries)
 462                        continue
 463                    raise plumbing.convert_error_to_porcelain(e) from e
 464                tries = 0
 465                for plumbing_item in plumbing_response.account_attachments:
 466                    yield plumbing.convert_account_attachment_to_porcelain(
 467                        plumbing_item)
 468                if plumbing_response.meta.next_cursor == '':
 469                    break
 470                req.meta.cursor = plumbing_response.meta.next_cursor
 471
 472        return generator(self, req)
 473
 474
 475class SnapshotAccountAttachments:
 476    '''
 477    SnapshotAccountAttachments exposes the read only methods of the AccountAttachments
 478    service for historical queries.
 479    '''
 480    def __init__(self, account_attachments):
 481        self.account_attachments = account_attachments
 482
 483    def get(self, id, timeout=None):
 484        '''
 485         Get reads one AccountAttachment by ID.
 486        '''
 487        return self.account_attachments.get(id, timeout=timeout)
 488
 489    def list(self, filter, *args, timeout=None):
 490        '''
 491         List gets a list of AccountAttachments matching a given set of criteria.
 492        '''
 493        return self.account_attachments.list(filter, *args, timeout=timeout)
 494
 495
 496class AccountAttachmentsHistory:
 497    '''
 498     AccountAttachmentsHistory records all changes to the state of an AccountAttachment.
 499    See `strongdm.models.AccountAttachmentHistory`.
 500    '''
 501    def __init__(self, channel, client):
 502        self.parent = client
 503        self.stub = AccountAttachmentsHistoryStub(channel)
 504
 505    def list(self, filter, *args, timeout=None):
 506        '''
 507         List gets a list of AccountAttachmentHistory records matching a given set of criteria.
 508        '''
 509        req = AccountAttachmentHistoryListRequest()
 510        req.meta.CopyFrom(ListRequestMetadata())
 511        if self.parent.page_limit > 0:
 512            req.meta.limit = self.parent.page_limit
 513        if self.parent.snapshot_datetime is not None:
 514            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 515
 516        req.filter = plumbing.quote_filter_args(filter, *args)
 517
 518        def generator(svc, req):
 519            tries = 0
 520            while True:
 521                try:
 522                    plumbing_response = svc.stub.List(
 523                        req,
 524                        metadata=svc.parent.get_metadata(
 525                            'AccountAttachmentsHistory.List', req),
 526                        timeout=timeout)
 527                except Exception as e:
 528                    if self.parent.shouldRetry(tries, e):
 529                        tries += 1
 530                        self.parent.jitterSleep(tries)
 531                        continue
 532                    raise plumbing.convert_error_to_porcelain(e) from e
 533                tries = 0
 534                for plumbing_item in plumbing_response.history:
 535                    yield plumbing.convert_account_attachment_history_to_porcelain(
 536                        plumbing_item)
 537                if plumbing_response.meta.next_cursor == '':
 538                    break
 539                req.meta.cursor = plumbing_response.meta.next_cursor
 540
 541        return generator(self, req)
 542
 543
 544class AccountGrants:
 545    '''
 546     AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
 547    See `strongdm.models.AccountGrant`.
 548    '''
 549    def __init__(self, channel, client):
 550        self.parent = client
 551        self.stub = AccountGrantsStub(channel)
 552
 553    def create(self, account_grant, timeout=None):
 554        '''
 555         Create registers a new AccountGrant.
 556        '''
 557        req = AccountGrantCreateRequest()
 558
 559        if account_grant is not None:
 560            req.account_grant.CopyFrom(
 561                plumbing.convert_account_grant_to_plumbing(account_grant))
 562        tries = 0
 563        plumbing_response = None
 564        while True:
 565            try:
 566                plumbing_response = self.stub.Create(
 567                    req,
 568                    metadata=self.parent.get_metadata('AccountGrants.Create',
 569                                                      req),
 570                    timeout=timeout)
 571            except Exception as e:
 572                if self.parent.shouldRetry(tries, e):
 573                    tries += 1
 574                    self.parent.jitterSleep(tries)
 575                    continue
 576                raise plumbing.convert_error_to_porcelain(e) from e
 577            break
 578
 579        resp = models.AccountGrantCreateResponse()
 580        resp.account_grant = plumbing.convert_account_grant_to_porcelain(
 581            plumbing_response.account_grant)
 582        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
 583            plumbing_response.meta)
 584        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 585            plumbing_response.rate_limit)
 586        return resp
 587
 588    def get(self, id, timeout=None):
 589        '''
 590         Get reads one AccountGrant by ID.
 591        '''
 592        req = AccountGrantGetRequest()
 593        if self.parent.snapshot_datetime is not None:
 594            req.meta.CopyFrom(GetRequestMetadata())
 595            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 596
 597        req.id = (id)
 598        tries = 0
 599        plumbing_response = None
 600        while True:
 601            try:
 602                plumbing_response = self.stub.Get(
 603                    req,
 604                    metadata=self.parent.get_metadata('AccountGrants.Get',
 605                                                      req),
 606                    timeout=timeout)
 607            except Exception as e:
 608                if self.parent.shouldRetry(tries, e):
 609                    tries += 1
 610                    self.parent.jitterSleep(tries)
 611                    continue
 612                raise plumbing.convert_error_to_porcelain(e) from e
 613            break
 614
 615        resp = models.AccountGrantGetResponse()
 616        resp.account_grant = plumbing.convert_account_grant_to_porcelain(
 617            plumbing_response.account_grant)
 618        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
 619            plumbing_response.meta)
 620        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 621            plumbing_response.rate_limit)
 622        return resp
 623
 624    def delete(self, id, timeout=None):
 625        '''
 626         Delete removes a AccountGrant by ID.
 627        '''
 628        req = AccountGrantDeleteRequest()
 629
 630        req.id = (id)
 631        tries = 0
 632        plumbing_response = None
 633        while True:
 634            try:
 635                plumbing_response = self.stub.Delete(
 636                    req,
 637                    metadata=self.parent.get_metadata('AccountGrants.Delete',
 638                                                      req),
 639                    timeout=timeout)
 640            except Exception as e:
 641                if self.parent.shouldRetry(tries, e):
 642                    tries += 1
 643                    self.parent.jitterSleep(tries)
 644                    continue
 645                raise plumbing.convert_error_to_porcelain(e) from e
 646            break
 647
 648        resp = models.AccountGrantDeleteResponse()
 649        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
 650            plumbing_response.meta)
 651        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 652            plumbing_response.rate_limit)
 653        return resp
 654
 655    def list(self, filter, *args, timeout=None):
 656        '''
 657         List gets a list of AccountGrants matching a given set of criteria.
 658        '''
 659        req = AccountGrantListRequest()
 660        req.meta.CopyFrom(ListRequestMetadata())
 661        if self.parent.page_limit > 0:
 662            req.meta.limit = self.parent.page_limit
 663        if self.parent.snapshot_datetime is not None:
 664            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 665
 666        req.filter = plumbing.quote_filter_args(filter, *args)
 667
 668        def generator(svc, req):
 669            tries = 0
 670            while True:
 671                try:
 672                    plumbing_response = svc.stub.List(
 673                        req,
 674                        metadata=svc.parent.get_metadata(
 675                            'AccountGrants.List', req),
 676                        timeout=timeout)
 677                except Exception as e:
 678                    if self.parent.shouldRetry(tries, e):
 679                        tries += 1
 680                        self.parent.jitterSleep(tries)
 681                        continue
 682                    raise plumbing.convert_error_to_porcelain(e) from e
 683                tries = 0
 684                for plumbing_item in plumbing_response.account_grants:
 685                    yield plumbing.convert_account_grant_to_porcelain(
 686                        plumbing_item)
 687                if plumbing_response.meta.next_cursor == '':
 688                    break
 689                req.meta.cursor = plumbing_response.meta.next_cursor
 690
 691        return generator(self, req)
 692
 693
 694class SnapshotAccountGrants:
 695    '''
 696    SnapshotAccountGrants exposes the read only methods of the AccountGrants
 697    service for historical queries.
 698    '''
 699    def __init__(self, account_grants):
 700        self.account_grants = account_grants
 701
 702    def get(self, id, timeout=None):
 703        '''
 704         Get reads one AccountGrant by ID.
 705        '''
 706        return self.account_grants.get(id, timeout=timeout)
 707
 708    def list(self, filter, *args, timeout=None):
 709        '''
 710         List gets a list of AccountGrants matching a given set of criteria.
 711        '''
 712        return self.account_grants.list(filter, *args, timeout=timeout)
 713
 714
 715class AccountGrantsHistory:
 716    '''
 717     AccountGrantsHistory records all changes to the state of an AccountGrant.
 718    See `strongdm.models.AccountGrantHistory`.
 719    '''
 720    def __init__(self, channel, client):
 721        self.parent = client
 722        self.stub = AccountGrantsHistoryStub(channel)
 723
 724    def list(self, filter, *args, timeout=None):
 725        '''
 726         List gets a list of AccountGrantHistory records matching a given set of criteria.
 727        '''
 728        req = AccountGrantHistoryListRequest()
 729        req.meta.CopyFrom(ListRequestMetadata())
 730        if self.parent.page_limit > 0:
 731            req.meta.limit = self.parent.page_limit
 732        if self.parent.snapshot_datetime is not None:
 733            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 734
 735        req.filter = plumbing.quote_filter_args(filter, *args)
 736
 737        def generator(svc, req):
 738            tries = 0
 739            while True:
 740                try:
 741                    plumbing_response = svc.stub.List(
 742                        req,
 743                        metadata=svc.parent.get_metadata(
 744                            'AccountGrantsHistory.List', req),
 745                        timeout=timeout)
 746                except Exception as e:
 747                    if self.parent.shouldRetry(tries, e):
 748                        tries += 1
 749                        self.parent.jitterSleep(tries)
 750                        continue
 751                    raise plumbing.convert_error_to_porcelain(e) from e
 752                tries = 0
 753                for plumbing_item in plumbing_response.history:
 754                    yield plumbing.convert_account_grant_history_to_porcelain(
 755                        plumbing_item)
 756                if plumbing_response.meta.next_cursor == '':
 757                    break
 758                req.meta.cursor = plumbing_response.meta.next_cursor
 759
 760        return generator(self, req)
 761
 762
 763class AccountPermissions:
 764    '''
 765     AccountPermissions records the granular permissions accounts have, allowing them to execute
 766     relevant commands via StrongDM's APIs.
 767    See `strongdm.models.AccountPermission`.
 768    '''
 769    def __init__(self, channel, client):
 770        self.parent = client
 771        self.stub = AccountPermissionsStub(channel)
 772
 773    def list(self, filter, *args, timeout=None):
 774        '''
 775         List gets a list of Permission records matching a given set of criteria.
 776        '''
 777        req = AccountPermissionListRequest()
 778        req.meta.CopyFrom(ListRequestMetadata())
 779        if self.parent.page_limit > 0:
 780            req.meta.limit = self.parent.page_limit
 781        if self.parent.snapshot_datetime is not None:
 782            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 783
 784        req.filter = plumbing.quote_filter_args(filter, *args)
 785
 786        def generator(svc, req):
 787            tries = 0
 788            while True:
 789                try:
 790                    plumbing_response = svc.stub.List(
 791                        req,
 792                        metadata=svc.parent.get_metadata(
 793                            'AccountPermissions.List', req),
 794                        timeout=timeout)
 795                except Exception as e:
 796                    if self.parent.shouldRetry(tries, e):
 797                        tries += 1
 798                        self.parent.jitterSleep(tries)
 799                        continue
 800                    raise plumbing.convert_error_to_porcelain(e) from e
 801                tries = 0
 802                for plumbing_item in plumbing_response.permissions:
 803                    yield plumbing.convert_account_permission_to_porcelain(
 804                        plumbing_item)
 805                if plumbing_response.meta.next_cursor == '':
 806                    break
 807                req.meta.cursor = plumbing_response.meta.next_cursor
 808
 809        return generator(self, req)
 810
 811
 812class SnapshotAccountPermissions:
 813    '''
 814    SnapshotAccountPermissions exposes the read only methods of the AccountPermissions
 815    service for historical queries.
 816    '''
 817    def __init__(self, account_permissions):
 818        self.account_permissions = account_permissions
 819
 820    def list(self, filter, *args, timeout=None):
 821        '''
 822         List gets a list of Permission records matching a given set of criteria.
 823        '''
 824        return self.account_permissions.list(filter, *args, timeout=timeout)
 825
 826
 827class AccountResources:
 828    '''
 829     AccountResources enumerates the resources to which accounts have access.
 830     The AccountResources service is read-only.
 831    See `strongdm.models.AccountResource`.
 832    '''
 833    def __init__(self, channel, client):
 834        self.parent = client
 835        self.stub = AccountResourcesStub(channel)
 836
 837    def list(self, filter, *args, timeout=None):
 838        '''
 839         List gets a list of AccountResource records matching a given set of criteria.
 840        '''
 841        req = AccountResourceListRequest()
 842        req.meta.CopyFrom(ListRequestMetadata())
 843        if self.parent.page_limit > 0:
 844            req.meta.limit = self.parent.page_limit
 845        if self.parent.snapshot_datetime is not None:
 846            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 847
 848        req.filter = plumbing.quote_filter_args(filter, *args)
 849
 850        def generator(svc, req):
 851            tries = 0
 852            while True:
 853                try:
 854                    plumbing_response = svc.stub.List(
 855                        req,
 856                        metadata=svc.parent.get_metadata(
 857                            'AccountResources.List', req),
 858                        timeout=timeout)
 859                except Exception as e:
 860                    if self.parent.shouldRetry(tries, e):
 861                        tries += 1
 862                        self.parent.jitterSleep(tries)
 863                        continue
 864                    raise plumbing.convert_error_to_porcelain(e) from e
 865                tries = 0
 866                for plumbing_item in plumbing_response.account_resources:
 867                    yield plumbing.convert_account_resource_to_porcelain(
 868                        plumbing_item)
 869                if plumbing_response.meta.next_cursor == '':
 870                    break
 871                req.meta.cursor = plumbing_response.meta.next_cursor
 872
 873        return generator(self, req)
 874
 875
 876class SnapshotAccountResources:
 877    '''
 878    SnapshotAccountResources exposes the read only methods of the AccountResources
 879    service for historical queries.
 880    '''
 881    def __init__(self, account_resources):
 882        self.account_resources = account_resources
 883
 884    def list(self, filter, *args, timeout=None):
 885        '''
 886         List gets a list of AccountResource records matching a given set of criteria.
 887        '''
 888        return self.account_resources.list(filter, *args, timeout=timeout)
 889
 890
 891class AccountResourcesHistory:
 892    '''
 893     AccountResourcesHistory records all changes to the state of a AccountResource.
 894    See `strongdm.models.AccountResourceHistory`.
 895    '''
 896    def __init__(self, channel, client):
 897        self.parent = client
 898        self.stub = AccountResourcesHistoryStub(channel)
 899
 900    def list(self, filter, *args, timeout=None):
 901        '''
 902         List gets a list of AccountResourceHistory records matching a given set of criteria.
 903        '''
 904        req = AccountResourceHistoryListRequest()
 905        req.meta.CopyFrom(ListRequestMetadata())
 906        if self.parent.page_limit > 0:
 907            req.meta.limit = self.parent.page_limit
 908        if self.parent.snapshot_datetime is not None:
 909            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 910
 911        req.filter = plumbing.quote_filter_args(filter, *args)
 912
 913        def generator(svc, req):
 914            tries = 0
 915            while True:
 916                try:
 917                    plumbing_response = svc.stub.List(
 918                        req,
 919                        metadata=svc.parent.get_metadata(
 920                            'AccountResourcesHistory.List', req),
 921                        timeout=timeout)
 922                except Exception as e:
 923                    if self.parent.shouldRetry(tries, e):
 924                        tries += 1
 925                        self.parent.jitterSleep(tries)
 926                        continue
 927                    raise plumbing.convert_error_to_porcelain(e) from e
 928                tries = 0
 929                for plumbing_item in plumbing_response.history:
 930                    yield plumbing.convert_account_resource_history_to_porcelain(
 931                        plumbing_item)
 932                if plumbing_response.meta.next_cursor == '':
 933                    break
 934                req.meta.cursor = plumbing_response.meta.next_cursor
 935
 936        return generator(self, req)
 937
 938
 939class Accounts:
 940    '''
 941     Accounts are users that have access to strongDM. There are two types of accounts:
 942     1. **Users:** humans who are authenticated through username and password or SSO.
 943     2. **Service Accounts:** machines that are authenticated using a service token.
 944     3. **Tokens** are access keys with permissions that can be used for authentication.
 945    See:
 946    `strongdm.models.Service`
 947    `strongdm.models.Token`
 948    `strongdm.models.User`
 949    '''
 950    def __init__(self, channel, client):
 951        self.parent = client
 952        self.stub = AccountsStub(channel)
 953
 954    def create(self, account, timeout=None):
 955        '''
 956         Create registers a new Account.
 957        '''
 958        req = AccountCreateRequest()
 959
 960        if account is not None:
 961            req.account.CopyFrom(plumbing.convert_account_to_plumbing(account))
 962        tries = 0
 963        plumbing_response = None
 964        while True:
 965            try:
 966                plumbing_response = self.stub.Create(
 967                    req,
 968                    metadata=self.parent.get_metadata('Accounts.Create', req),
 969                    timeout=timeout)
 970            except Exception as e:
 971                if self.parent.shouldRetry(tries, e):
 972                    tries += 1
 973                    self.parent.jitterSleep(tries)
 974                    continue
 975                raise plumbing.convert_error_to_porcelain(e) from e
 976            break
 977
 978        resp = models.AccountCreateResponse()
 979        resp.access_key = (plumbing_response.access_key)
 980        resp.account = plumbing.convert_account_to_porcelain(
 981            plumbing_response.account)
 982        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
 983            plumbing_response.meta)
 984        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 985            plumbing_response.rate_limit)
 986        resp.secret_key = (plumbing_response.secret_key)
 987        resp.token = (plumbing_response.token)
 988        return resp
 989
 990    def get(self, id, timeout=None):
 991        '''
 992         Get reads one Account by ID.
 993        '''
 994        req = AccountGetRequest()
 995        if self.parent.snapshot_datetime is not None:
 996            req.meta.CopyFrom(GetRequestMetadata())
 997            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 998
 999        req.id = (id)
1000        tries = 0
1001        plumbing_response = None
1002        while True:
1003            try:
1004                plumbing_response = self.stub.Get(
1005                    req,
1006                    metadata=self.parent.get_metadata('Accounts.Get', req),
1007                    timeout=timeout)
1008            except Exception as e:
1009                if self.parent.shouldRetry(tries, e):
1010                    tries += 1
1011                    self.parent.jitterSleep(tries)
1012                    continue
1013                raise plumbing.convert_error_to_porcelain(e) from e
1014            break
1015
1016        resp = models.AccountGetResponse()
1017        resp.account = plumbing.convert_account_to_porcelain(
1018            plumbing_response.account)
1019        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1020            plumbing_response.meta)
1021        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1022            plumbing_response.rate_limit)
1023        return resp
1024
1025    def update(self, account, timeout=None):
1026        '''
1027         Update replaces all the fields of an Account by ID.
1028        '''
1029        req = AccountUpdateRequest()
1030
1031        if account is not None:
1032            req.account.CopyFrom(plumbing.convert_account_to_plumbing(account))
1033        tries = 0
1034        plumbing_response = None
1035        while True:
1036            try:
1037                plumbing_response = self.stub.Update(
1038                    req,
1039                    metadata=self.parent.get_metadata('Accounts.Update', req),
1040                    timeout=timeout)
1041            except Exception as e:
1042                if self.parent.shouldRetry(tries, e):
1043                    tries += 1
1044                    self.parent.jitterSleep(tries)
1045                    continue
1046                raise plumbing.convert_error_to_porcelain(e) from e
1047            break
1048
1049        resp = models.AccountUpdateResponse()
1050        resp.account = plumbing.convert_account_to_porcelain(
1051            plumbing_response.account)
1052        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
1053            plumbing_response.meta)
1054        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1055            plumbing_response.rate_limit)
1056        return resp
1057
1058    def delete(self, id, timeout=None):
1059        '''
1060         Delete removes an Account by ID.
1061        '''
1062        req = AccountDeleteRequest()
1063
1064        req.id = (id)
1065        tries = 0
1066        plumbing_response = None
1067        while True:
1068            try:
1069                plumbing_response = self.stub.Delete(
1070                    req,
1071                    metadata=self.parent.get_metadata('Accounts.Delete', req),
1072                    timeout=timeout)
1073            except Exception as e:
1074                if self.parent.shouldRetry(tries, e):
1075                    tries += 1
1076                    self.parent.jitterSleep(tries)
1077                    continue
1078                raise plumbing.convert_error_to_porcelain(e) from e
1079            break
1080
1081        resp = models.AccountDeleteResponse()
1082        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
1083            plumbing_response.meta)
1084        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1085            plumbing_response.rate_limit)
1086        return resp
1087
1088    def list(self, filter, *args, timeout=None):
1089        '''
1090         List gets a list of Accounts matching a given set of criteria.
1091        '''
1092        req = AccountListRequest()
1093        req.meta.CopyFrom(ListRequestMetadata())
1094        if self.parent.page_limit > 0:
1095            req.meta.limit = self.parent.page_limit
1096        if self.parent.snapshot_datetime is not None:
1097            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1098
1099        req.filter = plumbing.quote_filter_args(filter, *args)
1100
1101        def generator(svc, req):
1102            tries = 0
1103            while True:
1104                try:
1105                    plumbing_response = svc.stub.List(
1106                        req,
1107                        metadata=svc.parent.get_metadata('Accounts.List', req),
1108                        timeout=timeout)
1109                except Exception as e:
1110                    if self.parent.shouldRetry(tries, e):
1111                        tries += 1
1112                        self.parent.jitterSleep(tries)
1113                        continue
1114                    raise plumbing.convert_error_to_porcelain(e) from e
1115                tries = 0
1116                for plumbing_item in plumbing_response.accounts:
1117                    yield plumbing.convert_account_to_porcelain(plumbing_item)
1118                if plumbing_response.meta.next_cursor == '':
1119                    break
1120                req.meta.cursor = plumbing_response.meta.next_cursor
1121
1122        return generator(self, req)
1123
1124
1125class SnapshotAccounts:
1126    '''
1127    SnapshotAccounts exposes the read only methods of the Accounts
1128    service for historical queries.
1129    '''
1130    def __init__(self, accounts):
1131        self.accounts = accounts
1132
1133    def get(self, id, timeout=None):
1134        '''
1135         Get reads one Account by ID.
1136        '''
1137        return self.accounts.get(id, timeout=timeout)
1138
1139    def list(self, filter, *args, timeout=None):
1140        '''
1141         List gets a list of Accounts matching a given set of criteria.
1142        '''
1143        return self.accounts.list(filter, *args, timeout=timeout)
1144
1145
1146class AccountsHistory:
1147    '''
1148     AccountsHistory records all changes to the state of an Account.
1149    See `strongdm.models.AccountHistory`.
1150    '''
1151    def __init__(self, channel, client):
1152        self.parent = client
1153        self.stub = AccountsHistoryStub(channel)
1154
1155    def list(self, filter, *args, timeout=None):
1156        '''
1157         List gets a list of AccountHistory records matching a given set of criteria.
1158        '''
1159        req = AccountHistoryListRequest()
1160        req.meta.CopyFrom(ListRequestMetadata())
1161        if self.parent.page_limit > 0:
1162            req.meta.limit = self.parent.page_limit
1163        if self.parent.snapshot_datetime is not None:
1164            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1165
1166        req.filter = plumbing.quote_filter_args(filter, *args)
1167
1168        def generator(svc, req):
1169            tries = 0
1170            while True:
1171                try:
1172                    plumbing_response = svc.stub.List(
1173                        req,
1174                        metadata=svc.parent.get_metadata(
1175                            'AccountsHistory.List', req),
1176                        timeout=timeout)
1177                except Exception as e:
1178                    if self.parent.shouldRetry(tries, e):
1179                        tries += 1
1180                        self.parent.jitterSleep(tries)
1181                        continue
1182                    raise plumbing.convert_error_to_porcelain(e) from e
1183                tries = 0
1184                for plumbing_item in plumbing_response.history:
1185                    yield plumbing.convert_account_history_to_porcelain(
1186                        plumbing_item)
1187                if plumbing_response.meta.next_cursor == '':
1188                    break
1189                req.meta.cursor = plumbing_response.meta.next_cursor
1190
1191        return generator(self, req)
1192
1193
1194class Activities:
1195    '''
1196     An Activity is a record of an action taken against a strongDM deployment, e.g.
1197     a user creation, resource deletion, sso configuration change, etc. The Activities
1198     service is read-only.
1199    See `strongdm.models.Activity`.
1200    '''
1201    def __init__(self, channel, client):
1202        self.parent = client
1203        self.stub = ActivitiesStub(channel)
1204
1205    def get(self, id, timeout=None):
1206        '''
1207         Get reads one Activity by ID.
1208        '''
1209        req = ActivityGetRequest()
1210        if self.parent.snapshot_datetime is not None:
1211            req.meta.CopyFrom(GetRequestMetadata())
1212            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1213
1214        req.id = (id)
1215        tries = 0
1216        plumbing_response = None
1217        while True:
1218            try:
1219                plumbing_response = self.stub.Get(
1220                    req,
1221                    metadata=self.parent.get_metadata('Activities.Get', req),
1222                    timeout=timeout)
1223            except Exception as e:
1224                if self.parent.shouldRetry(tries, e):
1225                    tries += 1
1226                    self.parent.jitterSleep(tries)
1227                    continue
1228                raise plumbing.convert_error_to_porcelain(e) from e
1229            break
1230
1231        resp = models.ActivityGetResponse()
1232        resp.activity = plumbing.convert_activity_to_porcelain(
1233            plumbing_response.activity)
1234        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1235            plumbing_response.meta)
1236        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1237            plumbing_response.rate_limit)
1238        return resp
1239
1240    def list(self, filter, *args, timeout=None):
1241        '''
1242         List gets a list of Activities matching a given set of criteria.
1243         The 'before' and 'after' filters can be used to control the time
1244         range of the output activities. If not provided, one week of back
1245         of activities will be returned.
1246        '''
1247        req = ActivityListRequest()
1248        req.meta.CopyFrom(ListRequestMetadata())
1249        if self.parent.page_limit > 0:
1250            req.meta.limit = self.parent.page_limit
1251        if self.parent.snapshot_datetime is not None:
1252            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1253
1254        req.filter = plumbing.quote_filter_args(filter, *args)
1255
1256        def generator(svc, req):
1257            tries = 0
1258            while True:
1259                try:
1260                    plumbing_response = svc.stub.List(
1261                        req,
1262                        metadata=svc.parent.get_metadata(
1263                            'Activities.List', req),
1264                        timeout=timeout)
1265                except Exception as e:
1266                    if self.parent.shouldRetry(tries, e):
1267                        tries += 1
1268                        self.parent.jitterSleep(tries)
1269                        continue
1270                    raise plumbing.convert_error_to_porcelain(e) from e
1271                tries = 0
1272                for plumbing_item in plumbing_response.activities:
1273                    yield plumbing.convert_activity_to_porcelain(plumbing_item)
1274                if plumbing_response.meta.next_cursor == '':
1275                    break
1276                req.meta.cursor = plumbing_response.meta.next_cursor
1277
1278        return generator(self, req)
1279
1280
1281class ApprovalWorkflowApprovers:
1282    '''
1283     ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep
1284    See `strongdm.models.ApprovalWorkflowApprover`.
1285    '''
1286    def __init__(self, channel, client):
1287        self.parent = client
1288        self.stub = ApprovalWorkflowApproversStub(channel)
1289
1290    def create(self, approval_workflow_approver, timeout=None):
1291        '''
1292         Create creates a new approval workflow approver.
1293        '''
1294        req = ApprovalWorkflowApproverCreateRequest()
1295
1296        if approval_workflow_approver is not None:
1297            req.approval_workflow_approver.CopyFrom(
1298                plumbing.convert_approval_workflow_approver_to_plumbing(
1299                    approval_workflow_approver))
1300        tries = 0
1301        plumbing_response = None
1302        while True:
1303            try:
1304                plumbing_response = self.stub.Create(
1305                    req,
1306                    metadata=self.parent.get_metadata(
1307                        'ApprovalWorkflowApprovers.Create', req),
1308                    timeout=timeout)
1309            except Exception as e:
1310                if self.parent.shouldRetry(tries, e):
1311                    tries += 1
1312                    self.parent.jitterSleep(tries)
1313                    continue
1314                raise plumbing.convert_error_to_porcelain(e) from e
1315            break
1316
1317        resp = models.ApprovalWorkflowApproverCreateResponse()
1318        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1319            plumbing_response.approval_workflow_approver)
1320        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1321            plumbing_response.rate_limit)
1322        return resp
1323
1324    def get(self, id, timeout=None):
1325        '''
1326         Get reads one approval workflow approver by ID.
1327        '''
1328        req = ApprovalWorkflowApproverGetRequest()
1329        if self.parent.snapshot_datetime is not None:
1330            req.meta.CopyFrom(GetRequestMetadata())
1331            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1332
1333        req.id = (id)
1334        tries = 0
1335        plumbing_response = None
1336        while True:
1337            try:
1338                plumbing_response = self.stub.Get(
1339                    req,
1340                    metadata=self.parent.get_metadata(
1341                        'ApprovalWorkflowApprovers.Get', req),
1342                    timeout=timeout)
1343            except Exception as e:
1344                if self.parent.shouldRetry(tries, e):
1345                    tries += 1
1346                    self.parent.jitterSleep(tries)
1347                    continue
1348                raise plumbing.convert_error_to_porcelain(e) from e
1349            break
1350
1351        resp = models.ApprovalWorkflowApproverGetResponse()
1352        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1353            plumbing_response.approval_workflow_approver)
1354        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1355            plumbing_response.meta)
1356        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1357            plumbing_response.rate_limit)
1358        return resp
1359
1360    def delete(self, id, timeout=None):
1361        '''
1362         Delete deletes an existing approval workflow approver.
1363        '''
1364        req = ApprovalWorkflowApproverDeleteRequest()
1365
1366        req.id = (id)
1367        tries = 0
1368        plumbing_response = None
1369        while True:
1370            try:
1371                plumbing_response = self.stub.Delete(
1372                    req,
1373                    metadata=self.parent.get_metadata(
1374                        'ApprovalWorkflowApprovers.Delete', req),
1375                    timeout=timeout)
1376            except Exception as e:
1377                if self.parent.shouldRetry(tries, e):
1378                    tries += 1
1379                    self.parent.jitterSleep(tries)
1380                    continue
1381                raise plumbing.convert_error_to_porcelain(e) from e
1382            break
1383
1384        resp = models.ApprovalWorkflowApproverDeleteResponse()
1385        resp.id = (plumbing_response.id)
1386        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1387            plumbing_response.rate_limit)
1388        return resp
1389
1390    def list(self, filter, *args, timeout=None):
1391        '''
1392         Lists existing approval workflow approvers.
1393        '''
1394        req = ApprovalWorkflowApproverListRequest()
1395        req.meta.CopyFrom(ListRequestMetadata())
1396        if self.parent.page_limit > 0:
1397            req.meta.limit = self.parent.page_limit
1398        if self.parent.snapshot_datetime is not None:
1399            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1400
1401        req.filter = plumbing.quote_filter_args(filter, *args)
1402
1403        def generator(svc, req):
1404            tries = 0
1405            while True:
1406                try:
1407                    plumbing_response = svc.stub.List(
1408                        req,
1409                        metadata=svc.parent.get_metadata(
1410                            'ApprovalWorkflowApprovers.List', req),
1411                        timeout=timeout)
1412                except Exception as e:
1413                    if self.parent.shouldRetry(tries, e):
1414                        tries += 1
1415                        self.parent.jitterSleep(tries)
1416                        continue
1417                    raise plumbing.convert_error_to_porcelain(e) from e
1418                tries = 0
1419                for plumbing_item in plumbing_response.approval_workflow_approvers:
1420                    yield plumbing.convert_approval_workflow_approver_to_porcelain(
1421                        plumbing_item)
1422                if plumbing_response.meta.next_cursor == '':
1423                    break
1424                req.meta.cursor = plumbing_response.meta.next_cursor
1425
1426        return generator(self, req)
1427
1428
1429class SnapshotApprovalWorkflowApprovers:
1430    '''
1431    SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers
1432    service for historical queries.
1433    '''
1434    def __init__(self, approval_workflow_approvers):
1435        self.approval_workflow_approvers = approval_workflow_approvers
1436
1437    def get(self, id, timeout=None):
1438        '''
1439         Get reads one approval workflow approver by ID.
1440        '''
1441        return self.approval_workflow_approvers.get(id, timeout=timeout)
1442
1443    def list(self, filter, *args, timeout=None):
1444        '''
1445         Lists existing approval workflow approvers.
1446        '''
1447        return self.approval_workflow_approvers.list(filter,
1448                                                     *args,
1449                                                     timeout=timeout)
1450
1451
1452class ApprovalWorkflowApproversHistory:
1453    '''
1454     ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover.
1455    See `strongdm.models.ApprovalWorkflowApproverHistory`.
1456    '''
1457    def __init__(self, channel, client):
1458        self.parent = client
1459        self.stub = ApprovalWorkflowApproversHistoryStub(channel)
1460
1461    def list(self, filter, *args, timeout=None):
1462        '''
1463         List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria.
1464        '''
1465        req = ApprovalWorkflowApproverHistoryListRequest()
1466        req.meta.CopyFrom(ListRequestMetadata())
1467        if self.parent.page_limit > 0:
1468            req.meta.limit = self.parent.page_limit
1469        if self.parent.snapshot_datetime is not None:
1470            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1471
1472        req.filter = plumbing.quote_filter_args(filter, *args)
1473
1474        def generator(svc, req):
1475            tries = 0
1476            while True:
1477                try:
1478                    plumbing_response = svc.stub.List(
1479                        req,
1480                        metadata=svc.parent.get_metadata(
1481                            'ApprovalWorkflowApproversHistory.List', req),
1482                        timeout=timeout)
1483                except Exception as e:
1484                    if self.parent.shouldRetry(tries, e):
1485                        tries += 1
1486                        self.parent.jitterSleep(tries)
1487                        continue
1488                    raise plumbing.convert_error_to_porcelain(e) from e
1489                tries = 0
1490                for plumbing_item in plumbing_response.history:
1491                    yield plumbing.convert_approval_workflow_approver_history_to_porcelain(
1492                        plumbing_item)
1493                if plumbing_response.meta.next_cursor == '':
1494                    break
1495                req.meta.cursor = plumbing_response.meta.next_cursor
1496
1497        return generator(self, req)
1498
1499
1500class ApprovalWorkflowSteps:
1501    '''
1502     ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow
1503    See `strongdm.models.ApprovalWorkflowStep`.
1504    '''
1505    def __init__(self, channel, client):
1506        self.parent = client
1507        self.stub = ApprovalWorkflowStepsStub(channel)
1508
1509    def create(self, approval_workflow_step, timeout=None):
1510        '''
1511         Create creates a new approval workflow step.
1512        '''
1513        req = ApprovalWorkflowStepCreateRequest()
1514
1515        if approval_workflow_step is not None:
1516            req.approval_workflow_step.CopyFrom(
1517                plumbing.convert_approval_workflow_step_to_plumbing(
1518                    approval_workflow_step))
1519        tries = 0
1520        plumbing_response = None
1521        while True:
1522            try:
1523                plumbing_response = self.stub.Create(
1524                    req,
1525                    metadata=self.parent.get_metadata(
1526                        'ApprovalWorkflowSteps.Create', req),
1527                    timeout=timeout)
1528            except Exception as e:
1529                if self.parent.shouldRetry(tries, e):
1530                    tries += 1
1531                    self.parent.jitterSleep(tries)
1532                    continue
1533                raise plumbing.convert_error_to_porcelain(e) from e
1534            break
1535
1536        resp = models.ApprovalWorkflowStepCreateResponse()
1537        resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain(
1538            plumbing_response.approval_workflow_step)
1539        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1540            plumbing_response.rate_limit)
1541        return resp
1542
1543    def get(self, id, timeout=None):
1544        '''
1545         Get reads one approval workflow step by ID.
1546        '''
1547        req = ApprovalWorkflowStepGetRequest()
1548        if self.parent.snapshot_datetime is not None:
1549            req.meta.CopyFrom(GetRequestMetadata())
1550            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1551
1552        req.id = (id)
1553        tries = 0
1554        plumbing_response = None
1555        while True:
1556            try:
1557                plumbing_response = self.stub.Get(
1558                    req,
1559                    metadata=self.parent.get_metadata(
1560                        'ApprovalWorkflowSteps.Get', req),
1561                    timeout=timeout)
1562            except Exception as e:
1563                if self.parent.shouldRetry(tries, e):
1564                    tries += 1
1565                    self.parent.jitterSleep(tries)
1566                    continue
1567                raise plumbing.convert_error_to_porcelain(e) from e
1568            break
1569
1570        resp = models.ApprovalWorkflowStepGetResponse()
1571        resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain(
1572            plumbing_response.approval_workflow_step)
1573        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1574            plumbing_response.meta)
1575        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1576            plumbing_response.rate_limit)
1577        return resp
1578
1579    def delete(self, id, timeout=None):
1580        '''
1581         Delete deletes an existing approval workflow step.
1582        '''
1583        req = ApprovalWorkflowStepDeleteRequest()
1584
1585        req.id = (id)
1586        tries = 0
1587        plumbing_response = None
1588        while True:
1589            try:
1590                plumbing_response = self.stub.Delete(
1591                    req,
1592                    metadata=self.parent.get_metadata(
1593                        'ApprovalWorkflowSteps.Delete', req),
1594                    timeout=timeout)
1595            except Exception as e:
1596                if self.parent.shouldRetry(tries, e):
1597                    tries += 1
1598                    self.parent.jitterSleep(tries)
1599                    continue
1600                raise plumbing.convert_error_to_porcelain(e) from e
1601            break
1602
1603        resp = models.ApprovalWorkflowStepDeleteResponse()
1604        resp.id = (plumbing_response.id)
1605        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1606            plumbing_response.rate_limit)
1607        return resp
1608
1609    def list(self, filter, *args, timeout=None):
1610        '''
1611         Lists existing approval workflow steps.
1612        '''
1613        req = ApprovalWorkflowStepListRequest()
1614        req.meta.CopyFrom(ListRequestMetadata())
1615        if self.parent.page_limit > 0:
1616            req.meta.limit = self.parent.page_limit
1617        if self.parent.snapshot_datetime is not None:
1618            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1619
1620        req.filter = plumbing.quote_filter_args(filter, *args)
1621
1622        def generator(svc, req):
1623            tries = 0
1624            while True:
1625                try:
1626                    plumbing_response = svc.stub.List(
1627                        req,
1628                        metadata=svc.parent.get_metadata(
1629                            'ApprovalWorkflowSteps.List', req),
1630                        timeout=timeout)
1631                except Exception as e:
1632                    if self.parent.shouldRetry(tries, e):
1633                        tries += 1
1634                        self.parent.jitterSleep(tries)
1635                        continue
1636                    raise plumbing.convert_error_to_porcelain(e) from e
1637                tries = 0
1638                for plumbing_item in plumbing_response.approval_workflow_steps:
1639                    yield plumbing.convert_approval_workflow_step_to_porcelain(
1640                        plumbing_item)
1641                if plumbing_response.meta.next_cursor == '':
1642                    break
1643                req.meta.cursor = plumbing_response.meta.next_cursor
1644
1645        return generator(self, req)
1646
1647
1648class SnapshotApprovalWorkflowSteps:
1649    '''
1650    SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps
1651    service for historical queries.
1652    '''
1653    def __init__(self, approval_workflow_steps):
1654        self.approval_workflow_steps = approval_workflow_steps
1655
1656    def get(self, id, timeout=None):
1657        '''
1658         Get reads one approval workflow step by ID.
1659        '''
1660        return self.approval_workflow_steps.get(id, timeout=timeout)
1661
1662    def list(self, filter, *args, timeout=None):
1663        '''
1664         Lists existing approval workflow steps.
1665        '''
1666        return self.approval_workflow_steps.list(filter,
1667                                                 *args,
1668                                                 timeout=timeout)
1669
1670
1671class ApprovalWorkflowStepsHistory:
1672    '''
1673     ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep.
1674    See `strongdm.models.ApprovalWorkflowStepHistory`.
1675    '''
1676    def __init__(self, channel, client):
1677        self.parent = client
1678        self.stub = ApprovalWorkflowStepsHistoryStub(channel)
1679
1680    def list(self, filter, *args, timeout=None):
1681        '''
1682         List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria.
1683        '''
1684        req = ApprovalWorkflowStepHistoryListRequest()
1685        req.meta.CopyFrom(ListRequestMetadata())
1686        if self.parent.page_limit > 0:
1687            req.meta.limit = self.parent.page_limit
1688        if self.parent.snapshot_datetime is not None:
1689            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1690
1691        req.filter = plumbing.quote_filter_args(filter, *args)
1692
1693        def generator(svc, req):
1694            tries = 0
1695            while True:
1696                try:
1697                    plumbing_response = svc.stub.List(
1698                        req,
1699                        metadata=svc.parent.get_metadata(
1700                            'ApprovalWorkflowStepsHistory.List', req),
1701                        timeout=timeout)
1702                except Exception as e:
1703                    if self.parent.shouldRetry(tries, e):
1704                        tries += 1
1705                        self.parent.jitterSleep(tries)
1706                        continue
1707                    raise plumbing.convert_error_to_porcelain(e) from e
1708                tries = 0
1709                for plumbing_item in plumbing_response.history:
1710                    yield plumbing.convert_approval_workflow_step_history_to_porcelain(
1711                        plumbing_item)
1712                if plumbing_response.meta.next_cursor == '':
1713                    break
1714                req.meta.cursor = plumbing_response.meta.next_cursor
1715
1716        return generator(self, req)
1717
1718
1719class ApprovalWorkflows:
1720    '''
1721     ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized
1722     approvers and be approved or denied.
1723    See `strongdm.models.ApprovalWorkflow`.
1724    '''
1725    def __init__(self, channel, client):
1726        self.parent = client
1727        self.stub = ApprovalWorkflowsStub(channel)
1728
1729    def create(self, approval_workflow, timeout=None):
1730        '''
1731         Create creates a new approval workflow and requires a name and approval mode for the approval workflow.
1732        '''
1733        req = ApprovalWorkflowCreateRequest()
1734
1735        if approval_workflow is not None:
1736            req.approval_workflow.CopyFrom(
1737                plumbing.convert_approval_workflow_to_plumbing(
1738                    approval_workflow))
1739        tries = 0
1740        plumbing_response = None
1741        while True:
1742            try:
1743                plumbing_response = self.stub.Create(
1744                    req,
1745                    metadata=self.parent.get_metadata(
1746                        'ApprovalWorkflows.Create', req),
1747                    timeout=timeout)
1748            except Exception as e:
1749                if self.parent.shouldRetry(tries, e):
1750                    tries += 1
1751                    self.parent.jitterSleep(tries)
1752                    continue
1753                raise plumbing.convert_error_to_porcelain(e) from e
1754            break
1755
1756        resp = models.ApprovalWorkflowCreateResponse()
1757        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1758            plumbing_response.approval_workflow)
1759        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1760            plumbing_response.rate_limit)
1761        return resp
1762
1763    def get(self, id, timeout=None):
1764        '''
1765         Get reads one approval workflow by ID.
1766        '''
1767        req = ApprovalWorkflowGetRequest()
1768        if self.parent.snapshot_datetime is not None:
1769            req.meta.CopyFrom(GetRequestMetadata())
1770            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1771
1772        req.id = (id)
1773        tries = 0
1774        plumbing_response = None
1775        while True:
1776            try:
1777                plumbing_response = self.stub.Get(
1778                    req,
1779                    metadata=self.parent.get_metadata('ApprovalWorkflows.Get',
1780                                                      req),
1781                    timeout=timeout)
1782            except Exception as e:
1783                if self.parent.shouldRetry(tries, e):
1784                    tries += 1
1785                    self.parent.jitterSleep(tries)
1786                    continue
1787                raise plumbing.convert_error_to_porcelain(e) from e
1788            break
1789
1790        resp = models.ApprovalWorkflowGetResponse()
1791        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1792            plumbing_response.approval_workflow)
1793        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1794            plumbing_response.meta)
1795        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1796            plumbing_response.rate_limit)
1797        return resp
1798
1799    def delete(self, id, timeout=None):
1800        '''
1801         Delete deletes an existing approval workflow.
1802        '''
1803        req = ApprovalWorkflowDeleteRequest()
1804
1805        req.id = (id)
1806        tries = 0
1807        plumbing_response = None
1808        while True:
1809            try:
1810                plumbing_response = self.stub.Delete(
1811                    req,
1812                    metadata=self.parent.get_metadata(
1813                        'ApprovalWorkflows.Delete', req),
1814                    timeout=timeout)
1815            except Exception as e:
1816                if self.parent.shouldRetry(tries, e):
1817                    tries += 1
1818                    self.parent.jitterSleep(tries)
1819                    continue
1820                raise plumbing.convert_error_to_porcelain(e) from e
1821            break
1822
1823        resp = models.ApprovalWorkflowDeleteResponse()
1824        resp.id = (plumbing_response.id)
1825        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1826            plumbing_response.rate_limit)
1827        return resp
1828
1829    def update(self, approval_workflow, timeout=None):
1830        '''
1831         Update updates an existing approval workflow.
1832        '''
1833        req = ApprovalWorkflowUpdateRequest()
1834
1835        if approval_workflow is not None:
1836            req.approval_workflow.CopyFrom(
1837                plumbing.convert_approval_workflow_to_plumbing(
1838                    approval_workflow))
1839        tries = 0
1840        plumbing_response = None
1841        while True:
1842            try:
1843                plumbing_response = self.stub.Update(
1844                    req,
1845                    metadata=self.parent.get_metadata(
1846                        'ApprovalWorkflows.Update', req),
1847                    timeout=timeout)
1848            except Exception as e:
1849                if self.parent.shouldRetry(tries, e):
1850                    tries += 1
1851                    self.parent.jitterSleep(tries)
1852                    continue
1853                raise plumbing.convert_error_to_porcelain(e) from e
1854            break
1855
1856        resp = models.ApprovalWorkflowUpdateResponse()
1857        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1858            plumbing_response.approval_workflow)
1859        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1860            plumbing_response.rate_limit)
1861        return resp
1862
1863    def list(self, filter, *args, timeout=None):
1864        '''
1865         Lists existing approval workflows.
1866        '''
1867        req = ApprovalWorkflowListRequest()
1868        req.meta.CopyFrom(ListRequestMetadata())
1869        if self.parent.page_limit > 0:
1870            req.meta.limit = self.parent.page_limit
1871        if self.parent.snapshot_datetime is not None:
1872            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1873
1874        req.filter = plumbing.quote_filter_args(filter, *args)
1875
1876        def generator(svc, req):
1877            tries = 0
1878            while True:
1879                try:
1880                    plumbing_response = svc.stub.List(
1881                        req,
1882                        metadata=svc.parent.get_metadata(
1883                            'ApprovalWorkflows.List', req),
1884                        timeout=timeout)
1885                except Exception as e:
1886                    if self.parent.shouldRetry(tries, e):
1887                        tries += 1
1888                        self.parent.jitterSleep(tries)
1889                        continue
1890                    raise plumbing.convert_error_to_porcelain(e) from e
1891                tries = 0
1892                for plumbing_item in plumbing_response.approval_workflows:
1893                    yield plumbing.convert_approval_workflow_to_porcelain(
1894                        plumbing_item)
1895                if plumbing_response.meta.next_cursor == '':
1896                    break
1897                req.meta.cursor = plumbing_response.meta.next_cursor
1898
1899        return generator(self, req)
1900
1901
1902class SnapshotApprovalWorkflows:
1903    '''
1904    SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows
1905    service for historical queries.
1906    '''
1907    def __init__(self, approval_workflows):
1908        self.approval_workflows = approval_workflows
1909
1910    def get(self, id, timeout=None):
1911        '''
1912         Get reads one approval workflow by ID.
1913        '''
1914        return self.approval_workflows.get(id, timeout=timeout)
1915
1916    def list(self, filter, *args, timeout=None):
1917        '''
1918         Lists existing approval workflows.
1919        '''
1920        return self.approval_workflows.list(filter, *args, timeout=timeout)
1921
1922
1923class ApprovalWorkflowsHistory:
1924    '''
1925     ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow.
1926    See `strongdm.models.ApprovalWorkflowHistory`.
1927    '''
1928    def __init__(self, channel, client):
1929        self.parent = client
1930        self.stub = ApprovalWorkflowsHistoryStub(channel)
1931
1932    def list(self, filter, *args, timeout=None):
1933        '''
1934         List gets a list of ApprovalWorkflowHistory records matching a given set of criteria.
1935        '''
1936        req = ApprovalWorkflowHistoryListRequest()
1937        req.meta.CopyFrom(ListRequestMetadata())
1938        if self.parent.page_limit > 0:
1939            req.meta.limit = self.parent.page_limit
1940        if self.parent.snapshot_datetime is not None:
1941            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1942
1943        req.filter = plumbing.quote_filter_args(filter, *args)
1944
1945        def generator(svc, req):
1946            tries = 0
1947            while True:
1948                try:
1949                    plumbing_response = svc.stub.List(
1950                        req,
1951                        metadata=svc.parent.get_metadata(
1952                            'ApprovalWorkflowsHistory.List', req),
1953                        timeout=timeout)
1954                except Exception as e:
1955                    if self.parent.shouldRetry(tries, e):
1956                        tries += 1
1957                        self.parent.jitterSleep(tries)
1958                        continue
1959                    raise plumbing.convert_error_to_porcelain(e) from e
1960                tries = 0
1961                for plumbing_item in plumbing_response.history:
1962                    yield plumbing.convert_approval_workflow_history_to_porcelain(
1963                        plumbing_item)
1964                if plumbing_response.meta.next_cursor == '':
1965                    break
1966                req.meta.cursor = plumbing_response.meta.next_cursor
1967
1968        return generator(self, req)
1969
1970
1971class ControlPanel:
1972    '''
1973     ControlPanel contains all administrative controls.
1974    '''
1975    def __init__(self, channel, client):
1976        self.parent = client
1977        self.stub = ControlPanelStub(channel)
1978
1979    def get_sshca_public_key(self, timeout=None):
1980        '''
1981         GetSSHCAPublicKey retrieves the SSH CA public key.
1982        '''
1983        req = ControlPanelGetSSHCAPublicKeyRequest()
1984
1985        tries = 0
1986        plumbing_response = None
1987        while True:
1988            try:
1989                plumbing_response = self.stub.GetSSHCAPublicKey(
1990                    req,
1991                    metadata=self.parent.get_metadata(
1992                        'ControlPanel.GetSSHCAPublicKey', req),
1993                    timeout=timeout)
1994            except Exception as e:
1995                if self.parent.shouldRetry(tries, e):
1996                    tries += 1
1997                    self.parent.jitterSleep(tries)
1998                    continue
1999                raise plumbing.convert_error_to_porcelain(e) from e
2000            break
2001
2002        resp = models.ControlPanelGetSSHCAPublicKeyResponse()
2003        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2004            plumbing_response.meta)
2005        resp.public_key = (plumbing_response.public_key)
2006        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2007            plumbing_response.rate_limit)
2008        return resp
2009
2010    def get_rdpca_public_key(self, timeout=None):
2011        '''
2012         GetRDPCAPublicKey retrieves the RDP CA public key.
2013        '''
2014        req = ControlPanelGetRDPCAPublicKeyRequest()
2015
2016        tries = 0
2017        plumbing_response = None
2018        while True:
2019            try:
2020                plumbing_response = self.stub.GetRDPCAPublicKey(
2021                    req,
2022                    metadata=self.parent.get_metadata(
2023                        'ControlPanel.GetRDPCAPublicKey', req),
2024                    timeout=timeout)
2025            except Exception as e:
2026                if self.parent.shouldRetry(tries, e):
2027                    tries += 1
2028                    self.parent.jitterSleep(tries)
2029                    continue
2030                raise plumbing.convert_error_to_porcelain(e) from e
2031            break
2032
2033        resp = models.ControlPanelGetRDPCAPublicKeyResponse()
2034        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2035            plumbing_response.meta)
2036        resp.public_key = (plumbing_response.public_key)
2037        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2038            plumbing_response.rate_limit)
2039        return resp
2040
2041    def verify_jwt(self, token, timeout=None):
2042        '''
2043         VerifyJWT reports whether the given JWT token (x-sdm-token) is valid.
2044        '''
2045        req = ControlPanelVerifyJWTRequest()
2046
2047        req.token = (token)
2048        tries = 0
2049        plumbing_response = None
2050        while True:
2051            try:
2052                plumbing_response = self.stub.VerifyJWT(
2053                    req,
2054                    metadata=self.parent.get_metadata('ControlPanel.VerifyJWT',
2055                                                      req),
2056                    timeout=timeout)
2057            except Exception as e:
2058                if self.parent.shouldRetry(tries, e):
2059                    tries += 1
2060                    self.parent.jitterSleep(tries)
2061                    continue
2062                raise plumbing.convert_error_to_porcelain(e) from e
2063            break
2064
2065        resp = models.ControlPanelVerifyJWTResponse()
2066        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2067            plumbing_response.meta)
2068        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2069            plumbing_response.rate_limit)
2070        resp.valid = (plumbing_response.valid)
2071        return resp
2072
2073
2074class HealthChecks:
2075    '''
2076     HealthChecks lists the last healthcheck between each node and resource.
2077     Note the unconventional capitalization here is to prevent having a collision with GRPC
2078    See `strongdm.models.Healthcheck`.
2079    '''
2080    def __init__(self, channel, client):
2081        self.parent = client
2082        self.stub = HealthChecksStub(channel)
2083
2084    def list(self, filter, *args, timeout=None):
2085        '''
2086         List gets a list of Healthchecks matching a given set of criteria.
2087        '''
2088        req = HealthcheckListRequest()
2089        req.meta.CopyFrom(ListRequestMetadata())
2090        if self.parent.page_limit > 0:
2091            req.meta.limit = self.parent.page_limit
2092        if self.parent.snapshot_datetime is not None:
2093            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2094
2095        req.filter = plumbing.quote_filter_args(filter, *args)
2096
2097        def generator(svc, req):
2098            tries = 0
2099            while True:
2100                try:
2101                    plumbing_response = svc.stub.List(
2102                        req,
2103                        metadata=svc.parent.get_metadata(
2104                            'HealthChecks.List', req),
2105                        timeout=timeout)
2106                except Exception as e:
2107                    if self.parent.shouldRetry(tries, e):
2108                        tries += 1
2109                        self.parent.jitterSleep(tries)
2110                        continue
2111                    raise plumbing.convert_error_to_porcelain(e) from e
2112                tries = 0
2113                for plumbing_item in plumbing_response.healthchecks:
2114                    yield plumbing.convert_healthcheck_to_porcelain(
2115                        plumbing_item)
2116                if plumbing_response.meta.next_cursor == '':
2117                    break
2118                req.meta.cursor = plumbing_response.meta.next_cursor
2119
2120        return generator(self, req)
2121
2122
2123class IdentityAliases:
2124    '''
2125     IdentityAliases assign an alias to an account within an IdentitySet.
2126     The alias is used as the username when connecting to a identity supported resource.
2127    See `strongdm.models.IdentityAlias`.
2128    '''
2129    def __init__(self, channel, client):
2130        self.parent = client
2131        self.stub = IdentityAliasesStub(channel)
2132
2133    def create(self, identity_alias, timeout=None):
2134        '''
2135         Create registers a new IdentityAlias.
2136        '''
2137        req = IdentityAliasCreateRequest()
2138
2139        if identity_alias is not None:
2140            req.identity_alias.CopyFrom(
2141                plumbing.convert_identity_alias_to_plumbing(identity_alias))
2142        tries = 0
2143        plumbing_response = None
2144        while True:
2145            try:
2146                plumbing_response = self.stub.Create(
2147                    req,
2148                    metadata=self.parent.get_metadata('IdentityAliases.Create',
2149                                                      req),
2150                    timeout=timeout)
2151            except Exception as e:
2152                if self.parent.shouldRetry(tries, e):
2153                    tries += 1
2154                    self.parent.jitterSleep(tries)
2155                    continue
2156                raise plumbing.convert_error_to_porcelain(e) from e
2157            break
2158
2159        resp = models.IdentityAliasCreateResponse()
2160        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2161            plumbing_response.identity_alias)
2162        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2163            plumbing_response.meta)
2164        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2165            plumbing_response.rate_limit)
2166        return resp
2167
2168    def get(self, id, timeout=None):
2169        '''
2170         Get reads one IdentityAlias by ID.
2171        '''
2172        req = IdentityAliasGetRequest()
2173        if self.parent.snapshot_datetime is not None:
2174            req.meta.CopyFrom(GetRequestMetadata())
2175            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2176
2177        req.id = (id)
2178        tries = 0
2179        plumbing_response = None
2180        while True:
2181            try:
2182                plumbing_response = self.stub.Get(
2183                    req,
2184                    metadata=self.parent.get_metadata('IdentityAliases.Get',
2185                                                      req),
2186                    timeout=timeout)
2187            except Exception as e:
2188                if self.parent.shouldRetry(tries, e):
2189                    tries += 1
2190                    self.parent.jitterSleep(tries)
2191                    continue
2192                raise plumbing.convert_error_to_porcelain(e) from e
2193            break
2194
2195        resp = models.IdentityAliasGetResponse()
2196        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2197            plumbing_response.identity_alias)
2198        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2199            plumbing_response.meta)
2200        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2201            plumbing_response.rate_limit)
2202        return resp
2203
2204    def update(self, identity_alias, timeout=None):
2205        '''
2206         Update replaces all the fields of a IdentityAlias by ID.
2207        '''
2208        req = IdentityAliasUpdateRequest()
2209
2210        if identity_alias is not None:
2211            req.identity_alias.CopyFrom(
2212                plumbing.convert_identity_alias_to_plumbing(identity_alias))
2213        tries = 0
2214        plumbing_response = None
2215        while True:
2216            try:
2217                plumbing_response = self.stub.Update(
2218                    req,
2219                    metadata=self.parent.get_metadata('IdentityAliases.Update',
2220                                                      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            break
2229
2230        resp = models.IdentityAliasUpdateResponse()
2231        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2232            plumbing_response.identity_alias)
2233        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2234            plumbing_response.meta)
2235        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2236            plumbing_response.rate_limit)
2237        return resp
2238
2239    def delete(self, id, timeout=None):
2240        '''
2241         Delete removes a IdentityAlias by ID.
2242        '''
2243        req = IdentityAliasDeleteRequest()
2244
2245        req.id = (id)
2246        tries = 0
2247        plumbing_response = None
2248        while True:
2249            try:
2250                plumbing_response = self.stub.Delete(
2251                    req,
2252                    metadata=self.parent.get_metadata('IdentityAliases.Delete',
2253                                                      req),
2254                    timeout=timeout)
2255            except Exception as e:
2256                if self.parent.shouldRetry(tries, e):
2257                    tries += 1
2258                    self.parent.jitterSleep(tries)
2259                    continue
2260                raise plumbing.convert_error_to_porcelain(e) from e
2261            break
2262
2263        resp = models.IdentityAliasDeleteResponse()
2264        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2265            plumbing_response.meta)
2266        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2267            plumbing_response.rate_limit)
2268        return resp
2269
2270    def list(self, filter, *args, timeout=None):
2271        '''
2272         List gets a list of IdentityAliases matching a given set of criteria.
2273        '''
2274        req = IdentityAliasListRequest()
2275        req.meta.CopyFrom(ListRequestMetadata())
2276        if self.parent.page_limit > 0:
2277            req.meta.limit = self.parent.page_limit
2278        if self.parent.snapshot_datetime is not None:
2279            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2280
2281        req.filter = plumbing.quote_filter_args(filter, *args)
2282
2283        def generator(svc, req):
2284            tries = 0
2285            while True:
2286                try:
2287                    plumbing_response = svc.stub.List(
2288                        req,
2289                        metadata=svc.parent.get_metadata(
2290                            'IdentityAliases.List', req),
2291                        timeout=timeout)
2292                except Exception as e:
2293                    if self.parent.shouldRetry(tries, e):
2294                        tries += 1
2295                        self.parent.jitterSleep(tries)
2296                        continue
2297                    raise plumbing.convert_error_to_porcelain(e) from e
2298                tries = 0
2299                for plumbing_item in plumbing_response.identity_aliases:
2300                    yield plumbing.convert_identity_alias_to_porcelain(
2301                        plumbing_item)
2302                if plumbing_response.meta.next_cursor == '':
2303                    break
2304                req.meta.cursor = plumbing_response.meta.next_cursor
2305
2306        return generator(self, req)
2307
2308
2309class SnapshotIdentityAliases:
2310    '''
2311    SnapshotIdentityAliases exposes the read only methods of the IdentityAliases
2312    service for historical queries.
2313    '''
2314    def __init__(self, identity_aliases):
2315        self.identity_aliases = identity_aliases
2316
2317    def get(self, id, timeout=None):
2318        '''
2319         Get reads one IdentityAlias by ID.
2320        '''
2321        return self.identity_aliases.get(id, timeout=timeout)
2322
2323    def list(self, filter, *args, timeout=None):
2324        '''
2325         List gets a list of IdentityAliases matching a given set of criteria.
2326        '''
2327        return self.identity_aliases.list(filter, *args, timeout=timeout)
2328
2329
2330class IdentityAliasesHistory:
2331    '''
2332     IdentityAliasesHistory records all changes to the state of a IdentityAlias.
2333    See `strongdm.models.IdentityAliasHistory`.
2334    '''
2335    def __init__(self, channel, client):
2336        self.parent = client
2337        self.stub = IdentityAliasesHistoryStub(channel)
2338
2339    def list(self, filter, *args, timeout=None):
2340        '''
2341         List gets a list of IdentityAliasHistory records matching a given set of criteria.
2342        '''
2343        req = IdentityAliasHistoryListRequest()
2344        req.meta.CopyFrom(ListRequestMetadata())
2345        if self.parent.page_limit > 0:
2346            req.meta.limit = self.parent.page_limit
2347        if self.parent.snapshot_datetime is not None:
2348            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2349
2350        req.filter = plumbing.quote_filter_args(filter, *args)
2351
2352        def generator(svc, req):
2353            tries = 0
2354            while True:
2355                try:
2356                    plumbing_response = svc.stub.List(
2357                        req,
2358                        metadata=svc.parent.get_metadata(
2359                            'IdentityAliasesHistory.List', req),
2360                        timeout=timeout)
2361                except Exception as e:
2362                    if self.parent.shouldRetry(tries, e):
2363                        tries += 1
2364                        self.parent.jitterSleep(tries)
2365                        continue
2366                    raise plumbing.convert_error_to_porcelain(e) from e
2367                tries = 0
2368                for plumbing_item in plumbing_response.history:
2369                    yield plumbing.convert_identity_alias_history_to_porcelain(
2370                        plumbing_item)
2371                if plumbing_response.meta.next_cursor == '':
2372                    break
2373                req.meta.cursor = plumbing_response.meta.next_cursor
2374
2375        return generator(self, req)
2376
2377
2378class IdentitySets:
2379    '''
2380     A IdentitySet is a named grouping of Identity Aliases for Accounts.
2381     An Account's relationship to a IdentitySet is defined via IdentityAlias objects.
2382    See `strongdm.models.IdentitySet`.
2383    '''
2384    def __init__(self, channel, client):
2385        self.parent = client
2386        self.stub = IdentitySetsStub(channel)
2387
2388    def create(self, identity_set, timeout=None):
2389        '''
2390         Create registers a new IdentitySet.
2391        '''
2392        req = IdentitySetCreateRequest()
2393
2394        if identity_set is not None:
2395            req.identity_set.CopyFrom(
2396                plumbing.convert_identity_set_to_plumbing(identity_set))
2397        tries = 0
2398        plumbing_response = None
2399        while True:
2400            try:
2401                plumbing_response = self.stub.Create(
2402                    req,
2403                    metadata=self.parent.get_metadata('IdentitySets.Create',
2404                                                      req),
2405                    timeout=timeout)
2406            except Exception as e:
2407                if self.parent.shouldRetry(tries, e):
2408                    tries += 1
2409                    self.parent.jitterSleep(tries)
2410                    continue
2411                raise plumbing.convert_error_to_porcelain(e) from e
2412            break
2413
2414        resp = models.IdentitySetCreateResponse()
2415        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2416            plumbing_response.identity_set)
2417        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2418            plumbing_response.meta)
2419        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2420            plumbing_response.rate_limit)
2421        return resp
2422
2423    def get(self, id, timeout=None):
2424        '''
2425         Get reads one IdentitySet by ID.
2426        '''
2427        req = IdentitySetGetRequest()
2428        if self.parent.snapshot_datetime is not None:
2429            req.meta.CopyFrom(GetRequestMetadata())
2430            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2431
2432        req.id = (id)
2433        tries = 0
2434        plumbing_response = None
2435        while True:
2436            try:
2437                plumbing_response = self.stub.Get(
2438                    req,
2439                    metadata=self.parent.get_metadata('IdentitySets.Get', req),
2440                    timeout=timeout)
2441            except Exception as e:
2442                if self.parent.shouldRetry(tries, e):
2443                    tries += 1
2444                    self.parent.jitterSleep(tries)
2445                    continue
2446                raise plumbing.convert_error_to_porcelain(e) from e
2447            break
2448
2449        resp = models.IdentitySetGetResponse()
2450        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2451            plumbing_response.identity_set)
2452        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2453            plumbing_response.meta)
2454        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2455            plumbing_response.rate_limit)
2456        return resp
2457
2458    def update(self, identity_set, timeout=None):
2459        '''
2460         Update replaces all the fields of a IdentitySet by ID.
2461        '''
2462        req = IdentitySetUpdateRequest()
2463
2464        if identity_set is not None:
2465            req.identity_set.CopyFrom(
2466                plumbing.convert_identity_set_to_plumbing(identity_set))
2467        tries = 0
2468        plumbing_response = None
2469        while True:
2470            try:
2471                plumbing_response = self.stub.Update(
2472                    req,
2473                    metadata=self.parent.get_metadata('IdentitySets.Update',
2474                                                      req),
2475                    timeout=timeout)
2476            except Exception as e:
2477                if self.parent.shouldRetry(tries, e):
2478                    tries += 1
2479                    self.parent.jitterSleep(tries)
2480                    continue
2481                raise plumbing.convert_error_to_porcelain(e) from e
2482            break
2483
2484        resp = models.IdentitySetUpdateResponse()
2485        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2486            plumbing_response.identity_set)
2487        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2488            plumbing_response.meta)
2489        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2490            plumbing_response.rate_limit)
2491        return resp
2492
2493    def delete(self, id, timeout=None):
2494        '''
2495         Delete removes a IdentitySet by ID.
2496        '''
2497        req = IdentitySetDeleteRequest()
2498
2499        req.id = (id)
2500        tries = 0
2501        plumbing_response = None
2502        while True:
2503            try:
2504                plumbing_response = self.stub.Delete(
2505                    req,
2506                    metadata=self.parent.get_metadata('IdentitySets.Delete',
2507                                                      req),
2508                    timeout=timeout)
2509            except Exception as e:
2510                if self.parent.shouldRetry(tries, e):
2511                    tries += 1
2512                    self.parent.jitterSleep(tries)
2513                    continue
2514                raise plumbing.convert_error_to_porcelain(e) from e
2515            break
2516
2517        resp = models.IdentitySetDeleteResponse()
2518        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2519            plumbing_response.meta)
2520        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2521            plumbing_response.rate_limit)
2522        return resp
2523
2524    def list(self, filter, *args, timeout=None):
2525        '''
2526         List gets a list of IdentitySets matching a given set of criteria.
2527        '''
2528        req = IdentitySetListRequest()
2529        req.meta.CopyFrom(ListRequestMetadata())
2530        if self.parent.page_limit > 0:
2531            req.meta.limit = self.parent.page_limit
2532        if self.parent.snapshot_datetime is not None:
2533            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2534
2535        req.filter = plumbing.quote_filter_args(filter, *args)
2536
2537        def generator(svc, req):
2538            tries = 0
2539            while True:
2540                try:
2541                    plumbing_response = svc.stub.List(
2542                        req,
2543                        metadata=svc.parent.get_metadata(
2544                            'IdentitySets.List', req),
2545                        timeout=timeout)
2546                except Exception as e:
2547                    if self.parent.shouldRetry(tries, e):
2548                        tries += 1
2549                        self.parent.jitterSleep(tries)
2550                        continue
2551                    raise plumbing.convert_error_to_porcelain(e) from e
2552                tries = 0
2553                for plumbing_item in plumbing_response.identity_sets:
2554                    yield plumbing.convert_identity_set_to_porcelain(
2555                        plumbing_item)
2556                if plumbing_response.meta.next_cursor == '':
2557                    break
2558                req.meta.cursor = plumbing_response.meta.next_cursor
2559
2560        return generator(self, req)
2561
2562
2563class SnapshotIdentitySets:
2564    '''
2565    SnapshotIdentitySets exposes the read only methods of the IdentitySets
2566    service for historical queries.
2567    '''
2568    def __init__(self, identity_sets):
2569        self.identity_sets = identity_sets
2570
2571    def get(self, id, timeout=None):
2572        '''
2573         Get reads one IdentitySet by ID.
2574        '''
2575        return self.identity_sets.get(id, timeout=timeout)
2576
2577    def list(self, filter, *args, timeout=None):
2578        '''
2579         List gets a list of IdentitySets matching a given set of criteria.
2580        '''
2581        return self.identity_sets.list(filter, *args, timeout=timeout)
2582
2583
2584class IdentitySetsHistory:
2585    '''
2586     IdentitySetsHistory records all changes to the state of a IdentitySet.
2587    See `strongdm.models.IdentitySetHistory`.
2588    '''
2589    def __init__(self, channel, client):
2590        self.parent = client
2591        self.stub = IdentitySetsHistoryStub(channel)
2592
2593    def list(self, filter, *args, timeout=None):
2594        '''
2595         List gets a list of IdentitySetHistory records matching a given set of criteria.
2596        '''
2597        req = IdentitySetHistoryListRequest()
2598        req.meta.CopyFrom(ListRequestMetadata())
2599        if self.parent.page_limit > 0:
2600            req.meta.limit = self.parent.page_limit
2601        if self.parent.snapshot_datetime is not None:
2602            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2603
2604        req.filter = plumbing.quote_filter_args(filter, *args)
2605
2606        def generator(svc, req):
2607            tries = 0
2608            while True:
2609                try:
2610                    plumbing_response = svc.stub.List(
2611                        req,
2612                        metadata=svc.parent.get_metadata(
2613                            'IdentitySetsHistory.List', req),
2614                        timeout=timeout)
2615                except Exception as e:
2616                    if self.parent.shouldRetry(tries, e):
2617                        tries += 1
2618                        self.parent.jitterSleep(tries)
2619                        continue
2620                    raise plumbing.convert_error_to_porcelain(e) from e
2621                tries = 0
2622                for plumbing_item in plumbing_response.history:
2623                    yield plumbing.convert_identity_set_history_to_porcelain(
2624                        plumbing_item)
2625                if plumbing_response.meta.next_cursor == '':
2626                    break
2627                req.meta.cursor = plumbing_response.meta.next_cursor
2628
2629        return generator(self, req)
2630
2631
2632class Nodes:
2633    '''
2634     Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
2635     - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
2636     - **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.
2637    See:
2638    `strongdm.models.Gateway`
2639    `strongdm.models.ProxyCluster`
2640    `strongdm.models.Relay`
2641    '''
2642    def __init__(self, channel, client):
2643        self.parent = client
2644        self.stub = NodesStub(channel)
2645
2646    def create(self, node, timeout=None):
2647        '''
2648         Create registers a new Node.
2649        '''
2650        req = NodeCreateRequest()
2651
2652        if node is not None:
2653            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
2654        tries = 0
2655        plumbing_response = None
2656        while True:
2657            try:
2658                plumbing_response = self.stub.Create(
2659                    req,
2660                    metadata=self.parent.get_metadata('Nodes.Create', req),
2661                    timeout=timeout)
2662            except Exception as e:
2663                if self.parent.shouldRetry(tries, e):
2664                    tries += 1
2665                    self.parent.jitterSleep(tries)
2666                    continue
2667                raise plumbing.convert_error_to_porcelain(e) from e
2668            break
2669
2670        resp = models.NodeCreateResponse()
2671        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2672            plumbing_response.meta)
2673        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2674        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2675            plumbing_response.rate_limit)
2676        resp.token = (plumbing_response.token)
2677        return resp
2678
2679    def get(self, id, timeout=None):
2680        '''
2681         Get reads one Node by ID.
2682        '''
2683        req = NodeGetRequest()
2684        if self.parent.snapshot_datetime is not None:
2685            req.meta.CopyFrom(GetRequestMetadata())
2686            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2687
2688        req.id = (id)
2689        tries = 0
2690        plumbing_response = None
2691        while True:
2692            try:
2693                plumbing_response = self.stub.Get(
2694                    req,
2695                    metadata=self.parent.get_metadata('Nodes.Get', req),
2696                    timeout=timeout)
2697            except Exception as e:
2698                if self.parent.shouldRetry(tries, e):
2699                    tries += 1
2700                    self.parent.jitterSleep(tries)
2701                    continue
2702                raise plumbing.convert_error_to_porcelain(e) from e
2703            break
2704
2705        resp = models.NodeGetResponse()
2706        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2707            plumbing_response.meta)
2708        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2709        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2710            plumbing_response.rate_limit)
2711        return resp
2712
2713    def update(self, node, timeout=None):
2714        '''
2715         Update replaces all the fields of a Node by ID.
2716        '''
2717        req = NodeUpdateRequest()
2718
2719        if node is not None:
2720            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
2721        tries = 0
2722        plumbing_response = None
2723        while True:
2724            try:
2725                plumbing_response = self.stub.Update(
2726                    req,
2727                    metadata=self.parent.get_metadata('Nodes.Update', req),
2728                    timeout=timeout)
2729            except Exception as e:
2730                if self.parent.shouldRetry(tries, e):
2731                    tries += 1
2732                    self.parent.jitterSleep(tries)
2733                    continue
2734                raise plumbing.convert_error_to_porcelain(e) from e
2735            break
2736
2737        resp = models.NodeUpdateResponse()
2738        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2739            plumbing_response.meta)
2740        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2741        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2742            plumbing_response.rate_limit)
2743        return resp
2744
2745    def delete(self, id, timeout=None):
2746        '''
2747         Delete removes a Node by ID.
2748        '''
2749        req = NodeDeleteRequest()
2750
2751        req.id = (id)
2752        tries = 0
2753        plumbing_response = None
2754        while True:
2755            try:
2756                plumbing_response = self.stub.Delete(
2757                    req,
2758                    metadata=self.parent.get_metadata('Nodes.Delete', req),
2759                    timeout=timeout)
2760            except Exception as e:
2761                if self.parent.shouldRetry(tries, e):
2762                    tries += 1
2763                    self.parent.jitterSleep(tries)
2764                    continue
2765                raise plumbing.convert_error_to_porcelain(e) from e
2766            break
2767
2768        resp = models.NodeDeleteResponse()
2769        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2770            plumbing_response.meta)
2771        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2772            plumbing_response.rate_limit)
2773        return resp
2774
2775    def list(self, filter, *args, timeout=None):
2776        '''
2777         List gets a list of Nodes matching a given set of criteria.
2778        '''
2779        req = NodeListRequest()
2780        req.meta.CopyFrom(ListRequestMetadata())
2781        if self.parent.page_limit > 0:
2782            req.meta.limit = self.parent.page_limit
2783        if self.parent.snapshot_datetime is not None:
2784            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2785
2786        req.filter = plumbing.quote_filter_args(filter, *args)
2787
2788        def generator(svc, req):
2789            tries = 0
2790            while True:
2791                try:
2792                    plumbing_response = svc.stub.List(
2793                        req,
2794                        metadata=svc.parent.get_metadata('Nodes.List', req),
2795                        timeout=timeout)
2796                except Exception as e:
2797                    if self.parent.shouldRetry(tries, e):
2798                        tries += 1
2799                        self.parent.jitterSleep(tries)
2800                        continue
2801                    raise plumbing.convert_error_to_porcelain(e) from e
2802                tries = 0
2803                for plumbing_item in plumbing_response.nodes:
2804                    yield plumbing.convert_node_to_porcelain(plumbing_item)
2805                if plumbing_response.meta.next_cursor == '':
2806                    break
2807                req.meta.cursor = plumbing_response.meta.next_cursor
2808
2809        return generator(self, req)
2810
2811
2812class SnapshotNodes:
2813    '''
2814    SnapshotNodes exposes the read only methods of the Nodes
2815    service for historical queries.
2816    '''
2817    def __init__(self, nodes):
2818        self.nodes = nodes
2819
2820    def get(self, id, timeout=None):
2821        '''
2822         Get reads one Node by ID.
2823        '''
2824        return self.nodes.get(id, timeout=timeout)
2825
2826    def list(self, filter, *args, timeout=None):
2827        '''
2828         List gets a list of Nodes matching a given set of criteria.
2829        '''
2830        return self.nodes.list(filter, *args, timeout=timeout)
2831
2832
2833class NodesHistory:
2834    '''
2835     NodesHistory records all changes to the state of a Node.
2836    See `strongdm.models.NodeHistory`.
2837    '''
2838    def __init__(self, channel, client):
2839        self.parent = client
2840        self.stub = NodesHistoryStub(channel)
2841
2842    def list(self, filter, *args, timeout=None):
2843        '''
2844         List gets a list of NodeHistory records matching a given set of criteria.
2845        '''
2846        req = NodeHistoryListRequest()
2847        req.meta.CopyFrom(ListRequestMetadata())
2848        if self.parent.page_limit > 0:
2849            req.meta.limit = self.parent.page_limit
2850        if self.parent.snapshot_datetime is not None:
2851            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2852
2853        req.filter = plumbing.quote_filter_args(filter, *args)
2854
2855        def generator(svc, req):
2856            tries = 0
2857            while True:
2858                try:
2859                    plumbing_response = svc.stub.List(
2860                        req,
2861                        metadata=svc.parent.get_metadata(
2862                            'NodesHistory.List', req),
2863                        timeout=timeout)
2864                except Exception as e:
2865                    if self.parent.shouldRetry(tries, e):
2866                        tries += 1
2867                        self.parent.jitterSleep(tries)
2868                        continue
2869                    raise plumbing.convert_error_to_porcelain(e) from e
2870                tries = 0
2871                for plumbing_item in plumbing_response.history:
2872                    yield plumbing.convert_node_history_to_porcelain(
2873                        plumbing_item)
2874                if plumbing_response.meta.next_cursor == '':
2875                    break
2876                req.meta.cursor = plumbing_response.meta.next_cursor
2877
2878        return generator(self, req)
2879
2880
2881class OrganizationHistory:
2882    '''
2883     OrganizationHistory records all changes to the state of an Organization.
2884    See `strongdm.models.OrganizationHistoryRecord`.
2885    '''
2886    def __init__(self, channel, client):
2887        self.parent = client
2888        self.stub = OrganizationHistoryStub(channel)
2889
2890    def list(self, filter, *args, timeout=None):
2891        '''
2892         List gets a list of OrganizationHistory records matching a given set of criteria.
2893        '''
2894        req = OrganizationHistoryListRequest()
2895        req.meta.CopyFrom(ListRequestMetadata())
2896        if self.parent.page_limit > 0:
2897            req.meta.limit = self.parent.page_limit
2898        if self.parent.snapshot_datetime is not None:
2899            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2900
2901        req.filter = plumbing.quote_filter_args(filter, *args)
2902
2903        def generator(svc, req):
2904            tries = 0
2905            while True:
2906                try:
2907                    plumbing_response = svc.stub.List(
2908                        req,
2909                        metadata=svc.parent.get_metadata(
2910                            'OrganizationHistory.List', req),
2911                        timeout=timeout)
2912                except Exception as e:
2913                    if self.parent.shouldRetry(tries, e):
2914                        tries += 1
2915                        self.parent.jitterSleep(tries)
2916                        continue
2917                    raise plumbing.convert_error_to_porcelain(e) from e
2918                tries = 0
2919                for plumbing_item in plumbing_response.history:
2920                    yield plumbing.convert_organization_history_record_to_porcelain(
2921                        plumbing_item)
2922                if plumbing_response.meta.next_cursor == '':
2923                    break
2924                req.meta.cursor = plumbing_response.meta.next_cursor
2925
2926        return generator(self, req)
2927
2928
2929class PeeringGroupNodes:
2930    '''
2931     PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group.
2932    See `strongdm.models.PeeringGroupNode`.
2933    '''
2934    def __init__(self, channel, client):
2935        self.parent = client
2936        self.stub = PeeringGroupNodesStub(channel)
2937
2938    def create(self, peering_group_node, timeout=None):
2939        '''
2940         Create attaches a Node to a PeeringGroup
2941        '''
2942        req = PeeringGroupNodeCreateRequest()
2943
2944        if peering_group_node is not None:
2945            req.peering_group_node.CopyFrom(
2946                plumbing.convert_peering_group_node_to_plumbing(
2947                    peering_group_node))
2948        tries = 0
2949        plumbing_response = None
2950        while True:
2951            try:
2952                plumbing_response = self.stub.Create(
2953                    req,
2954                    metadata=self.parent.get_metadata(
2955                        'PeeringGroupNodes.Create', req),
2956                    timeout=timeout)
2957            except Exception as e:
2958                if self.parent.shouldRetry(tries, e):
2959                    tries += 1
2960                    self.parent.jitterSleep(tries)
2961                    continue
2962                raise plumbing.convert_error_to_porcelain(e) from e
2963            break
2964
2965        resp = models.PeeringGroupNodeCreateResponse()
2966        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2967            plumbing_response.meta)
2968        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
2969            plumbing_response.peering_group_node)
2970        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2971            plumbing_response.rate_limit)
2972        return resp
2973
2974    def delete(self, id, timeout=None):
2975        '''
2976         Delete detaches a Node to a PeeringGroup.
2977        '''
2978        req = PeeringGroupNodeDeleteRequest()
2979
2980        req.id = (id)
2981        tries = 0
2982        plumbing_response = None
2983        while True:
2984            try:
2985                plumbing_response = self.stub.Delete(
2986                    req,
2987                    metadata=self.parent.get_metadata(
2988                        'PeeringGroupNodes.Delete', 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            break
2997
2998        resp = models.PeeringGroupNodeDeleteResponse()
2999        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3000            plumbing_response.meta)
3001        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3002            plumbing_response.rate_limit)
3003        return resp
3004
3005    def get(self, id, timeout=None):
3006        '''
3007         Get reads the information of one peering group to node attachment.
3008        '''
3009        req = PeeringGroupNodeGetRequest()
3010        if self.parent.snapshot_datetime is not None:
3011            req.meta.CopyFrom(GetRequestMetadata())
3012            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3013
3014        req.id = (id)
3015        tries = 0
3016        plumbing_response = None
3017        while True:
3018            try:
3019                plumbing_response = self.stub.Get(
3020                    req,
3021                    metadata=self.parent.get_metadata('PeeringGroupNodes.Get',
3022                                                      req),
3023                    timeout=timeout)
3024            except Exception as e:
3025                if self.parent.shouldRetry(tries, e):
3026                    tries += 1
3027                    self.parent.jitterSleep(tries)
3028                    continue
3029                raise plumbing.convert_error_to_porcelain(e) from e
3030            break
3031
3032        resp = models.PeeringGroupNodeGetResponse()
3033        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3034            plumbing_response.meta)
3035        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
3036            plumbing_response.peering_group_node)
3037        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3038            plumbing_response.rate_limit)
3039        return resp
3040
3041    def list(self, filter, *args, timeout=None):
3042        '''
3043         List gets a list of peering group node attachments.
3044        '''
3045        req = PeeringGroupNodeListRequest()
3046        req.meta.CopyFrom(ListRequestMetadata())
3047        if self.parent.page_limit > 0:
3048            req.meta.limit = self.parent.page_limit
3049        if self.parent.snapshot_datetime is not None:
3050            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3051
3052        req.filter = plumbing.quote_filter_args(filter, *args)
3053
3054        def generator(svc, req):
3055            tries = 0
3056            while True:
3057                try:
3058                    plumbing_response = svc.stub.List(
3059                        req,
3060                        metadata=svc.parent.get_metadata(
3061                            'PeeringGroupNodes.List', req),
3062                        timeout=timeout)
3063                except Exception as e:
3064                    if self.parent.shouldRetry(tries, e):
3065                        tries += 1
3066                        self.parent.jitterSleep(tries)
3067                        continue
3068                    raise plumbing.convert_error_to_porcelain(e) from e
3069                tries = 0
3070                for plumbing_item in plumbing_response.peering_group_nodes:
3071                    yield plumbing.convert_peering_group_node_to_porcelain(
3072                        plumbing_item)
3073                if plumbing_response.meta.next_cursor == '':
3074                    break
3075                req.meta.cursor = plumbing_response.meta.next_cursor
3076
3077        return generator(self, req)
3078
3079
3080class PeeringGroupPeers:
3081    '''
3082     PeeringGroupPeers provides the building blocks necessary to link two peering groups.
3083    See `strongdm.models.PeeringGroupPeer`.
3084    '''
3085    def __init__(self, channel, client):
3086        self.parent = client
3087        self.stub = PeeringGroupPeersStub(channel)
3088
3089    def create(self, peering_group_peer, timeout=None):
3090        '''
3091         Create links two peering groups.
3092        '''
3093        req = PeeringGroupPeerCreateRequest()
3094
3095        if peering_group_peer is not None:
3096            req.peering_group_peer.CopyFrom(
3097                plumbing.convert_peering_group_peer_to_plumbing(
3098                    peering_group_peer))
3099        tries = 0
3100        plumbing_response = None
3101        while True:
3102            try:
3103                plumbing_response = self.stub.Create(
3104                    req,
3105                    metadata=self.parent.get_metadata(
3106                        'PeeringGroupPeers.Create', req),
3107                    timeout=timeout)
3108            except Exception as e:
3109                if self.parent.shouldRetry(tries, e):
3110                    tries += 1
3111                    self.parent.jitterSleep(tries)
3112                    continue
3113                raise plumbing.convert_error_to_porcelain(e) from e
3114            break
3115
3116        resp = models.PeeringGroupPeerCreateResponse()
3117        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3118            plumbing_response.meta)
3119        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3120            plumbing_response.peering_group_peer)
3121        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3122            plumbing_response.rate_limit)
3123        return resp
3124
3125    def delete(self, id, timeout=None):
3126        '''
3127         Delete unlinks two peering groups.
3128        '''
3129        req = PeeringGroupPeerDeleteRequest()
3130
3131        req.id = (id)
3132        tries = 0
3133        plumbing_response = None
3134        while True:
3135            try:
3136                plumbing_response = self.stub.Delete(
3137                    req,
3138                    metadata=self.parent.get_metadata(
3139                        'PeeringGroupPeers.Delete', req),
3140                    timeout=timeout)
3141            except Exception as e:
3142                if self.parent.shouldRetry(tries, e):
3143                    tries += 1
3144                    self.parent.jitterSleep(tries)
3145                    continue
3146                raise plumbing.convert_error_to_porcelain(e) from e
3147            break
3148
3149        resp = models.PeeringGroupPeerDeleteResponse()
3150        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3151            plumbing_response.meta)
3152        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3153            plumbing_response.rate_limit)
3154        return resp
3155
3156    def get(self, id, timeout=None):
3157        '''
3158         Get reads the information of one peering group link.
3159        '''
3160        req = PeeringGroupPeerGetRequest()
3161        if self.parent.snapshot_datetime is not None:
3162            req.meta.CopyFrom(GetRequestMetadata())
3163            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3164
3165        req.id = (id)
3166        tries = 0
3167        plumbing_response = None
3168        while True:
3169            try:
3170                plumbing_response = self.stub.Get(
3171                    req,
3172                    metadata=self.parent.get_metadata('PeeringGroupPeers.Get',
3173                                                      req),
3174                    timeout=timeout)
3175            except Exception as e:
3176                if self.parent.shouldRetry(tries, e):
3177                    tries += 1
3178                    self.parent.jitterSleep(tries)
3179                    continue
3180                raise plumbing.convert_error_to_porcelain(e) from e
3181            break
3182
3183        resp = models.PeeringGroupPeerGetResponse()
3184        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3185            plumbing_response.meta)
3186        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3187            plumbing_response.peering_group_peer)
3188        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3189            plumbing_response.rate_limit)
3190        return resp
3191
3192    def list(self, filter, *args, timeout=None):
3193        '''
3194         List gets a list of peering group links.
3195        '''
3196        req = PeeringGroupPeerListRequest()
3197        req.meta.CopyFrom(ListRequestMetadata())
3198        if self.parent.page_limit > 0:
3199            req.meta.limit = self.parent.page_limit
3200        if self.parent.snapshot_datetime is not None:
3201            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3202
3203        req.filter = plumbing.quote_filter_args(filter, *args)
3204
3205        def generator(svc, req):
3206            tries = 0
3207            while True:
3208                try:
3209                    plumbing_response = svc.stub.List(
3210                        req,
3211                        metadata=svc.parent.get_metadata(
3212                            'PeeringGroupPeers.List', req),
3213                        timeout=timeout)
3214                except Exception as e:
3215                    if self.parent.shouldRetry(tries, e):
3216                        tries += 1
3217                        self.parent.jitterSleep(tries)
3218                        continue
3219                    raise plumbing.convert_error_to_porcelain(e) from e
3220                tries = 0
3221                for plumbing_item in plumbing_response.peering_group_peers:
3222                    yield plumbing.convert_peering_group_peer_to_porcelain(
3223                        plumbing_item)
3224                if plumbing_response.meta.next_cursor == '':
3225                    break
3226                req.meta.cursor = plumbing_response.meta.next_cursor
3227
3228        return generator(self, req)
3229
3230
3231class PeeringGroupResources:
3232    '''
3233     PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group.
3234    See `strongdm.models.PeeringGroupResource`.
3235    '''
3236    def __init__(self, channel, client):
3237        self.parent = client
3238        self.stub = PeeringGroupResourcesStub(channel)
3239
3240    def create(self, peering_group_resource, timeout=None):
3241        '''
3242         Create attaches a Resource to a PeeringGroup
3243        '''
3244        req = PeeringGroupResourceCreateRequest()
3245
3246        if peering_group_resource is not None:
3247            req.peering_group_resource.CopyFrom(
3248                plumbing.convert_peering_group_resource_to_plumbing(
3249                    peering_group_resource))
3250        tries = 0
3251        plumbing_response = None
3252        while True:
3253            try:
3254                plumbing_response = self.stub.Create(
3255                    req,
3256                    metadata=self.parent.get_metadata(
3257                        'PeeringGroupResources.Create', req),
3258                    timeout=timeout)
3259            except Exception as e:
3260                if self.parent.shouldRetry(tries, e):
3261                    tries += 1
3262                    self.parent.jitterSleep(tries)
3263                    continue
3264                raise plumbing.convert_error_to_porcelain(e) from e
3265            break
3266
3267        resp = models.PeeringGroupResourceCreateResponse()
3268        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3269            plumbing_response.meta)
3270        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3271            plumbing_response.peering_group_resource)
3272        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3273            plumbing_response.rate_limit)
3274        return resp
3275
3276    def delete(self, id, timeout=None):
3277        '''
3278         Delete detaches a Resource to a PeeringGroup
3279        '''
3280        req = PeeringGroupResourceDeleteRequest()
3281
3282        req.id = (id)
3283        tries = 0
3284        plumbing_response = None
3285        while True:
3286            try:
3287                plumbing_response = self.stub.Delete(
3288                    req,
3289                    metadata=self.parent.get_metadata(
3290                        'PeeringGroupResources.Delete', req),
3291                    timeout=timeout)
3292            except Exception as e:
3293                if self.parent.shouldRetry(tries, e):
3294                    tries += 1
3295                    self.parent.jitterSleep(tries)
3296                    continue
3297                raise plumbing.convert_error_to_porcelain(e) from e
3298            break
3299
3300        resp = models.PeeringGroupResourceDeleteResponse()
3301        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3302            plumbing_response.meta)
3303        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3304            plumbing_response.rate_limit)
3305        return resp
3306
3307    def get(self, id, timeout=None):
3308        '''
3309         Get reads the information of one peering group to resource attachment.
3310        '''
3311        req = PeeringGroupResourceGetRequest()
3312        if self.parent.snapshot_datetime is not None:
3313            req.meta.CopyFrom(GetRequestMetadata())
3314            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3315
3316        req.id = (id)
3317        tries = 0
3318        plumbing_response = None
3319        while True:
3320            try:
3321                plumbing_response = self.stub.Get(
3322                    req,
3323                    metadata=self.parent.get_metadata(
3324                        'PeeringGroupResources.Get', req),
3325                    timeout=timeout)
3326            except Exception as e:
3327                if self.parent.shouldRetry(tries, e):
3328                    tries += 1
3329                    self.parent.jitterSleep(tries)
3330                    continue
3331                raise plumbing.convert_error_to_porcelain(e) from e
3332            break
3333
3334        resp = models.PeeringGroupResourceGetResponse()
3335        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3336            plumbing_response.meta)
3337        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3338            plumbing_response.peering_group_resource)
3339        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3340            plumbing_response.rate_limit)
3341        return resp
3342
3343    def list(self, filter, *args, timeout=None):
3344        '''
3345         List gets a list of peering group resource attachments.
3346        '''
3347        req = PeeringGroupResourceListRequest()
3348        req.meta.CopyFrom(ListRequestMetadata())
3349        if self.parent.page_limit > 0:
3350            req.meta.limit = self.parent.page_limit
3351        if self.parent.snapshot_datetime is not None:
3352            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3353
3354        req.filter = plumbing.quote_filter_args(filter, *args)
3355
3356        def generator(svc, req):
3357            tries = 0
3358            while True:
3359                try:
3360                    plumbing_response = svc.stub.List(
3361                        req,
3362                        metadata=svc.parent.get_metadata(
3363                            'PeeringGroupResources.List', req),
3364                        timeout=timeout)
3365                except Exception as e:
3366                    if self.parent.shouldRetry(tries, e):
3367                        tries += 1
3368                        self.parent.jitterSleep(tries)
3369                        continue
3370                    raise plumbing.convert_error_to_porcelain(e) from e
3371                tries = 0
3372                for plumbing_item in plumbing_response.peering_group_resources:
3373                    yield plumbing.convert_peering_group_resource_to_porcelain(
3374                        plumbing_item)
3375                if plumbing_response.meta.next_cursor == '':
3376                    break
3377                req.meta.cursor = plumbing_response.meta.next_cursor
3378
3379        return generator(self, req)
3380
3381
3382class PeeringGroups:
3383    '''
3384     PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing.
3385    See `strongdm.models.PeeringGroup`.
3386    '''
3387    def __init__(self, channel, client):
3388        self.parent = client
3389        self.stub = PeeringGroupsStub(channel)
3390
3391    def create(self, peering_group, timeout=None):
3392        '''
3393         Create registers a new PeeringGroup.
3394        '''
3395        req = PeeringGroupCreateRequest()
3396
3397        if peering_group is not None:
3398            req.peering_group.CopyFrom(
3399                plumbing.convert_peering_group_to_plumbing(peering_group))
3400        tries = 0
3401        plumbing_response = None
3402        while True:
3403            try:
3404                plumbing_response = self.stub.Create(
3405                    req,
3406                    metadata=self.parent.get_metadata('PeeringGroups.Create',
3407                                                      req),
3408                    timeout=timeout)
3409            except Exception as e:
3410                if self.parent.shouldRetry(tries, e):
3411                    tries += 1
3412                    self.parent.jitterSleep(tries)
3413                    continue
3414                raise plumbing.convert_error_to_porcelain(e) from e
3415            break
3416
3417        resp = models.PeeringGroupCreateResponse()
3418        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3419            plumbing_response.meta)
3420        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3421            plumbing_response.peering_group)
3422        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3423            plumbing_response.rate_limit)
3424        return resp
3425
3426    def delete(self, id, timeout=None):
3427        '''
3428         Delete removes a PeeringGroup by ID.
3429        '''
3430        req = PeeringGroupDeleteRequest()
3431
3432        req.id = (id)
3433        tries = 0
3434        plumbing_response = None
3435        while True:
3436            try:
3437                plumbing_response = self.stub.Delete(
3438                    req,
3439                    metadata=self.parent.get_metadata('PeeringGroups.Delete',
3440                                                      req),
3441                    timeout=timeout)
3442            except Exception as e:
3443                if self.parent.shouldRetry(tries, e):
3444                    tries += 1
3445                    self.parent.jitterSleep(tries)
3446                    continue
3447                raise plumbing.convert_error_to_porcelain(e) from e
3448            break
3449
3450        resp = models.PeeringGroupDeleteResponse()
3451        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3452            plumbing_response.meta)
3453        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3454            plumbing_response.rate_limit)
3455        return resp
3456
3457    def get(self, id, timeout=None):
3458        '''
3459         Get reads one PeeringGroup by ID. It will load all its dependencies.
3460        '''
3461        req = PeeringGroupGetRequest()
3462        if self.parent.snapshot_datetime is not None:
3463            req.meta.CopyFrom(GetRequestMetadata())
3464            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3465
3466        req.id = (id)
3467        tries = 0
3468        plumbing_response = None
3469        while True:
3470            try:
3471                plumbing_response = self.stub.Get(
3472                    req,
3473                    metadata=self.parent.get_metadata('PeeringGroups.Get',
3474                                                      req),
3475                    timeout=timeout)
3476            except Exception as e:
3477                if self.parent.shouldRetry(tries, e):
3478                    tries += 1
3479                    self.parent.jitterSleep(tries)
3480                    continue
3481                raise plumbing.convert_error_to_porcelain(e) from e
3482            break
3483
3484        resp = models.PeeringGroupGetResponse()
3485        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3486            plumbing_response.meta)
3487        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3488            plumbing_response.peering_group)
3489        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3490            plumbing_response.rate_limit)
3491        return resp
3492
3493    def list(self, filter, *args, timeout=None):
3494        '''
3495         List gets a list of Peering Groups.
3496        '''
3497        req = PeeringGroupListRequest()
3498        req.meta.CopyFrom(ListRequestMetadata())
3499        if self.parent.page_limit > 0:
3500            req.meta.limit = self.parent.page_limit
3501        if self.parent.snapshot_datetime is not None:
3502            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3503
3504        req.filter = plumbing.quote_filter_args(filter, *args)
3505
3506        def generator(svc, req):
3507            tries = 0
3508            while True:
3509                try:
3510                    plumbing_response = svc.stub.List(
3511                        req,
3512                        metadata=svc.parent.get_metadata(
3513                            'PeeringGroups.List', req),
3514                        timeout=timeout)
3515                except Exception as e:
3516                    if self.parent.shouldRetry(tries, e):
3517                        tries += 1
3518                        self.parent.jitterSleep(tries)
3519                        continue
3520                    raise plumbing.convert_error_to_porcelain(e) from e
3521                tries = 0
3522                for plumbing_item in plumbing_response.peering_groups:
3523                    yield plumbing.convert_peering_group_to_porcelain(
3524                        plumbing_item)
3525                if plumbing_response.meta.next_cursor == '':
3526                    break
3527                req.meta.cursor = plumbing_response.meta.next_cursor
3528
3529        return generator(self, req)
3530
3531
3532class Policies:
3533    '''
3534     Policies are the collection of one or more statements that enforce fine-grained access
3535     control for the users of an organization.
3536    See `strongdm.models.Policy`.
3537    '''
3538    def __init__(self, channel, client):
3539        self.parent = client
3540        self.stub = PoliciesStub(channel)
3541
3542    def create(self, policy, timeout=None):
3543        '''
3544         Create creates a new Policy.
3545        '''
3546        req = PolicyCreateRequest()
3547
3548        if policy is not None:
3549            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3550        tries = 0
3551        plumbing_response = None
3552        while True:
3553            try:
3554                plumbing_response = self.stub.Create(
3555                    req,
3556                    metadata=self.parent.get_metadata('Policies.Create', req),
3557                    timeout=timeout)
3558            except Exception as e:
3559                if self.parent.shouldRetry(tries, e):
3560                    tries += 1
3561                    self.parent.jitterSleep(tries)
3562                    continue
3563                raise plumbing.convert_error_to_porcelain(e) from e
3564            break
3565
3566        resp = models.PolicyCreateResponse()
3567        resp.policy = plumbing.convert_policy_to_porcelain(
3568            plumbing_response.policy)
3569        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3570            plumbing_response.rate_limit)
3571        return resp
3572
3573    def delete(self, id, timeout=None):
3574        '''
3575         Delete removes a Policy by ID.
3576        '''
3577        req = PolicyDeleteRequest()
3578
3579        req.id = (id)
3580        tries = 0
3581        plumbing_response = None
3582        while True:
3583            try:
3584                plumbing_response = self.stub.Delete(
3585                    req,
3586                    metadata=self.parent.get_metadata('Policies.Delete', req),
3587                    timeout=timeout)
3588            except Exception as e:
3589                if self.parent.shouldRetry(tries, e):
3590                    tries += 1
3591                    self.parent.jitterSleep(tries)
3592                    continue
3593                raise plumbing.convert_error_to_porcelain(e) from e
3594            break
3595
3596        resp = models.PolicyDeleteResponse()
3597        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3598            plumbing_response.rate_limit)
3599        return resp
3600
3601    def update(self, policy, timeout=None):
3602        '''
3603         Update replaces all the fields of a Policy by ID.
3604        '''
3605        req = PolicyUpdateRequest()
3606
3607        if policy is not None:
3608            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3609        tries = 0
3610        plumbing_response = None
3611        while True:
3612            try:
3613                plumbing_response = self.stub.Update(
3614                    req,
3615                    metadata=self.parent.get_metadata('Policies.Update', req),
3616                    timeout=timeout)
3617            except Exception as e:
3618                if self.parent.shouldRetry(tries, e):
3619                    tries += 1
3620                    self.parent.jitterSleep(tries)
3621                    continue
3622                raise plumbing.convert_error_to_porcelain(e) from e
3623            break
3624
3625        resp = models.PolicyUpdateResponse()
3626        resp.policy = plumbing.convert_policy_to_porcelain(
3627            plumbing_response.policy)
3628        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3629            plumbing_response.rate_limit)
3630        return resp
3631
3632    def get(self, id, timeout=None):
3633        '''
3634         Get reads one Policy by ID.
3635        '''
3636        req = PolicyGetRequest()
3637        if self.parent.snapshot_datetime is not None:
3638            req.meta.CopyFrom(GetRequestMetadata())
3639            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3640
3641        req.id = (id)
3642        tries = 0
3643        plumbing_response = None
3644        while True:
3645            try:
3646                plumbing_response = self.stub.Get(
3647                    req,
3648                    metadata=self.parent.get_metadata('Policies.Get', req),
3649                    timeout=timeout)
3650            except Exception as e:
3651                if self.parent.shouldRetry(tries, e):
3652                    tries += 1
3653                    self.parent.jitterSleep(tries)
3654                    continue
3655                raise plumbing.convert_error_to_porcelain(e) from e
3656            break
3657
3658        resp = models.PolicyGetResponse()
3659        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3660            plumbing_response.meta)
3661        resp.policy = plumbing.convert_policy_to_porcelain(
3662            plumbing_response.policy)
3663        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3664            plumbing_response.rate_limit)
3665        return resp
3666
3667    def list(self, filter, *args, timeout=None):
3668        '''
3669         List gets a list of Policy matching a given set of criteria
3670        '''
3671        req = PolicyListRequest()
3672        req.meta.CopyFrom(ListRequestMetadata())
3673        if self.parent.page_limit > 0:
3674            req.meta.limit = self.parent.page_limit
3675        if self.parent.snapshot_datetime is not None:
3676            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3677
3678        req.filter = plumbing.quote_filter_args(filter, *args)
3679
3680        def generator(svc, req):
3681            tries = 0
3682            while True:
3683                try:
3684                    plumbing_response = svc.stub.List(
3685                        req,
3686                        metadata=svc.parent.get_metadata('Policies.List', req),
3687                        timeout=timeout)
3688                except Exception as e:
3689                    if self.parent.shouldRetry(tries, e):
3690                        tries += 1
3691                        self.parent.jitterSleep(tries)
3692                        continue
3693                    raise plumbing.convert_error_to_porcelain(e) from e
3694                tries = 0
3695                for plumbing_item in plumbing_response.policies:
3696                    yield plumbing.convert_policy_to_porcelain(plumbing_item)
3697                if plumbing_response.meta.next_cursor == '':
3698                    break
3699                req.meta.cursor = plumbing_response.meta.next_cursor
3700
3701        return generator(self, req)
3702
3703
3704class SnapshotPolicies:
3705    '''
3706    SnapshotPolicies exposes the read only methods of the Policies
3707    service for historical queries.
3708    '''
3709    def __init__(self, policies):
3710        self.policies = policies
3711
3712    def get(self, id, timeout=None):
3713        '''
3714         Get reads one Policy by ID.
3715        '''
3716        return self.policies.get(id, timeout=timeout)
3717
3718    def list(self, filter, *args, timeout=None):
3719        '''
3720         List gets a list of Policy matching a given set of criteria
3721        '''
3722        return self.policies.list(filter, *args, timeout=timeout)
3723
3724
3725class PoliciesHistory:
3726    '''
3727     PoliciesHistory records all changes to the state of a Policy.
3728    See `strongdm.models.PolicyHistory`.
3729    '''
3730    def __init__(self, channel, client):
3731        self.parent = client
3732        self.stub = PoliciesHistoryStub(channel)
3733
3734    def list(self, filter, *args, timeout=None):
3735        '''
3736         List gets a list of PolicyHistory records matching a given set of criteria.
3737        '''
3738        req = PoliciesHistoryListRequest()
3739        req.meta.CopyFrom(ListRequestMetadata())
3740        if self.parent.page_limit > 0:
3741            req.meta.limit = self.parent.page_limit
3742        if self.parent.snapshot_datetime is not None:
3743            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3744
3745        req.filter = plumbing.quote_filter_args(filter, *args)
3746
3747        def generator(svc, req):
3748            tries = 0
3749            while True:
3750                try:
3751                    plumbing_response = svc.stub.List(
3752                        req,
3753                        metadata=svc.parent.get_metadata(
3754                            'PoliciesHistory.List', req),
3755                        timeout=timeout)
3756                except Exception as e:
3757                    if self.parent.shouldRetry(tries, e):
3758                        tries += 1
3759                        self.parent.jitterSleep(tries)
3760                        continue
3761                    raise plumbing.convert_error_to_porcelain(e) from e
3762                tries = 0
3763                for plumbing_item in plumbing_response.history:
3764                    yield plumbing.convert_policy_history_to_porcelain(
3765                        plumbing_item)
3766                if plumbing_response.meta.next_cursor == '':
3767                    break
3768                req.meta.cursor = plumbing_response.meta.next_cursor
3769
3770        return generator(self, req)
3771
3772
3773class ProxyClusterKeys:
3774    '''
3775     Proxy Cluster Keys are authentication keys for all proxies within a cluster.
3776     The proxies within a cluster share the same key. One cluster can have
3777     multiple keys in order to facilitate key rotation.
3778    See `strongdm.models.ProxyClusterKey`.
3779    '''
3780    def __init__(self, channel, client):
3781        self.parent = client
3782        self.stub = ProxyClusterKeysStub(channel)
3783
3784    def create(self, proxy_cluster_key, timeout=None):
3785        '''
3786         Create registers a new ProxyClusterKey.
3787        '''
3788        req = ProxyClusterKeyCreateRequest()
3789
3790        if proxy_cluster_key is not None:
3791            req.proxy_cluster_key.CopyFrom(
3792                plumbing.convert_proxy_cluster_key_to_plumbing(
3793                    proxy_cluster_key))
3794        tries = 0
3795        plumbing_response = None
3796        while True:
3797            try:
3798                plumbing_response = self.stub.Create(
3799                    req,
3800                    metadata=self.parent.get_metadata(
3801                        'ProxyClusterKeys.Create', req),
3802                    timeout=timeout)
3803            except Exception as e:
3804                if self.parent.shouldRetry(tries, e):
3805                    tries += 1
3806                    self.parent.jitterSleep(tries)
3807                    continue
3808                raise plumbing.convert_error_to_porcelain(e) from e
3809            break
3810
3811        resp = models.ProxyClusterKeyCreateResponse()
3812        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3813            plumbing_response.meta)
3814        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
3815            plumbing_response.proxy_cluster_key)
3816        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3817            plumbing_response.rate_limit)
3818        resp.secret_key = (plumbing_response.secret_key)
3819        return resp
3820
3821    def get(self, id, timeout=None):
3822        '''
3823         Get reads one ProxyClusterKey by ID.
3824        '''
3825        req = ProxyClusterKeyGetRequest()
3826        if self.parent.snapshot_datetime is not None:
3827            req.meta.CopyFrom(GetRequestMetadata())
3828            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3829
3830        req.id = (id)
3831        tries = 0
3832        plumbing_response = None
3833        while True:
3834            try:
3835                plumbing_response = self.stub.Get(
3836                    req,
3837                    metadata=self.parent.get_metadata('ProxyClusterKeys.Get',
3838                                                      req),
3839                    timeout=timeout)
3840            except Exception as e:
3841                if self.parent.shouldRetry(tries, e):
3842                    tries += 1
3843                    self.parent.jitterSleep(tries)
3844                    continue
3845                raise plumbing.convert_error_to_porcelain(e) from e
3846            break
3847
3848        resp = models.ProxyClusterKeyGetResponse()
3849        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3850            plumbing_response.meta)
3851        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
3852            plumbing_response.proxy_cluster_key)
3853        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3854            plumbing_response.rate_limit)
3855        return resp
3856
3857    def delete(self, id, timeout=None):
3858        '''
3859         Delete removes a ProxyClusterKey by ID.
3860        '''
3861        req = ProxyClusterKeyDeleteRequest()
3862
3863        req.id = (id)
3864        tries = 0
3865        plumbing_response = None
3866        while True:
3867            try:
3868                plumbing_response = self.stub.Delete(
3869                    req,
3870                    metadata=self.parent.get_metadata(
3871                        'ProxyClusterKeys.Delete', req),
3872                    timeout=timeout)
3873            except Exception as e:
3874                if self.parent.shouldRetry(tries, e):
3875                    tries += 1
3876                    self.parent.jitterSleep(tries)
3877                    continue
3878                raise plumbing.convert_error_to_porcelain(e) from e
3879            break
3880
3881        resp = models.ProxyClusterKeyDeleteResponse()
3882        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3883            plumbing_response.meta)
3884        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3885            plumbing_response.rate_limit)
3886        return resp
3887
3888    def list(self, filter, *args, timeout=None):
3889        '''
3890         List gets a list of ProxyClusterKeys matching a given set of criteria.
3891        '''
3892        req = ProxyClusterKeyListRequest()
3893        req.meta.CopyFrom(ListRequestMetadata())
3894        if self.parent.page_limit > 0:
3895            req.meta.limit = self.parent.page_limit
3896        if self.parent.snapshot_datetime is not None:
3897            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3898
3899        req.filter = plumbing.quote_filter_args(filter, *args)
3900
3901        def generator(svc, req):
3902            tries = 0
3903            while True:
3904                try:
3905                    plumbing_response = svc.stub.List(
3906                        req,
3907                        metadata=svc.parent.get_metadata(
3908                            'ProxyClusterKeys.List', req),
3909                        timeout=timeout)
3910                except Exception as e:
3911                    if self.parent.shouldRetry(tries, e):
3912                        tries += 1
3913                        self.parent.jitterSleep(tries)
3914                        continue
3915                    raise plumbing.convert_error_to_porcelain(e) from e
3916                tries = 0
3917                for plumbing_item in plumbing_response.proxy_cluster_keys:
3918                    yield plumbing.convert_proxy_cluster_key_to_porcelain(
3919                        plumbing_item)
3920                if plumbing_response.meta.next_cursor == '':
3921                    break
3922                req.meta.cursor = plumbing_response.meta.next_cursor
3923
3924        return generator(self, req)
3925
3926
3927class SnapshotProxyClusterKeys:
3928    '''
3929    SnapshotProxyClusterKeys exposes the read only methods of the ProxyClusterKeys
3930    service for historical queries.
3931    '''
3932    def __init__(self, proxy_cluster_keys):
3933        self.proxy_cluster_keys = proxy_cluster_keys
3934
3935    def get(self, id, timeout=None):
3936        '''
3937         Get reads one ProxyClusterKey by ID.
3938        '''
3939        return self.proxy_cluster_keys.get(id, timeout=timeout)
3940
3941    def list(self, filter, *args, timeout=None):
3942        '''
3943         List gets a list of ProxyClusterKeys matching a given set of criteria.
3944        '''
3945        return self.proxy_cluster_keys.list(filter, *args, timeout=timeout)
3946
3947
3948class Queries:
3949    '''
3950     A Query is a record of a single client request to a resource, such as a SQL query.
3951     Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries.
3952     The Queries service is read-only.
3953    See `strongdm.models.Query`.
3954    '''
3955    def __init__(self, channel, client):
3956        self.parent = client
3957        self.stub = QueriesStub(channel)
3958
3959    def list(self, filter, *args, timeout=None):
3960        '''
3961         List gets a list of Queries matching a given set of criteria.
3962        '''
3963        req = QueryListRequest()
3964        req.meta.CopyFrom(ListRequestMetadata())
3965        if self.parent.page_limit > 0:
3966            req.meta.limit = self.parent.page_limit
3967        if self.parent.snapshot_datetime is not None:
3968            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3969
3970        req.filter = plumbing.quote_filter_args(filter, *args)
3971
3972        def generator(svc, req):
3973            tries = 0
3974            while True:
3975                try:
3976                    plumbing_response = svc.stub.List(
3977                        req,
3978                        metadata=svc.parent.get_metadata('Queries.List', req),
3979                        timeout=timeout)
3980                except Exception as e:
3981                    if self.parent.shouldRetry(tries, e):
3982                        tries += 1
3983                        self.parent.jitterSleep(tries)
3984                        continue
3985                    raise plumbing.convert_error_to_porcelain(e) from e
3986                tries = 0
3987                for plumbing_item in plumbing_response.queries:
3988                    yield plumbing.convert_query_to_porcelain(plumbing_item)
3989                if plumbing_response.meta.next_cursor == '':
3990                    break
3991                req.meta.cursor = plumbing_response.meta.next_cursor
3992
3993        return generator(self, req)
3994
3995
3996class RemoteIdentities:
3997    '''
3998     RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource.
3999    See `strongdm.models.RemoteIdentity`.
4000    '''
4001    def __init__(self, channel, client):
4002        self.parent = client
4003        self.stub = RemoteIdentitiesStub(channel)
4004
4005    def create(self, remote_identity, timeout=None):
4006        '''
4007         Create registers a new RemoteIdentity.
4008        '''
4009        req = RemoteIdentityCreateRequest()
4010
4011        if remote_identity is not None:
4012            req.remote_identity.CopyFrom(
4013                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4014        tries = 0
4015        plumbing_response = None
4016        while True:
4017            try:
4018                plumbing_response = self.stub.Create(
4019                    req,
4020                    metadata=self.parent.get_metadata(
4021                        'RemoteIdentities.Create', req),
4022                    timeout=timeout)
4023            except Exception as e:
4024                if self.parent.shouldRetry(tries, e):
4025                    tries += 1
4026                    self.parent.jitterSleep(tries)
4027                    continue
4028                raise plumbing.convert_error_to_porcelain(e) from e
4029            break
4030
4031        resp = models.RemoteIdentityCreateResponse()
4032        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4033            plumbing_response.meta)
4034        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4035            plumbing_response.rate_limit)
4036        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4037            plumbing_response.remote_identity)
4038        return resp
4039
4040    def get(self, id, timeout=None):
4041        '''
4042         Get reads one RemoteIdentity by ID.
4043        '''
4044        req = RemoteIdentityGetRequest()
4045        if self.parent.snapshot_datetime is not None:
4046            req.meta.CopyFrom(GetRequestMetadata())
4047            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4048
4049        req.id = (id)
4050        tries = 0
4051        plumbing_response = None
4052        while True:
4053            try:
4054                plumbing_response = self.stub.Get(
4055                    req,
4056                    metadata=self.parent.get_metadata('RemoteIdentities.Get',
4057                                                      req),
4058                    timeout=timeout)
4059            except Exception as e:
4060                if self.parent.shouldRetry(tries, e):
4061                    tries += 1
4062                    self.parent.jitterSleep(tries)
4063                    continue
4064                raise plumbing.convert_error_to_porcelain(e) from e
4065            break
4066
4067        resp = models.RemoteIdentityGetResponse()
4068        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4069            plumbing_response.meta)
4070        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4071            plumbing_response.rate_limit)
4072        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4073            plumbing_response.remote_identity)
4074        return resp
4075
4076    def update(self, remote_identity, timeout=None):
4077        '''
4078         Update replaces all the fields of a RemoteIdentity by ID.
4079        '''
4080        req = RemoteIdentityUpdateRequest()
4081
4082        if remote_identity is not None:
4083            req.remote_identity.CopyFrom(
4084                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4085        tries = 0
4086        plumbing_response = None
4087        while True:
4088            try:
4089                plumbing_response = self.stub.Update(
4090                    req,
4091                    metadata=self.parent.get_metadata(
4092                        'RemoteIdentities.Update', req),
4093                    timeout=timeout)
4094            except Exception as e:
4095                if self.parent.shouldRetry(tries, e):
4096                    tries += 1
4097                    self.parent.jitterSleep(tries)
4098                    continue
4099                raise plumbing.convert_error_to_porcelain(e) from e
4100            break
4101
4102        resp = models.RemoteIdentityUpdateResponse()
4103        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4104            plumbing_response.meta)
4105        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4106            plumbing_response.rate_limit)
4107        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4108            plumbing_response.remote_identity)
4109        return resp
4110
4111    def delete(self, id, timeout=None):
4112        '''
4113         Delete removes a RemoteIdentity by ID.
4114        '''
4115        req = RemoteIdentityDeleteRequest()
4116
4117        req.id = (id)
4118        tries = 0
4119        plumbing_response = None
4120        while True:
4121            try:
4122                plumbing_response = self.stub.Delete(
4123                    req,
4124                    metadata=self.parent.get_metadata(
4125                        'RemoteIdentities.Delete', req),
4126                    timeout=timeout)
4127            except Exception as e:
4128                if self.parent.shouldRetry(tries, e):
4129                    tries += 1
4130                    self.parent.jitterSleep(tries)
4131                    continue
4132                raise plumbing.convert_error_to_porcelain(e) from e
4133            break
4134
4135        resp = models.RemoteIdentityDeleteResponse()
4136        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4137            plumbing_response.meta)
4138        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4139            plumbing_response.rate_limit)
4140        return resp
4141
4142    def list(self, filter, *args, timeout=None):
4143        '''
4144         List gets a list of RemoteIdentities matching a given set of criteria.
4145        '''
4146        req = RemoteIdentityListRequest()
4147        req.meta.CopyFrom(ListRequestMetadata())
4148        if self.parent.page_limit > 0:
4149            req.meta.limit = self.parent.page_limit
4150        if self.parent.snapshot_datetime is not None:
4151            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4152
4153        req.filter = plumbing.quote_filter_args(filter, *args)
4154
4155        def generator(svc, req):
4156            tries = 0
4157            while True:
4158                try:
4159                    plumbing_response = svc.stub.List(
4160                        req,
4161                        metadata=svc.parent.get_metadata(
4162                            'RemoteIdentities.List', req),
4163                        timeout=timeout)
4164                except Exception as e:
4165                    if self.parent.shouldRetry(tries, e):
4166                        tries += 1
4167                        self.parent.jitterSleep(tries)
4168                        continue
4169                    raise plumbing.convert_error_to_porcelain(e) from e
4170                tries = 0
4171                for plumbing_item in plumbing_response.remote_identities:
4172                    yield plumbing.convert_remote_identity_to_porcelain(
4173                        plumbing_item)
4174                if plumbing_response.meta.next_cursor == '':
4175                    break
4176                req.meta.cursor = plumbing_response.meta.next_cursor
4177
4178        return generator(self, req)
4179
4180
4181class SnapshotRemoteIdentities:
4182    '''
4183    SnapshotRemoteIdentities exposes the read only methods of the RemoteIdentities
4184    service for historical queries.
4185    '''
4186    def __init__(self, remote_identities):
4187        self.remote_identities = remote_identities
4188
4189    def get(self, id, timeout=None):
4190        '''
4191         Get reads one RemoteIdentity by ID.
4192        '''
4193        return self.remote_identities.get(id, timeout=timeout)
4194
4195    def list(self, filter, *args, timeout=None):
4196        '''
4197         List gets a list of RemoteIdentities matching a given set of criteria.
4198        '''
4199        return self.remote_identities.list(filter, *args, timeout=timeout)
4200
4201
4202class RemoteIdentitiesHistory:
4203    '''
4204     RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity.
4205    See `strongdm.models.RemoteIdentityHistory`.
4206    '''
4207    def __init__(self, channel, client):
4208        self.parent = client
4209        self.stub = RemoteIdentitiesHistoryStub(channel)
4210
4211    def list(self, filter, *args, timeout=None):
4212        '''
4213         List gets a list of RemoteIdentityHistory records matching a given set of criteria.
4214        '''
4215        req = RemoteIdentityHistoryListRequest()
4216        req.meta.CopyFrom(ListRequestMetadata())
4217        if self.parent.page_limit > 0:
4218            req.meta.limit = self.parent.page_limit
4219        if self.parent.snapshot_datetime is not None:
4220            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4221
4222        req.filter = plumbing.quote_filter_args(filter, *args)
4223
4224        def generator(svc, req):
4225            tries = 0
4226            while True:
4227                try:
4228                    plumbing_response = svc.stub.List(
4229                        req,
4230                        metadata=svc.parent.get_metadata(
4231                            'RemoteIdentitiesHistory.List', req),
4232                        timeout=timeout)
4233                except Exception as e:
4234                    if self.parent.shouldRetry(tries, e):
4235                        tries += 1
4236                        self.parent.jitterSleep(tries)
4237                        continue
4238                    raise plumbing.convert_error_to_porcelain(e) from e
4239                tries = 0
4240                for plumbing_item in plumbing_response.history:
4241                    yield plumbing.convert_remote_identity_history_to_porcelain(
4242                        plumbing_item)
4243                if plumbing_response.meta.next_cursor == '':
4244                    break
4245                req.meta.cursor = plumbing_response.meta.next_cursor
4246
4247        return generator(self, req)
4248
4249
4250class RemoteIdentityGroups:
4251    '''
4252     A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts.
4253     An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects.
4254    See `strongdm.models.RemoteIdentityGroup`.
4255    '''
4256    def __init__(self, channel, client):
4257        self.parent = client
4258        self.stub = RemoteIdentityGroupsStub(channel)
4259
4260    def get(self, id, timeout=None):
4261        '''
4262         Get reads one RemoteIdentityGroup by ID.
4263        '''
4264        req = RemoteIdentityGroupGetRequest()
4265        if self.parent.snapshot_datetime is not None:
4266            req.meta.CopyFrom(GetRequestMetadata())
4267            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4268
4269        req.id = (id)
4270        tries = 0
4271        plumbing_response = None
4272        while True:
4273            try:
4274                plumbing_response = self.stub.Get(
4275                    req,
4276                    metadata=self.parent.get_metadata(
4277                        'RemoteIdentityGroups.Get', req),
4278                    timeout=timeout)
4279            except Exception as e:
4280                if self.parent.shouldRetry(tries, e):
4281                    tries += 1
4282                    self.parent.jitterSleep(tries)
4283                    continue
4284                raise plumbing.convert_error_to_porcelain(e) from e
4285            break
4286
4287        resp = models.RemoteIdentityGroupGetResponse()
4288        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4289            plumbing_response.meta)
4290        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4291            plumbing_response.rate_limit)
4292        resp.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain(
4293            plumbing_response.remote_identity_group)
4294        return resp
4295
4296    def list(self, filter, *args, timeout=None):
4297        '''
4298         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4299        '''
4300        req = RemoteIdentityGroupListRequest()
4301        req.meta.CopyFrom(ListRequestMetadata())
4302        if self.parent.page_limit > 0:
4303            req.meta.limit = self.parent.page_limit
4304        if self.parent.snapshot_datetime is not None:
4305            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4306
4307        req.filter = plumbing.quote_filter_args(filter, *args)
4308
4309        def generator(svc, req):
4310            tries = 0
4311            while True:
4312                try:
4313                    plumbing_response = svc.stub.List(
4314                        req,
4315                        metadata=svc.parent.get_metadata(
4316                            'RemoteIdentityGroups.List', req),
4317                        timeout=timeout)
4318                except Exception as e:
4319                    if self.parent.shouldRetry(tries, e):
4320                        tries += 1
4321                        self.parent.jitterSleep(tries)
4322                        continue
4323                    raise plumbing.convert_error_to_porcelain(e) from e
4324                tries = 0
4325                for plumbing_item in plumbing_response.remote_identity_groups:
4326                    yield plumbing.convert_remote_identity_group_to_porcelain(
4327                        plumbing_item)
4328                if plumbing_response.meta.next_cursor == '':
4329                    break
4330                req.meta.cursor = plumbing_response.meta.next_cursor
4331
4332        return generator(self, req)
4333
4334
4335class SnapshotRemoteIdentityGroups:
4336    '''
4337    SnapshotRemoteIdentityGroups exposes the read only methods of the RemoteIdentityGroups
4338    service for historical queries.
4339    '''
4340    def __init__(self, remote_identity_groups):
4341        self.remote_identity_groups = remote_identity_groups
4342
4343    def get(self, id, timeout=None):
4344        '''
4345         Get reads one RemoteIdentityGroup by ID.
4346        '''
4347        return self.remote_identity_groups.get(id, timeout=timeout)
4348
4349    def list(self, filter, *args, timeout=None):
4350        '''
4351         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4352        '''
4353        return self.remote_identity_groups.list(filter, *args, timeout=timeout)
4354
4355
4356class RemoteIdentityGroupsHistory:
4357    '''
4358     RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup.
4359    See `strongdm.models.RemoteIdentityGroupHistory`.
4360    '''
4361    def __init__(self, channel, client):
4362        self.parent = client
4363        self.stub = RemoteIdentityGroupsHistoryStub(channel)
4364
4365    def list(self, filter, *args, timeout=None):
4366        '''
4367         List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria.
4368        '''
4369        req = RemoteIdentityGroupHistoryListRequest()
4370        req.meta.CopyFrom(ListRequestMetadata())
4371        if self.parent.page_limit > 0:
4372            req.meta.limit = self.parent.page_limit
4373        if self.parent.snapshot_datetime is not None:
4374            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4375
4376        req.filter = plumbing.quote_filter_args(filter, *args)
4377
4378        def generator(svc, req):
4379            tries = 0
4380            while True:
4381                try:
4382                    plumbing_response = svc.stub.List(
4383                        req,
4384                        metadata=svc.parent.get_metadata(
4385                            'RemoteIdentityGroupsHistory.List', req),
4386                        timeout=timeout)
4387                except Exception as e:
4388                    if self.parent.shouldRetry(tries, e):
4389                        tries += 1
4390                        self.parent.jitterSleep(tries)
4391                        continue
4392                    raise plumbing.convert_error_to_porcelain(e) from e
4393                tries = 0
4394                for plumbing_item in plumbing_response.history:
4395                    yield plumbing.convert_remote_identity_group_history_to_porcelain(
4396                        plumbing_item)
4397                if plumbing_response.meta.next_cursor == '':
4398                    break
4399                req.meta.cursor = plumbing_response.meta.next_cursor
4400
4401        return generator(self, req)
4402
4403
4404class Replays:
4405    '''
4406     A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session
4407     (otherwise referred to as a query). The Replays service is read-only.
4408    See `strongdm.models.ReplayChunk`.
4409    '''
4410    def __init__(self, channel, client):
4411        self.parent = client
4412        self.stub = ReplaysStub(channel)
4413
4414    def list(self, filter, *args, timeout=None):
4415        '''
4416         List gets a list of ReplayChunks for the Query ID specified by the filter criteria.
4417        '''
4418        req = ReplayListRequest()
4419        req.meta.CopyFrom(ListRequestMetadata())
4420        if self.parent.page_limit > 0:
4421            req.meta.limit = self.parent.page_limit
4422        if self.parent.snapshot_datetime is not None:
4423            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4424
4425        req.filter = plumbing.quote_filter_args(filter, *args)
4426
4427        def generator(svc, req):
4428            tries = 0
4429            while True:
4430                try:
4431                    plumbing_response = svc.stub.List(
4432                        req,
4433                        metadata=svc.parent.get_metadata('Replays.List', req),
4434                        timeout=timeout)
4435                except Exception as e:
4436                    if self.parent.shouldRetry(tries, e):
4437                        tries += 1
4438                        self.parent.jitterSleep(tries)
4439                        continue
4440                    raise plumbing.convert_error_to_porcelain(e) from e
4441                tries = 0
4442                for plumbing_item in plumbing_response.chunks:
4443                    yield plumbing.convert_replay_chunk_to_porcelain(
4444                        plumbing_item)
4445                if plumbing_response.meta.next_cursor == '':
4446                    break
4447                req.meta.cursor = plumbing_response.meta.next_cursor
4448
4449        return generator(self, req)
4450
4451
4452class Resources:
4453    '''
4454     Resources are databases, servers, clusters, websites, or clouds that strongDM
4455     delegates access to.
4456    See:
4457    `strongdm.models.AKS`
4458    `strongdm.models.AKSBasicAuth`
4459    `strongdm.models.AKSServiceAccount`
4460    `strongdm.models.AKSServiceAccountUserImpersonation`
4461    `strongdm.models.AKSUserImpersonation`
4462    `strongdm.models.AmazonEKS`
4463    `strongdm.models.AmazonEKSInstanceProfile`
4464    `strongdm.models.AmazonEKSInstanceProfileUserImpersonation`
4465    `strongdm.models.AmazonEKSUserImpersonation`
4466    `strongdm.models.AmazonES`
4467    `strongdm.models.AmazonMQAMQP091`
4468    `strongdm.models.Athena`
4469    `strongdm.models.AuroraMysql`
4470    `strongdm.models.AuroraPostgres`
4471    `strongdm.models.AuroraPostgresIAM`
4472    `strongdm.models.AWS`
4473    `strongdm.models.AWSConsole`
4474    `strongdm.models.AWSConsoleStaticKeyPair`
4475    `strongdm.models.AWSInstanceProfile`
4476    `strongdm.models.Azure`
4477    `strongdm.models.AzureCertificate`
4478    `strongdm.models.AzureMysql`
4479    `strongdm.models.AzurePostgres`
4480    `strongdm.models.AzurePostgresManagedIdentity`
4481    `strongdm.models.BigQuery`
4482    `strongdm.models.Cassandra`
4483    `strongdm.models.Citus`
4484    `strongdm.models.Clustrix`
4485    `strongdm.models.Cockroach`
4486    `strongdm.models.CouchbaseDatabase`
4487    `strongdm.models.CouchbaseWebUI`
4488    `strongdm.models.DB2I`
4489    `strongdm.models.DB2LUW`
4490    `strongdm.models.DocumentDBHost`
4491    `strongdm.models.DocumentDBReplicaSet`
4492    `strongdm.models.Druid`
4493    `strongdm.models.DynamoDB`
4494    `strongdm.models.Elastic`
4495    `strongdm.models.ElasticacheRedis`
4496    `strongdm.models.GCP`
4497    `strongdm.models.GCPConsole`
4498    `strongdm.models.GCPWIF`
4499    `strongdm.models.GoogleGKE`
4500    `strongdm.models.GoogleGKEUserImpersonation`
4501    `strongdm.models.Greenplum`
4502    `strongdm.models.HTTPAuth`
4503    `strongdm.models.HTTPBasicAuth`
4504    `strongdm.models.HTTPNoAuth`
4505    `strongdm.models.Kubernetes`
4506    `strongdm.models.KubernetesBasicAuth`
4507    `strongdm.models.KubernetesServiceAccount`
4508    `strongdm.models.KubernetesServiceAccountUserImpersonation`
4509    `strongdm.models.KubernetesUserImpersonation`
4510    `strongdm.models.Maria`
4511    `strongdm.models.Memcached`
4512    `strongdm.models.Memsql`
4513    `strongdm.models.MongoHost`
4514    `strongdm.models.MongoLegacyHost`
4515    `strongdm.models.MongoLegacyReplicaset`
4516    `strongdm.models.MongoReplicaSet`
4517    `strongdm.models.MongoShardedCluster`
4518    `strongdm.models.MTLSMysql`
4519    `strongdm.models.MTLSPostgres`
4520    `strongdm.models.Mysql`
4521    `strongdm.models.Neptune`
4522    `strongdm.models.NeptuneIAM`
4523    `strongdm.models.Oracle`
4524    `strongdm.models.Postgres`
4525    `strongdm.models.Presto`
4526    `strongdm.models.RabbitMQAMQP091`
4527    `strongdm.models.RawTCP`
4528    `strongdm.models.RDP`
4529    `strongdm.models.RDPCert`
4530    `strongdm.models.RDSPostgresIAM`
4531    `strongdm.models.Redis`
4532    `strongdm.models.Redshift`
4533    `strongdm.models.SingleStore`
4534    `strongdm.models.Snowflake`
4535    `strongdm.models.Snowsight`
4536    `strongdm.models.SQLServer`
4537    `strongdm.models.SQLServerAzureAD`
4538    `strongdm.models.SQLServerKerberosAD`
4539    `strongdm.models.SSH`
4540    `strongdm.models.SSHCert`
4541    `strongdm.models.SSHCustomerKey`
4542    `strongdm.models.SSHPassword`
4543    `strongdm.models.Sybase`
4544    `strongdm.models.SybaseIQ`
4545    `strongdm.models.Teradata`
4546    `strongdm.models.Trino`
4547    '''
4548    def __init__(self, channel, client):
4549        self.parent = client
4550        self.stub = ResourcesStub(channel)
4551
4552    def enumerate_tags(self, filter, *args, timeout=None):
4553        '''
4554         EnumerateTags gets a list of the filter matching tags.
4555        '''
4556        req = EnumerateTagsRequest()
4557        req.meta.CopyFrom(ListRequestMetadata())
4558        if self.parent.page_limit > 0:
4559            req.meta.limit = self.parent.page_limit
4560        if self.parent.snapshot_datetime is not None:
4561            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4562
4563        req.filter = plumbing.quote_filter_args(filter, *args)
4564
4565        def generator(svc, req):
4566            tries = 0
4567            while True:
4568                try:
4569                    plumbing_response = svc.stub.EnumerateTags(
4570                        req,
4571                        metadata=svc.parent.get_metadata(
4572                            'Resources.EnumerateTags', req),
4573                        timeout=timeout)
4574                except Exception as e:
4575                    if self.parent.shouldRetry(tries, e):
4576                        tries += 1
4577                        self.parent.jitterSleep(tries)
4578                        continue
4579                    raise plumbing.convert_error_to_porcelain(e) from e
4580                tries = 0
4581                for plumbing_item in plumbing_response.matches:
4582                    yield plumbing.convert_tag_to_porcelain(plumbing_item)
4583                if plumbing_response.meta.next_cursor == '':
4584                    break
4585                req.meta.cursor = plumbing_response.meta.next_cursor
4586
4587        return generator(self, req)
4588
4589    def create(self, resource, timeout=None):
4590        '''
4591         Create registers a new Resource.
4592        '''
4593        req = ResourceCreateRequest()
4594
4595        if resource is not None:
4596            req.resource.CopyFrom(
4597                plumbing.convert_resource_to_plumbing(resource))
4598        tries = 0
4599        plumbing_response = None
4600        while True:
4601            try:
4602                plumbing_response = self.stub.Create(
4603                    req,
4604                    metadata=self.parent.get_metadata('Resources.Create', req),
4605                    timeout=timeout)
4606            except Exception as e:
4607                if self.parent.shouldRetry(tries, e):
4608                    tries += 1
4609                    self.parent.jitterSleep(tries)
4610                    continue
4611                raise plumbing.convert_error_to_porcelain(e) from e
4612            break
4613
4614        resp = models.ResourceCreateResponse()
4615        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4616            plumbing_response.meta)
4617        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4618            plumbing_response.rate_limit)
4619        resp.resource = plumbing.convert_resource_to_porcelain(
4620            plumbing_response.resource)
4621        return resp
4622
4623    def get(self, id, timeout=None):
4624        '''
4625         Get reads one Resource by ID.
4626        '''
4627        req = ResourceGetRequest()
4628        if self.parent.snapshot_datetime is not None:
4629            req.meta.CopyFrom(GetRequestMetadata())
4630            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4631
4632        req.id = (id)
4633        tries = 0
4634        plumbing_response = None
4635        while True:
4636            try:
4637                plumbing_response = self.stub.Get(
4638                    req,
4639                    metadata=self.parent.get_metadata('Resources.Get', req),
4640                    timeout=timeout)
4641            except Exception as e:
4642                if self.parent.shouldRetry(tries, e):
4643                    tries += 1
4644                    self.parent.jitterSleep(tries)
4645                    continue
4646                raise plumbing.convert_error_to_porcelain(e) from e
4647            break
4648
4649        resp = models.ResourceGetResponse()
4650        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4651            plumbing_response.meta)
4652        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4653            plumbing_response.rate_limit)
4654        resp.resource = plumbing.convert_resource_to_porcelain(
4655            plumbing_response.resource)
4656        return resp
4657
4658    def update(self, resource, timeout=None):
4659        '''
4660         Update replaces all the fields of a Resource by ID.
4661        '''
4662        req = ResourceUpdateRequest()
4663
4664        if resource is not None:
4665            req.resource.CopyFrom(
4666                plumbing.convert_resource_to_plumbing(resource))
4667        tries = 0
4668        plumbing_response = None
4669        while True:
4670            try:
4671                plumbing_response = self.stub.Update(
4672                    req,
4673                    metadata=self.parent.get_metadata('Resources.Update', req),
4674                    timeout=timeout)
4675            except Exception as e:
4676                if self.parent.shouldRetry(tries, e):
4677                    tries += 1
4678                    self.parent.jitterSleep(tries)
4679                    continue
4680                raise plumbing.convert_error_to_porcelain(e) from e
4681            break
4682
4683        resp = models.ResourceUpdateResponse()
4684        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4685            plumbing_response.meta)
4686        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4687            plumbing_response.rate_limit)
4688        resp.resource = plumbing.convert_resource_to_porcelain(
4689            plumbing_response.resource)
4690        return resp
4691
4692    def delete(self, id, timeout=None):
4693        '''
4694         Delete removes a Resource by ID.
4695        '''
4696        req = ResourceDeleteRequest()
4697
4698        req.id = (id)
4699        tries = 0
4700        plumbing_response = None
4701        while True:
4702            try:
4703                plumbing_response = self.stub.Delete(
4704                    req,
4705                    metadata=self.parent.get_metadata('Resources.Delete', req),
4706                    timeout=timeout)
4707            except Exception as e:
4708                if self.parent.shouldRetry(tries, e):
4709                    tries += 1
4710                    self.parent.jitterSleep(tries)
4711                    continue
4712                raise plumbing.convert_error_to_porcelain(e) from e
4713            break
4714
4715        resp = models.ResourceDeleteResponse()
4716        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4717            plumbing_response.meta)
4718        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4719            plumbing_response.rate_limit)
4720        return resp
4721
4722    def list(self, filter, *args, timeout=None):
4723        '''
4724         List gets a list of Resources matching a given set of criteria.
4725        '''
4726        req = ResourceListRequest()
4727        req.meta.CopyFrom(ListRequestMetadata())
4728        if self.parent.page_limit > 0:
4729            req.meta.limit = self.parent.page_limit
4730        if self.parent.snapshot_datetime is not None:
4731            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4732
4733        req.filter = plumbing.quote_filter_args(filter, *args)
4734
4735        def generator(svc, req):
4736            tries = 0
4737            while True:
4738                try:
4739                    plumbing_response = svc.stub.List(
4740                        req,
4741                        metadata=svc.parent.get_metadata(
4742                            'Resources.List', req),
4743                        timeout=timeout)
4744                except Exception as e:
4745                    if self.parent.shouldRetry(tries, e):
4746                        tries += 1
4747                        self.parent.jitterSleep(tries)
4748                        continue
4749                    raise plumbing.convert_error_to_porcelain(e) from e
4750                tries = 0
4751                for plumbing_item in plumbing_response.resources:
4752                    yield plumbing.convert_resource_to_porcelain(plumbing_item)
4753                if plumbing_response.meta.next_cursor == '':
4754                    break
4755                req.meta.cursor = plumbing_response.meta.next_cursor
4756
4757        return generator(self, req)
4758
4759    def healthcheck(self, id, timeout=None):
4760        '''
4761         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
4762         large network of Nodes. The call will return immediately, and the updated health of the
4763         Resource can be retrieved via Get or List.
4764        '''
4765        req = ResourceHealthcheckRequest()
4766
4767        req.id = (id)
4768        tries = 0
4769        plumbing_response = None
4770        while True:
4771            try:
4772                plumbing_response = self.stub.Healthcheck(
4773                    req,
4774                    metadata=self.parent.get_metadata('Resources.Healthcheck',
4775                                                      req),
4776                    timeout=timeout)
4777            except Exception as e:
4778                if self.parent.shouldRetry(tries, e):
4779                    tries += 1
4780                    self.parent.jitterSleep(tries)
4781                    continue
4782                raise plumbing.convert_error_to_porcelain(e) from e
4783            break
4784
4785        resp = models.ResourceHealthcheckResponse()
4786        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4787            plumbing_response.meta)
4788        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4789            plumbing_response.rate_limit)
4790        return resp
4791
4792
4793class SnapshotResources:
4794    '''
4795    SnapshotResources exposes the read only methods of the Resources
4796    service for historical queries.
4797    '''
4798    def __init__(self, resources):
4799        self.resources = resources
4800
4801    def get(self, id, timeout=None):
4802        '''
4803         Get reads one Resource by ID.
4804        '''
4805        return self.resources.get(id, timeout=timeout)
4806
4807    def list(self, filter, *args, timeout=None):
4808        '''
4809         List gets a list of Resources matching a given set of criteria.
4810        '''
4811        return self.resources.list(filter, *args, timeout=timeout)
4812
4813
4814class ResourcesHistory:
4815    '''
4816     ResourcesHistory records all changes to the state of a Resource.
4817    See `strongdm.models.ResourceHistory`.
4818    '''
4819    def __init__(self, channel, client):
4820        self.parent = client
4821        self.stub = ResourcesHistoryStub(channel)
4822
4823    def list(self, filter, *args, timeout=None):
4824        '''
4825         List gets a list of ResourceHistory records matching a given set of criteria.
4826        '''
4827        req = ResourceHistoryListRequest()
4828        req.meta.CopyFrom(ListRequestMetadata())
4829        if self.parent.page_limit > 0:
4830            req.meta.limit = self.parent.page_limit
4831        if self.parent.snapshot_datetime is not None:
4832            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4833
4834        req.filter = plumbing.quote_filter_args(filter, *args)
4835
4836        def generator(svc, req):
4837            tries = 0
4838            while True:
4839                try:
4840                    plumbing_response = svc.stub.List(
4841                        req,
4842                        metadata=svc.parent.get_metadata(
4843                            'ResourcesHistory.List', req),
4844                        timeout=timeout)
4845                except Exception as e:
4846                    if self.parent.shouldRetry(tries, e):
4847                        tries += 1
4848                        self.parent.jitterSleep(tries)
4849                        continue
4850                    raise plumbing.convert_error_to_porcelain(e) from e
4851                tries = 0
4852                for plumbing_item in plumbing_response.history:
4853                    yield plumbing.convert_resource_history_to_porcelain(
4854                        plumbing_item)
4855                if plumbing_response.meta.next_cursor == '':
4856                    break
4857                req.meta.cursor = plumbing_response.meta.next_cursor
4858
4859        return generator(self, req)
4860
4861
4862class RoleResources:
4863    '''
4864     RoleResources enumerates the resources to which roles have access.
4865     The RoleResources service is read-only.
4866    See `strongdm.models.RoleResource`.
4867    '''
4868    def __init__(self, channel, client):
4869        self.parent = client
4870        self.stub = RoleResourcesStub(channel)
4871
4872    def list(self, filter, *args, timeout=None):
4873        '''
4874         List gets a list of RoleResource records matching a given set of criteria.
4875        '''
4876        req = RoleResourceListRequest()
4877        req.meta.CopyFrom(ListRequestMetadata())
4878        if self.parent.page_limit > 0:
4879            req.meta.limit = self.parent.page_limit
4880        if self.parent.snapshot_datetime is not None:
4881            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4882
4883        req.filter = plumbing.quote_filter_args(filter, *args)
4884
4885        def generator(svc, req):
4886            tries = 0
4887            while True:
4888                try:
4889                    plumbing_response = svc.stub.List(
4890                        req,
4891                        metadata=svc.parent.get_metadata(
4892                            'RoleResources.List', req),
4893                        timeout=timeout)
4894                except Exception as e:
4895                    if self.parent.shouldRetry(tries, e):
4896                        tries += 1
4897                        self.parent.jitterSleep(tries)
4898                        continue
4899                    raise plumbing.convert_error_to_porcelain(e) from e
4900                tries = 0
4901                for plumbing_item in plumbing_response.role_resources:
4902                    yield plumbing.convert_role_resource_to_porcelain(
4903                        plumbing_item)
4904                if plumbing_response.meta.next_cursor == '':
4905                    break
4906                req.meta.cursor = plumbing_response.meta.next_cursor
4907
4908        return generator(self, req)
4909
4910
4911class SnapshotRoleResources:
4912    '''
4913    SnapshotRoleResources exposes the read only methods of the RoleResources
4914    service for historical queries.
4915    '''
4916    def __init__(self, role_resources):
4917        self.role_resources = role_resources
4918
4919    def list(self, filter, *args, timeout=None):
4920        '''
4921         List gets a list of RoleResource records matching a given set of criteria.
4922        '''
4923        return self.role_resources.list(filter, *args, timeout=timeout)
4924
4925
4926class RoleResourcesHistory:
4927    '''
4928     RoleResourcesHistory records all changes to the state of a RoleResource.
4929    See `strongdm.models.RoleResourceHistory`.
4930    '''
4931    def __init__(self, channel, client):
4932        self.parent = client
4933        self.stub = RoleResourcesHistoryStub(channel)
4934
4935    def list(self, filter, *args, timeout=None):
4936        '''
4937         List gets a list of RoleResourceHistory records matching a given set of criteria.
4938        '''
4939        req = RoleResourceHistoryListRequest()
4940        req.meta.CopyFrom(ListRequestMetadata())
4941        if self.parent.page_limit > 0:
4942            req.meta.limit = self.parent.page_limit
4943        if self.parent.snapshot_datetime is not None:
4944            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4945
4946        req.filter = plumbing.quote_filter_args(filter, *args)
4947
4948        def generator(svc, req):
4949            tries = 0
4950            while True:
4951                try:
4952                    plumbing_response = svc.stub.List(
4953                        req,
4954                        metadata=svc.parent.get_metadata(
4955                            'RoleResourcesHistory.List', req),
4956                        timeout=timeout)
4957                except Exception as e:
4958                    if self.parent.shouldRetry(tries, e):
4959                        tries += 1
4960                        self.parent.jitterSleep(tries)
4961                        continue
4962                    raise plumbing.convert_error_to_porcelain(e) from e
4963                tries = 0
4964                for plumbing_item in plumbing_response.history:
4965                    yield plumbing.convert_role_resource_history_to_porcelain(
4966                        plumbing_item)
4967                if plumbing_response.meta.next_cursor == '':
4968                    break
4969                req.meta.cursor = plumbing_response.meta.next_cursor
4970
4971        return generator(self, req)
4972
4973
4974class Roles:
4975    '''
4976     A Role has a list of access rules which determine which Resources the members
4977     of the Role have access to. An Account can be a member of multiple Roles via
4978     AccountAttachments.
4979    See `strongdm.models.Role`.
4980    '''
4981    def __init__(self, channel, client):
4982        self.parent = client
4983        self.stub = RolesStub(channel)
4984
4985    def create(self, role, timeout=None):
4986        '''
4987         Create registers a new Role.
4988        '''
4989        req = RoleCreateRequest()
4990
4991        if role is not None:
4992            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
4993        tries = 0
4994        plumbing_response = None
4995        while True:
4996            try:
4997                plumbing_response = self.stub.Create(
4998                    req,
4999                    metadata=self.parent.get_metadata('Roles.Create', req),
5000                    timeout=timeout)
5001            except Exception as e:
5002                if self.parent.shouldRetry(tries, e):
5003                    tries += 1
5004                    self.parent.jitterSleep(tries)
5005                    continue
5006                raise plumbing.convert_error_to_porcelain(e) from e
5007            break
5008
5009        resp = models.RoleCreateResponse()
5010        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5011            plumbing_response.meta)
5012        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5013            plumbing_response.rate_limit)
5014        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5015        return resp
5016
5017    def get(self, id, timeout=None):
5018        '''
5019         Get reads one Role by ID.
5020        '''
5021        req = RoleGetRequest()
5022        if self.parent.snapshot_datetime is not None:
5023            req.meta.CopyFrom(GetRequestMetadata())
5024            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5025
5026        req.id = (id)
5027        tries = 0
5028        plumbing_response = None
5029        while True:
5030            try:
5031                plumbing_response = self.stub.Get(
5032                    req,
5033                    metadata=self.parent.get_metadata('Roles.Get', req),
5034                    timeout=timeout)
5035            except Exception as e:
5036                if self.parent.shouldRetry(tries, e):
5037                    tries += 1
5038                    self.parent.jitterSleep(tries)
5039                    continue
5040                raise plumbing.convert_error_to_porcelain(e) from e
5041            break
5042
5043        resp = models.RoleGetResponse()
5044        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5045            plumbing_response.meta)
5046        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5047            plumbing_response.rate_limit)
5048        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5049        return resp
5050
5051    def update(self, role, timeout=None):
5052        '''
5053         Update replaces all the fields of a Role by ID.
5054        '''
5055        req = RoleUpdateRequest()
5056
5057        if role is not None:
5058            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5059        tries = 0
5060        plumbing_response = None
5061        while True:
5062            try:
5063                plumbing_response = self.stub.Update(
5064                    req,
5065                    metadata=self.parent.get_metadata('Roles.Update', req),
5066                    timeout=timeout)
5067            except Exception as e:
5068                if self.parent.shouldRetry(tries, e):
5069                    tries += 1
5070                    self.parent.jitterSleep(tries)
5071                    continue
5072                raise plumbing.convert_error_to_porcelain(e) from e
5073            break
5074
5075        resp = models.RoleUpdateResponse()
5076        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5077            plumbing_response.meta)
5078        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5079            plumbing_response.rate_limit)
5080        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5081        return resp
5082
5083    def delete(self, id, timeout=None):
5084        '''
5085         Delete removes a Role by ID.
5086        '''
5087        req = RoleDeleteRequest()
5088
5089        req.id = (id)
5090        tries = 0
5091        plumbing_response = None
5092        while True:
5093            try:
5094                plumbing_response = self.stub.Delete(
5095                    req,
5096                    metadata=self.parent.get_metadata('Roles.Delete', 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            break
5105
5106        resp = models.RoleDeleteResponse()
5107        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5108            plumbing_response.meta)
5109        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5110            plumbing_response.rate_limit)
5111        return resp
5112
5113    def list(self, filter, *args, timeout=None):
5114        '''
5115         List gets a list of Roles matching a given set of criteria.
5116        '''
5117        req = RoleListRequest()
5118        req.meta.CopyFrom(ListRequestMetadata())
5119        if self.parent.page_limit > 0:
5120            req.meta.limit = self.parent.page_limit
5121        if self.parent.snapshot_datetime is not None:
5122            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5123
5124        req.filter = plumbing.quote_filter_args(filter, *args)
5125
5126        def generator(svc, req):
5127            tries = 0
5128            while True:
5129                try:
5130                    plumbing_response = svc.stub.List(
5131                        req,
5132                        metadata=svc.parent.get_metadata('Roles.List', req),
5133                        timeout=timeout)
5134                except Exception as e:
5135                    if self.parent.shouldRetry(tries, e):
5136                        tries += 1
5137                        self.parent.jitterSleep(tries)
5138                        continue
5139                    raise plumbing.convert_error_to_porcelain(e) from e
5140                tries = 0
5141                for plumbing_item in plumbing_response.roles:
5142                    yield plumbing.convert_role_to_porcelain(plumbing_item)
5143                if plumbing_response.meta.next_cursor == '':
5144                    break
5145                req.meta.cursor = plumbing_response.meta.next_cursor
5146
5147        return generator(self, req)
5148
5149
5150class SnapshotRoles:
5151    '''
5152    SnapshotRoles exposes the read only methods of the Roles
5153    service for historical queries.
5154    '''
5155    def __init__(self, roles):
5156        self.roles = roles
5157
5158    def get(self, id, timeout=None):
5159        '''
5160         Get reads one Role by ID.
5161        '''
5162        return self.roles.get(id, timeout=timeout)
5163
5164    def list(self, filter, *args, timeout=None):
5165        '''
5166         List gets a list of Roles matching a given set of criteria.
5167        '''
5168        return self.roles.list(filter, *args, timeout=timeout)
5169
5170
5171class RolesHistory:
5172    '''
5173     RolesHistory records all changes to the state of a Role.
5174    See `strongdm.models.RoleHistory`.
5175    '''
5176    def __init__(self, channel, client):
5177        self.parent = client
5178        self.stub = RolesHistoryStub(channel)
5179
5180    def list(self, filter, *args, timeout=None):
5181        '''
5182         List gets a list of RoleHistory records matching a given set of criteria.
5183        '''
5184        req = RoleHistoryListRequest()
5185        req.meta.CopyFrom(ListRequestMetadata())
5186        if self.parent.page_limit > 0:
5187            req.meta.limit = self.parent.page_limit
5188        if self.parent.snapshot_datetime is not None:
5189            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5190
5191        req.filter = plumbing.quote_filter_args(filter, *args)
5192
5193        def generator(svc, req):
5194            tries = 0
5195            while True:
5196                try:
5197                    plumbing_response = svc.stub.List(
5198                        req,
5199                        metadata=svc.parent.get_metadata(
5200                            'RolesHistory.List', req),
5201                        timeout=timeout)
5202                except Exception as e:
5203                    if self.parent.shouldRetry(tries, e):
5204                        tries += 1
5205                        self.parent.jitterSleep(tries)
5206                        continue
5207                    raise plumbing.convert_error_to_porcelain(e) from e
5208                tries = 0
5209                for plumbing_item in plumbing_response.history:
5210                    yield plumbing.convert_role_history_to_porcelain(
5211                        plumbing_item)
5212                if plumbing_response.meta.next_cursor == '':
5213                    break
5214                req.meta.cursor = plumbing_response.meta.next_cursor
5215
5216        return generator(self, req)
5217
5218
5219class SecretStores:
5220    '''
5221     SecretStores are servers where resource secrets (passwords, keys) are stored.
5222    See:
5223    `strongdm.models.ActiveDirectoryStore`
5224    `strongdm.models.AWSStore`
5225    `strongdm.models.AWSCertX509Store`
5226    `strongdm.models.AzureStore`
5227    `strongdm.models.CyberarkConjurStore`
5228    `strongdm.models.CyberarkPAMStore`
5229    `strongdm.models.CyberarkPAMExperimentalStore`
5230    `strongdm.models.DelineaStore`
5231    `strongdm.models.GCPStore`
5232    `strongdm.models.GCPCertX509Store`
5233    `strongdm.models.KeyfactorSSHStore`
5234    `strongdm.models.KeyfactorX509Store`
5235    `strongdm.models.VaultAppRoleStore`
5236    `strongdm.models.VaultAppRoleCertSSHStore`
5237    `strongdm.models.VaultAppRoleCertX509Store`
5238    `strongdm.models.VaultAWSEC2Store`
5239    `strongdm.models.VaultAWSIAMStore`
5240    `strongdm.models.VaultTLSStore`
5241    `strongdm.models.VaultTLSCertSSHStore`
5242    `strongdm.models.VaultTLSCertX509Store`
5243    `strongdm.models.VaultTokenStore`
5244    `strongdm.models.VaultTokenCertSSHStore`
5245    `strongdm.models.VaultTokenCertX509Store`
5246    '''
5247    def __init__(self, channel, client):
5248        self.parent = client
5249        self.stub = SecretStoresStub(channel)
5250
5251    def create(self, secret_store, timeout=None):
5252        req = SecretStoreCreateRequest()
5253
5254        if secret_store is not None:
5255            req.secret_store.CopyFrom(
5256                plumbing.convert_secret_store_to_plumbing(secret_store))
5257        tries = 0
5258        plumbing_response = None
5259        while True:
5260            try:
5261                plumbing_response = self.stub.Create(
5262                    req,
5263                    metadata=self.parent.get_metadata('SecretStores.Create',
5264                                                      req),
5265                    timeout=timeout)
5266            except Exception as e:
5267                if self.parent.shouldRetry(tries, e):
5268                    tries += 1
5269                    self.parent.jitterSleep(tries)
5270                    continue
5271                raise plumbing.convert_error_to_porcelain(e) from e
5272            break
5273
5274        resp = models.SecretStoreCreateResponse()
5275        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5276            plumbing_response.meta)
5277        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5278            plumbing_response.rate_limit)
5279        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5280            plumbing_response.secret_store)
5281        return resp
5282
5283    def get(self, id, timeout=None):
5284        '''
5285         Get reads one SecretStore by ID.
5286        '''
5287        req = SecretStoreGetRequest()
5288        if self.parent.snapshot_datetime is not None:
5289            req.meta.CopyFrom(GetRequestMetadata())
5290            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5291
5292        req.id = (id)
5293        tries = 0
5294        plumbing_response = None
5295        while True:
5296            try:
5297                plumbing_response = self.stub.Get(
5298                    req,
5299                    metadata=self.parent.get_metadata('SecretStores.Get', req),
5300                    timeout=timeout)
5301            except Exception as e:
5302                if self.parent.shouldRetry(tries, e):
5303                    tries += 1
5304                    self.parent.jitterSleep(tries)
5305                    continue
5306                raise plumbing.convert_error_to_porcelain(e) from e
5307            break
5308
5309        resp = models.SecretStoreGetResponse()
5310        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5311            plumbing_response.meta)
5312        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5313            plumbing_response.rate_limit)
5314        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5315            plumbing_response.secret_store)
5316        return resp
5317
5318    def update(self, secret_store, timeout=None):
5319        '''
5320         Update replaces all the fields of a SecretStore by ID.
5321        '''
5322        req = SecretStoreUpdateRequest()
5323
5324        if secret_store is not None:
5325            req.secret_store.CopyFrom(
5326                plumbing.convert_secret_store_to_plumbing(secret_store))
5327        tries = 0
5328        plumbing_response = None
5329        while True:
5330            try:
5331                plumbing_response = self.stub.Update(
5332                    req,
5333                    metadata=self.parent.get_metadata('SecretStores.Update',
5334                                                      req),
5335                    timeout=timeout)
5336            except Exception as e:
5337                if self.parent.shouldRetry(tries, e):
5338                    tries += 1
5339                    self.parent.jitterSleep(tries)
5340                    continue
5341                raise plumbing.convert_error_to_porcelain(e) from e
5342            break
5343
5344        resp = models.SecretStoreUpdateResponse()
5345        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5346            plumbing_response.meta)
5347        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5348            plumbing_response.rate_limit)
5349        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5350            plumbing_response.secret_store)
5351        return resp
5352
5353    def delete(self, id, timeout=None):
5354        '''
5355         Delete removes a SecretStore by ID.
5356        '''
5357        req = SecretStoreDeleteRequest()
5358
5359        req.id = (id)
5360        tries = 0
5361        plumbing_response = None
5362        while True:
5363            try:
5364                plumbing_response = self.stub.Delete(
5365                    req,
5366                    metadata=self.parent.get_metadata('SecretStores.Delete',
5367                                                      req),
5368                    timeout=timeout)
5369            except Exception as e:
5370                if self.parent.shouldRetry(tries, e):
5371                    tries += 1
5372                    self.parent.jitterSleep(tries)
5373                    continue
5374                raise plumbing.convert_error_to_porcelain(e) from e
5375            break
5376
5377        resp = models.SecretStoreDeleteResponse()
5378        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5379            plumbing_response.meta)
5380        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5381            plumbing_response.rate_limit)
5382        return resp
5383
5384    def list(self, filter, *args, timeout=None):
5385        '''
5386         List gets a list of SecretStores matching a given set of criteria.
5387        '''
5388        req = SecretStoreListRequest()
5389        req.meta.CopyFrom(ListRequestMetadata())
5390        if self.parent.page_limit > 0:
5391            req.meta.limit = self.parent.page_limit
5392        if self.parent.snapshot_datetime is not None:
5393            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5394
5395        req.filter = plumbing.quote_filter_args(filter, *args)
5396
5397        def generator(svc, req):
5398            tries = 0
5399            while True:
5400                try:
5401                    plumbing_response = svc.stub.List(
5402                        req,
5403                        metadata=svc.parent.get_metadata(
5404                            'SecretStores.List', req),
5405                        timeout=timeout)
5406                except Exception as e:
5407                    if self.parent.shouldRetry(tries, e):
5408                        tries += 1
5409                        self.parent.jitterSleep(tries)
5410                        continue
5411                    raise plumbing.convert_error_to_porcelain(e) from e
5412                tries = 0
5413                for plumbing_item in plumbing_response.secret_stores:
5414                    yield plumbing.convert_secret_store_to_porcelain(
5415                        plumbing_item)
5416                if plumbing_response.meta.next_cursor == '':
5417                    break
5418                req.meta.cursor = plumbing_response.meta.next_cursor
5419
5420        return generator(self, req)
5421
5422
5423class SnapshotSecretStores:
5424    '''
5425    SnapshotSecretStores exposes the read only methods of the SecretStores
5426    service for historical queries.
5427    '''
5428    def __init__(self, secret_stores):
5429        self.secret_stores = secret_stores
5430
5431    def get(self, id, timeout=None):
5432        '''
5433         Get reads one SecretStore by ID.
5434        '''
5435        return self.secret_stores.get(id, timeout=timeout)
5436
5437    def list(self, filter, *args, timeout=None):
5438        '''
5439         List gets a list of SecretStores matching a given set of criteria.
5440        '''
5441        return self.secret_stores.list(filter, *args, timeout=timeout)
5442
5443
5444class SecretStoreHealths:
5445    '''
5446     SecretStoreHealths exposes health states for secret stores.
5447    See `strongdm.models.SecretStoreHealth`.
5448    '''
5449    def __init__(self, channel, client):
5450        self.parent = client
5451        self.stub = SecretStoreHealthsStub(channel)
5452
5453    def list(self, filter, *args, timeout=None):
5454        '''
5455         List reports the health status of node to secret store pairs.
5456        '''
5457        req = SecretStoreHealthListRequest()
5458        req.meta.CopyFrom(ListRequestMetadata())
5459        if self.parent.page_limit > 0:
5460            req.meta.limit = self.parent.page_limit
5461        if self.parent.snapshot_datetime is not None:
5462            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5463
5464        req.filter = plumbing.quote_filter_args(filter, *args)
5465
5466        def generator(svc, req):
5467            tries = 0
5468            while True:
5469                try:
5470                    plumbing_response = svc.stub.List(
5471                        req,
5472                        metadata=svc.parent.get_metadata(
5473                            'SecretStoreHealths.List', req),
5474                        timeout=timeout)
5475                except Exception as e:
5476                    if self.parent.shouldRetry(tries, e):
5477                        tries += 1
5478                        self.parent.jitterSleep(tries)
5479                        continue
5480                    raise plumbing.convert_error_to_porcelain(e) from e
5481                tries = 0
5482                for plumbing_item in plumbing_response.secret_store_healths:
5483                    yield plumbing.convert_secret_store_health_to_porcelain(
5484                        plumbing_item)
5485                if plumbing_response.meta.next_cursor == '':
5486                    break
5487                req.meta.cursor = plumbing_response.meta.next_cursor
5488
5489        return generator(self, req)
5490
5491    def healthcheck(self, secret_store_id, timeout=None):
5492        '''
5493         Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
5494         to propagate across a large network of Nodes. The call will return immediately, and the
5495         updated health of the Secret Store can be retrieved via List.
5496        '''
5497        req = SecretStoreHealthcheckRequest()
5498
5499        req.secret_store_id = (secret_store_id)
5500        tries = 0
5501        plumbing_response = None
5502        while True:
5503            try:
5504                plumbing_response = self.stub.Healthcheck(
5505                    req,
5506                    metadata=self.parent.get_metadata(
5507                        'SecretStoreHealths.Healthcheck', req),
5508                    timeout=timeout)
5509            except Exception as e:
5510                if self.parent.shouldRetry(tries, e):
5511                    tries += 1
5512                    self.parent.jitterSleep(tries)
5513                    continue
5514                raise plumbing.convert_error_to_porcelain(e) from e
5515            break
5516
5517        resp = models.SecretStoreHealthcheckResponse()
5518        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5519            plumbing_response.rate_limit)
5520        return resp
5521
5522
5523class SecretStoresHistory:
5524    '''
5525     SecretStoresHistory records all changes to the state of a SecretStore.
5526    See `strongdm.models.SecretStoreHistory`.
5527    '''
5528    def __init__(self, channel, client):
5529        self.parent = client
5530        self.stub = SecretStoresHistoryStub(channel)
5531
5532    def list(self, filter, *args, timeout=None):
5533        '''
5534         List gets a list of SecretStoreHistory records matching a given set of criteria.
5535        '''
5536        req = SecretStoreHistoryListRequest()
5537        req.meta.CopyFrom(ListRequestMetadata())
5538        if self.parent.page_limit > 0:
5539            req.meta.limit = self.parent.page_limit
5540        if self.parent.snapshot_datetime is not None:
5541            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5542
5543        req.filter = plumbing.quote_filter_args(filter, *args)
5544
5545        def generator(svc, req):
5546            tries = 0
5547            while True:
5548                try:
5549                    plumbing_response = svc.stub.List(
5550                        req,
5551                        metadata=svc.parent.get_metadata(
5552                            'SecretStoresHistory.List', req),
5553                        timeout=timeout)
5554                except Exception as e:
5555                    if self.parent.shouldRetry(tries, e):
5556                        tries += 1
5557                        self.parent.jitterSleep(tries)
5558                        continue
5559                    raise plumbing.convert_error_to_porcelain(e) from e
5560                tries = 0
5561                for plumbing_item in plumbing_response.history:
5562                    yield plumbing.convert_secret_store_history_to_porcelain(
5563                        plumbing_item)
5564                if plumbing_response.meta.next_cursor == '':
5565                    break
5566                req.meta.cursor = plumbing_response.meta.next_cursor
5567
5568        return generator(self, req)
5569
5570
5571class WorkflowApprovers:
5572    '''
5573     WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow.
5574    See `strongdm.models.WorkflowApprover`.
5575    '''
5576    def __init__(self, channel, client):
5577        self.parent = client
5578        self.stub = WorkflowApproversStub(channel)
5579
5580    def create(self, workflow_approver, timeout=None):
5581        '''
5582         Create creates a new workflow approver
5583        '''
5584        req = WorkflowApproversCreateRequest()
5585
5586        if workflow_approver is not None:
5587            req.workflow_approver.CopyFrom(
5588                plumbing.convert_workflow_approver_to_plumbing(
5589                    workflow_approver))
5590        tries = 0
5591        plumbing_response = None
5592        while True:
5593            try:
5594                plumbing_response = self.stub.Create(
5595                    req,
5596                    metadata=self.parent.get_metadata(
5597                        'WorkflowApprovers.Create', req),
5598                    timeout=timeout)
5599            except Exception as e:
5600                if self.parent.shouldRetry(tries, e):
5601                    tries += 1
5602                    self.parent.jitterSleep(tries)
5603                    continue
5604                raise plumbing.convert_error_to_porcelain(e) from e
5605            break
5606
5607        resp = models.WorkflowApproversCreateResponse()
5608        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5609            plumbing_response.rate_limit)
5610        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5611            plumbing_response.workflow_approver)
5612        return resp
5613
5614    def get(self, id, timeout=None):
5615        '''
5616         Get reads one workflow approver by ID.
5617        '''
5618        req = WorkflowApproverGetRequest()
5619        if self.parent.snapshot_datetime is not None:
5620            req.meta.CopyFrom(GetRequestMetadata())
5621            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5622
5623        req.id = (id)
5624        tries = 0
5625        plumbing_response = None
5626        while True:
5627            try:
5628                plumbing_response = self.stub.Get(
5629                    req,
5630                    metadata=self.parent.get_metadata('WorkflowApprovers.Get',
5631                                                      req),
5632                    timeout=timeout)
5633            except Exception as e:
5634                if self.parent.shouldRetry(tries, e):
5635                    tries += 1
5636                    self.parent.jitterSleep(tries)
5637                    continue
5638                raise plumbing.convert_error_to_porcelain(e) from e
5639            break
5640
5641        resp = models.WorkflowApproverGetResponse()
5642        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5643            plumbing_response.meta)
5644        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5645            plumbing_response.rate_limit)
5646        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5647            plumbing_response.workflow_approver)
5648        return resp
5649
5650    def delete(self, id, timeout=None):
5651        '''
5652         Delete deletes a workflow approver
5653        '''
5654        req = WorkflowApproversDeleteRequest()
5655
5656        req.id = (id)
5657        tries = 0
5658        plumbing_response = None
5659        while True:
5660            try:
5661                plumbing_response = self.stub.Delete(
5662                    req,
5663                    metadata=self.parent.get_metadata(
5664                        'WorkflowApprovers.Delete', req),
5665                    timeout=timeout)
5666            except Exception as e:
5667                if self.parent.shouldRetry(tries, e):
5668                    tries += 1
5669                    self.parent.jitterSleep(tries)
5670                    continue
5671                raise plumbing.convert_error_to_porcelain(e) from e
5672            break
5673
5674        resp = models.WorkflowApproversDeleteResponse()
5675        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5676            plumbing_response.rate_limit)
5677        return resp
5678
5679    def list(self, filter, *args, timeout=None):
5680        '''
5681         Lists existing workflow approvers.
5682        '''
5683        req = WorkflowApproversListRequest()
5684        req.meta.CopyFrom(ListRequestMetadata())
5685        if self.parent.page_limit > 0:
5686            req.meta.limit = self.parent.page_limit
5687        if self.parent.snapshot_datetime is not None:
5688            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5689
5690        req.filter = plumbing.quote_filter_args(filter, *args)
5691
5692        def generator(svc, req):
5693            tries = 0
5694            while True:
5695                try:
5696                    plumbing_response = svc.stub.List(
5697                        req,
5698                        metadata=svc.parent.get_metadata(
5699                            'WorkflowApprovers.List', req),
5700                        timeout=timeout)
5701                except Exception as e:
5702                    if self.parent.shouldRetry(tries, e):
5703                        tries += 1
5704                        self.parent.jitterSleep(tries)
5705                        continue
5706                    raise plumbing.convert_error_to_porcelain(e) from e
5707                tries = 0
5708                for plumbing_item in plumbing_response.workflow_approvers:
5709                    yield plumbing.convert_workflow_approver_to_porcelain(
5710                        plumbing_item)
5711                if plumbing_response.meta.next_cursor == '':
5712                    break
5713                req.meta.cursor = plumbing_response.meta.next_cursor
5714
5715        return generator(self, req)
5716
5717
5718class SnapshotWorkflowApprovers:
5719    '''
5720    SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers
5721    service for historical queries.
5722    '''
5723    def __init__(self, workflow_approvers):
5724        self.workflow_approvers = workflow_approvers
5725
5726    def get(self, id, timeout=None):
5727        '''
5728         Get reads one workflow approver by ID.
5729        '''
5730        return self.workflow_approvers.get(id, timeout=timeout)
5731
5732    def list(self, filter, *args, timeout=None):
5733        '''
5734         Lists existing workflow approvers.
5735        '''
5736        return self.workflow_approvers.list(filter, *args, timeout=timeout)
5737
5738
5739class WorkflowApproversHistory:
5740    '''
5741     WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover.
5742    See `strongdm.models.WorkflowApproverHistory`.
5743    '''
5744    def __init__(self, channel, client):
5745        self.parent = client
5746        self.stub = WorkflowApproversHistoryStub(channel)
5747
5748    def list(self, filter, *args, timeout=None):
5749        '''
5750         List gets a list of WorkflowApproversHistory records matching a given set of criteria.
5751        '''
5752        req = WorkflowApproversHistoryListRequest()
5753        req.meta.CopyFrom(ListRequestMetadata())
5754        if self.parent.page_limit > 0:
5755            req.meta.limit = self.parent.page_limit
5756        if self.parent.snapshot_datetime is not None:
5757            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5758
5759        req.filter = plumbing.quote_filter_args(filter, *args)
5760
5761        def generator(svc, req):
5762            tries = 0
5763            while True:
5764                try:
5765                    plumbing_response = svc.stub.List(
5766                        req,
5767                        metadata=svc.parent.get_metadata(
5768                            'WorkflowApproversHistory.List', req),
5769                        timeout=timeout)
5770                except Exception as e:
5771                    if self.parent.shouldRetry(tries, e):
5772                        tries += 1
5773                        self.parent.jitterSleep(tries)
5774                        continue
5775                    raise plumbing.convert_error_to_porcelain(e) from e
5776                tries = 0
5777                for plumbing_item in plumbing_response.history:
5778                    yield plumbing.convert_workflow_approver_history_to_porcelain(
5779                        plumbing_item)
5780                if plumbing_response.meta.next_cursor == '':
5781                    break
5782                req.meta.cursor = plumbing_response.meta.next_cursor
5783
5784        return generator(self, req)
5785
5786
5787class WorkflowAssignments:
5788    '''
5789     WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request
5790     access to via the workflow.
5791    See `strongdm.models.WorkflowAssignment`.
5792    '''
5793    def __init__(self, channel, client):
5794        self.parent = client
5795        self.stub = WorkflowAssignmentsStub(channel)
5796
5797    def list(self, filter, *args, timeout=None):
5798        '''
5799         Lists existing workflow assignments.
5800        '''
5801        req = WorkflowAssignmentsListRequest()
5802        req.meta.CopyFrom(ListRequestMetadata())
5803        if self.parent.page_limit > 0:
5804            req.meta.limit = self.parent.page_limit
5805        if self.parent.snapshot_datetime is not None:
5806            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5807
5808        req.filter = plumbing.quote_filter_args(filter, *args)
5809
5810        def generator(svc, req):
5811            tries = 0
5812            while True:
5813                try:
5814                    plumbing_response = svc.stub.List(
5815                        req,
5816                        metadata=svc.parent.get_metadata(
5817                            'WorkflowAssignments.List', req),
5818                        timeout=timeout)
5819                except Exception as e:
5820                    if self.parent.shouldRetry(tries, e):
5821                        tries += 1
5822                        self.parent.jitterSleep(tries)
5823                        continue
5824                    raise plumbing.convert_error_to_porcelain(e) from e
5825                tries = 0
5826                for plumbing_item in plumbing_response.workflow_assignments:
5827                    yield plumbing.convert_workflow_assignment_to_porcelain(
5828                        plumbing_item)
5829                if plumbing_response.meta.next_cursor == '':
5830                    break
5831                req.meta.cursor = plumbing_response.meta.next_cursor
5832
5833        return generator(self, req)
5834
5835
5836class SnapshotWorkflowAssignments:
5837    '''
5838    SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments
5839    service for historical queries.
5840    '''
5841    def __init__(self, workflow_assignments):
5842        self.workflow_assignments = workflow_assignments
5843
5844    def list(self, filter, *args, timeout=None):
5845        '''
5846         Lists existing workflow assignments.
5847        '''
5848        return self.workflow_assignments.list(filter, *args, timeout=timeout)
5849
5850
5851class WorkflowAssignmentsHistory:
5852    '''
5853     WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment.
5854    See `strongdm.models.WorkflowAssignmentHistory`.
5855    '''
5856    def __init__(self, channel, client):
5857        self.parent = client
5858        self.stub = WorkflowAssignmentsHistoryStub(channel)
5859
5860    def list(self, filter, *args, timeout=None):
5861        '''
5862         List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.
5863        '''
5864        req = WorkflowAssignmentsHistoryListRequest()
5865        req.meta.CopyFrom(ListRequestMetadata())
5866        if self.parent.page_limit > 0:
5867            req.meta.limit = self.parent.page_limit
5868        if self.parent.snapshot_datetime is not None:
5869            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5870
5871        req.filter = plumbing.quote_filter_args(filter, *args)
5872
5873        def generator(svc, req):
5874            tries = 0
5875            while True:
5876                try:
5877                    plumbing_response = svc.stub.List(
5878                        req,
5879                        metadata=svc.parent.get_metadata(
5880                            'WorkflowAssignmentsHistory.List', req),
5881                        timeout=timeout)
5882                except Exception as e:
5883                    if self.parent.shouldRetry(tries, e):
5884                        tries += 1
5885                        self.parent.jitterSleep(tries)
5886                        continue
5887                    raise plumbing.convert_error_to_porcelain(e) from e
5888                tries = 0
5889                for plumbing_item in plumbing_response.history:
5890                    yield plumbing.convert_workflow_assignment_history_to_porcelain(
5891                        plumbing_item)
5892                if plumbing_response.meta.next_cursor == '':
5893                    break
5894                req.meta.cursor = plumbing_response.meta.next_cursor
5895
5896        return generator(self, req)
5897
5898
5899class WorkflowRoles:
5900    '''
5901     WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
5902     to request access to a resource via the workflow.
5903    See `strongdm.models.WorkflowRole`.
5904    '''
5905    def __init__(self, channel, client):
5906        self.parent = client
5907        self.stub = WorkflowRolesStub(channel)
5908
5909    def create(self, workflow_role, timeout=None):
5910        '''
5911         Create creates a new workflow role
5912        '''
5913        req = WorkflowRolesCreateRequest()
5914
5915        if workflow_role is not None:
5916            req.workflow_role.CopyFrom(
5917                plumbing.convert_workflow_role_to_plumbing(workflow_role))
5918        tries = 0
5919        plumbing_response = None
5920        while True:
5921            try:
5922                plumbing_response = self.stub.Create(
5923                    req,
5924                    metadata=self.parent.get_metadata('WorkflowRoles.Create',
5925                                                      req),
5926                    timeout=timeout)
5927            except Exception as e:
5928                if self.parent.shouldRetry(tries, e):
5929                    tries += 1
5930                    self.parent.jitterSleep(tries)
5931                    continue
5932                raise plumbing.convert_error_to_porcelain(e) from e
5933            break
5934
5935        resp = models.WorkflowRolesCreateResponse()
5936        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5937            plumbing_response.rate_limit)
5938        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5939            plumbing_response.workflow_role)
5940        return resp
5941
5942    def get(self, id, timeout=None):
5943        '''
5944         Get reads one workflow role by ID.
5945        '''
5946        req = WorkflowRoleGetRequest()
5947        if self.parent.snapshot_datetime is not None:
5948            req.meta.CopyFrom(GetRequestMetadata())
5949            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5950
5951        req.id = (id)
5952        tries = 0
5953        plumbing_response = None
5954        while True:
5955            try:
5956                plumbing_response = self.stub.Get(
5957                    req,
5958                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
5959                                                      req),
5960                    timeout=timeout)
5961            except Exception as e:
5962                if self.parent.shouldRetry(tries, e):
5963                    tries += 1
5964                    self.parent.jitterSleep(tries)
5965                    continue
5966                raise plumbing.convert_error_to_porcelain(e) from e
5967            break
5968
5969        resp = models.WorkflowRoleGetResponse()
5970        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5971            plumbing_response.meta)
5972        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5973            plumbing_response.rate_limit)
5974        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5975            plumbing_response.workflow_role)
5976        return resp
5977
5978    def delete(self, id, timeout=None):
5979        '''
5980         Delete deletes a workflow role
5981        '''
5982        req = WorkflowRolesDeleteRequest()
5983
5984        req.id = (id)
5985        tries = 0
5986        plumbing_response = None
5987        while True:
5988            try:
5989                plumbing_response = self.stub.Delete(
5990                    req,
5991                    metadata=self.parent.get_metadata('WorkflowRoles.Delete',
5992                                                      req),
5993                    timeout=timeout)
5994            except Exception as e:
5995                if self.parent.shouldRetry(tries, e):
5996                    tries += 1
5997                    self.parent.jitterSleep(tries)
5998                    continue
5999                raise plumbing.convert_error_to_porcelain(e) from e
6000            break
6001
6002        resp = models.WorkflowRolesDeleteResponse()
6003        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6004            plumbing_response.rate_limit)
6005        return resp
6006
6007    def list(self, filter, *args, timeout=None):
6008        '''
6009         Lists existing workflow roles.
6010        '''
6011        req = WorkflowRolesListRequest()
6012        req.meta.CopyFrom(ListRequestMetadata())
6013        if self.parent.page_limit > 0:
6014            req.meta.limit = self.parent.page_limit
6015        if self.parent.snapshot_datetime is not None:
6016            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6017
6018        req.filter = plumbing.quote_filter_args(filter, *args)
6019
6020        def generator(svc, req):
6021            tries = 0
6022            while True:
6023                try:
6024                    plumbing_response = svc.stub.List(
6025                        req,
6026                        metadata=svc.parent.get_metadata(
6027                            'WorkflowRoles.List', req),
6028                        timeout=timeout)
6029                except Exception as e:
6030                    if self.parent.shouldRetry(tries, e):
6031                        tries += 1
6032                        self.parent.jitterSleep(tries)
6033                        continue
6034                    raise plumbing.convert_error_to_porcelain(e) from e
6035                tries = 0
6036                for plumbing_item in plumbing_response.workflow_role:
6037                    yield plumbing.convert_workflow_role_to_porcelain(
6038                        plumbing_item)
6039                if plumbing_response.meta.next_cursor == '':
6040                    break
6041                req.meta.cursor = plumbing_response.meta.next_cursor
6042
6043        return generator(self, req)
6044
6045
6046class SnapshotWorkflowRoles:
6047    '''
6048    SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles
6049    service for historical queries.
6050    '''
6051    def __init__(self, workflow_roles):
6052        self.workflow_roles = workflow_roles
6053
6054    def get(self, id, timeout=None):
6055        '''
6056         Get reads one workflow role by ID.
6057        '''
6058        return self.workflow_roles.get(id, timeout=timeout)
6059
6060    def list(self, filter, *args, timeout=None):
6061        '''
6062         Lists existing workflow roles.
6063        '''
6064        return self.workflow_roles.list(filter, *args, timeout=timeout)
6065
6066
6067class WorkflowRolesHistory:
6068    '''
6069     WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole
6070    See `strongdm.models.WorkflowRoleHistory`.
6071    '''
6072    def __init__(self, channel, client):
6073        self.parent = client
6074        self.stub = WorkflowRolesHistoryStub(channel)
6075
6076    def list(self, filter, *args, timeout=None):
6077        '''
6078         List gets a list of WorkflowRolesHistory records matching a given set of criteria.
6079        '''
6080        req = WorkflowRolesHistoryListRequest()
6081        req.meta.CopyFrom(ListRequestMetadata())
6082        if self.parent.page_limit > 0:
6083            req.meta.limit = self.parent.page_limit
6084        if self.parent.snapshot_datetime is not None:
6085            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6086
6087        req.filter = plumbing.quote_filter_args(filter, *args)
6088
6089        def generator(svc, req):
6090            tries = 0
6091            while True:
6092                try:
6093                    plumbing_response = svc.stub.List(
6094                        req,
6095                        metadata=svc.parent.get_metadata(
6096                            'WorkflowRolesHistory.List', req),
6097                        timeout=timeout)
6098                except Exception as e:
6099                    if self.parent.shouldRetry(tries, e):
6100                        tries += 1
6101                        self.parent.jitterSleep(tries)
6102                        continue
6103                    raise plumbing.convert_error_to_porcelain(e) from e
6104                tries = 0
6105                for plumbing_item in plumbing_response.history:
6106                    yield plumbing.convert_workflow_role_history_to_porcelain(
6107                        plumbing_item)
6108                if plumbing_response.meta.next_cursor == '':
6109                    break
6110                req.meta.cursor = plumbing_response.meta.next_cursor
6111
6112        return generator(self, req)
6113
6114
6115class Workflows:
6116    '''
6117     Workflows are the collection of rules that define the resources to which access can be requested,
6118     the users that can request that access, and the mechanism for approving those requests which can either
6119     be automatic approval or a set of users authorized to approve the requests.
6120    See `strongdm.models.Workflow`.
6121    '''
6122    def __init__(self, channel, client):
6123        self.parent = client
6124        self.stub = WorkflowsStub(channel)
6125
6126    def create(self, workflow, timeout=None):
6127        '''
6128         Create creates a new workflow and requires a name for the workflow.
6129        '''
6130        req = WorkflowCreateRequest()
6131
6132        if workflow is not None:
6133            req.workflow.CopyFrom(
6134                plumbing.convert_workflow_to_plumbing(workflow))
6135        tries = 0
6136        plumbing_response = None
6137        while True:
6138            try:
6139                plumbing_response = self.stub.Create(
6140                    req,
6141                    metadata=self.parent.get_metadata('Workflows.Create', req),
6142                    timeout=timeout)
6143            except Exception as e:
6144                if self.parent.shouldRetry(tries, e):
6145                    tries += 1
6146                    self.parent.jitterSleep(tries)
6147                    continue
6148                raise plumbing.convert_error_to_porcelain(e) from e
6149            break
6150
6151        resp = models.WorkflowCreateResponse()
6152        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6153            plumbing_response.rate_limit)
6154        resp.workflow = plumbing.convert_workflow_to_porcelain(
6155            plumbing_response.workflow)
6156        return resp
6157
6158    def get(self, id, timeout=None):
6159        '''
6160         Get reads one workflow by ID.
6161        '''
6162        req = WorkflowGetRequest()
6163        if self.parent.snapshot_datetime is not None:
6164            req.meta.CopyFrom(GetRequestMetadata())
6165            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6166
6167        req.id = (id)
6168        tries = 0
6169        plumbing_response = None
6170        while True:
6171            try:
6172                plumbing_response = self.stub.Get(
6173                    req,
6174                    metadata=self.parent.get_metadata('Workflows.Get', req),
6175                    timeout=timeout)
6176            except Exception as e:
6177                if self.parent.shouldRetry(tries, e):
6178                    tries += 1
6179                    self.parent.jitterSleep(tries)
6180                    continue
6181                raise plumbing.convert_error_to_porcelain(e) from e
6182            break
6183
6184        resp = models.WorkflowGetResponse()
6185        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6186            plumbing_response.meta)
6187        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6188            plumbing_response.rate_limit)
6189        resp.workflow = plumbing.convert_workflow_to_porcelain(
6190            plumbing_response.workflow)
6191        return resp
6192
6193    def delete(self, id, timeout=None):
6194        '''
6195         Delete deletes an existing workflow.
6196        '''
6197        req = WorkflowDeleteRequest()
6198
6199        req.id = (id)
6200        tries = 0
6201        plumbing_response = None
6202        while True:
6203            try:
6204                plumbing_response = self.stub.Delete(
6205                    req,
6206                    metadata=self.parent.get_metadata('Workflows.Delete', req),
6207                    timeout=timeout)
6208            except Exception as e:
6209                if self.parent.shouldRetry(tries, e):
6210                    tries += 1
6211                    self.parent.jitterSleep(tries)
6212                    continue
6213                raise plumbing.convert_error_to_porcelain(e) from e
6214            break
6215
6216        resp = models.WorkflowDeleteResponse()
6217        resp.id = (plumbing_response.id)
6218        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6219            plumbing_response.rate_limit)
6220        return resp
6221
6222    def update(self, workflow, timeout=None):
6223        '''
6224         Update updates an existing workflow.
6225        '''
6226        req = WorkflowUpdateRequest()
6227
6228        if workflow is not None:
6229            req.workflow.CopyFrom(
6230                plumbing.convert_workflow_to_plumbing(workflow))
6231        tries = 0
6232        plumbing_response = None
6233        while True:
6234            try:
6235                plumbing_response = self.stub.Update(
6236                    req,
6237                    metadata=self.parent.get_metadata('Workflows.Update', req),
6238                    timeout=timeout)
6239            except Exception as e:
6240                if self.parent.shouldRetry(tries, e):
6241                    tries += 1
6242                    self.parent.jitterSleep(tries)
6243                    continue
6244                raise plumbing.convert_error_to_porcelain(e) from e
6245            break
6246
6247        resp = models.WorkflowUpdateResponse()
6248        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6249            plumbing_response.rate_limit)
6250        resp.workflow = plumbing.convert_workflow_to_porcelain(
6251            plumbing_response.workflow)
6252        return resp
6253
6254    def list(self, filter, *args, timeout=None):
6255        '''
6256         Lists existing workflows.
6257        '''
6258        req = WorkflowListRequest()
6259        req.meta.CopyFrom(ListRequestMetadata())
6260        if self.parent.page_limit > 0:
6261            req.meta.limit = self.parent.page_limit
6262        if self.parent.snapshot_datetime is not None:
6263            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6264
6265        req.filter = plumbing.quote_filter_args(filter, *args)
6266
6267        def generator(svc, req):
6268            tries = 0
6269            while True:
6270                try:
6271                    plumbing_response = svc.stub.List(
6272                        req,
6273                        metadata=svc.parent.get_metadata(
6274                            'Workflows.List', req),
6275                        timeout=timeout)
6276                except Exception as e:
6277                    if self.parent.shouldRetry(tries, e):
6278                        tries += 1
6279                        self.parent.jitterSleep(tries)
6280                        continue
6281                    raise plumbing.convert_error_to_porcelain(e) from e
6282                tries = 0
6283                for plumbing_item in plumbing_response.workflows:
6284                    yield plumbing.convert_workflow_to_porcelain(plumbing_item)
6285                if plumbing_response.meta.next_cursor == '':
6286                    break
6287                req.meta.cursor = plumbing_response.meta.next_cursor
6288
6289        return generator(self, req)
6290
6291
6292class SnapshotWorkflows:
6293    '''
6294    SnapshotWorkflows exposes the read only methods of the Workflows
6295    service for historical queries.
6296    '''
6297    def __init__(self, workflows):
6298        self.workflows = workflows
6299
6300    def get(self, id, timeout=None):
6301        '''
6302         Get reads one workflow by ID.
6303        '''
6304        return self.workflows.get(id, timeout=timeout)
6305
6306    def list(self, filter, *args, timeout=None):
6307        '''
6308         Lists existing workflows.
6309        '''
6310        return self.workflows.list(filter, *args, timeout=timeout)
6311
6312
6313class WorkflowsHistory:
6314    '''
6315     WorkflowsHistory provides records of all changes to the state of a Workflow.
6316    See `strongdm.models.WorkflowHistory`.
6317    '''
6318    def __init__(self, channel, client):
6319        self.parent = client
6320        self.stub = WorkflowsHistoryStub(channel)
6321
6322    def list(self, filter, *args, timeout=None):
6323        '''
6324         List gets a list of WorkflowHistory records matching a given set of criteria.
6325        '''
6326        req = WorkflowHistoryListRequest()
6327        req.meta.CopyFrom(ListRequestMetadata())
6328        if self.parent.page_limit > 0:
6329            req.meta.limit = self.parent.page_limit
6330        if self.parent.snapshot_datetime is not None:
6331            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6332
6333        req.filter = plumbing.quote_filter_args(filter, *args)
6334
6335        def generator(svc, req):
6336            tries = 0
6337            while True:
6338                try:
6339                    plumbing_response = svc.stub.List(
6340                        req,
6341                        metadata=svc.parent.get_metadata(
6342                            'WorkflowsHistory.List', req),
6343                        timeout=timeout)
6344                except Exception as e:
6345                    if self.parent.shouldRetry(tries, e):
6346                        tries += 1
6347                        self.parent.jitterSleep(tries)
6348                        continue
6349                    raise plumbing.convert_error_to_porcelain(e) from e
6350                tries = 0
6351                for plumbing_item in plumbing_response.history:
6352                    yield plumbing.convert_workflow_history_to_porcelain(
6353                        plumbing_item)
6354                if plumbing_response.meta.next_cursor == '':
6355                    break
6356                req.meta.cursor = plumbing_response.meta.next_cursor
6357
6358        return generator(self, req)
def deprecated(func)
152def deprecated(func):
153    """This is a decorator which can be used to mark functions
154    as deprecated. It will result in a warning being emitted
155    when the function is used."""
156    @functools.wraps(func)
157    def new_func(*args, **kwargs):
158        warnings.warn("Call to deprecated function {}.".format(func.__name__),
159                      category=DeprecationWarning,
160                      stacklevel=2)
161        return func(*args, **kwargs)
162
163    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.

class AccessRequests:
166class AccessRequests:
167    '''
168     AccessRequests are requests for access to a resource that may match a Workflow.
169    See `strongdm.models.AccessRequest`.
170    '''
171    def __init__(self, channel, client):
172        self.parent = client
173        self.stub = AccessRequestsStub(channel)
174
175    def list(self, filter, *args, timeout=None):
176        '''
177         Lists existing access requests.
178        '''
179        req = AccessRequestListRequest()
180        req.meta.CopyFrom(ListRequestMetadata())
181        if self.parent.page_limit > 0:
182            req.meta.limit = self.parent.page_limit
183        if self.parent.snapshot_datetime is not None:
184            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
185
186        req.filter = plumbing.quote_filter_args(filter, *args)
187
188        def generator(svc, req):
189            tries = 0
190            while True:
191                try:
192                    plumbing_response = svc.stub.List(
193                        req,
194                        metadata=svc.parent.get_metadata(
195                            'AccessRequests.List', req),
196                        timeout=timeout)
197                except Exception as e:
198                    if self.parent.shouldRetry(tries, e):
199                        tries += 1
200                        self.parent.jitterSleep(tries)
201                        continue
202                    raise plumbing.convert_error_to_porcelain(e) from e
203                tries = 0
204                for plumbing_item in plumbing_response.access_requests:
205                    yield plumbing.convert_access_request_to_porcelain(
206                        plumbing_item)
207                if plumbing_response.meta.next_cursor == '':
208                    break
209                req.meta.cursor = plumbing_response.meta.next_cursor
210
211        return generator(self, req)

AccessRequests are requests for access to a resource that may match a Workflow. See strongdm.models.AccessRequest.

AccessRequests(channel, client)
171    def __init__(self, channel, client):
172        self.parent = client
173        self.stub = AccessRequestsStub(channel)
def list(self, filter, *args, timeout=None)
175    def list(self, filter, *args, timeout=None):
176        '''
177         Lists existing access requests.
178        '''
179        req = AccessRequestListRequest()
180        req.meta.CopyFrom(ListRequestMetadata())
181        if self.parent.page_limit > 0:
182            req.meta.limit = self.parent.page_limit
183        if self.parent.snapshot_datetime is not None:
184            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
185
186        req.filter = plumbing.quote_filter_args(filter, *args)
187
188        def generator(svc, req):
189            tries = 0
190            while True:
191                try:
192                    plumbing_response = svc.stub.List(
193                        req,
194                        metadata=svc.parent.get_metadata(
195                            'AccessRequests.List', req),
196                        timeout=timeout)
197                except Exception as e:
198                    if self.parent.shouldRetry(tries, e):
199                        tries += 1
200                        self.parent.jitterSleep(tries)
201                        continue
202                    raise plumbing.convert_error_to_porcelain(e) from e
203                tries = 0
204                for plumbing_item in plumbing_response.access_requests:
205                    yield plumbing.convert_access_request_to_porcelain(
206                        plumbing_item)
207                if plumbing_response.meta.next_cursor == '':
208                    break
209                req.meta.cursor = plumbing_response.meta.next_cursor
210
211        return generator(self, req)

Lists existing access requests.

class SnapshotAccessRequests:
214class SnapshotAccessRequests:
215    '''
216    SnapshotAccessRequests exposes the read only methods of the AccessRequests
217    service for historical queries.
218    '''
219    def __init__(self, access_requests):
220        self.access_requests = access_requests
221
222    def list(self, filter, *args, timeout=None):
223        '''
224         Lists existing access requests.
225        '''
226        return self.access_requests.list(filter, *args, timeout=timeout)

SnapshotAccessRequests exposes the read only methods of the AccessRequests service for historical queries.

SnapshotAccessRequests(access_requests)
219    def __init__(self, access_requests):
220        self.access_requests = access_requests
def list(self, filter, *args, timeout=None)
222    def list(self, filter, *args, timeout=None):
223        '''
224         Lists existing access requests.
225        '''
226        return self.access_requests.list(filter, *args, timeout=timeout)

Lists existing access requests.

class AccessRequestEventsHistory:
229class AccessRequestEventsHistory:
230    '''
231     AccessRequestEventsHistory provides records of all changes to the state of an AccessRequest.
232    See `strongdm.models.AccessRequestEventHistory`.
233    '''
234    def __init__(self, channel, client):
235        self.parent = client
236        self.stub = AccessRequestEventsHistoryStub(channel)
237
238    def list(self, filter, *args, timeout=None):
239        '''
240         List gets a list of AccessRequestEventHistory records matching a given set of criteria.
241        '''
242        req = AccessRequestEventHistoryListRequest()
243        req.meta.CopyFrom(ListRequestMetadata())
244        if self.parent.page_limit > 0:
245            req.meta.limit = self.parent.page_limit
246        if self.parent.snapshot_datetime is not None:
247            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
248
249        req.filter = plumbing.quote_filter_args(filter, *args)
250
251        def generator(svc, req):
252            tries = 0
253            while True:
254                try:
255                    plumbing_response = svc.stub.List(
256                        req,
257                        metadata=svc.parent.get_metadata(
258                            'AccessRequestEventsHistory.List', req),
259                        timeout=timeout)
260                except Exception as e:
261                    if self.parent.shouldRetry(tries, e):
262                        tries += 1
263                        self.parent.jitterSleep(tries)
264                        continue
265                    raise plumbing.convert_error_to_porcelain(e) from e
266                tries = 0
267                for plumbing_item in plumbing_response.history:
268                    yield plumbing.convert_access_request_event_history_to_porcelain(
269                        plumbing_item)
270                if plumbing_response.meta.next_cursor == '':
271                    break
272                req.meta.cursor = plumbing_response.meta.next_cursor
273
274        return generator(self, req)

AccessRequestEventsHistory provides records of all changes to the state of an AccessRequest. See strongdm.models.AccessRequestEventHistory.

AccessRequestEventsHistory(channel, client)
234    def __init__(self, channel, client):
235        self.parent = client
236        self.stub = AccessRequestEventsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
238    def list(self, filter, *args, timeout=None):
239        '''
240         List gets a list of AccessRequestEventHistory records matching a given set of criteria.
241        '''
242        req = AccessRequestEventHistoryListRequest()
243        req.meta.CopyFrom(ListRequestMetadata())
244        if self.parent.page_limit > 0:
245            req.meta.limit = self.parent.page_limit
246        if self.parent.snapshot_datetime is not None:
247            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
248
249        req.filter = plumbing.quote_filter_args(filter, *args)
250
251        def generator(svc, req):
252            tries = 0
253            while True:
254                try:
255                    plumbing_response = svc.stub.List(
256                        req,
257                        metadata=svc.parent.get_metadata(
258                            'AccessRequestEventsHistory.List', req),
259                        timeout=timeout)
260                except Exception as e:
261                    if self.parent.shouldRetry(tries, e):
262                        tries += 1
263                        self.parent.jitterSleep(tries)
264                        continue
265                    raise plumbing.convert_error_to_porcelain(e) from e
266                tries = 0
267                for plumbing_item in plumbing_response.history:
268                    yield plumbing.convert_access_request_event_history_to_porcelain(
269                        plumbing_item)
270                if plumbing_response.meta.next_cursor == '':
271                    break
272                req.meta.cursor = plumbing_response.meta.next_cursor
273
274        return generator(self, req)

List gets a list of AccessRequestEventHistory records matching a given set of criteria.

class AccessRequestsHistory:
277class AccessRequestsHistory:
278    '''
279     AccessRequestsHistory provides records of all changes to the state of an AccessRequest.
280    See `strongdm.models.AccessRequestHistory`.
281    '''
282    def __init__(self, channel, client):
283        self.parent = client
284        self.stub = AccessRequestsHistoryStub(channel)
285
286    def list(self, filter, *args, timeout=None):
287        '''
288         List gets a list of AccessRequestHistory records matching a given set of criteria.
289        '''
290        req = AccessRequestHistoryListRequest()
291        req.meta.CopyFrom(ListRequestMetadata())
292        if self.parent.page_limit > 0:
293            req.meta.limit = self.parent.page_limit
294        if self.parent.snapshot_datetime is not None:
295            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
296
297        req.filter = plumbing.quote_filter_args(filter, *args)
298
299        def generator(svc, req):
300            tries = 0
301            while True:
302                try:
303                    plumbing_response = svc.stub.List(
304                        req,
305                        metadata=svc.parent.get_metadata(
306                            'AccessRequestsHistory.List', req),
307                        timeout=timeout)
308                except Exception as e:
309                    if self.parent.shouldRetry(tries, e):
310                        tries += 1
311                        self.parent.jitterSleep(tries)
312                        continue
313                    raise plumbing.convert_error_to_porcelain(e) from e
314                tries = 0
315                for plumbing_item in plumbing_response.history:
316                    yield plumbing.convert_access_request_history_to_porcelain(
317                        plumbing_item)
318                if plumbing_response.meta.next_cursor == '':
319                    break
320                req.meta.cursor = plumbing_response.meta.next_cursor
321
322        return generator(self, req)

AccessRequestsHistory provides records of all changes to the state of an AccessRequest. See strongdm.models.AccessRequestHistory.

AccessRequestsHistory(channel, client)
282    def __init__(self, channel, client):
283        self.parent = client
284        self.stub = AccessRequestsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
286    def list(self, filter, *args, timeout=None):
287        '''
288         List gets a list of AccessRequestHistory records matching a given set of criteria.
289        '''
290        req = AccessRequestHistoryListRequest()
291        req.meta.CopyFrom(ListRequestMetadata())
292        if self.parent.page_limit > 0:
293            req.meta.limit = self.parent.page_limit
294        if self.parent.snapshot_datetime is not None:
295            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
296
297        req.filter = plumbing.quote_filter_args(filter, *args)
298
299        def generator(svc, req):
300            tries = 0
301            while True:
302                try:
303                    plumbing_response = svc.stub.List(
304                        req,
305                        metadata=svc.parent.get_metadata(
306                            'AccessRequestsHistory.List', req),
307                        timeout=timeout)
308                except Exception as e:
309                    if self.parent.shouldRetry(tries, e):
310                        tries += 1
311                        self.parent.jitterSleep(tries)
312                        continue
313                    raise plumbing.convert_error_to_porcelain(e) from e
314                tries = 0
315                for plumbing_item in plumbing_response.history:
316                    yield plumbing.convert_access_request_history_to_porcelain(
317                        plumbing_item)
318                if plumbing_response.meta.next_cursor == '':
319                    break
320                req.meta.cursor = plumbing_response.meta.next_cursor
321
322        return generator(self, req)

List gets a list of AccessRequestHistory records matching a given set of criteria.

class AccountAttachments:
325class AccountAttachments:
326    '''
327     AccountAttachments assign an account to a role.
328    See `strongdm.models.AccountAttachment`.
329    '''
330    def __init__(self, channel, client):
331        self.parent = client
332        self.stub = AccountAttachmentsStub(channel)
333
334    def create(self, account_attachment, timeout=None):
335        '''
336         Create registers a new AccountAttachment.
337        '''
338        req = AccountAttachmentCreateRequest()
339
340        if account_attachment is not None:
341            req.account_attachment.CopyFrom(
342                plumbing.convert_account_attachment_to_plumbing(
343                    account_attachment))
344        tries = 0
345        plumbing_response = None
346        while True:
347            try:
348                plumbing_response = self.stub.Create(
349                    req,
350                    metadata=self.parent.get_metadata(
351                        'AccountAttachments.Create', req),
352                    timeout=timeout)
353            except Exception as e:
354                if self.parent.shouldRetry(tries, e):
355                    tries += 1
356                    self.parent.jitterSleep(tries)
357                    continue
358                raise plumbing.convert_error_to_porcelain(e) from e
359            break
360
361        resp = models.AccountAttachmentCreateResponse()
362        resp.account_attachment = plumbing.convert_account_attachment_to_porcelain(
363            plumbing_response.account_attachment)
364        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
365            plumbing_response.meta)
366        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
367            plumbing_response.rate_limit)
368        return resp
369
370    def get(self, id, timeout=None):
371        '''
372         Get reads one AccountAttachment by ID.
373        '''
374        req = AccountAttachmentGetRequest()
375        if self.parent.snapshot_datetime is not None:
376            req.meta.CopyFrom(GetRequestMetadata())
377            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
378
379        req.id = (id)
380        tries = 0
381        plumbing_response = None
382        while True:
383            try:
384                plumbing_response = self.stub.Get(
385                    req,
386                    metadata=self.parent.get_metadata('AccountAttachments.Get',
387                                                      req),
388                    timeout=timeout)
389            except Exception as e:
390                if self.parent.shouldRetry(tries, e):
391                    tries += 1
392                    self.parent.jitterSleep(tries)
393                    continue
394                raise plumbing.convert_error_to_porcelain(e) from e
395            break
396
397        resp = models.AccountAttachmentGetResponse()
398        resp.account_attachment = plumbing.convert_account_attachment_to_porcelain(
399            plumbing_response.account_attachment)
400        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
401            plumbing_response.meta)
402        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
403            plumbing_response.rate_limit)
404        return resp
405
406    def delete(self, id, timeout=None):
407        '''
408         Delete removes a AccountAttachment by ID.
409        '''
410        req = AccountAttachmentDeleteRequest()
411
412        req.id = (id)
413        tries = 0
414        plumbing_response = None
415        while True:
416            try:
417                plumbing_response = self.stub.Delete(
418                    req,
419                    metadata=self.parent.get_metadata(
420                        'AccountAttachments.Delete', req),
421                    timeout=timeout)
422            except Exception as e:
423                if self.parent.shouldRetry(tries, e):
424                    tries += 1
425                    self.parent.jitterSleep(tries)
426                    continue
427                raise plumbing.convert_error_to_porcelain(e) from e
428            break
429
430        resp = models.AccountAttachmentDeleteResponse()
431        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
432            plumbing_response.meta)
433        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
434            plumbing_response.rate_limit)
435        return resp
436
437    def list(self, filter, *args, timeout=None):
438        '''
439         List gets a list of AccountAttachments matching a given set of criteria.
440        '''
441        req = AccountAttachmentListRequest()
442        req.meta.CopyFrom(ListRequestMetadata())
443        if self.parent.page_limit > 0:
444            req.meta.limit = self.parent.page_limit
445        if self.parent.snapshot_datetime is not None:
446            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
447
448        req.filter = plumbing.quote_filter_args(filter, *args)
449
450        def generator(svc, req):
451            tries = 0
452            while True:
453                try:
454                    plumbing_response = svc.stub.List(
455                        req,
456                        metadata=svc.parent.get_metadata(
457                            'AccountAttachments.List', req),
458                        timeout=timeout)
459                except Exception as e:
460                    if self.parent.shouldRetry(tries, e):
461                        tries += 1
462                        self.parent.jitterSleep(tries)
463                        continue
464                    raise plumbing.convert_error_to_porcelain(e) from e
465                tries = 0
466                for plumbing_item in plumbing_response.account_attachments:
467                    yield plumbing.convert_account_attachment_to_porcelain(
468                        plumbing_item)
469                if plumbing_response.meta.next_cursor == '':
470                    break
471                req.meta.cursor = plumbing_response.meta.next_cursor
472
473        return generator(self, req)

AccountAttachments assign an account to a role. See strongdm.models.AccountAttachment.

AccountAttachments(channel, client)
330    def __init__(self, channel, client):
331        self.parent = client
332        self.stub = AccountAttachmentsStub(channel)
def create(self, account_attachment, timeout=None)
334    def create(self, account_attachment, timeout=None):
335        '''
336         Create registers a new AccountAttachment.
337        '''
338        req = AccountAttachmentCreateRequest()
339
340        if account_attachment is not None:
341            req.account_attachment.CopyFrom(
342                plumbing.convert_account_attachment_to_plumbing(
343                    account_attachment))
344        tries = 0
345        plumbing_response = None
346        while True:
347            try:
348                plumbing_response = self.stub.Create(
349                    req,
350                    metadata=self.parent.get_metadata(
351                        'AccountAttachments.Create', req),
352                    timeout=timeout)
353            except Exception as e:
354                if self.parent.shouldRetry(tries, e):
355                    tries += 1
356                    self.parent.jitterSleep(tries)
357                    continue
358                raise plumbing.convert_error_to_porcelain(e) from e
359            break
360
361        resp = models.AccountAttachmentCreateResponse()
362        resp.account_attachment = plumbing.convert_account_attachment_to_porcelain(
363            plumbing_response.account_attachment)
364        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
365            plumbing_response.meta)
366        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
367            plumbing_response.rate_limit)
368        return resp

Create registers a new AccountAttachment.

def get(self, id, timeout=None)
370    def get(self, id, timeout=None):
371        '''
372         Get reads one AccountAttachment by ID.
373        '''
374        req = AccountAttachmentGetRequest()
375        if self.parent.snapshot_datetime is not None:
376            req.meta.CopyFrom(GetRequestMetadata())
377            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
378
379        req.id = (id)
380        tries = 0
381        plumbing_response = None
382        while True:
383            try:
384                plumbing_response = self.stub.Get(
385                    req,
386                    metadata=self.parent.get_metadata('AccountAttachments.Get',
387                                                      req),
388                    timeout=timeout)
389            except Exception as e:
390                if self.parent.shouldRetry(tries, e):
391                    tries += 1
392                    self.parent.jitterSleep(tries)
393                    continue
394                raise plumbing.convert_error_to_porcelain(e) from e
395            break
396
397        resp = models.AccountAttachmentGetResponse()
398        resp.account_attachment = plumbing.convert_account_attachment_to_porcelain(
399            plumbing_response.account_attachment)
400        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
401            plumbing_response.meta)
402        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
403            plumbing_response.rate_limit)
404        return resp

Get reads one AccountAttachment by ID.

def delete(self, id, timeout=None)
406    def delete(self, id, timeout=None):
407        '''
408         Delete removes a AccountAttachment by ID.
409        '''
410        req = AccountAttachmentDeleteRequest()
411
412        req.id = (id)
413        tries = 0
414        plumbing_response = None
415        while True:
416            try:
417                plumbing_response = self.stub.Delete(
418                    req,
419                    metadata=self.parent.get_metadata(
420                        'AccountAttachments.Delete', req),
421                    timeout=timeout)
422            except Exception as e:
423                if self.parent.shouldRetry(tries, e):
424                    tries += 1
425                    self.parent.jitterSleep(tries)
426                    continue
427                raise plumbing.convert_error_to_porcelain(e) from e
428            break
429
430        resp = models.AccountAttachmentDeleteResponse()
431        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
432            plumbing_response.meta)
433        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
434            plumbing_response.rate_limit)
435        return resp

Delete removes a AccountAttachment by ID.

def list(self, filter, *args, timeout=None)
437    def list(self, filter, *args, timeout=None):
438        '''
439         List gets a list of AccountAttachments matching a given set of criteria.
440        '''
441        req = AccountAttachmentListRequest()
442        req.meta.CopyFrom(ListRequestMetadata())
443        if self.parent.page_limit > 0:
444            req.meta.limit = self.parent.page_limit
445        if self.parent.snapshot_datetime is not None:
446            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
447
448        req.filter = plumbing.quote_filter_args(filter, *args)
449
450        def generator(svc, req):
451            tries = 0
452            while True:
453                try:
454                    plumbing_response = svc.stub.List(
455                        req,
456                        metadata=svc.parent.get_metadata(
457                            'AccountAttachments.List', req),
458                        timeout=timeout)
459                except Exception as e:
460                    if self.parent.shouldRetry(tries, e):
461                        tries += 1
462                        self.parent.jitterSleep(tries)
463                        continue
464                    raise plumbing.convert_error_to_porcelain(e) from e
465                tries = 0
466                for plumbing_item in plumbing_response.account_attachments:
467                    yield plumbing.convert_account_attachment_to_porcelain(
468                        plumbing_item)
469                if plumbing_response.meta.next_cursor == '':
470                    break
471                req.meta.cursor = plumbing_response.meta.next_cursor
472
473        return generator(self, req)

List gets a list of AccountAttachments matching a given set of criteria.

class SnapshotAccountAttachments:
476class SnapshotAccountAttachments:
477    '''
478    SnapshotAccountAttachments exposes the read only methods of the AccountAttachments
479    service for historical queries.
480    '''
481    def __init__(self, account_attachments):
482        self.account_attachments = account_attachments
483
484    def get(self, id, timeout=None):
485        '''
486         Get reads one AccountAttachment by ID.
487        '''
488        return self.account_attachments.get(id, timeout=timeout)
489
490    def list(self, filter, *args, timeout=None):
491        '''
492         List gets a list of AccountAttachments matching a given set of criteria.
493        '''
494        return self.account_attachments.list(filter, *args, timeout=timeout)

SnapshotAccountAttachments exposes the read only methods of the AccountAttachments service for historical queries.

SnapshotAccountAttachments(account_attachments)
481    def __init__(self, account_attachments):
482        self.account_attachments = account_attachments
def get(self, id, timeout=None)
484    def get(self, id, timeout=None):
485        '''
486         Get reads one AccountAttachment by ID.
487        '''
488        return self.account_attachments.get(id, timeout=timeout)

Get reads one AccountAttachment by ID.

def list(self, filter, *args, timeout=None)
490    def list(self, filter, *args, timeout=None):
491        '''
492         List gets a list of AccountAttachments matching a given set of criteria.
493        '''
494        return self.account_attachments.list(filter, *args, timeout=timeout)

List gets a list of AccountAttachments matching a given set of criteria.

class AccountAttachmentsHistory:
497class AccountAttachmentsHistory:
498    '''
499     AccountAttachmentsHistory records all changes to the state of an AccountAttachment.
500    See `strongdm.models.AccountAttachmentHistory`.
501    '''
502    def __init__(self, channel, client):
503        self.parent = client
504        self.stub = AccountAttachmentsHistoryStub(channel)
505
506    def list(self, filter, *args, timeout=None):
507        '''
508         List gets a list of AccountAttachmentHistory records matching a given set of criteria.
509        '''
510        req = AccountAttachmentHistoryListRequest()
511        req.meta.CopyFrom(ListRequestMetadata())
512        if self.parent.page_limit > 0:
513            req.meta.limit = self.parent.page_limit
514        if self.parent.snapshot_datetime is not None:
515            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
516
517        req.filter = plumbing.quote_filter_args(filter, *args)
518
519        def generator(svc, req):
520            tries = 0
521            while True:
522                try:
523                    plumbing_response = svc.stub.List(
524                        req,
525                        metadata=svc.parent.get_metadata(
526                            'AccountAttachmentsHistory.List', req),
527                        timeout=timeout)
528                except Exception as e:
529                    if self.parent.shouldRetry(tries, e):
530                        tries += 1
531                        self.parent.jitterSleep(tries)
532                        continue
533                    raise plumbing.convert_error_to_porcelain(e) from e
534                tries = 0
535                for plumbing_item in plumbing_response.history:
536                    yield plumbing.convert_account_attachment_history_to_porcelain(
537                        plumbing_item)
538                if plumbing_response.meta.next_cursor == '':
539                    break
540                req.meta.cursor = plumbing_response.meta.next_cursor
541
542        return generator(self, req)

AccountAttachmentsHistory records all changes to the state of an AccountAttachment. See strongdm.models.AccountAttachmentHistory.

AccountAttachmentsHistory(channel, client)
502    def __init__(self, channel, client):
503        self.parent = client
504        self.stub = AccountAttachmentsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
506    def list(self, filter, *args, timeout=None):
507        '''
508         List gets a list of AccountAttachmentHistory records matching a given set of criteria.
509        '''
510        req = AccountAttachmentHistoryListRequest()
511        req.meta.CopyFrom(ListRequestMetadata())
512        if self.parent.page_limit > 0:
513            req.meta.limit = self.parent.page_limit
514        if self.parent.snapshot_datetime is not None:
515            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
516
517        req.filter = plumbing.quote_filter_args(filter, *args)
518
519        def generator(svc, req):
520            tries = 0
521            while True:
522                try:
523                    plumbing_response = svc.stub.List(
524                        req,
525                        metadata=svc.parent.get_metadata(
526                            'AccountAttachmentsHistory.List', req),
527                        timeout=timeout)
528                except Exception as e:
529                    if self.parent.shouldRetry(tries, e):
530                        tries += 1
531                        self.parent.jitterSleep(tries)
532                        continue
533                    raise plumbing.convert_error_to_porcelain(e) from e
534                tries = 0
535                for plumbing_item in plumbing_response.history:
536                    yield plumbing.convert_account_attachment_history_to_porcelain(
537                        plumbing_item)
538                if plumbing_response.meta.next_cursor == '':
539                    break
540                req.meta.cursor = plumbing_response.meta.next_cursor
541
542        return generator(self, req)

List gets a list of AccountAttachmentHistory records matching a given set of criteria.

class AccountGrants:
545class AccountGrants:
546    '''
547     AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
548    See `strongdm.models.AccountGrant`.
549    '''
550    def __init__(self, channel, client):
551        self.parent = client
552        self.stub = AccountGrantsStub(channel)
553
554    def create(self, account_grant, timeout=None):
555        '''
556         Create registers a new AccountGrant.
557        '''
558        req = AccountGrantCreateRequest()
559
560        if account_grant is not None:
561            req.account_grant.CopyFrom(
562                plumbing.convert_account_grant_to_plumbing(account_grant))
563        tries = 0
564        plumbing_response = None
565        while True:
566            try:
567                plumbing_response = self.stub.Create(
568                    req,
569                    metadata=self.parent.get_metadata('AccountGrants.Create',
570                                                      req),
571                    timeout=timeout)
572            except Exception as e:
573                if self.parent.shouldRetry(tries, e):
574                    tries += 1
575                    self.parent.jitterSleep(tries)
576                    continue
577                raise plumbing.convert_error_to_porcelain(e) from e
578            break
579
580        resp = models.AccountGrantCreateResponse()
581        resp.account_grant = plumbing.convert_account_grant_to_porcelain(
582            plumbing_response.account_grant)
583        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
584            plumbing_response.meta)
585        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
586            plumbing_response.rate_limit)
587        return resp
588
589    def get(self, id, timeout=None):
590        '''
591         Get reads one AccountGrant by ID.
592        '''
593        req = AccountGrantGetRequest()
594        if self.parent.snapshot_datetime is not None:
595            req.meta.CopyFrom(GetRequestMetadata())
596            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
597
598        req.id = (id)
599        tries = 0
600        plumbing_response = None
601        while True:
602            try:
603                plumbing_response = self.stub.Get(
604                    req,
605                    metadata=self.parent.get_metadata('AccountGrants.Get',
606                                                      req),
607                    timeout=timeout)
608            except Exception as e:
609                if self.parent.shouldRetry(tries, e):
610                    tries += 1
611                    self.parent.jitterSleep(tries)
612                    continue
613                raise plumbing.convert_error_to_porcelain(e) from e
614            break
615
616        resp = models.AccountGrantGetResponse()
617        resp.account_grant = plumbing.convert_account_grant_to_porcelain(
618            plumbing_response.account_grant)
619        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
620            plumbing_response.meta)
621        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
622            plumbing_response.rate_limit)
623        return resp
624
625    def delete(self, id, timeout=None):
626        '''
627         Delete removes a AccountGrant by ID.
628        '''
629        req = AccountGrantDeleteRequest()
630
631        req.id = (id)
632        tries = 0
633        plumbing_response = None
634        while True:
635            try:
636                plumbing_response = self.stub.Delete(
637                    req,
638                    metadata=self.parent.get_metadata('AccountGrants.Delete',
639                                                      req),
640                    timeout=timeout)
641            except Exception as e:
642                if self.parent.shouldRetry(tries, e):
643                    tries += 1
644                    self.parent.jitterSleep(tries)
645                    continue
646                raise plumbing.convert_error_to_porcelain(e) from e
647            break
648
649        resp = models.AccountGrantDeleteResponse()
650        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
651            plumbing_response.meta)
652        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
653            plumbing_response.rate_limit)
654        return resp
655
656    def list(self, filter, *args, timeout=None):
657        '''
658         List gets a list of AccountGrants matching a given set of criteria.
659        '''
660        req = AccountGrantListRequest()
661        req.meta.CopyFrom(ListRequestMetadata())
662        if self.parent.page_limit > 0:
663            req.meta.limit = self.parent.page_limit
664        if self.parent.snapshot_datetime is not None:
665            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
666
667        req.filter = plumbing.quote_filter_args(filter, *args)
668
669        def generator(svc, req):
670            tries = 0
671            while True:
672                try:
673                    plumbing_response = svc.stub.List(
674                        req,
675                        metadata=svc.parent.get_metadata(
676                            'AccountGrants.List', req),
677                        timeout=timeout)
678                except Exception as e:
679                    if self.parent.shouldRetry(tries, e):
680                        tries += 1
681                        self.parent.jitterSleep(tries)
682                        continue
683                    raise plumbing.convert_error_to_porcelain(e) from e
684                tries = 0
685                for plumbing_item in plumbing_response.account_grants:
686                    yield plumbing.convert_account_grant_to_porcelain(
687                        plumbing_item)
688                if plumbing_response.meta.next_cursor == '':
689                    break
690                req.meta.cursor = plumbing_response.meta.next_cursor
691
692        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.

AccountGrants(channel, client)
550    def __init__(self, channel, client):
551        self.parent = client
552        self.stub = AccountGrantsStub(channel)
def create(self, account_grant, timeout=None)
554    def create(self, account_grant, timeout=None):
555        '''
556         Create registers a new AccountGrant.
557        '''
558        req = AccountGrantCreateRequest()
559
560        if account_grant is not None:
561            req.account_grant.CopyFrom(
562                plumbing.convert_account_grant_to_plumbing(account_grant))
563        tries = 0
564        plumbing_response = None
565        while True:
566            try:
567                plumbing_response = self.stub.Create(
568                    req,
569                    metadata=self.parent.get_metadata('AccountGrants.Create',
570                                                      req),
571                    timeout=timeout)
572            except Exception as e:
573                if self.parent.shouldRetry(tries, e):
574                    tries += 1
575                    self.parent.jitterSleep(tries)
576                    continue
577                raise plumbing.convert_error_to_porcelain(e) from e
578            break
579
580        resp = models.AccountGrantCreateResponse()
581        resp.account_grant = plumbing.convert_account_grant_to_porcelain(
582            plumbing_response.account_grant)
583        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
584            plumbing_response.meta)
585        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
586            plumbing_response.rate_limit)
587        return resp

Create registers a new AccountGrant.

def get(self, id, timeout=None)
589    def get(self, id, timeout=None):
590        '''
591         Get reads one AccountGrant by ID.
592        '''
593        req = AccountGrantGetRequest()
594        if self.parent.snapshot_datetime is not None:
595            req.meta.CopyFrom(GetRequestMetadata())
596            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
597
598        req.id = (id)
599        tries = 0
600        plumbing_response = None
601        while True:
602            try:
603                plumbing_response = self.stub.Get(
604                    req,
605                    metadata=self.parent.get_metadata('AccountGrants.Get',
606                                                      req),
607                    timeout=timeout)
608            except Exception as e:
609                if self.parent.shouldRetry(tries, e):
610                    tries += 1
611                    self.parent.jitterSleep(tries)
612                    continue
613                raise plumbing.convert_error_to_porcelain(e) from e
614            break
615
616        resp = models.AccountGrantGetResponse()
617        resp.account_grant = plumbing.convert_account_grant_to_porcelain(
618            plumbing_response.account_grant)
619        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
620            plumbing_response.meta)
621        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
622            plumbing_response.rate_limit)
623        return resp

Get reads one AccountGrant by ID.

def delete(self, id, timeout=None)
625    def delete(self, id, timeout=None):
626        '''
627         Delete removes a AccountGrant by ID.
628        '''
629        req = AccountGrantDeleteRequest()
630
631        req.id = (id)
632        tries = 0
633        plumbing_response = None
634        while True:
635            try:
636                plumbing_response = self.stub.Delete(
637                    req,
638                    metadata=self.parent.get_metadata('AccountGrants.Delete',
639                                                      req),
640                    timeout=timeout)
641            except Exception as e:
642                if self.parent.shouldRetry(tries, e):
643                    tries += 1
644                    self.parent.jitterSleep(tries)
645                    continue
646                raise plumbing.convert_error_to_porcelain(e) from e
647            break
648
649        resp = models.AccountGrantDeleteResponse()
650        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
651            plumbing_response.meta)
652        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
653            plumbing_response.rate_limit)
654        return resp

Delete removes a AccountGrant by ID.

def list(self, filter, *args, timeout=None)
656    def list(self, filter, *args, timeout=None):
657        '''
658         List gets a list of AccountGrants matching a given set of criteria.
659        '''
660        req = AccountGrantListRequest()
661        req.meta.CopyFrom(ListRequestMetadata())
662        if self.parent.page_limit > 0:
663            req.meta.limit = self.parent.page_limit
664        if self.parent.snapshot_datetime is not None:
665            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
666
667        req.filter = plumbing.quote_filter_args(filter, *args)
668
669        def generator(svc, req):
670            tries = 0
671            while True:
672                try:
673                    plumbing_response = svc.stub.List(
674                        req,
675                        metadata=svc.parent.get_metadata(
676                            'AccountGrants.List', req),
677                        timeout=timeout)
678                except Exception as e:
679                    if self.parent.shouldRetry(tries, e):
680                        tries += 1
681                        self.parent.jitterSleep(tries)
682                        continue
683                    raise plumbing.convert_error_to_porcelain(e) from e
684                tries = 0
685                for plumbing_item in plumbing_response.account_grants:
686                    yield plumbing.convert_account_grant_to_porcelain(
687                        plumbing_item)
688                if plumbing_response.meta.next_cursor == '':
689                    break
690                req.meta.cursor = plumbing_response.meta.next_cursor
691
692        return generator(self, req)

List gets a list of AccountGrants matching a given set of criteria.

class SnapshotAccountGrants:
695class SnapshotAccountGrants:
696    '''
697    SnapshotAccountGrants exposes the read only methods of the AccountGrants
698    service for historical queries.
699    '''
700    def __init__(self, account_grants):
701        self.account_grants = account_grants
702
703    def get(self, id, timeout=None):
704        '''
705         Get reads one AccountGrant by ID.
706        '''
707        return self.account_grants.get(id, timeout=timeout)
708
709    def list(self, filter, *args, timeout=None):
710        '''
711         List gets a list of AccountGrants matching a given set of criteria.
712        '''
713        return self.account_grants.list(filter, *args, timeout=timeout)

SnapshotAccountGrants exposes the read only methods of the AccountGrants service for historical queries.

SnapshotAccountGrants(account_grants)
700    def __init__(self, account_grants):
701        self.account_grants = account_grants
def get(self, id, timeout=None)
703    def get(self, id, timeout=None):
704        '''
705         Get reads one AccountGrant by ID.
706        '''
707        return self.account_grants.get(id, timeout=timeout)

Get reads one AccountGrant by ID.

def list(self, filter, *args, timeout=None)
709    def list(self, filter, *args, timeout=None):
710        '''
711         List gets a list of AccountGrants matching a given set of criteria.
712        '''
713        return self.account_grants.list(filter, *args, timeout=timeout)

List gets a list of AccountGrants matching a given set of criteria.

class AccountGrantsHistory:
716class AccountGrantsHistory:
717    '''
718     AccountGrantsHistory records all changes to the state of an AccountGrant.
719    See `strongdm.models.AccountGrantHistory`.
720    '''
721    def __init__(self, channel, client):
722        self.parent = client
723        self.stub = AccountGrantsHistoryStub(channel)
724
725    def list(self, filter, *args, timeout=None):
726        '''
727         List gets a list of AccountGrantHistory records matching a given set of criteria.
728        '''
729        req = AccountGrantHistoryListRequest()
730        req.meta.CopyFrom(ListRequestMetadata())
731        if self.parent.page_limit > 0:
732            req.meta.limit = self.parent.page_limit
733        if self.parent.snapshot_datetime is not None:
734            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
735
736        req.filter = plumbing.quote_filter_args(filter, *args)
737
738        def generator(svc, req):
739            tries = 0
740            while True:
741                try:
742                    plumbing_response = svc.stub.List(
743                        req,
744                        metadata=svc.parent.get_metadata(
745                            'AccountGrantsHistory.List', req),
746                        timeout=timeout)
747                except Exception as e:
748                    if self.parent.shouldRetry(tries, e):
749                        tries += 1
750                        self.parent.jitterSleep(tries)
751                        continue
752                    raise plumbing.convert_error_to_porcelain(e) from e
753                tries = 0
754                for plumbing_item in plumbing_response.history:
755                    yield plumbing.convert_account_grant_history_to_porcelain(
756                        plumbing_item)
757                if plumbing_response.meta.next_cursor == '':
758                    break
759                req.meta.cursor = plumbing_response.meta.next_cursor
760
761        return generator(self, req)

AccountGrantsHistory records all changes to the state of an AccountGrant. See strongdm.models.AccountGrantHistory.

AccountGrantsHistory(channel, client)
721    def __init__(self, channel, client):
722        self.parent = client
723        self.stub = AccountGrantsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
725    def list(self, filter, *args, timeout=None):
726        '''
727         List gets a list of AccountGrantHistory records matching a given set of criteria.
728        '''
729        req = AccountGrantHistoryListRequest()
730        req.meta.CopyFrom(ListRequestMetadata())
731        if self.parent.page_limit > 0:
732            req.meta.limit = self.parent.page_limit
733        if self.parent.snapshot_datetime is not None:
734            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
735
736        req.filter = plumbing.quote_filter_args(filter, *args)
737
738        def generator(svc, req):
739            tries = 0
740            while True:
741                try:
742                    plumbing_response = svc.stub.List(
743                        req,
744                        metadata=svc.parent.get_metadata(
745                            'AccountGrantsHistory.List', req),
746                        timeout=timeout)
747                except Exception as e:
748                    if self.parent.shouldRetry(tries, e):
749                        tries += 1
750                        self.parent.jitterSleep(tries)
751                        continue
752                    raise plumbing.convert_error_to_porcelain(e) from e
753                tries = 0
754                for plumbing_item in plumbing_response.history:
755                    yield plumbing.convert_account_grant_history_to_porcelain(
756                        plumbing_item)
757                if plumbing_response.meta.next_cursor == '':
758                    break
759                req.meta.cursor = plumbing_response.meta.next_cursor
760
761        return generator(self, req)

List gets a list of AccountGrantHistory records matching a given set of criteria.

class AccountPermissions:
764class AccountPermissions:
765    '''
766     AccountPermissions records the granular permissions accounts have, allowing them to execute
767     relevant commands via StrongDM's APIs.
768    See `strongdm.models.AccountPermission`.
769    '''
770    def __init__(self, channel, client):
771        self.parent = client
772        self.stub = AccountPermissionsStub(channel)
773
774    def list(self, filter, *args, timeout=None):
775        '''
776         List gets a list of Permission records matching a given set of criteria.
777        '''
778        req = AccountPermissionListRequest()
779        req.meta.CopyFrom(ListRequestMetadata())
780        if self.parent.page_limit > 0:
781            req.meta.limit = self.parent.page_limit
782        if self.parent.snapshot_datetime is not None:
783            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
784
785        req.filter = plumbing.quote_filter_args(filter, *args)
786
787        def generator(svc, req):
788            tries = 0
789            while True:
790                try:
791                    plumbing_response = svc.stub.List(
792                        req,
793                        metadata=svc.parent.get_metadata(
794                            'AccountPermissions.List', req),
795                        timeout=timeout)
796                except Exception as e:
797                    if self.parent.shouldRetry(tries, e):
798                        tries += 1
799                        self.parent.jitterSleep(tries)
800                        continue
801                    raise plumbing.convert_error_to_porcelain(e) from e
802                tries = 0
803                for plumbing_item in plumbing_response.permissions:
804                    yield plumbing.convert_account_permission_to_porcelain(
805                        plumbing_item)
806                if plumbing_response.meta.next_cursor == '':
807                    break
808                req.meta.cursor = plumbing_response.meta.next_cursor
809
810        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.

AccountPermissions(channel, client)
770    def __init__(self, channel, client):
771        self.parent = client
772        self.stub = AccountPermissionsStub(channel)
def list(self, filter, *args, timeout=None)
774    def list(self, filter, *args, timeout=None):
775        '''
776         List gets a list of Permission records matching a given set of criteria.
777        '''
778        req = AccountPermissionListRequest()
779        req.meta.CopyFrom(ListRequestMetadata())
780        if self.parent.page_limit > 0:
781            req.meta.limit = self.parent.page_limit
782        if self.parent.snapshot_datetime is not None:
783            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
784
785        req.filter = plumbing.quote_filter_args(filter, *args)
786
787        def generator(svc, req):
788            tries = 0
789            while True:
790                try:
791                    plumbing_response = svc.stub.List(
792                        req,
793                        metadata=svc.parent.get_metadata(
794                            'AccountPermissions.List', req),
795                        timeout=timeout)
796                except Exception as e:
797                    if self.parent.shouldRetry(tries, e):
798                        tries += 1
799                        self.parent.jitterSleep(tries)
800                        continue
801                    raise plumbing.convert_error_to_porcelain(e) from e
802                tries = 0
803                for plumbing_item in plumbing_response.permissions:
804                    yield plumbing.convert_account_permission_to_porcelain(
805                        plumbing_item)
806                if plumbing_response.meta.next_cursor == '':
807                    break
808                req.meta.cursor = plumbing_response.meta.next_cursor
809
810        return generator(self, req)

List gets a list of Permission records matching a given set of criteria.

class SnapshotAccountPermissions:
813class SnapshotAccountPermissions:
814    '''
815    SnapshotAccountPermissions exposes the read only methods of the AccountPermissions
816    service for historical queries.
817    '''
818    def __init__(self, account_permissions):
819        self.account_permissions = account_permissions
820
821    def list(self, filter, *args, timeout=None):
822        '''
823         List gets a list of Permission records matching a given set of criteria.
824        '''
825        return self.account_permissions.list(filter, *args, timeout=timeout)

SnapshotAccountPermissions exposes the read only methods of the AccountPermissions service for historical queries.

SnapshotAccountPermissions(account_permissions)
818    def __init__(self, account_permissions):
819        self.account_permissions = account_permissions
def list(self, filter, *args, timeout=None)
821    def list(self, filter, *args, timeout=None):
822        '''
823         List gets a list of Permission records matching a given set of criteria.
824        '''
825        return self.account_permissions.list(filter, *args, timeout=timeout)

List gets a list of Permission records matching a given set of criteria.

class AccountResources:
828class AccountResources:
829    '''
830     AccountResources enumerates the resources to which accounts have access.
831     The AccountResources service is read-only.
832    See `strongdm.models.AccountResource`.
833    '''
834    def __init__(self, channel, client):
835        self.parent = client
836        self.stub = AccountResourcesStub(channel)
837
838    def list(self, filter, *args, timeout=None):
839        '''
840         List gets a list of AccountResource records matching a given set of criteria.
841        '''
842        req = AccountResourceListRequest()
843        req.meta.CopyFrom(ListRequestMetadata())
844        if self.parent.page_limit > 0:
845            req.meta.limit = self.parent.page_limit
846        if self.parent.snapshot_datetime is not None:
847            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
848
849        req.filter = plumbing.quote_filter_args(filter, *args)
850
851        def generator(svc, req):
852            tries = 0
853            while True:
854                try:
855                    plumbing_response = svc.stub.List(
856                        req,
857                        metadata=svc.parent.get_metadata(
858                            'AccountResources.List', req),
859                        timeout=timeout)
860                except Exception as e:
861                    if self.parent.shouldRetry(tries, e):
862                        tries += 1
863                        self.parent.jitterSleep(tries)
864                        continue
865                    raise plumbing.convert_error_to_porcelain(e) from e
866                tries = 0
867                for plumbing_item in plumbing_response.account_resources:
868                    yield plumbing.convert_account_resource_to_porcelain(
869                        plumbing_item)
870                if plumbing_response.meta.next_cursor == '':
871                    break
872                req.meta.cursor = plumbing_response.meta.next_cursor
873
874        return generator(self, req)

AccountResources enumerates the resources to which accounts have access. The AccountResources service is read-only. See strongdm.models.AccountResource.

AccountResources(channel, client)
834    def __init__(self, channel, client):
835        self.parent = client
836        self.stub = AccountResourcesStub(channel)
def list(self, filter, *args, timeout=None)
838    def list(self, filter, *args, timeout=None):
839        '''
840         List gets a list of AccountResource records matching a given set of criteria.
841        '''
842        req = AccountResourceListRequest()
843        req.meta.CopyFrom(ListRequestMetadata())
844        if self.parent.page_limit > 0:
845            req.meta.limit = self.parent.page_limit
846        if self.parent.snapshot_datetime is not None:
847            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
848
849        req.filter = plumbing.quote_filter_args(filter, *args)
850
851        def generator(svc, req):
852            tries = 0
853            while True:
854                try:
855                    plumbing_response = svc.stub.List(
856                        req,
857                        metadata=svc.parent.get_metadata(
858                            'AccountResources.List', req),
859                        timeout=timeout)
860                except Exception as e:
861                    if self.parent.shouldRetry(tries, e):
862                        tries += 1
863                        self.parent.jitterSleep(tries)
864                        continue
865                    raise plumbing.convert_error_to_porcelain(e) from e
866                tries = 0
867                for plumbing_item in plumbing_response.account_resources:
868                    yield plumbing.convert_account_resource_to_porcelain(
869                        plumbing_item)
870                if plumbing_response.meta.next_cursor == '':
871                    break
872                req.meta.cursor = plumbing_response.meta.next_cursor
873
874        return generator(self, req)

List gets a list of AccountResource records matching a given set of criteria.

class SnapshotAccountResources:
877class SnapshotAccountResources:
878    '''
879    SnapshotAccountResources exposes the read only methods of the AccountResources
880    service for historical queries.
881    '''
882    def __init__(self, account_resources):
883        self.account_resources = account_resources
884
885    def list(self, filter, *args, timeout=None):
886        '''
887         List gets a list of AccountResource records matching a given set of criteria.
888        '''
889        return self.account_resources.list(filter, *args, timeout=timeout)

SnapshotAccountResources exposes the read only methods of the AccountResources service for historical queries.

SnapshotAccountResources(account_resources)
882    def __init__(self, account_resources):
883        self.account_resources = account_resources
def list(self, filter, *args, timeout=None)
885    def list(self, filter, *args, timeout=None):
886        '''
887         List gets a list of AccountResource records matching a given set of criteria.
888        '''
889        return self.account_resources.list(filter, *args, timeout=timeout)

List gets a list of AccountResource records matching a given set of criteria.

class AccountResourcesHistory:
892class AccountResourcesHistory:
893    '''
894     AccountResourcesHistory records all changes to the state of a AccountResource.
895    See `strongdm.models.AccountResourceHistory`.
896    '''
897    def __init__(self, channel, client):
898        self.parent = client
899        self.stub = AccountResourcesHistoryStub(channel)
900
901    def list(self, filter, *args, timeout=None):
902        '''
903         List gets a list of AccountResourceHistory records matching a given set of criteria.
904        '''
905        req = AccountResourceHistoryListRequest()
906        req.meta.CopyFrom(ListRequestMetadata())
907        if self.parent.page_limit > 0:
908            req.meta.limit = self.parent.page_limit
909        if self.parent.snapshot_datetime is not None:
910            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
911
912        req.filter = plumbing.quote_filter_args(filter, *args)
913
914        def generator(svc, req):
915            tries = 0
916            while True:
917                try:
918                    plumbing_response = svc.stub.List(
919                        req,
920                        metadata=svc.parent.get_metadata(
921                            'AccountResourcesHistory.List', req),
922                        timeout=timeout)
923                except Exception as e:
924                    if self.parent.shouldRetry(tries, e):
925                        tries += 1
926                        self.parent.jitterSleep(tries)
927                        continue
928                    raise plumbing.convert_error_to_porcelain(e) from e
929                tries = 0
930                for plumbing_item in plumbing_response.history:
931                    yield plumbing.convert_account_resource_history_to_porcelain(
932                        plumbing_item)
933                if plumbing_response.meta.next_cursor == '':
934                    break
935                req.meta.cursor = plumbing_response.meta.next_cursor
936
937        return generator(self, req)

AccountResourcesHistory records all changes to the state of a AccountResource. See strongdm.models.AccountResourceHistory.

AccountResourcesHistory(channel, client)
897    def __init__(self, channel, client):
898        self.parent = client
899        self.stub = AccountResourcesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
901    def list(self, filter, *args, timeout=None):
902        '''
903         List gets a list of AccountResourceHistory records matching a given set of criteria.
904        '''
905        req = AccountResourceHistoryListRequest()
906        req.meta.CopyFrom(ListRequestMetadata())
907        if self.parent.page_limit > 0:
908            req.meta.limit = self.parent.page_limit
909        if self.parent.snapshot_datetime is not None:
910            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
911
912        req.filter = plumbing.quote_filter_args(filter, *args)
913
914        def generator(svc, req):
915            tries = 0
916            while True:
917                try:
918                    plumbing_response = svc.stub.List(
919                        req,
920                        metadata=svc.parent.get_metadata(
921                            'AccountResourcesHistory.List', req),
922                        timeout=timeout)
923                except Exception as e:
924                    if self.parent.shouldRetry(tries, e):
925                        tries += 1
926                        self.parent.jitterSleep(tries)
927                        continue
928                    raise plumbing.convert_error_to_porcelain(e) from e
929                tries = 0
930                for plumbing_item in plumbing_response.history:
931                    yield plumbing.convert_account_resource_history_to_porcelain(
932                        plumbing_item)
933                if plumbing_response.meta.next_cursor == '':
934                    break
935                req.meta.cursor = plumbing_response.meta.next_cursor
936
937        return generator(self, req)

List gets a list of AccountResourceHistory records matching a given set of criteria.

class Accounts:
 940class Accounts:
 941    '''
 942     Accounts are users that have access to strongDM. There are two types of accounts:
 943     1. **Users:** humans who are authenticated through username and password or SSO.
 944     2. **Service Accounts:** machines that are authenticated using a service token.
 945     3. **Tokens** are access keys with permissions that can be used for authentication.
 946    See:
 947    `strongdm.models.Service`
 948    `strongdm.models.Token`
 949    `strongdm.models.User`
 950    '''
 951    def __init__(self, channel, client):
 952        self.parent = client
 953        self.stub = AccountsStub(channel)
 954
 955    def create(self, account, timeout=None):
 956        '''
 957         Create registers a new Account.
 958        '''
 959        req = AccountCreateRequest()
 960
 961        if account is not None:
 962            req.account.CopyFrom(plumbing.convert_account_to_plumbing(account))
 963        tries = 0
 964        plumbing_response = None
 965        while True:
 966            try:
 967                plumbing_response = self.stub.Create(
 968                    req,
 969                    metadata=self.parent.get_metadata('Accounts.Create', req),
 970                    timeout=timeout)
 971            except Exception as e:
 972                if self.parent.shouldRetry(tries, e):
 973                    tries += 1
 974                    self.parent.jitterSleep(tries)
 975                    continue
 976                raise plumbing.convert_error_to_porcelain(e) from e
 977            break
 978
 979        resp = models.AccountCreateResponse()
 980        resp.access_key = (plumbing_response.access_key)
 981        resp.account = plumbing.convert_account_to_porcelain(
 982            plumbing_response.account)
 983        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
 984            plumbing_response.meta)
 985        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
 986            plumbing_response.rate_limit)
 987        resp.secret_key = (plumbing_response.secret_key)
 988        resp.token = (plumbing_response.token)
 989        return resp
 990
 991    def get(self, id, timeout=None):
 992        '''
 993         Get reads one Account by ID.
 994        '''
 995        req = AccountGetRequest()
 996        if self.parent.snapshot_datetime is not None:
 997            req.meta.CopyFrom(GetRequestMetadata())
 998            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 999
1000        req.id = (id)
1001        tries = 0
1002        plumbing_response = None
1003        while True:
1004            try:
1005                plumbing_response = self.stub.Get(
1006                    req,
1007                    metadata=self.parent.get_metadata('Accounts.Get', req),
1008                    timeout=timeout)
1009            except Exception as e:
1010                if self.parent.shouldRetry(tries, e):
1011                    tries += 1
1012                    self.parent.jitterSleep(tries)
1013                    continue
1014                raise plumbing.convert_error_to_porcelain(e) from e
1015            break
1016
1017        resp = models.AccountGetResponse()
1018        resp.account = plumbing.convert_account_to_porcelain(
1019            plumbing_response.account)
1020        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1021            plumbing_response.meta)
1022        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1023            plumbing_response.rate_limit)
1024        return resp
1025
1026    def update(self, account, timeout=None):
1027        '''
1028         Update replaces all the fields of an Account by ID.
1029        '''
1030        req = AccountUpdateRequest()
1031
1032        if account is not None:
1033            req.account.CopyFrom(plumbing.convert_account_to_plumbing(account))
1034        tries = 0
1035        plumbing_response = None
1036        while True:
1037            try:
1038                plumbing_response = self.stub.Update(
1039                    req,
1040                    metadata=self.parent.get_metadata('Accounts.Update', req),
1041                    timeout=timeout)
1042            except Exception as e:
1043                if self.parent.shouldRetry(tries, e):
1044                    tries += 1
1045                    self.parent.jitterSleep(tries)
1046                    continue
1047                raise plumbing.convert_error_to_porcelain(e) from e
1048            break
1049
1050        resp = models.AccountUpdateResponse()
1051        resp.account = plumbing.convert_account_to_porcelain(
1052            plumbing_response.account)
1053        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
1054            plumbing_response.meta)
1055        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1056            plumbing_response.rate_limit)
1057        return resp
1058
1059    def delete(self, id, timeout=None):
1060        '''
1061         Delete removes an Account by ID.
1062        '''
1063        req = AccountDeleteRequest()
1064
1065        req.id = (id)
1066        tries = 0
1067        plumbing_response = None
1068        while True:
1069            try:
1070                plumbing_response = self.stub.Delete(
1071                    req,
1072                    metadata=self.parent.get_metadata('Accounts.Delete', req),
1073                    timeout=timeout)
1074            except Exception as e:
1075                if self.parent.shouldRetry(tries, e):
1076                    tries += 1
1077                    self.parent.jitterSleep(tries)
1078                    continue
1079                raise plumbing.convert_error_to_porcelain(e) from e
1080            break
1081
1082        resp = models.AccountDeleteResponse()
1083        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
1084            plumbing_response.meta)
1085        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1086            plumbing_response.rate_limit)
1087        return resp
1088
1089    def list(self, filter, *args, timeout=None):
1090        '''
1091         List gets a list of Accounts matching a given set of criteria.
1092        '''
1093        req = AccountListRequest()
1094        req.meta.CopyFrom(ListRequestMetadata())
1095        if self.parent.page_limit > 0:
1096            req.meta.limit = self.parent.page_limit
1097        if self.parent.snapshot_datetime is not None:
1098            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1099
1100        req.filter = plumbing.quote_filter_args(filter, *args)
1101
1102        def generator(svc, req):
1103            tries = 0
1104            while True:
1105                try:
1106                    plumbing_response = svc.stub.List(
1107                        req,
1108                        metadata=svc.parent.get_metadata('Accounts.List', req),
1109                        timeout=timeout)
1110                except Exception as e:
1111                    if self.parent.shouldRetry(tries, e):
1112                        tries += 1
1113                        self.parent.jitterSleep(tries)
1114                        continue
1115                    raise plumbing.convert_error_to_porcelain(e) from e
1116                tries = 0
1117                for plumbing_item in plumbing_response.accounts:
1118                    yield plumbing.convert_account_to_porcelain(plumbing_item)
1119                if plumbing_response.meta.next_cursor == '':
1120                    break
1121                req.meta.cursor = plumbing_response.meta.next_cursor
1122
1123        return generator(self, req)

Accounts are users that have access to strongDM. There are two types of accounts:

  1. Users: humans who are authenticated through username and password or SSO.
  2. Service Accounts: machines that are authenticated using a service token.
  3. Tokens are access keys with permissions that can be used for authentication. See: strongdm.models.Service strongdm.models.Token strongdm.models.User
Accounts(channel, client)
951    def __init__(self, channel, client):
952        self.parent = client
953        self.stub = AccountsStub(channel)
def create(self, account, timeout=None)
955    def create(self, account, timeout=None):
956        '''
957         Create registers a new Account.
958        '''
959        req = AccountCreateRequest()
960
961        if account is not None:
962            req.account.CopyFrom(plumbing.convert_account_to_plumbing(account))
963        tries = 0
964        plumbing_response = None
965        while True:
966            try:
967                plumbing_response = self.stub.Create(
968                    req,
969                    metadata=self.parent.get_metadata('Accounts.Create', req),
970                    timeout=timeout)
971            except Exception as e:
972                if self.parent.shouldRetry(tries, e):
973                    tries += 1
974                    self.parent.jitterSleep(tries)
975                    continue
976                raise plumbing.convert_error_to_porcelain(e) from e
977            break
978
979        resp = models.AccountCreateResponse()
980        resp.access_key = (plumbing_response.access_key)
981        resp.account = plumbing.convert_account_to_porcelain(
982            plumbing_response.account)
983        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
984            plumbing_response.meta)
985        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
986            plumbing_response.rate_limit)
987        resp.secret_key = (plumbing_response.secret_key)
988        resp.token = (plumbing_response.token)
989        return resp

Create registers a new Account.

def get(self, id, timeout=None)
 991    def get(self, id, timeout=None):
 992        '''
 993         Get reads one Account by ID.
 994        '''
 995        req = AccountGetRequest()
 996        if self.parent.snapshot_datetime is not None:
 997            req.meta.CopyFrom(GetRequestMetadata())
 998            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
 999
1000        req.id = (id)
1001        tries = 0
1002        plumbing_response = None
1003        while True:
1004            try:
1005                plumbing_response = self.stub.Get(
1006                    req,
1007                    metadata=self.parent.get_metadata('Accounts.Get', req),
1008                    timeout=timeout)
1009            except Exception as e:
1010                if self.parent.shouldRetry(tries, e):
1011                    tries += 1
1012                    self.parent.jitterSleep(tries)
1013                    continue
1014                raise plumbing.convert_error_to_porcelain(e) from e
1015            break
1016
1017        resp = models.AccountGetResponse()
1018        resp.account = plumbing.convert_account_to_porcelain(
1019            plumbing_response.account)
1020        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1021            plumbing_response.meta)
1022        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1023            plumbing_response.rate_limit)
1024        return resp

Get reads one Account by ID.

def update(self, account, timeout=None)
1026    def update(self, account, timeout=None):
1027        '''
1028         Update replaces all the fields of an Account by ID.
1029        '''
1030        req = AccountUpdateRequest()
1031
1032        if account is not None:
1033            req.account.CopyFrom(plumbing.convert_account_to_plumbing(account))
1034        tries = 0
1035        plumbing_response = None
1036        while True:
1037            try:
1038                plumbing_response = self.stub.Update(
1039                    req,
1040                    metadata=self.parent.get_metadata('Accounts.Update', req),
1041                    timeout=timeout)
1042            except Exception as e:
1043                if self.parent.shouldRetry(tries, e):
1044                    tries += 1
1045                    self.parent.jitterSleep(tries)
1046                    continue
1047                raise plumbing.convert_error_to_porcelain(e) from e
1048            break
1049
1050        resp = models.AccountUpdateResponse()
1051        resp.account = plumbing.convert_account_to_porcelain(
1052            plumbing_response.account)
1053        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
1054            plumbing_response.meta)
1055        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1056            plumbing_response.rate_limit)
1057        return resp

Update replaces all the fields of an Account by ID.

def delete(self, id, timeout=None)
1059    def delete(self, id, timeout=None):
1060        '''
1061         Delete removes an Account by ID.
1062        '''
1063        req = AccountDeleteRequest()
1064
1065        req.id = (id)
1066        tries = 0
1067        plumbing_response = None
1068        while True:
1069            try:
1070                plumbing_response = self.stub.Delete(
1071                    req,
1072                    metadata=self.parent.get_metadata('Accounts.Delete', req),
1073                    timeout=timeout)
1074            except Exception as e:
1075                if self.parent.shouldRetry(tries, e):
1076                    tries += 1
1077                    self.parent.jitterSleep(tries)
1078                    continue
1079                raise plumbing.convert_error_to_porcelain(e) from e
1080            break
1081
1082        resp = models.AccountDeleteResponse()
1083        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
1084            plumbing_response.meta)
1085        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1086            plumbing_response.rate_limit)
1087        return resp

Delete removes an Account by ID.

def list(self, filter, *args, timeout=None)
1089    def list(self, filter, *args, timeout=None):
1090        '''
1091         List gets a list of Accounts matching a given set of criteria.
1092        '''
1093        req = AccountListRequest()
1094        req.meta.CopyFrom(ListRequestMetadata())
1095        if self.parent.page_limit > 0:
1096            req.meta.limit = self.parent.page_limit
1097        if self.parent.snapshot_datetime is not None:
1098            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1099
1100        req.filter = plumbing.quote_filter_args(filter, *args)
1101
1102        def generator(svc, req):
1103            tries = 0
1104            while True:
1105                try:
1106                    plumbing_response = svc.stub.List(
1107                        req,
1108                        metadata=svc.parent.get_metadata('Accounts.List', req),
1109                        timeout=timeout)
1110                except Exception as e:
1111                    if self.parent.shouldRetry(tries, e):
1112                        tries += 1
1113                        self.parent.jitterSleep(tries)
1114                        continue
1115                    raise plumbing.convert_error_to_porcelain(e) from e
1116                tries = 0
1117                for plumbing_item in plumbing_response.accounts:
1118                    yield plumbing.convert_account_to_porcelain(plumbing_item)
1119                if plumbing_response.meta.next_cursor == '':
1120                    break
1121                req.meta.cursor = plumbing_response.meta.next_cursor
1122
1123        return generator(self, req)

List gets a list of Accounts matching a given set of criteria.

class SnapshotAccounts:
1126class SnapshotAccounts:
1127    '''
1128    SnapshotAccounts exposes the read only methods of the Accounts
1129    service for historical queries.
1130    '''
1131    def __init__(self, accounts):
1132        self.accounts = accounts
1133
1134    def get(self, id, timeout=None):
1135        '''
1136         Get reads one Account by ID.
1137        '''
1138        return self.accounts.get(id, timeout=timeout)
1139
1140    def list(self, filter, *args, timeout=None):
1141        '''
1142         List gets a list of Accounts matching a given set of criteria.
1143        '''
1144        return self.accounts.list(filter, *args, timeout=timeout)

SnapshotAccounts exposes the read only methods of the Accounts service for historical queries.

SnapshotAccounts(accounts)
1131    def __init__(self, accounts):
1132        self.accounts = accounts
def get(self, id, timeout=None)
1134    def get(self, id, timeout=None):
1135        '''
1136         Get reads one Account by ID.
1137        '''
1138        return self.accounts.get(id, timeout=timeout)

Get reads one Account by ID.

def list(self, filter, *args, timeout=None)
1140    def list(self, filter, *args, timeout=None):
1141        '''
1142         List gets a list of Accounts matching a given set of criteria.
1143        '''
1144        return self.accounts.list(filter, *args, timeout=timeout)

List gets a list of Accounts matching a given set of criteria.

class AccountsHistory:
1147class AccountsHistory:
1148    '''
1149     AccountsHistory records all changes to the state of an Account.
1150    See `strongdm.models.AccountHistory`.
1151    '''
1152    def __init__(self, channel, client):
1153        self.parent = client
1154        self.stub = AccountsHistoryStub(channel)
1155
1156    def list(self, filter, *args, timeout=None):
1157        '''
1158         List gets a list of AccountHistory records matching a given set of criteria.
1159        '''
1160        req = AccountHistoryListRequest()
1161        req.meta.CopyFrom(ListRequestMetadata())
1162        if self.parent.page_limit > 0:
1163            req.meta.limit = self.parent.page_limit
1164        if self.parent.snapshot_datetime is not None:
1165            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1166
1167        req.filter = plumbing.quote_filter_args(filter, *args)
1168
1169        def generator(svc, req):
1170            tries = 0
1171            while True:
1172                try:
1173                    plumbing_response = svc.stub.List(
1174                        req,
1175                        metadata=svc.parent.get_metadata(
1176                            'AccountsHistory.List', req),
1177                        timeout=timeout)
1178                except Exception as e:
1179                    if self.parent.shouldRetry(tries, e):
1180                        tries += 1
1181                        self.parent.jitterSleep(tries)
1182                        continue
1183                    raise plumbing.convert_error_to_porcelain(e) from e
1184                tries = 0
1185                for plumbing_item in plumbing_response.history:
1186                    yield plumbing.convert_account_history_to_porcelain(
1187                        plumbing_item)
1188                if plumbing_response.meta.next_cursor == '':
1189                    break
1190                req.meta.cursor = plumbing_response.meta.next_cursor
1191
1192        return generator(self, req)

AccountsHistory records all changes to the state of an Account. See strongdm.models.AccountHistory.

AccountsHistory(channel, client)
1152    def __init__(self, channel, client):
1153        self.parent = client
1154        self.stub = AccountsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
1156    def list(self, filter, *args, timeout=None):
1157        '''
1158         List gets a list of AccountHistory records matching a given set of criteria.
1159        '''
1160        req = AccountHistoryListRequest()
1161        req.meta.CopyFrom(ListRequestMetadata())
1162        if self.parent.page_limit > 0:
1163            req.meta.limit = self.parent.page_limit
1164        if self.parent.snapshot_datetime is not None:
1165            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1166
1167        req.filter = plumbing.quote_filter_args(filter, *args)
1168
1169        def generator(svc, req):
1170            tries = 0
1171            while True:
1172                try:
1173                    plumbing_response = svc.stub.List(
1174                        req,
1175                        metadata=svc.parent.get_metadata(
1176                            'AccountsHistory.List', req),
1177                        timeout=timeout)
1178                except Exception as e:
1179                    if self.parent.shouldRetry(tries, e):
1180                        tries += 1
1181                        self.parent.jitterSleep(tries)
1182                        continue
1183                    raise plumbing.convert_error_to_porcelain(e) from e
1184                tries = 0
1185                for plumbing_item in plumbing_response.history:
1186                    yield plumbing.convert_account_history_to_porcelain(
1187                        plumbing_item)
1188                if plumbing_response.meta.next_cursor == '':
1189                    break
1190                req.meta.cursor = plumbing_response.meta.next_cursor
1191
1192        return generator(self, req)

List gets a list of AccountHistory records matching a given set of criteria.

class Activities:
1195class Activities:
1196    '''
1197     An Activity is a record of an action taken against a strongDM deployment, e.g.
1198     a user creation, resource deletion, sso configuration change, etc. The Activities
1199     service is read-only.
1200    See `strongdm.models.Activity`.
1201    '''
1202    def __init__(self, channel, client):
1203        self.parent = client
1204        self.stub = ActivitiesStub(channel)
1205
1206    def get(self, id, timeout=None):
1207        '''
1208         Get reads one Activity by ID.
1209        '''
1210        req = ActivityGetRequest()
1211        if self.parent.snapshot_datetime is not None:
1212            req.meta.CopyFrom(GetRequestMetadata())
1213            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1214
1215        req.id = (id)
1216        tries = 0
1217        plumbing_response = None
1218        while True:
1219            try:
1220                plumbing_response = self.stub.Get(
1221                    req,
1222                    metadata=self.parent.get_metadata('Activities.Get', req),
1223                    timeout=timeout)
1224            except Exception as e:
1225                if self.parent.shouldRetry(tries, e):
1226                    tries += 1
1227                    self.parent.jitterSleep(tries)
1228                    continue
1229                raise plumbing.convert_error_to_porcelain(e) from e
1230            break
1231
1232        resp = models.ActivityGetResponse()
1233        resp.activity = plumbing.convert_activity_to_porcelain(
1234            plumbing_response.activity)
1235        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1236            plumbing_response.meta)
1237        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1238            plumbing_response.rate_limit)
1239        return resp
1240
1241    def list(self, filter, *args, timeout=None):
1242        '''
1243         List gets a list of Activities matching a given set of criteria.
1244         The 'before' and 'after' filters can be used to control the time
1245         range of the output activities. If not provided, one week of back
1246         of activities will be returned.
1247        '''
1248        req = ActivityListRequest()
1249        req.meta.CopyFrom(ListRequestMetadata())
1250        if self.parent.page_limit > 0:
1251            req.meta.limit = self.parent.page_limit
1252        if self.parent.snapshot_datetime is not None:
1253            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1254
1255        req.filter = plumbing.quote_filter_args(filter, *args)
1256
1257        def generator(svc, req):
1258            tries = 0
1259            while True:
1260                try:
1261                    plumbing_response = svc.stub.List(
1262                        req,
1263                        metadata=svc.parent.get_metadata(
1264                            'Activities.List', req),
1265                        timeout=timeout)
1266                except Exception as e:
1267                    if self.parent.shouldRetry(tries, e):
1268                        tries += 1
1269                        self.parent.jitterSleep(tries)
1270                        continue
1271                    raise plumbing.convert_error_to_porcelain(e) from e
1272                tries = 0
1273                for plumbing_item in plumbing_response.activities:
1274                    yield plumbing.convert_activity_to_porcelain(plumbing_item)
1275                if plumbing_response.meta.next_cursor == '':
1276                    break
1277                req.meta.cursor = plumbing_response.meta.next_cursor
1278
1279        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.

Activities(channel, client)
1202    def __init__(self, channel, client):
1203        self.parent = client
1204        self.stub = ActivitiesStub(channel)
def get(self, id, timeout=None)
1206    def get(self, id, timeout=None):
1207        '''
1208         Get reads one Activity by ID.
1209        '''
1210        req = ActivityGetRequest()
1211        if self.parent.snapshot_datetime is not None:
1212            req.meta.CopyFrom(GetRequestMetadata())
1213            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1214
1215        req.id = (id)
1216        tries = 0
1217        plumbing_response = None
1218        while True:
1219            try:
1220                plumbing_response = self.stub.Get(
1221                    req,
1222                    metadata=self.parent.get_metadata('Activities.Get', req),
1223                    timeout=timeout)
1224            except Exception as e:
1225                if self.parent.shouldRetry(tries, e):
1226                    tries += 1
1227                    self.parent.jitterSleep(tries)
1228                    continue
1229                raise plumbing.convert_error_to_porcelain(e) from e
1230            break
1231
1232        resp = models.ActivityGetResponse()
1233        resp.activity = plumbing.convert_activity_to_porcelain(
1234            plumbing_response.activity)
1235        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1236            plumbing_response.meta)
1237        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1238            plumbing_response.rate_limit)
1239        return resp

Get reads one Activity by ID.

def list(self, filter, *args, timeout=None)
1241    def list(self, filter, *args, timeout=None):
1242        '''
1243         List gets a list of Activities matching a given set of criteria.
1244         The 'before' and 'after' filters can be used to control the time
1245         range of the output activities. If not provided, one week of back
1246         of activities will be returned.
1247        '''
1248        req = ActivityListRequest()
1249        req.meta.CopyFrom(ListRequestMetadata())
1250        if self.parent.page_limit > 0:
1251            req.meta.limit = self.parent.page_limit
1252        if self.parent.snapshot_datetime is not None:
1253            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1254
1255        req.filter = plumbing.quote_filter_args(filter, *args)
1256
1257        def generator(svc, req):
1258            tries = 0
1259            while True:
1260                try:
1261                    plumbing_response = svc.stub.List(
1262                        req,
1263                        metadata=svc.parent.get_metadata(
1264                            'Activities.List', req),
1265                        timeout=timeout)
1266                except Exception as e:
1267                    if self.parent.shouldRetry(tries, e):
1268                        tries += 1
1269                        self.parent.jitterSleep(tries)
1270                        continue
1271                    raise plumbing.convert_error_to_porcelain(e) from e
1272                tries = 0
1273                for plumbing_item in plumbing_response.activities:
1274                    yield plumbing.convert_activity_to_porcelain(plumbing_item)
1275                if plumbing_response.meta.next_cursor == '':
1276                    break
1277                req.meta.cursor = plumbing_response.meta.next_cursor
1278
1279        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.

class ApprovalWorkflowApprovers:
1282class ApprovalWorkflowApprovers:
1283    '''
1284     ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep
1285    See `strongdm.models.ApprovalWorkflowApprover`.
1286    '''
1287    def __init__(self, channel, client):
1288        self.parent = client
1289        self.stub = ApprovalWorkflowApproversStub(channel)
1290
1291    def create(self, approval_workflow_approver, timeout=None):
1292        '''
1293         Create creates a new approval workflow approver.
1294        '''
1295        req = ApprovalWorkflowApproverCreateRequest()
1296
1297        if approval_workflow_approver is not None:
1298            req.approval_workflow_approver.CopyFrom(
1299                plumbing.convert_approval_workflow_approver_to_plumbing(
1300                    approval_workflow_approver))
1301        tries = 0
1302        plumbing_response = None
1303        while True:
1304            try:
1305                plumbing_response = self.stub.Create(
1306                    req,
1307                    metadata=self.parent.get_metadata(
1308                        'ApprovalWorkflowApprovers.Create', req),
1309                    timeout=timeout)
1310            except Exception as e:
1311                if self.parent.shouldRetry(tries, e):
1312                    tries += 1
1313                    self.parent.jitterSleep(tries)
1314                    continue
1315                raise plumbing.convert_error_to_porcelain(e) from e
1316            break
1317
1318        resp = models.ApprovalWorkflowApproverCreateResponse()
1319        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1320            plumbing_response.approval_workflow_approver)
1321        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1322            plumbing_response.rate_limit)
1323        return resp
1324
1325    def get(self, id, timeout=None):
1326        '''
1327         Get reads one approval workflow approver by ID.
1328        '''
1329        req = ApprovalWorkflowApproverGetRequest()
1330        if self.parent.snapshot_datetime is not None:
1331            req.meta.CopyFrom(GetRequestMetadata())
1332            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1333
1334        req.id = (id)
1335        tries = 0
1336        plumbing_response = None
1337        while True:
1338            try:
1339                plumbing_response = self.stub.Get(
1340                    req,
1341                    metadata=self.parent.get_metadata(
1342                        'ApprovalWorkflowApprovers.Get', req),
1343                    timeout=timeout)
1344            except Exception as e:
1345                if self.parent.shouldRetry(tries, e):
1346                    tries += 1
1347                    self.parent.jitterSleep(tries)
1348                    continue
1349                raise plumbing.convert_error_to_porcelain(e) from e
1350            break
1351
1352        resp = models.ApprovalWorkflowApproverGetResponse()
1353        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1354            plumbing_response.approval_workflow_approver)
1355        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1356            plumbing_response.meta)
1357        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1358            plumbing_response.rate_limit)
1359        return resp
1360
1361    def delete(self, id, timeout=None):
1362        '''
1363         Delete deletes an existing approval workflow approver.
1364        '''
1365        req = ApprovalWorkflowApproverDeleteRequest()
1366
1367        req.id = (id)
1368        tries = 0
1369        plumbing_response = None
1370        while True:
1371            try:
1372                plumbing_response = self.stub.Delete(
1373                    req,
1374                    metadata=self.parent.get_metadata(
1375                        'ApprovalWorkflowApprovers.Delete', req),
1376                    timeout=timeout)
1377            except Exception as e:
1378                if self.parent.shouldRetry(tries, e):
1379                    tries += 1
1380                    self.parent.jitterSleep(tries)
1381                    continue
1382                raise plumbing.convert_error_to_porcelain(e) from e
1383            break
1384
1385        resp = models.ApprovalWorkflowApproverDeleteResponse()
1386        resp.id = (plumbing_response.id)
1387        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1388            plumbing_response.rate_limit)
1389        return resp
1390
1391    def list(self, filter, *args, timeout=None):
1392        '''
1393         Lists existing approval workflow approvers.
1394        '''
1395        req = ApprovalWorkflowApproverListRequest()
1396        req.meta.CopyFrom(ListRequestMetadata())
1397        if self.parent.page_limit > 0:
1398            req.meta.limit = self.parent.page_limit
1399        if self.parent.snapshot_datetime is not None:
1400            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1401
1402        req.filter = plumbing.quote_filter_args(filter, *args)
1403
1404        def generator(svc, req):
1405            tries = 0
1406            while True:
1407                try:
1408                    plumbing_response = svc.stub.List(
1409                        req,
1410                        metadata=svc.parent.get_metadata(
1411                            'ApprovalWorkflowApprovers.List', req),
1412                        timeout=timeout)
1413                except Exception as e:
1414                    if self.parent.shouldRetry(tries, e):
1415                        tries += 1
1416                        self.parent.jitterSleep(tries)
1417                        continue
1418                    raise plumbing.convert_error_to_porcelain(e) from e
1419                tries = 0
1420                for plumbing_item in plumbing_response.approval_workflow_approvers:
1421                    yield plumbing.convert_approval_workflow_approver_to_porcelain(
1422                        plumbing_item)
1423                if plumbing_response.meta.next_cursor == '':
1424                    break
1425                req.meta.cursor = plumbing_response.meta.next_cursor
1426
1427        return generator(self, req)

ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep See strongdm.models.ApprovalWorkflowApprover.

ApprovalWorkflowApprovers(channel, client)
1287    def __init__(self, channel, client):
1288        self.parent = client
1289        self.stub = ApprovalWorkflowApproversStub(channel)
def create(self, approval_workflow_approver, timeout=None)
1291    def create(self, approval_workflow_approver, timeout=None):
1292        '''
1293         Create creates a new approval workflow approver.
1294        '''
1295        req = ApprovalWorkflowApproverCreateRequest()
1296
1297        if approval_workflow_approver is not None:
1298            req.approval_workflow_approver.CopyFrom(
1299                plumbing.convert_approval_workflow_approver_to_plumbing(
1300                    approval_workflow_approver))
1301        tries = 0
1302        plumbing_response = None
1303        while True:
1304            try:
1305                plumbing_response = self.stub.Create(
1306                    req,
1307                    metadata=self.parent.get_metadata(
1308                        'ApprovalWorkflowApprovers.Create', req),
1309                    timeout=timeout)
1310            except Exception as e:
1311                if self.parent.shouldRetry(tries, e):
1312                    tries += 1
1313                    self.parent.jitterSleep(tries)
1314                    continue
1315                raise plumbing.convert_error_to_porcelain(e) from e
1316            break
1317
1318        resp = models.ApprovalWorkflowApproverCreateResponse()
1319        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1320            plumbing_response.approval_workflow_approver)
1321        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1322            plumbing_response.rate_limit)
1323        return resp

Create creates a new approval workflow approver.

def get(self, id, timeout=None)
1325    def get(self, id, timeout=None):
1326        '''
1327         Get reads one approval workflow approver by ID.
1328        '''
1329        req = ApprovalWorkflowApproverGetRequest()
1330        if self.parent.snapshot_datetime is not None:
1331            req.meta.CopyFrom(GetRequestMetadata())
1332            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1333
1334        req.id = (id)
1335        tries = 0
1336        plumbing_response = None
1337        while True:
1338            try:
1339                plumbing_response = self.stub.Get(
1340                    req,
1341                    metadata=self.parent.get_metadata(
1342                        'ApprovalWorkflowApprovers.Get', req),
1343                    timeout=timeout)
1344            except Exception as e:
1345                if self.parent.shouldRetry(tries, e):
1346                    tries += 1
1347                    self.parent.jitterSleep(tries)
1348                    continue
1349                raise plumbing.convert_error_to_porcelain(e) from e
1350            break
1351
1352        resp = models.ApprovalWorkflowApproverGetResponse()
1353        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1354            plumbing_response.approval_workflow_approver)
1355        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1356            plumbing_response.meta)
1357        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1358            plumbing_response.rate_limit)
1359        return resp

Get reads one approval workflow approver by ID.

def delete(self, id, timeout=None)
1361    def delete(self, id, timeout=None):
1362        '''
1363         Delete deletes an existing approval workflow approver.
1364        '''
1365        req = ApprovalWorkflowApproverDeleteRequest()
1366
1367        req.id = (id)
1368        tries = 0
1369        plumbing_response = None
1370        while True:
1371            try:
1372                plumbing_response = self.stub.Delete(
1373                    req,
1374                    metadata=self.parent.get_metadata(
1375                        'ApprovalWorkflowApprovers.Delete', req),
1376                    timeout=timeout)
1377            except Exception as e:
1378                if self.parent.shouldRetry(tries, e):
1379                    tries += 1
1380                    self.parent.jitterSleep(tries)
1381                    continue
1382                raise plumbing.convert_error_to_porcelain(e) from e
1383            break
1384
1385        resp = models.ApprovalWorkflowApproverDeleteResponse()
1386        resp.id = (plumbing_response.id)
1387        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1388            plumbing_response.rate_limit)
1389        return resp

Delete deletes an existing approval workflow approver.

def list(self, filter, *args, timeout=None)
1391    def list(self, filter, *args, timeout=None):
1392        '''
1393         Lists existing approval workflow approvers.
1394        '''
1395        req = ApprovalWorkflowApproverListRequest()
1396        req.meta.CopyFrom(ListRequestMetadata())
1397        if self.parent.page_limit > 0:
1398            req.meta.limit = self.parent.page_limit
1399        if self.parent.snapshot_datetime is not None:
1400            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1401
1402        req.filter = plumbing.quote_filter_args(filter, *args)
1403
1404        def generator(svc, req):
1405            tries = 0
1406            while True:
1407                try:
1408                    plumbing_response = svc.stub.List(
1409                        req,
1410                        metadata=svc.parent.get_metadata(
1411                            'ApprovalWorkflowApprovers.List', req),
1412                        timeout=timeout)
1413                except Exception as e:
1414                    if self.parent.shouldRetry(tries, e):
1415                        tries += 1
1416                        self.parent.jitterSleep(tries)
1417                        continue
1418                    raise plumbing.convert_error_to_porcelain(e) from e
1419                tries = 0
1420                for plumbing_item in plumbing_response.approval_workflow_approvers:
1421                    yield plumbing.convert_approval_workflow_approver_to_porcelain(
1422                        plumbing_item)
1423                if plumbing_response.meta.next_cursor == '':
1424                    break
1425                req.meta.cursor = plumbing_response.meta.next_cursor
1426
1427        return generator(self, req)

Lists existing approval workflow approvers.

class SnapshotApprovalWorkflowApprovers:
1430class SnapshotApprovalWorkflowApprovers:
1431    '''
1432    SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers
1433    service for historical queries.
1434    '''
1435    def __init__(self, approval_workflow_approvers):
1436        self.approval_workflow_approvers = approval_workflow_approvers
1437
1438    def get(self, id, timeout=None):
1439        '''
1440         Get reads one approval workflow approver by ID.
1441        '''
1442        return self.approval_workflow_approvers.get(id, timeout=timeout)
1443
1444    def list(self, filter, *args, timeout=None):
1445        '''
1446         Lists existing approval workflow approvers.
1447        '''
1448        return self.approval_workflow_approvers.list(filter,
1449                                                     *args,
1450                                                     timeout=timeout)

SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers service for historical queries.

SnapshotApprovalWorkflowApprovers(approval_workflow_approvers)
1435    def __init__(self, approval_workflow_approvers):
1436        self.approval_workflow_approvers = approval_workflow_approvers
def get(self, id, timeout=None)
1438    def get(self, id, timeout=None):
1439        '''
1440         Get reads one approval workflow approver by ID.
1441        '''
1442        return self.approval_workflow_approvers.get(id, timeout=timeout)

Get reads one approval workflow approver by ID.

def list(self, filter, *args, timeout=None)
1444    def list(self, filter, *args, timeout=None):
1445        '''
1446         Lists existing approval workflow approvers.
1447        '''
1448        return self.approval_workflow_approvers.list(filter,
1449                                                     *args,
1450                                                     timeout=timeout)

Lists existing approval workflow approvers.

class ApprovalWorkflowApproversHistory:
1453class ApprovalWorkflowApproversHistory:
1454    '''
1455     ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover.
1456    See `strongdm.models.ApprovalWorkflowApproverHistory`.
1457    '''
1458    def __init__(self, channel, client):
1459        self.parent = client
1460        self.stub = ApprovalWorkflowApproversHistoryStub(channel)
1461
1462    def list(self, filter, *args, timeout=None):
1463        '''
1464         List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria.
1465        '''
1466        req = ApprovalWorkflowApproverHistoryListRequest()
1467        req.meta.CopyFrom(ListRequestMetadata())
1468        if self.parent.page_limit > 0:
1469            req.meta.limit = self.parent.page_limit
1470        if self.parent.snapshot_datetime is not None:
1471            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1472
1473        req.filter = plumbing.quote_filter_args(filter, *args)
1474
1475        def generator(svc, req):
1476            tries = 0
1477            while True:
1478                try:
1479                    plumbing_response = svc.stub.List(
1480                        req,
1481                        metadata=svc.parent.get_metadata(
1482                            'ApprovalWorkflowApproversHistory.List', req),
1483                        timeout=timeout)
1484                except Exception as e:
1485                    if self.parent.shouldRetry(tries, e):
1486                        tries += 1
1487                        self.parent.jitterSleep(tries)
1488                        continue
1489                    raise plumbing.convert_error_to_porcelain(e) from e
1490                tries = 0
1491                for plumbing_item in plumbing_response.history:
1492                    yield plumbing.convert_approval_workflow_approver_history_to_porcelain(
1493                        plumbing_item)
1494                if plumbing_response.meta.next_cursor == '':
1495                    break
1496                req.meta.cursor = plumbing_response.meta.next_cursor
1497
1498        return generator(self, req)

ApprovalWorkflowApproversHistory records all changes to the state of an ApprovalWorkflowApprover. See strongdm.models.ApprovalWorkflowApproverHistory.

ApprovalWorkflowApproversHistory(channel, client)
1458    def __init__(self, channel, client):
1459        self.parent = client
1460        self.stub = ApprovalWorkflowApproversHistoryStub(channel)
def list(self, filter, *args, timeout=None)
1462    def list(self, filter, *args, timeout=None):
1463        '''
1464         List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria.
1465        '''
1466        req = ApprovalWorkflowApproverHistoryListRequest()
1467        req.meta.CopyFrom(ListRequestMetadata())
1468        if self.parent.page_limit > 0:
1469            req.meta.limit = self.parent.page_limit
1470        if self.parent.snapshot_datetime is not None:
1471            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1472
1473        req.filter = plumbing.quote_filter_args(filter, *args)
1474
1475        def generator(svc, req):
1476            tries = 0
1477            while True:
1478                try:
1479                    plumbing_response = svc.stub.List(
1480                        req,
1481                        metadata=svc.parent.get_metadata(
1482                            'ApprovalWorkflowApproversHistory.List', req),
1483                        timeout=timeout)
1484                except Exception as e:
1485                    if self.parent.shouldRetry(tries, e):
1486                        tries += 1
1487                        self.parent.jitterSleep(tries)
1488                        continue
1489                    raise plumbing.convert_error_to_porcelain(e) from e
1490                tries = 0
1491                for plumbing_item in plumbing_response.history:
1492                    yield plumbing.convert_approval_workflow_approver_history_to_porcelain(
1493                        plumbing_item)
1494                if plumbing_response.meta.next_cursor == '':
1495                    break
1496                req.meta.cursor = plumbing_response.meta.next_cursor
1497
1498        return generator(self, req)

List gets a list of ApprovalWorkflowApproverHistory records matching a given set of criteria.

class ApprovalWorkflowSteps:
1501class ApprovalWorkflowSteps:
1502    '''
1503     ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow
1504    See `strongdm.models.ApprovalWorkflowStep`.
1505    '''
1506    def __init__(self, channel, client):
1507        self.parent = client
1508        self.stub = ApprovalWorkflowStepsStub(channel)
1509
1510    def create(self, approval_workflow_step, timeout=None):
1511        '''
1512         Create creates a new approval workflow step.
1513        '''
1514        req = ApprovalWorkflowStepCreateRequest()
1515
1516        if approval_workflow_step is not None:
1517            req.approval_workflow_step.CopyFrom(
1518                plumbing.convert_approval_workflow_step_to_plumbing(
1519                    approval_workflow_step))
1520        tries = 0
1521        plumbing_response = None
1522        while True:
1523            try:
1524                plumbing_response = self.stub.Create(
1525                    req,
1526                    metadata=self.parent.get_metadata(
1527                        'ApprovalWorkflowSteps.Create', req),
1528                    timeout=timeout)
1529            except Exception as e:
1530                if self.parent.shouldRetry(tries, e):
1531                    tries += 1
1532                    self.parent.jitterSleep(tries)
1533                    continue
1534                raise plumbing.convert_error_to_porcelain(e) from e
1535            break
1536
1537        resp = models.ApprovalWorkflowStepCreateResponse()
1538        resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain(
1539            plumbing_response.approval_workflow_step)
1540        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1541            plumbing_response.rate_limit)
1542        return resp
1543
1544    def get(self, id, timeout=None):
1545        '''
1546         Get reads one approval workflow step by ID.
1547        '''
1548        req = ApprovalWorkflowStepGetRequest()
1549        if self.parent.snapshot_datetime is not None:
1550            req.meta.CopyFrom(GetRequestMetadata())
1551            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1552
1553        req.id = (id)
1554        tries = 0
1555        plumbing_response = None
1556        while True:
1557            try:
1558                plumbing_response = self.stub.Get(
1559                    req,
1560                    metadata=self.parent.get_metadata(
1561                        'ApprovalWorkflowSteps.Get', req),
1562                    timeout=timeout)
1563            except Exception as e:
1564                if self.parent.shouldRetry(tries, e):
1565                    tries += 1
1566                    self.parent.jitterSleep(tries)
1567                    continue
1568                raise plumbing.convert_error_to_porcelain(e) from e
1569            break
1570
1571        resp = models.ApprovalWorkflowStepGetResponse()
1572        resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain(
1573            plumbing_response.approval_workflow_step)
1574        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1575            plumbing_response.meta)
1576        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1577            plumbing_response.rate_limit)
1578        return resp
1579
1580    def delete(self, id, timeout=None):
1581        '''
1582         Delete deletes an existing approval workflow step.
1583        '''
1584        req = ApprovalWorkflowStepDeleteRequest()
1585
1586        req.id = (id)
1587        tries = 0
1588        plumbing_response = None
1589        while True:
1590            try:
1591                plumbing_response = self.stub.Delete(
1592                    req,
1593                    metadata=self.parent.get_metadata(
1594                        'ApprovalWorkflowSteps.Delete', req),
1595                    timeout=timeout)
1596            except Exception as e:
1597                if self.parent.shouldRetry(tries, e):
1598                    tries += 1
1599                    self.parent.jitterSleep(tries)
1600                    continue
1601                raise plumbing.convert_error_to_porcelain(e) from e
1602            break
1603
1604        resp = models.ApprovalWorkflowStepDeleteResponse()
1605        resp.id = (plumbing_response.id)
1606        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1607            plumbing_response.rate_limit)
1608        return resp
1609
1610    def list(self, filter, *args, timeout=None):
1611        '''
1612         Lists existing approval workflow steps.
1613        '''
1614        req = ApprovalWorkflowStepListRequest()
1615        req.meta.CopyFrom(ListRequestMetadata())
1616        if self.parent.page_limit > 0:
1617            req.meta.limit = self.parent.page_limit
1618        if self.parent.snapshot_datetime is not None:
1619            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1620
1621        req.filter = plumbing.quote_filter_args(filter, *args)
1622
1623        def generator(svc, req):
1624            tries = 0
1625            while True:
1626                try:
1627                    plumbing_response = svc.stub.List(
1628                        req,
1629                        metadata=svc.parent.get_metadata(
1630                            'ApprovalWorkflowSteps.List', req),
1631                        timeout=timeout)
1632                except Exception as e:
1633                    if self.parent.shouldRetry(tries, e):
1634                        tries += 1
1635                        self.parent.jitterSleep(tries)
1636                        continue
1637                    raise plumbing.convert_error_to_porcelain(e) from e
1638                tries = 0
1639                for plumbing_item in plumbing_response.approval_workflow_steps:
1640                    yield plumbing.convert_approval_workflow_step_to_porcelain(
1641                        plumbing_item)
1642                if plumbing_response.meta.next_cursor == '':
1643                    break
1644                req.meta.cursor = plumbing_response.meta.next_cursor
1645
1646        return generator(self, req)

ApprovalWorkflowSteps link approval workflow steps to an ApprovalWorkflow See strongdm.models.ApprovalWorkflowStep.

ApprovalWorkflowSteps(channel, client)
1506    def __init__(self, channel, client):
1507        self.parent = client
1508        self.stub = ApprovalWorkflowStepsStub(channel)
def create(self, approval_workflow_step, timeout=None)
1510    def create(self, approval_workflow_step, timeout=None):
1511        '''
1512         Create creates a new approval workflow step.
1513        '''
1514        req = ApprovalWorkflowStepCreateRequest()
1515
1516        if approval_workflow_step is not None:
1517            req.approval_workflow_step.CopyFrom(
1518                plumbing.convert_approval_workflow_step_to_plumbing(
1519                    approval_workflow_step))
1520        tries = 0
1521        plumbing_response = None
1522        while True:
1523            try:
1524                plumbing_response = self.stub.Create(
1525                    req,
1526                    metadata=self.parent.get_metadata(
1527                        'ApprovalWorkflowSteps.Create', req),
1528                    timeout=timeout)
1529            except Exception as e:
1530                if self.parent.shouldRetry(tries, e):
1531                    tries += 1
1532                    self.parent.jitterSleep(tries)
1533                    continue
1534                raise plumbing.convert_error_to_porcelain(e) from e
1535            break
1536
1537        resp = models.ApprovalWorkflowStepCreateResponse()
1538        resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain(
1539            plumbing_response.approval_workflow_step)
1540        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1541            plumbing_response.rate_limit)
1542        return resp

Create creates a new approval workflow step.

def get(self, id, timeout=None)
1544    def get(self, id, timeout=None):
1545        '''
1546         Get reads one approval workflow step by ID.
1547        '''
1548        req = ApprovalWorkflowStepGetRequest()
1549        if self.parent.snapshot_datetime is not None:
1550            req.meta.CopyFrom(GetRequestMetadata())
1551            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1552
1553        req.id = (id)
1554        tries = 0
1555        plumbing_response = None
1556        while True:
1557            try:
1558                plumbing_response = self.stub.Get(
1559                    req,
1560                    metadata=self.parent.get_metadata(
1561                        'ApprovalWorkflowSteps.Get', req),
1562                    timeout=timeout)
1563            except Exception as e:
1564                if self.parent.shouldRetry(tries, e):
1565                    tries += 1
1566                    self.parent.jitterSleep(tries)
1567                    continue
1568                raise plumbing.convert_error_to_porcelain(e) from e
1569            break
1570
1571        resp = models.ApprovalWorkflowStepGetResponse()
1572        resp.approval_workflow_step = plumbing.convert_approval_workflow_step_to_porcelain(
1573            plumbing_response.approval_workflow_step)
1574        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1575            plumbing_response.meta)
1576        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1577            plumbing_response.rate_limit)
1578        return resp

Get reads one approval workflow step by ID.

def delete(self, id, timeout=None)
1580    def delete(self, id, timeout=None):
1581        '''
1582         Delete deletes an existing approval workflow step.
1583        '''
1584        req = ApprovalWorkflowStepDeleteRequest()
1585
1586        req.id = (id)
1587        tries = 0
1588        plumbing_response = None
1589        while True:
1590            try:
1591                plumbing_response = self.stub.Delete(
1592                    req,
1593                    metadata=self.parent.get_metadata(
1594                        'ApprovalWorkflowSteps.Delete', req),
1595                    timeout=timeout)
1596            except Exception as e:
1597                if self.parent.shouldRetry(tries, e):
1598                    tries += 1
1599                    self.parent.jitterSleep(tries)
1600                    continue
1601                raise plumbing.convert_error_to_porcelain(e) from e
1602            break
1603
1604        resp = models.ApprovalWorkflowStepDeleteResponse()
1605        resp.id = (plumbing_response.id)
1606        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1607            plumbing_response.rate_limit)
1608        return resp

Delete deletes an existing approval workflow step.

def list(self, filter, *args, timeout=None)
1610    def list(self, filter, *args, timeout=None):
1611        '''
1612         Lists existing approval workflow steps.
1613        '''
1614        req = ApprovalWorkflowStepListRequest()
1615        req.meta.CopyFrom(ListRequestMetadata())
1616        if self.parent.page_limit > 0:
1617            req.meta.limit = self.parent.page_limit
1618        if self.parent.snapshot_datetime is not None:
1619            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1620
1621        req.filter = plumbing.quote_filter_args(filter, *args)
1622
1623        def generator(svc, req):
1624            tries = 0
1625            while True:
1626                try:
1627                    plumbing_response = svc.stub.List(
1628                        req,
1629                        metadata=svc.parent.get_metadata(
1630                            'ApprovalWorkflowSteps.List', req),
1631                        timeout=timeout)
1632                except Exception as e:
1633                    if self.parent.shouldRetry(tries, e):
1634                        tries += 1
1635                        self.parent.jitterSleep(tries)
1636                        continue
1637                    raise plumbing.convert_error_to_porcelain(e) from e
1638                tries = 0
1639                for plumbing_item in plumbing_response.approval_workflow_steps:
1640                    yield plumbing.convert_approval_workflow_step_to_porcelain(
1641                        plumbing_item)
1642                if plumbing_response.meta.next_cursor == '':
1643                    break
1644                req.meta.cursor = plumbing_response.meta.next_cursor
1645
1646        return generator(self, req)

Lists existing approval workflow steps.

class SnapshotApprovalWorkflowSteps:
1649class SnapshotApprovalWorkflowSteps:
1650    '''
1651    SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps
1652    service for historical queries.
1653    '''
1654    def __init__(self, approval_workflow_steps):
1655        self.approval_workflow_steps = approval_workflow_steps
1656
1657    def get(self, id, timeout=None):
1658        '''
1659         Get reads one approval workflow step by ID.
1660        '''
1661        return self.approval_workflow_steps.get(id, timeout=timeout)
1662
1663    def list(self, filter, *args, timeout=None):
1664        '''
1665         Lists existing approval workflow steps.
1666        '''
1667        return self.approval_workflow_steps.list(filter,
1668                                                 *args,
1669                                                 timeout=timeout)

SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps service for historical queries.

SnapshotApprovalWorkflowSteps(approval_workflow_steps)
1654    def __init__(self, approval_workflow_steps):
1655        self.approval_workflow_steps = approval_workflow_steps
def get(self, id, timeout=None)
1657    def get(self, id, timeout=None):
1658        '''
1659         Get reads one approval workflow step by ID.
1660        '''
1661        return self.approval_workflow_steps.get(id, timeout=timeout)

Get reads one approval workflow step by ID.

def list(self, filter, *args, timeout=None)
1663    def list(self, filter, *args, timeout=None):
1664        '''
1665         Lists existing approval workflow steps.
1666        '''
1667        return self.approval_workflow_steps.list(filter,
1668                                                 *args,
1669                                                 timeout=timeout)

Lists existing approval workflow steps.

class ApprovalWorkflowStepsHistory:
1672class ApprovalWorkflowStepsHistory:
1673    '''
1674     ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep.
1675    See `strongdm.models.ApprovalWorkflowStepHistory`.
1676    '''
1677    def __init__(self, channel, client):
1678        self.parent = client
1679        self.stub = ApprovalWorkflowStepsHistoryStub(channel)
1680
1681    def list(self, filter, *args, timeout=None):
1682        '''
1683         List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria.
1684        '''
1685        req = ApprovalWorkflowStepHistoryListRequest()
1686        req.meta.CopyFrom(ListRequestMetadata())
1687        if self.parent.page_limit > 0:
1688            req.meta.limit = self.parent.page_limit
1689        if self.parent.snapshot_datetime is not None:
1690            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1691
1692        req.filter = plumbing.quote_filter_args(filter, *args)
1693
1694        def generator(svc, req):
1695            tries = 0
1696            while True:
1697                try:
1698                    plumbing_response = svc.stub.List(
1699                        req,
1700                        metadata=svc.parent.get_metadata(
1701                            'ApprovalWorkflowStepsHistory.List', req),
1702                        timeout=timeout)
1703                except Exception as e:
1704                    if self.parent.shouldRetry(tries, e):
1705                        tries += 1
1706                        self.parent.jitterSleep(tries)
1707                        continue
1708                    raise plumbing.convert_error_to_porcelain(e) from e
1709                tries = 0
1710                for plumbing_item in plumbing_response.history:
1711                    yield plumbing.convert_approval_workflow_step_history_to_porcelain(
1712                        plumbing_item)
1713                if plumbing_response.meta.next_cursor == '':
1714                    break
1715                req.meta.cursor = plumbing_response.meta.next_cursor
1716
1717        return generator(self, req)

ApprovalWorkflowStepsHistory records all changes to the state of an ApprovalWorkflowStep. See strongdm.models.ApprovalWorkflowStepHistory.

ApprovalWorkflowStepsHistory(channel, client)
1677    def __init__(self, channel, client):
1678        self.parent = client
1679        self.stub = ApprovalWorkflowStepsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
1681    def list(self, filter, *args, timeout=None):
1682        '''
1683         List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria.
1684        '''
1685        req = ApprovalWorkflowStepHistoryListRequest()
1686        req.meta.CopyFrom(ListRequestMetadata())
1687        if self.parent.page_limit > 0:
1688            req.meta.limit = self.parent.page_limit
1689        if self.parent.snapshot_datetime is not None:
1690            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1691
1692        req.filter = plumbing.quote_filter_args(filter, *args)
1693
1694        def generator(svc, req):
1695            tries = 0
1696            while True:
1697                try:
1698                    plumbing_response = svc.stub.List(
1699                        req,
1700                        metadata=svc.parent.get_metadata(
1701                            'ApprovalWorkflowStepsHistory.List', req),
1702                        timeout=timeout)
1703                except Exception as e:
1704                    if self.parent.shouldRetry(tries, e):
1705                        tries += 1
1706                        self.parent.jitterSleep(tries)
1707                        continue
1708                    raise plumbing.convert_error_to_porcelain(e) from e
1709                tries = 0
1710                for plumbing_item in plumbing_response.history:
1711                    yield plumbing.convert_approval_workflow_step_history_to_porcelain(
1712                        plumbing_item)
1713                if plumbing_response.meta.next_cursor == '':
1714                    break
1715                req.meta.cursor = plumbing_response.meta.next_cursor
1716
1717        return generator(self, req)

List gets a list of ApprovalWorkflowStepHistory records matching a given set of criteria.

class ApprovalWorkflows:
1720class ApprovalWorkflows:
1721    '''
1722     ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized
1723     approvers and be approved or denied.
1724    See `strongdm.models.ApprovalWorkflow`.
1725    '''
1726    def __init__(self, channel, client):
1727        self.parent = client
1728        self.stub = ApprovalWorkflowsStub(channel)
1729
1730    def create(self, approval_workflow, timeout=None):
1731        '''
1732         Create creates a new approval workflow and requires a name and approval mode for the approval workflow.
1733        '''
1734        req = ApprovalWorkflowCreateRequest()
1735
1736        if approval_workflow is not None:
1737            req.approval_workflow.CopyFrom(
1738                plumbing.convert_approval_workflow_to_plumbing(
1739                    approval_workflow))
1740        tries = 0
1741        plumbing_response = None
1742        while True:
1743            try:
1744                plumbing_response = self.stub.Create(
1745                    req,
1746                    metadata=self.parent.get_metadata(
1747                        'ApprovalWorkflows.Create', req),
1748                    timeout=timeout)
1749            except Exception as e:
1750                if self.parent.shouldRetry(tries, e):
1751                    tries += 1
1752                    self.parent.jitterSleep(tries)
1753                    continue
1754                raise plumbing.convert_error_to_porcelain(e) from e
1755            break
1756
1757        resp = models.ApprovalWorkflowCreateResponse()
1758        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1759            plumbing_response.approval_workflow)
1760        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1761            plumbing_response.rate_limit)
1762        return resp
1763
1764    def get(self, id, timeout=None):
1765        '''
1766         Get reads one approval workflow by ID.
1767        '''
1768        req = ApprovalWorkflowGetRequest()
1769        if self.parent.snapshot_datetime is not None:
1770            req.meta.CopyFrom(GetRequestMetadata())
1771            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1772
1773        req.id = (id)
1774        tries = 0
1775        plumbing_response = None
1776        while True:
1777            try:
1778                plumbing_response = self.stub.Get(
1779                    req,
1780                    metadata=self.parent.get_metadata('ApprovalWorkflows.Get',
1781                                                      req),
1782                    timeout=timeout)
1783            except Exception as e:
1784                if self.parent.shouldRetry(tries, e):
1785                    tries += 1
1786                    self.parent.jitterSleep(tries)
1787                    continue
1788                raise plumbing.convert_error_to_porcelain(e) from e
1789            break
1790
1791        resp = models.ApprovalWorkflowGetResponse()
1792        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1793            plumbing_response.approval_workflow)
1794        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1795            plumbing_response.meta)
1796        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1797            plumbing_response.rate_limit)
1798        return resp
1799
1800    def delete(self, id, timeout=None):
1801        '''
1802         Delete deletes an existing approval workflow.
1803        '''
1804        req = ApprovalWorkflowDeleteRequest()
1805
1806        req.id = (id)
1807        tries = 0
1808        plumbing_response = None
1809        while True:
1810            try:
1811                plumbing_response = self.stub.Delete(
1812                    req,
1813                    metadata=self.parent.get_metadata(
1814                        'ApprovalWorkflows.Delete', req),
1815                    timeout=timeout)
1816            except Exception as e:
1817                if self.parent.shouldRetry(tries, e):
1818                    tries += 1
1819                    self.parent.jitterSleep(tries)
1820                    continue
1821                raise plumbing.convert_error_to_porcelain(e) from e
1822            break
1823
1824        resp = models.ApprovalWorkflowDeleteResponse()
1825        resp.id = (plumbing_response.id)
1826        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1827            plumbing_response.rate_limit)
1828        return resp
1829
1830    def update(self, approval_workflow, timeout=None):
1831        '''
1832         Update updates an existing approval workflow.
1833        '''
1834        req = ApprovalWorkflowUpdateRequest()
1835
1836        if approval_workflow is not None:
1837            req.approval_workflow.CopyFrom(
1838                plumbing.convert_approval_workflow_to_plumbing(
1839                    approval_workflow))
1840        tries = 0
1841        plumbing_response = None
1842        while True:
1843            try:
1844                plumbing_response = self.stub.Update(
1845                    req,
1846                    metadata=self.parent.get_metadata(
1847                        'ApprovalWorkflows.Update', req),
1848                    timeout=timeout)
1849            except Exception as e:
1850                if self.parent.shouldRetry(tries, e):
1851                    tries += 1
1852                    self.parent.jitterSleep(tries)
1853                    continue
1854                raise plumbing.convert_error_to_porcelain(e) from e
1855            break
1856
1857        resp = models.ApprovalWorkflowUpdateResponse()
1858        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1859            plumbing_response.approval_workflow)
1860        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1861            plumbing_response.rate_limit)
1862        return resp
1863
1864    def list(self, filter, *args, timeout=None):
1865        '''
1866         Lists existing approval workflows.
1867        '''
1868        req = ApprovalWorkflowListRequest()
1869        req.meta.CopyFrom(ListRequestMetadata())
1870        if self.parent.page_limit > 0:
1871            req.meta.limit = self.parent.page_limit
1872        if self.parent.snapshot_datetime is not None:
1873            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1874
1875        req.filter = plumbing.quote_filter_args(filter, *args)
1876
1877        def generator(svc, req):
1878            tries = 0
1879            while True:
1880                try:
1881                    plumbing_response = svc.stub.List(
1882                        req,
1883                        metadata=svc.parent.get_metadata(
1884                            'ApprovalWorkflows.List', req),
1885                        timeout=timeout)
1886                except Exception as e:
1887                    if self.parent.shouldRetry(tries, e):
1888                        tries += 1
1889                        self.parent.jitterSleep(tries)
1890                        continue
1891                    raise plumbing.convert_error_to_porcelain(e) from e
1892                tries = 0
1893                for plumbing_item in plumbing_response.approval_workflows:
1894                    yield plumbing.convert_approval_workflow_to_porcelain(
1895                        plumbing_item)
1896                if plumbing_response.meta.next_cursor == '':
1897                    break
1898                req.meta.cursor = plumbing_response.meta.next_cursor
1899
1900        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.

ApprovalWorkflows(channel, client)
1726    def __init__(self, channel, client):
1727        self.parent = client
1728        self.stub = ApprovalWorkflowsStub(channel)
def create(self, approval_workflow, timeout=None)
1730    def create(self, approval_workflow, timeout=None):
1731        '''
1732         Create creates a new approval workflow and requires a name and approval mode for the approval workflow.
1733        '''
1734        req = ApprovalWorkflowCreateRequest()
1735
1736        if approval_workflow is not None:
1737            req.approval_workflow.CopyFrom(
1738                plumbing.convert_approval_workflow_to_plumbing(
1739                    approval_workflow))
1740        tries = 0
1741        plumbing_response = None
1742        while True:
1743            try:
1744                plumbing_response = self.stub.Create(
1745                    req,
1746                    metadata=self.parent.get_metadata(
1747                        'ApprovalWorkflows.Create', req),
1748                    timeout=timeout)
1749            except Exception as e:
1750                if self.parent.shouldRetry(tries, e):
1751                    tries += 1
1752                    self.parent.jitterSleep(tries)
1753                    continue
1754                raise plumbing.convert_error_to_porcelain(e) from e
1755            break
1756
1757        resp = models.ApprovalWorkflowCreateResponse()
1758        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1759            plumbing_response.approval_workflow)
1760        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1761            plumbing_response.rate_limit)
1762        return resp

Create creates a new approval workflow and requires a name and approval mode for the approval workflow.

def get(self, id, timeout=None)
1764    def get(self, id, timeout=None):
1765        '''
1766         Get reads one approval workflow by ID.
1767        '''
1768        req = ApprovalWorkflowGetRequest()
1769        if self.parent.snapshot_datetime is not None:
1770            req.meta.CopyFrom(GetRequestMetadata())
1771            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1772
1773        req.id = (id)
1774        tries = 0
1775        plumbing_response = None
1776        while True:
1777            try:
1778                plumbing_response = self.stub.Get(
1779                    req,
1780                    metadata=self.parent.get_metadata('ApprovalWorkflows.Get',
1781                                                      req),
1782                    timeout=timeout)
1783            except Exception as e:
1784                if self.parent.shouldRetry(tries, e):
1785                    tries += 1
1786                    self.parent.jitterSleep(tries)
1787                    continue
1788                raise plumbing.convert_error_to_porcelain(e) from e
1789            break
1790
1791        resp = models.ApprovalWorkflowGetResponse()
1792        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1793            plumbing_response.approval_workflow)
1794        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1795            plumbing_response.meta)
1796        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1797            plumbing_response.rate_limit)
1798        return resp

Get reads one approval workflow by ID.

def delete(self, id, timeout=None)
1800    def delete(self, id, timeout=None):
1801        '''
1802         Delete deletes an existing approval workflow.
1803        '''
1804        req = ApprovalWorkflowDeleteRequest()
1805
1806        req.id = (id)
1807        tries = 0
1808        plumbing_response = None
1809        while True:
1810            try:
1811                plumbing_response = self.stub.Delete(
1812                    req,
1813                    metadata=self.parent.get_metadata(
1814                        'ApprovalWorkflows.Delete', req),
1815                    timeout=timeout)
1816            except Exception as e:
1817                if self.parent.shouldRetry(tries, e):
1818                    tries += 1
1819                    self.parent.jitterSleep(tries)
1820                    continue
1821                raise plumbing.convert_error_to_porcelain(e) from e
1822            break
1823
1824        resp = models.ApprovalWorkflowDeleteResponse()
1825        resp.id = (plumbing_response.id)
1826        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1827            plumbing_response.rate_limit)
1828        return resp

Delete deletes an existing approval workflow.

def update(self, approval_workflow, timeout=None)
1830    def update(self, approval_workflow, timeout=None):
1831        '''
1832         Update updates an existing approval workflow.
1833        '''
1834        req = ApprovalWorkflowUpdateRequest()
1835
1836        if approval_workflow is not None:
1837            req.approval_workflow.CopyFrom(
1838                plumbing.convert_approval_workflow_to_plumbing(
1839                    approval_workflow))
1840        tries = 0
1841        plumbing_response = None
1842        while True:
1843            try:
1844                plumbing_response = self.stub.Update(
1845                    req,
1846                    metadata=self.parent.get_metadata(
1847                        'ApprovalWorkflows.Update', req),
1848                    timeout=timeout)
1849            except Exception as e:
1850                if self.parent.shouldRetry(tries, e):
1851                    tries += 1
1852                    self.parent.jitterSleep(tries)
1853                    continue
1854                raise plumbing.convert_error_to_porcelain(e) from e
1855            break
1856
1857        resp = models.ApprovalWorkflowUpdateResponse()
1858        resp.approval_workflow = plumbing.convert_approval_workflow_to_porcelain(
1859            plumbing_response.approval_workflow)
1860        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1861            plumbing_response.rate_limit)
1862        return resp

Update updates an existing approval workflow.

def list(self, filter, *args, timeout=None)
1864    def list(self, filter, *args, timeout=None):
1865        '''
1866         Lists existing approval workflows.
1867        '''
1868        req = ApprovalWorkflowListRequest()
1869        req.meta.CopyFrom(ListRequestMetadata())
1870        if self.parent.page_limit > 0:
1871            req.meta.limit = self.parent.page_limit
1872        if self.parent.snapshot_datetime is not None:
1873            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1874
1875        req.filter = plumbing.quote_filter_args(filter, *args)
1876
1877        def generator(svc, req):
1878            tries = 0
1879            while True:
1880                try:
1881                    plumbing_response = svc.stub.List(
1882                        req,
1883                        metadata=svc.parent.get_metadata(
1884                            'ApprovalWorkflows.List', req),
1885                        timeout=timeout)
1886                except Exception as e:
1887                    if self.parent.shouldRetry(tries, e):
1888                        tries += 1
1889                        self.parent.jitterSleep(tries)
1890                        continue
1891                    raise plumbing.convert_error_to_porcelain(e) from e
1892                tries = 0
1893                for plumbing_item in plumbing_response.approval_workflows:
1894                    yield plumbing.convert_approval_workflow_to_porcelain(
1895                        plumbing_item)
1896                if plumbing_response.meta.next_cursor == '':
1897                    break
1898                req.meta.cursor = plumbing_response.meta.next_cursor
1899
1900        return generator(self, req)

Lists existing approval workflows.

class SnapshotApprovalWorkflows:
1903class SnapshotApprovalWorkflows:
1904    '''
1905    SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows
1906    service for historical queries.
1907    '''
1908    def __init__(self, approval_workflows):
1909        self.approval_workflows = approval_workflows
1910
1911    def get(self, id, timeout=None):
1912        '''
1913         Get reads one approval workflow by ID.
1914        '''
1915        return self.approval_workflows.get(id, timeout=timeout)
1916
1917    def list(self, filter, *args, timeout=None):
1918        '''
1919         Lists existing approval workflows.
1920        '''
1921        return self.approval_workflows.list(filter, *args, timeout=timeout)

SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows service for historical queries.

SnapshotApprovalWorkflows(approval_workflows)
1908    def __init__(self, approval_workflows):
1909        self.approval_workflows = approval_workflows
def get(self, id, timeout=None)
1911    def get(self, id, timeout=None):
1912        '''
1913         Get reads one approval workflow by ID.
1914        '''
1915        return self.approval_workflows.get(id, timeout=timeout)

Get reads one approval workflow by ID.

def list(self, filter, *args, timeout=None)
1917    def list(self, filter, *args, timeout=None):
1918        '''
1919         Lists existing approval workflows.
1920        '''
1921        return self.approval_workflows.list(filter, *args, timeout=timeout)

Lists existing approval workflows.

class ApprovalWorkflowsHistory:
1924class ApprovalWorkflowsHistory:
1925    '''
1926     ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow.
1927    See `strongdm.models.ApprovalWorkflowHistory`.
1928    '''
1929    def __init__(self, channel, client):
1930        self.parent = client
1931        self.stub = ApprovalWorkflowsHistoryStub(channel)
1932
1933    def list(self, filter, *args, timeout=None):
1934        '''
1935         List gets a list of ApprovalWorkflowHistory records matching a given set of criteria.
1936        '''
1937        req = ApprovalWorkflowHistoryListRequest()
1938        req.meta.CopyFrom(ListRequestMetadata())
1939        if self.parent.page_limit > 0:
1940            req.meta.limit = self.parent.page_limit
1941        if self.parent.snapshot_datetime is not None:
1942            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1943
1944        req.filter = plumbing.quote_filter_args(filter, *args)
1945
1946        def generator(svc, req):
1947            tries = 0
1948            while True:
1949                try:
1950                    plumbing_response = svc.stub.List(
1951                        req,
1952                        metadata=svc.parent.get_metadata(
1953                            'ApprovalWorkflowsHistory.List', req),
1954                        timeout=timeout)
1955                except Exception as e:
1956                    if self.parent.shouldRetry(tries, e):
1957                        tries += 1
1958                        self.parent.jitterSleep(tries)
1959                        continue
1960                    raise plumbing.convert_error_to_porcelain(e) from e
1961                tries = 0
1962                for plumbing_item in plumbing_response.history:
1963                    yield plumbing.convert_approval_workflow_history_to_porcelain(
1964                        plumbing_item)
1965                if plumbing_response.meta.next_cursor == '':
1966                    break
1967                req.meta.cursor = plumbing_response.meta.next_cursor
1968
1969        return generator(self, req)

ApprovalWorkflowsHistory records all changes to the state of an ApprovalWorkflow. See strongdm.models.ApprovalWorkflowHistory.

ApprovalWorkflowsHistory(channel, client)
1929    def __init__(self, channel, client):
1930        self.parent = client
1931        self.stub = ApprovalWorkflowsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
1933    def list(self, filter, *args, timeout=None):
1934        '''
1935         List gets a list of ApprovalWorkflowHistory records matching a given set of criteria.
1936        '''
1937        req = ApprovalWorkflowHistoryListRequest()
1938        req.meta.CopyFrom(ListRequestMetadata())
1939        if self.parent.page_limit > 0:
1940            req.meta.limit = self.parent.page_limit
1941        if self.parent.snapshot_datetime is not None:
1942            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1943
1944        req.filter = plumbing.quote_filter_args(filter, *args)
1945
1946        def generator(svc, req):
1947            tries = 0
1948            while True:
1949                try:
1950                    plumbing_response = svc.stub.List(
1951                        req,
1952                        metadata=svc.parent.get_metadata(
1953                            'ApprovalWorkflowsHistory.List', req),
1954                        timeout=timeout)
1955                except Exception as e:
1956                    if self.parent.shouldRetry(tries, e):
1957                        tries += 1
1958                        self.parent.jitterSleep(tries)
1959                        continue
1960                    raise plumbing.convert_error_to_porcelain(e) from e
1961                tries = 0
1962                for plumbing_item in plumbing_response.history:
1963                    yield plumbing.convert_approval_workflow_history_to_porcelain(
1964                        plumbing_item)
1965                if plumbing_response.meta.next_cursor == '':
1966                    break
1967                req.meta.cursor = plumbing_response.meta.next_cursor
1968
1969        return generator(self, req)

List gets a list of ApprovalWorkflowHistory records matching a given set of criteria.

class ControlPanel:
1972class ControlPanel:
1973    '''
1974     ControlPanel contains all administrative controls.
1975    '''
1976    def __init__(self, channel, client):
1977        self.parent = client
1978        self.stub = ControlPanelStub(channel)
1979
1980    def get_sshca_public_key(self, timeout=None):
1981        '''
1982         GetSSHCAPublicKey retrieves the SSH CA public key.
1983        '''
1984        req = ControlPanelGetSSHCAPublicKeyRequest()
1985
1986        tries = 0
1987        plumbing_response = None
1988        while True:
1989            try:
1990                plumbing_response = self.stub.GetSSHCAPublicKey(
1991                    req,
1992                    metadata=self.parent.get_metadata(
1993                        'ControlPanel.GetSSHCAPublicKey', req),
1994                    timeout=timeout)
1995            except Exception as e:
1996                if self.parent.shouldRetry(tries, e):
1997                    tries += 1
1998                    self.parent.jitterSleep(tries)
1999                    continue
2000                raise plumbing.convert_error_to_porcelain(e) from e
2001            break
2002
2003        resp = models.ControlPanelGetSSHCAPublicKeyResponse()
2004        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2005            plumbing_response.meta)
2006        resp.public_key = (plumbing_response.public_key)
2007        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2008            plumbing_response.rate_limit)
2009        return resp
2010
2011    def get_rdpca_public_key(self, timeout=None):
2012        '''
2013         GetRDPCAPublicKey retrieves the RDP CA public key.
2014        '''
2015        req = ControlPanelGetRDPCAPublicKeyRequest()
2016
2017        tries = 0
2018        plumbing_response = None
2019        while True:
2020            try:
2021                plumbing_response = self.stub.GetRDPCAPublicKey(
2022                    req,
2023                    metadata=self.parent.get_metadata(
2024                        'ControlPanel.GetRDPCAPublicKey', req),
2025                    timeout=timeout)
2026            except Exception as e:
2027                if self.parent.shouldRetry(tries, e):
2028                    tries += 1
2029                    self.parent.jitterSleep(tries)
2030                    continue
2031                raise plumbing.convert_error_to_porcelain(e) from e
2032            break
2033
2034        resp = models.ControlPanelGetRDPCAPublicKeyResponse()
2035        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2036            plumbing_response.meta)
2037        resp.public_key = (plumbing_response.public_key)
2038        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2039            plumbing_response.rate_limit)
2040        return resp
2041
2042    def verify_jwt(self, token, timeout=None):
2043        '''
2044         VerifyJWT reports whether the given JWT token (x-sdm-token) is valid.
2045        '''
2046        req = ControlPanelVerifyJWTRequest()
2047
2048        req.token = (token)
2049        tries = 0
2050        plumbing_response = None
2051        while True:
2052            try:
2053                plumbing_response = self.stub.VerifyJWT(
2054                    req,
2055                    metadata=self.parent.get_metadata('ControlPanel.VerifyJWT',
2056                                                      req),
2057                    timeout=timeout)
2058            except Exception as e:
2059                if self.parent.shouldRetry(tries, e):
2060                    tries += 1
2061                    self.parent.jitterSleep(tries)
2062                    continue
2063                raise plumbing.convert_error_to_porcelain(e) from e
2064            break
2065
2066        resp = models.ControlPanelVerifyJWTResponse()
2067        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2068            plumbing_response.meta)
2069        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2070            plumbing_response.rate_limit)
2071        resp.valid = (plumbing_response.valid)
2072        return resp

ControlPanel contains all administrative controls.

ControlPanel(channel, client)
1976    def __init__(self, channel, client):
1977        self.parent = client
1978        self.stub = ControlPanelStub(channel)
def get_sshca_public_key(self, timeout=None)
1980    def get_sshca_public_key(self, timeout=None):
1981        '''
1982         GetSSHCAPublicKey retrieves the SSH CA public key.
1983        '''
1984        req = ControlPanelGetSSHCAPublicKeyRequest()
1985
1986        tries = 0
1987        plumbing_response = None
1988        while True:
1989            try:
1990                plumbing_response = self.stub.GetSSHCAPublicKey(
1991                    req,
1992                    metadata=self.parent.get_metadata(
1993                        'ControlPanel.GetSSHCAPublicKey', req),
1994                    timeout=timeout)
1995            except Exception as e:
1996                if self.parent.shouldRetry(tries, e):
1997                    tries += 1
1998                    self.parent.jitterSleep(tries)
1999                    continue
2000                raise plumbing.convert_error_to_porcelain(e) from e
2001            break
2002
2003        resp = models.ControlPanelGetSSHCAPublicKeyResponse()
2004        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2005            plumbing_response.meta)
2006        resp.public_key = (plumbing_response.public_key)
2007        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2008            plumbing_response.rate_limit)
2009        return resp

GetSSHCAPublicKey retrieves the SSH CA public key.

def get_rdpca_public_key(self, timeout=None)
2011    def get_rdpca_public_key(self, timeout=None):
2012        '''
2013         GetRDPCAPublicKey retrieves the RDP CA public key.
2014        '''
2015        req = ControlPanelGetRDPCAPublicKeyRequest()
2016
2017        tries = 0
2018        plumbing_response = None
2019        while True:
2020            try:
2021                plumbing_response = self.stub.GetRDPCAPublicKey(
2022                    req,
2023                    metadata=self.parent.get_metadata(
2024                        'ControlPanel.GetRDPCAPublicKey', req),
2025                    timeout=timeout)
2026            except Exception as e:
2027                if self.parent.shouldRetry(tries, e):
2028                    tries += 1
2029                    self.parent.jitterSleep(tries)
2030                    continue
2031                raise plumbing.convert_error_to_porcelain(e) from e
2032            break
2033
2034        resp = models.ControlPanelGetRDPCAPublicKeyResponse()
2035        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2036            plumbing_response.meta)
2037        resp.public_key = (plumbing_response.public_key)
2038        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2039            plumbing_response.rate_limit)
2040        return resp

GetRDPCAPublicKey retrieves the RDP CA public key.

def verify_jwt(self, token, timeout=None)
2042    def verify_jwt(self, token, timeout=None):
2043        '''
2044         VerifyJWT reports whether the given JWT token (x-sdm-token) is valid.
2045        '''
2046        req = ControlPanelVerifyJWTRequest()
2047
2048        req.token = (token)
2049        tries = 0
2050        plumbing_response = None
2051        while True:
2052            try:
2053                plumbing_response = self.stub.VerifyJWT(
2054                    req,
2055                    metadata=self.parent.get_metadata('ControlPanel.VerifyJWT',
2056                                                      req),
2057                    timeout=timeout)
2058            except Exception as e:
2059                if self.parent.shouldRetry(tries, e):
2060                    tries += 1
2061                    self.parent.jitterSleep(tries)
2062                    continue
2063                raise plumbing.convert_error_to_porcelain(e) from e
2064            break
2065
2066        resp = models.ControlPanelVerifyJWTResponse()
2067        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2068            plumbing_response.meta)
2069        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2070            plumbing_response.rate_limit)
2071        resp.valid = (plumbing_response.valid)
2072        return resp

VerifyJWT reports whether the given JWT token (x-sdm-token) is valid.

class HealthChecks:
2075class HealthChecks:
2076    '''
2077     HealthChecks lists the last healthcheck between each node and resource.
2078     Note the unconventional capitalization here is to prevent having a collision with GRPC
2079    See `strongdm.models.Healthcheck`.
2080    '''
2081    def __init__(self, channel, client):
2082        self.parent = client
2083        self.stub = HealthChecksStub(channel)
2084
2085    def list(self, filter, *args, timeout=None):
2086        '''
2087         List gets a list of Healthchecks matching a given set of criteria.
2088        '''
2089        req = HealthcheckListRequest()
2090        req.meta.CopyFrom(ListRequestMetadata())
2091        if self.parent.page_limit > 0:
2092            req.meta.limit = self.parent.page_limit
2093        if self.parent.snapshot_datetime is not None:
2094            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2095
2096        req.filter = plumbing.quote_filter_args(filter, *args)
2097
2098        def generator(svc, req):
2099            tries = 0
2100            while True:
2101                try:
2102                    plumbing_response = svc.stub.List(
2103                        req,
2104                        metadata=svc.parent.get_metadata(
2105                            'HealthChecks.List', req),
2106                        timeout=timeout)
2107                except Exception as e:
2108                    if self.parent.shouldRetry(tries, e):
2109                        tries += 1
2110                        self.parent.jitterSleep(tries)
2111                        continue
2112                    raise plumbing.convert_error_to_porcelain(e) from e
2113                tries = 0
2114                for plumbing_item in plumbing_response.healthchecks:
2115                    yield plumbing.convert_healthcheck_to_porcelain(
2116                        plumbing_item)
2117                if plumbing_response.meta.next_cursor == '':
2118                    break
2119                req.meta.cursor = plumbing_response.meta.next_cursor
2120
2121        return generator(self, req)

HealthChecks lists the last healthcheck between each node and resource. Note the unconventional capitalization here is to prevent having a collision with GRPC See strongdm.models.Healthcheck.

HealthChecks(channel, client)
2081    def __init__(self, channel, client):
2082        self.parent = client
2083        self.stub = HealthChecksStub(channel)
def list(self, filter, *args, timeout=None)
2085    def list(self, filter, *args, timeout=None):
2086        '''
2087         List gets a list of Healthchecks matching a given set of criteria.
2088        '''
2089        req = HealthcheckListRequest()
2090        req.meta.CopyFrom(ListRequestMetadata())
2091        if self.parent.page_limit > 0:
2092            req.meta.limit = self.parent.page_limit
2093        if self.parent.snapshot_datetime is not None:
2094            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2095
2096        req.filter = plumbing.quote_filter_args(filter, *args)
2097
2098        def generator(svc, req):
2099            tries = 0
2100            while True:
2101                try:
2102                    plumbing_response = svc.stub.List(
2103                        req,
2104                        metadata=svc.parent.get_metadata(
2105                            'HealthChecks.List', req),
2106                        timeout=timeout)
2107                except Exception as e:
2108                    if self.parent.shouldRetry(tries, e):
2109                        tries += 1
2110                        self.parent.jitterSleep(tries)
2111                        continue
2112                    raise plumbing.convert_error_to_porcelain(e) from e
2113                tries = 0
2114                for plumbing_item in plumbing_response.healthchecks:
2115                    yield plumbing.convert_healthcheck_to_porcelain(
2116                        plumbing_item)
2117                if plumbing_response.meta.next_cursor == '':
2118                    break
2119                req.meta.cursor = plumbing_response.meta.next_cursor
2120
2121        return generator(self, req)

List gets a list of Healthchecks matching a given set of criteria.

class IdentityAliases:
2124class IdentityAliases:
2125    '''
2126     IdentityAliases assign an alias to an account within an IdentitySet.
2127     The alias is used as the username when connecting to a identity supported resource.
2128    See `strongdm.models.IdentityAlias`.
2129    '''
2130    def __init__(self, channel, client):
2131        self.parent = client
2132        self.stub = IdentityAliasesStub(channel)
2133
2134    def create(self, identity_alias, timeout=None):
2135        '''
2136         Create registers a new IdentityAlias.
2137        '''
2138        req = IdentityAliasCreateRequest()
2139
2140        if identity_alias is not None:
2141            req.identity_alias.CopyFrom(
2142                plumbing.convert_identity_alias_to_plumbing(identity_alias))
2143        tries = 0
2144        plumbing_response = None
2145        while True:
2146            try:
2147                plumbing_response = self.stub.Create(
2148                    req,
2149                    metadata=self.parent.get_metadata('IdentityAliases.Create',
2150                                                      req),
2151                    timeout=timeout)
2152            except Exception as e:
2153                if self.parent.shouldRetry(tries, e):
2154                    tries += 1
2155                    self.parent.jitterSleep(tries)
2156                    continue
2157                raise plumbing.convert_error_to_porcelain(e) from e
2158            break
2159
2160        resp = models.IdentityAliasCreateResponse()
2161        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2162            plumbing_response.identity_alias)
2163        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2164            plumbing_response.meta)
2165        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2166            plumbing_response.rate_limit)
2167        return resp
2168
2169    def get(self, id, timeout=None):
2170        '''
2171         Get reads one IdentityAlias by ID.
2172        '''
2173        req = IdentityAliasGetRequest()
2174        if self.parent.snapshot_datetime is not None:
2175            req.meta.CopyFrom(GetRequestMetadata())
2176            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2177
2178        req.id = (id)
2179        tries = 0
2180        plumbing_response = None
2181        while True:
2182            try:
2183                plumbing_response = self.stub.Get(
2184                    req,
2185                    metadata=self.parent.get_metadata('IdentityAliases.Get',
2186                                                      req),
2187                    timeout=timeout)
2188            except Exception as e:
2189                if self.parent.shouldRetry(tries, e):
2190                    tries += 1
2191                    self.parent.jitterSleep(tries)
2192                    continue
2193                raise plumbing.convert_error_to_porcelain(e) from e
2194            break
2195
2196        resp = models.IdentityAliasGetResponse()
2197        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2198            plumbing_response.identity_alias)
2199        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2200            plumbing_response.meta)
2201        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2202            plumbing_response.rate_limit)
2203        return resp
2204
2205    def update(self, identity_alias, timeout=None):
2206        '''
2207         Update replaces all the fields of a IdentityAlias by ID.
2208        '''
2209        req = IdentityAliasUpdateRequest()
2210
2211        if identity_alias is not None:
2212            req.identity_alias.CopyFrom(
2213                plumbing.convert_identity_alias_to_plumbing(identity_alias))
2214        tries = 0
2215        plumbing_response = None
2216        while True:
2217            try:
2218                plumbing_response = self.stub.Update(
2219                    req,
2220                    metadata=self.parent.get_metadata('IdentityAliases.Update',
2221                                                      req),
2222                    timeout=timeout)
2223            except Exception as e:
2224                if self.parent.shouldRetry(tries, e):
2225                    tries += 1
2226                    self.parent.jitterSleep(tries)
2227                    continue
2228                raise plumbing.convert_error_to_porcelain(e) from e
2229            break
2230
2231        resp = models.IdentityAliasUpdateResponse()
2232        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2233            plumbing_response.identity_alias)
2234        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2235            plumbing_response.meta)
2236        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2237            plumbing_response.rate_limit)
2238        return resp
2239
2240    def delete(self, id, timeout=None):
2241        '''
2242         Delete removes a IdentityAlias by ID.
2243        '''
2244        req = IdentityAliasDeleteRequest()
2245
2246        req.id = (id)
2247        tries = 0
2248        plumbing_response = None
2249        while True:
2250            try:
2251                plumbing_response = self.stub.Delete(
2252                    req,
2253                    metadata=self.parent.get_metadata('IdentityAliases.Delete',
2254                                                      req),
2255                    timeout=timeout)
2256            except Exception as e:
2257                if self.parent.shouldRetry(tries, e):
2258                    tries += 1
2259                    self.parent.jitterSleep(tries)
2260                    continue
2261                raise plumbing.convert_error_to_porcelain(e) from e
2262            break
2263
2264        resp = models.IdentityAliasDeleteResponse()
2265        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2266            plumbing_response.meta)
2267        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2268            plumbing_response.rate_limit)
2269        return resp
2270
2271    def list(self, filter, *args, timeout=None):
2272        '''
2273         List gets a list of IdentityAliases matching a given set of criteria.
2274        '''
2275        req = IdentityAliasListRequest()
2276        req.meta.CopyFrom(ListRequestMetadata())
2277        if self.parent.page_limit > 0:
2278            req.meta.limit = self.parent.page_limit
2279        if self.parent.snapshot_datetime is not None:
2280            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2281
2282        req.filter = plumbing.quote_filter_args(filter, *args)
2283
2284        def generator(svc, req):
2285            tries = 0
2286            while True:
2287                try:
2288                    plumbing_response = svc.stub.List(
2289                        req,
2290                        metadata=svc.parent.get_metadata(
2291                            'IdentityAliases.List', req),
2292                        timeout=timeout)
2293                except Exception as e:
2294                    if self.parent.shouldRetry(tries, e):
2295                        tries += 1
2296                        self.parent.jitterSleep(tries)
2297                        continue
2298                    raise plumbing.convert_error_to_porcelain(e) from e
2299                tries = 0
2300                for plumbing_item in plumbing_response.identity_aliases:
2301                    yield plumbing.convert_identity_alias_to_porcelain(
2302                        plumbing_item)
2303                if plumbing_response.meta.next_cursor == '':
2304                    break
2305                req.meta.cursor = plumbing_response.meta.next_cursor
2306
2307        return generator(self, req)

IdentityAliases assign an alias to an account within an IdentitySet. The alias is used as the username when connecting to a identity supported resource. See strongdm.models.IdentityAlias.

IdentityAliases(channel, client)
2130    def __init__(self, channel, client):
2131        self.parent = client
2132        self.stub = IdentityAliasesStub(channel)
def create(self, identity_alias, timeout=None)
2134    def create(self, identity_alias, timeout=None):
2135        '''
2136         Create registers a new IdentityAlias.
2137        '''
2138        req = IdentityAliasCreateRequest()
2139
2140        if identity_alias is not None:
2141            req.identity_alias.CopyFrom(
2142                plumbing.convert_identity_alias_to_plumbing(identity_alias))
2143        tries = 0
2144        plumbing_response = None
2145        while True:
2146            try:
2147                plumbing_response = self.stub.Create(
2148                    req,
2149                    metadata=self.parent.get_metadata('IdentityAliases.Create',
2150                                                      req),
2151                    timeout=timeout)
2152            except Exception as e:
2153                if self.parent.shouldRetry(tries, e):
2154                    tries += 1
2155                    self.parent.jitterSleep(tries)
2156                    continue
2157                raise plumbing.convert_error_to_porcelain(e) from e
2158            break
2159
2160        resp = models.IdentityAliasCreateResponse()
2161        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2162            plumbing_response.identity_alias)
2163        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2164            plumbing_response.meta)
2165        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2166            plumbing_response.rate_limit)
2167        return resp

Create registers a new IdentityAlias.

def get(self, id, timeout=None)
2169    def get(self, id, timeout=None):
2170        '''
2171         Get reads one IdentityAlias by ID.
2172        '''
2173        req = IdentityAliasGetRequest()
2174        if self.parent.snapshot_datetime is not None:
2175            req.meta.CopyFrom(GetRequestMetadata())
2176            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2177
2178        req.id = (id)
2179        tries = 0
2180        plumbing_response = None
2181        while True:
2182            try:
2183                plumbing_response = self.stub.Get(
2184                    req,
2185                    metadata=self.parent.get_metadata('IdentityAliases.Get',
2186                                                      req),
2187                    timeout=timeout)
2188            except Exception as e:
2189                if self.parent.shouldRetry(tries, e):
2190                    tries += 1
2191                    self.parent.jitterSleep(tries)
2192                    continue
2193                raise plumbing.convert_error_to_porcelain(e) from e
2194            break
2195
2196        resp = models.IdentityAliasGetResponse()
2197        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2198            plumbing_response.identity_alias)
2199        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2200            plumbing_response.meta)
2201        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2202            plumbing_response.rate_limit)
2203        return resp

Get reads one IdentityAlias by ID.

def update(self, identity_alias, timeout=None)
2205    def update(self, identity_alias, timeout=None):
2206        '''
2207         Update replaces all the fields of a IdentityAlias by ID.
2208        '''
2209        req = IdentityAliasUpdateRequest()
2210
2211        if identity_alias is not None:
2212            req.identity_alias.CopyFrom(
2213                plumbing.convert_identity_alias_to_plumbing(identity_alias))
2214        tries = 0
2215        plumbing_response = None
2216        while True:
2217            try:
2218                plumbing_response = self.stub.Update(
2219                    req,
2220                    metadata=self.parent.get_metadata('IdentityAliases.Update',
2221                                                      req),
2222                    timeout=timeout)
2223            except Exception as e:
2224                if self.parent.shouldRetry(tries, e):
2225                    tries += 1
2226                    self.parent.jitterSleep(tries)
2227                    continue
2228                raise plumbing.convert_error_to_porcelain(e) from e
2229            break
2230
2231        resp = models.IdentityAliasUpdateResponse()
2232        resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
2233            plumbing_response.identity_alias)
2234        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2235            plumbing_response.meta)
2236        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2237            plumbing_response.rate_limit)
2238        return resp

Update replaces all the fields of a IdentityAlias by ID.

def delete(self, id, timeout=None)
2240    def delete(self, id, timeout=None):
2241        '''
2242         Delete removes a IdentityAlias by ID.
2243        '''
2244        req = IdentityAliasDeleteRequest()
2245
2246        req.id = (id)
2247        tries = 0
2248        plumbing_response = None
2249        while True:
2250            try:
2251                plumbing_response = self.stub.Delete(
2252                    req,
2253                    metadata=self.parent.get_metadata('IdentityAliases.Delete',
2254                                                      req),
2255                    timeout=timeout)
2256            except Exception as e:
2257                if self.parent.shouldRetry(tries, e):
2258                    tries += 1
2259                    self.parent.jitterSleep(tries)
2260                    continue
2261                raise plumbing.convert_error_to_porcelain(e) from e
2262            break
2263
2264        resp = models.IdentityAliasDeleteResponse()
2265        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2266            plumbing_response.meta)
2267        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2268            plumbing_response.rate_limit)
2269        return resp

Delete removes a IdentityAlias by ID.

def list(self, filter, *args, timeout=None)
2271    def list(self, filter, *args, timeout=None):
2272        '''
2273         List gets a list of IdentityAliases matching a given set of criteria.
2274        '''
2275        req = IdentityAliasListRequest()
2276        req.meta.CopyFrom(ListRequestMetadata())
2277        if self.parent.page_limit > 0:
2278            req.meta.limit = self.parent.page_limit
2279        if self.parent.snapshot_datetime is not None:
2280            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2281
2282        req.filter = plumbing.quote_filter_args(filter, *args)
2283
2284        def generator(svc, req):
2285            tries = 0
2286            while True:
2287                try:
2288                    plumbing_response = svc.stub.List(
2289                        req,
2290                        metadata=svc.parent.get_metadata(
2291                            'IdentityAliases.List', req),
2292                        timeout=timeout)
2293                except Exception as e:
2294                    if self.parent.shouldRetry(tries, e):
2295                        tries += 1
2296                        self.parent.jitterSleep(tries)
2297                        continue
2298                    raise plumbing.convert_error_to_porcelain(e) from e
2299                tries = 0
2300                for plumbing_item in plumbing_response.identity_aliases:
2301                    yield plumbing.convert_identity_alias_to_porcelain(
2302                        plumbing_item)
2303                if plumbing_response.meta.next_cursor == '':
2304                    break
2305                req.meta.cursor = plumbing_response.meta.next_cursor
2306
2307        return generator(self, req)

List gets a list of IdentityAliases matching a given set of criteria.

class SnapshotIdentityAliases:
2310class SnapshotIdentityAliases:
2311    '''
2312    SnapshotIdentityAliases exposes the read only methods of the IdentityAliases
2313    service for historical queries.
2314    '''
2315    def __init__(self, identity_aliases):
2316        self.identity_aliases = identity_aliases
2317
2318    def get(self, id, timeout=None):
2319        '''
2320         Get reads one IdentityAlias by ID.
2321        '''
2322        return self.identity_aliases.get(id, timeout=timeout)
2323
2324    def list(self, filter, *args, timeout=None):
2325        '''
2326         List gets a list of IdentityAliases matching a given set of criteria.
2327        '''
2328        return self.identity_aliases.list(filter, *args, timeout=timeout)

SnapshotIdentityAliases exposes the read only methods of the IdentityAliases service for historical queries.

SnapshotIdentityAliases(identity_aliases)
2315    def __init__(self, identity_aliases):
2316        self.identity_aliases = identity_aliases
def get(self, id, timeout=None)
2318    def get(self, id, timeout=None):
2319        '''
2320         Get reads one IdentityAlias by ID.
2321        '''
2322        return self.identity_aliases.get(id, timeout=timeout)

Get reads one IdentityAlias by ID.

def list(self, filter, *args, timeout=None)
2324    def list(self, filter, *args, timeout=None):
2325        '''
2326         List gets a list of IdentityAliases matching a given set of criteria.
2327        '''
2328        return self.identity_aliases.list(filter, *args, timeout=timeout)

List gets a list of IdentityAliases matching a given set of criteria.

class IdentityAliasesHistory:
2331class IdentityAliasesHistory:
2332    '''
2333     IdentityAliasesHistory records all changes to the state of a IdentityAlias.
2334    See `strongdm.models.IdentityAliasHistory`.
2335    '''
2336    def __init__(self, channel, client):
2337        self.parent = client
2338        self.stub = IdentityAliasesHistoryStub(channel)
2339
2340    def list(self, filter, *args, timeout=None):
2341        '''
2342         List gets a list of IdentityAliasHistory records matching a given set of criteria.
2343        '''
2344        req = IdentityAliasHistoryListRequest()
2345        req.meta.CopyFrom(ListRequestMetadata())
2346        if self.parent.page_limit > 0:
2347            req.meta.limit = self.parent.page_limit
2348        if self.parent.snapshot_datetime is not None:
2349            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2350
2351        req.filter = plumbing.quote_filter_args(filter, *args)
2352
2353        def generator(svc, req):
2354            tries = 0
2355            while True:
2356                try:
2357                    plumbing_response = svc.stub.List(
2358                        req,
2359                        metadata=svc.parent.get_metadata(
2360                            'IdentityAliasesHistory.List', req),
2361                        timeout=timeout)
2362                except Exception as e:
2363                    if self.parent.shouldRetry(tries, e):
2364                        tries += 1
2365                        self.parent.jitterSleep(tries)
2366                        continue
2367                    raise plumbing.convert_error_to_porcelain(e) from e
2368                tries = 0
2369                for plumbing_item in plumbing_response.history:
2370                    yield plumbing.convert_identity_alias_history_to_porcelain(
2371                        plumbing_item)
2372                if plumbing_response.meta.next_cursor == '':
2373                    break
2374                req.meta.cursor = plumbing_response.meta.next_cursor
2375
2376        return generator(self, req)

IdentityAliasesHistory records all changes to the state of a IdentityAlias. See strongdm.models.IdentityAliasHistory.

IdentityAliasesHistory(channel, client)
2336    def __init__(self, channel, client):
2337        self.parent = client
2338        self.stub = IdentityAliasesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
2340    def list(self, filter, *args, timeout=None):
2341        '''
2342         List gets a list of IdentityAliasHistory records matching a given set of criteria.
2343        '''
2344        req = IdentityAliasHistoryListRequest()
2345        req.meta.CopyFrom(ListRequestMetadata())
2346        if self.parent.page_limit > 0:
2347            req.meta.limit = self.parent.page_limit
2348        if self.parent.snapshot_datetime is not None:
2349            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2350
2351        req.filter = plumbing.quote_filter_args(filter, *args)
2352
2353        def generator(svc, req):
2354            tries = 0
2355            while True:
2356                try:
2357                    plumbing_response = svc.stub.List(
2358                        req,
2359                        metadata=svc.parent.get_metadata(
2360                            'IdentityAliasesHistory.List', req),
2361                        timeout=timeout)
2362                except Exception as e:
2363                    if self.parent.shouldRetry(tries, e):
2364                        tries += 1
2365                        self.parent.jitterSleep(tries)
2366                        continue
2367                    raise plumbing.convert_error_to_porcelain(e) from e
2368                tries = 0
2369                for plumbing_item in plumbing_response.history:
2370                    yield plumbing.convert_identity_alias_history_to_porcelain(
2371                        plumbing_item)
2372                if plumbing_response.meta.next_cursor == '':
2373                    break
2374                req.meta.cursor = plumbing_response.meta.next_cursor
2375
2376        return generator(self, req)

List gets a list of IdentityAliasHistory records matching a given set of criteria.

class IdentitySets:
2379class IdentitySets:
2380    '''
2381     A IdentitySet is a named grouping of Identity Aliases for Accounts.
2382     An Account's relationship to a IdentitySet is defined via IdentityAlias objects.
2383    See `strongdm.models.IdentitySet`.
2384    '''
2385    def __init__(self, channel, client):
2386        self.parent = client
2387        self.stub = IdentitySetsStub(channel)
2388
2389    def create(self, identity_set, timeout=None):
2390        '''
2391         Create registers a new IdentitySet.
2392        '''
2393        req = IdentitySetCreateRequest()
2394
2395        if identity_set is not None:
2396            req.identity_set.CopyFrom(
2397                plumbing.convert_identity_set_to_plumbing(identity_set))
2398        tries = 0
2399        plumbing_response = None
2400        while True:
2401            try:
2402                plumbing_response = self.stub.Create(
2403                    req,
2404                    metadata=self.parent.get_metadata('IdentitySets.Create',
2405                                                      req),
2406                    timeout=timeout)
2407            except Exception as e:
2408                if self.parent.shouldRetry(tries, e):
2409                    tries += 1
2410                    self.parent.jitterSleep(tries)
2411                    continue
2412                raise plumbing.convert_error_to_porcelain(e) from e
2413            break
2414
2415        resp = models.IdentitySetCreateResponse()
2416        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2417            plumbing_response.identity_set)
2418        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2419            plumbing_response.meta)
2420        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2421            plumbing_response.rate_limit)
2422        return resp
2423
2424    def get(self, id, timeout=None):
2425        '''
2426         Get reads one IdentitySet by ID.
2427        '''
2428        req = IdentitySetGetRequest()
2429        if self.parent.snapshot_datetime is not None:
2430            req.meta.CopyFrom(GetRequestMetadata())
2431            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2432
2433        req.id = (id)
2434        tries = 0
2435        plumbing_response = None
2436        while True:
2437            try:
2438                plumbing_response = self.stub.Get(
2439                    req,
2440                    metadata=self.parent.get_metadata('IdentitySets.Get', req),
2441                    timeout=timeout)
2442            except Exception as e:
2443                if self.parent.shouldRetry(tries, e):
2444                    tries += 1
2445                    self.parent.jitterSleep(tries)
2446                    continue
2447                raise plumbing.convert_error_to_porcelain(e) from e
2448            break
2449
2450        resp = models.IdentitySetGetResponse()
2451        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2452            plumbing_response.identity_set)
2453        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2454            plumbing_response.meta)
2455        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2456            plumbing_response.rate_limit)
2457        return resp
2458
2459    def update(self, identity_set, timeout=None):
2460        '''
2461         Update replaces all the fields of a IdentitySet by ID.
2462        '''
2463        req = IdentitySetUpdateRequest()
2464
2465        if identity_set is not None:
2466            req.identity_set.CopyFrom(
2467                plumbing.convert_identity_set_to_plumbing(identity_set))
2468        tries = 0
2469        plumbing_response = None
2470        while True:
2471            try:
2472                plumbing_response = self.stub.Update(
2473                    req,
2474                    metadata=self.parent.get_metadata('IdentitySets.Update',
2475                                                      req),
2476                    timeout=timeout)
2477            except Exception as e:
2478                if self.parent.shouldRetry(tries, e):
2479                    tries += 1
2480                    self.parent.jitterSleep(tries)
2481                    continue
2482                raise plumbing.convert_error_to_porcelain(e) from e
2483            break
2484
2485        resp = models.IdentitySetUpdateResponse()
2486        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2487            plumbing_response.identity_set)
2488        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2489            plumbing_response.meta)
2490        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2491            plumbing_response.rate_limit)
2492        return resp
2493
2494    def delete(self, id, timeout=None):
2495        '''
2496         Delete removes a IdentitySet by ID.
2497        '''
2498        req = IdentitySetDeleteRequest()
2499
2500        req.id = (id)
2501        tries = 0
2502        plumbing_response = None
2503        while True:
2504            try:
2505                plumbing_response = self.stub.Delete(
2506                    req,
2507                    metadata=self.parent.get_metadata('IdentitySets.Delete',
2508                                                      req),
2509                    timeout=timeout)
2510            except Exception as e:
2511                if self.parent.shouldRetry(tries, e):
2512                    tries += 1
2513                    self.parent.jitterSleep(tries)
2514                    continue
2515                raise plumbing.convert_error_to_porcelain(e) from e
2516            break
2517
2518        resp = models.IdentitySetDeleteResponse()
2519        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2520            plumbing_response.meta)
2521        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2522            plumbing_response.rate_limit)
2523        return resp
2524
2525    def list(self, filter, *args, timeout=None):
2526        '''
2527         List gets a list of IdentitySets matching a given set of criteria.
2528        '''
2529        req = IdentitySetListRequest()
2530        req.meta.CopyFrom(ListRequestMetadata())
2531        if self.parent.page_limit > 0:
2532            req.meta.limit = self.parent.page_limit
2533        if self.parent.snapshot_datetime is not None:
2534            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2535
2536        req.filter = plumbing.quote_filter_args(filter, *args)
2537
2538        def generator(svc, req):
2539            tries = 0
2540            while True:
2541                try:
2542                    plumbing_response = svc.stub.List(
2543                        req,
2544                        metadata=svc.parent.get_metadata(
2545                            'IdentitySets.List', req),
2546                        timeout=timeout)
2547                except Exception as e:
2548                    if self.parent.shouldRetry(tries, e):
2549                        tries += 1
2550                        self.parent.jitterSleep(tries)
2551                        continue
2552                    raise plumbing.convert_error_to_porcelain(e) from e
2553                tries = 0
2554                for plumbing_item in plumbing_response.identity_sets:
2555                    yield plumbing.convert_identity_set_to_porcelain(
2556                        plumbing_item)
2557                if plumbing_response.meta.next_cursor == '':
2558                    break
2559                req.meta.cursor = plumbing_response.meta.next_cursor
2560
2561        return generator(self, req)

A IdentitySet is a named grouping of Identity Aliases for Accounts. An Account's relationship to a IdentitySet is defined via IdentityAlias objects. See strongdm.models.IdentitySet.

IdentitySets(channel, client)
2385    def __init__(self, channel, client):
2386        self.parent = client
2387        self.stub = IdentitySetsStub(channel)
def create(self, identity_set, timeout=None)
2389    def create(self, identity_set, timeout=None):
2390        '''
2391         Create registers a new IdentitySet.
2392        '''
2393        req = IdentitySetCreateRequest()
2394
2395        if identity_set is not None:
2396            req.identity_set.CopyFrom(
2397                plumbing.convert_identity_set_to_plumbing(identity_set))
2398        tries = 0
2399        plumbing_response = None
2400        while True:
2401            try:
2402                plumbing_response = self.stub.Create(
2403                    req,
2404                    metadata=self.parent.get_metadata('IdentitySets.Create',
2405                                                      req),
2406                    timeout=timeout)
2407            except Exception as e:
2408                if self.parent.shouldRetry(tries, e):
2409                    tries += 1
2410                    self.parent.jitterSleep(tries)
2411                    continue
2412                raise plumbing.convert_error_to_porcelain(e) from e
2413            break
2414
2415        resp = models.IdentitySetCreateResponse()
2416        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2417            plumbing_response.identity_set)
2418        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2419            plumbing_response.meta)
2420        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2421            plumbing_response.rate_limit)
2422        return resp

Create registers a new IdentitySet.

def get(self, id, timeout=None)
2424    def get(self, id, timeout=None):
2425        '''
2426         Get reads one IdentitySet by ID.
2427        '''
2428        req = IdentitySetGetRequest()
2429        if self.parent.snapshot_datetime is not None:
2430            req.meta.CopyFrom(GetRequestMetadata())
2431            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2432
2433        req.id = (id)
2434        tries = 0
2435        plumbing_response = None
2436        while True:
2437            try:
2438                plumbing_response = self.stub.Get(
2439                    req,
2440                    metadata=self.parent.get_metadata('IdentitySets.Get', req),
2441                    timeout=timeout)
2442            except Exception as e:
2443                if self.parent.shouldRetry(tries, e):
2444                    tries += 1
2445                    self.parent.jitterSleep(tries)
2446                    continue
2447                raise plumbing.convert_error_to_porcelain(e) from e
2448            break
2449
2450        resp = models.IdentitySetGetResponse()
2451        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2452            plumbing_response.identity_set)
2453        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2454            plumbing_response.meta)
2455        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2456            plumbing_response.rate_limit)
2457        return resp

Get reads one IdentitySet by ID.

def update(self, identity_set, timeout=None)
2459    def update(self, identity_set, timeout=None):
2460        '''
2461         Update replaces all the fields of a IdentitySet by ID.
2462        '''
2463        req = IdentitySetUpdateRequest()
2464
2465        if identity_set is not None:
2466            req.identity_set.CopyFrom(
2467                plumbing.convert_identity_set_to_plumbing(identity_set))
2468        tries = 0
2469        plumbing_response = None
2470        while True:
2471            try:
2472                plumbing_response = self.stub.Update(
2473                    req,
2474                    metadata=self.parent.get_metadata('IdentitySets.Update',
2475                                                      req),
2476                    timeout=timeout)
2477            except Exception as e:
2478                if self.parent.shouldRetry(tries, e):
2479                    tries += 1
2480                    self.parent.jitterSleep(tries)
2481                    continue
2482                raise plumbing.convert_error_to_porcelain(e) from e
2483            break
2484
2485        resp = models.IdentitySetUpdateResponse()
2486        resp.identity_set = plumbing.convert_identity_set_to_porcelain(
2487            plumbing_response.identity_set)
2488        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2489            plumbing_response.meta)
2490        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2491            plumbing_response.rate_limit)
2492        return resp

Update replaces all the fields of a IdentitySet by ID.

def delete(self, id, timeout=None)
2494    def delete(self, id, timeout=None):
2495        '''
2496         Delete removes a IdentitySet by ID.
2497        '''
2498        req = IdentitySetDeleteRequest()
2499
2500        req.id = (id)
2501        tries = 0
2502        plumbing_response = None
2503        while True:
2504            try:
2505                plumbing_response = self.stub.Delete(
2506                    req,
2507                    metadata=self.parent.get_metadata('IdentitySets.Delete',
2508                                                      req),
2509                    timeout=timeout)
2510            except Exception as e:
2511                if self.parent.shouldRetry(tries, e):
2512                    tries += 1
2513                    self.parent.jitterSleep(tries)
2514                    continue
2515                raise plumbing.convert_error_to_porcelain(e) from e
2516            break
2517
2518        resp = models.IdentitySetDeleteResponse()
2519        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2520            plumbing_response.meta)
2521        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2522            plumbing_response.rate_limit)
2523        return resp

Delete removes a IdentitySet by ID.

def list(self, filter, *args, timeout=None)
2525    def list(self, filter, *args, timeout=None):
2526        '''
2527         List gets a list of IdentitySets matching a given set of criteria.
2528        '''
2529        req = IdentitySetListRequest()
2530        req.meta.CopyFrom(ListRequestMetadata())
2531        if self.parent.page_limit > 0:
2532            req.meta.limit = self.parent.page_limit
2533        if self.parent.snapshot_datetime is not None:
2534            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2535
2536        req.filter = plumbing.quote_filter_args(filter, *args)
2537
2538        def generator(svc, req):
2539            tries = 0
2540            while True:
2541                try:
2542                    plumbing_response = svc.stub.List(
2543                        req,
2544                        metadata=svc.parent.get_metadata(
2545                            'IdentitySets.List', req),
2546                        timeout=timeout)
2547                except Exception as e:
2548                    if self.parent.shouldRetry(tries, e):
2549                        tries += 1
2550                        self.parent.jitterSleep(tries)
2551                        continue
2552                    raise plumbing.convert_error_to_porcelain(e) from e
2553                tries = 0
2554                for plumbing_item in plumbing_response.identity_sets:
2555                    yield plumbing.convert_identity_set_to_porcelain(
2556                        plumbing_item)
2557                if plumbing_response.meta.next_cursor == '':
2558                    break
2559                req.meta.cursor = plumbing_response.meta.next_cursor
2560
2561        return generator(self, req)

List gets a list of IdentitySets matching a given set of criteria.

class SnapshotIdentitySets:
2564class SnapshotIdentitySets:
2565    '''
2566    SnapshotIdentitySets exposes the read only methods of the IdentitySets
2567    service for historical queries.
2568    '''
2569    def __init__(self, identity_sets):
2570        self.identity_sets = identity_sets
2571
2572    def get(self, id, timeout=None):
2573        '''
2574         Get reads one IdentitySet by ID.
2575        '''
2576        return self.identity_sets.get(id, timeout=timeout)
2577
2578    def list(self, filter, *args, timeout=None):
2579        '''
2580         List gets a list of IdentitySets matching a given set of criteria.
2581        '''
2582        return self.identity_sets.list(filter, *args, timeout=timeout)

SnapshotIdentitySets exposes the read only methods of the IdentitySets service for historical queries.

SnapshotIdentitySets(identity_sets)
2569    def __init__(self, identity_sets):
2570        self.identity_sets = identity_sets
def get(self, id, timeout=None)
2572    def get(self, id, timeout=None):
2573        '''
2574         Get reads one IdentitySet by ID.
2575        '''
2576        return self.identity_sets.get(id, timeout=timeout)

Get reads one IdentitySet by ID.

def list(self, filter, *args, timeout=None)
2578    def list(self, filter, *args, timeout=None):
2579        '''
2580         List gets a list of IdentitySets matching a given set of criteria.
2581        '''
2582        return self.identity_sets.list(filter, *args, timeout=timeout)

List gets a list of IdentitySets matching a given set of criteria.

class IdentitySetsHistory:
2585class IdentitySetsHistory:
2586    '''
2587     IdentitySetsHistory records all changes to the state of a IdentitySet.
2588    See `strongdm.models.IdentitySetHistory`.
2589    '''
2590    def __init__(self, channel, client):
2591        self.parent = client
2592        self.stub = IdentitySetsHistoryStub(channel)
2593
2594    def list(self, filter, *args, timeout=None):
2595        '''
2596         List gets a list of IdentitySetHistory records matching a given set of criteria.
2597        '''
2598        req = IdentitySetHistoryListRequest()
2599        req.meta.CopyFrom(ListRequestMetadata())
2600        if self.parent.page_limit > 0:
2601            req.meta.limit = self.parent.page_limit
2602        if self.parent.snapshot_datetime is not None:
2603            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2604
2605        req.filter = plumbing.quote_filter_args(filter, *args)
2606
2607        def generator(svc, req):
2608            tries = 0
2609            while True:
2610                try:
2611                    plumbing_response = svc.stub.List(
2612                        req,
2613                        metadata=svc.parent.get_metadata(
2614                            'IdentitySetsHistory.List', req),
2615                        timeout=timeout)
2616                except Exception as e:
2617                    if self.parent.shouldRetry(tries, e):
2618                        tries += 1
2619                        self.parent.jitterSleep(tries)
2620                        continue
2621                    raise plumbing.convert_error_to_porcelain(e) from e
2622                tries = 0
2623                for plumbing_item in plumbing_response.history:
2624                    yield plumbing.convert_identity_set_history_to_porcelain(
2625                        plumbing_item)
2626                if plumbing_response.meta.next_cursor == '':
2627                    break
2628                req.meta.cursor = plumbing_response.meta.next_cursor
2629
2630        return generator(self, req)

IdentitySetsHistory records all changes to the state of a IdentitySet. See strongdm.models.IdentitySetHistory.

IdentitySetsHistory(channel, client)
2590    def __init__(self, channel, client):
2591        self.parent = client
2592        self.stub = IdentitySetsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
2594    def list(self, filter, *args, timeout=None):
2595        '''
2596         List gets a list of IdentitySetHistory records matching a given set of criteria.
2597        '''
2598        req = IdentitySetHistoryListRequest()
2599        req.meta.CopyFrom(ListRequestMetadata())
2600        if self.parent.page_limit > 0:
2601            req.meta.limit = self.parent.page_limit
2602        if self.parent.snapshot_datetime is not None:
2603            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2604
2605        req.filter = plumbing.quote_filter_args(filter, *args)
2606
2607        def generator(svc, req):
2608            tries = 0
2609            while True:
2610                try:
2611                    plumbing_response = svc.stub.List(
2612                        req,
2613                        metadata=svc.parent.get_metadata(
2614                            'IdentitySetsHistory.List', req),
2615                        timeout=timeout)
2616                except Exception as e:
2617                    if self.parent.shouldRetry(tries, e):
2618                        tries += 1
2619                        self.parent.jitterSleep(tries)
2620                        continue
2621                    raise plumbing.convert_error_to_porcelain(e) from e
2622                tries = 0
2623                for plumbing_item in plumbing_response.history:
2624                    yield plumbing.convert_identity_set_history_to_porcelain(
2625                        plumbing_item)
2626                if plumbing_response.meta.next_cursor == '':
2627                    break
2628                req.meta.cursor = plumbing_response.meta.next_cursor
2629
2630        return generator(self, req)

List gets a list of IdentitySetHistory records matching a given set of criteria.

class Nodes:
2633class Nodes:
2634    '''
2635     Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
2636     - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
2637     - **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.
2638    See:
2639    `strongdm.models.Gateway`
2640    `strongdm.models.ProxyCluster`
2641    `strongdm.models.Relay`
2642    '''
2643    def __init__(self, channel, client):
2644        self.parent = client
2645        self.stub = NodesStub(channel)
2646
2647    def create(self, node, timeout=None):
2648        '''
2649         Create registers a new Node.
2650        '''
2651        req = NodeCreateRequest()
2652
2653        if node is not None:
2654            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
2655        tries = 0
2656        plumbing_response = None
2657        while True:
2658            try:
2659                plumbing_response = self.stub.Create(
2660                    req,
2661                    metadata=self.parent.get_metadata('Nodes.Create', req),
2662                    timeout=timeout)
2663            except Exception as e:
2664                if self.parent.shouldRetry(tries, e):
2665                    tries += 1
2666                    self.parent.jitterSleep(tries)
2667                    continue
2668                raise plumbing.convert_error_to_porcelain(e) from e
2669            break
2670
2671        resp = models.NodeCreateResponse()
2672        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2673            plumbing_response.meta)
2674        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2675        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2676            plumbing_response.rate_limit)
2677        resp.token = (plumbing_response.token)
2678        return resp
2679
2680    def get(self, id, timeout=None):
2681        '''
2682         Get reads one Node by ID.
2683        '''
2684        req = NodeGetRequest()
2685        if self.parent.snapshot_datetime is not None:
2686            req.meta.CopyFrom(GetRequestMetadata())
2687            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2688
2689        req.id = (id)
2690        tries = 0
2691        plumbing_response = None
2692        while True:
2693            try:
2694                plumbing_response = self.stub.Get(
2695                    req,
2696                    metadata=self.parent.get_metadata('Nodes.Get', req),
2697                    timeout=timeout)
2698            except Exception as e:
2699                if self.parent.shouldRetry(tries, e):
2700                    tries += 1
2701                    self.parent.jitterSleep(tries)
2702                    continue
2703                raise plumbing.convert_error_to_porcelain(e) from e
2704            break
2705
2706        resp = models.NodeGetResponse()
2707        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2708            plumbing_response.meta)
2709        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2710        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2711            plumbing_response.rate_limit)
2712        return resp
2713
2714    def update(self, node, timeout=None):
2715        '''
2716         Update replaces all the fields of a Node by ID.
2717        '''
2718        req = NodeUpdateRequest()
2719
2720        if node is not None:
2721            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
2722        tries = 0
2723        plumbing_response = None
2724        while True:
2725            try:
2726                plumbing_response = self.stub.Update(
2727                    req,
2728                    metadata=self.parent.get_metadata('Nodes.Update', req),
2729                    timeout=timeout)
2730            except Exception as e:
2731                if self.parent.shouldRetry(tries, e):
2732                    tries += 1
2733                    self.parent.jitterSleep(tries)
2734                    continue
2735                raise plumbing.convert_error_to_porcelain(e) from e
2736            break
2737
2738        resp = models.NodeUpdateResponse()
2739        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2740            plumbing_response.meta)
2741        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2742        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2743            plumbing_response.rate_limit)
2744        return resp
2745
2746    def delete(self, id, timeout=None):
2747        '''
2748         Delete removes a Node by ID.
2749        '''
2750        req = NodeDeleteRequest()
2751
2752        req.id = (id)
2753        tries = 0
2754        plumbing_response = None
2755        while True:
2756            try:
2757                plumbing_response = self.stub.Delete(
2758                    req,
2759                    metadata=self.parent.get_metadata('Nodes.Delete', req),
2760                    timeout=timeout)
2761            except Exception as e:
2762                if self.parent.shouldRetry(tries, e):
2763                    tries += 1
2764                    self.parent.jitterSleep(tries)
2765                    continue
2766                raise plumbing.convert_error_to_porcelain(e) from e
2767            break
2768
2769        resp = models.NodeDeleteResponse()
2770        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2771            plumbing_response.meta)
2772        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2773            plumbing_response.rate_limit)
2774        return resp
2775
2776    def list(self, filter, *args, timeout=None):
2777        '''
2778         List gets a list of Nodes matching a given set of criteria.
2779        '''
2780        req = NodeListRequest()
2781        req.meta.CopyFrom(ListRequestMetadata())
2782        if self.parent.page_limit > 0:
2783            req.meta.limit = self.parent.page_limit
2784        if self.parent.snapshot_datetime is not None:
2785            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2786
2787        req.filter = plumbing.quote_filter_args(filter, *args)
2788
2789        def generator(svc, req):
2790            tries = 0
2791            while True:
2792                try:
2793                    plumbing_response = svc.stub.List(
2794                        req,
2795                        metadata=svc.parent.get_metadata('Nodes.List', req),
2796                        timeout=timeout)
2797                except Exception as e:
2798                    if self.parent.shouldRetry(tries, e):
2799                        tries += 1
2800                        self.parent.jitterSleep(tries)
2801                        continue
2802                    raise plumbing.convert_error_to_porcelain(e) from e
2803                tries = 0
2804                for plumbing_item in plumbing_response.nodes:
2805                    yield plumbing.convert_node_to_porcelain(plumbing_item)
2806                if plumbing_response.meta.next_cursor == '':
2807                    break
2808                req.meta.cursor = plumbing_response.meta.next_cursor
2809
2810        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.ProxyCluster strongdm.models.Relay
Nodes(channel, client)
2643    def __init__(self, channel, client):
2644        self.parent = client
2645        self.stub = NodesStub(channel)
def create(self, node, timeout=None)
2647    def create(self, node, timeout=None):
2648        '''
2649         Create registers a new Node.
2650        '''
2651        req = NodeCreateRequest()
2652
2653        if node is not None:
2654            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
2655        tries = 0
2656        plumbing_response = None
2657        while True:
2658            try:
2659                plumbing_response = self.stub.Create(
2660                    req,
2661                    metadata=self.parent.get_metadata('Nodes.Create', req),
2662                    timeout=timeout)
2663            except Exception as e:
2664                if self.parent.shouldRetry(tries, e):
2665                    tries += 1
2666                    self.parent.jitterSleep(tries)
2667                    continue
2668                raise plumbing.convert_error_to_porcelain(e) from e
2669            break
2670
2671        resp = models.NodeCreateResponse()
2672        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2673            plumbing_response.meta)
2674        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2675        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2676            plumbing_response.rate_limit)
2677        resp.token = (plumbing_response.token)
2678        return resp

Create registers a new Node.

def get(self, id, timeout=None)
2680    def get(self, id, timeout=None):
2681        '''
2682         Get reads one Node by ID.
2683        '''
2684        req = NodeGetRequest()
2685        if self.parent.snapshot_datetime is not None:
2686            req.meta.CopyFrom(GetRequestMetadata())
2687            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2688
2689        req.id = (id)
2690        tries = 0
2691        plumbing_response = None
2692        while True:
2693            try:
2694                plumbing_response = self.stub.Get(
2695                    req,
2696                    metadata=self.parent.get_metadata('Nodes.Get', req),
2697                    timeout=timeout)
2698            except Exception as e:
2699                if self.parent.shouldRetry(tries, e):
2700                    tries += 1
2701                    self.parent.jitterSleep(tries)
2702                    continue
2703                raise plumbing.convert_error_to_porcelain(e) from e
2704            break
2705
2706        resp = models.NodeGetResponse()
2707        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2708            plumbing_response.meta)
2709        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2710        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2711            plumbing_response.rate_limit)
2712        return resp

Get reads one Node by ID.

def update(self, node, timeout=None)
2714    def update(self, node, timeout=None):
2715        '''
2716         Update replaces all the fields of a Node by ID.
2717        '''
2718        req = NodeUpdateRequest()
2719
2720        if node is not None:
2721            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
2722        tries = 0
2723        plumbing_response = None
2724        while True:
2725            try:
2726                plumbing_response = self.stub.Update(
2727                    req,
2728                    metadata=self.parent.get_metadata('Nodes.Update', req),
2729                    timeout=timeout)
2730            except Exception as e:
2731                if self.parent.shouldRetry(tries, e):
2732                    tries += 1
2733                    self.parent.jitterSleep(tries)
2734                    continue
2735                raise plumbing.convert_error_to_porcelain(e) from e
2736            break
2737
2738        resp = models.NodeUpdateResponse()
2739        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2740            plumbing_response.meta)
2741        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2742        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2743            plumbing_response.rate_limit)
2744        return resp

Update replaces all the fields of a Node by ID.

def delete(self, id, timeout=None)
2746    def delete(self, id, timeout=None):
2747        '''
2748         Delete removes a Node by ID.
2749        '''
2750        req = NodeDeleteRequest()
2751
2752        req.id = (id)
2753        tries = 0
2754        plumbing_response = None
2755        while True:
2756            try:
2757                plumbing_response = self.stub.Delete(
2758                    req,
2759                    metadata=self.parent.get_metadata('Nodes.Delete', req),
2760                    timeout=timeout)
2761            except Exception as e:
2762                if self.parent.shouldRetry(tries, e):
2763                    tries += 1
2764                    self.parent.jitterSleep(tries)
2765                    continue
2766                raise plumbing.convert_error_to_porcelain(e) from e
2767            break
2768
2769        resp = models.NodeDeleteResponse()
2770        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
2771            plumbing_response.meta)
2772        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2773            plumbing_response.rate_limit)
2774        return resp

Delete removes a Node by ID.

def list(self, filter, *args, timeout=None)
2776    def list(self, filter, *args, timeout=None):
2777        '''
2778         List gets a list of Nodes matching a given set of criteria.
2779        '''
2780        req = NodeListRequest()
2781        req.meta.CopyFrom(ListRequestMetadata())
2782        if self.parent.page_limit > 0:
2783            req.meta.limit = self.parent.page_limit
2784        if self.parent.snapshot_datetime is not None:
2785            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2786
2787        req.filter = plumbing.quote_filter_args(filter, *args)
2788
2789        def generator(svc, req):
2790            tries = 0
2791            while True:
2792                try:
2793                    plumbing_response = svc.stub.List(
2794                        req,
2795                        metadata=svc.parent.get_metadata('Nodes.List', req),
2796                        timeout=timeout)
2797                except Exception as e:
2798                    if self.parent.shouldRetry(tries, e):
2799                        tries += 1
2800                        self.parent.jitterSleep(tries)
2801                        continue
2802                    raise plumbing.convert_error_to_porcelain(e) from e
2803                tries = 0
2804                for plumbing_item in plumbing_response.nodes:
2805                    yield plumbing.convert_node_to_porcelain(plumbing_item)
2806                if plumbing_response.meta.next_cursor == '':
2807                    break
2808                req.meta.cursor = plumbing_response.meta.next_cursor
2809
2810        return generator(self, req)

List gets a list of Nodes matching a given set of criteria.

class SnapshotNodes:
2813class SnapshotNodes:
2814    '''
2815    SnapshotNodes exposes the read only methods of the Nodes
2816    service for historical queries.
2817    '''
2818    def __init__(self, nodes):
2819        self.nodes = nodes
2820
2821    def get(self, id, timeout=None):
2822        '''
2823         Get reads one Node by ID.
2824        '''
2825        return self.nodes.get(id, timeout=timeout)
2826
2827    def list(self, filter, *args, timeout=None):
2828        '''
2829         List gets a list of Nodes matching a given set of criteria.
2830        '''
2831        return self.nodes.list(filter, *args, timeout=timeout)

SnapshotNodes exposes the read only methods of the Nodes service for historical queries.

SnapshotNodes(nodes)
2818    def __init__(self, nodes):
2819        self.nodes = nodes
def get(self, id, timeout=None)
2821    def get(self, id, timeout=None):
2822        '''
2823         Get reads one Node by ID.
2824        '''
2825        return self.nodes.get(id, timeout=timeout)

Get reads one Node by ID.

def list(self, filter, *args, timeout=None)
2827    def list(self, filter, *args, timeout=None):
2828        '''
2829         List gets a list of Nodes matching a given set of criteria.
2830        '''
2831        return self.nodes.list(filter, *args, timeout=timeout)

List gets a list of Nodes matching a given set of criteria.

class NodesHistory:
2834class NodesHistory:
2835    '''
2836     NodesHistory records all changes to the state of a Node.
2837    See `strongdm.models.NodeHistory`.
2838    '''
2839    def __init__(self, channel, client):
2840        self.parent = client
2841        self.stub = NodesHistoryStub(channel)
2842
2843    def list(self, filter, *args, timeout=None):
2844        '''
2845         List gets a list of NodeHistory records matching a given set of criteria.
2846        '''
2847        req = NodeHistoryListRequest()
2848        req.meta.CopyFrom(ListRequestMetadata())
2849        if self.parent.page_limit > 0:
2850            req.meta.limit = self.parent.page_limit
2851        if self.parent.snapshot_datetime is not None:
2852            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2853
2854        req.filter = plumbing.quote_filter_args(filter, *args)
2855
2856        def generator(svc, req):
2857            tries = 0
2858            while True:
2859                try:
2860                    plumbing_response = svc.stub.List(
2861                        req,
2862                        metadata=svc.parent.get_metadata(
2863                            'NodesHistory.List', req),
2864                        timeout=timeout)
2865                except Exception as e:
2866                    if self.parent.shouldRetry(tries, e):
2867                        tries += 1
2868                        self.parent.jitterSleep(tries)
2869                        continue
2870                    raise plumbing.convert_error_to_porcelain(e) from e
2871                tries = 0
2872                for plumbing_item in plumbing_response.history:
2873                    yield plumbing.convert_node_history_to_porcelain(
2874                        plumbing_item)
2875                if plumbing_response.meta.next_cursor == '':
2876                    break
2877                req.meta.cursor = plumbing_response.meta.next_cursor
2878
2879        return generator(self, req)

NodesHistory records all changes to the state of a Node. See strongdm.models.NodeHistory.

NodesHistory(channel, client)
2839    def __init__(self, channel, client):
2840        self.parent = client
2841        self.stub = NodesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
2843    def list(self, filter, *args, timeout=None):
2844        '''
2845         List gets a list of NodeHistory records matching a given set of criteria.
2846        '''
2847        req = NodeHistoryListRequest()
2848        req.meta.CopyFrom(ListRequestMetadata())
2849        if self.parent.page_limit > 0:
2850            req.meta.limit = self.parent.page_limit
2851        if self.parent.snapshot_datetime is not None:
2852            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2853
2854        req.filter = plumbing.quote_filter_args(filter, *args)
2855
2856        def generator(svc, req):
2857            tries = 0
2858            while True:
2859                try:
2860                    plumbing_response = svc.stub.List(
2861                        req,
2862                        metadata=svc.parent.get_metadata(
2863                            'NodesHistory.List', req),
2864                        timeout=timeout)
2865                except Exception as e:
2866                    if self.parent.shouldRetry(tries, e):
2867                        tries += 1
2868                        self.parent.jitterSleep(tries)
2869                        continue
2870                    raise plumbing.convert_error_to_porcelain(e) from e
2871                tries = 0
2872                for plumbing_item in plumbing_response.history:
2873                    yield plumbing.convert_node_history_to_porcelain(
2874                        plumbing_item)
2875                if plumbing_response.meta.next_cursor == '':
2876                    break
2877                req.meta.cursor = plumbing_response.meta.next_cursor
2878
2879        return generator(self, req)

List gets a list of NodeHistory records matching a given set of criteria.

class OrganizationHistory:
2882class OrganizationHistory:
2883    '''
2884     OrganizationHistory records all changes to the state of an Organization.
2885    See `strongdm.models.OrganizationHistoryRecord`.
2886    '''
2887    def __init__(self, channel, client):
2888        self.parent = client
2889        self.stub = OrganizationHistoryStub(channel)
2890
2891    def list(self, filter, *args, timeout=None):
2892        '''
2893         List gets a list of OrganizationHistory records matching a given set of criteria.
2894        '''
2895        req = OrganizationHistoryListRequest()
2896        req.meta.CopyFrom(ListRequestMetadata())
2897        if self.parent.page_limit > 0:
2898            req.meta.limit = self.parent.page_limit
2899        if self.parent.snapshot_datetime is not None:
2900            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2901
2902        req.filter = plumbing.quote_filter_args(filter, *args)
2903
2904        def generator(svc, req):
2905            tries = 0
2906            while True:
2907                try:
2908                    plumbing_response = svc.stub.List(
2909                        req,
2910                        metadata=svc.parent.get_metadata(
2911                            'OrganizationHistory.List', req),
2912                        timeout=timeout)
2913                except Exception as e:
2914                    if self.parent.shouldRetry(tries, e):
2915                        tries += 1
2916                        self.parent.jitterSleep(tries)
2917                        continue
2918                    raise plumbing.convert_error_to_porcelain(e) from e
2919                tries = 0
2920                for plumbing_item in plumbing_response.history:
2921                    yield plumbing.convert_organization_history_record_to_porcelain(
2922                        plumbing_item)
2923                if plumbing_response.meta.next_cursor == '':
2924                    break
2925                req.meta.cursor = plumbing_response.meta.next_cursor
2926
2927        return generator(self, req)

OrganizationHistory records all changes to the state of an Organization. See strongdm.models.OrganizationHistoryRecord.

OrganizationHistory(channel, client)
2887    def __init__(self, channel, client):
2888        self.parent = client
2889        self.stub = OrganizationHistoryStub(channel)
def list(self, filter, *args, timeout=None)
2891    def list(self, filter, *args, timeout=None):
2892        '''
2893         List gets a list of OrganizationHistory records matching a given set of criteria.
2894        '''
2895        req = OrganizationHistoryListRequest()
2896        req.meta.CopyFrom(ListRequestMetadata())
2897        if self.parent.page_limit > 0:
2898            req.meta.limit = self.parent.page_limit
2899        if self.parent.snapshot_datetime is not None:
2900            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2901
2902        req.filter = plumbing.quote_filter_args(filter, *args)
2903
2904        def generator(svc, req):
2905            tries = 0
2906            while True:
2907                try:
2908                    plumbing_response = svc.stub.List(
2909                        req,
2910                        metadata=svc.parent.get_metadata(
2911                            'OrganizationHistory.List', req),
2912                        timeout=timeout)
2913                except Exception as e:
2914                    if self.parent.shouldRetry(tries, e):
2915                        tries += 1
2916                        self.parent.jitterSleep(tries)
2917                        continue
2918                    raise plumbing.convert_error_to_porcelain(e) from e
2919                tries = 0
2920                for plumbing_item in plumbing_response.history:
2921                    yield plumbing.convert_organization_history_record_to_porcelain(
2922                        plumbing_item)
2923                if plumbing_response.meta.next_cursor == '':
2924                    break
2925                req.meta.cursor = plumbing_response.meta.next_cursor
2926
2927        return generator(self, req)

List gets a list of OrganizationHistory records matching a given set of criteria.

class PeeringGroupNodes:
2930class PeeringGroupNodes:
2931    '''
2932     PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group.
2933    See `strongdm.models.PeeringGroupNode`.
2934    '''
2935    def __init__(self, channel, client):
2936        self.parent = client
2937        self.stub = PeeringGroupNodesStub(channel)
2938
2939    def create(self, peering_group_node, timeout=None):
2940        '''
2941         Create attaches a Node to a PeeringGroup
2942        '''
2943        req = PeeringGroupNodeCreateRequest()
2944
2945        if peering_group_node is not None:
2946            req.peering_group_node.CopyFrom(
2947                plumbing.convert_peering_group_node_to_plumbing(
2948                    peering_group_node))
2949        tries = 0
2950        plumbing_response = None
2951        while True:
2952            try:
2953                plumbing_response = self.stub.Create(
2954                    req,
2955                    metadata=self.parent.get_metadata(
2956                        'PeeringGroupNodes.Create', req),
2957                    timeout=timeout)
2958            except Exception as e:
2959                if self.parent.shouldRetry(tries, e):
2960                    tries += 1
2961                    self.parent.jitterSleep(tries)
2962                    continue
2963                raise plumbing.convert_error_to_porcelain(e) from e
2964            break
2965
2966        resp = models.PeeringGroupNodeCreateResponse()
2967        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2968            plumbing_response.meta)
2969        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
2970            plumbing_response.peering_group_node)
2971        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2972            plumbing_response.rate_limit)
2973        return resp
2974
2975    def delete(self, id, timeout=None):
2976        '''
2977         Delete detaches a Node to a PeeringGroup.
2978        '''
2979        req = PeeringGroupNodeDeleteRequest()
2980
2981        req.id = (id)
2982        tries = 0
2983        plumbing_response = None
2984        while True:
2985            try:
2986                plumbing_response = self.stub.Delete(
2987                    req,
2988                    metadata=self.parent.get_metadata(
2989                        'PeeringGroupNodes.Delete', req),
2990                    timeout=timeout)
2991            except Exception as e:
2992                if self.parent.shouldRetry(tries, e):
2993                    tries += 1
2994                    self.parent.jitterSleep(tries)
2995                    continue
2996                raise plumbing.convert_error_to_porcelain(e) from e
2997            break
2998
2999        resp = models.PeeringGroupNodeDeleteResponse()
3000        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3001            plumbing_response.meta)
3002        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3003            plumbing_response.rate_limit)
3004        return resp
3005
3006    def get(self, id, timeout=None):
3007        '''
3008         Get reads the information of one peering group to node attachment.
3009        '''
3010        req = PeeringGroupNodeGetRequest()
3011        if self.parent.snapshot_datetime is not None:
3012            req.meta.CopyFrom(GetRequestMetadata())
3013            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3014
3015        req.id = (id)
3016        tries = 0
3017        plumbing_response = None
3018        while True:
3019            try:
3020                plumbing_response = self.stub.Get(
3021                    req,
3022                    metadata=self.parent.get_metadata('PeeringGroupNodes.Get',
3023                                                      req),
3024                    timeout=timeout)
3025            except Exception as e:
3026                if self.parent.shouldRetry(tries, e):
3027                    tries += 1
3028                    self.parent.jitterSleep(tries)
3029                    continue
3030                raise plumbing.convert_error_to_porcelain(e) from e
3031            break
3032
3033        resp = models.PeeringGroupNodeGetResponse()
3034        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3035            plumbing_response.meta)
3036        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
3037            plumbing_response.peering_group_node)
3038        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3039            plumbing_response.rate_limit)
3040        return resp
3041
3042    def list(self, filter, *args, timeout=None):
3043        '''
3044         List gets a list of peering group node attachments.
3045        '''
3046        req = PeeringGroupNodeListRequest()
3047        req.meta.CopyFrom(ListRequestMetadata())
3048        if self.parent.page_limit > 0:
3049            req.meta.limit = self.parent.page_limit
3050        if self.parent.snapshot_datetime is not None:
3051            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3052
3053        req.filter = plumbing.quote_filter_args(filter, *args)
3054
3055        def generator(svc, req):
3056            tries = 0
3057            while True:
3058                try:
3059                    plumbing_response = svc.stub.List(
3060                        req,
3061                        metadata=svc.parent.get_metadata(
3062                            'PeeringGroupNodes.List', req),
3063                        timeout=timeout)
3064                except Exception as e:
3065                    if self.parent.shouldRetry(tries, e):
3066                        tries += 1
3067                        self.parent.jitterSleep(tries)
3068                        continue
3069                    raise plumbing.convert_error_to_porcelain(e) from e
3070                tries = 0
3071                for plumbing_item in plumbing_response.peering_group_nodes:
3072                    yield plumbing.convert_peering_group_node_to_porcelain(
3073                        plumbing_item)
3074                if plumbing_response.meta.next_cursor == '':
3075                    break
3076                req.meta.cursor = plumbing_response.meta.next_cursor
3077
3078        return generator(self, req)

PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group. See strongdm.models.PeeringGroupNode.

PeeringGroupNodes(channel, client)
2935    def __init__(self, channel, client):
2936        self.parent = client
2937        self.stub = PeeringGroupNodesStub(channel)
def create(self, peering_group_node, timeout=None)
2939    def create(self, peering_group_node, timeout=None):
2940        '''
2941         Create attaches a Node to a PeeringGroup
2942        '''
2943        req = PeeringGroupNodeCreateRequest()
2944
2945        if peering_group_node is not None:
2946            req.peering_group_node.CopyFrom(
2947                plumbing.convert_peering_group_node_to_plumbing(
2948                    peering_group_node))
2949        tries = 0
2950        plumbing_response = None
2951        while True:
2952            try:
2953                plumbing_response = self.stub.Create(
2954                    req,
2955                    metadata=self.parent.get_metadata(
2956                        'PeeringGroupNodes.Create', req),
2957                    timeout=timeout)
2958            except Exception as e:
2959                if self.parent.shouldRetry(tries, e):
2960                    tries += 1
2961                    self.parent.jitterSleep(tries)
2962                    continue
2963                raise plumbing.convert_error_to_porcelain(e) from e
2964            break
2965
2966        resp = models.PeeringGroupNodeCreateResponse()
2967        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2968            plumbing_response.meta)
2969        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
2970            plumbing_response.peering_group_node)
2971        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2972            plumbing_response.rate_limit)
2973        return resp

Create attaches a Node to a PeeringGroup

def delete(self, id, timeout=None)
2975    def delete(self, id, timeout=None):
2976        '''
2977         Delete detaches a Node to a PeeringGroup.
2978        '''
2979        req = PeeringGroupNodeDeleteRequest()
2980
2981        req.id = (id)
2982        tries = 0
2983        plumbing_response = None
2984        while True:
2985            try:
2986                plumbing_response = self.stub.Delete(
2987                    req,
2988                    metadata=self.parent.get_metadata(
2989                        'PeeringGroupNodes.Delete', req),
2990                    timeout=timeout)
2991            except Exception as e:
2992                if self.parent.shouldRetry(tries, e):
2993                    tries += 1
2994                    self.parent.jitterSleep(tries)
2995                    continue
2996                raise plumbing.convert_error_to_porcelain(e) from e
2997            break
2998
2999        resp = models.PeeringGroupNodeDeleteResponse()
3000        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3001            plumbing_response.meta)
3002        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3003            plumbing_response.rate_limit)
3004        return resp

Delete detaches a Node to a PeeringGroup.

def get(self, id, timeout=None)
3006    def get(self, id, timeout=None):
3007        '''
3008         Get reads the information of one peering group to node attachment.
3009        '''
3010        req = PeeringGroupNodeGetRequest()
3011        if self.parent.snapshot_datetime is not None:
3012            req.meta.CopyFrom(GetRequestMetadata())
3013            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3014
3015        req.id = (id)
3016        tries = 0
3017        plumbing_response = None
3018        while True:
3019            try:
3020                plumbing_response = self.stub.Get(
3021                    req,
3022                    metadata=self.parent.get_metadata('PeeringGroupNodes.Get',
3023                                                      req),
3024                    timeout=timeout)
3025            except Exception as e:
3026                if self.parent.shouldRetry(tries, e):
3027                    tries += 1
3028                    self.parent.jitterSleep(tries)
3029                    continue
3030                raise plumbing.convert_error_to_porcelain(e) from e
3031            break
3032
3033        resp = models.PeeringGroupNodeGetResponse()
3034        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3035            plumbing_response.meta)
3036        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
3037            plumbing_response.peering_group_node)
3038        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3039            plumbing_response.rate_limit)
3040        return resp

Get reads the information of one peering group to node attachment.

def list(self, filter, *args, timeout=None)
3042    def list(self, filter, *args, timeout=None):
3043        '''
3044         List gets a list of peering group node attachments.
3045        '''
3046        req = PeeringGroupNodeListRequest()
3047        req.meta.CopyFrom(ListRequestMetadata())
3048        if self.parent.page_limit > 0:
3049            req.meta.limit = self.parent.page_limit
3050        if self.parent.snapshot_datetime is not None:
3051            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3052
3053        req.filter = plumbing.quote_filter_args(filter, *args)
3054
3055        def generator(svc, req):
3056            tries = 0
3057            while True:
3058                try:
3059                    plumbing_response = svc.stub.List(
3060                        req,
3061                        metadata=svc.parent.get_metadata(
3062                            'PeeringGroupNodes.List', req),
3063                        timeout=timeout)
3064                except Exception as e:
3065                    if self.parent.shouldRetry(tries, e):
3066                        tries += 1
3067                        self.parent.jitterSleep(tries)
3068                        continue
3069                    raise plumbing.convert_error_to_porcelain(e) from e
3070                tries = 0
3071                for plumbing_item in plumbing_response.peering_group_nodes:
3072                    yield plumbing.convert_peering_group_node_to_porcelain(
3073                        plumbing_item)
3074                if plumbing_response.meta.next_cursor == '':
3075                    break
3076                req.meta.cursor = plumbing_response.meta.next_cursor
3077
3078        return generator(self, req)

List gets a list of peering group node attachments.

class PeeringGroupPeers:
3081class PeeringGroupPeers:
3082    '''
3083     PeeringGroupPeers provides the building blocks necessary to link two peering groups.
3084    See `strongdm.models.PeeringGroupPeer`.
3085    '''
3086    def __init__(self, channel, client):
3087        self.parent = client
3088        self.stub = PeeringGroupPeersStub(channel)
3089
3090    def create(self, peering_group_peer, timeout=None):
3091        '''
3092         Create links two peering groups.
3093        '''
3094        req = PeeringGroupPeerCreateRequest()
3095
3096        if peering_group_peer is not None:
3097            req.peering_group_peer.CopyFrom(
3098                plumbing.convert_peering_group_peer_to_plumbing(
3099                    peering_group_peer))
3100        tries = 0
3101        plumbing_response = None
3102        while True:
3103            try:
3104                plumbing_response = self.stub.Create(
3105                    req,
3106                    metadata=self.parent.get_metadata(
3107                        'PeeringGroupPeers.Create', req),
3108                    timeout=timeout)
3109            except Exception as e:
3110                if self.parent.shouldRetry(tries, e):
3111                    tries += 1
3112                    self.parent.jitterSleep(tries)
3113                    continue
3114                raise plumbing.convert_error_to_porcelain(e) from e
3115            break
3116
3117        resp = models.PeeringGroupPeerCreateResponse()
3118        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3119            plumbing_response.meta)
3120        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3121            plumbing_response.peering_group_peer)
3122        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3123            plumbing_response.rate_limit)
3124        return resp
3125
3126    def delete(self, id, timeout=None):
3127        '''
3128         Delete unlinks two peering groups.
3129        '''
3130        req = PeeringGroupPeerDeleteRequest()
3131
3132        req.id = (id)
3133        tries = 0
3134        plumbing_response = None
3135        while True:
3136            try:
3137                plumbing_response = self.stub.Delete(
3138                    req,
3139                    metadata=self.parent.get_metadata(
3140                        'PeeringGroupPeers.Delete', req),
3141                    timeout=timeout)
3142            except Exception as e:
3143                if self.parent.shouldRetry(tries, e):
3144                    tries += 1
3145                    self.parent.jitterSleep(tries)
3146                    continue
3147                raise plumbing.convert_error_to_porcelain(e) from e
3148            break
3149
3150        resp = models.PeeringGroupPeerDeleteResponse()
3151        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3152            plumbing_response.meta)
3153        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3154            plumbing_response.rate_limit)
3155        return resp
3156
3157    def get(self, id, timeout=None):
3158        '''
3159         Get reads the information of one peering group link.
3160        '''
3161        req = PeeringGroupPeerGetRequest()
3162        if self.parent.snapshot_datetime is not None:
3163            req.meta.CopyFrom(GetRequestMetadata())
3164            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3165
3166        req.id = (id)
3167        tries = 0
3168        plumbing_response = None
3169        while True:
3170            try:
3171                plumbing_response = self.stub.Get(
3172                    req,
3173                    metadata=self.parent.get_metadata('PeeringGroupPeers.Get',
3174                                                      req),
3175                    timeout=timeout)
3176            except Exception as e:
3177                if self.parent.shouldRetry(tries, e):
3178                    tries += 1
3179                    self.parent.jitterSleep(tries)
3180                    continue
3181                raise plumbing.convert_error_to_porcelain(e) from e
3182            break
3183
3184        resp = models.PeeringGroupPeerGetResponse()
3185        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3186            plumbing_response.meta)
3187        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3188            plumbing_response.peering_group_peer)
3189        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3190            plumbing_response.rate_limit)
3191        return resp
3192
3193    def list(self, filter, *args, timeout=None):
3194        '''
3195         List gets a list of peering group links.
3196        '''
3197        req = PeeringGroupPeerListRequest()
3198        req.meta.CopyFrom(ListRequestMetadata())
3199        if self.parent.page_limit > 0:
3200            req.meta.limit = self.parent.page_limit
3201        if self.parent.snapshot_datetime is not None:
3202            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3203
3204        req.filter = plumbing.quote_filter_args(filter, *args)
3205
3206        def generator(svc, req):
3207            tries = 0
3208            while True:
3209                try:
3210                    plumbing_response = svc.stub.List(
3211                        req,
3212                        metadata=svc.parent.get_metadata(
3213                            'PeeringGroupPeers.List', req),
3214                        timeout=timeout)
3215                except Exception as e:
3216                    if self.parent.shouldRetry(tries, e):
3217                        tries += 1
3218                        self.parent.jitterSleep(tries)
3219                        continue
3220                    raise plumbing.convert_error_to_porcelain(e) from e
3221                tries = 0
3222                for plumbing_item in plumbing_response.peering_group_peers:
3223                    yield plumbing.convert_peering_group_peer_to_porcelain(
3224                        plumbing_item)
3225                if plumbing_response.meta.next_cursor == '':
3226                    break
3227                req.meta.cursor = plumbing_response.meta.next_cursor
3228
3229        return generator(self, req)

PeeringGroupPeers provides the building blocks necessary to link two peering groups. See strongdm.models.PeeringGroupPeer.

PeeringGroupPeers(channel, client)
3086    def __init__(self, channel, client):
3087        self.parent = client
3088        self.stub = PeeringGroupPeersStub(channel)
def create(self, peering_group_peer, timeout=None)
3090    def create(self, peering_group_peer, timeout=None):
3091        '''
3092         Create links two peering groups.
3093        '''
3094        req = PeeringGroupPeerCreateRequest()
3095
3096        if peering_group_peer is not None:
3097            req.peering_group_peer.CopyFrom(
3098                plumbing.convert_peering_group_peer_to_plumbing(
3099                    peering_group_peer))
3100        tries = 0
3101        plumbing_response = None
3102        while True:
3103            try:
3104                plumbing_response = self.stub.Create(
3105                    req,
3106                    metadata=self.parent.get_metadata(
3107                        'PeeringGroupPeers.Create', req),
3108                    timeout=timeout)
3109            except Exception as e:
3110                if self.parent.shouldRetry(tries, e):
3111                    tries += 1
3112                    self.parent.jitterSleep(tries)
3113                    continue
3114                raise plumbing.convert_error_to_porcelain(e) from e
3115            break
3116
3117        resp = models.PeeringGroupPeerCreateResponse()
3118        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3119            plumbing_response.meta)
3120        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3121            plumbing_response.peering_group_peer)
3122        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3123            plumbing_response.rate_limit)
3124        return resp

Create links two peering groups.

def delete(self, id, timeout=None)
3126    def delete(self, id, timeout=None):
3127        '''
3128         Delete unlinks two peering groups.
3129        '''
3130        req = PeeringGroupPeerDeleteRequest()
3131
3132        req.id = (id)
3133        tries = 0
3134        plumbing_response = None
3135        while True:
3136            try:
3137                plumbing_response = self.stub.Delete(
3138                    req,
3139                    metadata=self.parent.get_metadata(
3140                        'PeeringGroupPeers.Delete', req),
3141                    timeout=timeout)
3142            except Exception as e:
3143                if self.parent.shouldRetry(tries, e):
3144                    tries += 1
3145                    self.parent.jitterSleep(tries)
3146                    continue
3147                raise plumbing.convert_error_to_porcelain(e) from e
3148            break
3149
3150        resp = models.PeeringGroupPeerDeleteResponse()
3151        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3152            plumbing_response.meta)
3153        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3154            plumbing_response.rate_limit)
3155        return resp

Delete unlinks two peering groups.

def get(self, id, timeout=None)
3157    def get(self, id, timeout=None):
3158        '''
3159         Get reads the information of one peering group link.
3160        '''
3161        req = PeeringGroupPeerGetRequest()
3162        if self.parent.snapshot_datetime is not None:
3163            req.meta.CopyFrom(GetRequestMetadata())
3164            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3165
3166        req.id = (id)
3167        tries = 0
3168        plumbing_response = None
3169        while True:
3170            try:
3171                plumbing_response = self.stub.Get(
3172                    req,
3173                    metadata=self.parent.get_metadata('PeeringGroupPeers.Get',
3174                                                      req),
3175                    timeout=timeout)
3176            except Exception as e:
3177                if self.parent.shouldRetry(tries, e):
3178                    tries += 1
3179                    self.parent.jitterSleep(tries)
3180                    continue
3181                raise plumbing.convert_error_to_porcelain(e) from e
3182            break
3183
3184        resp = models.PeeringGroupPeerGetResponse()
3185        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3186            plumbing_response.meta)
3187        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3188            plumbing_response.peering_group_peer)
3189        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3190            plumbing_response.rate_limit)
3191        return resp

Get reads the information of one peering group link.

def list(self, filter, *args, timeout=None)
3193    def list(self, filter, *args, timeout=None):
3194        '''
3195         List gets a list of peering group links.
3196        '''
3197        req = PeeringGroupPeerListRequest()
3198        req.meta.CopyFrom(ListRequestMetadata())
3199        if self.parent.page_limit > 0:
3200            req.meta.limit = self.parent.page_limit
3201        if self.parent.snapshot_datetime is not None:
3202            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3203
3204        req.filter = plumbing.quote_filter_args(filter, *args)
3205
3206        def generator(svc, req):
3207            tries = 0
3208            while True:
3209                try:
3210                    plumbing_response = svc.stub.List(
3211                        req,
3212                        metadata=svc.parent.get_metadata(
3213                            'PeeringGroupPeers.List', req),
3214                        timeout=timeout)
3215                except Exception as e:
3216                    if self.parent.shouldRetry(tries, e):
3217                        tries += 1
3218                        self.parent.jitterSleep(tries)
3219                        continue
3220                    raise plumbing.convert_error_to_porcelain(e) from e
3221                tries = 0
3222                for plumbing_item in plumbing_response.peering_group_peers:
3223                    yield plumbing.convert_peering_group_peer_to_porcelain(
3224                        plumbing_item)
3225                if plumbing_response.meta.next_cursor == '':
3226                    break
3227                req.meta.cursor = plumbing_response.meta.next_cursor
3228
3229        return generator(self, req)

List gets a list of peering group links.

class PeeringGroupResources:
3232class PeeringGroupResources:
3233    '''
3234     PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group.
3235    See `strongdm.models.PeeringGroupResource`.
3236    '''
3237    def __init__(self, channel, client):
3238        self.parent = client
3239        self.stub = PeeringGroupResourcesStub(channel)
3240
3241    def create(self, peering_group_resource, timeout=None):
3242        '''
3243         Create attaches a Resource to a PeeringGroup
3244        '''
3245        req = PeeringGroupResourceCreateRequest()
3246
3247        if peering_group_resource is not None:
3248            req.peering_group_resource.CopyFrom(
3249                plumbing.convert_peering_group_resource_to_plumbing(
3250                    peering_group_resource))
3251        tries = 0
3252        plumbing_response = None
3253        while True:
3254            try:
3255                plumbing_response = self.stub.Create(
3256                    req,
3257                    metadata=self.parent.get_metadata(
3258                        'PeeringGroupResources.Create', req),
3259                    timeout=timeout)
3260            except Exception as e:
3261                if self.parent.shouldRetry(tries, e):
3262                    tries += 1
3263                    self.parent.jitterSleep(tries)
3264                    continue
3265                raise plumbing.convert_error_to_porcelain(e) from e
3266            break
3267
3268        resp = models.PeeringGroupResourceCreateResponse()
3269        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3270            plumbing_response.meta)
3271        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3272            plumbing_response.peering_group_resource)
3273        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3274            plumbing_response.rate_limit)
3275        return resp
3276
3277    def delete(self, id, timeout=None):
3278        '''
3279         Delete detaches a Resource to a PeeringGroup
3280        '''
3281        req = PeeringGroupResourceDeleteRequest()
3282
3283        req.id = (id)
3284        tries = 0
3285        plumbing_response = None
3286        while True:
3287            try:
3288                plumbing_response = self.stub.Delete(
3289                    req,
3290                    metadata=self.parent.get_metadata(
3291                        'PeeringGroupResources.Delete', req),
3292                    timeout=timeout)
3293            except Exception as e:
3294                if self.parent.shouldRetry(tries, e):
3295                    tries += 1
3296                    self.parent.jitterSleep(tries)
3297                    continue
3298                raise plumbing.convert_error_to_porcelain(e) from e
3299            break
3300
3301        resp = models.PeeringGroupResourceDeleteResponse()
3302        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3303            plumbing_response.meta)
3304        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3305            plumbing_response.rate_limit)
3306        return resp
3307
3308    def get(self, id, timeout=None):
3309        '''
3310         Get reads the information of one peering group to resource attachment.
3311        '''
3312        req = PeeringGroupResourceGetRequest()
3313        if self.parent.snapshot_datetime is not None:
3314            req.meta.CopyFrom(GetRequestMetadata())
3315            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3316
3317        req.id = (id)
3318        tries = 0
3319        plumbing_response = None
3320        while True:
3321            try:
3322                plumbing_response = self.stub.Get(
3323                    req,
3324                    metadata=self.parent.get_metadata(
3325                        'PeeringGroupResources.Get', 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            break
3334
3335        resp = models.PeeringGroupResourceGetResponse()
3336        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3337            plumbing_response.meta)
3338        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3339            plumbing_response.peering_group_resource)
3340        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3341            plumbing_response.rate_limit)
3342        return resp
3343
3344    def list(self, filter, *args, timeout=None):
3345        '''
3346         List gets a list of peering group resource attachments.
3347        '''
3348        req = PeeringGroupResourceListRequest()
3349        req.meta.CopyFrom(ListRequestMetadata())
3350        if self.parent.page_limit > 0:
3351            req.meta.limit = self.parent.page_limit
3352        if self.parent.snapshot_datetime is not None:
3353            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3354
3355        req.filter = plumbing.quote_filter_args(filter, *args)
3356
3357        def generator(svc, req):
3358            tries = 0
3359            while True:
3360                try:
3361                    plumbing_response = svc.stub.List(
3362                        req,
3363                        metadata=svc.parent.get_metadata(
3364                            'PeeringGroupResources.List', req),
3365                        timeout=timeout)
3366                except Exception as e:
3367                    if self.parent.shouldRetry(tries, e):
3368                        tries += 1
3369                        self.parent.jitterSleep(tries)
3370                        continue
3371                    raise plumbing.convert_error_to_porcelain(e) from e
3372                tries = 0
3373                for plumbing_item in plumbing_response.peering_group_resources:
3374                    yield plumbing.convert_peering_group_resource_to_porcelain(
3375                        plumbing_item)
3376                if plumbing_response.meta.next_cursor == '':
3377                    break
3378                req.meta.cursor = plumbing_response.meta.next_cursor
3379
3380        return generator(self, req)

PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group. See strongdm.models.PeeringGroupResource.

PeeringGroupResources(channel, client)
3237    def __init__(self, channel, client):
3238        self.parent = client
3239        self.stub = PeeringGroupResourcesStub(channel)
def create(self, peering_group_resource, timeout=None)
3241    def create(self, peering_group_resource, timeout=None):
3242        '''
3243         Create attaches a Resource to a PeeringGroup
3244        '''
3245        req = PeeringGroupResourceCreateRequest()
3246
3247        if peering_group_resource is not None:
3248            req.peering_group_resource.CopyFrom(
3249                plumbing.convert_peering_group_resource_to_plumbing(
3250                    peering_group_resource))
3251        tries = 0
3252        plumbing_response = None
3253        while True:
3254            try:
3255                plumbing_response = self.stub.Create(
3256                    req,
3257                    metadata=self.parent.get_metadata(
3258                        'PeeringGroupResources.Create', req),
3259                    timeout=timeout)
3260            except Exception as e:
3261                if self.parent.shouldRetry(tries, e):
3262                    tries += 1
3263                    self.parent.jitterSleep(tries)
3264                    continue
3265                raise plumbing.convert_error_to_porcelain(e) from e
3266            break
3267
3268        resp = models.PeeringGroupResourceCreateResponse()
3269        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3270            plumbing_response.meta)
3271        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3272            plumbing_response.peering_group_resource)
3273        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3274            plumbing_response.rate_limit)
3275        return resp

Create attaches a Resource to a PeeringGroup

def delete(self, id, timeout=None)
3277    def delete(self, id, timeout=None):
3278        '''
3279         Delete detaches a Resource to a PeeringGroup
3280        '''
3281        req = PeeringGroupResourceDeleteRequest()
3282
3283        req.id = (id)
3284        tries = 0
3285        plumbing_response = None
3286        while True:
3287            try:
3288                plumbing_response = self.stub.Delete(
3289                    req,
3290                    metadata=self.parent.get_metadata(
3291                        'PeeringGroupResources.Delete', req),
3292                    timeout=timeout)
3293            except Exception as e:
3294                if self.parent.shouldRetry(tries, e):
3295                    tries += 1
3296                    self.parent.jitterSleep(tries)
3297                    continue
3298                raise plumbing.convert_error_to_porcelain(e) from e
3299            break
3300
3301        resp = models.PeeringGroupResourceDeleteResponse()
3302        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3303            plumbing_response.meta)
3304        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3305            plumbing_response.rate_limit)
3306        return resp

Delete detaches a Resource to a PeeringGroup

def get(self, id, timeout=None)
3308    def get(self, id, timeout=None):
3309        '''
3310         Get reads the information of one peering group to resource attachment.
3311        '''
3312        req = PeeringGroupResourceGetRequest()
3313        if self.parent.snapshot_datetime is not None:
3314            req.meta.CopyFrom(GetRequestMetadata())
3315            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3316
3317        req.id = (id)
3318        tries = 0
3319        plumbing_response = None
3320        while True:
3321            try:
3322                plumbing_response = self.stub.Get(
3323                    req,
3324                    metadata=self.parent.get_metadata(
3325                        'PeeringGroupResources.Get', 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            break
3334
3335        resp = models.PeeringGroupResourceGetResponse()
3336        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3337            plumbing_response.meta)
3338        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3339            plumbing_response.peering_group_resource)
3340        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3341            plumbing_response.rate_limit)
3342        return resp

Get reads the information of one peering group to resource attachment.

def list(self, filter, *args, timeout=None)
3344    def list(self, filter, *args, timeout=None):
3345        '''
3346         List gets a list of peering group resource attachments.
3347        '''
3348        req = PeeringGroupResourceListRequest()
3349        req.meta.CopyFrom(ListRequestMetadata())
3350        if self.parent.page_limit > 0:
3351            req.meta.limit = self.parent.page_limit
3352        if self.parent.snapshot_datetime is not None:
3353            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3354
3355        req.filter = plumbing.quote_filter_args(filter, *args)
3356
3357        def generator(svc, req):
3358            tries = 0
3359            while True:
3360                try:
3361                    plumbing_response = svc.stub.List(
3362                        req,
3363                        metadata=svc.parent.get_metadata(
3364                            'PeeringGroupResources.List', req),
3365                        timeout=timeout)
3366                except Exception as e:
3367                    if self.parent.shouldRetry(tries, e):
3368                        tries += 1
3369                        self.parent.jitterSleep(tries)
3370                        continue
3371                    raise plumbing.convert_error_to_porcelain(e) from e
3372                tries = 0
3373                for plumbing_item in plumbing_response.peering_group_resources:
3374                    yield plumbing.convert_peering_group_resource_to_porcelain(
3375                        plumbing_item)
3376                if plumbing_response.meta.next_cursor == '':
3377                    break
3378                req.meta.cursor = plumbing_response.meta.next_cursor
3379
3380        return generator(self, req)

List gets a list of peering group resource attachments.

class PeeringGroups:
3383class PeeringGroups:
3384    '''
3385     PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing.
3386    See `strongdm.models.PeeringGroup`.
3387    '''
3388    def __init__(self, channel, client):
3389        self.parent = client
3390        self.stub = PeeringGroupsStub(channel)
3391
3392    def create(self, peering_group, timeout=None):
3393        '''
3394         Create registers a new PeeringGroup.
3395        '''
3396        req = PeeringGroupCreateRequest()
3397
3398        if peering_group is not None:
3399            req.peering_group.CopyFrom(
3400                plumbing.convert_peering_group_to_plumbing(peering_group))
3401        tries = 0
3402        plumbing_response = None
3403        while True:
3404            try:
3405                plumbing_response = self.stub.Create(
3406                    req,
3407                    metadata=self.parent.get_metadata('PeeringGroups.Create',
3408                                                      req),
3409                    timeout=timeout)
3410            except Exception as e:
3411                if self.parent.shouldRetry(tries, e):
3412                    tries += 1
3413                    self.parent.jitterSleep(tries)
3414                    continue
3415                raise plumbing.convert_error_to_porcelain(e) from e
3416            break
3417
3418        resp = models.PeeringGroupCreateResponse()
3419        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3420            plumbing_response.meta)
3421        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3422            plumbing_response.peering_group)
3423        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3424            plumbing_response.rate_limit)
3425        return resp
3426
3427    def delete(self, id, timeout=None):
3428        '''
3429         Delete removes a PeeringGroup by ID.
3430        '''
3431        req = PeeringGroupDeleteRequest()
3432
3433        req.id = (id)
3434        tries = 0
3435        plumbing_response = None
3436        while True:
3437            try:
3438                plumbing_response = self.stub.Delete(
3439                    req,
3440                    metadata=self.parent.get_metadata('PeeringGroups.Delete',
3441                                                      req),
3442                    timeout=timeout)
3443            except Exception as e:
3444                if self.parent.shouldRetry(tries, e):
3445                    tries += 1
3446                    self.parent.jitterSleep(tries)
3447                    continue
3448                raise plumbing.convert_error_to_porcelain(e) from e
3449            break
3450
3451        resp = models.PeeringGroupDeleteResponse()
3452        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3453            plumbing_response.meta)
3454        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3455            plumbing_response.rate_limit)
3456        return resp
3457
3458    def get(self, id, timeout=None):
3459        '''
3460         Get reads one PeeringGroup by ID. It will load all its dependencies.
3461        '''
3462        req = PeeringGroupGetRequest()
3463        if self.parent.snapshot_datetime is not None:
3464            req.meta.CopyFrom(GetRequestMetadata())
3465            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3466
3467        req.id = (id)
3468        tries = 0
3469        plumbing_response = None
3470        while True:
3471            try:
3472                plumbing_response = self.stub.Get(
3473                    req,
3474                    metadata=self.parent.get_metadata('PeeringGroups.Get',
3475                                                      req),
3476                    timeout=timeout)
3477            except Exception as e:
3478                if self.parent.shouldRetry(tries, e):
3479                    tries += 1
3480                    self.parent.jitterSleep(tries)
3481                    continue
3482                raise plumbing.convert_error_to_porcelain(e) from e
3483            break
3484
3485        resp = models.PeeringGroupGetResponse()
3486        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3487            plumbing_response.meta)
3488        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3489            plumbing_response.peering_group)
3490        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3491            plumbing_response.rate_limit)
3492        return resp
3493
3494    def list(self, filter, *args, timeout=None):
3495        '''
3496         List gets a list of Peering Groups.
3497        '''
3498        req = PeeringGroupListRequest()
3499        req.meta.CopyFrom(ListRequestMetadata())
3500        if self.parent.page_limit > 0:
3501            req.meta.limit = self.parent.page_limit
3502        if self.parent.snapshot_datetime is not None:
3503            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3504
3505        req.filter = plumbing.quote_filter_args(filter, *args)
3506
3507        def generator(svc, req):
3508            tries = 0
3509            while True:
3510                try:
3511                    plumbing_response = svc.stub.List(
3512                        req,
3513                        metadata=svc.parent.get_metadata(
3514                            'PeeringGroups.List', req),
3515                        timeout=timeout)
3516                except Exception as e:
3517                    if self.parent.shouldRetry(tries, e):
3518                        tries += 1
3519                        self.parent.jitterSleep(tries)
3520                        continue
3521                    raise plumbing.convert_error_to_porcelain(e) from e
3522                tries = 0
3523                for plumbing_item in plumbing_response.peering_groups:
3524                    yield plumbing.convert_peering_group_to_porcelain(
3525                        plumbing_item)
3526                if plumbing_response.meta.next_cursor == '':
3527                    break
3528                req.meta.cursor = plumbing_response.meta.next_cursor
3529
3530        return generator(self, req)

PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing. See strongdm.models.PeeringGroup.

PeeringGroups(channel, client)
3388    def __init__(self, channel, client):
3389        self.parent = client
3390        self.stub = PeeringGroupsStub(channel)
def create(self, peering_group, timeout=None)
3392    def create(self, peering_group, timeout=None):
3393        '''
3394         Create registers a new PeeringGroup.
3395        '''
3396        req = PeeringGroupCreateRequest()
3397
3398        if peering_group is not None:
3399            req.peering_group.CopyFrom(
3400                plumbing.convert_peering_group_to_plumbing(peering_group))
3401        tries = 0
3402        plumbing_response = None
3403        while True:
3404            try:
3405                plumbing_response = self.stub.Create(
3406                    req,
3407                    metadata=self.parent.get_metadata('PeeringGroups.Create',
3408                                                      req),
3409                    timeout=timeout)
3410            except Exception as e:
3411                if self.parent.shouldRetry(tries, e):
3412                    tries += 1
3413                    self.parent.jitterSleep(tries)
3414                    continue
3415                raise plumbing.convert_error_to_porcelain(e) from e
3416            break
3417
3418        resp = models.PeeringGroupCreateResponse()
3419        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3420            plumbing_response.meta)
3421        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3422            plumbing_response.peering_group)
3423        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3424            plumbing_response.rate_limit)
3425        return resp

Create registers a new PeeringGroup.

def delete(self, id, timeout=None)
3427    def delete(self, id, timeout=None):
3428        '''
3429         Delete removes a PeeringGroup by ID.
3430        '''
3431        req = PeeringGroupDeleteRequest()
3432
3433        req.id = (id)
3434        tries = 0
3435        plumbing_response = None
3436        while True:
3437            try:
3438                plumbing_response = self.stub.Delete(
3439                    req,
3440                    metadata=self.parent.get_metadata('PeeringGroups.Delete',
3441                                                      req),
3442                    timeout=timeout)
3443            except Exception as e:
3444                if self.parent.shouldRetry(tries, e):
3445                    tries += 1
3446                    self.parent.jitterSleep(tries)
3447                    continue
3448                raise plumbing.convert_error_to_porcelain(e) from e
3449            break
3450
3451        resp = models.PeeringGroupDeleteResponse()
3452        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3453            plumbing_response.meta)
3454        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3455            plumbing_response.rate_limit)
3456        return resp

Delete removes a PeeringGroup by ID.

def get(self, id, timeout=None)
3458    def get(self, id, timeout=None):
3459        '''
3460         Get reads one PeeringGroup by ID. It will load all its dependencies.
3461        '''
3462        req = PeeringGroupGetRequest()
3463        if self.parent.snapshot_datetime is not None:
3464            req.meta.CopyFrom(GetRequestMetadata())
3465            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3466
3467        req.id = (id)
3468        tries = 0
3469        plumbing_response = None
3470        while True:
3471            try:
3472                plumbing_response = self.stub.Get(
3473                    req,
3474                    metadata=self.parent.get_metadata('PeeringGroups.Get',
3475                                                      req),
3476                    timeout=timeout)
3477            except Exception as e:
3478                if self.parent.shouldRetry(tries, e):
3479                    tries += 1
3480                    self.parent.jitterSleep(tries)
3481                    continue
3482                raise plumbing.convert_error_to_porcelain(e) from e
3483            break
3484
3485        resp = models.PeeringGroupGetResponse()
3486        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3487            plumbing_response.meta)
3488        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3489            plumbing_response.peering_group)
3490        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3491            plumbing_response.rate_limit)
3492        return resp

Get reads one PeeringGroup by ID. It will load all its dependencies.

def list(self, filter, *args, timeout=None)
3494    def list(self, filter, *args, timeout=None):
3495        '''
3496         List gets a list of Peering Groups.
3497        '''
3498        req = PeeringGroupListRequest()
3499        req.meta.CopyFrom(ListRequestMetadata())
3500        if self.parent.page_limit > 0:
3501            req.meta.limit = self.parent.page_limit
3502        if self.parent.snapshot_datetime is not None:
3503            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3504
3505        req.filter = plumbing.quote_filter_args(filter, *args)
3506
3507        def generator(svc, req):
3508            tries = 0
3509            while True:
3510                try:
3511                    plumbing_response = svc.stub.List(
3512                        req,
3513                        metadata=svc.parent.get_metadata(
3514                            'PeeringGroups.List', req),
3515                        timeout=timeout)
3516                except Exception as e:
3517                    if self.parent.shouldRetry(tries, e):
3518                        tries += 1
3519                        self.parent.jitterSleep(tries)
3520                        continue
3521                    raise plumbing.convert_error_to_porcelain(e) from e
3522                tries = 0
3523                for plumbing_item in plumbing_response.peering_groups:
3524                    yield plumbing.convert_peering_group_to_porcelain(
3525                        plumbing_item)
3526                if plumbing_response.meta.next_cursor == '':
3527                    break
3528                req.meta.cursor = plumbing_response.meta.next_cursor
3529
3530        return generator(self, req)

List gets a list of Peering Groups.

class Policies:
3533class Policies:
3534    '''
3535     Policies are the collection of one or more statements that enforce fine-grained access
3536     control for the users of an organization.
3537    See `strongdm.models.Policy`.
3538    '''
3539    def __init__(self, channel, client):
3540        self.parent = client
3541        self.stub = PoliciesStub(channel)
3542
3543    def create(self, policy, timeout=None):
3544        '''
3545         Create creates a new Policy.
3546        '''
3547        req = PolicyCreateRequest()
3548
3549        if policy is not None:
3550            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3551        tries = 0
3552        plumbing_response = None
3553        while True:
3554            try:
3555                plumbing_response = self.stub.Create(
3556                    req,
3557                    metadata=self.parent.get_metadata('Policies.Create', req),
3558                    timeout=timeout)
3559            except Exception as e:
3560                if self.parent.shouldRetry(tries, e):
3561                    tries += 1
3562                    self.parent.jitterSleep(tries)
3563                    continue
3564                raise plumbing.convert_error_to_porcelain(e) from e
3565            break
3566
3567        resp = models.PolicyCreateResponse()
3568        resp.policy = plumbing.convert_policy_to_porcelain(
3569            plumbing_response.policy)
3570        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3571            plumbing_response.rate_limit)
3572        return resp
3573
3574    def delete(self, id, timeout=None):
3575        '''
3576         Delete removes a Policy by ID.
3577        '''
3578        req = PolicyDeleteRequest()
3579
3580        req.id = (id)
3581        tries = 0
3582        plumbing_response = None
3583        while True:
3584            try:
3585                plumbing_response = self.stub.Delete(
3586                    req,
3587                    metadata=self.parent.get_metadata('Policies.Delete', req),
3588                    timeout=timeout)
3589            except Exception as e:
3590                if self.parent.shouldRetry(tries, e):
3591                    tries += 1
3592                    self.parent.jitterSleep(tries)
3593                    continue
3594                raise plumbing.convert_error_to_porcelain(e) from e
3595            break
3596
3597        resp = models.PolicyDeleteResponse()
3598        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3599            plumbing_response.rate_limit)
3600        return resp
3601
3602    def update(self, policy, timeout=None):
3603        '''
3604         Update replaces all the fields of a Policy by ID.
3605        '''
3606        req = PolicyUpdateRequest()
3607
3608        if policy is not None:
3609            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3610        tries = 0
3611        plumbing_response = None
3612        while True:
3613            try:
3614                plumbing_response = self.stub.Update(
3615                    req,
3616                    metadata=self.parent.get_metadata('Policies.Update', req),
3617                    timeout=timeout)
3618            except Exception as e:
3619                if self.parent.shouldRetry(tries, e):
3620                    tries += 1
3621                    self.parent.jitterSleep(tries)
3622                    continue
3623                raise plumbing.convert_error_to_porcelain(e) from e
3624            break
3625
3626        resp = models.PolicyUpdateResponse()
3627        resp.policy = plumbing.convert_policy_to_porcelain(
3628            plumbing_response.policy)
3629        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3630            plumbing_response.rate_limit)
3631        return resp
3632
3633    def get(self, id, timeout=None):
3634        '''
3635         Get reads one Policy by ID.
3636        '''
3637        req = PolicyGetRequest()
3638        if self.parent.snapshot_datetime is not None:
3639            req.meta.CopyFrom(GetRequestMetadata())
3640            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3641
3642        req.id = (id)
3643        tries = 0
3644        plumbing_response = None
3645        while True:
3646            try:
3647                plumbing_response = self.stub.Get(
3648                    req,
3649                    metadata=self.parent.get_metadata('Policies.Get', req),
3650                    timeout=timeout)
3651            except Exception as e:
3652                if self.parent.shouldRetry(tries, e):
3653                    tries += 1
3654                    self.parent.jitterSleep(tries)
3655                    continue
3656                raise plumbing.convert_error_to_porcelain(e) from e
3657            break
3658
3659        resp = models.PolicyGetResponse()
3660        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3661            plumbing_response.meta)
3662        resp.policy = plumbing.convert_policy_to_porcelain(
3663            plumbing_response.policy)
3664        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3665            plumbing_response.rate_limit)
3666        return resp
3667
3668    def list(self, filter, *args, timeout=None):
3669        '''
3670         List gets a list of Policy matching a given set of criteria
3671        '''
3672        req = PolicyListRequest()
3673        req.meta.CopyFrom(ListRequestMetadata())
3674        if self.parent.page_limit > 0:
3675            req.meta.limit = self.parent.page_limit
3676        if self.parent.snapshot_datetime is not None:
3677            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3678
3679        req.filter = plumbing.quote_filter_args(filter, *args)
3680
3681        def generator(svc, req):
3682            tries = 0
3683            while True:
3684                try:
3685                    plumbing_response = svc.stub.List(
3686                        req,
3687                        metadata=svc.parent.get_metadata('Policies.List', req),
3688                        timeout=timeout)
3689                except Exception as e:
3690                    if self.parent.shouldRetry(tries, e):
3691                        tries += 1
3692                        self.parent.jitterSleep(tries)
3693                        continue
3694                    raise plumbing.convert_error_to_porcelain(e) from e
3695                tries = 0
3696                for plumbing_item in plumbing_response.policies:
3697                    yield plumbing.convert_policy_to_porcelain(plumbing_item)
3698                if plumbing_response.meta.next_cursor == '':
3699                    break
3700                req.meta.cursor = plumbing_response.meta.next_cursor
3701
3702        return generator(self, req)

Policies are the collection of one or more statements that enforce fine-grained access control for the users of an organization. See strongdm.models.Policy.

Policies(channel, client)
3539    def __init__(self, channel, client):
3540        self.parent = client
3541        self.stub = PoliciesStub(channel)
def create(self, policy, timeout=None)
3543    def create(self, policy, timeout=None):
3544        '''
3545         Create creates a new Policy.
3546        '''
3547        req = PolicyCreateRequest()
3548
3549        if policy is not None:
3550            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3551        tries = 0
3552        plumbing_response = None
3553        while True:
3554            try:
3555                plumbing_response = self.stub.Create(
3556                    req,
3557                    metadata=self.parent.get_metadata('Policies.Create', req),
3558                    timeout=timeout)
3559            except Exception as e:
3560                if self.parent.shouldRetry(tries, e):
3561                    tries += 1
3562                    self.parent.jitterSleep(tries)
3563                    continue
3564                raise plumbing.convert_error_to_porcelain(e) from e
3565            break
3566
3567        resp = models.PolicyCreateResponse()
3568        resp.policy = plumbing.convert_policy_to_porcelain(
3569            plumbing_response.policy)
3570        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3571            plumbing_response.rate_limit)
3572        return resp

Create creates a new Policy.

def delete(self, id, timeout=None)
3574    def delete(self, id, timeout=None):
3575        '''
3576         Delete removes a Policy by ID.
3577        '''
3578        req = PolicyDeleteRequest()
3579
3580        req.id = (id)
3581        tries = 0
3582        plumbing_response = None
3583        while True:
3584            try:
3585                plumbing_response = self.stub.Delete(
3586                    req,
3587                    metadata=self.parent.get_metadata('Policies.Delete', req),
3588                    timeout=timeout)
3589            except Exception as e:
3590                if self.parent.shouldRetry(tries, e):
3591                    tries += 1
3592                    self.parent.jitterSleep(tries)
3593                    continue
3594                raise plumbing.convert_error_to_porcelain(e) from e
3595            break
3596
3597        resp = models.PolicyDeleteResponse()
3598        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3599            plumbing_response.rate_limit)
3600        return resp

Delete removes a Policy by ID.

def update(self, policy, timeout=None)
3602    def update(self, policy, timeout=None):
3603        '''
3604         Update replaces all the fields of a Policy by ID.
3605        '''
3606        req = PolicyUpdateRequest()
3607
3608        if policy is not None:
3609            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3610        tries = 0
3611        plumbing_response = None
3612        while True:
3613            try:
3614                plumbing_response = self.stub.Update(
3615                    req,
3616                    metadata=self.parent.get_metadata('Policies.Update', req),
3617                    timeout=timeout)
3618            except Exception as e:
3619                if self.parent.shouldRetry(tries, e):
3620                    tries += 1
3621                    self.parent.jitterSleep(tries)
3622                    continue
3623                raise plumbing.convert_error_to_porcelain(e) from e
3624            break
3625
3626        resp = models.PolicyUpdateResponse()
3627        resp.policy = plumbing.convert_policy_to_porcelain(
3628            plumbing_response.policy)
3629        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3630            plumbing_response.rate_limit)
3631        return resp

Update replaces all the fields of a Policy by ID.

def get(self, id, timeout=None)
3633    def get(self, id, timeout=None):
3634        '''
3635         Get reads one Policy by ID.
3636        '''
3637        req = PolicyGetRequest()
3638        if self.parent.snapshot_datetime is not None:
3639            req.meta.CopyFrom(GetRequestMetadata())
3640            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3641
3642        req.id = (id)
3643        tries = 0
3644        plumbing_response = None
3645        while True:
3646            try:
3647                plumbing_response = self.stub.Get(
3648                    req,
3649                    metadata=self.parent.get_metadata('Policies.Get', req),
3650                    timeout=timeout)
3651            except Exception as e:
3652                if self.parent.shouldRetry(tries, e):
3653                    tries += 1
3654                    self.parent.jitterSleep(tries)
3655                    continue
3656                raise plumbing.convert_error_to_porcelain(e) from e
3657            break
3658
3659        resp = models.PolicyGetResponse()
3660        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3661            plumbing_response.meta)
3662        resp.policy = plumbing.convert_policy_to_porcelain(
3663            plumbing_response.policy)
3664        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3665            plumbing_response.rate_limit)
3666        return resp

Get reads one Policy by ID.

def list(self, filter, *args, timeout=None)
3668    def list(self, filter, *args, timeout=None):
3669        '''
3670         List gets a list of Policy matching a given set of criteria
3671        '''
3672        req = PolicyListRequest()
3673        req.meta.CopyFrom(ListRequestMetadata())
3674        if self.parent.page_limit > 0:
3675            req.meta.limit = self.parent.page_limit
3676        if self.parent.snapshot_datetime is not None:
3677            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3678
3679        req.filter = plumbing.quote_filter_args(filter, *args)
3680
3681        def generator(svc, req):
3682            tries = 0
3683            while True:
3684                try:
3685                    plumbing_response = svc.stub.List(
3686                        req,
3687                        metadata=svc.parent.get_metadata('Policies.List', req),
3688                        timeout=timeout)
3689                except Exception as e:
3690                    if self.parent.shouldRetry(tries, e):
3691                        tries += 1
3692                        self.parent.jitterSleep(tries)
3693                        continue
3694                    raise plumbing.convert_error_to_porcelain(e) from e
3695                tries = 0
3696                for plumbing_item in plumbing_response.policies:
3697                    yield plumbing.convert_policy_to_porcelain(plumbing_item)
3698                if plumbing_response.meta.next_cursor == '':
3699                    break
3700                req.meta.cursor = plumbing_response.meta.next_cursor
3701
3702        return generator(self, req)

List gets a list of Policy matching a given set of criteria

class SnapshotPolicies:
3705class SnapshotPolicies:
3706    '''
3707    SnapshotPolicies exposes the read only methods of the Policies
3708    service for historical queries.
3709    '''
3710    def __init__(self, policies):
3711        self.policies = policies
3712
3713    def get(self, id, timeout=None):
3714        '''
3715         Get reads one Policy by ID.
3716        '''
3717        return self.policies.get(id, timeout=timeout)
3718
3719    def list(self, filter, *args, timeout=None):
3720        '''
3721         List gets a list of Policy matching a given set of criteria
3722        '''
3723        return self.policies.list(filter, *args, timeout=timeout)

SnapshotPolicies exposes the read only methods of the Policies service for historical queries.

SnapshotPolicies(policies)
3710    def __init__(self, policies):
3711        self.policies = policies
def get(self, id, timeout=None)
3713    def get(self, id, timeout=None):
3714        '''
3715         Get reads one Policy by ID.
3716        '''
3717        return self.policies.get(id, timeout=timeout)

Get reads one Policy by ID.

def list(self, filter, *args, timeout=None)
3719    def list(self, filter, *args, timeout=None):
3720        '''
3721         List gets a list of Policy matching a given set of criteria
3722        '''
3723        return self.policies.list(filter, *args, timeout=timeout)

List gets a list of Policy matching a given set of criteria

class PoliciesHistory:
3726class PoliciesHistory:
3727    '''
3728     PoliciesHistory records all changes to the state of a Policy.
3729    See `strongdm.models.PolicyHistory`.
3730    '''
3731    def __init__(self, channel, client):
3732        self.parent = client
3733        self.stub = PoliciesHistoryStub(channel)
3734
3735    def list(self, filter, *args, timeout=None):
3736        '''
3737         List gets a list of PolicyHistory records matching a given set of criteria.
3738        '''
3739        req = PoliciesHistoryListRequest()
3740        req.meta.CopyFrom(ListRequestMetadata())
3741        if self.parent.page_limit > 0:
3742            req.meta.limit = self.parent.page_limit
3743        if self.parent.snapshot_datetime is not None:
3744            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3745
3746        req.filter = plumbing.quote_filter_args(filter, *args)
3747
3748        def generator(svc, req):
3749            tries = 0
3750            while True:
3751                try:
3752                    plumbing_response = svc.stub.List(
3753                        req,
3754                        metadata=svc.parent.get_metadata(
3755                            'PoliciesHistory.List', req),
3756                        timeout=timeout)
3757                except Exception as e:
3758                    if self.parent.shouldRetry(tries, e):
3759                        tries += 1
3760                        self.parent.jitterSleep(tries)
3761                        continue
3762                    raise plumbing.convert_error_to_porcelain(e) from e
3763                tries = 0
3764                for plumbing_item in plumbing_response.history:
3765                    yield plumbing.convert_policy_history_to_porcelain(
3766                        plumbing_item)
3767                if plumbing_response.meta.next_cursor == '':
3768                    break
3769                req.meta.cursor = plumbing_response.meta.next_cursor
3770
3771        return generator(self, req)

PoliciesHistory records all changes to the state of a Policy. See strongdm.models.PolicyHistory.

PoliciesHistory(channel, client)
3731    def __init__(self, channel, client):
3732        self.parent = client
3733        self.stub = PoliciesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
3735    def list(self, filter, *args, timeout=None):
3736        '''
3737         List gets a list of PolicyHistory records matching a given set of criteria.
3738        '''
3739        req = PoliciesHistoryListRequest()
3740        req.meta.CopyFrom(ListRequestMetadata())
3741        if self.parent.page_limit > 0:
3742            req.meta.limit = self.parent.page_limit
3743        if self.parent.snapshot_datetime is not None:
3744            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3745
3746        req.filter = plumbing.quote_filter_args(filter, *args)
3747
3748        def generator(svc, req):
3749            tries = 0
3750            while True:
3751                try:
3752                    plumbing_response = svc.stub.List(
3753                        req,
3754                        metadata=svc.parent.get_metadata(
3755                            'PoliciesHistory.List', req),
3756                        timeout=timeout)
3757                except Exception as e:
3758                    if self.parent.shouldRetry(tries, e):
3759                        tries += 1
3760                        self.parent.jitterSleep(tries)
3761                        continue
3762                    raise plumbing.convert_error_to_porcelain(e) from e
3763                tries = 0
3764                for plumbing_item in plumbing_response.history:
3765                    yield plumbing.convert_policy_history_to_porcelain(
3766                        plumbing_item)
3767                if plumbing_response.meta.next_cursor == '':
3768                    break
3769                req.meta.cursor = plumbing_response.meta.next_cursor
3770
3771        return generator(self, req)

List gets a list of PolicyHistory records matching a given set of criteria.

class ProxyClusterKeys:
3774class ProxyClusterKeys:
3775    '''
3776     Proxy Cluster Keys are authentication keys for all proxies within a cluster.
3777     The proxies within a cluster share the same key. One cluster can have
3778     multiple keys in order to facilitate key rotation.
3779    See `strongdm.models.ProxyClusterKey`.
3780    '''
3781    def __init__(self, channel, client):
3782        self.parent = client
3783        self.stub = ProxyClusterKeysStub(channel)
3784
3785    def create(self, proxy_cluster_key, timeout=None):
3786        '''
3787         Create registers a new ProxyClusterKey.
3788        '''
3789        req = ProxyClusterKeyCreateRequest()
3790
3791        if proxy_cluster_key is not None:
3792            req.proxy_cluster_key.CopyFrom(
3793                plumbing.convert_proxy_cluster_key_to_plumbing(
3794                    proxy_cluster_key))
3795        tries = 0
3796        plumbing_response = None
3797        while True:
3798            try:
3799                plumbing_response = self.stub.Create(
3800                    req,
3801                    metadata=self.parent.get_metadata(
3802                        'ProxyClusterKeys.Create', req),
3803                    timeout=timeout)
3804            except Exception as e:
3805                if self.parent.shouldRetry(tries, e):
3806                    tries += 1
3807                    self.parent.jitterSleep(tries)
3808                    continue
3809                raise plumbing.convert_error_to_porcelain(e) from e
3810            break
3811
3812        resp = models.ProxyClusterKeyCreateResponse()
3813        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3814            plumbing_response.meta)
3815        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
3816            plumbing_response.proxy_cluster_key)
3817        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3818            plumbing_response.rate_limit)
3819        resp.secret_key = (plumbing_response.secret_key)
3820        return resp
3821
3822    def get(self, id, timeout=None):
3823        '''
3824         Get reads one ProxyClusterKey by ID.
3825        '''
3826        req = ProxyClusterKeyGetRequest()
3827        if self.parent.snapshot_datetime is not None:
3828            req.meta.CopyFrom(GetRequestMetadata())
3829            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3830
3831        req.id = (id)
3832        tries = 0
3833        plumbing_response = None
3834        while True:
3835            try:
3836                plumbing_response = self.stub.Get(
3837                    req,
3838                    metadata=self.parent.get_metadata('ProxyClusterKeys.Get',
3839                                                      req),
3840                    timeout=timeout)
3841            except Exception as e:
3842                if self.parent.shouldRetry(tries, e):
3843                    tries += 1
3844                    self.parent.jitterSleep(tries)
3845                    continue
3846                raise plumbing.convert_error_to_porcelain(e) from e
3847            break
3848
3849        resp = models.ProxyClusterKeyGetResponse()
3850        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3851            plumbing_response.meta)
3852        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
3853            plumbing_response.proxy_cluster_key)
3854        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3855            plumbing_response.rate_limit)
3856        return resp
3857
3858    def delete(self, id, timeout=None):
3859        '''
3860         Delete removes a ProxyClusterKey by ID.
3861        '''
3862        req = ProxyClusterKeyDeleteRequest()
3863
3864        req.id = (id)
3865        tries = 0
3866        plumbing_response = None
3867        while True:
3868            try:
3869                plumbing_response = self.stub.Delete(
3870                    req,
3871                    metadata=self.parent.get_metadata(
3872                        'ProxyClusterKeys.Delete', req),
3873                    timeout=timeout)
3874            except Exception as e:
3875                if self.parent.shouldRetry(tries, e):
3876                    tries += 1
3877                    self.parent.jitterSleep(tries)
3878                    continue
3879                raise plumbing.convert_error_to_porcelain(e) from e
3880            break
3881
3882        resp = models.ProxyClusterKeyDeleteResponse()
3883        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3884            plumbing_response.meta)
3885        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3886            plumbing_response.rate_limit)
3887        return resp
3888
3889    def list(self, filter, *args, timeout=None):
3890        '''
3891         List gets a list of ProxyClusterKeys matching a given set of criteria.
3892        '''
3893        req = ProxyClusterKeyListRequest()
3894        req.meta.CopyFrom(ListRequestMetadata())
3895        if self.parent.page_limit > 0:
3896            req.meta.limit = self.parent.page_limit
3897        if self.parent.snapshot_datetime is not None:
3898            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3899
3900        req.filter = plumbing.quote_filter_args(filter, *args)
3901
3902        def generator(svc, req):
3903            tries = 0
3904            while True:
3905                try:
3906                    plumbing_response = svc.stub.List(
3907                        req,
3908                        metadata=svc.parent.get_metadata(
3909                            'ProxyClusterKeys.List', req),
3910                        timeout=timeout)
3911                except Exception as e:
3912                    if self.parent.shouldRetry(tries, e):
3913                        tries += 1
3914                        self.parent.jitterSleep(tries)
3915                        continue
3916                    raise plumbing.convert_error_to_porcelain(e) from e
3917                tries = 0
3918                for plumbing_item in plumbing_response.proxy_cluster_keys:
3919                    yield plumbing.convert_proxy_cluster_key_to_porcelain(
3920                        plumbing_item)
3921                if plumbing_response.meta.next_cursor == '':
3922                    break
3923                req.meta.cursor = plumbing_response.meta.next_cursor
3924
3925        return generator(self, req)

Proxy Cluster Keys are authentication keys for all proxies within a cluster. The proxies within a cluster share the same key. One cluster can have multiple keys in order to facilitate key rotation. See strongdm.models.ProxyClusterKey.

ProxyClusterKeys(channel, client)
3781    def __init__(self, channel, client):
3782        self.parent = client
3783        self.stub = ProxyClusterKeysStub(channel)
def create(self, proxy_cluster_key, timeout=None)
3785    def create(self, proxy_cluster_key, timeout=None):
3786        '''
3787         Create registers a new ProxyClusterKey.
3788        '''
3789        req = ProxyClusterKeyCreateRequest()
3790
3791        if proxy_cluster_key is not None:
3792            req.proxy_cluster_key.CopyFrom(
3793                plumbing.convert_proxy_cluster_key_to_plumbing(
3794                    proxy_cluster_key))
3795        tries = 0
3796        plumbing_response = None
3797        while True:
3798            try:
3799                plumbing_response = self.stub.Create(
3800                    req,
3801                    metadata=self.parent.get_metadata(
3802                        'ProxyClusterKeys.Create', req),
3803                    timeout=timeout)
3804            except Exception as e:
3805                if self.parent.shouldRetry(tries, e):
3806                    tries += 1
3807                    self.parent.jitterSleep(tries)
3808                    continue
3809                raise plumbing.convert_error_to_porcelain(e) from e
3810            break
3811
3812        resp = models.ProxyClusterKeyCreateResponse()
3813        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3814            plumbing_response.meta)
3815        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
3816            plumbing_response.proxy_cluster_key)
3817        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3818            plumbing_response.rate_limit)
3819        resp.secret_key = (plumbing_response.secret_key)
3820        return resp

Create registers a new ProxyClusterKey.

def get(self, id, timeout=None)
3822    def get(self, id, timeout=None):
3823        '''
3824         Get reads one ProxyClusterKey by ID.
3825        '''
3826        req = ProxyClusterKeyGetRequest()
3827        if self.parent.snapshot_datetime is not None:
3828            req.meta.CopyFrom(GetRequestMetadata())
3829            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3830
3831        req.id = (id)
3832        tries = 0
3833        plumbing_response = None
3834        while True:
3835            try:
3836                plumbing_response = self.stub.Get(
3837                    req,
3838                    metadata=self.parent.get_metadata('ProxyClusterKeys.Get',
3839                                                      req),
3840                    timeout=timeout)
3841            except Exception as e:
3842                if self.parent.shouldRetry(tries, e):
3843                    tries += 1
3844                    self.parent.jitterSleep(tries)
3845                    continue
3846                raise plumbing.convert_error_to_porcelain(e) from e
3847            break
3848
3849        resp = models.ProxyClusterKeyGetResponse()
3850        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3851            plumbing_response.meta)
3852        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
3853            plumbing_response.proxy_cluster_key)
3854        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3855            plumbing_response.rate_limit)
3856        return resp

Get reads one ProxyClusterKey by ID.

def delete(self, id, timeout=None)
3858    def delete(self, id, timeout=None):
3859        '''
3860         Delete removes a ProxyClusterKey by ID.
3861        '''
3862        req = ProxyClusterKeyDeleteRequest()
3863
3864        req.id = (id)
3865        tries = 0
3866        plumbing_response = None
3867        while True:
3868            try:
3869                plumbing_response = self.stub.Delete(
3870                    req,
3871                    metadata=self.parent.get_metadata(
3872                        'ProxyClusterKeys.Delete', req),
3873                    timeout=timeout)
3874            except Exception as e:
3875                if self.parent.shouldRetry(tries, e):
3876                    tries += 1
3877                    self.parent.jitterSleep(tries)
3878                    continue
3879                raise plumbing.convert_error_to_porcelain(e) from e
3880            break
3881
3882        resp = models.ProxyClusterKeyDeleteResponse()
3883        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3884            plumbing_response.meta)
3885        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3886            plumbing_response.rate_limit)
3887        return resp

Delete removes a ProxyClusterKey by ID.

def list(self, filter, *args, timeout=None)
3889    def list(self, filter, *args, timeout=None):
3890        '''
3891         List gets a list of ProxyClusterKeys matching a given set of criteria.
3892        '''
3893        req = ProxyClusterKeyListRequest()
3894        req.meta.CopyFrom(ListRequestMetadata())
3895        if self.parent.page_limit > 0:
3896            req.meta.limit = self.parent.page_limit
3897        if self.parent.snapshot_datetime is not None:
3898            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3899
3900        req.filter = plumbing.quote_filter_args(filter, *args)
3901
3902        def generator(svc, req):
3903            tries = 0
3904            while True:
3905                try:
3906                    plumbing_response = svc.stub.List(
3907                        req,
3908                        metadata=svc.parent.get_metadata(
3909                            'ProxyClusterKeys.List', req),
3910                        timeout=timeout)
3911                except Exception as e:
3912                    if self.parent.shouldRetry(tries, e):
3913                        tries += 1
3914                        self.parent.jitterSleep(tries)
3915                        continue
3916                    raise plumbing.convert_error_to_porcelain(e) from e
3917                tries = 0
3918                for plumbing_item in plumbing_response.proxy_cluster_keys:
3919                    yield plumbing.convert_proxy_cluster_key_to_porcelain(
3920                        plumbing_item)
3921                if plumbing_response.meta.next_cursor == '':
3922                    break
3923                req.meta.cursor = plumbing_response.meta.next_cursor
3924
3925        return generator(self, req)

List gets a list of ProxyClusterKeys matching a given set of criteria.

class SnapshotProxyClusterKeys:
3928class SnapshotProxyClusterKeys:
3929    '''
3930    SnapshotProxyClusterKeys exposes the read only methods of the ProxyClusterKeys
3931    service for historical queries.
3932    '''
3933    def __init__(self, proxy_cluster_keys):
3934        self.proxy_cluster_keys = proxy_cluster_keys
3935
3936    def get(self, id, timeout=None):
3937        '''
3938         Get reads one ProxyClusterKey by ID.
3939        '''
3940        return self.proxy_cluster_keys.get(id, timeout=timeout)
3941
3942    def list(self, filter, *args, timeout=None):
3943        '''
3944         List gets a list of ProxyClusterKeys matching a given set of criteria.
3945        '''
3946        return self.proxy_cluster_keys.list(filter, *args, timeout=timeout)

SnapshotProxyClusterKeys exposes the read only methods of the ProxyClusterKeys service for historical queries.

SnapshotProxyClusterKeys(proxy_cluster_keys)
3933    def __init__(self, proxy_cluster_keys):
3934        self.proxy_cluster_keys = proxy_cluster_keys
def get(self, id, timeout=None)
3936    def get(self, id, timeout=None):
3937        '''
3938         Get reads one ProxyClusterKey by ID.
3939        '''
3940        return self.proxy_cluster_keys.get(id, timeout=timeout)

Get reads one ProxyClusterKey by ID.

def list(self, filter, *args, timeout=None)
3942    def list(self, filter, *args, timeout=None):
3943        '''
3944         List gets a list of ProxyClusterKeys matching a given set of criteria.
3945        '''
3946        return self.proxy_cluster_keys.list(filter, *args, timeout=timeout)

List gets a list of ProxyClusterKeys matching a given set of criteria.

class Queries:
3949class Queries:
3950    '''
3951     A Query is a record of a single client request to a resource, such as a SQL query.
3952     Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries.
3953     The Queries service is read-only.
3954    See `strongdm.models.Query`.
3955    '''
3956    def __init__(self, channel, client):
3957        self.parent = client
3958        self.stub = QueriesStub(channel)
3959
3960    def list(self, filter, *args, timeout=None):
3961        '''
3962         List gets a list of Queries matching a given set of criteria.
3963        '''
3964        req = QueryListRequest()
3965        req.meta.CopyFrom(ListRequestMetadata())
3966        if self.parent.page_limit > 0:
3967            req.meta.limit = self.parent.page_limit
3968        if self.parent.snapshot_datetime is not None:
3969            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3970
3971        req.filter = plumbing.quote_filter_args(filter, *args)
3972
3973        def generator(svc, req):
3974            tries = 0
3975            while True:
3976                try:
3977                    plumbing_response = svc.stub.List(
3978                        req,
3979                        metadata=svc.parent.get_metadata('Queries.List', req),
3980                        timeout=timeout)
3981                except Exception as e:
3982                    if self.parent.shouldRetry(tries, e):
3983                        tries += 1
3984                        self.parent.jitterSleep(tries)
3985                        continue
3986                    raise plumbing.convert_error_to_porcelain(e) from e
3987                tries = 0
3988                for plumbing_item in plumbing_response.queries:
3989                    yield plumbing.convert_query_to_porcelain(plumbing_item)
3990                if plumbing_response.meta.next_cursor == '':
3991                    break
3992                req.meta.cursor = plumbing_response.meta.next_cursor
3993
3994        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.

Queries(channel, client)
3956    def __init__(self, channel, client):
3957        self.parent = client
3958        self.stub = QueriesStub(channel)
def list(self, filter, *args, timeout=None)
3960    def list(self, filter, *args, timeout=None):
3961        '''
3962         List gets a list of Queries matching a given set of criteria.
3963        '''
3964        req = QueryListRequest()
3965        req.meta.CopyFrom(ListRequestMetadata())
3966        if self.parent.page_limit > 0:
3967            req.meta.limit = self.parent.page_limit
3968        if self.parent.snapshot_datetime is not None:
3969            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3970
3971        req.filter = plumbing.quote_filter_args(filter, *args)
3972
3973        def generator(svc, req):
3974            tries = 0
3975            while True:
3976                try:
3977                    plumbing_response = svc.stub.List(
3978                        req,
3979                        metadata=svc.parent.get_metadata('Queries.List', req),
3980                        timeout=timeout)
3981                except Exception as e:
3982                    if self.parent.shouldRetry(tries, e):
3983                        tries += 1
3984                        self.parent.jitterSleep(tries)
3985                        continue
3986                    raise plumbing.convert_error_to_porcelain(e) from e
3987                tries = 0
3988                for plumbing_item in plumbing_response.queries:
3989                    yield plumbing.convert_query_to_porcelain(plumbing_item)
3990                if plumbing_response.meta.next_cursor == '':
3991                    break
3992                req.meta.cursor = plumbing_response.meta.next_cursor
3993
3994        return generator(self, req)

List gets a list of Queries matching a given set of criteria.

class RemoteIdentities:
3997class RemoteIdentities:
3998    '''
3999     RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource.
4000    See `strongdm.models.RemoteIdentity`.
4001    '''
4002    def __init__(self, channel, client):
4003        self.parent = client
4004        self.stub = RemoteIdentitiesStub(channel)
4005
4006    def create(self, remote_identity, timeout=None):
4007        '''
4008         Create registers a new RemoteIdentity.
4009        '''
4010        req = RemoteIdentityCreateRequest()
4011
4012        if remote_identity is not None:
4013            req.remote_identity.CopyFrom(
4014                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4015        tries = 0
4016        plumbing_response = None
4017        while True:
4018            try:
4019                plumbing_response = self.stub.Create(
4020                    req,
4021                    metadata=self.parent.get_metadata(
4022                        'RemoteIdentities.Create', req),
4023                    timeout=timeout)
4024            except Exception as e:
4025                if self.parent.shouldRetry(tries, e):
4026                    tries += 1
4027                    self.parent.jitterSleep(tries)
4028                    continue
4029                raise plumbing.convert_error_to_porcelain(e) from e
4030            break
4031
4032        resp = models.RemoteIdentityCreateResponse()
4033        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4034            plumbing_response.meta)
4035        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4036            plumbing_response.rate_limit)
4037        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4038            plumbing_response.remote_identity)
4039        return resp
4040
4041    def get(self, id, timeout=None):
4042        '''
4043         Get reads one RemoteIdentity by ID.
4044        '''
4045        req = RemoteIdentityGetRequest()
4046        if self.parent.snapshot_datetime is not None:
4047            req.meta.CopyFrom(GetRequestMetadata())
4048            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4049
4050        req.id = (id)
4051        tries = 0
4052        plumbing_response = None
4053        while True:
4054            try:
4055                plumbing_response = self.stub.Get(
4056                    req,
4057                    metadata=self.parent.get_metadata('RemoteIdentities.Get',
4058                                                      req),
4059                    timeout=timeout)
4060            except Exception as e:
4061                if self.parent.shouldRetry(tries, e):
4062                    tries += 1
4063                    self.parent.jitterSleep(tries)
4064                    continue
4065                raise plumbing.convert_error_to_porcelain(e) from e
4066            break
4067
4068        resp = models.RemoteIdentityGetResponse()
4069        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4070            plumbing_response.meta)
4071        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4072            plumbing_response.rate_limit)
4073        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4074            plumbing_response.remote_identity)
4075        return resp
4076
4077    def update(self, remote_identity, timeout=None):
4078        '''
4079         Update replaces all the fields of a RemoteIdentity by ID.
4080        '''
4081        req = RemoteIdentityUpdateRequest()
4082
4083        if remote_identity is not None:
4084            req.remote_identity.CopyFrom(
4085                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4086        tries = 0
4087        plumbing_response = None
4088        while True:
4089            try:
4090                plumbing_response = self.stub.Update(
4091                    req,
4092                    metadata=self.parent.get_metadata(
4093                        'RemoteIdentities.Update', req),
4094                    timeout=timeout)
4095            except Exception as e:
4096                if self.parent.shouldRetry(tries, e):
4097                    tries += 1
4098                    self.parent.jitterSleep(tries)
4099                    continue
4100                raise plumbing.convert_error_to_porcelain(e) from e
4101            break
4102
4103        resp = models.RemoteIdentityUpdateResponse()
4104        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4105            plumbing_response.meta)
4106        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4107            plumbing_response.rate_limit)
4108        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4109            plumbing_response.remote_identity)
4110        return resp
4111
4112    def delete(self, id, timeout=None):
4113        '''
4114         Delete removes a RemoteIdentity by ID.
4115        '''
4116        req = RemoteIdentityDeleteRequest()
4117
4118        req.id = (id)
4119        tries = 0
4120        plumbing_response = None
4121        while True:
4122            try:
4123                plumbing_response = self.stub.Delete(
4124                    req,
4125                    metadata=self.parent.get_metadata(
4126                        'RemoteIdentities.Delete', req),
4127                    timeout=timeout)
4128            except Exception as e:
4129                if self.parent.shouldRetry(tries, e):
4130                    tries += 1
4131                    self.parent.jitterSleep(tries)
4132                    continue
4133                raise plumbing.convert_error_to_porcelain(e) from e
4134            break
4135
4136        resp = models.RemoteIdentityDeleteResponse()
4137        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4138            plumbing_response.meta)
4139        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4140            plumbing_response.rate_limit)
4141        return resp
4142
4143    def list(self, filter, *args, timeout=None):
4144        '''
4145         List gets a list of RemoteIdentities matching a given set of criteria.
4146        '''
4147        req = RemoteIdentityListRequest()
4148        req.meta.CopyFrom(ListRequestMetadata())
4149        if self.parent.page_limit > 0:
4150            req.meta.limit = self.parent.page_limit
4151        if self.parent.snapshot_datetime is not None:
4152            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4153
4154        req.filter = plumbing.quote_filter_args(filter, *args)
4155
4156        def generator(svc, req):
4157            tries = 0
4158            while True:
4159                try:
4160                    plumbing_response = svc.stub.List(
4161                        req,
4162                        metadata=svc.parent.get_metadata(
4163                            'RemoteIdentities.List', req),
4164                        timeout=timeout)
4165                except Exception as e:
4166                    if self.parent.shouldRetry(tries, e):
4167                        tries += 1
4168                        self.parent.jitterSleep(tries)
4169                        continue
4170                    raise plumbing.convert_error_to_porcelain(e) from e
4171                tries = 0
4172                for plumbing_item in plumbing_response.remote_identities:
4173                    yield plumbing.convert_remote_identity_to_porcelain(
4174                        plumbing_item)
4175                if plumbing_response.meta.next_cursor == '':
4176                    break
4177                req.meta.cursor = plumbing_response.meta.next_cursor
4178
4179        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.

RemoteIdentities(channel, client)
4002    def __init__(self, channel, client):
4003        self.parent = client
4004        self.stub = RemoteIdentitiesStub(channel)
def create(self, remote_identity, timeout=None)
4006    def create(self, remote_identity, timeout=None):
4007        '''
4008         Create registers a new RemoteIdentity.
4009        '''
4010        req = RemoteIdentityCreateRequest()
4011
4012        if remote_identity is not None:
4013            req.remote_identity.CopyFrom(
4014                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4015        tries = 0
4016        plumbing_response = None
4017        while True:
4018            try:
4019                plumbing_response = self.stub.Create(
4020                    req,
4021                    metadata=self.parent.get_metadata(
4022                        'RemoteIdentities.Create', req),
4023                    timeout=timeout)
4024            except Exception as e:
4025                if self.parent.shouldRetry(tries, e):
4026                    tries += 1
4027                    self.parent.jitterSleep(tries)
4028                    continue
4029                raise plumbing.convert_error_to_porcelain(e) from e
4030            break
4031
4032        resp = models.RemoteIdentityCreateResponse()
4033        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4034            plumbing_response.meta)
4035        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4036            plumbing_response.rate_limit)
4037        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4038            plumbing_response.remote_identity)
4039        return resp

Create registers a new RemoteIdentity.

def get(self, id, timeout=None)
4041    def get(self, id, timeout=None):
4042        '''
4043         Get reads one RemoteIdentity by ID.
4044        '''
4045        req = RemoteIdentityGetRequest()
4046        if self.parent.snapshot_datetime is not None:
4047            req.meta.CopyFrom(GetRequestMetadata())
4048            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4049
4050        req.id = (id)
4051        tries = 0
4052        plumbing_response = None
4053        while True:
4054            try:
4055                plumbing_response = self.stub.Get(
4056                    req,
4057                    metadata=self.parent.get_metadata('RemoteIdentities.Get',
4058                                                      req),
4059                    timeout=timeout)
4060            except Exception as e:
4061                if self.parent.shouldRetry(tries, e):
4062                    tries += 1
4063                    self.parent.jitterSleep(tries)
4064                    continue
4065                raise plumbing.convert_error_to_porcelain(e) from e
4066            break
4067
4068        resp = models.RemoteIdentityGetResponse()
4069        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4070            plumbing_response.meta)
4071        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4072            plumbing_response.rate_limit)
4073        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4074            plumbing_response.remote_identity)
4075        return resp

Get reads one RemoteIdentity by ID.

def update(self, remote_identity, timeout=None)
4077    def update(self, remote_identity, timeout=None):
4078        '''
4079         Update replaces all the fields of a RemoteIdentity by ID.
4080        '''
4081        req = RemoteIdentityUpdateRequest()
4082
4083        if remote_identity is not None:
4084            req.remote_identity.CopyFrom(
4085                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4086        tries = 0
4087        plumbing_response = None
4088        while True:
4089            try:
4090                plumbing_response = self.stub.Update(
4091                    req,
4092                    metadata=self.parent.get_metadata(
4093                        'RemoteIdentities.Update', req),
4094                    timeout=timeout)
4095            except Exception as e:
4096                if self.parent.shouldRetry(tries, e):
4097                    tries += 1
4098                    self.parent.jitterSleep(tries)
4099                    continue
4100                raise plumbing.convert_error_to_porcelain(e) from e
4101            break
4102
4103        resp = models.RemoteIdentityUpdateResponse()
4104        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4105            plumbing_response.meta)
4106        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4107            plumbing_response.rate_limit)
4108        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4109            plumbing_response.remote_identity)
4110        return resp

Update replaces all the fields of a RemoteIdentity by ID.

def delete(self, id, timeout=None)
4112    def delete(self, id, timeout=None):
4113        '''
4114         Delete removes a RemoteIdentity by ID.
4115        '''
4116        req = RemoteIdentityDeleteRequest()
4117
4118        req.id = (id)
4119        tries = 0
4120        plumbing_response = None
4121        while True:
4122            try:
4123                plumbing_response = self.stub.Delete(
4124                    req,
4125                    metadata=self.parent.get_metadata(
4126                        'RemoteIdentities.Delete', req),
4127                    timeout=timeout)
4128            except Exception as e:
4129                if self.parent.shouldRetry(tries, e):
4130                    tries += 1
4131                    self.parent.jitterSleep(tries)
4132                    continue
4133                raise plumbing.convert_error_to_porcelain(e) from e
4134            break
4135
4136        resp = models.RemoteIdentityDeleteResponse()
4137        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4138            plumbing_response.meta)
4139        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4140            plumbing_response.rate_limit)
4141        return resp

Delete removes a RemoteIdentity by ID.

def list(self, filter, *args, timeout=None)
4143    def list(self, filter, *args, timeout=None):
4144        '''
4145         List gets a list of RemoteIdentities matching a given set of criteria.
4146        '''
4147        req = RemoteIdentityListRequest()
4148        req.meta.CopyFrom(ListRequestMetadata())
4149        if self.parent.page_limit > 0:
4150            req.meta.limit = self.parent.page_limit
4151        if self.parent.snapshot_datetime is not None:
4152            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4153
4154        req.filter = plumbing.quote_filter_args(filter, *args)
4155
4156        def generator(svc, req):
4157            tries = 0
4158            while True:
4159                try:
4160                    plumbing_response = svc.stub.List(
4161                        req,
4162                        metadata=svc.parent.get_metadata(
4163                            'RemoteIdentities.List', req),
4164                        timeout=timeout)
4165                except Exception as e:
4166                    if self.parent.shouldRetry(tries, e):
4167                        tries += 1
4168                        self.parent.jitterSleep(tries)
4169                        continue
4170                    raise plumbing.convert_error_to_porcelain(e) from e
4171                tries = 0
4172                for plumbing_item in plumbing_response.remote_identities:
4173                    yield plumbing.convert_remote_identity_to_porcelain(
4174                        plumbing_item)
4175                if plumbing_response.meta.next_cursor == '':
4176                    break
4177                req.meta.cursor = plumbing_response.meta.next_cursor
4178
4179        return generator(self, req)

List gets a list of RemoteIdentities matching a given set of criteria.

class SnapshotRemoteIdentities:
4182class SnapshotRemoteIdentities:
4183    '''
4184    SnapshotRemoteIdentities exposes the read only methods of the RemoteIdentities
4185    service for historical queries.
4186    '''
4187    def __init__(self, remote_identities):
4188        self.remote_identities = remote_identities
4189
4190    def get(self, id, timeout=None):
4191        '''
4192         Get reads one RemoteIdentity by ID.
4193        '''
4194        return self.remote_identities.get(id, timeout=timeout)
4195
4196    def list(self, filter, *args, timeout=None):
4197        '''
4198         List gets a list of RemoteIdentities matching a given set of criteria.
4199        '''
4200        return self.remote_identities.list(filter, *args, timeout=timeout)

SnapshotRemoteIdentities exposes the read only methods of the RemoteIdentities service for historical queries.

SnapshotRemoteIdentities(remote_identities)
4187    def __init__(self, remote_identities):
4188        self.remote_identities = remote_identities
def get(self, id, timeout=None)
4190    def get(self, id, timeout=None):
4191        '''
4192         Get reads one RemoteIdentity by ID.
4193        '''
4194        return self.remote_identities.get(id, timeout=timeout)

Get reads one RemoteIdentity by ID.

def list(self, filter, *args, timeout=None)
4196    def list(self, filter, *args, timeout=None):
4197        '''
4198         List gets a list of RemoteIdentities matching a given set of criteria.
4199        '''
4200        return self.remote_identities.list(filter, *args, timeout=timeout)

List gets a list of RemoteIdentities matching a given set of criteria.

class RemoteIdentitiesHistory:
4203class RemoteIdentitiesHistory:
4204    '''
4205     RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity.
4206    See `strongdm.models.RemoteIdentityHistory`.
4207    '''
4208    def __init__(self, channel, client):
4209        self.parent = client
4210        self.stub = RemoteIdentitiesHistoryStub(channel)
4211
4212    def list(self, filter, *args, timeout=None):
4213        '''
4214         List gets a list of RemoteIdentityHistory records matching a given set of criteria.
4215        '''
4216        req = RemoteIdentityHistoryListRequest()
4217        req.meta.CopyFrom(ListRequestMetadata())
4218        if self.parent.page_limit > 0:
4219            req.meta.limit = self.parent.page_limit
4220        if self.parent.snapshot_datetime is not None:
4221            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4222
4223        req.filter = plumbing.quote_filter_args(filter, *args)
4224
4225        def generator(svc, req):
4226            tries = 0
4227            while True:
4228                try:
4229                    plumbing_response = svc.stub.List(
4230                        req,
4231                        metadata=svc.parent.get_metadata(
4232                            'RemoteIdentitiesHistory.List', req),
4233                        timeout=timeout)
4234                except Exception as e:
4235                    if self.parent.shouldRetry(tries, e):
4236                        tries += 1
4237                        self.parent.jitterSleep(tries)
4238                        continue
4239                    raise plumbing.convert_error_to_porcelain(e) from e
4240                tries = 0
4241                for plumbing_item in plumbing_response.history:
4242                    yield plumbing.convert_remote_identity_history_to_porcelain(
4243                        plumbing_item)
4244                if plumbing_response.meta.next_cursor == '':
4245                    break
4246                req.meta.cursor = plumbing_response.meta.next_cursor
4247
4248        return generator(self, req)

RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity. See strongdm.models.RemoteIdentityHistory.

RemoteIdentitiesHistory(channel, client)
4208    def __init__(self, channel, client):
4209        self.parent = client
4210        self.stub = RemoteIdentitiesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
4212    def list(self, filter, *args, timeout=None):
4213        '''
4214         List gets a list of RemoteIdentityHistory records matching a given set of criteria.
4215        '''
4216        req = RemoteIdentityHistoryListRequest()
4217        req.meta.CopyFrom(ListRequestMetadata())
4218        if self.parent.page_limit > 0:
4219            req.meta.limit = self.parent.page_limit
4220        if self.parent.snapshot_datetime is not None:
4221            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4222
4223        req.filter = plumbing.quote_filter_args(filter, *args)
4224
4225        def generator(svc, req):
4226            tries = 0
4227            while True:
4228                try:
4229                    plumbing_response = svc.stub.List(
4230                        req,
4231                        metadata=svc.parent.get_metadata(
4232                            'RemoteIdentitiesHistory.List', req),
4233                        timeout=timeout)
4234                except Exception as e:
4235                    if self.parent.shouldRetry(tries, e):
4236                        tries += 1
4237                        self.parent.jitterSleep(tries)
4238                        continue
4239                    raise plumbing.convert_error_to_porcelain(e) from e
4240                tries = 0
4241                for plumbing_item in plumbing_response.history:
4242                    yield plumbing.convert_remote_identity_history_to_porcelain(
4243                        plumbing_item)
4244                if plumbing_response.meta.next_cursor == '':
4245                    break
4246                req.meta.cursor = plumbing_response.meta.next_cursor
4247
4248        return generator(self, req)

List gets a list of RemoteIdentityHistory records matching a given set of criteria.

class RemoteIdentityGroups:
4251class RemoteIdentityGroups:
4252    '''
4253     A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts.
4254     An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects.
4255    See `strongdm.models.RemoteIdentityGroup`.
4256    '''
4257    def __init__(self, channel, client):
4258        self.parent = client
4259        self.stub = RemoteIdentityGroupsStub(channel)
4260
4261    def get(self, id, timeout=None):
4262        '''
4263         Get reads one RemoteIdentityGroup by ID.
4264        '''
4265        req = RemoteIdentityGroupGetRequest()
4266        if self.parent.snapshot_datetime is not None:
4267            req.meta.CopyFrom(GetRequestMetadata())
4268            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4269
4270        req.id = (id)
4271        tries = 0
4272        plumbing_response = None
4273        while True:
4274            try:
4275                plumbing_response = self.stub.Get(
4276                    req,
4277                    metadata=self.parent.get_metadata(
4278                        'RemoteIdentityGroups.Get', req),
4279                    timeout=timeout)
4280            except Exception as e:
4281                if self.parent.shouldRetry(tries, e):
4282                    tries += 1
4283                    self.parent.jitterSleep(tries)
4284                    continue
4285                raise plumbing.convert_error_to_porcelain(e) from e
4286            break
4287
4288        resp = models.RemoteIdentityGroupGetResponse()
4289        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4290            plumbing_response.meta)
4291        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4292            plumbing_response.rate_limit)
4293        resp.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain(
4294            plumbing_response.remote_identity_group)
4295        return resp
4296
4297    def list(self, filter, *args, timeout=None):
4298        '''
4299         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4300        '''
4301        req = RemoteIdentityGroupListRequest()
4302        req.meta.CopyFrom(ListRequestMetadata())
4303        if self.parent.page_limit > 0:
4304            req.meta.limit = self.parent.page_limit
4305        if self.parent.snapshot_datetime is not None:
4306            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4307
4308        req.filter = plumbing.quote_filter_args(filter, *args)
4309
4310        def generator(svc, req):
4311            tries = 0
4312            while True:
4313                try:
4314                    plumbing_response = svc.stub.List(
4315                        req,
4316                        metadata=svc.parent.get_metadata(
4317                            'RemoteIdentityGroups.List', req),
4318                        timeout=timeout)
4319                except Exception as e:
4320                    if self.parent.shouldRetry(tries, e):
4321                        tries += 1
4322                        self.parent.jitterSleep(tries)
4323                        continue
4324                    raise plumbing.convert_error_to_porcelain(e) from e
4325                tries = 0
4326                for plumbing_item in plumbing_response.remote_identity_groups:
4327                    yield plumbing.convert_remote_identity_group_to_porcelain(
4328                        plumbing_item)
4329                if plumbing_response.meta.next_cursor == '':
4330                    break
4331                req.meta.cursor = plumbing_response.meta.next_cursor
4332
4333        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.

RemoteIdentityGroups(channel, client)
4257    def __init__(self, channel, client):
4258        self.parent = client
4259        self.stub = RemoteIdentityGroupsStub(channel)
def get(self, id, timeout=None)
4261    def get(self, id, timeout=None):
4262        '''
4263         Get reads one RemoteIdentityGroup by ID.
4264        '''
4265        req = RemoteIdentityGroupGetRequest()
4266        if self.parent.snapshot_datetime is not None:
4267            req.meta.CopyFrom(GetRequestMetadata())
4268            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4269
4270        req.id = (id)
4271        tries = 0
4272        plumbing_response = None
4273        while True:
4274            try:
4275                plumbing_response = self.stub.Get(
4276                    req,
4277                    metadata=self.parent.get_metadata(
4278                        'RemoteIdentityGroups.Get', req),
4279                    timeout=timeout)
4280            except Exception as e:
4281                if self.parent.shouldRetry(tries, e):
4282                    tries += 1
4283                    self.parent.jitterSleep(tries)
4284                    continue
4285                raise plumbing.convert_error_to_porcelain(e) from e
4286            break
4287
4288        resp = models.RemoteIdentityGroupGetResponse()
4289        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4290            plumbing_response.meta)
4291        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4292            plumbing_response.rate_limit)
4293        resp.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain(
4294            plumbing_response.remote_identity_group)
4295        return resp

Get reads one RemoteIdentityGroup by ID.

def list(self, filter, *args, timeout=None)
4297    def list(self, filter, *args, timeout=None):
4298        '''
4299         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4300        '''
4301        req = RemoteIdentityGroupListRequest()
4302        req.meta.CopyFrom(ListRequestMetadata())
4303        if self.parent.page_limit > 0:
4304            req.meta.limit = self.parent.page_limit
4305        if self.parent.snapshot_datetime is not None:
4306            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4307
4308        req.filter = plumbing.quote_filter_args(filter, *args)
4309
4310        def generator(svc, req):
4311            tries = 0
4312            while True:
4313                try:
4314                    plumbing_response = svc.stub.List(
4315                        req,
4316                        metadata=svc.parent.get_metadata(
4317                            'RemoteIdentityGroups.List', req),
4318                        timeout=timeout)
4319                except Exception as e:
4320                    if self.parent.shouldRetry(tries, e):
4321                        tries += 1
4322                        self.parent.jitterSleep(tries)
4323                        continue
4324                    raise plumbing.convert_error_to_porcelain(e) from e
4325                tries = 0
4326                for plumbing_item in plumbing_response.remote_identity_groups:
4327                    yield plumbing.convert_remote_identity_group_to_porcelain(
4328                        plumbing_item)
4329                if plumbing_response.meta.next_cursor == '':
4330                    break
4331                req.meta.cursor = plumbing_response.meta.next_cursor
4332
4333        return generator(self, req)

List gets a list of RemoteIdentityGroups matching a given set of criteria.

class SnapshotRemoteIdentityGroups:
4336class SnapshotRemoteIdentityGroups:
4337    '''
4338    SnapshotRemoteIdentityGroups exposes the read only methods of the RemoteIdentityGroups
4339    service for historical queries.
4340    '''
4341    def __init__(self, remote_identity_groups):
4342        self.remote_identity_groups = remote_identity_groups
4343
4344    def get(self, id, timeout=None):
4345        '''
4346         Get reads one RemoteIdentityGroup by ID.
4347        '''
4348        return self.remote_identity_groups.get(id, timeout=timeout)
4349
4350    def list(self, filter, *args, timeout=None):
4351        '''
4352         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4353        '''
4354        return self.remote_identity_groups.list(filter, *args, timeout=timeout)

SnapshotRemoteIdentityGroups exposes the read only methods of the RemoteIdentityGroups service for historical queries.

SnapshotRemoteIdentityGroups(remote_identity_groups)
4341    def __init__(self, remote_identity_groups):
4342        self.remote_identity_groups = remote_identity_groups
def get(self, id, timeout=None)
4344    def get(self, id, timeout=None):
4345        '''
4346         Get reads one RemoteIdentityGroup by ID.
4347        '''
4348        return self.remote_identity_groups.get(id, timeout=timeout)

Get reads one RemoteIdentityGroup by ID.

def list(self, filter, *args, timeout=None)
4350    def list(self, filter, *args, timeout=None):
4351        '''
4352         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4353        '''
4354        return self.remote_identity_groups.list(filter, *args, timeout=timeout)

List gets a list of RemoteIdentityGroups matching a given set of criteria.

class RemoteIdentityGroupsHistory:
4357class RemoteIdentityGroupsHistory:
4358    '''
4359     RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup.
4360    See `strongdm.models.RemoteIdentityGroupHistory`.
4361    '''
4362    def __init__(self, channel, client):
4363        self.parent = client
4364        self.stub = RemoteIdentityGroupsHistoryStub(channel)
4365
4366    def list(self, filter, *args, timeout=None):
4367        '''
4368         List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria.
4369        '''
4370        req = RemoteIdentityGroupHistoryListRequest()
4371        req.meta.CopyFrom(ListRequestMetadata())
4372        if self.parent.page_limit > 0:
4373            req.meta.limit = self.parent.page_limit
4374        if self.parent.snapshot_datetime is not None:
4375            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4376
4377        req.filter = plumbing.quote_filter_args(filter, *args)
4378
4379        def generator(svc, req):
4380            tries = 0
4381            while True:
4382                try:
4383                    plumbing_response = svc.stub.List(
4384                        req,
4385                        metadata=svc.parent.get_metadata(
4386                            'RemoteIdentityGroupsHistory.List', req),
4387                        timeout=timeout)
4388                except Exception as e:
4389                    if self.parent.shouldRetry(tries, e):
4390                        tries += 1
4391                        self.parent.jitterSleep(tries)
4392                        continue
4393                    raise plumbing.convert_error_to_porcelain(e) from e
4394                tries = 0
4395                for plumbing_item in plumbing_response.history:
4396                    yield plumbing.convert_remote_identity_group_history_to_porcelain(
4397                        plumbing_item)
4398                if plumbing_response.meta.next_cursor == '':
4399                    break
4400                req.meta.cursor = plumbing_response.meta.next_cursor
4401
4402        return generator(self, req)

RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup. See strongdm.models.RemoteIdentityGroupHistory.

RemoteIdentityGroupsHistory(channel, client)
4362    def __init__(self, channel, client):
4363        self.parent = client
4364        self.stub = RemoteIdentityGroupsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
4366    def list(self, filter, *args, timeout=None):
4367        '''
4368         List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria.
4369        '''
4370        req = RemoteIdentityGroupHistoryListRequest()
4371        req.meta.CopyFrom(ListRequestMetadata())
4372        if self.parent.page_limit > 0:
4373            req.meta.limit = self.parent.page_limit
4374        if self.parent.snapshot_datetime is not None:
4375            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4376
4377        req.filter = plumbing.quote_filter_args(filter, *args)
4378
4379        def generator(svc, req):
4380            tries = 0
4381            while True:
4382                try:
4383                    plumbing_response = svc.stub.List(
4384                        req,
4385                        metadata=svc.parent.get_metadata(
4386                            'RemoteIdentityGroupsHistory.List', req),
4387                        timeout=timeout)
4388                except Exception as e:
4389                    if self.parent.shouldRetry(tries, e):
4390                        tries += 1
4391                        self.parent.jitterSleep(tries)
4392                        continue
4393                    raise plumbing.convert_error_to_porcelain(e) from e
4394                tries = 0
4395                for plumbing_item in plumbing_response.history:
4396                    yield plumbing.convert_remote_identity_group_history_to_porcelain(
4397                        plumbing_item)
4398                if plumbing_response.meta.next_cursor == '':
4399                    break
4400                req.meta.cursor = plumbing_response.meta.next_cursor
4401
4402        return generator(self, req)

List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria.

class Replays:
4405class Replays:
4406    '''
4407     A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session
4408     (otherwise referred to as a query). The Replays service is read-only.
4409    See `strongdm.models.ReplayChunk`.
4410    '''
4411    def __init__(self, channel, client):
4412        self.parent = client
4413        self.stub = ReplaysStub(channel)
4414
4415    def list(self, filter, *args, timeout=None):
4416        '''
4417         List gets a list of ReplayChunks for the Query ID specified by the filter criteria.
4418        '''
4419        req = ReplayListRequest()
4420        req.meta.CopyFrom(ListRequestMetadata())
4421        if self.parent.page_limit > 0:
4422            req.meta.limit = self.parent.page_limit
4423        if self.parent.snapshot_datetime is not None:
4424            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4425
4426        req.filter = plumbing.quote_filter_args(filter, *args)
4427
4428        def generator(svc, req):
4429            tries = 0
4430            while True:
4431                try:
4432                    plumbing_response = svc.stub.List(
4433                        req,
4434                        metadata=svc.parent.get_metadata('Replays.List', req),
4435                        timeout=timeout)
4436                except Exception as e:
4437                    if self.parent.shouldRetry(tries, e):
4438                        tries += 1
4439                        self.parent.jitterSleep(tries)
4440                        continue
4441                    raise plumbing.convert_error_to_porcelain(e) from e
4442                tries = 0
4443                for plumbing_item in plumbing_response.chunks:
4444                    yield plumbing.convert_replay_chunk_to_porcelain(
4445                        plumbing_item)
4446                if plumbing_response.meta.next_cursor == '':
4447                    break
4448                req.meta.cursor = plumbing_response.meta.next_cursor
4449
4450        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.

Replays(channel, client)
4411    def __init__(self, channel, client):
4412        self.parent = client
4413        self.stub = ReplaysStub(channel)
def list(self, filter, *args, timeout=None)
4415    def list(self, filter, *args, timeout=None):
4416        '''
4417         List gets a list of ReplayChunks for the Query ID specified by the filter criteria.
4418        '''
4419        req = ReplayListRequest()
4420        req.meta.CopyFrom(ListRequestMetadata())
4421        if self.parent.page_limit > 0:
4422            req.meta.limit = self.parent.page_limit
4423        if self.parent.snapshot_datetime is not None:
4424            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4425
4426        req.filter = plumbing.quote_filter_args(filter, *args)
4427
4428        def generator(svc, req):
4429            tries = 0
4430            while True:
4431                try:
4432                    plumbing_response = svc.stub.List(
4433                        req,
4434                        metadata=svc.parent.get_metadata('Replays.List', req),
4435                        timeout=timeout)
4436                except Exception as e:
4437                    if self.parent.shouldRetry(tries, e):
4438                        tries += 1
4439                        self.parent.jitterSleep(tries)
4440                        continue
4441                    raise plumbing.convert_error_to_porcelain(e) from e
4442                tries = 0
4443                for plumbing_item in plumbing_response.chunks:
4444                    yield plumbing.convert_replay_chunk_to_porcelain(
4445                        plumbing_item)
4446                if plumbing_response.meta.next_cursor == '':
4447                    break
4448                req.meta.cursor = plumbing_response.meta.next_cursor
4449
4450        return generator(self, req)

List gets a list of ReplayChunks for the Query ID specified by the filter criteria.

class Resources:
4453class Resources:
4454    '''
4455     Resources are databases, servers, clusters, websites, or clouds that strongDM
4456     delegates access to.
4457    See:
4458    `strongdm.models.AKS`
4459    `strongdm.models.AKSBasicAuth`
4460    `strongdm.models.AKSServiceAccount`
4461    `strongdm.models.AKSServiceAccountUserImpersonation`
4462    `strongdm.models.AKSUserImpersonation`
4463    `strongdm.models.AmazonEKS`
4464    `strongdm.models.AmazonEKSInstanceProfile`
4465    `strongdm.models.AmazonEKSInstanceProfileUserImpersonation`
4466    `strongdm.models.AmazonEKSUserImpersonation`
4467    `strongdm.models.AmazonES`
4468    `strongdm.models.AmazonMQAMQP091`
4469    `strongdm.models.Athena`
4470    `strongdm.models.AuroraMysql`
4471    `strongdm.models.AuroraPostgres`
4472    `strongdm.models.AuroraPostgresIAM`
4473    `strongdm.models.AWS`
4474    `strongdm.models.AWSConsole`
4475    `strongdm.models.AWSConsoleStaticKeyPair`
4476    `strongdm.models.AWSInstanceProfile`
4477    `strongdm.models.Azure`
4478    `strongdm.models.AzureCertificate`
4479    `strongdm.models.AzureMysql`
4480    `strongdm.models.AzurePostgres`
4481    `strongdm.models.AzurePostgresManagedIdentity`
4482    `strongdm.models.BigQuery`
4483    `strongdm.models.Cassandra`
4484    `strongdm.models.Citus`
4485    `strongdm.models.Clustrix`
4486    `strongdm.models.Cockroach`
4487    `strongdm.models.CouchbaseDatabase`
4488    `strongdm.models.CouchbaseWebUI`
4489    `strongdm.models.DB2I`
4490    `strongdm.models.DB2LUW`
4491    `strongdm.models.DocumentDBHost`
4492    `strongdm.models.DocumentDBReplicaSet`
4493    `strongdm.models.Druid`
4494    `strongdm.models.DynamoDB`
4495    `strongdm.models.Elastic`
4496    `strongdm.models.ElasticacheRedis`
4497    `strongdm.models.GCP`
4498    `strongdm.models.GCPConsole`
4499    `strongdm.models.GCPWIF`
4500    `strongdm.models.GoogleGKE`
4501    `strongdm.models.GoogleGKEUserImpersonation`
4502    `strongdm.models.Greenplum`
4503    `strongdm.models.HTTPAuth`
4504    `strongdm.models.HTTPBasicAuth`
4505    `strongdm.models.HTTPNoAuth`
4506    `strongdm.models.Kubernetes`
4507    `strongdm.models.KubernetesBasicAuth`
4508    `strongdm.models.KubernetesServiceAccount`
4509    `strongdm.models.KubernetesServiceAccountUserImpersonation`
4510    `strongdm.models.KubernetesUserImpersonation`
4511    `strongdm.models.Maria`
4512    `strongdm.models.Memcached`
4513    `strongdm.models.Memsql`
4514    `strongdm.models.MongoHost`
4515    `strongdm.models.MongoLegacyHost`
4516    `strongdm.models.MongoLegacyReplicaset`
4517    `strongdm.models.MongoReplicaSet`
4518    `strongdm.models.MongoShardedCluster`
4519    `strongdm.models.MTLSMysql`
4520    `strongdm.models.MTLSPostgres`
4521    `strongdm.models.Mysql`
4522    `strongdm.models.Neptune`
4523    `strongdm.models.NeptuneIAM`
4524    `strongdm.models.Oracle`
4525    `strongdm.models.Postgres`
4526    `strongdm.models.Presto`
4527    `strongdm.models.RabbitMQAMQP091`
4528    `strongdm.models.RawTCP`
4529    `strongdm.models.RDP`
4530    `strongdm.models.RDPCert`
4531    `strongdm.models.RDSPostgresIAM`
4532    `strongdm.models.Redis`
4533    `strongdm.models.Redshift`
4534    `strongdm.models.SingleStore`
4535    `strongdm.models.Snowflake`
4536    `strongdm.models.Snowsight`
4537    `strongdm.models.SQLServer`
4538    `strongdm.models.SQLServerAzureAD`
4539    `strongdm.models.SQLServerKerberosAD`
4540    `strongdm.models.SSH`
4541    `strongdm.models.SSHCert`
4542    `strongdm.models.SSHCustomerKey`
4543    `strongdm.models.SSHPassword`
4544    `strongdm.models.Sybase`
4545    `strongdm.models.SybaseIQ`
4546    `strongdm.models.Teradata`
4547    `strongdm.models.Trino`
4548    '''
4549    def __init__(self, channel, client):
4550        self.parent = client
4551        self.stub = ResourcesStub(channel)
4552
4553    def enumerate_tags(self, filter, *args, timeout=None):
4554        '''
4555         EnumerateTags gets a list of the filter matching tags.
4556        '''
4557        req = EnumerateTagsRequest()
4558        req.meta.CopyFrom(ListRequestMetadata())
4559        if self.parent.page_limit > 0:
4560            req.meta.limit = self.parent.page_limit
4561        if self.parent.snapshot_datetime is not None:
4562            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4563
4564        req.filter = plumbing.quote_filter_args(filter, *args)
4565
4566        def generator(svc, req):
4567            tries = 0
4568            while True:
4569                try:
4570                    plumbing_response = svc.stub.EnumerateTags(
4571                        req,
4572                        metadata=svc.parent.get_metadata(
4573                            'Resources.EnumerateTags', req),
4574                        timeout=timeout)
4575                except Exception as e:
4576                    if self.parent.shouldRetry(tries, e):
4577                        tries += 1
4578                        self.parent.jitterSleep(tries)
4579                        continue
4580                    raise plumbing.convert_error_to_porcelain(e) from e
4581                tries = 0
4582                for plumbing_item in plumbing_response.matches:
4583                    yield plumbing.convert_tag_to_porcelain(plumbing_item)
4584                if plumbing_response.meta.next_cursor == '':
4585                    break
4586                req.meta.cursor = plumbing_response.meta.next_cursor
4587
4588        return generator(self, req)
4589
4590    def create(self, resource, timeout=None):
4591        '''
4592         Create registers a new Resource.
4593        '''
4594        req = ResourceCreateRequest()
4595
4596        if resource is not None:
4597            req.resource.CopyFrom(
4598                plumbing.convert_resource_to_plumbing(resource))
4599        tries = 0
4600        plumbing_response = None
4601        while True:
4602            try:
4603                plumbing_response = self.stub.Create(
4604                    req,
4605                    metadata=self.parent.get_metadata('Resources.Create', req),
4606                    timeout=timeout)
4607            except Exception as e:
4608                if self.parent.shouldRetry(tries, e):
4609                    tries += 1
4610                    self.parent.jitterSleep(tries)
4611                    continue
4612                raise plumbing.convert_error_to_porcelain(e) from e
4613            break
4614
4615        resp = models.ResourceCreateResponse()
4616        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4617            plumbing_response.meta)
4618        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4619            plumbing_response.rate_limit)
4620        resp.resource = plumbing.convert_resource_to_porcelain(
4621            plumbing_response.resource)
4622        return resp
4623
4624    def get(self, id, timeout=None):
4625        '''
4626         Get reads one Resource by ID.
4627        '''
4628        req = ResourceGetRequest()
4629        if self.parent.snapshot_datetime is not None:
4630            req.meta.CopyFrom(GetRequestMetadata())
4631            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4632
4633        req.id = (id)
4634        tries = 0
4635        plumbing_response = None
4636        while True:
4637            try:
4638                plumbing_response = self.stub.Get(
4639                    req,
4640                    metadata=self.parent.get_metadata('Resources.Get', req),
4641                    timeout=timeout)
4642            except Exception as e:
4643                if self.parent.shouldRetry(tries, e):
4644                    tries += 1
4645                    self.parent.jitterSleep(tries)
4646                    continue
4647                raise plumbing.convert_error_to_porcelain(e) from e
4648            break
4649
4650        resp = models.ResourceGetResponse()
4651        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4652            plumbing_response.meta)
4653        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4654            plumbing_response.rate_limit)
4655        resp.resource = plumbing.convert_resource_to_porcelain(
4656            plumbing_response.resource)
4657        return resp
4658
4659    def update(self, resource, timeout=None):
4660        '''
4661         Update replaces all the fields of a Resource by ID.
4662        '''
4663        req = ResourceUpdateRequest()
4664
4665        if resource is not None:
4666            req.resource.CopyFrom(
4667                plumbing.convert_resource_to_plumbing(resource))
4668        tries = 0
4669        plumbing_response = None
4670        while True:
4671            try:
4672                plumbing_response = self.stub.Update(
4673                    req,
4674                    metadata=self.parent.get_metadata('Resources.Update', req),
4675                    timeout=timeout)
4676            except Exception as e:
4677                if self.parent.shouldRetry(tries, e):
4678                    tries += 1
4679                    self.parent.jitterSleep(tries)
4680                    continue
4681                raise plumbing.convert_error_to_porcelain(e) from e
4682            break
4683
4684        resp = models.ResourceUpdateResponse()
4685        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4686            plumbing_response.meta)
4687        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4688            plumbing_response.rate_limit)
4689        resp.resource = plumbing.convert_resource_to_porcelain(
4690            plumbing_response.resource)
4691        return resp
4692
4693    def delete(self, id, timeout=None):
4694        '''
4695         Delete removes a Resource by ID.
4696        '''
4697        req = ResourceDeleteRequest()
4698
4699        req.id = (id)
4700        tries = 0
4701        plumbing_response = None
4702        while True:
4703            try:
4704                plumbing_response = self.stub.Delete(
4705                    req,
4706                    metadata=self.parent.get_metadata('Resources.Delete', req),
4707                    timeout=timeout)
4708            except Exception as e:
4709                if self.parent.shouldRetry(tries, e):
4710                    tries += 1
4711                    self.parent.jitterSleep(tries)
4712                    continue
4713                raise plumbing.convert_error_to_porcelain(e) from e
4714            break
4715
4716        resp = models.ResourceDeleteResponse()
4717        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4718            plumbing_response.meta)
4719        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4720            plumbing_response.rate_limit)
4721        return resp
4722
4723    def list(self, filter, *args, timeout=None):
4724        '''
4725         List gets a list of Resources matching a given set of criteria.
4726        '''
4727        req = ResourceListRequest()
4728        req.meta.CopyFrom(ListRequestMetadata())
4729        if self.parent.page_limit > 0:
4730            req.meta.limit = self.parent.page_limit
4731        if self.parent.snapshot_datetime is not None:
4732            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4733
4734        req.filter = plumbing.quote_filter_args(filter, *args)
4735
4736        def generator(svc, req):
4737            tries = 0
4738            while True:
4739                try:
4740                    plumbing_response = svc.stub.List(
4741                        req,
4742                        metadata=svc.parent.get_metadata(
4743                            'Resources.List', req),
4744                        timeout=timeout)
4745                except Exception as e:
4746                    if self.parent.shouldRetry(tries, e):
4747                        tries += 1
4748                        self.parent.jitterSleep(tries)
4749                        continue
4750                    raise plumbing.convert_error_to_porcelain(e) from e
4751                tries = 0
4752                for plumbing_item in plumbing_response.resources:
4753                    yield plumbing.convert_resource_to_porcelain(plumbing_item)
4754                if plumbing_response.meta.next_cursor == '':
4755                    break
4756                req.meta.cursor = plumbing_response.meta.next_cursor
4757
4758        return generator(self, req)
4759
4760    def healthcheck(self, id, timeout=None):
4761        '''
4762         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
4763         large network of Nodes. The call will return immediately, and the updated health of the
4764         Resource can be retrieved via Get or List.
4765        '''
4766        req = ResourceHealthcheckRequest()
4767
4768        req.id = (id)
4769        tries = 0
4770        plumbing_response = None
4771        while True:
4772            try:
4773                plumbing_response = self.stub.Healthcheck(
4774                    req,
4775                    metadata=self.parent.get_metadata('Resources.Healthcheck',
4776                                                      req),
4777                    timeout=timeout)
4778            except Exception as e:
4779                if self.parent.shouldRetry(tries, e):
4780                    tries += 1
4781                    self.parent.jitterSleep(tries)
4782                    continue
4783                raise plumbing.convert_error_to_porcelain(e) from e
4784            break
4785
4786        resp = models.ResourceHealthcheckResponse()
4787        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4788            plumbing_response.meta)
4789        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4790            plumbing_response.rate_limit)
4791        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.AWSInstanceProfile 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.CouchbaseDatabase strongdm.models.CouchbaseWebUI 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.GCPConsole strongdm.models.GCPWIF 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.SSHPassword strongdm.models.Sybase strongdm.models.SybaseIQ strongdm.models.Teradata strongdm.models.Trino

Resources(channel, client)
4549    def __init__(self, channel, client):
4550        self.parent = client
4551        self.stub = ResourcesStub(channel)
def enumerate_tags(self, filter, *args, timeout=None)
4553    def enumerate_tags(self, filter, *args, timeout=None):
4554        '''
4555         EnumerateTags gets a list of the filter matching tags.
4556        '''
4557        req = EnumerateTagsRequest()
4558        req.meta.CopyFrom(ListRequestMetadata())
4559        if self.parent.page_limit > 0:
4560            req.meta.limit = self.parent.page_limit
4561        if self.parent.snapshot_datetime is not None:
4562            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4563
4564        req.filter = plumbing.quote_filter_args(filter, *args)
4565
4566        def generator(svc, req):
4567            tries = 0
4568            while True:
4569                try:
4570                    plumbing_response = svc.stub.EnumerateTags(
4571                        req,
4572                        metadata=svc.parent.get_metadata(
4573                            'Resources.EnumerateTags', req),
4574                        timeout=timeout)
4575                except Exception as e:
4576                    if self.parent.shouldRetry(tries, e):
4577                        tries += 1
4578                        self.parent.jitterSleep(tries)
4579                        continue
4580                    raise plumbing.convert_error_to_porcelain(e) from e
4581                tries = 0
4582                for plumbing_item in plumbing_response.matches:
4583                    yield plumbing.convert_tag_to_porcelain(plumbing_item)
4584                if plumbing_response.meta.next_cursor == '':
4585                    break
4586                req.meta.cursor = plumbing_response.meta.next_cursor
4587
4588        return generator(self, req)

EnumerateTags gets a list of the filter matching tags.

def create(self, resource, timeout=None)
4590    def create(self, resource, timeout=None):
4591        '''
4592         Create registers a new Resource.
4593        '''
4594        req = ResourceCreateRequest()
4595
4596        if resource is not None:
4597            req.resource.CopyFrom(
4598                plumbing.convert_resource_to_plumbing(resource))
4599        tries = 0
4600        plumbing_response = None
4601        while True:
4602            try:
4603                plumbing_response = self.stub.Create(
4604                    req,
4605                    metadata=self.parent.get_metadata('Resources.Create', req),
4606                    timeout=timeout)
4607            except Exception as e:
4608                if self.parent.shouldRetry(tries, e):
4609                    tries += 1
4610                    self.parent.jitterSleep(tries)
4611                    continue
4612                raise plumbing.convert_error_to_porcelain(e) from e
4613            break
4614
4615        resp = models.ResourceCreateResponse()
4616        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4617            plumbing_response.meta)
4618        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4619            plumbing_response.rate_limit)
4620        resp.resource = plumbing.convert_resource_to_porcelain(
4621            plumbing_response.resource)
4622        return resp

Create registers a new Resource.

def get(self, id, timeout=None)
4624    def get(self, id, timeout=None):
4625        '''
4626         Get reads one Resource by ID.
4627        '''
4628        req = ResourceGetRequest()
4629        if self.parent.snapshot_datetime is not None:
4630            req.meta.CopyFrom(GetRequestMetadata())
4631            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4632
4633        req.id = (id)
4634        tries = 0
4635        plumbing_response = None
4636        while True:
4637            try:
4638                plumbing_response = self.stub.Get(
4639                    req,
4640                    metadata=self.parent.get_metadata('Resources.Get', req),
4641                    timeout=timeout)
4642            except Exception as e:
4643                if self.parent.shouldRetry(tries, e):
4644                    tries += 1
4645                    self.parent.jitterSleep(tries)
4646                    continue
4647                raise plumbing.convert_error_to_porcelain(e) from e
4648            break
4649
4650        resp = models.ResourceGetResponse()
4651        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4652            plumbing_response.meta)
4653        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4654            plumbing_response.rate_limit)
4655        resp.resource = plumbing.convert_resource_to_porcelain(
4656            plumbing_response.resource)
4657        return resp

Get reads one Resource by ID.

def update(self, resource, timeout=None)
4659    def update(self, resource, timeout=None):
4660        '''
4661         Update replaces all the fields of a Resource by ID.
4662        '''
4663        req = ResourceUpdateRequest()
4664
4665        if resource is not None:
4666            req.resource.CopyFrom(
4667                plumbing.convert_resource_to_plumbing(resource))
4668        tries = 0
4669        plumbing_response = None
4670        while True:
4671            try:
4672                plumbing_response = self.stub.Update(
4673                    req,
4674                    metadata=self.parent.get_metadata('Resources.Update', req),
4675                    timeout=timeout)
4676            except Exception as e:
4677                if self.parent.shouldRetry(tries, e):
4678                    tries += 1
4679                    self.parent.jitterSleep(tries)
4680                    continue
4681                raise plumbing.convert_error_to_porcelain(e) from e
4682            break
4683
4684        resp = models.ResourceUpdateResponse()
4685        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4686            plumbing_response.meta)
4687        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4688            plumbing_response.rate_limit)
4689        resp.resource = plumbing.convert_resource_to_porcelain(
4690            plumbing_response.resource)
4691        return resp

Update replaces all the fields of a Resource by ID.

def delete(self, id, timeout=None)
4693    def delete(self, id, timeout=None):
4694        '''
4695         Delete removes a Resource by ID.
4696        '''
4697        req = ResourceDeleteRequest()
4698
4699        req.id = (id)
4700        tries = 0
4701        plumbing_response = None
4702        while True:
4703            try:
4704                plumbing_response = self.stub.Delete(
4705                    req,
4706                    metadata=self.parent.get_metadata('Resources.Delete', req),
4707                    timeout=timeout)
4708            except Exception as e:
4709                if self.parent.shouldRetry(tries, e):
4710                    tries += 1
4711                    self.parent.jitterSleep(tries)
4712                    continue
4713                raise plumbing.convert_error_to_porcelain(e) from e
4714            break
4715
4716        resp = models.ResourceDeleteResponse()
4717        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4718            plumbing_response.meta)
4719        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4720            plumbing_response.rate_limit)
4721        return resp

Delete removes a Resource by ID.

def list(self, filter, *args, timeout=None)
4723    def list(self, filter, *args, timeout=None):
4724        '''
4725         List gets a list of Resources matching a given set of criteria.
4726        '''
4727        req = ResourceListRequest()
4728        req.meta.CopyFrom(ListRequestMetadata())
4729        if self.parent.page_limit > 0:
4730            req.meta.limit = self.parent.page_limit
4731        if self.parent.snapshot_datetime is not None:
4732            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4733
4734        req.filter = plumbing.quote_filter_args(filter, *args)
4735
4736        def generator(svc, req):
4737            tries = 0
4738            while True:
4739                try:
4740                    plumbing_response = svc.stub.List(
4741                        req,
4742                        metadata=svc.parent.get_metadata(
4743                            'Resources.List', req),
4744                        timeout=timeout)
4745                except Exception as e:
4746                    if self.parent.shouldRetry(tries, e):
4747                        tries += 1
4748                        self.parent.jitterSleep(tries)
4749                        continue
4750                    raise plumbing.convert_error_to_porcelain(e) from e
4751                tries = 0
4752                for plumbing_item in plumbing_response.resources:
4753                    yield plumbing.convert_resource_to_porcelain(plumbing_item)
4754                if plumbing_response.meta.next_cursor == '':
4755                    break
4756                req.meta.cursor = plumbing_response.meta.next_cursor
4757
4758        return generator(self, req)

List gets a list of Resources matching a given set of criteria.

def healthcheck(self, id, timeout=None)
4760    def healthcheck(self, id, timeout=None):
4761        '''
4762         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
4763         large network of Nodes. The call will return immediately, and the updated health of the
4764         Resource can be retrieved via Get or List.
4765        '''
4766        req = ResourceHealthcheckRequest()
4767
4768        req.id = (id)
4769        tries = 0
4770        plumbing_response = None
4771        while True:
4772            try:
4773                plumbing_response = self.stub.Healthcheck(
4774                    req,
4775                    metadata=self.parent.get_metadata('Resources.Healthcheck',
4776                                                      req),
4777                    timeout=timeout)
4778            except Exception as e:
4779                if self.parent.shouldRetry(tries, e):
4780                    tries += 1
4781                    self.parent.jitterSleep(tries)
4782                    continue
4783                raise plumbing.convert_error_to_porcelain(e) from e
4784            break
4785
4786        resp = models.ResourceHealthcheckResponse()
4787        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4788            plumbing_response.meta)
4789        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4790            plumbing_response.rate_limit)
4791        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.

class SnapshotResources:
4794class SnapshotResources:
4795    '''
4796    SnapshotResources exposes the read only methods of the Resources
4797    service for historical queries.
4798    '''
4799    def __init__(self, resources):
4800        self.resources = resources
4801
4802    def get(self, id, timeout=None):
4803        '''
4804         Get reads one Resource by ID.
4805        '''
4806        return self.resources.get(id, timeout=timeout)
4807
4808    def list(self, filter, *args, timeout=None):
4809        '''
4810         List gets a list of Resources matching a given set of criteria.
4811        '''
4812        return self.resources.list(filter, *args, timeout=timeout)

SnapshotResources exposes the read only methods of the Resources service for historical queries.

SnapshotResources(resources)
4799    def __init__(self, resources):
4800        self.resources = resources
def get(self, id, timeout=None)
4802    def get(self, id, timeout=None):
4803        '''
4804         Get reads one Resource by ID.
4805        '''
4806        return self.resources.get(id, timeout=timeout)

Get reads one Resource by ID.

def list(self, filter, *args, timeout=None)
4808    def list(self, filter, *args, timeout=None):
4809        '''
4810         List gets a list of Resources matching a given set of criteria.
4811        '''
4812        return self.resources.list(filter, *args, timeout=timeout)

List gets a list of Resources matching a given set of criteria.

class ResourcesHistory:
4815class ResourcesHistory:
4816    '''
4817     ResourcesHistory records all changes to the state of a Resource.
4818    See `strongdm.models.ResourceHistory`.
4819    '''
4820    def __init__(self, channel, client):
4821        self.parent = client
4822        self.stub = ResourcesHistoryStub(channel)
4823
4824    def list(self, filter, *args, timeout=None):
4825        '''
4826         List gets a list of ResourceHistory records matching a given set of criteria.
4827        '''
4828        req = ResourceHistoryListRequest()
4829        req.meta.CopyFrom(ListRequestMetadata())
4830        if self.parent.page_limit > 0:
4831            req.meta.limit = self.parent.page_limit
4832        if self.parent.snapshot_datetime is not None:
4833            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4834
4835        req.filter = plumbing.quote_filter_args(filter, *args)
4836
4837        def generator(svc, req):
4838            tries = 0
4839            while True:
4840                try:
4841                    plumbing_response = svc.stub.List(
4842                        req,
4843                        metadata=svc.parent.get_metadata(
4844                            'ResourcesHistory.List', req),
4845                        timeout=timeout)
4846                except Exception as e:
4847                    if self.parent.shouldRetry(tries, e):
4848                        tries += 1
4849                        self.parent.jitterSleep(tries)
4850                        continue
4851                    raise plumbing.convert_error_to_porcelain(e) from e
4852                tries = 0
4853                for plumbing_item in plumbing_response.history:
4854                    yield plumbing.convert_resource_history_to_porcelain(
4855                        plumbing_item)
4856                if plumbing_response.meta.next_cursor == '':
4857                    break
4858                req.meta.cursor = plumbing_response.meta.next_cursor
4859
4860        return generator(self, req)

ResourcesHistory records all changes to the state of a Resource. See strongdm.models.ResourceHistory.

ResourcesHistory(channel, client)
4820    def __init__(self, channel, client):
4821        self.parent = client
4822        self.stub = ResourcesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
4824    def list(self, filter, *args, timeout=None):
4825        '''
4826         List gets a list of ResourceHistory records matching a given set of criteria.
4827        '''
4828        req = ResourceHistoryListRequest()
4829        req.meta.CopyFrom(ListRequestMetadata())
4830        if self.parent.page_limit > 0:
4831            req.meta.limit = self.parent.page_limit
4832        if self.parent.snapshot_datetime is not None:
4833            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4834
4835        req.filter = plumbing.quote_filter_args(filter, *args)
4836
4837        def generator(svc, req):
4838            tries = 0
4839            while True:
4840                try:
4841                    plumbing_response = svc.stub.List(
4842                        req,
4843                        metadata=svc.parent.get_metadata(
4844                            'ResourcesHistory.List', req),
4845                        timeout=timeout)
4846                except Exception as e:
4847                    if self.parent.shouldRetry(tries, e):
4848                        tries += 1
4849                        self.parent.jitterSleep(tries)
4850                        continue
4851                    raise plumbing.convert_error_to_porcelain(e) from e
4852                tries = 0
4853                for plumbing_item in plumbing_response.history:
4854                    yield plumbing.convert_resource_history_to_porcelain(
4855                        plumbing_item)
4856                if plumbing_response.meta.next_cursor == '':
4857                    break
4858                req.meta.cursor = plumbing_response.meta.next_cursor
4859
4860        return generator(self, req)

List gets a list of ResourceHistory records matching a given set of criteria.

class RoleResources:
4863class RoleResources:
4864    '''
4865     RoleResources enumerates the resources to which roles have access.
4866     The RoleResources service is read-only.
4867    See `strongdm.models.RoleResource`.
4868    '''
4869    def __init__(self, channel, client):
4870        self.parent = client
4871        self.stub = RoleResourcesStub(channel)
4872
4873    def list(self, filter, *args, timeout=None):
4874        '''
4875         List gets a list of RoleResource records matching a given set of criteria.
4876        '''
4877        req = RoleResourceListRequest()
4878        req.meta.CopyFrom(ListRequestMetadata())
4879        if self.parent.page_limit > 0:
4880            req.meta.limit = self.parent.page_limit
4881        if self.parent.snapshot_datetime is not None:
4882            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4883
4884        req.filter = plumbing.quote_filter_args(filter, *args)
4885
4886        def generator(svc, req):
4887            tries = 0
4888            while True:
4889                try:
4890                    plumbing_response = svc.stub.List(
4891                        req,
4892                        metadata=svc.parent.get_metadata(
4893                            'RoleResources.List', req),
4894                        timeout=timeout)
4895                except Exception as e:
4896                    if self.parent.shouldRetry(tries, e):
4897                        tries += 1
4898                        self.parent.jitterSleep(tries)
4899                        continue
4900                    raise plumbing.convert_error_to_porcelain(e) from e
4901                tries = 0
4902                for plumbing_item in plumbing_response.role_resources:
4903                    yield plumbing.convert_role_resource_to_porcelain(
4904                        plumbing_item)
4905                if plumbing_response.meta.next_cursor == '':
4906                    break
4907                req.meta.cursor = plumbing_response.meta.next_cursor
4908
4909        return generator(self, req)

RoleResources enumerates the resources to which roles have access. The RoleResources service is read-only. See strongdm.models.RoleResource.

RoleResources(channel, client)
4869    def __init__(self, channel, client):
4870        self.parent = client
4871        self.stub = RoleResourcesStub(channel)
def list(self, filter, *args, timeout=None)
4873    def list(self, filter, *args, timeout=None):
4874        '''
4875         List gets a list of RoleResource records matching a given set of criteria.
4876        '''
4877        req = RoleResourceListRequest()
4878        req.meta.CopyFrom(ListRequestMetadata())
4879        if self.parent.page_limit > 0:
4880            req.meta.limit = self.parent.page_limit
4881        if self.parent.snapshot_datetime is not None:
4882            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4883
4884        req.filter = plumbing.quote_filter_args(filter, *args)
4885
4886        def generator(svc, req):
4887            tries = 0
4888            while True:
4889                try:
4890                    plumbing_response = svc.stub.List(
4891                        req,
4892                        metadata=svc.parent.get_metadata(
4893                            'RoleResources.List', req),
4894                        timeout=timeout)
4895                except Exception as e:
4896                    if self.parent.shouldRetry(tries, e):
4897                        tries += 1
4898                        self.parent.jitterSleep(tries)
4899                        continue
4900                    raise plumbing.convert_error_to_porcelain(e) from e
4901                tries = 0
4902                for plumbing_item in plumbing_response.role_resources:
4903                    yield plumbing.convert_role_resource_to_porcelain(
4904                        plumbing_item)
4905                if plumbing_response.meta.next_cursor == '':
4906                    break
4907                req.meta.cursor = plumbing_response.meta.next_cursor
4908
4909        return generator(self, req)

List gets a list of RoleResource records matching a given set of criteria.

class SnapshotRoleResources:
4912class SnapshotRoleResources:
4913    '''
4914    SnapshotRoleResources exposes the read only methods of the RoleResources
4915    service for historical queries.
4916    '''
4917    def __init__(self, role_resources):
4918        self.role_resources = role_resources
4919
4920    def list(self, filter, *args, timeout=None):
4921        '''
4922         List gets a list of RoleResource records matching a given set of criteria.
4923        '''
4924        return self.role_resources.list(filter, *args, timeout=timeout)

SnapshotRoleResources exposes the read only methods of the RoleResources service for historical queries.

SnapshotRoleResources(role_resources)
4917    def __init__(self, role_resources):
4918        self.role_resources = role_resources
def list(self, filter, *args, timeout=None)
4920    def list(self, filter, *args, timeout=None):
4921        '''
4922         List gets a list of RoleResource records matching a given set of criteria.
4923        '''
4924        return self.role_resources.list(filter, *args, timeout=timeout)

List gets a list of RoleResource records matching a given set of criteria.

class RoleResourcesHistory:
4927class RoleResourcesHistory:
4928    '''
4929     RoleResourcesHistory records all changes to the state of a RoleResource.
4930    See `strongdm.models.RoleResourceHistory`.
4931    '''
4932    def __init__(self, channel, client):
4933        self.parent = client
4934        self.stub = RoleResourcesHistoryStub(channel)
4935
4936    def list(self, filter, *args, timeout=None):
4937        '''
4938         List gets a list of RoleResourceHistory records matching a given set of criteria.
4939        '''
4940        req = RoleResourceHistoryListRequest()
4941        req.meta.CopyFrom(ListRequestMetadata())
4942        if self.parent.page_limit > 0:
4943            req.meta.limit = self.parent.page_limit
4944        if self.parent.snapshot_datetime is not None:
4945            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4946
4947        req.filter = plumbing.quote_filter_args(filter, *args)
4948
4949        def generator(svc, req):
4950            tries = 0
4951            while True:
4952                try:
4953                    plumbing_response = svc.stub.List(
4954                        req,
4955                        metadata=svc.parent.get_metadata(
4956                            'RoleResourcesHistory.List', req),
4957                        timeout=timeout)
4958                except Exception as e:
4959                    if self.parent.shouldRetry(tries, e):
4960                        tries += 1
4961                        self.parent.jitterSleep(tries)
4962                        continue
4963                    raise plumbing.convert_error_to_porcelain(e) from e
4964                tries = 0
4965                for plumbing_item in plumbing_response.history:
4966                    yield plumbing.convert_role_resource_history_to_porcelain(
4967                        plumbing_item)
4968                if plumbing_response.meta.next_cursor == '':
4969                    break
4970                req.meta.cursor = plumbing_response.meta.next_cursor
4971
4972        return generator(self, req)

RoleResourcesHistory records all changes to the state of a RoleResource. See strongdm.models.RoleResourceHistory.

RoleResourcesHistory(channel, client)
4932    def __init__(self, channel, client):
4933        self.parent = client
4934        self.stub = RoleResourcesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
4936    def list(self, filter, *args, timeout=None):
4937        '''
4938         List gets a list of RoleResourceHistory records matching a given set of criteria.
4939        '''
4940        req = RoleResourceHistoryListRequest()
4941        req.meta.CopyFrom(ListRequestMetadata())
4942        if self.parent.page_limit > 0:
4943            req.meta.limit = self.parent.page_limit
4944        if self.parent.snapshot_datetime is not None:
4945            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4946
4947        req.filter = plumbing.quote_filter_args(filter, *args)
4948
4949        def generator(svc, req):
4950            tries = 0
4951            while True:
4952                try:
4953                    plumbing_response = svc.stub.List(
4954                        req,
4955                        metadata=svc.parent.get_metadata(
4956                            'RoleResourcesHistory.List', req),
4957                        timeout=timeout)
4958                except Exception as e:
4959                    if self.parent.shouldRetry(tries, e):
4960                        tries += 1
4961                        self.parent.jitterSleep(tries)
4962                        continue
4963                    raise plumbing.convert_error_to_porcelain(e) from e
4964                tries = 0
4965                for plumbing_item in plumbing_response.history:
4966                    yield plumbing.convert_role_resource_history_to_porcelain(
4967                        plumbing_item)
4968                if plumbing_response.meta.next_cursor == '':
4969                    break
4970                req.meta.cursor = plumbing_response.meta.next_cursor
4971
4972        return generator(self, req)

List gets a list of RoleResourceHistory records matching a given set of criteria.

class Roles:
4975class Roles:
4976    '''
4977     A Role has a list of access rules which determine which Resources the members
4978     of the Role have access to. An Account can be a member of multiple Roles via
4979     AccountAttachments.
4980    See `strongdm.models.Role`.
4981    '''
4982    def __init__(self, channel, client):
4983        self.parent = client
4984        self.stub = RolesStub(channel)
4985
4986    def create(self, role, timeout=None):
4987        '''
4988         Create registers a new Role.
4989        '''
4990        req = RoleCreateRequest()
4991
4992        if role is not None:
4993            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
4994        tries = 0
4995        plumbing_response = None
4996        while True:
4997            try:
4998                plumbing_response = self.stub.Create(
4999                    req,
5000                    metadata=self.parent.get_metadata('Roles.Create', req),
5001                    timeout=timeout)
5002            except Exception as e:
5003                if self.parent.shouldRetry(tries, e):
5004                    tries += 1
5005                    self.parent.jitterSleep(tries)
5006                    continue
5007                raise plumbing.convert_error_to_porcelain(e) from e
5008            break
5009
5010        resp = models.RoleCreateResponse()
5011        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5012            plumbing_response.meta)
5013        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5014            plumbing_response.rate_limit)
5015        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5016        return resp
5017
5018    def get(self, id, timeout=None):
5019        '''
5020         Get reads one Role by ID.
5021        '''
5022        req = RoleGetRequest()
5023        if self.parent.snapshot_datetime is not None:
5024            req.meta.CopyFrom(GetRequestMetadata())
5025            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5026
5027        req.id = (id)
5028        tries = 0
5029        plumbing_response = None
5030        while True:
5031            try:
5032                plumbing_response = self.stub.Get(
5033                    req,
5034                    metadata=self.parent.get_metadata('Roles.Get', req),
5035                    timeout=timeout)
5036            except Exception as e:
5037                if self.parent.shouldRetry(tries, e):
5038                    tries += 1
5039                    self.parent.jitterSleep(tries)
5040                    continue
5041                raise plumbing.convert_error_to_porcelain(e) from e
5042            break
5043
5044        resp = models.RoleGetResponse()
5045        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5046            plumbing_response.meta)
5047        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5048            plumbing_response.rate_limit)
5049        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5050        return resp
5051
5052    def update(self, role, timeout=None):
5053        '''
5054         Update replaces all the fields of a Role by ID.
5055        '''
5056        req = RoleUpdateRequest()
5057
5058        if role is not None:
5059            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5060        tries = 0
5061        plumbing_response = None
5062        while True:
5063            try:
5064                plumbing_response = self.stub.Update(
5065                    req,
5066                    metadata=self.parent.get_metadata('Roles.Update', req),
5067                    timeout=timeout)
5068            except Exception as e:
5069                if self.parent.shouldRetry(tries, e):
5070                    tries += 1
5071                    self.parent.jitterSleep(tries)
5072                    continue
5073                raise plumbing.convert_error_to_porcelain(e) from e
5074            break
5075
5076        resp = models.RoleUpdateResponse()
5077        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5078            plumbing_response.meta)
5079        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5080            plumbing_response.rate_limit)
5081        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5082        return resp
5083
5084    def delete(self, id, timeout=None):
5085        '''
5086         Delete removes a Role by ID.
5087        '''
5088        req = RoleDeleteRequest()
5089
5090        req.id = (id)
5091        tries = 0
5092        plumbing_response = None
5093        while True:
5094            try:
5095                plumbing_response = self.stub.Delete(
5096                    req,
5097                    metadata=self.parent.get_metadata('Roles.Delete', 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            break
5106
5107        resp = models.RoleDeleteResponse()
5108        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5109            plumbing_response.meta)
5110        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5111            plumbing_response.rate_limit)
5112        return resp
5113
5114    def list(self, filter, *args, timeout=None):
5115        '''
5116         List gets a list of Roles matching a given set of criteria.
5117        '''
5118        req = RoleListRequest()
5119        req.meta.CopyFrom(ListRequestMetadata())
5120        if self.parent.page_limit > 0:
5121            req.meta.limit = self.parent.page_limit
5122        if self.parent.snapshot_datetime is not None:
5123            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5124
5125        req.filter = plumbing.quote_filter_args(filter, *args)
5126
5127        def generator(svc, req):
5128            tries = 0
5129            while True:
5130                try:
5131                    plumbing_response = svc.stub.List(
5132                        req,
5133                        metadata=svc.parent.get_metadata('Roles.List', req),
5134                        timeout=timeout)
5135                except Exception as e:
5136                    if self.parent.shouldRetry(tries, e):
5137                        tries += 1
5138                        self.parent.jitterSleep(tries)
5139                        continue
5140                    raise plumbing.convert_error_to_porcelain(e) from e
5141                tries = 0
5142                for plumbing_item in plumbing_response.roles:
5143                    yield plumbing.convert_role_to_porcelain(plumbing_item)
5144                if plumbing_response.meta.next_cursor == '':
5145                    break
5146                req.meta.cursor = plumbing_response.meta.next_cursor
5147
5148        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.

Roles(channel, client)
4982    def __init__(self, channel, client):
4983        self.parent = client
4984        self.stub = RolesStub(channel)
def create(self, role, timeout=None)
4986    def create(self, role, timeout=None):
4987        '''
4988         Create registers a new Role.
4989        '''
4990        req = RoleCreateRequest()
4991
4992        if role is not None:
4993            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
4994        tries = 0
4995        plumbing_response = None
4996        while True:
4997            try:
4998                plumbing_response = self.stub.Create(
4999                    req,
5000                    metadata=self.parent.get_metadata('Roles.Create', req),
5001                    timeout=timeout)
5002            except Exception as e:
5003                if self.parent.shouldRetry(tries, e):
5004                    tries += 1
5005                    self.parent.jitterSleep(tries)
5006                    continue
5007                raise plumbing.convert_error_to_porcelain(e) from e
5008            break
5009
5010        resp = models.RoleCreateResponse()
5011        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5012            plumbing_response.meta)
5013        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5014            plumbing_response.rate_limit)
5015        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5016        return resp

Create registers a new Role.

def get(self, id, timeout=None)
5018    def get(self, id, timeout=None):
5019        '''
5020         Get reads one Role by ID.
5021        '''
5022        req = RoleGetRequest()
5023        if self.parent.snapshot_datetime is not None:
5024            req.meta.CopyFrom(GetRequestMetadata())
5025            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5026
5027        req.id = (id)
5028        tries = 0
5029        plumbing_response = None
5030        while True:
5031            try:
5032                plumbing_response = self.stub.Get(
5033                    req,
5034                    metadata=self.parent.get_metadata('Roles.Get', req),
5035                    timeout=timeout)
5036            except Exception as e:
5037                if self.parent.shouldRetry(tries, e):
5038                    tries += 1
5039                    self.parent.jitterSleep(tries)
5040                    continue
5041                raise plumbing.convert_error_to_porcelain(e) from e
5042            break
5043
5044        resp = models.RoleGetResponse()
5045        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5046            plumbing_response.meta)
5047        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5048            plumbing_response.rate_limit)
5049        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5050        return resp

Get reads one Role by ID.

def update(self, role, timeout=None)
5052    def update(self, role, timeout=None):
5053        '''
5054         Update replaces all the fields of a Role by ID.
5055        '''
5056        req = RoleUpdateRequest()
5057
5058        if role is not None:
5059            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5060        tries = 0
5061        plumbing_response = None
5062        while True:
5063            try:
5064                plumbing_response = self.stub.Update(
5065                    req,
5066                    metadata=self.parent.get_metadata('Roles.Update', req),
5067                    timeout=timeout)
5068            except Exception as e:
5069                if self.parent.shouldRetry(tries, e):
5070                    tries += 1
5071                    self.parent.jitterSleep(tries)
5072                    continue
5073                raise plumbing.convert_error_to_porcelain(e) from e
5074            break
5075
5076        resp = models.RoleUpdateResponse()
5077        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5078            plumbing_response.meta)
5079        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5080            plumbing_response.rate_limit)
5081        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5082        return resp

Update replaces all the fields of a Role by ID.

def delete(self, id, timeout=None)
5084    def delete(self, id, timeout=None):
5085        '''
5086         Delete removes a Role by ID.
5087        '''
5088        req = RoleDeleteRequest()
5089
5090        req.id = (id)
5091        tries = 0
5092        plumbing_response = None
5093        while True:
5094            try:
5095                plumbing_response = self.stub.Delete(
5096                    req,
5097                    metadata=self.parent.get_metadata('Roles.Delete', 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            break
5106
5107        resp = models.RoleDeleteResponse()
5108        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5109            plumbing_response.meta)
5110        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5111            plumbing_response.rate_limit)
5112        return resp

Delete removes a Role by ID.

def list(self, filter, *args, timeout=None)
5114    def list(self, filter, *args, timeout=None):
5115        '''
5116         List gets a list of Roles matching a given set of criteria.
5117        '''
5118        req = RoleListRequest()
5119        req.meta.CopyFrom(ListRequestMetadata())
5120        if self.parent.page_limit > 0:
5121            req.meta.limit = self.parent.page_limit
5122        if self.parent.snapshot_datetime is not None:
5123            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5124
5125        req.filter = plumbing.quote_filter_args(filter, *args)
5126
5127        def generator(svc, req):
5128            tries = 0
5129            while True:
5130                try:
5131                    plumbing_response = svc.stub.List(
5132                        req,
5133                        metadata=svc.parent.get_metadata('Roles.List', req),
5134                        timeout=timeout)
5135                except Exception as e:
5136                    if self.parent.shouldRetry(tries, e):
5137                        tries += 1
5138                        self.parent.jitterSleep(tries)
5139                        continue
5140                    raise plumbing.convert_error_to_porcelain(e) from e
5141                tries = 0
5142                for plumbing_item in plumbing_response.roles:
5143                    yield plumbing.convert_role_to_porcelain(plumbing_item)
5144                if plumbing_response.meta.next_cursor == '':
5145                    break
5146                req.meta.cursor = plumbing_response.meta.next_cursor
5147
5148        return generator(self, req)

List gets a list of Roles matching a given set of criteria.

class SnapshotRoles:
5151class SnapshotRoles:
5152    '''
5153    SnapshotRoles exposes the read only methods of the Roles
5154    service for historical queries.
5155    '''
5156    def __init__(self, roles):
5157        self.roles = roles
5158
5159    def get(self, id, timeout=None):
5160        '''
5161         Get reads one Role by ID.
5162        '''
5163        return self.roles.get(id, timeout=timeout)
5164
5165    def list(self, filter, *args, timeout=None):
5166        '''
5167         List gets a list of Roles matching a given set of criteria.
5168        '''
5169        return self.roles.list(filter, *args, timeout=timeout)

SnapshotRoles exposes the read only methods of the Roles service for historical queries.

SnapshotRoles(roles)
5156    def __init__(self, roles):
5157        self.roles = roles
def get(self, id, timeout=None)
5159    def get(self, id, timeout=None):
5160        '''
5161         Get reads one Role by ID.
5162        '''
5163        return self.roles.get(id, timeout=timeout)

Get reads one Role by ID.

def list(self, filter, *args, timeout=None)
5165    def list(self, filter, *args, timeout=None):
5166        '''
5167         List gets a list of Roles matching a given set of criteria.
5168        '''
5169        return self.roles.list(filter, *args, timeout=timeout)

List gets a list of Roles matching a given set of criteria.

class RolesHistory:
5172class RolesHistory:
5173    '''
5174     RolesHistory records all changes to the state of a Role.
5175    See `strongdm.models.RoleHistory`.
5176    '''
5177    def __init__(self, channel, client):
5178        self.parent = client
5179        self.stub = RolesHistoryStub(channel)
5180
5181    def list(self, filter, *args, timeout=None):
5182        '''
5183         List gets a list of RoleHistory records matching a given set of criteria.
5184        '''
5185        req = RoleHistoryListRequest()
5186        req.meta.CopyFrom(ListRequestMetadata())
5187        if self.parent.page_limit > 0:
5188            req.meta.limit = self.parent.page_limit
5189        if self.parent.snapshot_datetime is not None:
5190            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5191
5192        req.filter = plumbing.quote_filter_args(filter, *args)
5193
5194        def generator(svc, req):
5195            tries = 0
5196            while True:
5197                try:
5198                    plumbing_response = svc.stub.List(
5199                        req,
5200                        metadata=svc.parent.get_metadata(
5201                            'RolesHistory.List', req),
5202                        timeout=timeout)
5203                except Exception as e:
5204                    if self.parent.shouldRetry(tries, e):
5205                        tries += 1
5206                        self.parent.jitterSleep(tries)
5207                        continue
5208                    raise plumbing.convert_error_to_porcelain(e) from e
5209                tries = 0
5210                for plumbing_item in plumbing_response.history:
5211                    yield plumbing.convert_role_history_to_porcelain(
5212                        plumbing_item)
5213                if plumbing_response.meta.next_cursor == '':
5214                    break
5215                req.meta.cursor = plumbing_response.meta.next_cursor
5216
5217        return generator(self, req)

RolesHistory records all changes to the state of a Role. See strongdm.models.RoleHistory.

RolesHistory(channel, client)
5177    def __init__(self, channel, client):
5178        self.parent = client
5179        self.stub = RolesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
5181    def list(self, filter, *args, timeout=None):
5182        '''
5183         List gets a list of RoleHistory records matching a given set of criteria.
5184        '''
5185        req = RoleHistoryListRequest()
5186        req.meta.CopyFrom(ListRequestMetadata())
5187        if self.parent.page_limit > 0:
5188            req.meta.limit = self.parent.page_limit
5189        if self.parent.snapshot_datetime is not None:
5190            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5191
5192        req.filter = plumbing.quote_filter_args(filter, *args)
5193
5194        def generator(svc, req):
5195            tries = 0
5196            while True:
5197                try:
5198                    plumbing_response = svc.stub.List(
5199                        req,
5200                        metadata=svc.parent.get_metadata(
5201                            'RolesHistory.List', req),
5202                        timeout=timeout)
5203                except Exception as e:
5204                    if self.parent.shouldRetry(tries, e):
5205                        tries += 1
5206                        self.parent.jitterSleep(tries)
5207                        continue
5208                    raise plumbing.convert_error_to_porcelain(e) from e
5209                tries = 0
5210                for plumbing_item in plumbing_response.history:
5211                    yield plumbing.convert_role_history_to_porcelain(
5212                        plumbing_item)
5213                if plumbing_response.meta.next_cursor == '':
5214                    break
5215                req.meta.cursor = plumbing_response.meta.next_cursor
5216
5217        return generator(self, req)

List gets a list of RoleHistory records matching a given set of criteria.

class SecretStores:
5220class SecretStores:
5221    '''
5222     SecretStores are servers where resource secrets (passwords, keys) are stored.
5223    See:
5224    `strongdm.models.ActiveDirectoryStore`
5225    `strongdm.models.AWSStore`
5226    `strongdm.models.AWSCertX509Store`
5227    `strongdm.models.AzureStore`
5228    `strongdm.models.CyberarkConjurStore`
5229    `strongdm.models.CyberarkPAMStore`
5230    `strongdm.models.CyberarkPAMExperimentalStore`
5231    `strongdm.models.DelineaStore`
5232    `strongdm.models.GCPStore`
5233    `strongdm.models.GCPCertX509Store`
5234    `strongdm.models.KeyfactorSSHStore`
5235    `strongdm.models.KeyfactorX509Store`
5236    `strongdm.models.VaultAppRoleStore`
5237    `strongdm.models.VaultAppRoleCertSSHStore`
5238    `strongdm.models.VaultAppRoleCertX509Store`
5239    `strongdm.models.VaultAWSEC2Store`
5240    `strongdm.models.VaultAWSIAMStore`
5241    `strongdm.models.VaultTLSStore`
5242    `strongdm.models.VaultTLSCertSSHStore`
5243    `strongdm.models.VaultTLSCertX509Store`
5244    `strongdm.models.VaultTokenStore`
5245    `strongdm.models.VaultTokenCertSSHStore`
5246    `strongdm.models.VaultTokenCertX509Store`
5247    '''
5248    def __init__(self, channel, client):
5249        self.parent = client
5250        self.stub = SecretStoresStub(channel)
5251
5252    def create(self, secret_store, timeout=None):
5253        req = SecretStoreCreateRequest()
5254
5255        if secret_store is not None:
5256            req.secret_store.CopyFrom(
5257                plumbing.convert_secret_store_to_plumbing(secret_store))
5258        tries = 0
5259        plumbing_response = None
5260        while True:
5261            try:
5262                plumbing_response = self.stub.Create(
5263                    req,
5264                    metadata=self.parent.get_metadata('SecretStores.Create',
5265                                                      req),
5266                    timeout=timeout)
5267            except Exception as e:
5268                if self.parent.shouldRetry(tries, e):
5269                    tries += 1
5270                    self.parent.jitterSleep(tries)
5271                    continue
5272                raise plumbing.convert_error_to_porcelain(e) from e
5273            break
5274
5275        resp = models.SecretStoreCreateResponse()
5276        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5277            plumbing_response.meta)
5278        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5279            plumbing_response.rate_limit)
5280        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5281            plumbing_response.secret_store)
5282        return resp
5283
5284    def get(self, id, timeout=None):
5285        '''
5286         Get reads one SecretStore by ID.
5287        '''
5288        req = SecretStoreGetRequest()
5289        if self.parent.snapshot_datetime is not None:
5290            req.meta.CopyFrom(GetRequestMetadata())
5291            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5292
5293        req.id = (id)
5294        tries = 0
5295        plumbing_response = None
5296        while True:
5297            try:
5298                plumbing_response = self.stub.Get(
5299                    req,
5300                    metadata=self.parent.get_metadata('SecretStores.Get', req),
5301                    timeout=timeout)
5302            except Exception as e:
5303                if self.parent.shouldRetry(tries, e):
5304                    tries += 1
5305                    self.parent.jitterSleep(tries)
5306                    continue
5307                raise plumbing.convert_error_to_porcelain(e) from e
5308            break
5309
5310        resp = models.SecretStoreGetResponse()
5311        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5312            plumbing_response.meta)
5313        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5314            plumbing_response.rate_limit)
5315        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5316            plumbing_response.secret_store)
5317        return resp
5318
5319    def update(self, secret_store, timeout=None):
5320        '''
5321         Update replaces all the fields of a SecretStore by ID.
5322        '''
5323        req = SecretStoreUpdateRequest()
5324
5325        if secret_store is not None:
5326            req.secret_store.CopyFrom(
5327                plumbing.convert_secret_store_to_plumbing(secret_store))
5328        tries = 0
5329        plumbing_response = None
5330        while True:
5331            try:
5332                plumbing_response = self.stub.Update(
5333                    req,
5334                    metadata=self.parent.get_metadata('SecretStores.Update',
5335                                                      req),
5336                    timeout=timeout)
5337            except Exception as e:
5338                if self.parent.shouldRetry(tries, e):
5339                    tries += 1
5340                    self.parent.jitterSleep(tries)
5341                    continue
5342                raise plumbing.convert_error_to_porcelain(e) from e
5343            break
5344
5345        resp = models.SecretStoreUpdateResponse()
5346        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5347            plumbing_response.meta)
5348        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5349            plumbing_response.rate_limit)
5350        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5351            plumbing_response.secret_store)
5352        return resp
5353
5354    def delete(self, id, timeout=None):
5355        '''
5356         Delete removes a SecretStore by ID.
5357        '''
5358        req = SecretStoreDeleteRequest()
5359
5360        req.id = (id)
5361        tries = 0
5362        plumbing_response = None
5363        while True:
5364            try:
5365                plumbing_response = self.stub.Delete(
5366                    req,
5367                    metadata=self.parent.get_metadata('SecretStores.Delete',
5368                                                      req),
5369                    timeout=timeout)
5370            except Exception as e:
5371                if self.parent.shouldRetry(tries, e):
5372                    tries += 1
5373                    self.parent.jitterSleep(tries)
5374                    continue
5375                raise plumbing.convert_error_to_porcelain(e) from e
5376            break
5377
5378        resp = models.SecretStoreDeleteResponse()
5379        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5380            plumbing_response.meta)
5381        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5382            plumbing_response.rate_limit)
5383        return resp
5384
5385    def list(self, filter, *args, timeout=None):
5386        '''
5387         List gets a list of SecretStores matching a given set of criteria.
5388        '''
5389        req = SecretStoreListRequest()
5390        req.meta.CopyFrom(ListRequestMetadata())
5391        if self.parent.page_limit > 0:
5392            req.meta.limit = self.parent.page_limit
5393        if self.parent.snapshot_datetime is not None:
5394            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5395
5396        req.filter = plumbing.quote_filter_args(filter, *args)
5397
5398        def generator(svc, req):
5399            tries = 0
5400            while True:
5401                try:
5402                    plumbing_response = svc.stub.List(
5403                        req,
5404                        metadata=svc.parent.get_metadata(
5405                            'SecretStores.List', req),
5406                        timeout=timeout)
5407                except Exception as e:
5408                    if self.parent.shouldRetry(tries, e):
5409                        tries += 1
5410                        self.parent.jitterSleep(tries)
5411                        continue
5412                    raise plumbing.convert_error_to_porcelain(e) from e
5413                tries = 0
5414                for plumbing_item in plumbing_response.secret_stores:
5415                    yield plumbing.convert_secret_store_to_porcelain(
5416                        plumbing_item)
5417                if plumbing_response.meta.next_cursor == '':
5418                    break
5419                req.meta.cursor = plumbing_response.meta.next_cursor
5420
5421        return generator(self, req)
SecretStores(channel, client)
5248    def __init__(self, channel, client):
5249        self.parent = client
5250        self.stub = SecretStoresStub(channel)
def create(self, secret_store, timeout=None)
5252    def create(self, secret_store, timeout=None):
5253        req = SecretStoreCreateRequest()
5254
5255        if secret_store is not None:
5256            req.secret_store.CopyFrom(
5257                plumbing.convert_secret_store_to_plumbing(secret_store))
5258        tries = 0
5259        plumbing_response = None
5260        while True:
5261            try:
5262                plumbing_response = self.stub.Create(
5263                    req,
5264                    metadata=self.parent.get_metadata('SecretStores.Create',
5265                                                      req),
5266                    timeout=timeout)
5267            except Exception as e:
5268                if self.parent.shouldRetry(tries, e):
5269                    tries += 1
5270                    self.parent.jitterSleep(tries)
5271                    continue
5272                raise plumbing.convert_error_to_porcelain(e) from e
5273            break
5274
5275        resp = models.SecretStoreCreateResponse()
5276        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5277            plumbing_response.meta)
5278        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5279            plumbing_response.rate_limit)
5280        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5281            plumbing_response.secret_store)
5282        return resp
def get(self, id, timeout=None)
5284    def get(self, id, timeout=None):
5285        '''
5286         Get reads one SecretStore by ID.
5287        '''
5288        req = SecretStoreGetRequest()
5289        if self.parent.snapshot_datetime is not None:
5290            req.meta.CopyFrom(GetRequestMetadata())
5291            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5292
5293        req.id = (id)
5294        tries = 0
5295        plumbing_response = None
5296        while True:
5297            try:
5298                plumbing_response = self.stub.Get(
5299                    req,
5300                    metadata=self.parent.get_metadata('SecretStores.Get', req),
5301                    timeout=timeout)
5302            except Exception as e:
5303                if self.parent.shouldRetry(tries, e):
5304                    tries += 1
5305                    self.parent.jitterSleep(tries)
5306                    continue
5307                raise plumbing.convert_error_to_porcelain(e) from e
5308            break
5309
5310        resp = models.SecretStoreGetResponse()
5311        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5312            plumbing_response.meta)
5313        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5314            plumbing_response.rate_limit)
5315        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5316            plumbing_response.secret_store)
5317        return resp

Get reads one SecretStore by ID.

def update(self, secret_store, timeout=None)
5319    def update(self, secret_store, timeout=None):
5320        '''
5321         Update replaces all the fields of a SecretStore by ID.
5322        '''
5323        req = SecretStoreUpdateRequest()
5324
5325        if secret_store is not None:
5326            req.secret_store.CopyFrom(
5327                plumbing.convert_secret_store_to_plumbing(secret_store))
5328        tries = 0
5329        plumbing_response = None
5330        while True:
5331            try:
5332                plumbing_response = self.stub.Update(
5333                    req,
5334                    metadata=self.parent.get_metadata('SecretStores.Update',
5335                                                      req),
5336                    timeout=timeout)
5337            except Exception as e:
5338                if self.parent.shouldRetry(tries, e):
5339                    tries += 1
5340                    self.parent.jitterSleep(tries)
5341                    continue
5342                raise plumbing.convert_error_to_porcelain(e) from e
5343            break
5344
5345        resp = models.SecretStoreUpdateResponse()
5346        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5347            plumbing_response.meta)
5348        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5349            plumbing_response.rate_limit)
5350        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5351            plumbing_response.secret_store)
5352        return resp

Update replaces all the fields of a SecretStore by ID.

def delete(self, id, timeout=None)
5354    def delete(self, id, timeout=None):
5355        '''
5356         Delete removes a SecretStore by ID.
5357        '''
5358        req = SecretStoreDeleteRequest()
5359
5360        req.id = (id)
5361        tries = 0
5362        plumbing_response = None
5363        while True:
5364            try:
5365                plumbing_response = self.stub.Delete(
5366                    req,
5367                    metadata=self.parent.get_metadata('SecretStores.Delete',
5368                                                      req),
5369                    timeout=timeout)
5370            except Exception as e:
5371                if self.parent.shouldRetry(tries, e):
5372                    tries += 1
5373                    self.parent.jitterSleep(tries)
5374                    continue
5375                raise plumbing.convert_error_to_porcelain(e) from e
5376            break
5377
5378        resp = models.SecretStoreDeleteResponse()
5379        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5380            plumbing_response.meta)
5381        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5382            plumbing_response.rate_limit)
5383        return resp

Delete removes a SecretStore by ID.

def list(self, filter, *args, timeout=None)
5385    def list(self, filter, *args, timeout=None):
5386        '''
5387         List gets a list of SecretStores matching a given set of criteria.
5388        '''
5389        req = SecretStoreListRequest()
5390        req.meta.CopyFrom(ListRequestMetadata())
5391        if self.parent.page_limit > 0:
5392            req.meta.limit = self.parent.page_limit
5393        if self.parent.snapshot_datetime is not None:
5394            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5395
5396        req.filter = plumbing.quote_filter_args(filter, *args)
5397
5398        def generator(svc, req):
5399            tries = 0
5400            while True:
5401                try:
5402                    plumbing_response = svc.stub.List(
5403                        req,
5404                        metadata=svc.parent.get_metadata(
5405                            'SecretStores.List', req),
5406                        timeout=timeout)
5407                except Exception as e:
5408                    if self.parent.shouldRetry(tries, e):
5409                        tries += 1
5410                        self.parent.jitterSleep(tries)
5411                        continue
5412                    raise plumbing.convert_error_to_porcelain(e) from e
5413                tries = 0
5414                for plumbing_item in plumbing_response.secret_stores:
5415                    yield plumbing.convert_secret_store_to_porcelain(
5416                        plumbing_item)
5417                if plumbing_response.meta.next_cursor == '':
5418                    break
5419                req.meta.cursor = plumbing_response.meta.next_cursor
5420
5421        return generator(self, req)

List gets a list of SecretStores matching a given set of criteria.

class SnapshotSecretStores:
5424class SnapshotSecretStores:
5425    '''
5426    SnapshotSecretStores exposes the read only methods of the SecretStores
5427    service for historical queries.
5428    '''
5429    def __init__(self, secret_stores):
5430        self.secret_stores = secret_stores
5431
5432    def get(self, id, timeout=None):
5433        '''
5434         Get reads one SecretStore by ID.
5435        '''
5436        return self.secret_stores.get(id, timeout=timeout)
5437
5438    def list(self, filter, *args, timeout=None):
5439        '''
5440         List gets a list of SecretStores matching a given set of criteria.
5441        '''
5442        return self.secret_stores.list(filter, *args, timeout=timeout)

SnapshotSecretStores exposes the read only methods of the SecretStores service for historical queries.

SnapshotSecretStores(secret_stores)
5429    def __init__(self, secret_stores):
5430        self.secret_stores = secret_stores
def get(self, id, timeout=None)
5432    def get(self, id, timeout=None):
5433        '''
5434         Get reads one SecretStore by ID.
5435        '''
5436        return self.secret_stores.get(id, timeout=timeout)

Get reads one SecretStore by ID.

def list(self, filter, *args, timeout=None)
5438    def list(self, filter, *args, timeout=None):
5439        '''
5440         List gets a list of SecretStores matching a given set of criteria.
5441        '''
5442        return self.secret_stores.list(filter, *args, timeout=timeout)

List gets a list of SecretStores matching a given set of criteria.

class SecretStoreHealths:
5445class SecretStoreHealths:
5446    '''
5447     SecretStoreHealths exposes health states for secret stores.
5448    See `strongdm.models.SecretStoreHealth`.
5449    '''
5450    def __init__(self, channel, client):
5451        self.parent = client
5452        self.stub = SecretStoreHealthsStub(channel)
5453
5454    def list(self, filter, *args, timeout=None):
5455        '''
5456         List reports the health status of node to secret store pairs.
5457        '''
5458        req = SecretStoreHealthListRequest()
5459        req.meta.CopyFrom(ListRequestMetadata())
5460        if self.parent.page_limit > 0:
5461            req.meta.limit = self.parent.page_limit
5462        if self.parent.snapshot_datetime is not None:
5463            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5464
5465        req.filter = plumbing.quote_filter_args(filter, *args)
5466
5467        def generator(svc, req):
5468            tries = 0
5469            while True:
5470                try:
5471                    plumbing_response = svc.stub.List(
5472                        req,
5473                        metadata=svc.parent.get_metadata(
5474                            'SecretStoreHealths.List', req),
5475                        timeout=timeout)
5476                except Exception as e:
5477                    if self.parent.shouldRetry(tries, e):
5478                        tries += 1
5479                        self.parent.jitterSleep(tries)
5480                        continue
5481                    raise plumbing.convert_error_to_porcelain(e) from e
5482                tries = 0
5483                for plumbing_item in plumbing_response.secret_store_healths:
5484                    yield plumbing.convert_secret_store_health_to_porcelain(
5485                        plumbing_item)
5486                if plumbing_response.meta.next_cursor == '':
5487                    break
5488                req.meta.cursor = plumbing_response.meta.next_cursor
5489
5490        return generator(self, req)
5491
5492    def healthcheck(self, secret_store_id, timeout=None):
5493        '''
5494         Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
5495         to propagate across a large network of Nodes. The call will return immediately, and the
5496         updated health of the Secret Store can be retrieved via List.
5497        '''
5498        req = SecretStoreHealthcheckRequest()
5499
5500        req.secret_store_id = (secret_store_id)
5501        tries = 0
5502        plumbing_response = None
5503        while True:
5504            try:
5505                plumbing_response = self.stub.Healthcheck(
5506                    req,
5507                    metadata=self.parent.get_metadata(
5508                        'SecretStoreHealths.Healthcheck', req),
5509                    timeout=timeout)
5510            except Exception as e:
5511                if self.parent.shouldRetry(tries, e):
5512                    tries += 1
5513                    self.parent.jitterSleep(tries)
5514                    continue
5515                raise plumbing.convert_error_to_porcelain(e) from e
5516            break
5517
5518        resp = models.SecretStoreHealthcheckResponse()
5519        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5520            plumbing_response.rate_limit)
5521        return resp

SecretStoreHealths exposes health states for secret stores. See strongdm.models.SecretStoreHealth.

SecretStoreHealths(channel, client)
5450    def __init__(self, channel, client):
5451        self.parent = client
5452        self.stub = SecretStoreHealthsStub(channel)
def list(self, filter, *args, timeout=None)
5454    def list(self, filter, *args, timeout=None):
5455        '''
5456         List reports the health status of node to secret store pairs.
5457        '''
5458        req = SecretStoreHealthListRequest()
5459        req.meta.CopyFrom(ListRequestMetadata())
5460        if self.parent.page_limit > 0:
5461            req.meta.limit = self.parent.page_limit
5462        if self.parent.snapshot_datetime is not None:
5463            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5464
5465        req.filter = plumbing.quote_filter_args(filter, *args)
5466
5467        def generator(svc, req):
5468            tries = 0
5469            while True:
5470                try:
5471                    plumbing_response = svc.stub.List(
5472                        req,
5473                        metadata=svc.parent.get_metadata(
5474                            'SecretStoreHealths.List', req),
5475                        timeout=timeout)
5476                except Exception as e:
5477                    if self.parent.shouldRetry(tries, e):
5478                        tries += 1
5479                        self.parent.jitterSleep(tries)
5480                        continue
5481                    raise plumbing.convert_error_to_porcelain(e) from e
5482                tries = 0
5483                for plumbing_item in plumbing_response.secret_store_healths:
5484                    yield plumbing.convert_secret_store_health_to_porcelain(
5485                        plumbing_item)
5486                if plumbing_response.meta.next_cursor == '':
5487                    break
5488                req.meta.cursor = plumbing_response.meta.next_cursor
5489
5490        return generator(self, req)

List reports the health status of node to secret store pairs.

def healthcheck(self, secret_store_id, timeout=None)
5492    def healthcheck(self, secret_store_id, timeout=None):
5493        '''
5494         Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
5495         to propagate across a large network of Nodes. The call will return immediately, and the
5496         updated health of the Secret Store can be retrieved via List.
5497        '''
5498        req = SecretStoreHealthcheckRequest()
5499
5500        req.secret_store_id = (secret_store_id)
5501        tries = 0
5502        plumbing_response = None
5503        while True:
5504            try:
5505                plumbing_response = self.stub.Healthcheck(
5506                    req,
5507                    metadata=self.parent.get_metadata(
5508                        'SecretStoreHealths.Healthcheck', req),
5509                    timeout=timeout)
5510            except Exception as e:
5511                if self.parent.shouldRetry(tries, e):
5512                    tries += 1
5513                    self.parent.jitterSleep(tries)
5514                    continue
5515                raise plumbing.convert_error_to_porcelain(e) from e
5516            break
5517
5518        resp = models.SecretStoreHealthcheckResponse()
5519        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5520            plumbing_response.rate_limit)
5521        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.

class SecretStoresHistory:
5524class SecretStoresHistory:
5525    '''
5526     SecretStoresHistory records all changes to the state of a SecretStore.
5527    See `strongdm.models.SecretStoreHistory`.
5528    '''
5529    def __init__(self, channel, client):
5530        self.parent = client
5531        self.stub = SecretStoresHistoryStub(channel)
5532
5533    def list(self, filter, *args, timeout=None):
5534        '''
5535         List gets a list of SecretStoreHistory records matching a given set of criteria.
5536        '''
5537        req = SecretStoreHistoryListRequest()
5538        req.meta.CopyFrom(ListRequestMetadata())
5539        if self.parent.page_limit > 0:
5540            req.meta.limit = self.parent.page_limit
5541        if self.parent.snapshot_datetime is not None:
5542            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5543
5544        req.filter = plumbing.quote_filter_args(filter, *args)
5545
5546        def generator(svc, req):
5547            tries = 0
5548            while True:
5549                try:
5550                    plumbing_response = svc.stub.List(
5551                        req,
5552                        metadata=svc.parent.get_metadata(
5553                            'SecretStoresHistory.List', req),
5554                        timeout=timeout)
5555                except Exception as e:
5556                    if self.parent.shouldRetry(tries, e):
5557                        tries += 1
5558                        self.parent.jitterSleep(tries)
5559                        continue
5560                    raise plumbing.convert_error_to_porcelain(e) from e
5561                tries = 0
5562                for plumbing_item in plumbing_response.history:
5563                    yield plumbing.convert_secret_store_history_to_porcelain(
5564                        plumbing_item)
5565                if plumbing_response.meta.next_cursor == '':
5566                    break
5567                req.meta.cursor = plumbing_response.meta.next_cursor
5568
5569        return generator(self, req)

SecretStoresHistory records all changes to the state of a SecretStore. See strongdm.models.SecretStoreHistory.

SecretStoresHistory(channel, client)
5529    def __init__(self, channel, client):
5530        self.parent = client
5531        self.stub = SecretStoresHistoryStub(channel)
def list(self, filter, *args, timeout=None)
5533    def list(self, filter, *args, timeout=None):
5534        '''
5535         List gets a list of SecretStoreHistory records matching a given set of criteria.
5536        '''
5537        req = SecretStoreHistoryListRequest()
5538        req.meta.CopyFrom(ListRequestMetadata())
5539        if self.parent.page_limit > 0:
5540            req.meta.limit = self.parent.page_limit
5541        if self.parent.snapshot_datetime is not None:
5542            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5543
5544        req.filter = plumbing.quote_filter_args(filter, *args)
5545
5546        def generator(svc, req):
5547            tries = 0
5548            while True:
5549                try:
5550                    plumbing_response = svc.stub.List(
5551                        req,
5552                        metadata=svc.parent.get_metadata(
5553                            'SecretStoresHistory.List', req),
5554                        timeout=timeout)
5555                except Exception as e:
5556                    if self.parent.shouldRetry(tries, e):
5557                        tries += 1
5558                        self.parent.jitterSleep(tries)
5559                        continue
5560                    raise plumbing.convert_error_to_porcelain(e) from e
5561                tries = 0
5562                for plumbing_item in plumbing_response.history:
5563                    yield plumbing.convert_secret_store_history_to_porcelain(
5564                        plumbing_item)
5565                if plumbing_response.meta.next_cursor == '':
5566                    break
5567                req.meta.cursor = plumbing_response.meta.next_cursor
5568
5569        return generator(self, req)

List gets a list of SecretStoreHistory records matching a given set of criteria.

class WorkflowApprovers:
5572class WorkflowApprovers:
5573    '''
5574     WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow.
5575    See `strongdm.models.WorkflowApprover`.
5576    '''
5577    def __init__(self, channel, client):
5578        self.parent = client
5579        self.stub = WorkflowApproversStub(channel)
5580
5581    def create(self, workflow_approver, timeout=None):
5582        '''
5583         Create creates a new workflow approver
5584        '''
5585        req = WorkflowApproversCreateRequest()
5586
5587        if workflow_approver is not None:
5588            req.workflow_approver.CopyFrom(
5589                plumbing.convert_workflow_approver_to_plumbing(
5590                    workflow_approver))
5591        tries = 0
5592        plumbing_response = None
5593        while True:
5594            try:
5595                plumbing_response = self.stub.Create(
5596                    req,
5597                    metadata=self.parent.get_metadata(
5598                        'WorkflowApprovers.Create', req),
5599                    timeout=timeout)
5600            except Exception as e:
5601                if self.parent.shouldRetry(tries, e):
5602                    tries += 1
5603                    self.parent.jitterSleep(tries)
5604                    continue
5605                raise plumbing.convert_error_to_porcelain(e) from e
5606            break
5607
5608        resp = models.WorkflowApproversCreateResponse()
5609        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5610            plumbing_response.rate_limit)
5611        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5612            plumbing_response.workflow_approver)
5613        return resp
5614
5615    def get(self, id, timeout=None):
5616        '''
5617         Get reads one workflow approver by ID.
5618        '''
5619        req = WorkflowApproverGetRequest()
5620        if self.parent.snapshot_datetime is not None:
5621            req.meta.CopyFrom(GetRequestMetadata())
5622            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5623
5624        req.id = (id)
5625        tries = 0
5626        plumbing_response = None
5627        while True:
5628            try:
5629                plumbing_response = self.stub.Get(
5630                    req,
5631                    metadata=self.parent.get_metadata('WorkflowApprovers.Get',
5632                                                      req),
5633                    timeout=timeout)
5634            except Exception as e:
5635                if self.parent.shouldRetry(tries, e):
5636                    tries += 1
5637                    self.parent.jitterSleep(tries)
5638                    continue
5639                raise plumbing.convert_error_to_porcelain(e) from e
5640            break
5641
5642        resp = models.WorkflowApproverGetResponse()
5643        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5644            plumbing_response.meta)
5645        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5646            plumbing_response.rate_limit)
5647        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5648            plumbing_response.workflow_approver)
5649        return resp
5650
5651    def delete(self, id, timeout=None):
5652        '''
5653         Delete deletes a workflow approver
5654        '''
5655        req = WorkflowApproversDeleteRequest()
5656
5657        req.id = (id)
5658        tries = 0
5659        plumbing_response = None
5660        while True:
5661            try:
5662                plumbing_response = self.stub.Delete(
5663                    req,
5664                    metadata=self.parent.get_metadata(
5665                        'WorkflowApprovers.Delete', req),
5666                    timeout=timeout)
5667            except Exception as e:
5668                if self.parent.shouldRetry(tries, e):
5669                    tries += 1
5670                    self.parent.jitterSleep(tries)
5671                    continue
5672                raise plumbing.convert_error_to_porcelain(e) from e
5673            break
5674
5675        resp = models.WorkflowApproversDeleteResponse()
5676        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5677            plumbing_response.rate_limit)
5678        return resp
5679
5680    def list(self, filter, *args, timeout=None):
5681        '''
5682         Lists existing workflow approvers.
5683        '''
5684        req = WorkflowApproversListRequest()
5685        req.meta.CopyFrom(ListRequestMetadata())
5686        if self.parent.page_limit > 0:
5687            req.meta.limit = self.parent.page_limit
5688        if self.parent.snapshot_datetime is not None:
5689            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5690
5691        req.filter = plumbing.quote_filter_args(filter, *args)
5692
5693        def generator(svc, req):
5694            tries = 0
5695            while True:
5696                try:
5697                    plumbing_response = svc.stub.List(
5698                        req,
5699                        metadata=svc.parent.get_metadata(
5700                            'WorkflowApprovers.List', req),
5701                        timeout=timeout)
5702                except Exception as e:
5703                    if self.parent.shouldRetry(tries, e):
5704                        tries += 1
5705                        self.parent.jitterSleep(tries)
5706                        continue
5707                    raise plumbing.convert_error_to_porcelain(e) from e
5708                tries = 0
5709                for plumbing_item in plumbing_response.workflow_approvers:
5710                    yield plumbing.convert_workflow_approver_to_porcelain(
5711                        plumbing_item)
5712                if plumbing_response.meta.next_cursor == '':
5713                    break
5714                req.meta.cursor = plumbing_response.meta.next_cursor
5715
5716        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.

WorkflowApprovers(channel, client)
5577    def __init__(self, channel, client):
5578        self.parent = client
5579        self.stub = WorkflowApproversStub(channel)
def create(self, workflow_approver, timeout=None)
5581    def create(self, workflow_approver, timeout=None):
5582        '''
5583         Create creates a new workflow approver
5584        '''
5585        req = WorkflowApproversCreateRequest()
5586
5587        if workflow_approver is not None:
5588            req.workflow_approver.CopyFrom(
5589                plumbing.convert_workflow_approver_to_plumbing(
5590                    workflow_approver))
5591        tries = 0
5592        plumbing_response = None
5593        while True:
5594            try:
5595                plumbing_response = self.stub.Create(
5596                    req,
5597                    metadata=self.parent.get_metadata(
5598                        'WorkflowApprovers.Create', req),
5599                    timeout=timeout)
5600            except Exception as e:
5601                if self.parent.shouldRetry(tries, e):
5602                    tries += 1
5603                    self.parent.jitterSleep(tries)
5604                    continue
5605                raise plumbing.convert_error_to_porcelain(e) from e
5606            break
5607
5608        resp = models.WorkflowApproversCreateResponse()
5609        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5610            plumbing_response.rate_limit)
5611        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5612            plumbing_response.workflow_approver)
5613        return resp

Create creates a new workflow approver

def get(self, id, timeout=None)
5615    def get(self, id, timeout=None):
5616        '''
5617         Get reads one workflow approver by ID.
5618        '''
5619        req = WorkflowApproverGetRequest()
5620        if self.parent.snapshot_datetime is not None:
5621            req.meta.CopyFrom(GetRequestMetadata())
5622            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5623
5624        req.id = (id)
5625        tries = 0
5626        plumbing_response = None
5627        while True:
5628            try:
5629                plumbing_response = self.stub.Get(
5630                    req,
5631                    metadata=self.parent.get_metadata('WorkflowApprovers.Get',
5632                                                      req),
5633                    timeout=timeout)
5634            except Exception as e:
5635                if self.parent.shouldRetry(tries, e):
5636                    tries += 1
5637                    self.parent.jitterSleep(tries)
5638                    continue
5639                raise plumbing.convert_error_to_porcelain(e) from e
5640            break
5641
5642        resp = models.WorkflowApproverGetResponse()
5643        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5644            plumbing_response.meta)
5645        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5646            plumbing_response.rate_limit)
5647        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5648            plumbing_response.workflow_approver)
5649        return resp

Get reads one workflow approver by ID.

def delete(self, id, timeout=None)
5651    def delete(self, id, timeout=None):
5652        '''
5653         Delete deletes a workflow approver
5654        '''
5655        req = WorkflowApproversDeleteRequest()
5656
5657        req.id = (id)
5658        tries = 0
5659        plumbing_response = None
5660        while True:
5661            try:
5662                plumbing_response = self.stub.Delete(
5663                    req,
5664                    metadata=self.parent.get_metadata(
5665                        'WorkflowApprovers.Delete', req),
5666                    timeout=timeout)
5667            except Exception as e:
5668                if self.parent.shouldRetry(tries, e):
5669                    tries += 1
5670                    self.parent.jitterSleep(tries)
5671                    continue
5672                raise plumbing.convert_error_to_porcelain(e) from e
5673            break
5674
5675        resp = models.WorkflowApproversDeleteResponse()
5676        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5677            plumbing_response.rate_limit)
5678        return resp

Delete deletes a workflow approver

def list(self, filter, *args, timeout=None)
5680    def list(self, filter, *args, timeout=None):
5681        '''
5682         Lists existing workflow approvers.
5683        '''
5684        req = WorkflowApproversListRequest()
5685        req.meta.CopyFrom(ListRequestMetadata())
5686        if self.parent.page_limit > 0:
5687            req.meta.limit = self.parent.page_limit
5688        if self.parent.snapshot_datetime is not None:
5689            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5690
5691        req.filter = plumbing.quote_filter_args(filter, *args)
5692
5693        def generator(svc, req):
5694            tries = 0
5695            while True:
5696                try:
5697                    plumbing_response = svc.stub.List(
5698                        req,
5699                        metadata=svc.parent.get_metadata(
5700                            'WorkflowApprovers.List', req),
5701                        timeout=timeout)
5702                except Exception as e:
5703                    if self.parent.shouldRetry(tries, e):
5704                        tries += 1
5705                        self.parent.jitterSleep(tries)
5706                        continue
5707                    raise plumbing.convert_error_to_porcelain(e) from e
5708                tries = 0
5709                for plumbing_item in plumbing_response.workflow_approvers:
5710                    yield plumbing.convert_workflow_approver_to_porcelain(
5711                        plumbing_item)
5712                if plumbing_response.meta.next_cursor == '':
5713                    break
5714                req.meta.cursor = plumbing_response.meta.next_cursor
5715
5716        return generator(self, req)

Lists existing workflow approvers.

class SnapshotWorkflowApprovers:
5719class SnapshotWorkflowApprovers:
5720    '''
5721    SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers
5722    service for historical queries.
5723    '''
5724    def __init__(self, workflow_approvers):
5725        self.workflow_approvers = workflow_approvers
5726
5727    def get(self, id, timeout=None):
5728        '''
5729         Get reads one workflow approver by ID.
5730        '''
5731        return self.workflow_approvers.get(id, timeout=timeout)
5732
5733    def list(self, filter, *args, timeout=None):
5734        '''
5735         Lists existing workflow approvers.
5736        '''
5737        return self.workflow_approvers.list(filter, *args, timeout=timeout)

SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers service for historical queries.

SnapshotWorkflowApprovers(workflow_approvers)
5724    def __init__(self, workflow_approvers):
5725        self.workflow_approvers = workflow_approvers
def get(self, id, timeout=None)
5727    def get(self, id, timeout=None):
5728        '''
5729         Get reads one workflow approver by ID.
5730        '''
5731        return self.workflow_approvers.get(id, timeout=timeout)

Get reads one workflow approver by ID.

def list(self, filter, *args, timeout=None)
5733    def list(self, filter, *args, timeout=None):
5734        '''
5735         Lists existing workflow approvers.
5736        '''
5737        return self.workflow_approvers.list(filter, *args, timeout=timeout)

Lists existing workflow approvers.

class WorkflowApproversHistory:
5740class WorkflowApproversHistory:
5741    '''
5742     WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover.
5743    See `strongdm.models.WorkflowApproverHistory`.
5744    '''
5745    def __init__(self, channel, client):
5746        self.parent = client
5747        self.stub = WorkflowApproversHistoryStub(channel)
5748
5749    def list(self, filter, *args, timeout=None):
5750        '''
5751         List gets a list of WorkflowApproversHistory records matching a given set of criteria.
5752        '''
5753        req = WorkflowApproversHistoryListRequest()
5754        req.meta.CopyFrom(ListRequestMetadata())
5755        if self.parent.page_limit > 0:
5756            req.meta.limit = self.parent.page_limit
5757        if self.parent.snapshot_datetime is not None:
5758            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5759
5760        req.filter = plumbing.quote_filter_args(filter, *args)
5761
5762        def generator(svc, req):
5763            tries = 0
5764            while True:
5765                try:
5766                    plumbing_response = svc.stub.List(
5767                        req,
5768                        metadata=svc.parent.get_metadata(
5769                            'WorkflowApproversHistory.List', req),
5770                        timeout=timeout)
5771                except Exception as e:
5772                    if self.parent.shouldRetry(tries, e):
5773                        tries += 1
5774                        self.parent.jitterSleep(tries)
5775                        continue
5776                    raise plumbing.convert_error_to_porcelain(e) from e
5777                tries = 0
5778                for plumbing_item in plumbing_response.history:
5779                    yield plumbing.convert_workflow_approver_history_to_porcelain(
5780                        plumbing_item)
5781                if plumbing_response.meta.next_cursor == '':
5782                    break
5783                req.meta.cursor = plumbing_response.meta.next_cursor
5784
5785        return generator(self, req)

WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover. See strongdm.models.WorkflowApproverHistory.

WorkflowApproversHistory(channel, client)
5745    def __init__(self, channel, client):
5746        self.parent = client
5747        self.stub = WorkflowApproversHistoryStub(channel)
def list(self, filter, *args, timeout=None)
5749    def list(self, filter, *args, timeout=None):
5750        '''
5751         List gets a list of WorkflowApproversHistory records matching a given set of criteria.
5752        '''
5753        req = WorkflowApproversHistoryListRequest()
5754        req.meta.CopyFrom(ListRequestMetadata())
5755        if self.parent.page_limit > 0:
5756            req.meta.limit = self.parent.page_limit
5757        if self.parent.snapshot_datetime is not None:
5758            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5759
5760        req.filter = plumbing.quote_filter_args(filter, *args)
5761
5762        def generator(svc, req):
5763            tries = 0
5764            while True:
5765                try:
5766                    plumbing_response = svc.stub.List(
5767                        req,
5768                        metadata=svc.parent.get_metadata(
5769                            'WorkflowApproversHistory.List', req),
5770                        timeout=timeout)
5771                except Exception as e:
5772                    if self.parent.shouldRetry(tries, e):
5773                        tries += 1
5774                        self.parent.jitterSleep(tries)
5775                        continue
5776                    raise plumbing.convert_error_to_porcelain(e) from e
5777                tries = 0
5778                for plumbing_item in plumbing_response.history:
5779                    yield plumbing.convert_workflow_approver_history_to_porcelain(
5780                        plumbing_item)
5781                if plumbing_response.meta.next_cursor == '':
5782                    break
5783                req.meta.cursor = plumbing_response.meta.next_cursor
5784
5785        return generator(self, req)

List gets a list of WorkflowApproversHistory records matching a given set of criteria.

class WorkflowAssignments:
5788class WorkflowAssignments:
5789    '''
5790     WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request
5791     access to via the workflow.
5792    See `strongdm.models.WorkflowAssignment`.
5793    '''
5794    def __init__(self, channel, client):
5795        self.parent = client
5796        self.stub = WorkflowAssignmentsStub(channel)
5797
5798    def list(self, filter, *args, timeout=None):
5799        '''
5800         Lists existing workflow assignments.
5801        '''
5802        req = WorkflowAssignmentsListRequest()
5803        req.meta.CopyFrom(ListRequestMetadata())
5804        if self.parent.page_limit > 0:
5805            req.meta.limit = self.parent.page_limit
5806        if self.parent.snapshot_datetime is not None:
5807            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5808
5809        req.filter = plumbing.quote_filter_args(filter, *args)
5810
5811        def generator(svc, req):
5812            tries = 0
5813            while True:
5814                try:
5815                    plumbing_response = svc.stub.List(
5816                        req,
5817                        metadata=svc.parent.get_metadata(
5818                            'WorkflowAssignments.List', req),
5819                        timeout=timeout)
5820                except Exception as e:
5821                    if self.parent.shouldRetry(tries, e):
5822                        tries += 1
5823                        self.parent.jitterSleep(tries)
5824                        continue
5825                    raise plumbing.convert_error_to_porcelain(e) from e
5826                tries = 0
5827                for plumbing_item in plumbing_response.workflow_assignments:
5828                    yield plumbing.convert_workflow_assignment_to_porcelain(
5829                        plumbing_item)
5830                if plumbing_response.meta.next_cursor == '':
5831                    break
5832                req.meta.cursor = plumbing_response.meta.next_cursor
5833
5834        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.

WorkflowAssignments(channel, client)
5794    def __init__(self, channel, client):
5795        self.parent = client
5796        self.stub = WorkflowAssignmentsStub(channel)
def list(self, filter, *args, timeout=None)
5798    def list(self, filter, *args, timeout=None):
5799        '''
5800         Lists existing workflow assignments.
5801        '''
5802        req = WorkflowAssignmentsListRequest()
5803        req.meta.CopyFrom(ListRequestMetadata())
5804        if self.parent.page_limit > 0:
5805            req.meta.limit = self.parent.page_limit
5806        if self.parent.snapshot_datetime is not None:
5807            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5808
5809        req.filter = plumbing.quote_filter_args(filter, *args)
5810
5811        def generator(svc, req):
5812            tries = 0
5813            while True:
5814                try:
5815                    plumbing_response = svc.stub.List(
5816                        req,
5817                        metadata=svc.parent.get_metadata(
5818                            'WorkflowAssignments.List', req),
5819                        timeout=timeout)
5820                except Exception as e:
5821                    if self.parent.shouldRetry(tries, e):
5822                        tries += 1
5823                        self.parent.jitterSleep(tries)
5824                        continue
5825                    raise plumbing.convert_error_to_porcelain(e) from e
5826                tries = 0
5827                for plumbing_item in plumbing_response.workflow_assignments:
5828                    yield plumbing.convert_workflow_assignment_to_porcelain(
5829                        plumbing_item)
5830                if plumbing_response.meta.next_cursor == '':
5831                    break
5832                req.meta.cursor = plumbing_response.meta.next_cursor
5833
5834        return generator(self, req)

Lists existing workflow assignments.

class SnapshotWorkflowAssignments:
5837class SnapshotWorkflowAssignments:
5838    '''
5839    SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments
5840    service for historical queries.
5841    '''
5842    def __init__(self, workflow_assignments):
5843        self.workflow_assignments = workflow_assignments
5844
5845    def list(self, filter, *args, timeout=None):
5846        '''
5847         Lists existing workflow assignments.
5848        '''
5849        return self.workflow_assignments.list(filter, *args, timeout=timeout)

SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments service for historical queries.

SnapshotWorkflowAssignments(workflow_assignments)
5842    def __init__(self, workflow_assignments):
5843        self.workflow_assignments = workflow_assignments
def list(self, filter, *args, timeout=None)
5845    def list(self, filter, *args, timeout=None):
5846        '''
5847         Lists existing workflow assignments.
5848        '''
5849        return self.workflow_assignments.list(filter, *args, timeout=timeout)

Lists existing workflow assignments.

class WorkflowAssignmentsHistory:
5852class WorkflowAssignmentsHistory:
5853    '''
5854     WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment.
5855    See `strongdm.models.WorkflowAssignmentHistory`.
5856    '''
5857    def __init__(self, channel, client):
5858        self.parent = client
5859        self.stub = WorkflowAssignmentsHistoryStub(channel)
5860
5861    def list(self, filter, *args, timeout=None):
5862        '''
5863         List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.
5864        '''
5865        req = WorkflowAssignmentsHistoryListRequest()
5866        req.meta.CopyFrom(ListRequestMetadata())
5867        if self.parent.page_limit > 0:
5868            req.meta.limit = self.parent.page_limit
5869        if self.parent.snapshot_datetime is not None:
5870            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5871
5872        req.filter = plumbing.quote_filter_args(filter, *args)
5873
5874        def generator(svc, req):
5875            tries = 0
5876            while True:
5877                try:
5878                    plumbing_response = svc.stub.List(
5879                        req,
5880                        metadata=svc.parent.get_metadata(
5881                            'WorkflowAssignmentsHistory.List', req),
5882                        timeout=timeout)
5883                except Exception as e:
5884                    if self.parent.shouldRetry(tries, e):
5885                        tries += 1
5886                        self.parent.jitterSleep(tries)
5887                        continue
5888                    raise plumbing.convert_error_to_porcelain(e) from e
5889                tries = 0
5890                for plumbing_item in plumbing_response.history:
5891                    yield plumbing.convert_workflow_assignment_history_to_porcelain(
5892                        plumbing_item)
5893                if plumbing_response.meta.next_cursor == '':
5894                    break
5895                req.meta.cursor = plumbing_response.meta.next_cursor
5896
5897        return generator(self, req)

WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment. See strongdm.models.WorkflowAssignmentHistory.

WorkflowAssignmentsHistory(channel, client)
5857    def __init__(self, channel, client):
5858        self.parent = client
5859        self.stub = WorkflowAssignmentsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
5861    def list(self, filter, *args, timeout=None):
5862        '''
5863         List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.
5864        '''
5865        req = WorkflowAssignmentsHistoryListRequest()
5866        req.meta.CopyFrom(ListRequestMetadata())
5867        if self.parent.page_limit > 0:
5868            req.meta.limit = self.parent.page_limit
5869        if self.parent.snapshot_datetime is not None:
5870            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5871
5872        req.filter = plumbing.quote_filter_args(filter, *args)
5873
5874        def generator(svc, req):
5875            tries = 0
5876            while True:
5877                try:
5878                    plumbing_response = svc.stub.List(
5879                        req,
5880                        metadata=svc.parent.get_metadata(
5881                            'WorkflowAssignmentsHistory.List', req),
5882                        timeout=timeout)
5883                except Exception as e:
5884                    if self.parent.shouldRetry(tries, e):
5885                        tries += 1
5886                        self.parent.jitterSleep(tries)
5887                        continue
5888                    raise plumbing.convert_error_to_porcelain(e) from e
5889                tries = 0
5890                for plumbing_item in plumbing_response.history:
5891                    yield plumbing.convert_workflow_assignment_history_to_porcelain(
5892                        plumbing_item)
5893                if plumbing_response.meta.next_cursor == '':
5894                    break
5895                req.meta.cursor = plumbing_response.meta.next_cursor
5896
5897        return generator(self, req)

List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.

class WorkflowRoles:
5900class WorkflowRoles:
5901    '''
5902     WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
5903     to request access to a resource via the workflow.
5904    See `strongdm.models.WorkflowRole`.
5905    '''
5906    def __init__(self, channel, client):
5907        self.parent = client
5908        self.stub = WorkflowRolesStub(channel)
5909
5910    def create(self, workflow_role, timeout=None):
5911        '''
5912         Create creates a new workflow role
5913        '''
5914        req = WorkflowRolesCreateRequest()
5915
5916        if workflow_role is not None:
5917            req.workflow_role.CopyFrom(
5918                plumbing.convert_workflow_role_to_plumbing(workflow_role))
5919        tries = 0
5920        plumbing_response = None
5921        while True:
5922            try:
5923                plumbing_response = self.stub.Create(
5924                    req,
5925                    metadata=self.parent.get_metadata('WorkflowRoles.Create',
5926                                                      req),
5927                    timeout=timeout)
5928            except Exception as e:
5929                if self.parent.shouldRetry(tries, e):
5930                    tries += 1
5931                    self.parent.jitterSleep(tries)
5932                    continue
5933                raise plumbing.convert_error_to_porcelain(e) from e
5934            break
5935
5936        resp = models.WorkflowRolesCreateResponse()
5937        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5938            plumbing_response.rate_limit)
5939        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5940            plumbing_response.workflow_role)
5941        return resp
5942
5943    def get(self, id, timeout=None):
5944        '''
5945         Get reads one workflow role by ID.
5946        '''
5947        req = WorkflowRoleGetRequest()
5948        if self.parent.snapshot_datetime is not None:
5949            req.meta.CopyFrom(GetRequestMetadata())
5950            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5951
5952        req.id = (id)
5953        tries = 0
5954        plumbing_response = None
5955        while True:
5956            try:
5957                plumbing_response = self.stub.Get(
5958                    req,
5959                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
5960                                                      req),
5961                    timeout=timeout)
5962            except Exception as e:
5963                if self.parent.shouldRetry(tries, e):
5964                    tries += 1
5965                    self.parent.jitterSleep(tries)
5966                    continue
5967                raise plumbing.convert_error_to_porcelain(e) from e
5968            break
5969
5970        resp = models.WorkflowRoleGetResponse()
5971        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5972            plumbing_response.meta)
5973        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5974            plumbing_response.rate_limit)
5975        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5976            plumbing_response.workflow_role)
5977        return resp
5978
5979    def delete(self, id, timeout=None):
5980        '''
5981         Delete deletes a workflow role
5982        '''
5983        req = WorkflowRolesDeleteRequest()
5984
5985        req.id = (id)
5986        tries = 0
5987        plumbing_response = None
5988        while True:
5989            try:
5990                plumbing_response = self.stub.Delete(
5991                    req,
5992                    metadata=self.parent.get_metadata('WorkflowRoles.Delete',
5993                                                      req),
5994                    timeout=timeout)
5995            except Exception as e:
5996                if self.parent.shouldRetry(tries, e):
5997                    tries += 1
5998                    self.parent.jitterSleep(tries)
5999                    continue
6000                raise plumbing.convert_error_to_porcelain(e) from e
6001            break
6002
6003        resp = models.WorkflowRolesDeleteResponse()
6004        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6005            plumbing_response.rate_limit)
6006        return resp
6007
6008    def list(self, filter, *args, timeout=None):
6009        '''
6010         Lists existing workflow roles.
6011        '''
6012        req = WorkflowRolesListRequest()
6013        req.meta.CopyFrom(ListRequestMetadata())
6014        if self.parent.page_limit > 0:
6015            req.meta.limit = self.parent.page_limit
6016        if self.parent.snapshot_datetime is not None:
6017            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6018
6019        req.filter = plumbing.quote_filter_args(filter, *args)
6020
6021        def generator(svc, req):
6022            tries = 0
6023            while True:
6024                try:
6025                    plumbing_response = svc.stub.List(
6026                        req,
6027                        metadata=svc.parent.get_metadata(
6028                            'WorkflowRoles.List', req),
6029                        timeout=timeout)
6030                except Exception as e:
6031                    if self.parent.shouldRetry(tries, e):
6032                        tries += 1
6033                        self.parent.jitterSleep(tries)
6034                        continue
6035                    raise plumbing.convert_error_to_porcelain(e) from e
6036                tries = 0
6037                for plumbing_item in plumbing_response.workflow_role:
6038                    yield plumbing.convert_workflow_role_to_porcelain(
6039                        plumbing_item)
6040                if plumbing_response.meta.next_cursor == '':
6041                    break
6042                req.meta.cursor = plumbing_response.meta.next_cursor
6043
6044        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.

WorkflowRoles(channel, client)
5906    def __init__(self, channel, client):
5907        self.parent = client
5908        self.stub = WorkflowRolesStub(channel)
def create(self, workflow_role, timeout=None)
5910    def create(self, workflow_role, timeout=None):
5911        '''
5912         Create creates a new workflow role
5913        '''
5914        req = WorkflowRolesCreateRequest()
5915
5916        if workflow_role is not None:
5917            req.workflow_role.CopyFrom(
5918                plumbing.convert_workflow_role_to_plumbing(workflow_role))
5919        tries = 0
5920        plumbing_response = None
5921        while True:
5922            try:
5923                plumbing_response = self.stub.Create(
5924                    req,
5925                    metadata=self.parent.get_metadata('WorkflowRoles.Create',
5926                                                      req),
5927                    timeout=timeout)
5928            except Exception as e:
5929                if self.parent.shouldRetry(tries, e):
5930                    tries += 1
5931                    self.parent.jitterSleep(tries)
5932                    continue
5933                raise plumbing.convert_error_to_porcelain(e) from e
5934            break
5935
5936        resp = models.WorkflowRolesCreateResponse()
5937        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5938            plumbing_response.rate_limit)
5939        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5940            plumbing_response.workflow_role)
5941        return resp

Create creates a new workflow role

def get(self, id, timeout=None)
5943    def get(self, id, timeout=None):
5944        '''
5945         Get reads one workflow role by ID.
5946        '''
5947        req = WorkflowRoleGetRequest()
5948        if self.parent.snapshot_datetime is not None:
5949            req.meta.CopyFrom(GetRequestMetadata())
5950            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5951
5952        req.id = (id)
5953        tries = 0
5954        plumbing_response = None
5955        while True:
5956            try:
5957                plumbing_response = self.stub.Get(
5958                    req,
5959                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
5960                                                      req),
5961                    timeout=timeout)
5962            except Exception as e:
5963                if self.parent.shouldRetry(tries, e):
5964                    tries += 1
5965                    self.parent.jitterSleep(tries)
5966                    continue
5967                raise plumbing.convert_error_to_porcelain(e) from e
5968            break
5969
5970        resp = models.WorkflowRoleGetResponse()
5971        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5972            plumbing_response.meta)
5973        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5974            plumbing_response.rate_limit)
5975        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5976            plumbing_response.workflow_role)
5977        return resp

Get reads one workflow role by ID.

def delete(self, id, timeout=None)
5979    def delete(self, id, timeout=None):
5980        '''
5981         Delete deletes a workflow role
5982        '''
5983        req = WorkflowRolesDeleteRequest()
5984
5985        req.id = (id)
5986        tries = 0
5987        plumbing_response = None
5988        while True:
5989            try:
5990                plumbing_response = self.stub.Delete(
5991                    req,
5992                    metadata=self.parent.get_metadata('WorkflowRoles.Delete',
5993                                                      req),
5994                    timeout=timeout)
5995            except Exception as e:
5996                if self.parent.shouldRetry(tries, e):
5997                    tries += 1
5998                    self.parent.jitterSleep(tries)
5999                    continue
6000                raise plumbing.convert_error_to_porcelain(e) from e
6001            break
6002
6003        resp = models.WorkflowRolesDeleteResponse()
6004        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6005            plumbing_response.rate_limit)
6006        return resp

Delete deletes a workflow role

def list(self, filter, *args, timeout=None)
6008    def list(self, filter, *args, timeout=None):
6009        '''
6010         Lists existing workflow roles.
6011        '''
6012        req = WorkflowRolesListRequest()
6013        req.meta.CopyFrom(ListRequestMetadata())
6014        if self.parent.page_limit > 0:
6015            req.meta.limit = self.parent.page_limit
6016        if self.parent.snapshot_datetime is not None:
6017            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6018
6019        req.filter = plumbing.quote_filter_args(filter, *args)
6020
6021        def generator(svc, req):
6022            tries = 0
6023            while True:
6024                try:
6025                    plumbing_response = svc.stub.List(
6026                        req,
6027                        metadata=svc.parent.get_metadata(
6028                            'WorkflowRoles.List', req),
6029                        timeout=timeout)
6030                except Exception as e:
6031                    if self.parent.shouldRetry(tries, e):
6032                        tries += 1
6033                        self.parent.jitterSleep(tries)
6034                        continue
6035                    raise plumbing.convert_error_to_porcelain(e) from e
6036                tries = 0
6037                for plumbing_item in plumbing_response.workflow_role:
6038                    yield plumbing.convert_workflow_role_to_porcelain(
6039                        plumbing_item)
6040                if plumbing_response.meta.next_cursor == '':
6041                    break
6042                req.meta.cursor = plumbing_response.meta.next_cursor
6043
6044        return generator(self, req)

Lists existing workflow roles.

class SnapshotWorkflowRoles:
6047class SnapshotWorkflowRoles:
6048    '''
6049    SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles
6050    service for historical queries.
6051    '''
6052    def __init__(self, workflow_roles):
6053        self.workflow_roles = workflow_roles
6054
6055    def get(self, id, timeout=None):
6056        '''
6057         Get reads one workflow role by ID.
6058        '''
6059        return self.workflow_roles.get(id, timeout=timeout)
6060
6061    def list(self, filter, *args, timeout=None):
6062        '''
6063         Lists existing workflow roles.
6064        '''
6065        return self.workflow_roles.list(filter, *args, timeout=timeout)

SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles service for historical queries.

SnapshotWorkflowRoles(workflow_roles)
6052    def __init__(self, workflow_roles):
6053        self.workflow_roles = workflow_roles
def get(self, id, timeout=None)
6055    def get(self, id, timeout=None):
6056        '''
6057         Get reads one workflow role by ID.
6058        '''
6059        return self.workflow_roles.get(id, timeout=timeout)

Get reads one workflow role by ID.

def list(self, filter, *args, timeout=None)
6061    def list(self, filter, *args, timeout=None):
6062        '''
6063         Lists existing workflow roles.
6064        '''
6065        return self.workflow_roles.list(filter, *args, timeout=timeout)

Lists existing workflow roles.

class WorkflowRolesHistory:
6068class WorkflowRolesHistory:
6069    '''
6070     WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole
6071    See `strongdm.models.WorkflowRoleHistory`.
6072    '''
6073    def __init__(self, channel, client):
6074        self.parent = client
6075        self.stub = WorkflowRolesHistoryStub(channel)
6076
6077    def list(self, filter, *args, timeout=None):
6078        '''
6079         List gets a list of WorkflowRolesHistory records matching a given set of criteria.
6080        '''
6081        req = WorkflowRolesHistoryListRequest()
6082        req.meta.CopyFrom(ListRequestMetadata())
6083        if self.parent.page_limit > 0:
6084            req.meta.limit = self.parent.page_limit
6085        if self.parent.snapshot_datetime is not None:
6086            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6087
6088        req.filter = plumbing.quote_filter_args(filter, *args)
6089
6090        def generator(svc, req):
6091            tries = 0
6092            while True:
6093                try:
6094                    plumbing_response = svc.stub.List(
6095                        req,
6096                        metadata=svc.parent.get_metadata(
6097                            'WorkflowRolesHistory.List', req),
6098                        timeout=timeout)
6099                except Exception as e:
6100                    if self.parent.shouldRetry(tries, e):
6101                        tries += 1
6102                        self.parent.jitterSleep(tries)
6103                        continue
6104                    raise plumbing.convert_error_to_porcelain(e) from e
6105                tries = 0
6106                for plumbing_item in plumbing_response.history:
6107                    yield plumbing.convert_workflow_role_history_to_porcelain(
6108                        plumbing_item)
6109                if plumbing_response.meta.next_cursor == '':
6110                    break
6111                req.meta.cursor = plumbing_response.meta.next_cursor
6112
6113        return generator(self, req)

WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole See strongdm.models.WorkflowRoleHistory.

WorkflowRolesHistory(channel, client)
6073    def __init__(self, channel, client):
6074        self.parent = client
6075        self.stub = WorkflowRolesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
6077    def list(self, filter, *args, timeout=None):
6078        '''
6079         List gets a list of WorkflowRolesHistory records matching a given set of criteria.
6080        '''
6081        req = WorkflowRolesHistoryListRequest()
6082        req.meta.CopyFrom(ListRequestMetadata())
6083        if self.parent.page_limit > 0:
6084            req.meta.limit = self.parent.page_limit
6085        if self.parent.snapshot_datetime is not None:
6086            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6087
6088        req.filter = plumbing.quote_filter_args(filter, *args)
6089
6090        def generator(svc, req):
6091            tries = 0
6092            while True:
6093                try:
6094                    plumbing_response = svc.stub.List(
6095                        req,
6096                        metadata=svc.parent.get_metadata(
6097                            'WorkflowRolesHistory.List', req),
6098                        timeout=timeout)
6099                except Exception as e:
6100                    if self.parent.shouldRetry(tries, e):
6101                        tries += 1
6102                        self.parent.jitterSleep(tries)
6103                        continue
6104                    raise plumbing.convert_error_to_porcelain(e) from e
6105                tries = 0
6106                for plumbing_item in plumbing_response.history:
6107                    yield plumbing.convert_workflow_role_history_to_porcelain(
6108                        plumbing_item)
6109                if plumbing_response.meta.next_cursor == '':
6110                    break
6111                req.meta.cursor = plumbing_response.meta.next_cursor
6112
6113        return generator(self, req)

List gets a list of WorkflowRolesHistory records matching a given set of criteria.

class Workflows:
6116class Workflows:
6117    '''
6118     Workflows are the collection of rules that define the resources to which access can be requested,
6119     the users that can request that access, and the mechanism for approving those requests which can either
6120     be automatic approval or a set of users authorized to approve the requests.
6121    See `strongdm.models.Workflow`.
6122    '''
6123    def __init__(self, channel, client):
6124        self.parent = client
6125        self.stub = WorkflowsStub(channel)
6126
6127    def create(self, workflow, timeout=None):
6128        '''
6129         Create creates a new workflow and requires a name for the workflow.
6130        '''
6131        req = WorkflowCreateRequest()
6132
6133        if workflow is not None:
6134            req.workflow.CopyFrom(
6135                plumbing.convert_workflow_to_plumbing(workflow))
6136        tries = 0
6137        plumbing_response = None
6138        while True:
6139            try:
6140                plumbing_response = self.stub.Create(
6141                    req,
6142                    metadata=self.parent.get_metadata('Workflows.Create', req),
6143                    timeout=timeout)
6144            except Exception as e:
6145                if self.parent.shouldRetry(tries, e):
6146                    tries += 1
6147                    self.parent.jitterSleep(tries)
6148                    continue
6149                raise plumbing.convert_error_to_porcelain(e) from e
6150            break
6151
6152        resp = models.WorkflowCreateResponse()
6153        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6154            plumbing_response.rate_limit)
6155        resp.workflow = plumbing.convert_workflow_to_porcelain(
6156            plumbing_response.workflow)
6157        return resp
6158
6159    def get(self, id, timeout=None):
6160        '''
6161         Get reads one workflow by ID.
6162        '''
6163        req = WorkflowGetRequest()
6164        if self.parent.snapshot_datetime is not None:
6165            req.meta.CopyFrom(GetRequestMetadata())
6166            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6167
6168        req.id = (id)
6169        tries = 0
6170        plumbing_response = None
6171        while True:
6172            try:
6173                plumbing_response = self.stub.Get(
6174                    req,
6175                    metadata=self.parent.get_metadata('Workflows.Get', req),
6176                    timeout=timeout)
6177            except Exception as e:
6178                if self.parent.shouldRetry(tries, e):
6179                    tries += 1
6180                    self.parent.jitterSleep(tries)
6181                    continue
6182                raise plumbing.convert_error_to_porcelain(e) from e
6183            break
6184
6185        resp = models.WorkflowGetResponse()
6186        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6187            plumbing_response.meta)
6188        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6189            plumbing_response.rate_limit)
6190        resp.workflow = plumbing.convert_workflow_to_porcelain(
6191            plumbing_response.workflow)
6192        return resp
6193
6194    def delete(self, id, timeout=None):
6195        '''
6196         Delete deletes an existing workflow.
6197        '''
6198        req = WorkflowDeleteRequest()
6199
6200        req.id = (id)
6201        tries = 0
6202        plumbing_response = None
6203        while True:
6204            try:
6205                plumbing_response = self.stub.Delete(
6206                    req,
6207                    metadata=self.parent.get_metadata('Workflows.Delete', req),
6208                    timeout=timeout)
6209            except Exception as e:
6210                if self.parent.shouldRetry(tries, e):
6211                    tries += 1
6212                    self.parent.jitterSleep(tries)
6213                    continue
6214                raise plumbing.convert_error_to_porcelain(e) from e
6215            break
6216
6217        resp = models.WorkflowDeleteResponse()
6218        resp.id = (plumbing_response.id)
6219        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6220            plumbing_response.rate_limit)
6221        return resp
6222
6223    def update(self, workflow, timeout=None):
6224        '''
6225         Update updates an existing workflow.
6226        '''
6227        req = WorkflowUpdateRequest()
6228
6229        if workflow is not None:
6230            req.workflow.CopyFrom(
6231                plumbing.convert_workflow_to_plumbing(workflow))
6232        tries = 0
6233        plumbing_response = None
6234        while True:
6235            try:
6236                plumbing_response = self.stub.Update(
6237                    req,
6238                    metadata=self.parent.get_metadata('Workflows.Update', req),
6239                    timeout=timeout)
6240            except Exception as e:
6241                if self.parent.shouldRetry(tries, e):
6242                    tries += 1
6243                    self.parent.jitterSleep(tries)
6244                    continue
6245                raise plumbing.convert_error_to_porcelain(e) from e
6246            break
6247
6248        resp = models.WorkflowUpdateResponse()
6249        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6250            plumbing_response.rate_limit)
6251        resp.workflow = plumbing.convert_workflow_to_porcelain(
6252            plumbing_response.workflow)
6253        return resp
6254
6255    def list(self, filter, *args, timeout=None):
6256        '''
6257         Lists existing workflows.
6258        '''
6259        req = WorkflowListRequest()
6260        req.meta.CopyFrom(ListRequestMetadata())
6261        if self.parent.page_limit > 0:
6262            req.meta.limit = self.parent.page_limit
6263        if self.parent.snapshot_datetime is not None:
6264            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6265
6266        req.filter = plumbing.quote_filter_args(filter, *args)
6267
6268        def generator(svc, req):
6269            tries = 0
6270            while True:
6271                try:
6272                    plumbing_response = svc.stub.List(
6273                        req,
6274                        metadata=svc.parent.get_metadata(
6275                            'Workflows.List', req),
6276                        timeout=timeout)
6277                except Exception as e:
6278                    if self.parent.shouldRetry(tries, e):
6279                        tries += 1
6280                        self.parent.jitterSleep(tries)
6281                        continue
6282                    raise plumbing.convert_error_to_porcelain(e) from e
6283                tries = 0
6284                for plumbing_item in plumbing_response.workflows:
6285                    yield plumbing.convert_workflow_to_porcelain(plumbing_item)
6286                if plumbing_response.meta.next_cursor == '':
6287                    break
6288                req.meta.cursor = plumbing_response.meta.next_cursor
6289
6290        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.

Workflows(channel, client)
6123    def __init__(self, channel, client):
6124        self.parent = client
6125        self.stub = WorkflowsStub(channel)
def create(self, workflow, timeout=None)
6127    def create(self, workflow, timeout=None):
6128        '''
6129         Create creates a new workflow and requires a name for the workflow.
6130        '''
6131        req = WorkflowCreateRequest()
6132
6133        if workflow is not None:
6134            req.workflow.CopyFrom(
6135                plumbing.convert_workflow_to_plumbing(workflow))
6136        tries = 0
6137        plumbing_response = None
6138        while True:
6139            try:
6140                plumbing_response = self.stub.Create(
6141                    req,
6142                    metadata=self.parent.get_metadata('Workflows.Create', req),
6143                    timeout=timeout)
6144            except Exception as e:
6145                if self.parent.shouldRetry(tries, e):
6146                    tries += 1
6147                    self.parent.jitterSleep(tries)
6148                    continue
6149                raise plumbing.convert_error_to_porcelain(e) from e
6150            break
6151
6152        resp = models.WorkflowCreateResponse()
6153        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6154            plumbing_response.rate_limit)
6155        resp.workflow = plumbing.convert_workflow_to_porcelain(
6156            plumbing_response.workflow)
6157        return resp

Create creates a new workflow and requires a name for the workflow.

def get(self, id, timeout=None)
6159    def get(self, id, timeout=None):
6160        '''
6161         Get reads one workflow by ID.
6162        '''
6163        req = WorkflowGetRequest()
6164        if self.parent.snapshot_datetime is not None:
6165            req.meta.CopyFrom(GetRequestMetadata())
6166            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6167
6168        req.id = (id)
6169        tries = 0
6170        plumbing_response = None
6171        while True:
6172            try:
6173                plumbing_response = self.stub.Get(
6174                    req,
6175                    metadata=self.parent.get_metadata('Workflows.Get', req),
6176                    timeout=timeout)
6177            except Exception as e:
6178                if self.parent.shouldRetry(tries, e):
6179                    tries += 1
6180                    self.parent.jitterSleep(tries)
6181                    continue
6182                raise plumbing.convert_error_to_porcelain(e) from e
6183            break
6184
6185        resp = models.WorkflowGetResponse()
6186        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6187            plumbing_response.meta)
6188        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6189            plumbing_response.rate_limit)
6190        resp.workflow = plumbing.convert_workflow_to_porcelain(
6191            plumbing_response.workflow)
6192        return resp

Get reads one workflow by ID.

def delete(self, id, timeout=None)
6194    def delete(self, id, timeout=None):
6195        '''
6196         Delete deletes an existing workflow.
6197        '''
6198        req = WorkflowDeleteRequest()
6199
6200        req.id = (id)
6201        tries = 0
6202        plumbing_response = None
6203        while True:
6204            try:
6205                plumbing_response = self.stub.Delete(
6206                    req,
6207                    metadata=self.parent.get_metadata('Workflows.Delete', req),
6208                    timeout=timeout)
6209            except Exception as e:
6210                if self.parent.shouldRetry(tries, e):
6211                    tries += 1
6212                    self.parent.jitterSleep(tries)
6213                    continue
6214                raise plumbing.convert_error_to_porcelain(e) from e
6215            break
6216
6217        resp = models.WorkflowDeleteResponse()
6218        resp.id = (plumbing_response.id)
6219        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6220            plumbing_response.rate_limit)
6221        return resp

Delete deletes an existing workflow.

def update(self, workflow, timeout=None)
6223    def update(self, workflow, timeout=None):
6224        '''
6225         Update updates an existing workflow.
6226        '''
6227        req = WorkflowUpdateRequest()
6228
6229        if workflow is not None:
6230            req.workflow.CopyFrom(
6231                plumbing.convert_workflow_to_plumbing(workflow))
6232        tries = 0
6233        plumbing_response = None
6234        while True:
6235            try:
6236                plumbing_response = self.stub.Update(
6237                    req,
6238                    metadata=self.parent.get_metadata('Workflows.Update', req),
6239                    timeout=timeout)
6240            except Exception as e:
6241                if self.parent.shouldRetry(tries, e):
6242                    tries += 1
6243                    self.parent.jitterSleep(tries)
6244                    continue
6245                raise plumbing.convert_error_to_porcelain(e) from e
6246            break
6247
6248        resp = models.WorkflowUpdateResponse()
6249        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6250            plumbing_response.rate_limit)
6251        resp.workflow = plumbing.convert_workflow_to_porcelain(
6252            plumbing_response.workflow)
6253        return resp

Update updates an existing workflow.

def list(self, filter, *args, timeout=None)
6255    def list(self, filter, *args, timeout=None):
6256        '''
6257         Lists existing workflows.
6258        '''
6259        req = WorkflowListRequest()
6260        req.meta.CopyFrom(ListRequestMetadata())
6261        if self.parent.page_limit > 0:
6262            req.meta.limit = self.parent.page_limit
6263        if self.parent.snapshot_datetime is not None:
6264            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6265
6266        req.filter = plumbing.quote_filter_args(filter, *args)
6267
6268        def generator(svc, req):
6269            tries = 0
6270            while True:
6271                try:
6272                    plumbing_response = svc.stub.List(
6273                        req,
6274                        metadata=svc.parent.get_metadata(
6275                            'Workflows.List', req),
6276                        timeout=timeout)
6277                except Exception as e:
6278                    if self.parent.shouldRetry(tries, e):
6279                        tries += 1
6280                        self.parent.jitterSleep(tries)
6281                        continue
6282                    raise plumbing.convert_error_to_porcelain(e) from e
6283                tries = 0
6284                for plumbing_item in plumbing_response.workflows:
6285                    yield plumbing.convert_workflow_to_porcelain(plumbing_item)
6286                if plumbing_response.meta.next_cursor == '':
6287                    break
6288                req.meta.cursor = plumbing_response.meta.next_cursor
6289
6290        return generator(self, req)

Lists existing workflows.

class SnapshotWorkflows:
6293class SnapshotWorkflows:
6294    '''
6295    SnapshotWorkflows exposes the read only methods of the Workflows
6296    service for historical queries.
6297    '''
6298    def __init__(self, workflows):
6299        self.workflows = workflows
6300
6301    def get(self, id, timeout=None):
6302        '''
6303         Get reads one workflow by ID.
6304        '''
6305        return self.workflows.get(id, timeout=timeout)
6306
6307    def list(self, filter, *args, timeout=None):
6308        '''
6309         Lists existing workflows.
6310        '''
6311        return self.workflows.list(filter, *args, timeout=timeout)

SnapshotWorkflows exposes the read only methods of the Workflows service for historical queries.

SnapshotWorkflows(workflows)
6298    def __init__(self, workflows):
6299        self.workflows = workflows
def get(self, id, timeout=None)
6301    def get(self, id, timeout=None):
6302        '''
6303         Get reads one workflow by ID.
6304        '''
6305        return self.workflows.get(id, timeout=timeout)

Get reads one workflow by ID.

def list(self, filter, *args, timeout=None)
6307    def list(self, filter, *args, timeout=None):
6308        '''
6309         Lists existing workflows.
6310        '''
6311        return self.workflows.list(filter, *args, timeout=timeout)

Lists existing workflows.

class WorkflowsHistory:
6314class WorkflowsHistory:
6315    '''
6316     WorkflowsHistory provides records of all changes to the state of a Workflow.
6317    See `strongdm.models.WorkflowHistory`.
6318    '''
6319    def __init__(self, channel, client):
6320        self.parent = client
6321        self.stub = WorkflowsHistoryStub(channel)
6322
6323    def list(self, filter, *args, timeout=None):
6324        '''
6325         List gets a list of WorkflowHistory records matching a given set of criteria.
6326        '''
6327        req = WorkflowHistoryListRequest()
6328        req.meta.CopyFrom(ListRequestMetadata())
6329        if self.parent.page_limit > 0:
6330            req.meta.limit = self.parent.page_limit
6331        if self.parent.snapshot_datetime is not None:
6332            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6333
6334        req.filter = plumbing.quote_filter_args(filter, *args)
6335
6336        def generator(svc, req):
6337            tries = 0
6338            while True:
6339                try:
6340                    plumbing_response = svc.stub.List(
6341                        req,
6342                        metadata=svc.parent.get_metadata(
6343                            'WorkflowsHistory.List', req),
6344                        timeout=timeout)
6345                except Exception as e:
6346                    if self.parent.shouldRetry(tries, e):
6347                        tries += 1
6348                        self.parent.jitterSleep(tries)
6349                        continue
6350                    raise plumbing.convert_error_to_porcelain(e) from e
6351                tries = 0
6352                for plumbing_item in plumbing_response.history:
6353                    yield plumbing.convert_workflow_history_to_porcelain(
6354                        plumbing_item)
6355                if plumbing_response.meta.next_cursor == '':
6356                    break
6357                req.meta.cursor = plumbing_response.meta.next_cursor
6358
6359        return generator(self, req)

WorkflowsHistory provides records of all changes to the state of a Workflow. See strongdm.models.WorkflowHistory.

WorkflowsHistory(channel, client)
6319    def __init__(self, channel, client):
6320        self.parent = client
6321        self.stub = WorkflowsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
6323    def list(self, filter, *args, timeout=None):
6324        '''
6325         List gets a list of WorkflowHistory records matching a given set of criteria.
6326        '''
6327        req = WorkflowHistoryListRequest()
6328        req.meta.CopyFrom(ListRequestMetadata())
6329        if self.parent.page_limit > 0:
6330            req.meta.limit = self.parent.page_limit
6331        if self.parent.snapshot_datetime is not None:
6332            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6333
6334        req.filter = plumbing.quote_filter_args(filter, *args)
6335
6336        def generator(svc, req):
6337            tries = 0
6338            while True:
6339                try:
6340                    plumbing_response = svc.stub.List(
6341                        req,
6342                        metadata=svc.parent.get_metadata(
6343                            'WorkflowsHistory.List', req),
6344                        timeout=timeout)
6345                except Exception as e:
6346                    if self.parent.shouldRetry(tries, e):
6347                        tries += 1
6348                        self.parent.jitterSleep(tries)
6349                        continue
6350                    raise plumbing.convert_error_to_porcelain(e) from e
6351                tries = 0
6352                for plumbing_item in plumbing_response.history:
6353                    yield plumbing.convert_workflow_history_to_porcelain(
6354                        plumbing_item)
6355                if plumbing_response.meta.next_cursor == '':
6356                    break
6357                req.meta.cursor = plumbing_response.meta.next_cursor
6358
6359        return generator(self, req)

List gets a list of WorkflowHistory records matching a given set of criteria.