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 .drivers_pb2 import *
  34from .drivers_pb2_grpc import *
  35from .account_attachments_pb2 import *
  36from .account_attachments_pb2_grpc import *
  37from .account_attachments_history_pb2 import *
  38from .account_attachments_history_pb2_grpc import *
  39from .account_grants_pb2 import *
  40from .account_grants_pb2_grpc import *
  41from .account_grants_history_pb2 import *
  42from .account_grants_history_pb2_grpc import *
  43from .account_permissions_pb2 import *
  44from .account_permissions_pb2_grpc import *
  45from .account_resources_pb2 import *
  46from .account_resources_pb2_grpc import *
  47from .account_resources_history_pb2 import *
  48from .account_resources_history_pb2_grpc import *
  49from .accounts_pb2 import *
  50from .accounts_pb2_grpc import *
  51from .accounts_history_pb2 import *
  52from .accounts_history_pb2_grpc import *
  53from .activities_pb2 import *
  54from .activities_pb2_grpc import *
  55from .approval_workflow_approvers_pb2 import *
  56from .approval_workflow_approvers_pb2_grpc import *
  57from .approval_workflow_approvers_history_pb2 import *
  58from .approval_workflow_approvers_history_pb2_grpc import *
  59from .approval_workflow_steps_pb2 import *
  60from .approval_workflow_steps_pb2_grpc import *
  61from .approval_workflow_steps_history_pb2 import *
  62from .approval_workflow_steps_history_pb2_grpc import *
  63from .approval_workflows_pb2 import *
  64from .approval_workflows_pb2_grpc import *
  65from .approval_workflows_history_pb2 import *
  66from .approval_workflows_history_pb2_grpc import *
  67from .control_panel_pb2 import *
  68from .control_panel_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.AmazonESIAM`
4468    `strongdm.models.AmazonMQAMQP091`
4469    `strongdm.models.Athena`
4470    `strongdm.models.AthenaIAM`
4471    `strongdm.models.AuroraMysql`
4472    `strongdm.models.AuroraMysqlIAM`
4473    `strongdm.models.AuroraPostgres`
4474    `strongdm.models.AuroraPostgresIAM`
4475    `strongdm.models.AWS`
4476    `strongdm.models.AWSConsole`
4477    `strongdm.models.AWSConsoleStaticKeyPair`
4478    `strongdm.models.AWSInstanceProfile`
4479    `strongdm.models.Azure`
4480    `strongdm.models.AzureCertificate`
4481    `strongdm.models.AzureMysql`
4482    `strongdm.models.AzurePostgres`
4483    `strongdm.models.AzurePostgresManagedIdentity`
4484    `strongdm.models.BigQuery`
4485    `strongdm.models.Cassandra`
4486    `strongdm.models.Citus`
4487    `strongdm.models.ClickHouseHTTP`
4488    `strongdm.models.ClickHouseMySQL`
4489    `strongdm.models.ClickHouseTCP`
4490    `strongdm.models.Clustrix`
4491    `strongdm.models.Cockroach`
4492    `strongdm.models.CouchbaseDatabase`
4493    `strongdm.models.CouchbaseWebUI`
4494    `strongdm.models.DB2I`
4495    `strongdm.models.DB2LUW`
4496    `strongdm.models.DocumentDBHost`
4497    `strongdm.models.DocumentDBHostIAM`
4498    `strongdm.models.DocumentDBReplicaSet`
4499    `strongdm.models.Druid`
4500    `strongdm.models.DynamoDB`
4501    `strongdm.models.DynamoDBIAM`
4502    `strongdm.models.Elastic`
4503    `strongdm.models.ElasticacheRedis`
4504    `strongdm.models.GCP`
4505    `strongdm.models.GCPConsole`
4506    `strongdm.models.GCPWIF`
4507    `strongdm.models.GoogleGKE`
4508    `strongdm.models.GoogleGKEUserImpersonation`
4509    `strongdm.models.Greenplum`
4510    `strongdm.models.HTTPAuth`
4511    `strongdm.models.HTTPBasicAuth`
4512    `strongdm.models.HTTPNoAuth`
4513    `strongdm.models.Kubernetes`
4514    `strongdm.models.KubernetesBasicAuth`
4515    `strongdm.models.KubernetesServiceAccount`
4516    `strongdm.models.KubernetesServiceAccountUserImpersonation`
4517    `strongdm.models.KubernetesUserImpersonation`
4518    `strongdm.models.Maria`
4519    `strongdm.models.Memcached`
4520    `strongdm.models.Memsql`
4521    `strongdm.models.MongoHost`
4522    `strongdm.models.MongoLegacyHost`
4523    `strongdm.models.MongoLegacyReplicaset`
4524    `strongdm.models.MongoReplicaSet`
4525    `strongdm.models.MongoShardedCluster`
4526    `strongdm.models.MTLSMysql`
4527    `strongdm.models.MTLSPostgres`
4528    `strongdm.models.Mysql`
4529    `strongdm.models.Neptune`
4530    `strongdm.models.NeptuneIAM`
4531    `strongdm.models.Oracle`
4532    `strongdm.models.Postgres`
4533    `strongdm.models.Presto`
4534    `strongdm.models.RabbitMQAMQP091`
4535    `strongdm.models.RawTCP`
4536    `strongdm.models.RDP`
4537    `strongdm.models.RDPCert`
4538    `strongdm.models.RDSPostgresIAM`
4539    `strongdm.models.Redis`
4540    `strongdm.models.Redshift`
4541    `strongdm.models.SingleStore`
4542    `strongdm.models.Snowflake`
4543    `strongdm.models.Snowsight`
4544    `strongdm.models.SQLServer`
4545    `strongdm.models.SQLServerAzureAD`
4546    `strongdm.models.SQLServerKerberosAD`
4547    `strongdm.models.SSH`
4548    `strongdm.models.SSHCert`
4549    `strongdm.models.SSHCustomerKey`
4550    `strongdm.models.SSHPassword`
4551    `strongdm.models.Sybase`
4552    `strongdm.models.SybaseIQ`
4553    `strongdm.models.Teradata`
4554    `strongdm.models.Trino`
4555    '''
4556    def __init__(self, channel, client):
4557        self.parent = client
4558        self.stub = ResourcesStub(channel)
4559
4560    def enumerate_tags(self, filter, *args, timeout=None):
4561        '''
4562         EnumerateTags gets a list of the filter matching tags.
4563        '''
4564        req = EnumerateTagsRequest()
4565        req.meta.CopyFrom(ListRequestMetadata())
4566        if self.parent.page_limit > 0:
4567            req.meta.limit = self.parent.page_limit
4568        if self.parent.snapshot_datetime is not None:
4569            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4570
4571        req.filter = plumbing.quote_filter_args(filter, *args)
4572
4573        def generator(svc, req):
4574            tries = 0
4575            while True:
4576                try:
4577                    plumbing_response = svc.stub.EnumerateTags(
4578                        req,
4579                        metadata=svc.parent.get_metadata(
4580                            'Resources.EnumerateTags', req),
4581                        timeout=timeout)
4582                except Exception as e:
4583                    if self.parent.shouldRetry(tries, e):
4584                        tries += 1
4585                        self.parent.jitterSleep(tries)
4586                        continue
4587                    raise plumbing.convert_error_to_porcelain(e) from e
4588                tries = 0
4589                for plumbing_item in plumbing_response.matches:
4590                    yield plumbing.convert_tag_to_porcelain(plumbing_item)
4591                if plumbing_response.meta.next_cursor == '':
4592                    break
4593                req.meta.cursor = plumbing_response.meta.next_cursor
4594
4595        return generator(self, req)
4596
4597    def create(self, resource, timeout=None):
4598        '''
4599         Create registers a new Resource.
4600        '''
4601        req = ResourceCreateRequest()
4602
4603        if resource is not None:
4604            req.resource.CopyFrom(
4605                plumbing.convert_resource_to_plumbing(resource))
4606        tries = 0
4607        plumbing_response = None
4608        while True:
4609            try:
4610                plumbing_response = self.stub.Create(
4611                    req,
4612                    metadata=self.parent.get_metadata('Resources.Create', req),
4613                    timeout=timeout)
4614            except Exception as e:
4615                if self.parent.shouldRetry(tries, e):
4616                    tries += 1
4617                    self.parent.jitterSleep(tries)
4618                    continue
4619                raise plumbing.convert_error_to_porcelain(e) from e
4620            break
4621
4622        resp = models.ResourceCreateResponse()
4623        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4624            plumbing_response.meta)
4625        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4626            plumbing_response.rate_limit)
4627        resp.resource = plumbing.convert_resource_to_porcelain(
4628            plumbing_response.resource)
4629        return resp
4630
4631    def get(self, id, timeout=None):
4632        '''
4633         Get reads one Resource by ID.
4634        '''
4635        req = ResourceGetRequest()
4636        if self.parent.snapshot_datetime is not None:
4637            req.meta.CopyFrom(GetRequestMetadata())
4638            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4639
4640        req.id = (id)
4641        tries = 0
4642        plumbing_response = None
4643        while True:
4644            try:
4645                plumbing_response = self.stub.Get(
4646                    req,
4647                    metadata=self.parent.get_metadata('Resources.Get', req),
4648                    timeout=timeout)
4649            except Exception as e:
4650                if self.parent.shouldRetry(tries, e):
4651                    tries += 1
4652                    self.parent.jitterSleep(tries)
4653                    continue
4654                raise plumbing.convert_error_to_porcelain(e) from e
4655            break
4656
4657        resp = models.ResourceGetResponse()
4658        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4659            plumbing_response.meta)
4660        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4661            plumbing_response.rate_limit)
4662        resp.resource = plumbing.convert_resource_to_porcelain(
4663            plumbing_response.resource)
4664        return resp
4665
4666    def update(self, resource, timeout=None):
4667        '''
4668         Update replaces all the fields of a Resource by ID.
4669        '''
4670        req = ResourceUpdateRequest()
4671
4672        if resource is not None:
4673            req.resource.CopyFrom(
4674                plumbing.convert_resource_to_plumbing(resource))
4675        tries = 0
4676        plumbing_response = None
4677        while True:
4678            try:
4679                plumbing_response = self.stub.Update(
4680                    req,
4681                    metadata=self.parent.get_metadata('Resources.Update', req),
4682                    timeout=timeout)
4683            except Exception as e:
4684                if self.parent.shouldRetry(tries, e):
4685                    tries += 1
4686                    self.parent.jitterSleep(tries)
4687                    continue
4688                raise plumbing.convert_error_to_porcelain(e) from e
4689            break
4690
4691        resp = models.ResourceUpdateResponse()
4692        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4693            plumbing_response.meta)
4694        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4695            plumbing_response.rate_limit)
4696        resp.resource = plumbing.convert_resource_to_porcelain(
4697            plumbing_response.resource)
4698        return resp
4699
4700    def delete(self, id, timeout=None):
4701        '''
4702         Delete removes a Resource by ID.
4703        '''
4704        req = ResourceDeleteRequest()
4705
4706        req.id = (id)
4707        tries = 0
4708        plumbing_response = None
4709        while True:
4710            try:
4711                plumbing_response = self.stub.Delete(
4712                    req,
4713                    metadata=self.parent.get_metadata('Resources.Delete', req),
4714                    timeout=timeout)
4715            except Exception as e:
4716                if self.parent.shouldRetry(tries, e):
4717                    tries += 1
4718                    self.parent.jitterSleep(tries)
4719                    continue
4720                raise plumbing.convert_error_to_porcelain(e) from e
4721            break
4722
4723        resp = models.ResourceDeleteResponse()
4724        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4725            plumbing_response.meta)
4726        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4727            plumbing_response.rate_limit)
4728        return resp
4729
4730    def list(self, filter, *args, timeout=None):
4731        '''
4732         List gets a list of Resources matching a given set of criteria.
4733        '''
4734        req = ResourceListRequest()
4735        req.meta.CopyFrom(ListRequestMetadata())
4736        if self.parent.page_limit > 0:
4737            req.meta.limit = self.parent.page_limit
4738        if self.parent.snapshot_datetime is not None:
4739            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4740
4741        req.filter = plumbing.quote_filter_args(filter, *args)
4742
4743        def generator(svc, req):
4744            tries = 0
4745            while True:
4746                try:
4747                    plumbing_response = svc.stub.List(
4748                        req,
4749                        metadata=svc.parent.get_metadata(
4750                            'Resources.List', req),
4751                        timeout=timeout)
4752                except Exception as e:
4753                    if self.parent.shouldRetry(tries, e):
4754                        tries += 1
4755                        self.parent.jitterSleep(tries)
4756                        continue
4757                    raise plumbing.convert_error_to_porcelain(e) from e
4758                tries = 0
4759                for plumbing_item in plumbing_response.resources:
4760                    yield plumbing.convert_resource_to_porcelain(plumbing_item)
4761                if plumbing_response.meta.next_cursor == '':
4762                    break
4763                req.meta.cursor = plumbing_response.meta.next_cursor
4764
4765        return generator(self, req)
4766
4767    def healthcheck(self, id, timeout=None):
4768        '''
4769         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
4770         large network of Nodes. The call will return immediately, and the updated health of the
4771         Resource can be retrieved via Get or List.
4772        '''
4773        req = ResourceHealthcheckRequest()
4774
4775        req.id = (id)
4776        tries = 0
4777        plumbing_response = None
4778        while True:
4779            try:
4780                plumbing_response = self.stub.Healthcheck(
4781                    req,
4782                    metadata=self.parent.get_metadata('Resources.Healthcheck',
4783                                                      req),
4784                    timeout=timeout)
4785            except Exception as e:
4786                if self.parent.shouldRetry(tries, e):
4787                    tries += 1
4788                    self.parent.jitterSleep(tries)
4789                    continue
4790                raise plumbing.convert_error_to_porcelain(e) from e
4791            break
4792
4793        resp = models.ResourceHealthcheckResponse()
4794        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4795            plumbing_response.meta)
4796        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4797            plumbing_response.rate_limit)
4798        return resp
4799
4800
4801class SnapshotResources:
4802    '''
4803    SnapshotResources exposes the read only methods of the Resources
4804    service for historical queries.
4805    '''
4806    def __init__(self, resources):
4807        self.resources = resources
4808
4809    def get(self, id, timeout=None):
4810        '''
4811         Get reads one Resource by ID.
4812        '''
4813        return self.resources.get(id, timeout=timeout)
4814
4815    def list(self, filter, *args, timeout=None):
4816        '''
4817         List gets a list of Resources matching a given set of criteria.
4818        '''
4819        return self.resources.list(filter, *args, timeout=timeout)
4820
4821
4822class ResourcesHistory:
4823    '''
4824     ResourcesHistory records all changes to the state of a Resource.
4825    See `strongdm.models.ResourceHistory`.
4826    '''
4827    def __init__(self, channel, client):
4828        self.parent = client
4829        self.stub = ResourcesHistoryStub(channel)
4830
4831    def list(self, filter, *args, timeout=None):
4832        '''
4833         List gets a list of ResourceHistory records matching a given set of criteria.
4834        '''
4835        req = ResourceHistoryListRequest()
4836        req.meta.CopyFrom(ListRequestMetadata())
4837        if self.parent.page_limit > 0:
4838            req.meta.limit = self.parent.page_limit
4839        if self.parent.snapshot_datetime is not None:
4840            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4841
4842        req.filter = plumbing.quote_filter_args(filter, *args)
4843
4844        def generator(svc, req):
4845            tries = 0
4846            while True:
4847                try:
4848                    plumbing_response = svc.stub.List(
4849                        req,
4850                        metadata=svc.parent.get_metadata(
4851                            'ResourcesHistory.List', req),
4852                        timeout=timeout)
4853                except Exception as e:
4854                    if self.parent.shouldRetry(tries, e):
4855                        tries += 1
4856                        self.parent.jitterSleep(tries)
4857                        continue
4858                    raise plumbing.convert_error_to_porcelain(e) from e
4859                tries = 0
4860                for plumbing_item in plumbing_response.history:
4861                    yield plumbing.convert_resource_history_to_porcelain(
4862                        plumbing_item)
4863                if plumbing_response.meta.next_cursor == '':
4864                    break
4865                req.meta.cursor = plumbing_response.meta.next_cursor
4866
4867        return generator(self, req)
4868
4869
4870class RoleResources:
4871    '''
4872     RoleResources enumerates the resources to which roles have access.
4873     The RoleResources service is read-only.
4874    See `strongdm.models.RoleResource`.
4875    '''
4876    def __init__(self, channel, client):
4877        self.parent = client
4878        self.stub = RoleResourcesStub(channel)
4879
4880    def list(self, filter, *args, timeout=None):
4881        '''
4882         List gets a list of RoleResource records matching a given set of criteria.
4883        '''
4884        req = RoleResourceListRequest()
4885        req.meta.CopyFrom(ListRequestMetadata())
4886        if self.parent.page_limit > 0:
4887            req.meta.limit = self.parent.page_limit
4888        if self.parent.snapshot_datetime is not None:
4889            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4890
4891        req.filter = plumbing.quote_filter_args(filter, *args)
4892
4893        def generator(svc, req):
4894            tries = 0
4895            while True:
4896                try:
4897                    plumbing_response = svc.stub.List(
4898                        req,
4899                        metadata=svc.parent.get_metadata(
4900                            'RoleResources.List', req),
4901                        timeout=timeout)
4902                except Exception as e:
4903                    if self.parent.shouldRetry(tries, e):
4904                        tries += 1
4905                        self.parent.jitterSleep(tries)
4906                        continue
4907                    raise plumbing.convert_error_to_porcelain(e) from e
4908                tries = 0
4909                for plumbing_item in plumbing_response.role_resources:
4910                    yield plumbing.convert_role_resource_to_porcelain(
4911                        plumbing_item)
4912                if plumbing_response.meta.next_cursor == '':
4913                    break
4914                req.meta.cursor = plumbing_response.meta.next_cursor
4915
4916        return generator(self, req)
4917
4918
4919class SnapshotRoleResources:
4920    '''
4921    SnapshotRoleResources exposes the read only methods of the RoleResources
4922    service for historical queries.
4923    '''
4924    def __init__(self, role_resources):
4925        self.role_resources = role_resources
4926
4927    def list(self, filter, *args, timeout=None):
4928        '''
4929         List gets a list of RoleResource records matching a given set of criteria.
4930        '''
4931        return self.role_resources.list(filter, *args, timeout=timeout)
4932
4933
4934class RoleResourcesHistory:
4935    '''
4936     RoleResourcesHistory records all changes to the state of a RoleResource.
4937    See `strongdm.models.RoleResourceHistory`.
4938    '''
4939    def __init__(self, channel, client):
4940        self.parent = client
4941        self.stub = RoleResourcesHistoryStub(channel)
4942
4943    def list(self, filter, *args, timeout=None):
4944        '''
4945         List gets a list of RoleResourceHistory records matching a given set of criteria.
4946        '''
4947        req = RoleResourceHistoryListRequest()
4948        req.meta.CopyFrom(ListRequestMetadata())
4949        if self.parent.page_limit > 0:
4950            req.meta.limit = self.parent.page_limit
4951        if self.parent.snapshot_datetime is not None:
4952            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4953
4954        req.filter = plumbing.quote_filter_args(filter, *args)
4955
4956        def generator(svc, req):
4957            tries = 0
4958            while True:
4959                try:
4960                    plumbing_response = svc.stub.List(
4961                        req,
4962                        metadata=svc.parent.get_metadata(
4963                            'RoleResourcesHistory.List', req),
4964                        timeout=timeout)
4965                except Exception as e:
4966                    if self.parent.shouldRetry(tries, e):
4967                        tries += 1
4968                        self.parent.jitterSleep(tries)
4969                        continue
4970                    raise plumbing.convert_error_to_porcelain(e) from e
4971                tries = 0
4972                for plumbing_item in plumbing_response.history:
4973                    yield plumbing.convert_role_resource_history_to_porcelain(
4974                        plumbing_item)
4975                if plumbing_response.meta.next_cursor == '':
4976                    break
4977                req.meta.cursor = plumbing_response.meta.next_cursor
4978
4979        return generator(self, req)
4980
4981
4982class Roles:
4983    '''
4984     A Role has a list of access rules which determine which Resources the members
4985     of the Role have access to. An Account can be a member of multiple Roles via
4986     AccountAttachments.
4987    See `strongdm.models.Role`.
4988    '''
4989    def __init__(self, channel, client):
4990        self.parent = client
4991        self.stub = RolesStub(channel)
4992
4993    def create(self, role, timeout=None):
4994        '''
4995         Create registers a new Role.
4996        '''
4997        req = RoleCreateRequest()
4998
4999        if role is not None:
5000            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5001        tries = 0
5002        plumbing_response = None
5003        while True:
5004            try:
5005                plumbing_response = self.stub.Create(
5006                    req,
5007                    metadata=self.parent.get_metadata('Roles.Create', req),
5008                    timeout=timeout)
5009            except Exception as e:
5010                if self.parent.shouldRetry(tries, e):
5011                    tries += 1
5012                    self.parent.jitterSleep(tries)
5013                    continue
5014                raise plumbing.convert_error_to_porcelain(e) from e
5015            break
5016
5017        resp = models.RoleCreateResponse()
5018        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5019            plumbing_response.meta)
5020        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5021            plumbing_response.rate_limit)
5022        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5023        return resp
5024
5025    def get(self, id, timeout=None):
5026        '''
5027         Get reads one Role by ID.
5028        '''
5029        req = RoleGetRequest()
5030        if self.parent.snapshot_datetime is not None:
5031            req.meta.CopyFrom(GetRequestMetadata())
5032            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5033
5034        req.id = (id)
5035        tries = 0
5036        plumbing_response = None
5037        while True:
5038            try:
5039                plumbing_response = self.stub.Get(
5040                    req,
5041                    metadata=self.parent.get_metadata('Roles.Get', req),
5042                    timeout=timeout)
5043            except Exception as e:
5044                if self.parent.shouldRetry(tries, e):
5045                    tries += 1
5046                    self.parent.jitterSleep(tries)
5047                    continue
5048                raise plumbing.convert_error_to_porcelain(e) from e
5049            break
5050
5051        resp = models.RoleGetResponse()
5052        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5053            plumbing_response.meta)
5054        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5055            plumbing_response.rate_limit)
5056        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5057        return resp
5058
5059    def update(self, role, timeout=None):
5060        '''
5061         Update replaces all the fields of a Role by ID.
5062        '''
5063        req = RoleUpdateRequest()
5064
5065        if role is not None:
5066            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5067        tries = 0
5068        plumbing_response = None
5069        while True:
5070            try:
5071                plumbing_response = self.stub.Update(
5072                    req,
5073                    metadata=self.parent.get_metadata('Roles.Update', req),
5074                    timeout=timeout)
5075            except Exception as e:
5076                if self.parent.shouldRetry(tries, e):
5077                    tries += 1
5078                    self.parent.jitterSleep(tries)
5079                    continue
5080                raise plumbing.convert_error_to_porcelain(e) from e
5081            break
5082
5083        resp = models.RoleUpdateResponse()
5084        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5085            plumbing_response.meta)
5086        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5087            plumbing_response.rate_limit)
5088        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5089        return resp
5090
5091    def delete(self, id, timeout=None):
5092        '''
5093         Delete removes a Role by ID.
5094        '''
5095        req = RoleDeleteRequest()
5096
5097        req.id = (id)
5098        tries = 0
5099        plumbing_response = None
5100        while True:
5101            try:
5102                plumbing_response = self.stub.Delete(
5103                    req,
5104                    metadata=self.parent.get_metadata('Roles.Delete', req),
5105                    timeout=timeout)
5106            except Exception as e:
5107                if self.parent.shouldRetry(tries, e):
5108                    tries += 1
5109                    self.parent.jitterSleep(tries)
5110                    continue
5111                raise plumbing.convert_error_to_porcelain(e) from e
5112            break
5113
5114        resp = models.RoleDeleteResponse()
5115        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5116            plumbing_response.meta)
5117        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5118            plumbing_response.rate_limit)
5119        return resp
5120
5121    def list(self, filter, *args, timeout=None):
5122        '''
5123         List gets a list of Roles matching a given set of criteria.
5124        '''
5125        req = RoleListRequest()
5126        req.meta.CopyFrom(ListRequestMetadata())
5127        if self.parent.page_limit > 0:
5128            req.meta.limit = self.parent.page_limit
5129        if self.parent.snapshot_datetime is not None:
5130            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5131
5132        req.filter = plumbing.quote_filter_args(filter, *args)
5133
5134        def generator(svc, req):
5135            tries = 0
5136            while True:
5137                try:
5138                    plumbing_response = svc.stub.List(
5139                        req,
5140                        metadata=svc.parent.get_metadata('Roles.List', req),
5141                        timeout=timeout)
5142                except Exception as e:
5143                    if self.parent.shouldRetry(tries, e):
5144                        tries += 1
5145                        self.parent.jitterSleep(tries)
5146                        continue
5147                    raise plumbing.convert_error_to_porcelain(e) from e
5148                tries = 0
5149                for plumbing_item in plumbing_response.roles:
5150                    yield plumbing.convert_role_to_porcelain(plumbing_item)
5151                if plumbing_response.meta.next_cursor == '':
5152                    break
5153                req.meta.cursor = plumbing_response.meta.next_cursor
5154
5155        return generator(self, req)
5156
5157
5158class SnapshotRoles:
5159    '''
5160    SnapshotRoles exposes the read only methods of the Roles
5161    service for historical queries.
5162    '''
5163    def __init__(self, roles):
5164        self.roles = roles
5165
5166    def get(self, id, timeout=None):
5167        '''
5168         Get reads one Role by ID.
5169        '''
5170        return self.roles.get(id, timeout=timeout)
5171
5172    def list(self, filter, *args, timeout=None):
5173        '''
5174         List gets a list of Roles matching a given set of criteria.
5175        '''
5176        return self.roles.list(filter, *args, timeout=timeout)
5177
5178
5179class RolesHistory:
5180    '''
5181     RolesHistory records all changes to the state of a Role.
5182    See `strongdm.models.RoleHistory`.
5183    '''
5184    def __init__(self, channel, client):
5185        self.parent = client
5186        self.stub = RolesHistoryStub(channel)
5187
5188    def list(self, filter, *args, timeout=None):
5189        '''
5190         List gets a list of RoleHistory records matching a given set of criteria.
5191        '''
5192        req = RoleHistoryListRequest()
5193        req.meta.CopyFrom(ListRequestMetadata())
5194        if self.parent.page_limit > 0:
5195            req.meta.limit = self.parent.page_limit
5196        if self.parent.snapshot_datetime is not None:
5197            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5198
5199        req.filter = plumbing.quote_filter_args(filter, *args)
5200
5201        def generator(svc, req):
5202            tries = 0
5203            while True:
5204                try:
5205                    plumbing_response = svc.stub.List(
5206                        req,
5207                        metadata=svc.parent.get_metadata(
5208                            'RolesHistory.List', req),
5209                        timeout=timeout)
5210                except Exception as e:
5211                    if self.parent.shouldRetry(tries, e):
5212                        tries += 1
5213                        self.parent.jitterSleep(tries)
5214                        continue
5215                    raise plumbing.convert_error_to_porcelain(e) from e
5216                tries = 0
5217                for plumbing_item in plumbing_response.history:
5218                    yield plumbing.convert_role_history_to_porcelain(
5219                        plumbing_item)
5220                if plumbing_response.meta.next_cursor == '':
5221                    break
5222                req.meta.cursor = plumbing_response.meta.next_cursor
5223
5224        return generator(self, req)
5225
5226
5227class SecretStores:
5228    '''
5229     SecretStores are servers where resource secrets (passwords, keys) are stored.
5230    See:
5231    `strongdm.models.ActiveDirectoryStore`
5232    `strongdm.models.AWSStore`
5233    `strongdm.models.AWSCertX509Store`
5234    `strongdm.models.AzureStore`
5235    `strongdm.models.CyberarkConjurStore`
5236    `strongdm.models.CyberarkPAMStore`
5237    `strongdm.models.CyberarkPAMExperimentalStore`
5238    `strongdm.models.DelineaStore`
5239    `strongdm.models.GCPStore`
5240    `strongdm.models.GCPCertX509Store`
5241    `strongdm.models.KeyfactorSSHStore`
5242    `strongdm.models.KeyfactorX509Store`
5243    `strongdm.models.VaultAppRoleStore`
5244    `strongdm.models.VaultAppRoleCertSSHStore`
5245    `strongdm.models.VaultAppRoleCertX509Store`
5246    `strongdm.models.VaultAWSEC2Store`
5247    `strongdm.models.VaultAWSIAMStore`
5248    `strongdm.models.VaultTLSStore`
5249    `strongdm.models.VaultTLSCertSSHStore`
5250    `strongdm.models.VaultTLSCertX509Store`
5251    `strongdm.models.VaultTokenStore`
5252    `strongdm.models.VaultTokenCertSSHStore`
5253    `strongdm.models.VaultTokenCertX509Store`
5254    '''
5255    def __init__(self, channel, client):
5256        self.parent = client
5257        self.stub = SecretStoresStub(channel)
5258
5259    def create(self, secret_store, timeout=None):
5260        req = SecretStoreCreateRequest()
5261
5262        if secret_store is not None:
5263            req.secret_store.CopyFrom(
5264                plumbing.convert_secret_store_to_plumbing(secret_store))
5265        tries = 0
5266        plumbing_response = None
5267        while True:
5268            try:
5269                plumbing_response = self.stub.Create(
5270                    req,
5271                    metadata=self.parent.get_metadata('SecretStores.Create',
5272                                                      req),
5273                    timeout=timeout)
5274            except Exception as e:
5275                if self.parent.shouldRetry(tries, e):
5276                    tries += 1
5277                    self.parent.jitterSleep(tries)
5278                    continue
5279                raise plumbing.convert_error_to_porcelain(e) from e
5280            break
5281
5282        resp = models.SecretStoreCreateResponse()
5283        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5284            plumbing_response.meta)
5285        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5286            plumbing_response.rate_limit)
5287        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5288            plumbing_response.secret_store)
5289        return resp
5290
5291    def get(self, id, timeout=None):
5292        '''
5293         Get reads one SecretStore by ID.
5294        '''
5295        req = SecretStoreGetRequest()
5296        if self.parent.snapshot_datetime is not None:
5297            req.meta.CopyFrom(GetRequestMetadata())
5298            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5299
5300        req.id = (id)
5301        tries = 0
5302        plumbing_response = None
5303        while True:
5304            try:
5305                plumbing_response = self.stub.Get(
5306                    req,
5307                    metadata=self.parent.get_metadata('SecretStores.Get', req),
5308                    timeout=timeout)
5309            except Exception as e:
5310                if self.parent.shouldRetry(tries, e):
5311                    tries += 1
5312                    self.parent.jitterSleep(tries)
5313                    continue
5314                raise plumbing.convert_error_to_porcelain(e) from e
5315            break
5316
5317        resp = models.SecretStoreGetResponse()
5318        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5319            plumbing_response.meta)
5320        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5321            plumbing_response.rate_limit)
5322        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5323            plumbing_response.secret_store)
5324        return resp
5325
5326    def update(self, secret_store, timeout=None):
5327        '''
5328         Update replaces all the fields of a SecretStore by ID.
5329        '''
5330        req = SecretStoreUpdateRequest()
5331
5332        if secret_store is not None:
5333            req.secret_store.CopyFrom(
5334                plumbing.convert_secret_store_to_plumbing(secret_store))
5335        tries = 0
5336        plumbing_response = None
5337        while True:
5338            try:
5339                plumbing_response = self.stub.Update(
5340                    req,
5341                    metadata=self.parent.get_metadata('SecretStores.Update',
5342                                                      req),
5343                    timeout=timeout)
5344            except Exception as e:
5345                if self.parent.shouldRetry(tries, e):
5346                    tries += 1
5347                    self.parent.jitterSleep(tries)
5348                    continue
5349                raise plumbing.convert_error_to_porcelain(e) from e
5350            break
5351
5352        resp = models.SecretStoreUpdateResponse()
5353        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5354            plumbing_response.meta)
5355        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5356            plumbing_response.rate_limit)
5357        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5358            plumbing_response.secret_store)
5359        return resp
5360
5361    def delete(self, id, timeout=None):
5362        '''
5363         Delete removes a SecretStore by ID.
5364        '''
5365        req = SecretStoreDeleteRequest()
5366
5367        req.id = (id)
5368        tries = 0
5369        plumbing_response = None
5370        while True:
5371            try:
5372                plumbing_response = self.stub.Delete(
5373                    req,
5374                    metadata=self.parent.get_metadata('SecretStores.Delete',
5375                                                      req),
5376                    timeout=timeout)
5377            except Exception as e:
5378                if self.parent.shouldRetry(tries, e):
5379                    tries += 1
5380                    self.parent.jitterSleep(tries)
5381                    continue
5382                raise plumbing.convert_error_to_porcelain(e) from e
5383            break
5384
5385        resp = models.SecretStoreDeleteResponse()
5386        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5387            plumbing_response.meta)
5388        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5389            plumbing_response.rate_limit)
5390        return resp
5391
5392    def list(self, filter, *args, timeout=None):
5393        '''
5394         List gets a list of SecretStores matching a given set of criteria.
5395        '''
5396        req = SecretStoreListRequest()
5397        req.meta.CopyFrom(ListRequestMetadata())
5398        if self.parent.page_limit > 0:
5399            req.meta.limit = self.parent.page_limit
5400        if self.parent.snapshot_datetime is not None:
5401            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5402
5403        req.filter = plumbing.quote_filter_args(filter, *args)
5404
5405        def generator(svc, req):
5406            tries = 0
5407            while True:
5408                try:
5409                    plumbing_response = svc.stub.List(
5410                        req,
5411                        metadata=svc.parent.get_metadata(
5412                            'SecretStores.List', req),
5413                        timeout=timeout)
5414                except Exception as e:
5415                    if self.parent.shouldRetry(tries, e):
5416                        tries += 1
5417                        self.parent.jitterSleep(tries)
5418                        continue
5419                    raise plumbing.convert_error_to_porcelain(e) from e
5420                tries = 0
5421                for plumbing_item in plumbing_response.secret_stores:
5422                    yield plumbing.convert_secret_store_to_porcelain(
5423                        plumbing_item)
5424                if plumbing_response.meta.next_cursor == '':
5425                    break
5426                req.meta.cursor = plumbing_response.meta.next_cursor
5427
5428        return generator(self, req)
5429
5430
5431class SnapshotSecretStores:
5432    '''
5433    SnapshotSecretStores exposes the read only methods of the SecretStores
5434    service for historical queries.
5435    '''
5436    def __init__(self, secret_stores):
5437        self.secret_stores = secret_stores
5438
5439    def get(self, id, timeout=None):
5440        '''
5441         Get reads one SecretStore by ID.
5442        '''
5443        return self.secret_stores.get(id, timeout=timeout)
5444
5445    def list(self, filter, *args, timeout=None):
5446        '''
5447         List gets a list of SecretStores matching a given set of criteria.
5448        '''
5449        return self.secret_stores.list(filter, *args, timeout=timeout)
5450
5451
5452class SecretStoreHealths:
5453    '''
5454     SecretStoreHealths exposes health states for secret stores.
5455    See `strongdm.models.SecretStoreHealth`.
5456    '''
5457    def __init__(self, channel, client):
5458        self.parent = client
5459        self.stub = SecretStoreHealthsStub(channel)
5460
5461    def list(self, filter, *args, timeout=None):
5462        '''
5463         List reports the health status of node to secret store pairs.
5464        '''
5465        req = SecretStoreHealthListRequest()
5466        req.meta.CopyFrom(ListRequestMetadata())
5467        if self.parent.page_limit > 0:
5468            req.meta.limit = self.parent.page_limit
5469        if self.parent.snapshot_datetime is not None:
5470            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5471
5472        req.filter = plumbing.quote_filter_args(filter, *args)
5473
5474        def generator(svc, req):
5475            tries = 0
5476            while True:
5477                try:
5478                    plumbing_response = svc.stub.List(
5479                        req,
5480                        metadata=svc.parent.get_metadata(
5481                            'SecretStoreHealths.List', req),
5482                        timeout=timeout)
5483                except Exception as e:
5484                    if self.parent.shouldRetry(tries, e):
5485                        tries += 1
5486                        self.parent.jitterSleep(tries)
5487                        continue
5488                    raise plumbing.convert_error_to_porcelain(e) from e
5489                tries = 0
5490                for plumbing_item in plumbing_response.secret_store_healths:
5491                    yield plumbing.convert_secret_store_health_to_porcelain(
5492                        plumbing_item)
5493                if plumbing_response.meta.next_cursor == '':
5494                    break
5495                req.meta.cursor = plumbing_response.meta.next_cursor
5496
5497        return generator(self, req)
5498
5499    def healthcheck(self, secret_store_id, timeout=None):
5500        '''
5501         Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
5502         to propagate across a large network of Nodes. The call will return immediately, and the
5503         updated health of the Secret Store can be retrieved via List.
5504        '''
5505        req = SecretStoreHealthcheckRequest()
5506
5507        req.secret_store_id = (secret_store_id)
5508        tries = 0
5509        plumbing_response = None
5510        while True:
5511            try:
5512                plumbing_response = self.stub.Healthcheck(
5513                    req,
5514                    metadata=self.parent.get_metadata(
5515                        'SecretStoreHealths.Healthcheck', req),
5516                    timeout=timeout)
5517            except Exception as e:
5518                if self.parent.shouldRetry(tries, e):
5519                    tries += 1
5520                    self.parent.jitterSleep(tries)
5521                    continue
5522                raise plumbing.convert_error_to_porcelain(e) from e
5523            break
5524
5525        resp = models.SecretStoreHealthcheckResponse()
5526        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5527            plumbing_response.rate_limit)
5528        return resp
5529
5530
5531class SecretStoresHistory:
5532    '''
5533     SecretStoresHistory records all changes to the state of a SecretStore.
5534    See `strongdm.models.SecretStoreHistory`.
5535    '''
5536    def __init__(self, channel, client):
5537        self.parent = client
5538        self.stub = SecretStoresHistoryStub(channel)
5539
5540    def list(self, filter, *args, timeout=None):
5541        '''
5542         List gets a list of SecretStoreHistory records matching a given set of criteria.
5543        '''
5544        req = SecretStoreHistoryListRequest()
5545        req.meta.CopyFrom(ListRequestMetadata())
5546        if self.parent.page_limit > 0:
5547            req.meta.limit = self.parent.page_limit
5548        if self.parent.snapshot_datetime is not None:
5549            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5550
5551        req.filter = plumbing.quote_filter_args(filter, *args)
5552
5553        def generator(svc, req):
5554            tries = 0
5555            while True:
5556                try:
5557                    plumbing_response = svc.stub.List(
5558                        req,
5559                        metadata=svc.parent.get_metadata(
5560                            'SecretStoresHistory.List', req),
5561                        timeout=timeout)
5562                except Exception as e:
5563                    if self.parent.shouldRetry(tries, e):
5564                        tries += 1
5565                        self.parent.jitterSleep(tries)
5566                        continue
5567                    raise plumbing.convert_error_to_porcelain(e) from e
5568                tries = 0
5569                for plumbing_item in plumbing_response.history:
5570                    yield plumbing.convert_secret_store_history_to_porcelain(
5571                        plumbing_item)
5572                if plumbing_response.meta.next_cursor == '':
5573                    break
5574                req.meta.cursor = plumbing_response.meta.next_cursor
5575
5576        return generator(self, req)
5577
5578
5579class WorkflowApprovers:
5580    '''
5581     WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow.
5582    See `strongdm.models.WorkflowApprover`.
5583    '''
5584    def __init__(self, channel, client):
5585        self.parent = client
5586        self.stub = WorkflowApproversStub(channel)
5587
5588    def create(self, workflow_approver, timeout=None):
5589        '''
5590         Create creates a new workflow approver
5591        '''
5592        req = WorkflowApproversCreateRequest()
5593
5594        if workflow_approver is not None:
5595            req.workflow_approver.CopyFrom(
5596                plumbing.convert_workflow_approver_to_plumbing(
5597                    workflow_approver))
5598        tries = 0
5599        plumbing_response = None
5600        while True:
5601            try:
5602                plumbing_response = self.stub.Create(
5603                    req,
5604                    metadata=self.parent.get_metadata(
5605                        'WorkflowApprovers.Create', req),
5606                    timeout=timeout)
5607            except Exception as e:
5608                if self.parent.shouldRetry(tries, e):
5609                    tries += 1
5610                    self.parent.jitterSleep(tries)
5611                    continue
5612                raise plumbing.convert_error_to_porcelain(e) from e
5613            break
5614
5615        resp = models.WorkflowApproversCreateResponse()
5616        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5617            plumbing_response.rate_limit)
5618        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5619            plumbing_response.workflow_approver)
5620        return resp
5621
5622    def get(self, id, timeout=None):
5623        '''
5624         Get reads one workflow approver by ID.
5625        '''
5626        req = WorkflowApproverGetRequest()
5627        if self.parent.snapshot_datetime is not None:
5628            req.meta.CopyFrom(GetRequestMetadata())
5629            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5630
5631        req.id = (id)
5632        tries = 0
5633        plumbing_response = None
5634        while True:
5635            try:
5636                plumbing_response = self.stub.Get(
5637                    req,
5638                    metadata=self.parent.get_metadata('WorkflowApprovers.Get',
5639                                                      req),
5640                    timeout=timeout)
5641            except Exception as e:
5642                if self.parent.shouldRetry(tries, e):
5643                    tries += 1
5644                    self.parent.jitterSleep(tries)
5645                    continue
5646                raise plumbing.convert_error_to_porcelain(e) from e
5647            break
5648
5649        resp = models.WorkflowApproverGetResponse()
5650        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5651            plumbing_response.meta)
5652        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5653            plumbing_response.rate_limit)
5654        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
5655            plumbing_response.workflow_approver)
5656        return resp
5657
5658    def delete(self, id, timeout=None):
5659        '''
5660         Delete deletes a workflow approver
5661        '''
5662        req = WorkflowApproversDeleteRequest()
5663
5664        req.id = (id)
5665        tries = 0
5666        plumbing_response = None
5667        while True:
5668            try:
5669                plumbing_response = self.stub.Delete(
5670                    req,
5671                    metadata=self.parent.get_metadata(
5672                        'WorkflowApprovers.Delete', req),
5673                    timeout=timeout)
5674            except Exception as e:
5675                if self.parent.shouldRetry(tries, e):
5676                    tries += 1
5677                    self.parent.jitterSleep(tries)
5678                    continue
5679                raise plumbing.convert_error_to_porcelain(e) from e
5680            break
5681
5682        resp = models.WorkflowApproversDeleteResponse()
5683        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5684            plumbing_response.rate_limit)
5685        return resp
5686
5687    def list(self, filter, *args, timeout=None):
5688        '''
5689         Lists existing workflow approvers.
5690        '''
5691        req = WorkflowApproversListRequest()
5692        req.meta.CopyFrom(ListRequestMetadata())
5693        if self.parent.page_limit > 0:
5694            req.meta.limit = self.parent.page_limit
5695        if self.parent.snapshot_datetime is not None:
5696            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5697
5698        req.filter = plumbing.quote_filter_args(filter, *args)
5699
5700        def generator(svc, req):
5701            tries = 0
5702            while True:
5703                try:
5704                    plumbing_response = svc.stub.List(
5705                        req,
5706                        metadata=svc.parent.get_metadata(
5707                            'WorkflowApprovers.List', req),
5708                        timeout=timeout)
5709                except Exception as e:
5710                    if self.parent.shouldRetry(tries, e):
5711                        tries += 1
5712                        self.parent.jitterSleep(tries)
5713                        continue
5714                    raise plumbing.convert_error_to_porcelain(e) from e
5715                tries = 0
5716                for plumbing_item in plumbing_response.workflow_approvers:
5717                    yield plumbing.convert_workflow_approver_to_porcelain(
5718                        plumbing_item)
5719                if plumbing_response.meta.next_cursor == '':
5720                    break
5721                req.meta.cursor = plumbing_response.meta.next_cursor
5722
5723        return generator(self, req)
5724
5725
5726class SnapshotWorkflowApprovers:
5727    '''
5728    SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers
5729    service for historical queries.
5730    '''
5731    def __init__(self, workflow_approvers):
5732        self.workflow_approvers = workflow_approvers
5733
5734    def get(self, id, timeout=None):
5735        '''
5736         Get reads one workflow approver by ID.
5737        '''
5738        return self.workflow_approvers.get(id, timeout=timeout)
5739
5740    def list(self, filter, *args, timeout=None):
5741        '''
5742         Lists existing workflow approvers.
5743        '''
5744        return self.workflow_approvers.list(filter, *args, timeout=timeout)
5745
5746
5747class WorkflowApproversHistory:
5748    '''
5749     WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover.
5750    See `strongdm.models.WorkflowApproverHistory`.
5751    '''
5752    def __init__(self, channel, client):
5753        self.parent = client
5754        self.stub = WorkflowApproversHistoryStub(channel)
5755
5756    def list(self, filter, *args, timeout=None):
5757        '''
5758         List gets a list of WorkflowApproversHistory records matching a given set of criteria.
5759        '''
5760        req = WorkflowApproversHistoryListRequest()
5761        req.meta.CopyFrom(ListRequestMetadata())
5762        if self.parent.page_limit > 0:
5763            req.meta.limit = self.parent.page_limit
5764        if self.parent.snapshot_datetime is not None:
5765            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5766
5767        req.filter = plumbing.quote_filter_args(filter, *args)
5768
5769        def generator(svc, req):
5770            tries = 0
5771            while True:
5772                try:
5773                    plumbing_response = svc.stub.List(
5774                        req,
5775                        metadata=svc.parent.get_metadata(
5776                            'WorkflowApproversHistory.List', req),
5777                        timeout=timeout)
5778                except Exception as e:
5779                    if self.parent.shouldRetry(tries, e):
5780                        tries += 1
5781                        self.parent.jitterSleep(tries)
5782                        continue
5783                    raise plumbing.convert_error_to_porcelain(e) from e
5784                tries = 0
5785                for plumbing_item in plumbing_response.history:
5786                    yield plumbing.convert_workflow_approver_history_to_porcelain(
5787                        plumbing_item)
5788                if plumbing_response.meta.next_cursor == '':
5789                    break
5790                req.meta.cursor = plumbing_response.meta.next_cursor
5791
5792        return generator(self, req)
5793
5794
5795class WorkflowAssignments:
5796    '''
5797     WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request
5798     access to via the workflow.
5799    See `strongdm.models.WorkflowAssignment`.
5800    '''
5801    def __init__(self, channel, client):
5802        self.parent = client
5803        self.stub = WorkflowAssignmentsStub(channel)
5804
5805    def list(self, filter, *args, timeout=None):
5806        '''
5807         Lists existing workflow assignments.
5808        '''
5809        req = WorkflowAssignmentsListRequest()
5810        req.meta.CopyFrom(ListRequestMetadata())
5811        if self.parent.page_limit > 0:
5812            req.meta.limit = self.parent.page_limit
5813        if self.parent.snapshot_datetime is not None:
5814            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5815
5816        req.filter = plumbing.quote_filter_args(filter, *args)
5817
5818        def generator(svc, req):
5819            tries = 0
5820            while True:
5821                try:
5822                    plumbing_response = svc.stub.List(
5823                        req,
5824                        metadata=svc.parent.get_metadata(
5825                            'WorkflowAssignments.List', req),
5826                        timeout=timeout)
5827                except Exception as e:
5828                    if self.parent.shouldRetry(tries, e):
5829                        tries += 1
5830                        self.parent.jitterSleep(tries)
5831                        continue
5832                    raise plumbing.convert_error_to_porcelain(e) from e
5833                tries = 0
5834                for plumbing_item in plumbing_response.workflow_assignments:
5835                    yield plumbing.convert_workflow_assignment_to_porcelain(
5836                        plumbing_item)
5837                if plumbing_response.meta.next_cursor == '':
5838                    break
5839                req.meta.cursor = plumbing_response.meta.next_cursor
5840
5841        return generator(self, req)
5842
5843
5844class SnapshotWorkflowAssignments:
5845    '''
5846    SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments
5847    service for historical queries.
5848    '''
5849    def __init__(self, workflow_assignments):
5850        self.workflow_assignments = workflow_assignments
5851
5852    def list(self, filter, *args, timeout=None):
5853        '''
5854         Lists existing workflow assignments.
5855        '''
5856        return self.workflow_assignments.list(filter, *args, timeout=timeout)
5857
5858
5859class WorkflowAssignmentsHistory:
5860    '''
5861     WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment.
5862    See `strongdm.models.WorkflowAssignmentHistory`.
5863    '''
5864    def __init__(self, channel, client):
5865        self.parent = client
5866        self.stub = WorkflowAssignmentsHistoryStub(channel)
5867
5868    def list(self, filter, *args, timeout=None):
5869        '''
5870         List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.
5871        '''
5872        req = WorkflowAssignmentsHistoryListRequest()
5873        req.meta.CopyFrom(ListRequestMetadata())
5874        if self.parent.page_limit > 0:
5875            req.meta.limit = self.parent.page_limit
5876        if self.parent.snapshot_datetime is not None:
5877            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5878
5879        req.filter = plumbing.quote_filter_args(filter, *args)
5880
5881        def generator(svc, req):
5882            tries = 0
5883            while True:
5884                try:
5885                    plumbing_response = svc.stub.List(
5886                        req,
5887                        metadata=svc.parent.get_metadata(
5888                            'WorkflowAssignmentsHistory.List', req),
5889                        timeout=timeout)
5890                except Exception as e:
5891                    if self.parent.shouldRetry(tries, e):
5892                        tries += 1
5893                        self.parent.jitterSleep(tries)
5894                        continue
5895                    raise plumbing.convert_error_to_porcelain(e) from e
5896                tries = 0
5897                for plumbing_item in plumbing_response.history:
5898                    yield plumbing.convert_workflow_assignment_history_to_porcelain(
5899                        plumbing_item)
5900                if plumbing_response.meta.next_cursor == '':
5901                    break
5902                req.meta.cursor = plumbing_response.meta.next_cursor
5903
5904        return generator(self, req)
5905
5906
5907class WorkflowRoles:
5908    '''
5909     WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
5910     to request access to a resource via the workflow.
5911    See `strongdm.models.WorkflowRole`.
5912    '''
5913    def __init__(self, channel, client):
5914        self.parent = client
5915        self.stub = WorkflowRolesStub(channel)
5916
5917    def create(self, workflow_role, timeout=None):
5918        '''
5919         Create creates a new workflow role
5920        '''
5921        req = WorkflowRolesCreateRequest()
5922
5923        if workflow_role is not None:
5924            req.workflow_role.CopyFrom(
5925                plumbing.convert_workflow_role_to_plumbing(workflow_role))
5926        tries = 0
5927        plumbing_response = None
5928        while True:
5929            try:
5930                plumbing_response = self.stub.Create(
5931                    req,
5932                    metadata=self.parent.get_metadata('WorkflowRoles.Create',
5933                                                      req),
5934                    timeout=timeout)
5935            except Exception as e:
5936                if self.parent.shouldRetry(tries, e):
5937                    tries += 1
5938                    self.parent.jitterSleep(tries)
5939                    continue
5940                raise plumbing.convert_error_to_porcelain(e) from e
5941            break
5942
5943        resp = models.WorkflowRolesCreateResponse()
5944        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5945            plumbing_response.rate_limit)
5946        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5947            plumbing_response.workflow_role)
5948        return resp
5949
5950    def get(self, id, timeout=None):
5951        '''
5952         Get reads one workflow role by ID.
5953        '''
5954        req = WorkflowRoleGetRequest()
5955        if self.parent.snapshot_datetime is not None:
5956            req.meta.CopyFrom(GetRequestMetadata())
5957            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5958
5959        req.id = (id)
5960        tries = 0
5961        plumbing_response = None
5962        while True:
5963            try:
5964                plumbing_response = self.stub.Get(
5965                    req,
5966                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
5967                                                      req),
5968                    timeout=timeout)
5969            except Exception as e:
5970                if self.parent.shouldRetry(tries, e):
5971                    tries += 1
5972                    self.parent.jitterSleep(tries)
5973                    continue
5974                raise plumbing.convert_error_to_porcelain(e) from e
5975            break
5976
5977        resp = models.WorkflowRoleGetResponse()
5978        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5979            plumbing_response.meta)
5980        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5981            plumbing_response.rate_limit)
5982        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5983            plumbing_response.workflow_role)
5984        return resp
5985
5986    def delete(self, id, timeout=None):
5987        '''
5988         Delete deletes a workflow role
5989        '''
5990        req = WorkflowRolesDeleteRequest()
5991
5992        req.id = (id)
5993        tries = 0
5994        plumbing_response = None
5995        while True:
5996            try:
5997                plumbing_response = self.stub.Delete(
5998                    req,
5999                    metadata=self.parent.get_metadata('WorkflowRoles.Delete',
6000                                                      req),
6001                    timeout=timeout)
6002            except Exception as e:
6003                if self.parent.shouldRetry(tries, e):
6004                    tries += 1
6005                    self.parent.jitterSleep(tries)
6006                    continue
6007                raise plumbing.convert_error_to_porcelain(e) from e
6008            break
6009
6010        resp = models.WorkflowRolesDeleteResponse()
6011        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6012            plumbing_response.rate_limit)
6013        return resp
6014
6015    def list(self, filter, *args, timeout=None):
6016        '''
6017         Lists existing workflow roles.
6018        '''
6019        req = WorkflowRolesListRequest()
6020        req.meta.CopyFrom(ListRequestMetadata())
6021        if self.parent.page_limit > 0:
6022            req.meta.limit = self.parent.page_limit
6023        if self.parent.snapshot_datetime is not None:
6024            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6025
6026        req.filter = plumbing.quote_filter_args(filter, *args)
6027
6028        def generator(svc, req):
6029            tries = 0
6030            while True:
6031                try:
6032                    plumbing_response = svc.stub.List(
6033                        req,
6034                        metadata=svc.parent.get_metadata(
6035                            'WorkflowRoles.List', req),
6036                        timeout=timeout)
6037                except Exception as e:
6038                    if self.parent.shouldRetry(tries, e):
6039                        tries += 1
6040                        self.parent.jitterSleep(tries)
6041                        continue
6042                    raise plumbing.convert_error_to_porcelain(e) from e
6043                tries = 0
6044                for plumbing_item in plumbing_response.workflow_role:
6045                    yield plumbing.convert_workflow_role_to_porcelain(
6046                        plumbing_item)
6047                if plumbing_response.meta.next_cursor == '':
6048                    break
6049                req.meta.cursor = plumbing_response.meta.next_cursor
6050
6051        return generator(self, req)
6052
6053
6054class SnapshotWorkflowRoles:
6055    '''
6056    SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles
6057    service for historical queries.
6058    '''
6059    def __init__(self, workflow_roles):
6060        self.workflow_roles = workflow_roles
6061
6062    def get(self, id, timeout=None):
6063        '''
6064         Get reads one workflow role by ID.
6065        '''
6066        return self.workflow_roles.get(id, timeout=timeout)
6067
6068    def list(self, filter, *args, timeout=None):
6069        '''
6070         Lists existing workflow roles.
6071        '''
6072        return self.workflow_roles.list(filter, *args, timeout=timeout)
6073
6074
6075class WorkflowRolesHistory:
6076    '''
6077     WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole
6078    See `strongdm.models.WorkflowRoleHistory`.
6079    '''
6080    def __init__(self, channel, client):
6081        self.parent = client
6082        self.stub = WorkflowRolesHistoryStub(channel)
6083
6084    def list(self, filter, *args, timeout=None):
6085        '''
6086         List gets a list of WorkflowRolesHistory records matching a given set of criteria.
6087        '''
6088        req = WorkflowRolesHistoryListRequest()
6089        req.meta.CopyFrom(ListRequestMetadata())
6090        if self.parent.page_limit > 0:
6091            req.meta.limit = self.parent.page_limit
6092        if self.parent.snapshot_datetime is not None:
6093            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6094
6095        req.filter = plumbing.quote_filter_args(filter, *args)
6096
6097        def generator(svc, req):
6098            tries = 0
6099            while True:
6100                try:
6101                    plumbing_response = svc.stub.List(
6102                        req,
6103                        metadata=svc.parent.get_metadata(
6104                            'WorkflowRolesHistory.List', req),
6105                        timeout=timeout)
6106                except Exception as e:
6107                    if self.parent.shouldRetry(tries, e):
6108                        tries += 1
6109                        self.parent.jitterSleep(tries)
6110                        continue
6111                    raise plumbing.convert_error_to_porcelain(e) from e
6112                tries = 0
6113                for plumbing_item in plumbing_response.history:
6114                    yield plumbing.convert_workflow_role_history_to_porcelain(
6115                        plumbing_item)
6116                if plumbing_response.meta.next_cursor == '':
6117                    break
6118                req.meta.cursor = plumbing_response.meta.next_cursor
6119
6120        return generator(self, req)
6121
6122
6123class Workflows:
6124    '''
6125     Workflows are the collection of rules that define the resources to which access can be requested,
6126     the users that can request that access, and the mechanism for approving those requests which can either
6127     be automatic approval or a set of users authorized to approve the requests.
6128    See `strongdm.models.Workflow`.
6129    '''
6130    def __init__(self, channel, client):
6131        self.parent = client
6132        self.stub = WorkflowsStub(channel)
6133
6134    def create(self, workflow, timeout=None):
6135        '''
6136         Create creates a new workflow and requires a name for the workflow.
6137        '''
6138        req = WorkflowCreateRequest()
6139
6140        if workflow is not None:
6141            req.workflow.CopyFrom(
6142                plumbing.convert_workflow_to_plumbing(workflow))
6143        tries = 0
6144        plumbing_response = None
6145        while True:
6146            try:
6147                plumbing_response = self.stub.Create(
6148                    req,
6149                    metadata=self.parent.get_metadata('Workflows.Create', req),
6150                    timeout=timeout)
6151            except Exception as e:
6152                if self.parent.shouldRetry(tries, e):
6153                    tries += 1
6154                    self.parent.jitterSleep(tries)
6155                    continue
6156                raise plumbing.convert_error_to_porcelain(e) from e
6157            break
6158
6159        resp = models.WorkflowCreateResponse()
6160        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6161            plumbing_response.rate_limit)
6162        resp.workflow = plumbing.convert_workflow_to_porcelain(
6163            plumbing_response.workflow)
6164        return resp
6165
6166    def get(self, id, timeout=None):
6167        '''
6168         Get reads one workflow by ID.
6169        '''
6170        req = WorkflowGetRequest()
6171        if self.parent.snapshot_datetime is not None:
6172            req.meta.CopyFrom(GetRequestMetadata())
6173            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6174
6175        req.id = (id)
6176        tries = 0
6177        plumbing_response = None
6178        while True:
6179            try:
6180                plumbing_response = self.stub.Get(
6181                    req,
6182                    metadata=self.parent.get_metadata('Workflows.Get', req),
6183                    timeout=timeout)
6184            except Exception as e:
6185                if self.parent.shouldRetry(tries, e):
6186                    tries += 1
6187                    self.parent.jitterSleep(tries)
6188                    continue
6189                raise plumbing.convert_error_to_porcelain(e) from e
6190            break
6191
6192        resp = models.WorkflowGetResponse()
6193        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6194            plumbing_response.meta)
6195        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6196            plumbing_response.rate_limit)
6197        resp.workflow = plumbing.convert_workflow_to_porcelain(
6198            plumbing_response.workflow)
6199        return resp
6200
6201    def delete(self, id, timeout=None):
6202        '''
6203         Delete deletes an existing workflow.
6204        '''
6205        req = WorkflowDeleteRequest()
6206
6207        req.id = (id)
6208        tries = 0
6209        plumbing_response = None
6210        while True:
6211            try:
6212                plumbing_response = self.stub.Delete(
6213                    req,
6214                    metadata=self.parent.get_metadata('Workflows.Delete', req),
6215                    timeout=timeout)
6216            except Exception as e:
6217                if self.parent.shouldRetry(tries, e):
6218                    tries += 1
6219                    self.parent.jitterSleep(tries)
6220                    continue
6221                raise plumbing.convert_error_to_porcelain(e) from e
6222            break
6223
6224        resp = models.WorkflowDeleteResponse()
6225        resp.id = (plumbing_response.id)
6226        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6227            plumbing_response.rate_limit)
6228        return resp
6229
6230    def update(self, workflow, timeout=None):
6231        '''
6232         Update updates an existing workflow.
6233        '''
6234        req = WorkflowUpdateRequest()
6235
6236        if workflow is not None:
6237            req.workflow.CopyFrom(
6238                plumbing.convert_workflow_to_plumbing(workflow))
6239        tries = 0
6240        plumbing_response = None
6241        while True:
6242            try:
6243                plumbing_response = self.stub.Update(
6244                    req,
6245                    metadata=self.parent.get_metadata('Workflows.Update', req),
6246                    timeout=timeout)
6247            except Exception as e:
6248                if self.parent.shouldRetry(tries, e):
6249                    tries += 1
6250                    self.parent.jitterSleep(tries)
6251                    continue
6252                raise plumbing.convert_error_to_porcelain(e) from e
6253            break
6254
6255        resp = models.WorkflowUpdateResponse()
6256        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6257            plumbing_response.rate_limit)
6258        resp.workflow = plumbing.convert_workflow_to_porcelain(
6259            plumbing_response.workflow)
6260        return resp
6261
6262    def list(self, filter, *args, timeout=None):
6263        '''
6264         Lists existing workflows.
6265        '''
6266        req = WorkflowListRequest()
6267        req.meta.CopyFrom(ListRequestMetadata())
6268        if self.parent.page_limit > 0:
6269            req.meta.limit = self.parent.page_limit
6270        if self.parent.snapshot_datetime is not None:
6271            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6272
6273        req.filter = plumbing.quote_filter_args(filter, *args)
6274
6275        def generator(svc, req):
6276            tries = 0
6277            while True:
6278                try:
6279                    plumbing_response = svc.stub.List(
6280                        req,
6281                        metadata=svc.parent.get_metadata(
6282                            'Workflows.List', req),
6283                        timeout=timeout)
6284                except Exception as e:
6285                    if self.parent.shouldRetry(tries, e):
6286                        tries += 1
6287                        self.parent.jitterSleep(tries)
6288                        continue
6289                    raise plumbing.convert_error_to_porcelain(e) from e
6290                tries = 0
6291                for plumbing_item in plumbing_response.workflows:
6292                    yield plumbing.convert_workflow_to_porcelain(plumbing_item)
6293                if plumbing_response.meta.next_cursor == '':
6294                    break
6295                req.meta.cursor = plumbing_response.meta.next_cursor
6296
6297        return generator(self, req)
6298
6299
6300class SnapshotWorkflows:
6301    '''
6302    SnapshotWorkflows exposes the read only methods of the Workflows
6303    service for historical queries.
6304    '''
6305    def __init__(self, workflows):
6306        self.workflows = workflows
6307
6308    def get(self, id, timeout=None):
6309        '''
6310         Get reads one workflow by ID.
6311        '''
6312        return self.workflows.get(id, timeout=timeout)
6313
6314    def list(self, filter, *args, timeout=None):
6315        '''
6316         Lists existing workflows.
6317        '''
6318        return self.workflows.list(filter, *args, timeout=timeout)
6319
6320
6321class WorkflowsHistory:
6322    '''
6323     WorkflowsHistory provides records of all changes to the state of a Workflow.
6324    See `strongdm.models.WorkflowHistory`.
6325    '''
6326    def __init__(self, channel, client):
6327        self.parent = client
6328        self.stub = WorkflowsHistoryStub(channel)
6329
6330    def list(self, filter, *args, timeout=None):
6331        '''
6332         List gets a list of WorkflowHistory records matching a given set of criteria.
6333        '''
6334        req = WorkflowHistoryListRequest()
6335        req.meta.CopyFrom(ListRequestMetadata())
6336        if self.parent.page_limit > 0:
6337            req.meta.limit = self.parent.page_limit
6338        if self.parent.snapshot_datetime is not None:
6339            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6340
6341        req.filter = plumbing.quote_filter_args(filter, *args)
6342
6343        def generator(svc, req):
6344            tries = 0
6345            while True:
6346                try:
6347                    plumbing_response = svc.stub.List(
6348                        req,
6349                        metadata=svc.parent.get_metadata(
6350                            'WorkflowsHistory.List', req),
6351                        timeout=timeout)
6352                except Exception as e:
6353                    if self.parent.shouldRetry(tries, e):
6354                        tries += 1
6355                        self.parent.jitterSleep(tries)
6356                        continue
6357                    raise plumbing.convert_error_to_porcelain(e) from e
6358                tries = 0
6359                for plumbing_item in plumbing_response.history:
6360                    yield plumbing.convert_workflow_history_to_porcelain(
6361                        plumbing_item)
6362                if plumbing_response.meta.next_cursor == '':
6363                    break
6364                req.meta.cursor = plumbing_response.meta.next_cursor
6365
6366        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.AmazonESIAM`
4469    `strongdm.models.AmazonMQAMQP091`
4470    `strongdm.models.Athena`
4471    `strongdm.models.AthenaIAM`
4472    `strongdm.models.AuroraMysql`
4473    `strongdm.models.AuroraMysqlIAM`
4474    `strongdm.models.AuroraPostgres`
4475    `strongdm.models.AuroraPostgresIAM`
4476    `strongdm.models.AWS`
4477    `strongdm.models.AWSConsole`
4478    `strongdm.models.AWSConsoleStaticKeyPair`
4479    `strongdm.models.AWSInstanceProfile`
4480    `strongdm.models.Azure`
4481    `strongdm.models.AzureCertificate`
4482    `strongdm.models.AzureMysql`
4483    `strongdm.models.AzurePostgres`
4484    `strongdm.models.AzurePostgresManagedIdentity`
4485    `strongdm.models.BigQuery`
4486    `strongdm.models.Cassandra`
4487    `strongdm.models.Citus`
4488    `strongdm.models.ClickHouseHTTP`
4489    `strongdm.models.ClickHouseMySQL`
4490    `strongdm.models.ClickHouseTCP`
4491    `strongdm.models.Clustrix`
4492    `strongdm.models.Cockroach`
4493    `strongdm.models.CouchbaseDatabase`
4494    `strongdm.models.CouchbaseWebUI`
4495    `strongdm.models.DB2I`
4496    `strongdm.models.DB2LUW`
4497    `strongdm.models.DocumentDBHost`
4498    `strongdm.models.DocumentDBHostIAM`
4499    `strongdm.models.DocumentDBReplicaSet`
4500    `strongdm.models.Druid`
4501    `strongdm.models.DynamoDB`
4502    `strongdm.models.DynamoDBIAM`
4503    `strongdm.models.Elastic`
4504    `strongdm.models.ElasticacheRedis`
4505    `strongdm.models.GCP`
4506    `strongdm.models.GCPConsole`
4507    `strongdm.models.GCPWIF`
4508    `strongdm.models.GoogleGKE`
4509    `strongdm.models.GoogleGKEUserImpersonation`
4510    `strongdm.models.Greenplum`
4511    `strongdm.models.HTTPAuth`
4512    `strongdm.models.HTTPBasicAuth`
4513    `strongdm.models.HTTPNoAuth`
4514    `strongdm.models.Kubernetes`
4515    `strongdm.models.KubernetesBasicAuth`
4516    `strongdm.models.KubernetesServiceAccount`
4517    `strongdm.models.KubernetesServiceAccountUserImpersonation`
4518    `strongdm.models.KubernetesUserImpersonation`
4519    `strongdm.models.Maria`
4520    `strongdm.models.Memcached`
4521    `strongdm.models.Memsql`
4522    `strongdm.models.MongoHost`
4523    `strongdm.models.MongoLegacyHost`
4524    `strongdm.models.MongoLegacyReplicaset`
4525    `strongdm.models.MongoReplicaSet`
4526    `strongdm.models.MongoShardedCluster`
4527    `strongdm.models.MTLSMysql`
4528    `strongdm.models.MTLSPostgres`
4529    `strongdm.models.Mysql`
4530    `strongdm.models.Neptune`
4531    `strongdm.models.NeptuneIAM`
4532    `strongdm.models.Oracle`
4533    `strongdm.models.Postgres`
4534    `strongdm.models.Presto`
4535    `strongdm.models.RabbitMQAMQP091`
4536    `strongdm.models.RawTCP`
4537    `strongdm.models.RDP`
4538    `strongdm.models.RDPCert`
4539    `strongdm.models.RDSPostgresIAM`
4540    `strongdm.models.Redis`
4541    `strongdm.models.Redshift`
4542    `strongdm.models.SingleStore`
4543    `strongdm.models.Snowflake`
4544    `strongdm.models.Snowsight`
4545    `strongdm.models.SQLServer`
4546    `strongdm.models.SQLServerAzureAD`
4547    `strongdm.models.SQLServerKerberosAD`
4548    `strongdm.models.SSH`
4549    `strongdm.models.SSHCert`
4550    `strongdm.models.SSHCustomerKey`
4551    `strongdm.models.SSHPassword`
4552    `strongdm.models.Sybase`
4553    `strongdm.models.SybaseIQ`
4554    `strongdm.models.Teradata`
4555    `strongdm.models.Trino`
4556    '''
4557    def __init__(self, channel, client):
4558        self.parent = client
4559        self.stub = ResourcesStub(channel)
4560
4561    def enumerate_tags(self, filter, *args, timeout=None):
4562        '''
4563         EnumerateTags gets a list of the filter matching tags.
4564        '''
4565        req = EnumerateTagsRequest()
4566        req.meta.CopyFrom(ListRequestMetadata())
4567        if self.parent.page_limit > 0:
4568            req.meta.limit = self.parent.page_limit
4569        if self.parent.snapshot_datetime is not None:
4570            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4571
4572        req.filter = plumbing.quote_filter_args(filter, *args)
4573
4574        def generator(svc, req):
4575            tries = 0
4576            while True:
4577                try:
4578                    plumbing_response = svc.stub.EnumerateTags(
4579                        req,
4580                        metadata=svc.parent.get_metadata(
4581                            'Resources.EnumerateTags', req),
4582                        timeout=timeout)
4583                except Exception as e:
4584                    if self.parent.shouldRetry(tries, e):
4585                        tries += 1
4586                        self.parent.jitterSleep(tries)
4587                        continue
4588                    raise plumbing.convert_error_to_porcelain(e) from e
4589                tries = 0
4590                for plumbing_item in plumbing_response.matches:
4591                    yield plumbing.convert_tag_to_porcelain(plumbing_item)
4592                if plumbing_response.meta.next_cursor == '':
4593                    break
4594                req.meta.cursor = plumbing_response.meta.next_cursor
4595
4596        return generator(self, req)
4597
4598    def create(self, resource, timeout=None):
4599        '''
4600         Create registers a new Resource.
4601        '''
4602        req = ResourceCreateRequest()
4603
4604        if resource is not None:
4605            req.resource.CopyFrom(
4606                plumbing.convert_resource_to_plumbing(resource))
4607        tries = 0
4608        plumbing_response = None
4609        while True:
4610            try:
4611                plumbing_response = self.stub.Create(
4612                    req,
4613                    metadata=self.parent.get_metadata('Resources.Create', req),
4614                    timeout=timeout)
4615            except Exception as e:
4616                if self.parent.shouldRetry(tries, e):
4617                    tries += 1
4618                    self.parent.jitterSleep(tries)
4619                    continue
4620                raise plumbing.convert_error_to_porcelain(e) from e
4621            break
4622
4623        resp = models.ResourceCreateResponse()
4624        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4625            plumbing_response.meta)
4626        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4627            plumbing_response.rate_limit)
4628        resp.resource = plumbing.convert_resource_to_porcelain(
4629            plumbing_response.resource)
4630        return resp
4631
4632    def get(self, id, timeout=None):
4633        '''
4634         Get reads one Resource by ID.
4635        '''
4636        req = ResourceGetRequest()
4637        if self.parent.snapshot_datetime is not None:
4638            req.meta.CopyFrom(GetRequestMetadata())
4639            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4640
4641        req.id = (id)
4642        tries = 0
4643        plumbing_response = None
4644        while True:
4645            try:
4646                plumbing_response = self.stub.Get(
4647                    req,
4648                    metadata=self.parent.get_metadata('Resources.Get', req),
4649                    timeout=timeout)
4650            except Exception as e:
4651                if self.parent.shouldRetry(tries, e):
4652                    tries += 1
4653                    self.parent.jitterSleep(tries)
4654                    continue
4655                raise plumbing.convert_error_to_porcelain(e) from e
4656            break
4657
4658        resp = models.ResourceGetResponse()
4659        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4660            plumbing_response.meta)
4661        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4662            plumbing_response.rate_limit)
4663        resp.resource = plumbing.convert_resource_to_porcelain(
4664            plumbing_response.resource)
4665        return resp
4666
4667    def update(self, resource, timeout=None):
4668        '''
4669         Update replaces all the fields of a Resource by ID.
4670        '''
4671        req = ResourceUpdateRequest()
4672
4673        if resource is not None:
4674            req.resource.CopyFrom(
4675                plumbing.convert_resource_to_plumbing(resource))
4676        tries = 0
4677        plumbing_response = None
4678        while True:
4679            try:
4680                plumbing_response = self.stub.Update(
4681                    req,
4682                    metadata=self.parent.get_metadata('Resources.Update', req),
4683                    timeout=timeout)
4684            except Exception as e:
4685                if self.parent.shouldRetry(tries, e):
4686                    tries += 1
4687                    self.parent.jitterSleep(tries)
4688                    continue
4689                raise plumbing.convert_error_to_porcelain(e) from e
4690            break
4691
4692        resp = models.ResourceUpdateResponse()
4693        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4694            plumbing_response.meta)
4695        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4696            plumbing_response.rate_limit)
4697        resp.resource = plumbing.convert_resource_to_porcelain(
4698            plumbing_response.resource)
4699        return resp
4700
4701    def delete(self, id, timeout=None):
4702        '''
4703         Delete removes a Resource by ID.
4704        '''
4705        req = ResourceDeleteRequest()
4706
4707        req.id = (id)
4708        tries = 0
4709        plumbing_response = None
4710        while True:
4711            try:
4712                plumbing_response = self.stub.Delete(
4713                    req,
4714                    metadata=self.parent.get_metadata('Resources.Delete', req),
4715                    timeout=timeout)
4716            except Exception as e:
4717                if self.parent.shouldRetry(tries, e):
4718                    tries += 1
4719                    self.parent.jitterSleep(tries)
4720                    continue
4721                raise plumbing.convert_error_to_porcelain(e) from e
4722            break
4723
4724        resp = models.ResourceDeleteResponse()
4725        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4726            plumbing_response.meta)
4727        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4728            plumbing_response.rate_limit)
4729        return resp
4730
4731    def list(self, filter, *args, timeout=None):
4732        '''
4733         List gets a list of Resources matching a given set of criteria.
4734        '''
4735        req = ResourceListRequest()
4736        req.meta.CopyFrom(ListRequestMetadata())
4737        if self.parent.page_limit > 0:
4738            req.meta.limit = self.parent.page_limit
4739        if self.parent.snapshot_datetime is not None:
4740            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4741
4742        req.filter = plumbing.quote_filter_args(filter, *args)
4743
4744        def generator(svc, req):
4745            tries = 0
4746            while True:
4747                try:
4748                    plumbing_response = svc.stub.List(
4749                        req,
4750                        metadata=svc.parent.get_metadata(
4751                            'Resources.List', req),
4752                        timeout=timeout)
4753                except Exception as e:
4754                    if self.parent.shouldRetry(tries, e):
4755                        tries += 1
4756                        self.parent.jitterSleep(tries)
4757                        continue
4758                    raise plumbing.convert_error_to_porcelain(e) from e
4759                tries = 0
4760                for plumbing_item in plumbing_response.resources:
4761                    yield plumbing.convert_resource_to_porcelain(plumbing_item)
4762                if plumbing_response.meta.next_cursor == '':
4763                    break
4764                req.meta.cursor = plumbing_response.meta.next_cursor
4765
4766        return generator(self, req)
4767
4768    def healthcheck(self, id, timeout=None):
4769        '''
4770         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
4771         large network of Nodes. The call will return immediately, and the updated health of the
4772         Resource can be retrieved via Get or List.
4773        '''
4774        req = ResourceHealthcheckRequest()
4775
4776        req.id = (id)
4777        tries = 0
4778        plumbing_response = None
4779        while True:
4780            try:
4781                plumbing_response = self.stub.Healthcheck(
4782                    req,
4783                    metadata=self.parent.get_metadata('Resources.Healthcheck',
4784                                                      req),
4785                    timeout=timeout)
4786            except Exception as e:
4787                if self.parent.shouldRetry(tries, e):
4788                    tries += 1
4789                    self.parent.jitterSleep(tries)
4790                    continue
4791                raise plumbing.convert_error_to_porcelain(e) from e
4792            break
4793
4794        resp = models.ResourceHealthcheckResponse()
4795        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4796            plumbing_response.meta)
4797        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4798            plumbing_response.rate_limit)
4799        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.AmazonESIAM strongdm.models.AmazonMQAMQP091 strongdm.models.Athena strongdm.models.AthenaIAM strongdm.models.AuroraMysql strongdm.models.AuroraMysqlIAM 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.ClickHouseHTTP strongdm.models.ClickHouseMySQL strongdm.models.ClickHouseTCP strongdm.models.Clustrix strongdm.models.Cockroach strongdm.models.CouchbaseDatabase strongdm.models.CouchbaseWebUI strongdm.models.DB2I strongdm.models.DB2LUW strongdm.models.DocumentDBHost strongdm.models.DocumentDBHostIAM strongdm.models.DocumentDBReplicaSet strongdm.models.Druid strongdm.models.DynamoDB strongdm.models.DynamoDBIAM 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)
4557    def __init__(self, channel, client):
4558        self.parent = client
4559        self.stub = ResourcesStub(channel)
def enumerate_tags(self, filter, *args, timeout=None)
4561    def enumerate_tags(self, filter, *args, timeout=None):
4562        '''
4563         EnumerateTags gets a list of the filter matching tags.
4564        '''
4565        req = EnumerateTagsRequest()
4566        req.meta.CopyFrom(ListRequestMetadata())
4567        if self.parent.page_limit > 0:
4568            req.meta.limit = self.parent.page_limit
4569        if self.parent.snapshot_datetime is not None:
4570            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4571
4572        req.filter = plumbing.quote_filter_args(filter, *args)
4573
4574        def generator(svc, req):
4575            tries = 0
4576            while True:
4577                try:
4578                    plumbing_response = svc.stub.EnumerateTags(
4579                        req,
4580                        metadata=svc.parent.get_metadata(
4581                            'Resources.EnumerateTags', req),
4582                        timeout=timeout)
4583                except Exception as e:
4584                    if self.parent.shouldRetry(tries, e):
4585                        tries += 1
4586                        self.parent.jitterSleep(tries)
4587                        continue
4588                    raise plumbing.convert_error_to_porcelain(e) from e
4589                tries = 0
4590                for plumbing_item in plumbing_response.matches:
4591                    yield plumbing.convert_tag_to_porcelain(plumbing_item)
4592                if plumbing_response.meta.next_cursor == '':
4593                    break
4594                req.meta.cursor = plumbing_response.meta.next_cursor
4595
4596        return generator(self, req)

EnumerateTags gets a list of the filter matching tags.

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

Create registers a new Resource.

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

Get reads one Resource by ID.

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

Update replaces all the fields of a Resource by ID.

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

Delete removes a Resource by ID.

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

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

def healthcheck(self, id, timeout=None)
4768    def healthcheck(self, id, timeout=None):
4769        '''
4770         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
4771         large network of Nodes. The call will return immediately, and the updated health of the
4772         Resource can be retrieved via Get or List.
4773        '''
4774        req = ResourceHealthcheckRequest()
4775
4776        req.id = (id)
4777        tries = 0
4778        plumbing_response = None
4779        while True:
4780            try:
4781                plumbing_response = self.stub.Healthcheck(
4782                    req,
4783                    metadata=self.parent.get_metadata('Resources.Healthcheck',
4784                                                      req),
4785                    timeout=timeout)
4786            except Exception as e:
4787                if self.parent.shouldRetry(tries, e):
4788                    tries += 1
4789                    self.parent.jitterSleep(tries)
4790                    continue
4791                raise plumbing.convert_error_to_porcelain(e) from e
4792            break
4793
4794        resp = models.ResourceHealthcheckResponse()
4795        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4796            plumbing_response.meta)
4797        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4798            plumbing_response.rate_limit)
4799        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:
4802class SnapshotResources:
4803    '''
4804    SnapshotResources exposes the read only methods of the Resources
4805    service for historical queries.
4806    '''
4807    def __init__(self, resources):
4808        self.resources = resources
4809
4810    def get(self, id, timeout=None):
4811        '''
4812         Get reads one Resource by ID.
4813        '''
4814        return self.resources.get(id, timeout=timeout)
4815
4816    def list(self, filter, *args, timeout=None):
4817        '''
4818         List gets a list of Resources matching a given set of criteria.
4819        '''
4820        return self.resources.list(filter, *args, timeout=timeout)

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

SnapshotResources(resources)
4807    def __init__(self, resources):
4808        self.resources = resources
def get(self, id, timeout=None)
4810    def get(self, id, timeout=None):
4811        '''
4812         Get reads one Resource by ID.
4813        '''
4814        return self.resources.get(id, timeout=timeout)

Get reads one Resource by ID.

def list(self, filter, *args, timeout=None)
4816    def list(self, filter, *args, timeout=None):
4817        '''
4818         List gets a list of Resources matching a given set of criteria.
4819        '''
4820        return self.resources.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

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

class SnapshotRoleResources:
4920class SnapshotRoleResources:
4921    '''
4922    SnapshotRoleResources exposes the read only methods of the RoleResources
4923    service for historical queries.
4924    '''
4925    def __init__(self, role_resources):
4926        self.role_resources = role_resources
4927
4928    def list(self, filter, *args, timeout=None):
4929        '''
4930         List gets a list of RoleResource records matching a given set of criteria.
4931        '''
4932        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)
4925    def __init__(self, role_resources):
4926        self.role_resources = role_resources
def list(self, filter, *args, timeout=None)
4928    def list(self, filter, *args, timeout=None):
4929        '''
4930         List gets a list of RoleResource records matching a given set of criteria.
4931        '''
4932        return self.role_resources.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

Create registers a new Role.

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

Get reads one Role by ID.

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

Update replaces all the fields of a Role by ID.

def delete(self, id, timeout=None)
5092    def delete(self, id, timeout=None):
5093        '''
5094         Delete removes a Role by ID.
5095        '''
5096        req = RoleDeleteRequest()
5097
5098        req.id = (id)
5099        tries = 0
5100        plumbing_response = None
5101        while True:
5102            try:
5103                plumbing_response = self.stub.Delete(
5104                    req,
5105                    metadata=self.parent.get_metadata('Roles.Delete', req),
5106                    timeout=timeout)
5107            except Exception as e:
5108                if self.parent.shouldRetry(tries, e):
5109                    tries += 1
5110                    self.parent.jitterSleep(tries)
5111                    continue
5112                raise plumbing.convert_error_to_porcelain(e) from e
5113            break
5114
5115        resp = models.RoleDeleteResponse()
5116        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5117            plumbing_response.meta)
5118        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5119            plumbing_response.rate_limit)
5120        return resp

Delete removes a Role by ID.

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

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

class SnapshotRoles:
5159class SnapshotRoles:
5160    '''
5161    SnapshotRoles exposes the read only methods of the Roles
5162    service for historical queries.
5163    '''
5164    def __init__(self, roles):
5165        self.roles = roles
5166
5167    def get(self, id, timeout=None):
5168        '''
5169         Get reads one Role by ID.
5170        '''
5171        return self.roles.get(id, timeout=timeout)
5172
5173    def list(self, filter, *args, timeout=None):
5174        '''
5175         List gets a list of Roles matching a given set of criteria.
5176        '''
5177        return self.roles.list(filter, *args, timeout=timeout)

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

SnapshotRoles(roles)
5164    def __init__(self, roles):
5165        self.roles = roles
def get(self, id, timeout=None)
5167    def get(self, id, timeout=None):
5168        '''
5169         Get reads one Role by ID.
5170        '''
5171        return self.roles.get(id, timeout=timeout)

Get reads one Role by ID.

def list(self, filter, *args, timeout=None)
5173    def list(self, filter, *args, timeout=None):
5174        '''
5175         List gets a list of Roles matching a given set of criteria.
5176        '''
5177        return self.roles.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

Get reads one SecretStore by ID.

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

Update replaces all the fields of a SecretStore by ID.

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

Delete removes a SecretStore by ID.

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

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

class SnapshotSecretStores:
5432class SnapshotSecretStores:
5433    '''
5434    SnapshotSecretStores exposes the read only methods of the SecretStores
5435    service for historical queries.
5436    '''
5437    def __init__(self, secret_stores):
5438        self.secret_stores = secret_stores
5439
5440    def get(self, id, timeout=None):
5441        '''
5442         Get reads one SecretStore by ID.
5443        '''
5444        return self.secret_stores.get(id, timeout=timeout)
5445
5446    def list(self, filter, *args, timeout=None):
5447        '''
5448         List gets a list of SecretStores matching a given set of criteria.
5449        '''
5450        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)
5437    def __init__(self, secret_stores):
5438        self.secret_stores = secret_stores
def get(self, id, timeout=None)
5440    def get(self, id, timeout=None):
5441        '''
5442         Get reads one SecretStore by ID.
5443        '''
5444        return self.secret_stores.get(id, timeout=timeout)

Get reads one SecretStore by ID.

def list(self, filter, *args, timeout=None)
5446    def list(self, filter, *args, timeout=None):
5447        '''
5448         List gets a list of SecretStores matching a given set of criteria.
5449        '''
5450        return self.secret_stores.list(filter, *args, timeout=timeout)

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

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

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

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

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

def healthcheck(self, secret_store_id, timeout=None)
5500    def healthcheck(self, secret_store_id, timeout=None):
5501        '''
5502         Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
5503         to propagate across a large network of Nodes. The call will return immediately, and the
5504         updated health of the Secret Store can be retrieved via List.
5505        '''
5506        req = SecretStoreHealthcheckRequest()
5507
5508        req.secret_store_id = (secret_store_id)
5509        tries = 0
5510        plumbing_response = None
5511        while True:
5512            try:
5513                plumbing_response = self.stub.Healthcheck(
5514                    req,
5515                    metadata=self.parent.get_metadata(
5516                        'SecretStoreHealths.Healthcheck', req),
5517                    timeout=timeout)
5518            except Exception as e:
5519                if self.parent.shouldRetry(tries, e):
5520                    tries += 1
5521                    self.parent.jitterSleep(tries)
5522                    continue
5523                raise plumbing.convert_error_to_porcelain(e) from e
5524            break
5525
5526        resp = models.SecretStoreHealthcheckResponse()
5527        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5528            plumbing_response.rate_limit)
5529        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:
5532class SecretStoresHistory:
5533    '''
5534     SecretStoresHistory records all changes to the state of a SecretStore.
5535    See `strongdm.models.SecretStoreHistory`.
5536    '''
5537    def __init__(self, channel, client):
5538        self.parent = client
5539        self.stub = SecretStoresHistoryStub(channel)
5540
5541    def list(self, filter, *args, timeout=None):
5542        '''
5543         List gets a list of SecretStoreHistory records matching a given set of criteria.
5544        '''
5545        req = SecretStoreHistoryListRequest()
5546        req.meta.CopyFrom(ListRequestMetadata())
5547        if self.parent.page_limit > 0:
5548            req.meta.limit = self.parent.page_limit
5549        if self.parent.snapshot_datetime is not None:
5550            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5551
5552        req.filter = plumbing.quote_filter_args(filter, *args)
5553
5554        def generator(svc, req):
5555            tries = 0
5556            while True:
5557                try:
5558                    plumbing_response = svc.stub.List(
5559                        req,
5560                        metadata=svc.parent.get_metadata(
5561                            'SecretStoresHistory.List', req),
5562                        timeout=timeout)
5563                except Exception as e:
5564                    if self.parent.shouldRetry(tries, e):
5565                        tries += 1
5566                        self.parent.jitterSleep(tries)
5567                        continue
5568                    raise plumbing.convert_error_to_porcelain(e) from e
5569                tries = 0
5570                for plumbing_item in plumbing_response.history:
5571                    yield plumbing.convert_secret_store_history_to_porcelain(
5572                        plumbing_item)
5573                if plumbing_response.meta.next_cursor == '':
5574                    break
5575                req.meta.cursor = plumbing_response.meta.next_cursor
5576
5577        return generator(self, req)

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

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

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

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

Create creates a new workflow approver

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

Get reads one workflow approver by ID.

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

Delete deletes a workflow approver

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

Lists existing workflow approvers.

class SnapshotWorkflowApprovers:
5727class SnapshotWorkflowApprovers:
5728    '''
5729    SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers
5730    service for historical queries.
5731    '''
5732    def __init__(self, workflow_approvers):
5733        self.workflow_approvers = workflow_approvers
5734
5735    def get(self, id, timeout=None):
5736        '''
5737         Get reads one workflow approver by ID.
5738        '''
5739        return self.workflow_approvers.get(id, timeout=timeout)
5740
5741    def list(self, filter, *args, timeout=None):
5742        '''
5743         Lists existing workflow approvers.
5744        '''
5745        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)
5732    def __init__(self, workflow_approvers):
5733        self.workflow_approvers = workflow_approvers
def get(self, id, timeout=None)
5735    def get(self, id, timeout=None):
5736        '''
5737         Get reads one workflow approver by ID.
5738        '''
5739        return self.workflow_approvers.get(id, timeout=timeout)

Get reads one workflow approver by ID.

def list(self, filter, *args, timeout=None)
5741    def list(self, filter, *args, timeout=None):
5742        '''
5743         Lists existing workflow approvers.
5744        '''
5745        return self.workflow_approvers.list(filter, *args, timeout=timeout)

Lists existing workflow approvers.

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

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

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

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

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

Lists existing workflow assignments.

class SnapshotWorkflowAssignments:
5845class SnapshotWorkflowAssignments:
5846    '''
5847    SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments
5848    service for historical queries.
5849    '''
5850    def __init__(self, workflow_assignments):
5851        self.workflow_assignments = workflow_assignments
5852
5853    def list(self, filter, *args, timeout=None):
5854        '''
5855         Lists existing workflow assignments.
5856        '''
5857        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)
5850    def __init__(self, workflow_assignments):
5851        self.workflow_assignments = workflow_assignments
def list(self, filter, *args, timeout=None)
5853    def list(self, filter, *args, timeout=None):
5854        '''
5855         Lists existing workflow assignments.
5856        '''
5857        return self.workflow_assignments.list(filter, *args, timeout=timeout)

Lists existing workflow assignments.

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

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

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

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

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

Create creates a new workflow role

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

Get reads one workflow role by ID.

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

Delete deletes a workflow role

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

Lists existing workflow roles.

class SnapshotWorkflowRoles:
6055class SnapshotWorkflowRoles:
6056    '''
6057    SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles
6058    service for historical queries.
6059    '''
6060    def __init__(self, workflow_roles):
6061        self.workflow_roles = workflow_roles
6062
6063    def get(self, id, timeout=None):
6064        '''
6065         Get reads one workflow role by ID.
6066        '''
6067        return self.workflow_roles.get(id, timeout=timeout)
6068
6069    def list(self, filter, *args, timeout=None):
6070        '''
6071         Lists existing workflow roles.
6072        '''
6073        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)
6060    def __init__(self, workflow_roles):
6061        self.workflow_roles = workflow_roles
def get(self, id, timeout=None)
6063    def get(self, id, timeout=None):
6064        '''
6065         Get reads one workflow role by ID.
6066        '''
6067        return self.workflow_roles.get(id, timeout=timeout)

Get reads one workflow role by ID.

def list(self, filter, *args, timeout=None)
6069    def list(self, filter, *args, timeout=None):
6070        '''
6071         Lists existing workflow roles.
6072        '''
6073        return self.workflow_roles.list(filter, *args, timeout=timeout)

Lists existing workflow roles.

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

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

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

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

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

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

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

Get reads one workflow by ID.

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

Delete deletes an existing workflow.

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

Update updates an existing workflow.

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

Lists existing workflows.

class SnapshotWorkflows:
6301class SnapshotWorkflows:
6302    '''
6303    SnapshotWorkflows exposes the read only methods of the Workflows
6304    service for historical queries.
6305    '''
6306    def __init__(self, workflows):
6307        self.workflows = workflows
6308
6309    def get(self, id, timeout=None):
6310        '''
6311         Get reads one workflow by ID.
6312        '''
6313        return self.workflows.get(id, timeout=timeout)
6314
6315    def list(self, filter, *args, timeout=None):
6316        '''
6317         Lists existing workflows.
6318        '''
6319        return self.workflows.list(filter, *args, timeout=timeout)

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

SnapshotWorkflows(workflows)
6306    def __init__(self, workflows):
6307        self.workflows = workflows
def get(self, id, timeout=None)
6309    def get(self, id, timeout=None):
6310        '''
6311         Get reads one workflow by ID.
6312        '''
6313        return self.workflows.get(id, timeout=timeout)

Get reads one workflow by ID.

def list(self, filter, *args, timeout=None)
6315    def list(self, filter, *args, timeout=None):
6316        '''
6317         Lists existing workflows.
6318        '''
6319        return self.workflows.list(filter, *args, timeout=timeout)

Lists existing workflows.

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

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

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

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