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

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

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

Lists existing access requests.

class SnapshotAccessRequests:
222class SnapshotAccessRequests:
223    '''
224    SnapshotAccessRequests exposes the read only methods of the AccessRequests
225    service for historical queries.
226    '''
227    def __init__(self, access_requests):
228        self.access_requests = access_requests
229
230    def list(self, filter, *args, timeout=None):
231        '''
232         Lists existing access requests.
233        '''
234        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)
227    def __init__(self, access_requests):
228        self.access_requests = access_requests
def list(self, filter, *args, timeout=None)
230    def list(self, filter, *args, timeout=None):
231        '''
232         Lists existing access requests.
233        '''
234        return self.access_requests.list(filter, *args, timeout=timeout)

Lists existing access requests.

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

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

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

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

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

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

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

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

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

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

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

Create registers a new AccountAttachment.

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

Get reads one AccountAttachment by ID.

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

Delete removes a AccountAttachment by ID.

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

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

class SnapshotAccountAttachments:
484class SnapshotAccountAttachments:
485    '''
486    SnapshotAccountAttachments exposes the read only methods of the AccountAttachments
487    service for historical queries.
488    '''
489    def __init__(self, account_attachments):
490        self.account_attachments = account_attachments
491
492    def get(self, id, timeout=None):
493        '''
494         Get reads one AccountAttachment by ID.
495        '''
496        return self.account_attachments.get(id, timeout=timeout)
497
498    def list(self, filter, *args, timeout=None):
499        '''
500         List gets a list of AccountAttachments matching a given set of criteria.
501        '''
502        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)
489    def __init__(self, account_attachments):
490        self.account_attachments = account_attachments
def get(self, id, timeout=None)
492    def get(self, id, timeout=None):
493        '''
494         Get reads one AccountAttachment by ID.
495        '''
496        return self.account_attachments.get(id, timeout=timeout)

Get reads one AccountAttachment by ID.

def list(self, filter, *args, timeout=None)
498    def list(self, filter, *args, timeout=None):
499        '''
500         List gets a list of AccountAttachments matching a given set of criteria.
501        '''
502        return self.account_attachments.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

Create registers a new AccountGrant.

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

Get reads one AccountGrant by ID.

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

Delete removes a AccountGrant by ID.

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

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

class SnapshotAccountGrants:
703class SnapshotAccountGrants:
704    '''
705    SnapshotAccountGrants exposes the read only methods of the AccountGrants
706    service for historical queries.
707    '''
708    def __init__(self, account_grants):
709        self.account_grants = account_grants
710
711    def get(self, id, timeout=None):
712        '''
713         Get reads one AccountGrant by ID.
714        '''
715        return self.account_grants.get(id, timeout=timeout)
716
717    def list(self, filter, *args, timeout=None):
718        '''
719         List gets a list of AccountGrants matching a given set of criteria.
720        '''
721        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)
708    def __init__(self, account_grants):
709        self.account_grants = account_grants
def get(self, id, timeout=None)
711    def get(self, id, timeout=None):
712        '''
713         Get reads one AccountGrant by ID.
714        '''
715        return self.account_grants.get(id, timeout=timeout)

Get reads one AccountGrant by ID.

def list(self, filter, *args, timeout=None)
717    def list(self, filter, *args, timeout=None):
718        '''
719         List gets a list of AccountGrants matching a given set of criteria.
720        '''
721        return self.account_grants.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

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

class SnapshotAccountPermissions:
821class SnapshotAccountPermissions:
822    '''
823    SnapshotAccountPermissions exposes the read only methods of the AccountPermissions
824    service for historical queries.
825    '''
826    def __init__(self, account_permissions):
827        self.account_permissions = account_permissions
828
829    def list(self, filter, *args, timeout=None):
830        '''
831         List gets a list of Permission records matching a given set of criteria.
832        '''
833        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)
826    def __init__(self, account_permissions):
827        self.account_permissions = account_permissions
def list(self, filter, *args, timeout=None)
829    def list(self, filter, *args, timeout=None):
830        '''
831         List gets a list of Permission records matching a given set of criteria.
832        '''
833        return self.account_permissions.list(filter, *args, timeout=timeout)

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

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

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

class SnapshotAccountResources:
885class SnapshotAccountResources:
886    '''
887    SnapshotAccountResources exposes the read only methods of the AccountResources
888    service for historical queries.
889    '''
890    def __init__(self, account_resources):
891        self.account_resources = account_resources
892
893    def list(self, filter, *args, timeout=None):
894        '''
895         List gets a list of AccountResource records matching a given set of criteria.
896        '''
897        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)
890    def __init__(self, account_resources):
891        self.account_resources = account_resources
def list(self, filter, *args, timeout=None)
893    def list(self, filter, *args, timeout=None):
894        '''
895         List gets a list of AccountResource records matching a given set of criteria.
896        '''
897        return self.account_resources.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

Create registers a new Account.

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

Get reads one Account by ID.

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

Update replaces all the fields of an Account by ID.

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

Delete removes an Account by ID.

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

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

class SnapshotAccounts:
1134class SnapshotAccounts:
1135    '''
1136    SnapshotAccounts exposes the read only methods of the Accounts
1137    service for historical queries.
1138    '''
1139    def __init__(self, accounts):
1140        self.accounts = accounts
1141
1142    def get(self, id, timeout=None):
1143        '''
1144         Get reads one Account by ID.
1145        '''
1146        return self.accounts.get(id, timeout=timeout)
1147
1148    def list(self, filter, *args, timeout=None):
1149        '''
1150         List gets a list of Accounts matching a given set of criteria.
1151        '''
1152        return self.accounts.list(filter, *args, timeout=timeout)

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

SnapshotAccounts(accounts)
1139    def __init__(self, accounts):
1140        self.accounts = accounts
def get(self, id, timeout=None)
1142    def get(self, id, timeout=None):
1143        '''
1144         Get reads one Account by ID.
1145        '''
1146        return self.accounts.get(id, timeout=timeout)

Get reads one Account by ID.

def list(self, filter, *args, timeout=None)
1148    def list(self, filter, *args, timeout=None):
1149        '''
1150         List gets a list of Accounts matching a given set of criteria.
1151        '''
1152        return self.accounts.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

Get reads one Activity by ID.

def list(self, filter, *args, timeout=None)
1249    def list(self, filter, *args, timeout=None):
1250        '''
1251         List gets a list of Activities matching a given set of criteria.
1252         The 'before' and 'after' filters can be used to control the time
1253         range of the output activities. If not provided, one week of back
1254         of activities will be returned.
1255        '''
1256        req = ActivityListRequest()
1257        req.meta.CopyFrom(ListRequestMetadata())
1258        if self.parent.page_limit > 0:
1259            req.meta.limit = self.parent.page_limit
1260        if self.parent.snapshot_datetime is not None:
1261            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1262
1263        req.filter = plumbing.quote_filter_args(filter, *args)
1264
1265        def generator(svc, req):
1266            tries = 0
1267            while True:
1268                try:
1269                    plumbing_response = svc.stub.List(
1270                        req,
1271                        metadata=svc.parent.get_metadata(
1272                            'Activities.List', req),
1273                        timeout=timeout)
1274                except Exception as e:
1275                    if self.parent.shouldRetry(tries, e):
1276                        tries += 1
1277                        self.parent.jitterSleep(tries)
1278                        continue
1279                    raise plumbing.convert_error_to_porcelain(e) from e
1280                tries = 0
1281                for plumbing_item in plumbing_response.activities:
1282                    yield plumbing.convert_activity_to_porcelain(plumbing_item)
1283                if plumbing_response.meta.next_cursor == '':
1284                    break
1285                req.meta.cursor = plumbing_response.meta.next_cursor
1286
1287        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:
1290class ApprovalWorkflowApprovers:
1291    '''
1292     ApprovalWorkflowApprovers link approval workflow approvers to an ApprovalWorkflowStep
1293    See `strongdm.models.ApprovalWorkflowApprover`.
1294    '''
1295    def __init__(self, channel, client):
1296        self.parent = client
1297        self.stub = ApprovalWorkflowApproversStub(channel)
1298
1299    def create(self, approval_workflow_approver, timeout=None):
1300        '''
1301         Deprecated: Create creates a new approval workflow approver.
1302        '''
1303        req = ApprovalWorkflowApproverCreateRequest()
1304
1305        if approval_workflow_approver is not None:
1306            req.approval_workflow_approver.CopyFrom(
1307                plumbing.convert_approval_workflow_approver_to_plumbing(
1308                    approval_workflow_approver))
1309        tries = 0
1310        plumbing_response = None
1311        while True:
1312            try:
1313                plumbing_response = self.stub.Create(
1314                    req,
1315                    metadata=self.parent.get_metadata(
1316                        'ApprovalWorkflowApprovers.Create', req),
1317                    timeout=timeout)
1318            except Exception as e:
1319                if self.parent.shouldRetry(tries, e):
1320                    tries += 1
1321                    self.parent.jitterSleep(tries)
1322                    continue
1323                raise plumbing.convert_error_to_porcelain(e) from e
1324            break
1325
1326        resp = models.ApprovalWorkflowApproverCreateResponse()
1327        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1328            plumbing_response.approval_workflow_approver)
1329        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1330            plumbing_response.rate_limit)
1331        return resp
1332
1333    def get(self, id, timeout=None):
1334        '''
1335         Deprecated: Get reads one approval workflow approver by ID.
1336        '''
1337        req = ApprovalWorkflowApproverGetRequest()
1338        if self.parent.snapshot_datetime is not None:
1339            req.meta.CopyFrom(GetRequestMetadata())
1340            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1341
1342        req.id = (id)
1343        tries = 0
1344        plumbing_response = None
1345        while True:
1346            try:
1347                plumbing_response = self.stub.Get(
1348                    req,
1349                    metadata=self.parent.get_metadata(
1350                        'ApprovalWorkflowApprovers.Get', req),
1351                    timeout=timeout)
1352            except Exception as e:
1353                if self.parent.shouldRetry(tries, e):
1354                    tries += 1
1355                    self.parent.jitterSleep(tries)
1356                    continue
1357                raise plumbing.convert_error_to_porcelain(e) from e
1358            break
1359
1360        resp = models.ApprovalWorkflowApproverGetResponse()
1361        resp.approval_workflow_approver = plumbing.convert_approval_workflow_approver_to_porcelain(
1362            plumbing_response.approval_workflow_approver)
1363        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
1364            plumbing_response.meta)
1365        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1366            plumbing_response.rate_limit)
1367        return resp
1368
1369    def delete(self, id, timeout=None):
1370        '''
1371         Deprecated: Delete deletes an existing approval workflow approver.
1372        '''
1373        req = ApprovalWorkflowApproverDeleteRequest()
1374
1375        req.id = (id)
1376        tries = 0
1377        plumbing_response = None
1378        while True:
1379            try:
1380                plumbing_response = self.stub.Delete(
1381                    req,
1382                    metadata=self.parent.get_metadata(
1383                        'ApprovalWorkflowApprovers.Delete', req),
1384                    timeout=timeout)
1385            except Exception as e:
1386                if self.parent.shouldRetry(tries, e):
1387                    tries += 1
1388                    self.parent.jitterSleep(tries)
1389                    continue
1390                raise plumbing.convert_error_to_porcelain(e) from e
1391            break
1392
1393        resp = models.ApprovalWorkflowApproverDeleteResponse()
1394        resp.id = (plumbing_response.id)
1395        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
1396            plumbing_response.rate_limit)
1397        return resp
1398
1399    def list(self, filter, *args, timeout=None):
1400        '''
1401         Deprecated: Lists existing approval workflow approvers.
1402        '''
1403        req = ApprovalWorkflowApproverListRequest()
1404        req.meta.CopyFrom(ListRequestMetadata())
1405        if self.parent.page_limit > 0:
1406            req.meta.limit = self.parent.page_limit
1407        if self.parent.snapshot_datetime is not None:
1408            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
1409
1410        req.filter = plumbing.quote_filter_args(filter, *args)
1411
1412        def generator(svc, req):
1413            tries = 0
1414            while True:
1415                try:
1416                    plumbing_response = svc.stub.List(
1417                        req,
1418                        metadata=svc.parent.get_metadata(
1419                            'ApprovalWorkflowApprovers.List', req),
1420                        timeout=timeout)
1421                except Exception as e:
1422                    if self.parent.shouldRetry(tries, e):
1423                        tries += 1
1424                        self.parent.jitterSleep(tries)
1425                        continue
1426                    raise plumbing.convert_error_to_porcelain(e) from e
1427                tries = 0
1428                for plumbing_item in plumbing_response.approval_workflow_approvers:
1429                    yield plumbing.convert_approval_workflow_approver_to_porcelain(
1430                        plumbing_item)
1431                if plumbing_response.meta.next_cursor == '':
1432                    break
1433                req.meta.cursor = plumbing_response.meta.next_cursor
1434
1435        return generator(self, req)

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

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

Deprecated: Create creates a new approval workflow approver.

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

Deprecated: Get reads one approval workflow approver by ID.

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

Deprecated: Delete deletes an existing approval workflow approver.

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

Deprecated: Lists existing approval workflow approvers.

class SnapshotApprovalWorkflowApprovers:
1438class SnapshotApprovalWorkflowApprovers:
1439    '''
1440    SnapshotApprovalWorkflowApprovers exposes the read only methods of the ApprovalWorkflowApprovers
1441    service for historical queries.
1442    '''
1443    def __init__(self, approval_workflow_approvers):
1444        self.approval_workflow_approvers = approval_workflow_approvers
1445
1446    def get(self, id, timeout=None):
1447        '''
1448         Deprecated: Get reads one approval workflow approver by ID.
1449        '''
1450        return self.approval_workflow_approvers.get(id, timeout=timeout)
1451
1452    def list(self, filter, *args, timeout=None):
1453        '''
1454         Deprecated: Lists existing approval workflow approvers.
1455        '''
1456        return self.approval_workflow_approvers.list(filter,
1457                                                     *args,
1458                                                     timeout=timeout)

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

SnapshotApprovalWorkflowApprovers(approval_workflow_approvers)
1443    def __init__(self, approval_workflow_approvers):
1444        self.approval_workflow_approvers = approval_workflow_approvers
def get(self, id, timeout=None)
1446    def get(self, id, timeout=None):
1447        '''
1448         Deprecated: Get reads one approval workflow approver by ID.
1449        '''
1450        return self.approval_workflow_approvers.get(id, timeout=timeout)

Deprecated: Get reads one approval workflow approver by ID.

def list(self, filter, *args, timeout=None)
1452    def list(self, filter, *args, timeout=None):
1453        '''
1454         Deprecated: Lists existing approval workflow approvers.
1455        '''
1456        return self.approval_workflow_approvers.list(filter,
1457                                                     *args,
1458                                                     timeout=timeout)

Deprecated: Lists existing approval workflow approvers.

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

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

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

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

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

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

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

Deprecated: Create creates a new approval workflow step.

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

Deprecated: Get reads one approval workflow step by ID.

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

Deprecated: Delete deletes an existing approval workflow step.

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

Deprecated: Lists existing approval workflow steps.

class SnapshotApprovalWorkflowSteps:
1657class SnapshotApprovalWorkflowSteps:
1658    '''
1659    SnapshotApprovalWorkflowSteps exposes the read only methods of the ApprovalWorkflowSteps
1660    service for historical queries.
1661    '''
1662    def __init__(self, approval_workflow_steps):
1663        self.approval_workflow_steps = approval_workflow_steps
1664
1665    def get(self, id, timeout=None):
1666        '''
1667         Deprecated: Get reads one approval workflow step by ID.
1668        '''
1669        return self.approval_workflow_steps.get(id, timeout=timeout)
1670
1671    def list(self, filter, *args, timeout=None):
1672        '''
1673         Deprecated: Lists existing approval workflow steps.
1674        '''
1675        return self.approval_workflow_steps.list(filter,
1676                                                 *args,
1677                                                 timeout=timeout)

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

SnapshotApprovalWorkflowSteps(approval_workflow_steps)
1662    def __init__(self, approval_workflow_steps):
1663        self.approval_workflow_steps = approval_workflow_steps
def get(self, id, timeout=None)
1665    def get(self, id, timeout=None):
1666        '''
1667         Deprecated: Get reads one approval workflow step by ID.
1668        '''
1669        return self.approval_workflow_steps.get(id, timeout=timeout)

Deprecated: Get reads one approval workflow step by ID.

def list(self, filter, *args, timeout=None)
1671    def list(self, filter, *args, timeout=None):
1672        '''
1673         Deprecated: Lists existing approval workflow steps.
1674        '''
1675        return self.approval_workflow_steps.list(filter,
1676                                                 *args,
1677                                                 timeout=timeout)

Deprecated: Lists existing approval workflow steps.

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

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

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

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

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

Get reads one approval workflow by ID.

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

Delete deletes an existing approval workflow.

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

Update updates an existing approval workflow.

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

Lists existing approval workflows.

class SnapshotApprovalWorkflows:
1911class SnapshotApprovalWorkflows:
1912    '''
1913    SnapshotApprovalWorkflows exposes the read only methods of the ApprovalWorkflows
1914    service for historical queries.
1915    '''
1916    def __init__(self, approval_workflows):
1917        self.approval_workflows = approval_workflows
1918
1919    def get(self, id, timeout=None):
1920        '''
1921         Get reads one approval workflow by ID.
1922        '''
1923        return self.approval_workflows.get(id, timeout=timeout)
1924
1925    def list(self, filter, *args, timeout=None):
1926        '''
1927         Lists existing approval workflows.
1928        '''
1929        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)
1916    def __init__(self, approval_workflows):
1917        self.approval_workflows = approval_workflows
def get(self, id, timeout=None)
1919    def get(self, id, timeout=None):
1920        '''
1921         Get reads one approval workflow by ID.
1922        '''
1923        return self.approval_workflows.get(id, timeout=timeout)

Get reads one approval workflow by ID.

def list(self, filter, *args, timeout=None)
1925    def list(self, filter, *args, timeout=None):
1926        '''
1927         Lists existing approval workflows.
1928        '''
1929        return self.approval_workflows.list(filter, *args, timeout=timeout)

Lists existing approval workflows.

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

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

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

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

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

ControlPanel contains all administrative controls.

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

GetSSHCAPublicKey retrieves the SSH CA public key.

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

GetRDPCAPublicKey retrieves the RDP CA public key.

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

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

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

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

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

Create registers a new IdentityAlias.

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

Get reads one IdentityAlias by ID.

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

Update replaces all the fields of a IdentityAlias by ID.

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

Delete removes a IdentityAlias by ID.

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

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

class SnapshotIdentityAliases:
2318class SnapshotIdentityAliases:
2319    '''
2320    SnapshotIdentityAliases exposes the read only methods of the IdentityAliases
2321    service for historical queries.
2322    '''
2323    def __init__(self, identity_aliases):
2324        self.identity_aliases = identity_aliases
2325
2326    def get(self, id, timeout=None):
2327        '''
2328         Get reads one IdentityAlias by ID.
2329        '''
2330        return self.identity_aliases.get(id, timeout=timeout)
2331
2332    def list(self, filter, *args, timeout=None):
2333        '''
2334         List gets a list of IdentityAliases matching a given set of criteria.
2335        '''
2336        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)
2323    def __init__(self, identity_aliases):
2324        self.identity_aliases = identity_aliases
def get(self, id, timeout=None)
2326    def get(self, id, timeout=None):
2327        '''
2328         Get reads one IdentityAlias by ID.
2329        '''
2330        return self.identity_aliases.get(id, timeout=timeout)

Get reads one IdentityAlias by ID.

def list(self, filter, *args, timeout=None)
2332    def list(self, filter, *args, timeout=None):
2333        '''
2334         List gets a list of IdentityAliases matching a given set of criteria.
2335        '''
2336        return self.identity_aliases.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

Create registers a new IdentitySet.

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

Get reads one IdentitySet by ID.

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

Update replaces all the fields of a IdentitySet by ID.

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

Delete removes a IdentitySet by ID.

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

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

class SnapshotIdentitySets:
2572class SnapshotIdentitySets:
2573    '''
2574    SnapshotIdentitySets exposes the read only methods of the IdentitySets
2575    service for historical queries.
2576    '''
2577    def __init__(self, identity_sets):
2578        self.identity_sets = identity_sets
2579
2580    def get(self, id, timeout=None):
2581        '''
2582         Get reads one IdentitySet by ID.
2583        '''
2584        return self.identity_sets.get(id, timeout=timeout)
2585
2586    def list(self, filter, *args, timeout=None):
2587        '''
2588         List gets a list of IdentitySets matching a given set of criteria.
2589        '''
2590        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)
2577    def __init__(self, identity_sets):
2578        self.identity_sets = identity_sets
def get(self, id, timeout=None)
2580    def get(self, id, timeout=None):
2581        '''
2582         Get reads one IdentitySet by ID.
2583        '''
2584        return self.identity_sets.get(id, timeout=timeout)

Get reads one IdentitySet by ID.

def list(self, filter, *args, timeout=None)
2586    def list(self, filter, *args, timeout=None):
2587        '''
2588         List gets a list of IdentitySets matching a given set of criteria.
2589        '''
2590        return self.identity_sets.list(filter, *args, timeout=timeout)

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

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

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

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

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

class ManagedSecrets:
2641class ManagedSecrets:
2642    '''
2643     ManagedSecret is a private vertical for creating, reading, updating,
2644     deleting, listing and rotating the managed secrets in the secrets engines as
2645     an authenticated user.
2646    See `strongdm.models.ManagedSecret`.
2647    '''
2648    def __init__(self, channel, client):
2649        self.parent = client
2650        self.stub = ManagedSecretsStub(channel)
2651
2652    def list(self, filter, *args, timeout=None):
2653        '''
2654         List returns Managed Secrets from a Secret Engine.
2655        '''
2656        req = ManagedSecretListRequest()
2657        req.meta.CopyFrom(ListRequestMetadata())
2658        if self.parent.page_limit > 0:
2659            req.meta.limit = self.parent.page_limit
2660        if self.parent.snapshot_datetime is not None:
2661            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2662
2663        req.filter = plumbing.quote_filter_args(filter, *args)
2664
2665        def generator(svc, req):
2666            tries = 0
2667            while True:
2668                try:
2669                    plumbing_response = svc.stub.List(
2670                        req,
2671                        metadata=svc.parent.get_metadata(
2672                            'ManagedSecrets.List', req),
2673                        timeout=timeout)
2674                except Exception as e:
2675                    if self.parent.shouldRetry(tries, e):
2676                        tries += 1
2677                        self.parent.jitterSleep(tries)
2678                        continue
2679                    raise plumbing.convert_error_to_porcelain(e) from e
2680                tries = 0
2681                for plumbing_item in plumbing_response.managed_secrets:
2682                    yield plumbing.convert_managed_secret_to_porcelain(
2683                        plumbing_item)
2684                if plumbing_response.meta.next_cursor == '':
2685                    break
2686                req.meta.cursor = plumbing_response.meta.next_cursor
2687
2688        return generator(self, req)
2689
2690    def list_by_actor(self, filter, *args, timeout=None):
2691        '''
2692         List returns Managed Secrets for an Actor from a Secret Engine.
2693        '''
2694        req = ManagedSecretListRequest()
2695        req.meta.CopyFrom(ListRequestMetadata())
2696        if self.parent.page_limit > 0:
2697            req.meta.limit = self.parent.page_limit
2698        if self.parent.snapshot_datetime is not None:
2699            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2700
2701        req.filter = plumbing.quote_filter_args(filter, *args)
2702
2703        def generator(svc, req):
2704            tries = 0
2705            while True:
2706                try:
2707                    plumbing_response = svc.stub.ListByActor(
2708                        req,
2709                        metadata=svc.parent.get_metadata(
2710                            'ManagedSecrets.ListByActor', req),
2711                        timeout=timeout)
2712                except Exception as e:
2713                    if self.parent.shouldRetry(tries, e):
2714                        tries += 1
2715                        self.parent.jitterSleep(tries)
2716                        continue
2717                    raise plumbing.convert_error_to_porcelain(e) from e
2718                tries = 0
2719                for plumbing_item in plumbing_response.managed_secrets:
2720                    yield plumbing.convert_managed_secret_to_porcelain(
2721                        plumbing_item)
2722                if plumbing_response.meta.next_cursor == '':
2723                    break
2724                req.meta.cursor = plumbing_response.meta.next_cursor
2725
2726        return generator(self, req)
2727
2728    def create(self, managed_secret, timeout=None):
2729        '''
2730         Create creates a Managed Secret
2731        '''
2732        req = ManagedSecretCreateRequest()
2733
2734        if managed_secret is not None:
2735            req.managed_secret.CopyFrom(
2736                plumbing.convert_managed_secret_to_plumbing(managed_secret))
2737        tries = 0
2738        plumbing_response = None
2739        while True:
2740            try:
2741                plumbing_response = self.stub.Create(
2742                    req,
2743                    metadata=self.parent.get_metadata('ManagedSecrets.Create',
2744                                                      req),
2745                    timeout=timeout)
2746            except Exception as e:
2747                if self.parent.shouldRetry(tries, e):
2748                    tries += 1
2749                    self.parent.jitterSleep(tries)
2750                    continue
2751                raise plumbing.convert_error_to_porcelain(e) from e
2752            break
2753
2754        resp = models.ManagedSecretCreateResponse()
2755        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2756            plumbing_response.managed_secret)
2757        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2758            plumbing_response.meta)
2759        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2760            plumbing_response.rate_limit)
2761        return resp
2762
2763    def update(self, managed_secret, timeout=None):
2764        '''
2765         Update updates a Managed Secret
2766        '''
2767        req = ManagedSecretUpdateRequest()
2768
2769        if managed_secret is not None:
2770            req.managed_secret.CopyFrom(
2771                plumbing.convert_managed_secret_to_plumbing(managed_secret))
2772        tries = 0
2773        plumbing_response = None
2774        while True:
2775            try:
2776                plumbing_response = self.stub.Update(
2777                    req,
2778                    metadata=self.parent.get_metadata('ManagedSecrets.Update',
2779                                                      req),
2780                    timeout=timeout)
2781            except Exception as e:
2782                if self.parent.shouldRetry(tries, e):
2783                    tries += 1
2784                    self.parent.jitterSleep(tries)
2785                    continue
2786                raise plumbing.convert_error_to_porcelain(e) from e
2787            break
2788
2789        resp = models.ManagedSecretUpdateResponse()
2790        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2791            plumbing_response.managed_secret)
2792        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2793            plumbing_response.meta)
2794        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2795            plumbing_response.rate_limit)
2796        return resp
2797
2798    def rotate(self, id, timeout=None):
2799        '''
2800         Rotate forces rotation of Managed Secret
2801        '''
2802        req = ManagedSecretRotateRequest()
2803
2804        req.id = (id)
2805        tries = 0
2806        plumbing_response = None
2807        while True:
2808            try:
2809                plumbing_response = self.stub.Rotate(
2810                    req,
2811                    metadata=self.parent.get_metadata('ManagedSecrets.Rotate',
2812                                                      req),
2813                    timeout=timeout)
2814            except Exception as e:
2815                if self.parent.shouldRetry(tries, e):
2816                    tries += 1
2817                    self.parent.jitterSleep(tries)
2818                    continue
2819                raise plumbing.convert_error_to_porcelain(e) from e
2820            break
2821
2822        resp = models.ManagedSecretRotateResponse()
2823        resp.meta = plumbing.convert_generic_response_metadata_to_porcelain(
2824            plumbing_response.meta)
2825        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2826            plumbing_response.rate_limit)
2827        return resp
2828
2829    def delete(self, id, timeout=None):
2830        '''
2831         Delete deletes a Managed Secret
2832        '''
2833        req = ManagedSecretDeleteRequest()
2834
2835        req.id = (id)
2836        tries = 0
2837        plumbing_response = None
2838        while True:
2839            try:
2840                plumbing_response = self.stub.Delete(
2841                    req,
2842                    metadata=self.parent.get_metadata('ManagedSecrets.Delete',
2843                                                      req),
2844                    timeout=timeout)
2845            except Exception as e:
2846                if self.parent.shouldRetry(tries, e):
2847                    tries += 1
2848                    self.parent.jitterSleep(tries)
2849                    continue
2850                raise plumbing.convert_error_to_porcelain(e) from e
2851            break
2852
2853        resp = models.ManagedSecretDeleteResponse()
2854        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2855            plumbing_response.rate_limit)
2856        return resp
2857
2858    def get(self, id, timeout=None):
2859        '''
2860         Get gets details of a Managed Secret without sensitive data
2861        '''
2862        req = ManagedSecretGetRequest()
2863        if self.parent.snapshot_datetime is not None:
2864            req.meta.CopyFrom(GetRequestMetadata())
2865            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2866
2867        req.id = (id)
2868        tries = 0
2869        plumbing_response = None
2870        while True:
2871            try:
2872                plumbing_response = self.stub.Get(
2873                    req,
2874                    metadata=self.parent.get_metadata('ManagedSecrets.Get',
2875                                                      req),
2876                    timeout=timeout)
2877            except Exception as e:
2878                if self.parent.shouldRetry(tries, e):
2879                    tries += 1
2880                    self.parent.jitterSleep(tries)
2881                    continue
2882                raise plumbing.convert_error_to_porcelain(e) from e
2883            break
2884
2885        resp = models.ManagedSecretGetResponse()
2886        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2887            plumbing_response.managed_secret)
2888        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2889            plumbing_response.meta)
2890        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2891            plumbing_response.rate_limit)
2892        return resp
2893
2894    def retrieve(self, id, public_key, timeout=None):
2895        '''
2896         Retrieve returns Managed Secret with sensitive data
2897        '''
2898        req = ManagedSecretRetrieveRequest()
2899
2900        req.id = (id)
2901        req.public_key = (public_key)
2902        tries = 0
2903        plumbing_response = None
2904        while True:
2905            try:
2906                plumbing_response = self.stub.Retrieve(
2907                    req,
2908                    metadata=self.parent.get_metadata(
2909                        'ManagedSecrets.Retrieve', req),
2910                    timeout=timeout)
2911            except Exception as e:
2912                if self.parent.shouldRetry(tries, e):
2913                    tries += 1
2914                    self.parent.jitterSleep(tries)
2915                    continue
2916                raise plumbing.convert_error_to_porcelain(e) from e
2917            break
2918
2919        resp = models.ManagedSecretRetrieveResponse()
2920        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2921            plumbing_response.managed_secret)
2922        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2923            plumbing_response.meta)
2924        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2925            plumbing_response.rate_limit)
2926        return resp
2927
2928    def validate(self, id, timeout=None):
2929        '''
2930         Validate returns the result of testing the stored credential against the
2931         secret engine.
2932        '''
2933        req = ManagedSecretValidateRequest()
2934
2935        req.id = (id)
2936        tries = 0
2937        plumbing_response = None
2938        while True:
2939            try:
2940                plumbing_response = self.stub.Validate(
2941                    req,
2942                    metadata=self.parent.get_metadata(
2943                        'ManagedSecrets.Validate', req),
2944                    timeout=timeout)
2945            except Exception as e:
2946                if self.parent.shouldRetry(tries, e):
2947                    tries += 1
2948                    self.parent.jitterSleep(tries)
2949                    continue
2950                raise plumbing.convert_error_to_porcelain(e) from e
2951            break
2952
2953        resp = models.ManagedSecretValidateResponse()
2954        resp.invalid_info = (plumbing_response.invalid_info)
2955        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2956            plumbing_response.meta)
2957        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2958            plumbing_response.rate_limit)
2959        resp.valid = (plumbing_response.valid)
2960        return resp
2961
2962    def logs(self, filter, *args, timeout=None):
2963        '''
2964         Logs returns the audit records for the managed secret. This may be replaced
2965         in the future.
2966        '''
2967        req = ManagedSecretLogsRequest()
2968        req.meta.CopyFrom(ListRequestMetadata())
2969        if self.parent.page_limit > 0:
2970            req.meta.limit = self.parent.page_limit
2971        if self.parent.snapshot_datetime is not None:
2972            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2973
2974        req.filter = plumbing.quote_filter_args(filter, *args)
2975
2976        def generator(svc, req):
2977            tries = 0
2978            while True:
2979                try:
2980                    plumbing_response = svc.stub.Logs(
2981                        req,
2982                        metadata=svc.parent.get_metadata(
2983                            'ManagedSecrets.Logs', req),
2984                        timeout=timeout)
2985                except Exception as e:
2986                    if self.parent.shouldRetry(tries, e):
2987                        tries += 1
2988                        self.parent.jitterSleep(tries)
2989                        continue
2990                    raise plumbing.convert_error_to_porcelain(e) from e
2991                tries = 0
2992                for plumbing_item in plumbing_response.managed_secret_logs:
2993                    yield plumbing.convert_managed_secret_log_to_porcelain(
2994                        plumbing_item)
2995                if plumbing_response.meta.next_cursor == '':
2996                    break
2997                req.meta.cursor = plumbing_response.meta.next_cursor
2998
2999        return generator(self, req)

ManagedSecret is a private vertical for creating, reading, updating, deleting, listing and rotating the managed secrets in the secrets engines as an authenticated user. See strongdm.models.ManagedSecret.

ManagedSecrets(channel, client)
2648    def __init__(self, channel, client):
2649        self.parent = client
2650        self.stub = ManagedSecretsStub(channel)
def list(self, filter, *args, timeout=None)
2652    def list(self, filter, *args, timeout=None):
2653        '''
2654         List returns Managed Secrets from a Secret Engine.
2655        '''
2656        req = ManagedSecretListRequest()
2657        req.meta.CopyFrom(ListRequestMetadata())
2658        if self.parent.page_limit > 0:
2659            req.meta.limit = self.parent.page_limit
2660        if self.parent.snapshot_datetime is not None:
2661            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2662
2663        req.filter = plumbing.quote_filter_args(filter, *args)
2664
2665        def generator(svc, req):
2666            tries = 0
2667            while True:
2668                try:
2669                    plumbing_response = svc.stub.List(
2670                        req,
2671                        metadata=svc.parent.get_metadata(
2672                            'ManagedSecrets.List', req),
2673                        timeout=timeout)
2674                except Exception as e:
2675                    if self.parent.shouldRetry(tries, e):
2676                        tries += 1
2677                        self.parent.jitterSleep(tries)
2678                        continue
2679                    raise plumbing.convert_error_to_porcelain(e) from e
2680                tries = 0
2681                for plumbing_item in plumbing_response.managed_secrets:
2682                    yield plumbing.convert_managed_secret_to_porcelain(
2683                        plumbing_item)
2684                if plumbing_response.meta.next_cursor == '':
2685                    break
2686                req.meta.cursor = plumbing_response.meta.next_cursor
2687
2688        return generator(self, req)

List returns Managed Secrets from a Secret Engine.

def list_by_actor(self, filter, *args, timeout=None)
2690    def list_by_actor(self, filter, *args, timeout=None):
2691        '''
2692         List returns Managed Secrets for an Actor from a Secret Engine.
2693        '''
2694        req = ManagedSecretListRequest()
2695        req.meta.CopyFrom(ListRequestMetadata())
2696        if self.parent.page_limit > 0:
2697            req.meta.limit = self.parent.page_limit
2698        if self.parent.snapshot_datetime is not None:
2699            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2700
2701        req.filter = plumbing.quote_filter_args(filter, *args)
2702
2703        def generator(svc, req):
2704            tries = 0
2705            while True:
2706                try:
2707                    plumbing_response = svc.stub.ListByActor(
2708                        req,
2709                        metadata=svc.parent.get_metadata(
2710                            'ManagedSecrets.ListByActor', req),
2711                        timeout=timeout)
2712                except Exception as e:
2713                    if self.parent.shouldRetry(tries, e):
2714                        tries += 1
2715                        self.parent.jitterSleep(tries)
2716                        continue
2717                    raise plumbing.convert_error_to_porcelain(e) from e
2718                tries = 0
2719                for plumbing_item in plumbing_response.managed_secrets:
2720                    yield plumbing.convert_managed_secret_to_porcelain(
2721                        plumbing_item)
2722                if plumbing_response.meta.next_cursor == '':
2723                    break
2724                req.meta.cursor = plumbing_response.meta.next_cursor
2725
2726        return generator(self, req)

List returns Managed Secrets for an Actor from a Secret Engine.

def create(self, managed_secret, timeout=None)
2728    def create(self, managed_secret, timeout=None):
2729        '''
2730         Create creates a Managed Secret
2731        '''
2732        req = ManagedSecretCreateRequest()
2733
2734        if managed_secret is not None:
2735            req.managed_secret.CopyFrom(
2736                plumbing.convert_managed_secret_to_plumbing(managed_secret))
2737        tries = 0
2738        plumbing_response = None
2739        while True:
2740            try:
2741                plumbing_response = self.stub.Create(
2742                    req,
2743                    metadata=self.parent.get_metadata('ManagedSecrets.Create',
2744                                                      req),
2745                    timeout=timeout)
2746            except Exception as e:
2747                if self.parent.shouldRetry(tries, e):
2748                    tries += 1
2749                    self.parent.jitterSleep(tries)
2750                    continue
2751                raise plumbing.convert_error_to_porcelain(e) from e
2752            break
2753
2754        resp = models.ManagedSecretCreateResponse()
2755        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2756            plumbing_response.managed_secret)
2757        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2758            plumbing_response.meta)
2759        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2760            plumbing_response.rate_limit)
2761        return resp

Create creates a Managed Secret

def update(self, managed_secret, timeout=None)
2763    def update(self, managed_secret, timeout=None):
2764        '''
2765         Update updates a Managed Secret
2766        '''
2767        req = ManagedSecretUpdateRequest()
2768
2769        if managed_secret is not None:
2770            req.managed_secret.CopyFrom(
2771                plumbing.convert_managed_secret_to_plumbing(managed_secret))
2772        tries = 0
2773        plumbing_response = None
2774        while True:
2775            try:
2776                plumbing_response = self.stub.Update(
2777                    req,
2778                    metadata=self.parent.get_metadata('ManagedSecrets.Update',
2779                                                      req),
2780                    timeout=timeout)
2781            except Exception as e:
2782                if self.parent.shouldRetry(tries, e):
2783                    tries += 1
2784                    self.parent.jitterSleep(tries)
2785                    continue
2786                raise plumbing.convert_error_to_porcelain(e) from e
2787            break
2788
2789        resp = models.ManagedSecretUpdateResponse()
2790        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2791            plumbing_response.managed_secret)
2792        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
2793            plumbing_response.meta)
2794        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2795            plumbing_response.rate_limit)
2796        return resp

Update updates a Managed Secret

def rotate(self, id, timeout=None)
2798    def rotate(self, id, timeout=None):
2799        '''
2800         Rotate forces rotation of Managed Secret
2801        '''
2802        req = ManagedSecretRotateRequest()
2803
2804        req.id = (id)
2805        tries = 0
2806        plumbing_response = None
2807        while True:
2808            try:
2809                plumbing_response = self.stub.Rotate(
2810                    req,
2811                    metadata=self.parent.get_metadata('ManagedSecrets.Rotate',
2812                                                      req),
2813                    timeout=timeout)
2814            except Exception as e:
2815                if self.parent.shouldRetry(tries, e):
2816                    tries += 1
2817                    self.parent.jitterSleep(tries)
2818                    continue
2819                raise plumbing.convert_error_to_porcelain(e) from e
2820            break
2821
2822        resp = models.ManagedSecretRotateResponse()
2823        resp.meta = plumbing.convert_generic_response_metadata_to_porcelain(
2824            plumbing_response.meta)
2825        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2826            plumbing_response.rate_limit)
2827        return resp

Rotate forces rotation of Managed Secret

def delete(self, id, timeout=None)
2829    def delete(self, id, timeout=None):
2830        '''
2831         Delete deletes a Managed Secret
2832        '''
2833        req = ManagedSecretDeleteRequest()
2834
2835        req.id = (id)
2836        tries = 0
2837        plumbing_response = None
2838        while True:
2839            try:
2840                plumbing_response = self.stub.Delete(
2841                    req,
2842                    metadata=self.parent.get_metadata('ManagedSecrets.Delete',
2843                                                      req),
2844                    timeout=timeout)
2845            except Exception as e:
2846                if self.parent.shouldRetry(tries, e):
2847                    tries += 1
2848                    self.parent.jitterSleep(tries)
2849                    continue
2850                raise plumbing.convert_error_to_porcelain(e) from e
2851            break
2852
2853        resp = models.ManagedSecretDeleteResponse()
2854        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2855            plumbing_response.rate_limit)
2856        return resp

Delete deletes a Managed Secret

def get(self, id, timeout=None)
2858    def get(self, id, timeout=None):
2859        '''
2860         Get gets details of a Managed Secret without sensitive data
2861        '''
2862        req = ManagedSecretGetRequest()
2863        if self.parent.snapshot_datetime is not None:
2864            req.meta.CopyFrom(GetRequestMetadata())
2865            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2866
2867        req.id = (id)
2868        tries = 0
2869        plumbing_response = None
2870        while True:
2871            try:
2872                plumbing_response = self.stub.Get(
2873                    req,
2874                    metadata=self.parent.get_metadata('ManagedSecrets.Get',
2875                                                      req),
2876                    timeout=timeout)
2877            except Exception as e:
2878                if self.parent.shouldRetry(tries, e):
2879                    tries += 1
2880                    self.parent.jitterSleep(tries)
2881                    continue
2882                raise plumbing.convert_error_to_porcelain(e) from e
2883            break
2884
2885        resp = models.ManagedSecretGetResponse()
2886        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2887            plumbing_response.managed_secret)
2888        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2889            plumbing_response.meta)
2890        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2891            plumbing_response.rate_limit)
2892        return resp

Get gets details of a Managed Secret without sensitive data

def retrieve(self, id, public_key, timeout=None)
2894    def retrieve(self, id, public_key, timeout=None):
2895        '''
2896         Retrieve returns Managed Secret with sensitive data
2897        '''
2898        req = ManagedSecretRetrieveRequest()
2899
2900        req.id = (id)
2901        req.public_key = (public_key)
2902        tries = 0
2903        plumbing_response = None
2904        while True:
2905            try:
2906                plumbing_response = self.stub.Retrieve(
2907                    req,
2908                    metadata=self.parent.get_metadata(
2909                        'ManagedSecrets.Retrieve', req),
2910                    timeout=timeout)
2911            except Exception as e:
2912                if self.parent.shouldRetry(tries, e):
2913                    tries += 1
2914                    self.parent.jitterSleep(tries)
2915                    continue
2916                raise plumbing.convert_error_to_porcelain(e) from e
2917            break
2918
2919        resp = models.ManagedSecretRetrieveResponse()
2920        resp.managed_secret = plumbing.convert_managed_secret_to_porcelain(
2921            plumbing_response.managed_secret)
2922        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2923            plumbing_response.meta)
2924        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2925            plumbing_response.rate_limit)
2926        return resp

Retrieve returns Managed Secret with sensitive data

def validate(self, id, timeout=None)
2928    def validate(self, id, timeout=None):
2929        '''
2930         Validate returns the result of testing the stored credential against the
2931         secret engine.
2932        '''
2933        req = ManagedSecretValidateRequest()
2934
2935        req.id = (id)
2936        tries = 0
2937        plumbing_response = None
2938        while True:
2939            try:
2940                plumbing_response = self.stub.Validate(
2941                    req,
2942                    metadata=self.parent.get_metadata(
2943                        'ManagedSecrets.Validate', req),
2944                    timeout=timeout)
2945            except Exception as e:
2946                if self.parent.shouldRetry(tries, e):
2947                    tries += 1
2948                    self.parent.jitterSleep(tries)
2949                    continue
2950                raise plumbing.convert_error_to_porcelain(e) from e
2951            break
2952
2953        resp = models.ManagedSecretValidateResponse()
2954        resp.invalid_info = (plumbing_response.invalid_info)
2955        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
2956            plumbing_response.meta)
2957        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2958            plumbing_response.rate_limit)
2959        resp.valid = (plumbing_response.valid)
2960        return resp

Validate returns the result of testing the stored credential against the secret engine.

def logs(self, filter, *args, timeout=None)
2962    def logs(self, filter, *args, timeout=None):
2963        '''
2964         Logs returns the audit records for the managed secret. This may be replaced
2965         in the future.
2966        '''
2967        req = ManagedSecretLogsRequest()
2968        req.meta.CopyFrom(ListRequestMetadata())
2969        if self.parent.page_limit > 0:
2970            req.meta.limit = self.parent.page_limit
2971        if self.parent.snapshot_datetime is not None:
2972            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
2973
2974        req.filter = plumbing.quote_filter_args(filter, *args)
2975
2976        def generator(svc, req):
2977            tries = 0
2978            while True:
2979                try:
2980                    plumbing_response = svc.stub.Logs(
2981                        req,
2982                        metadata=svc.parent.get_metadata(
2983                            'ManagedSecrets.Logs', req),
2984                        timeout=timeout)
2985                except Exception as e:
2986                    if self.parent.shouldRetry(tries, e):
2987                        tries += 1
2988                        self.parent.jitterSleep(tries)
2989                        continue
2990                    raise plumbing.convert_error_to_porcelain(e) from e
2991                tries = 0
2992                for plumbing_item in plumbing_response.managed_secret_logs:
2993                    yield plumbing.convert_managed_secret_log_to_porcelain(
2994                        plumbing_item)
2995                if plumbing_response.meta.next_cursor == '':
2996                    break
2997                req.meta.cursor = plumbing_response.meta.next_cursor
2998
2999        return generator(self, req)

Logs returns the audit records for the managed secret. This may be replaced in the future.

class Nodes:
3002class Nodes:
3003    '''
3004     Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
3005     - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
3006     - **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.
3007    See:
3008    `strongdm.models.Gateway`
3009    `strongdm.models.ProxyCluster`
3010    `strongdm.models.Relay`
3011    '''
3012    def __init__(self, channel, client):
3013        self.parent = client
3014        self.stub = NodesStub(channel)
3015
3016    def create(self, node, timeout=None):
3017        '''
3018         Create registers a new Node.
3019        '''
3020        req = NodeCreateRequest()
3021
3022        if node is not None:
3023            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
3024        tries = 0
3025        plumbing_response = None
3026        while True:
3027            try:
3028                plumbing_response = self.stub.Create(
3029                    req,
3030                    metadata=self.parent.get_metadata('Nodes.Create', req),
3031                    timeout=timeout)
3032            except Exception as e:
3033                if self.parent.shouldRetry(tries, e):
3034                    tries += 1
3035                    self.parent.jitterSleep(tries)
3036                    continue
3037                raise plumbing.convert_error_to_porcelain(e) from e
3038            break
3039
3040        resp = models.NodeCreateResponse()
3041        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3042            plumbing_response.meta)
3043        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
3044        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3045            plumbing_response.rate_limit)
3046        resp.token = (plumbing_response.token)
3047        return resp
3048
3049    def get(self, id, timeout=None):
3050        '''
3051         Get reads one Node by ID.
3052        '''
3053        req = NodeGetRequest()
3054        if self.parent.snapshot_datetime is not None:
3055            req.meta.CopyFrom(GetRequestMetadata())
3056            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3057
3058        req.id = (id)
3059        tries = 0
3060        plumbing_response = None
3061        while True:
3062            try:
3063                plumbing_response = self.stub.Get(
3064                    req,
3065                    metadata=self.parent.get_metadata('Nodes.Get', req),
3066                    timeout=timeout)
3067            except Exception as e:
3068                if self.parent.shouldRetry(tries, e):
3069                    tries += 1
3070                    self.parent.jitterSleep(tries)
3071                    continue
3072                raise plumbing.convert_error_to_porcelain(e) from e
3073            break
3074
3075        resp = models.NodeGetResponse()
3076        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3077            plumbing_response.meta)
3078        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
3079        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3080            plumbing_response.rate_limit)
3081        return resp
3082
3083    def update(self, node, timeout=None):
3084        '''
3085         Update replaces all the fields of a Node by ID.
3086        '''
3087        req = NodeUpdateRequest()
3088
3089        if node is not None:
3090            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
3091        tries = 0
3092        plumbing_response = None
3093        while True:
3094            try:
3095                plumbing_response = self.stub.Update(
3096                    req,
3097                    metadata=self.parent.get_metadata('Nodes.Update', req),
3098                    timeout=timeout)
3099            except Exception as e:
3100                if self.parent.shouldRetry(tries, e):
3101                    tries += 1
3102                    self.parent.jitterSleep(tries)
3103                    continue
3104                raise plumbing.convert_error_to_porcelain(e) from e
3105            break
3106
3107        resp = models.NodeUpdateResponse()
3108        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
3109            plumbing_response.meta)
3110        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
3111        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3112            plumbing_response.rate_limit)
3113        return resp
3114
3115    def delete(self, id, timeout=None):
3116        '''
3117         Delete removes a Node by ID.
3118        '''
3119        req = NodeDeleteRequest()
3120
3121        req.id = (id)
3122        tries = 0
3123        plumbing_response = None
3124        while True:
3125            try:
3126                plumbing_response = self.stub.Delete(
3127                    req,
3128                    metadata=self.parent.get_metadata('Nodes.Delete', req),
3129                    timeout=timeout)
3130            except Exception as e:
3131                if self.parent.shouldRetry(tries, e):
3132                    tries += 1
3133                    self.parent.jitterSleep(tries)
3134                    continue
3135                raise plumbing.convert_error_to_porcelain(e) from e
3136            break
3137
3138        resp = models.NodeDeleteResponse()
3139        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3140            plumbing_response.meta)
3141        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3142            plumbing_response.rate_limit)
3143        return resp
3144
3145    def list(self, filter, *args, timeout=None):
3146        '''
3147         List gets a list of Nodes matching a given set of criteria.
3148        '''
3149        req = NodeListRequest()
3150        req.meta.CopyFrom(ListRequestMetadata())
3151        if self.parent.page_limit > 0:
3152            req.meta.limit = self.parent.page_limit
3153        if self.parent.snapshot_datetime is not None:
3154            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3155
3156        req.filter = plumbing.quote_filter_args(filter, *args)
3157
3158        def generator(svc, req):
3159            tries = 0
3160            while True:
3161                try:
3162                    plumbing_response = svc.stub.List(
3163                        req,
3164                        metadata=svc.parent.get_metadata('Nodes.List', req),
3165                        timeout=timeout)
3166                except Exception as e:
3167                    if self.parent.shouldRetry(tries, e):
3168                        tries += 1
3169                        self.parent.jitterSleep(tries)
3170                        continue
3171                    raise plumbing.convert_error_to_porcelain(e) from e
3172                tries = 0
3173                for plumbing_item in plumbing_response.nodes:
3174                    yield plumbing.convert_node_to_porcelain(plumbing_item)
3175                if plumbing_response.meta.next_cursor == '':
3176                    break
3177                req.meta.cursor = plumbing_response.meta.next_cursor
3178
3179        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)
3012    def __init__(self, channel, client):
3013        self.parent = client
3014        self.stub = NodesStub(channel)
def create(self, node, timeout=None)
3016    def create(self, node, timeout=None):
3017        '''
3018         Create registers a new Node.
3019        '''
3020        req = NodeCreateRequest()
3021
3022        if node is not None:
3023            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
3024        tries = 0
3025        plumbing_response = None
3026        while True:
3027            try:
3028                plumbing_response = self.stub.Create(
3029                    req,
3030                    metadata=self.parent.get_metadata('Nodes.Create', req),
3031                    timeout=timeout)
3032            except Exception as e:
3033                if self.parent.shouldRetry(tries, e):
3034                    tries += 1
3035                    self.parent.jitterSleep(tries)
3036                    continue
3037                raise plumbing.convert_error_to_porcelain(e) from e
3038            break
3039
3040        resp = models.NodeCreateResponse()
3041        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3042            plumbing_response.meta)
3043        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
3044        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3045            plumbing_response.rate_limit)
3046        resp.token = (plumbing_response.token)
3047        return resp

Create registers a new Node.

def get(self, id, timeout=None)
3049    def get(self, id, timeout=None):
3050        '''
3051         Get reads one Node by ID.
3052        '''
3053        req = NodeGetRequest()
3054        if self.parent.snapshot_datetime is not None:
3055            req.meta.CopyFrom(GetRequestMetadata())
3056            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3057
3058        req.id = (id)
3059        tries = 0
3060        plumbing_response = None
3061        while True:
3062            try:
3063                plumbing_response = self.stub.Get(
3064                    req,
3065                    metadata=self.parent.get_metadata('Nodes.Get', req),
3066                    timeout=timeout)
3067            except Exception as e:
3068                if self.parent.shouldRetry(tries, e):
3069                    tries += 1
3070                    self.parent.jitterSleep(tries)
3071                    continue
3072                raise plumbing.convert_error_to_porcelain(e) from e
3073            break
3074
3075        resp = models.NodeGetResponse()
3076        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3077            plumbing_response.meta)
3078        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
3079        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3080            plumbing_response.rate_limit)
3081        return resp

Get reads one Node by ID.

def update(self, node, timeout=None)
3083    def update(self, node, timeout=None):
3084        '''
3085         Update replaces all the fields of a Node by ID.
3086        '''
3087        req = NodeUpdateRequest()
3088
3089        if node is not None:
3090            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
3091        tries = 0
3092        plumbing_response = None
3093        while True:
3094            try:
3095                plumbing_response = self.stub.Update(
3096                    req,
3097                    metadata=self.parent.get_metadata('Nodes.Update', req),
3098                    timeout=timeout)
3099            except Exception as e:
3100                if self.parent.shouldRetry(tries, e):
3101                    tries += 1
3102                    self.parent.jitterSleep(tries)
3103                    continue
3104                raise plumbing.convert_error_to_porcelain(e) from e
3105            break
3106
3107        resp = models.NodeUpdateResponse()
3108        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
3109            plumbing_response.meta)
3110        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
3111        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3112            plumbing_response.rate_limit)
3113        return resp

Update replaces all the fields of a Node by ID.

def delete(self, id, timeout=None)
3115    def delete(self, id, timeout=None):
3116        '''
3117         Delete removes a Node by ID.
3118        '''
3119        req = NodeDeleteRequest()
3120
3121        req.id = (id)
3122        tries = 0
3123        plumbing_response = None
3124        while True:
3125            try:
3126                plumbing_response = self.stub.Delete(
3127                    req,
3128                    metadata=self.parent.get_metadata('Nodes.Delete', req),
3129                    timeout=timeout)
3130            except Exception as e:
3131                if self.parent.shouldRetry(tries, e):
3132                    tries += 1
3133                    self.parent.jitterSleep(tries)
3134                    continue
3135                raise plumbing.convert_error_to_porcelain(e) from e
3136            break
3137
3138        resp = models.NodeDeleteResponse()
3139        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3140            plumbing_response.meta)
3141        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3142            plumbing_response.rate_limit)
3143        return resp

Delete removes a Node by ID.

def list(self, filter, *args, timeout=None)
3145    def list(self, filter, *args, timeout=None):
3146        '''
3147         List gets a list of Nodes matching a given set of criteria.
3148        '''
3149        req = NodeListRequest()
3150        req.meta.CopyFrom(ListRequestMetadata())
3151        if self.parent.page_limit > 0:
3152            req.meta.limit = self.parent.page_limit
3153        if self.parent.snapshot_datetime is not None:
3154            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3155
3156        req.filter = plumbing.quote_filter_args(filter, *args)
3157
3158        def generator(svc, req):
3159            tries = 0
3160            while True:
3161                try:
3162                    plumbing_response = svc.stub.List(
3163                        req,
3164                        metadata=svc.parent.get_metadata('Nodes.List', req),
3165                        timeout=timeout)
3166                except Exception as e:
3167                    if self.parent.shouldRetry(tries, e):
3168                        tries += 1
3169                        self.parent.jitterSleep(tries)
3170                        continue
3171                    raise plumbing.convert_error_to_porcelain(e) from e
3172                tries = 0
3173                for plumbing_item in plumbing_response.nodes:
3174                    yield plumbing.convert_node_to_porcelain(plumbing_item)
3175                if plumbing_response.meta.next_cursor == '':
3176                    break
3177                req.meta.cursor = plumbing_response.meta.next_cursor
3178
3179        return generator(self, req)

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

class SnapshotNodes:
3182class SnapshotNodes:
3183    '''
3184    SnapshotNodes exposes the read only methods of the Nodes
3185    service for historical queries.
3186    '''
3187    def __init__(self, nodes):
3188        self.nodes = nodes
3189
3190    def get(self, id, timeout=None):
3191        '''
3192         Get reads one Node by ID.
3193        '''
3194        return self.nodes.get(id, timeout=timeout)
3195
3196    def list(self, filter, *args, timeout=None):
3197        '''
3198         List gets a list of Nodes matching a given set of criteria.
3199        '''
3200        return self.nodes.list(filter, *args, timeout=timeout)

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

SnapshotNodes(nodes)
3187    def __init__(self, nodes):
3188        self.nodes = nodes
def get(self, id, timeout=None)
3190    def get(self, id, timeout=None):
3191        '''
3192         Get reads one Node by ID.
3193        '''
3194        return self.nodes.get(id, timeout=timeout)

Get reads one Node by ID.

def list(self, filter, *args, timeout=None)
3196    def list(self, filter, *args, timeout=None):
3197        '''
3198         List gets a list of Nodes matching a given set of criteria.
3199        '''
3200        return self.nodes.list(filter, *args, timeout=timeout)

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

class NodesHistory:
3203class NodesHistory:
3204    '''
3205     NodesHistory records all changes to the state of a Node.
3206    See `strongdm.models.NodeHistory`.
3207    '''
3208    def __init__(self, channel, client):
3209        self.parent = client
3210        self.stub = NodesHistoryStub(channel)
3211
3212    def list(self, filter, *args, timeout=None):
3213        '''
3214         List gets a list of NodeHistory records matching a given set of criteria.
3215        '''
3216        req = NodeHistoryListRequest()
3217        req.meta.CopyFrom(ListRequestMetadata())
3218        if self.parent.page_limit > 0:
3219            req.meta.limit = self.parent.page_limit
3220        if self.parent.snapshot_datetime is not None:
3221            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3222
3223        req.filter = plumbing.quote_filter_args(filter, *args)
3224
3225        def generator(svc, req):
3226            tries = 0
3227            while True:
3228                try:
3229                    plumbing_response = svc.stub.List(
3230                        req,
3231                        metadata=svc.parent.get_metadata(
3232                            'NodesHistory.List', req),
3233                        timeout=timeout)
3234                except Exception as e:
3235                    if self.parent.shouldRetry(tries, e):
3236                        tries += 1
3237                        self.parent.jitterSleep(tries)
3238                        continue
3239                    raise plumbing.convert_error_to_porcelain(e) from e
3240                tries = 0
3241                for plumbing_item in plumbing_response.history:
3242                    yield plumbing.convert_node_history_to_porcelain(
3243                        plumbing_item)
3244                if plumbing_response.meta.next_cursor == '':
3245                    break
3246                req.meta.cursor = plumbing_response.meta.next_cursor
3247
3248        return generator(self, req)

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

NodesHistory(channel, client)
3208    def __init__(self, channel, client):
3209        self.parent = client
3210        self.stub = NodesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
3212    def list(self, filter, *args, timeout=None):
3213        '''
3214         List gets a list of NodeHistory records matching a given set of criteria.
3215        '''
3216        req = NodeHistoryListRequest()
3217        req.meta.CopyFrom(ListRequestMetadata())
3218        if self.parent.page_limit > 0:
3219            req.meta.limit = self.parent.page_limit
3220        if self.parent.snapshot_datetime is not None:
3221            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3222
3223        req.filter = plumbing.quote_filter_args(filter, *args)
3224
3225        def generator(svc, req):
3226            tries = 0
3227            while True:
3228                try:
3229                    plumbing_response = svc.stub.List(
3230                        req,
3231                        metadata=svc.parent.get_metadata(
3232                            'NodesHistory.List', req),
3233                        timeout=timeout)
3234                except Exception as e:
3235                    if self.parent.shouldRetry(tries, e):
3236                        tries += 1
3237                        self.parent.jitterSleep(tries)
3238                        continue
3239                    raise plumbing.convert_error_to_porcelain(e) from e
3240                tries = 0
3241                for plumbing_item in plumbing_response.history:
3242                    yield plumbing.convert_node_history_to_porcelain(
3243                        plumbing_item)
3244                if plumbing_response.meta.next_cursor == '':
3245                    break
3246                req.meta.cursor = plumbing_response.meta.next_cursor
3247
3248        return generator(self, req)

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

class OrganizationHistory:
3251class OrganizationHistory:
3252    '''
3253     OrganizationHistory records all changes to the state of an Organization.
3254    See `strongdm.models.OrganizationHistoryRecord`.
3255    '''
3256    def __init__(self, channel, client):
3257        self.parent = client
3258        self.stub = OrganizationHistoryStub(channel)
3259
3260    def list(self, filter, *args, timeout=None):
3261        '''
3262         List gets a list of OrganizationHistory records matching a given set of criteria.
3263        '''
3264        req = OrganizationHistoryListRequest()
3265        req.meta.CopyFrom(ListRequestMetadata())
3266        if self.parent.page_limit > 0:
3267            req.meta.limit = self.parent.page_limit
3268        if self.parent.snapshot_datetime is not None:
3269            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3270
3271        req.filter = plumbing.quote_filter_args(filter, *args)
3272
3273        def generator(svc, req):
3274            tries = 0
3275            while True:
3276                try:
3277                    plumbing_response = svc.stub.List(
3278                        req,
3279                        metadata=svc.parent.get_metadata(
3280                            'OrganizationHistory.List', req),
3281                        timeout=timeout)
3282                except Exception as e:
3283                    if self.parent.shouldRetry(tries, e):
3284                        tries += 1
3285                        self.parent.jitterSleep(tries)
3286                        continue
3287                    raise plumbing.convert_error_to_porcelain(e) from e
3288                tries = 0
3289                for plumbing_item in plumbing_response.history:
3290                    yield plumbing.convert_organization_history_record_to_porcelain(
3291                        plumbing_item)
3292                if plumbing_response.meta.next_cursor == '':
3293                    break
3294                req.meta.cursor = plumbing_response.meta.next_cursor
3295
3296        return generator(self, req)

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

OrganizationHistory(channel, client)
3256    def __init__(self, channel, client):
3257        self.parent = client
3258        self.stub = OrganizationHistoryStub(channel)
def list(self, filter, *args, timeout=None)
3260    def list(self, filter, *args, timeout=None):
3261        '''
3262         List gets a list of OrganizationHistory records matching a given set of criteria.
3263        '''
3264        req = OrganizationHistoryListRequest()
3265        req.meta.CopyFrom(ListRequestMetadata())
3266        if self.parent.page_limit > 0:
3267            req.meta.limit = self.parent.page_limit
3268        if self.parent.snapshot_datetime is not None:
3269            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3270
3271        req.filter = plumbing.quote_filter_args(filter, *args)
3272
3273        def generator(svc, req):
3274            tries = 0
3275            while True:
3276                try:
3277                    plumbing_response = svc.stub.List(
3278                        req,
3279                        metadata=svc.parent.get_metadata(
3280                            'OrganizationHistory.List', req),
3281                        timeout=timeout)
3282                except Exception as e:
3283                    if self.parent.shouldRetry(tries, e):
3284                        tries += 1
3285                        self.parent.jitterSleep(tries)
3286                        continue
3287                    raise plumbing.convert_error_to_porcelain(e) from e
3288                tries = 0
3289                for plumbing_item in plumbing_response.history:
3290                    yield plumbing.convert_organization_history_record_to_porcelain(
3291                        plumbing_item)
3292                if plumbing_response.meta.next_cursor == '':
3293                    break
3294                req.meta.cursor = plumbing_response.meta.next_cursor
3295
3296        return generator(self, req)

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

class PeeringGroupNodes:
3299class PeeringGroupNodes:
3300    '''
3301     PeeringGroupNodes provides the building blocks necessary to obtain attach a node to a peering group.
3302    See `strongdm.models.PeeringGroupNode`.
3303    '''
3304    def __init__(self, channel, client):
3305        self.parent = client
3306        self.stub = PeeringGroupNodesStub(channel)
3307
3308    def create(self, peering_group_node, timeout=None):
3309        '''
3310         Create attaches a Node to a PeeringGroup
3311        '''
3312        req = PeeringGroupNodeCreateRequest()
3313
3314        if peering_group_node is not None:
3315            req.peering_group_node.CopyFrom(
3316                plumbing.convert_peering_group_node_to_plumbing(
3317                    peering_group_node))
3318        tries = 0
3319        plumbing_response = None
3320        while True:
3321            try:
3322                plumbing_response = self.stub.Create(
3323                    req,
3324                    metadata=self.parent.get_metadata(
3325                        'PeeringGroupNodes.Create', 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.PeeringGroupNodeCreateResponse()
3336        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3337            plumbing_response.meta)
3338        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
3339            plumbing_response.peering_group_node)
3340        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3341            plumbing_response.rate_limit)
3342        return resp
3343
3344    def delete(self, id, timeout=None):
3345        '''
3346         Delete detaches a Node to a PeeringGroup.
3347        '''
3348        req = PeeringGroupNodeDeleteRequest()
3349
3350        req.id = (id)
3351        tries = 0
3352        plumbing_response = None
3353        while True:
3354            try:
3355                plumbing_response = self.stub.Delete(
3356                    req,
3357                    metadata=self.parent.get_metadata(
3358                        'PeeringGroupNodes.Delete', req),
3359                    timeout=timeout)
3360            except Exception as e:
3361                if self.parent.shouldRetry(tries, e):
3362                    tries += 1
3363                    self.parent.jitterSleep(tries)
3364                    continue
3365                raise plumbing.convert_error_to_porcelain(e) from e
3366            break
3367
3368        resp = models.PeeringGroupNodeDeleteResponse()
3369        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3370            plumbing_response.meta)
3371        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3372            plumbing_response.rate_limit)
3373        return resp
3374
3375    def get(self, id, timeout=None):
3376        '''
3377         Get reads the information of one peering group to node attachment.
3378        '''
3379        req = PeeringGroupNodeGetRequest()
3380        if self.parent.snapshot_datetime is not None:
3381            req.meta.CopyFrom(GetRequestMetadata())
3382            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3383
3384        req.id = (id)
3385        tries = 0
3386        plumbing_response = None
3387        while True:
3388            try:
3389                plumbing_response = self.stub.Get(
3390                    req,
3391                    metadata=self.parent.get_metadata('PeeringGroupNodes.Get',
3392                                                      req),
3393                    timeout=timeout)
3394            except Exception as e:
3395                if self.parent.shouldRetry(tries, e):
3396                    tries += 1
3397                    self.parent.jitterSleep(tries)
3398                    continue
3399                raise plumbing.convert_error_to_porcelain(e) from e
3400            break
3401
3402        resp = models.PeeringGroupNodeGetResponse()
3403        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3404            plumbing_response.meta)
3405        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
3406            plumbing_response.peering_group_node)
3407        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3408            plumbing_response.rate_limit)
3409        return resp
3410
3411    def list(self, filter, *args, timeout=None):
3412        '''
3413         List gets a list of peering group node attachments.
3414        '''
3415        req = PeeringGroupNodeListRequest()
3416        req.meta.CopyFrom(ListRequestMetadata())
3417        if self.parent.page_limit > 0:
3418            req.meta.limit = self.parent.page_limit
3419        if self.parent.snapshot_datetime is not None:
3420            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3421
3422        req.filter = plumbing.quote_filter_args(filter, *args)
3423
3424        def generator(svc, req):
3425            tries = 0
3426            while True:
3427                try:
3428                    plumbing_response = svc.stub.List(
3429                        req,
3430                        metadata=svc.parent.get_metadata(
3431                            'PeeringGroupNodes.List', req),
3432                        timeout=timeout)
3433                except Exception as e:
3434                    if self.parent.shouldRetry(tries, e):
3435                        tries += 1
3436                        self.parent.jitterSleep(tries)
3437                        continue
3438                    raise plumbing.convert_error_to_porcelain(e) from e
3439                tries = 0
3440                for plumbing_item in plumbing_response.peering_group_nodes:
3441                    yield plumbing.convert_peering_group_node_to_porcelain(
3442                        plumbing_item)
3443                if plumbing_response.meta.next_cursor == '':
3444                    break
3445                req.meta.cursor = plumbing_response.meta.next_cursor
3446
3447        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)
3304    def __init__(self, channel, client):
3305        self.parent = client
3306        self.stub = PeeringGroupNodesStub(channel)
def create(self, peering_group_node, timeout=None)
3308    def create(self, peering_group_node, timeout=None):
3309        '''
3310         Create attaches a Node to a PeeringGroup
3311        '''
3312        req = PeeringGroupNodeCreateRequest()
3313
3314        if peering_group_node is not None:
3315            req.peering_group_node.CopyFrom(
3316                plumbing.convert_peering_group_node_to_plumbing(
3317                    peering_group_node))
3318        tries = 0
3319        plumbing_response = None
3320        while True:
3321            try:
3322                plumbing_response = self.stub.Create(
3323                    req,
3324                    metadata=self.parent.get_metadata(
3325                        'PeeringGroupNodes.Create', 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.PeeringGroupNodeCreateResponse()
3336        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3337            plumbing_response.meta)
3338        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
3339            plumbing_response.peering_group_node)
3340        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3341            plumbing_response.rate_limit)
3342        return resp

Create attaches a Node to a PeeringGroup

def delete(self, id, timeout=None)
3344    def delete(self, id, timeout=None):
3345        '''
3346         Delete detaches a Node to a PeeringGroup.
3347        '''
3348        req = PeeringGroupNodeDeleteRequest()
3349
3350        req.id = (id)
3351        tries = 0
3352        plumbing_response = None
3353        while True:
3354            try:
3355                plumbing_response = self.stub.Delete(
3356                    req,
3357                    metadata=self.parent.get_metadata(
3358                        'PeeringGroupNodes.Delete', req),
3359                    timeout=timeout)
3360            except Exception as e:
3361                if self.parent.shouldRetry(tries, e):
3362                    tries += 1
3363                    self.parent.jitterSleep(tries)
3364                    continue
3365                raise plumbing.convert_error_to_porcelain(e) from e
3366            break
3367
3368        resp = models.PeeringGroupNodeDeleteResponse()
3369        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3370            plumbing_response.meta)
3371        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3372            plumbing_response.rate_limit)
3373        return resp

Delete detaches a Node to a PeeringGroup.

def get(self, id, timeout=None)
3375    def get(self, id, timeout=None):
3376        '''
3377         Get reads the information of one peering group to node attachment.
3378        '''
3379        req = PeeringGroupNodeGetRequest()
3380        if self.parent.snapshot_datetime is not None:
3381            req.meta.CopyFrom(GetRequestMetadata())
3382            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3383
3384        req.id = (id)
3385        tries = 0
3386        plumbing_response = None
3387        while True:
3388            try:
3389                plumbing_response = self.stub.Get(
3390                    req,
3391                    metadata=self.parent.get_metadata('PeeringGroupNodes.Get',
3392                                                      req),
3393                    timeout=timeout)
3394            except Exception as e:
3395                if self.parent.shouldRetry(tries, e):
3396                    tries += 1
3397                    self.parent.jitterSleep(tries)
3398                    continue
3399                raise plumbing.convert_error_to_porcelain(e) from e
3400            break
3401
3402        resp = models.PeeringGroupNodeGetResponse()
3403        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3404            plumbing_response.meta)
3405        resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
3406            plumbing_response.peering_group_node)
3407        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3408            plumbing_response.rate_limit)
3409        return resp

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

def list(self, filter, *args, timeout=None)
3411    def list(self, filter, *args, timeout=None):
3412        '''
3413         List gets a list of peering group node attachments.
3414        '''
3415        req = PeeringGroupNodeListRequest()
3416        req.meta.CopyFrom(ListRequestMetadata())
3417        if self.parent.page_limit > 0:
3418            req.meta.limit = self.parent.page_limit
3419        if self.parent.snapshot_datetime is not None:
3420            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3421
3422        req.filter = plumbing.quote_filter_args(filter, *args)
3423
3424        def generator(svc, req):
3425            tries = 0
3426            while True:
3427                try:
3428                    plumbing_response = svc.stub.List(
3429                        req,
3430                        metadata=svc.parent.get_metadata(
3431                            'PeeringGroupNodes.List', req),
3432                        timeout=timeout)
3433                except Exception as e:
3434                    if self.parent.shouldRetry(tries, e):
3435                        tries += 1
3436                        self.parent.jitterSleep(tries)
3437                        continue
3438                    raise plumbing.convert_error_to_porcelain(e) from e
3439                tries = 0
3440                for plumbing_item in plumbing_response.peering_group_nodes:
3441                    yield plumbing.convert_peering_group_node_to_porcelain(
3442                        plumbing_item)
3443                if plumbing_response.meta.next_cursor == '':
3444                    break
3445                req.meta.cursor = plumbing_response.meta.next_cursor
3446
3447        return generator(self, req)

List gets a list of peering group node attachments.

class PeeringGroupPeers:
3450class PeeringGroupPeers:
3451    '''
3452     PeeringGroupPeers provides the building blocks necessary to link two peering groups.
3453    See `strongdm.models.PeeringGroupPeer`.
3454    '''
3455    def __init__(self, channel, client):
3456        self.parent = client
3457        self.stub = PeeringGroupPeersStub(channel)
3458
3459    def create(self, peering_group_peer, timeout=None):
3460        '''
3461         Create links two peering groups.
3462        '''
3463        req = PeeringGroupPeerCreateRequest()
3464
3465        if peering_group_peer is not None:
3466            req.peering_group_peer.CopyFrom(
3467                plumbing.convert_peering_group_peer_to_plumbing(
3468                    peering_group_peer))
3469        tries = 0
3470        plumbing_response = None
3471        while True:
3472            try:
3473                plumbing_response = self.stub.Create(
3474                    req,
3475                    metadata=self.parent.get_metadata(
3476                        'PeeringGroupPeers.Create', req),
3477                    timeout=timeout)
3478            except Exception as e:
3479                if self.parent.shouldRetry(tries, e):
3480                    tries += 1
3481                    self.parent.jitterSleep(tries)
3482                    continue
3483                raise plumbing.convert_error_to_porcelain(e) from e
3484            break
3485
3486        resp = models.PeeringGroupPeerCreateResponse()
3487        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3488            plumbing_response.meta)
3489        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3490            plumbing_response.peering_group_peer)
3491        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3492            plumbing_response.rate_limit)
3493        return resp
3494
3495    def delete(self, id, timeout=None):
3496        '''
3497         Delete unlinks two peering groups.
3498        '''
3499        req = PeeringGroupPeerDeleteRequest()
3500
3501        req.id = (id)
3502        tries = 0
3503        plumbing_response = None
3504        while True:
3505            try:
3506                plumbing_response = self.stub.Delete(
3507                    req,
3508                    metadata=self.parent.get_metadata(
3509                        'PeeringGroupPeers.Delete', req),
3510                    timeout=timeout)
3511            except Exception as e:
3512                if self.parent.shouldRetry(tries, e):
3513                    tries += 1
3514                    self.parent.jitterSleep(tries)
3515                    continue
3516                raise plumbing.convert_error_to_porcelain(e) from e
3517            break
3518
3519        resp = models.PeeringGroupPeerDeleteResponse()
3520        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3521            plumbing_response.meta)
3522        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3523            plumbing_response.rate_limit)
3524        return resp
3525
3526    def get(self, id, timeout=None):
3527        '''
3528         Get reads the information of one peering group link.
3529        '''
3530        req = PeeringGroupPeerGetRequest()
3531        if self.parent.snapshot_datetime is not None:
3532            req.meta.CopyFrom(GetRequestMetadata())
3533            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3534
3535        req.id = (id)
3536        tries = 0
3537        plumbing_response = None
3538        while True:
3539            try:
3540                plumbing_response = self.stub.Get(
3541                    req,
3542                    metadata=self.parent.get_metadata('PeeringGroupPeers.Get',
3543                                                      req),
3544                    timeout=timeout)
3545            except Exception as e:
3546                if self.parent.shouldRetry(tries, e):
3547                    tries += 1
3548                    self.parent.jitterSleep(tries)
3549                    continue
3550                raise plumbing.convert_error_to_porcelain(e) from e
3551            break
3552
3553        resp = models.PeeringGroupPeerGetResponse()
3554        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3555            plumbing_response.meta)
3556        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3557            plumbing_response.peering_group_peer)
3558        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3559            plumbing_response.rate_limit)
3560        return resp
3561
3562    def list(self, filter, *args, timeout=None):
3563        '''
3564         List gets a list of peering group links.
3565        '''
3566        req = PeeringGroupPeerListRequest()
3567        req.meta.CopyFrom(ListRequestMetadata())
3568        if self.parent.page_limit > 0:
3569            req.meta.limit = self.parent.page_limit
3570        if self.parent.snapshot_datetime is not None:
3571            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3572
3573        req.filter = plumbing.quote_filter_args(filter, *args)
3574
3575        def generator(svc, req):
3576            tries = 0
3577            while True:
3578                try:
3579                    plumbing_response = svc.stub.List(
3580                        req,
3581                        metadata=svc.parent.get_metadata(
3582                            'PeeringGroupPeers.List', req),
3583                        timeout=timeout)
3584                except Exception as e:
3585                    if self.parent.shouldRetry(tries, e):
3586                        tries += 1
3587                        self.parent.jitterSleep(tries)
3588                        continue
3589                    raise plumbing.convert_error_to_porcelain(e) from e
3590                tries = 0
3591                for plumbing_item in plumbing_response.peering_group_peers:
3592                    yield plumbing.convert_peering_group_peer_to_porcelain(
3593                        plumbing_item)
3594                if plumbing_response.meta.next_cursor == '':
3595                    break
3596                req.meta.cursor = plumbing_response.meta.next_cursor
3597
3598        return generator(self, req)

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

PeeringGroupPeers(channel, client)
3455    def __init__(self, channel, client):
3456        self.parent = client
3457        self.stub = PeeringGroupPeersStub(channel)
def create(self, peering_group_peer, timeout=None)
3459    def create(self, peering_group_peer, timeout=None):
3460        '''
3461         Create links two peering groups.
3462        '''
3463        req = PeeringGroupPeerCreateRequest()
3464
3465        if peering_group_peer is not None:
3466            req.peering_group_peer.CopyFrom(
3467                plumbing.convert_peering_group_peer_to_plumbing(
3468                    peering_group_peer))
3469        tries = 0
3470        plumbing_response = None
3471        while True:
3472            try:
3473                plumbing_response = self.stub.Create(
3474                    req,
3475                    metadata=self.parent.get_metadata(
3476                        'PeeringGroupPeers.Create', req),
3477                    timeout=timeout)
3478            except Exception as e:
3479                if self.parent.shouldRetry(tries, e):
3480                    tries += 1
3481                    self.parent.jitterSleep(tries)
3482                    continue
3483                raise plumbing.convert_error_to_porcelain(e) from e
3484            break
3485
3486        resp = models.PeeringGroupPeerCreateResponse()
3487        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3488            plumbing_response.meta)
3489        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3490            plumbing_response.peering_group_peer)
3491        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3492            plumbing_response.rate_limit)
3493        return resp

Create links two peering groups.

def delete(self, id, timeout=None)
3495    def delete(self, id, timeout=None):
3496        '''
3497         Delete unlinks two peering groups.
3498        '''
3499        req = PeeringGroupPeerDeleteRequest()
3500
3501        req.id = (id)
3502        tries = 0
3503        plumbing_response = None
3504        while True:
3505            try:
3506                plumbing_response = self.stub.Delete(
3507                    req,
3508                    metadata=self.parent.get_metadata(
3509                        'PeeringGroupPeers.Delete', req),
3510                    timeout=timeout)
3511            except Exception as e:
3512                if self.parent.shouldRetry(tries, e):
3513                    tries += 1
3514                    self.parent.jitterSleep(tries)
3515                    continue
3516                raise plumbing.convert_error_to_porcelain(e) from e
3517            break
3518
3519        resp = models.PeeringGroupPeerDeleteResponse()
3520        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3521            plumbing_response.meta)
3522        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3523            plumbing_response.rate_limit)
3524        return resp

Delete unlinks two peering groups.

def get(self, id, timeout=None)
3526    def get(self, id, timeout=None):
3527        '''
3528         Get reads the information of one peering group link.
3529        '''
3530        req = PeeringGroupPeerGetRequest()
3531        if self.parent.snapshot_datetime is not None:
3532            req.meta.CopyFrom(GetRequestMetadata())
3533            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3534
3535        req.id = (id)
3536        tries = 0
3537        plumbing_response = None
3538        while True:
3539            try:
3540                plumbing_response = self.stub.Get(
3541                    req,
3542                    metadata=self.parent.get_metadata('PeeringGroupPeers.Get',
3543                                                      req),
3544                    timeout=timeout)
3545            except Exception as e:
3546                if self.parent.shouldRetry(tries, e):
3547                    tries += 1
3548                    self.parent.jitterSleep(tries)
3549                    continue
3550                raise plumbing.convert_error_to_porcelain(e) from e
3551            break
3552
3553        resp = models.PeeringGroupPeerGetResponse()
3554        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3555            plumbing_response.meta)
3556        resp.peering_group_peer = plumbing.convert_peering_group_peer_to_porcelain(
3557            plumbing_response.peering_group_peer)
3558        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3559            plumbing_response.rate_limit)
3560        return resp

Get reads the information of one peering group link.

def list(self, filter, *args, timeout=None)
3562    def list(self, filter, *args, timeout=None):
3563        '''
3564         List gets a list of peering group links.
3565        '''
3566        req = PeeringGroupPeerListRequest()
3567        req.meta.CopyFrom(ListRequestMetadata())
3568        if self.parent.page_limit > 0:
3569            req.meta.limit = self.parent.page_limit
3570        if self.parent.snapshot_datetime is not None:
3571            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3572
3573        req.filter = plumbing.quote_filter_args(filter, *args)
3574
3575        def generator(svc, req):
3576            tries = 0
3577            while True:
3578                try:
3579                    plumbing_response = svc.stub.List(
3580                        req,
3581                        metadata=svc.parent.get_metadata(
3582                            'PeeringGroupPeers.List', req),
3583                        timeout=timeout)
3584                except Exception as e:
3585                    if self.parent.shouldRetry(tries, e):
3586                        tries += 1
3587                        self.parent.jitterSleep(tries)
3588                        continue
3589                    raise plumbing.convert_error_to_porcelain(e) from e
3590                tries = 0
3591                for plumbing_item in plumbing_response.peering_group_peers:
3592                    yield plumbing.convert_peering_group_peer_to_porcelain(
3593                        plumbing_item)
3594                if plumbing_response.meta.next_cursor == '':
3595                    break
3596                req.meta.cursor = plumbing_response.meta.next_cursor
3597
3598        return generator(self, req)

List gets a list of peering group links.

class PeeringGroupResources:
3601class PeeringGroupResources:
3602    '''
3603     PeeringGroupResources provides the building blocks necessary to obtain attach a resource to a peering group.
3604    See `strongdm.models.PeeringGroupResource`.
3605    '''
3606    def __init__(self, channel, client):
3607        self.parent = client
3608        self.stub = PeeringGroupResourcesStub(channel)
3609
3610    def create(self, peering_group_resource, timeout=None):
3611        '''
3612         Create attaches a Resource to a PeeringGroup
3613        '''
3614        req = PeeringGroupResourceCreateRequest()
3615
3616        if peering_group_resource is not None:
3617            req.peering_group_resource.CopyFrom(
3618                plumbing.convert_peering_group_resource_to_plumbing(
3619                    peering_group_resource))
3620        tries = 0
3621        plumbing_response = None
3622        while True:
3623            try:
3624                plumbing_response = self.stub.Create(
3625                    req,
3626                    metadata=self.parent.get_metadata(
3627                        'PeeringGroupResources.Create', req),
3628                    timeout=timeout)
3629            except Exception as e:
3630                if self.parent.shouldRetry(tries, e):
3631                    tries += 1
3632                    self.parent.jitterSleep(tries)
3633                    continue
3634                raise plumbing.convert_error_to_porcelain(e) from e
3635            break
3636
3637        resp = models.PeeringGroupResourceCreateResponse()
3638        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3639            plumbing_response.meta)
3640        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3641            plumbing_response.peering_group_resource)
3642        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3643            plumbing_response.rate_limit)
3644        return resp
3645
3646    def delete(self, id, timeout=None):
3647        '''
3648         Delete detaches a Resource to a PeeringGroup
3649        '''
3650        req = PeeringGroupResourceDeleteRequest()
3651
3652        req.id = (id)
3653        tries = 0
3654        plumbing_response = None
3655        while True:
3656            try:
3657                plumbing_response = self.stub.Delete(
3658                    req,
3659                    metadata=self.parent.get_metadata(
3660                        'PeeringGroupResources.Delete', req),
3661                    timeout=timeout)
3662            except Exception as e:
3663                if self.parent.shouldRetry(tries, e):
3664                    tries += 1
3665                    self.parent.jitterSleep(tries)
3666                    continue
3667                raise plumbing.convert_error_to_porcelain(e) from e
3668            break
3669
3670        resp = models.PeeringGroupResourceDeleteResponse()
3671        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3672            plumbing_response.meta)
3673        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3674            plumbing_response.rate_limit)
3675        return resp
3676
3677    def get(self, id, timeout=None):
3678        '''
3679         Get reads the information of one peering group to resource attachment.
3680        '''
3681        req = PeeringGroupResourceGetRequest()
3682        if self.parent.snapshot_datetime is not None:
3683            req.meta.CopyFrom(GetRequestMetadata())
3684            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3685
3686        req.id = (id)
3687        tries = 0
3688        plumbing_response = None
3689        while True:
3690            try:
3691                plumbing_response = self.stub.Get(
3692                    req,
3693                    metadata=self.parent.get_metadata(
3694                        'PeeringGroupResources.Get', req),
3695                    timeout=timeout)
3696            except Exception as e:
3697                if self.parent.shouldRetry(tries, e):
3698                    tries += 1
3699                    self.parent.jitterSleep(tries)
3700                    continue
3701                raise plumbing.convert_error_to_porcelain(e) from e
3702            break
3703
3704        resp = models.PeeringGroupResourceGetResponse()
3705        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3706            plumbing_response.meta)
3707        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3708            plumbing_response.peering_group_resource)
3709        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3710            plumbing_response.rate_limit)
3711        return resp
3712
3713    def list(self, filter, *args, timeout=None):
3714        '''
3715         List gets a list of peering group resource attachments.
3716        '''
3717        req = PeeringGroupResourceListRequest()
3718        req.meta.CopyFrom(ListRequestMetadata())
3719        if self.parent.page_limit > 0:
3720            req.meta.limit = self.parent.page_limit
3721        if self.parent.snapshot_datetime is not None:
3722            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3723
3724        req.filter = plumbing.quote_filter_args(filter, *args)
3725
3726        def generator(svc, req):
3727            tries = 0
3728            while True:
3729                try:
3730                    plumbing_response = svc.stub.List(
3731                        req,
3732                        metadata=svc.parent.get_metadata(
3733                            'PeeringGroupResources.List', req),
3734                        timeout=timeout)
3735                except Exception as e:
3736                    if self.parent.shouldRetry(tries, e):
3737                        tries += 1
3738                        self.parent.jitterSleep(tries)
3739                        continue
3740                    raise plumbing.convert_error_to_porcelain(e) from e
3741                tries = 0
3742                for plumbing_item in plumbing_response.peering_group_resources:
3743                    yield plumbing.convert_peering_group_resource_to_porcelain(
3744                        plumbing_item)
3745                if plumbing_response.meta.next_cursor == '':
3746                    break
3747                req.meta.cursor = plumbing_response.meta.next_cursor
3748
3749        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)
3606    def __init__(self, channel, client):
3607        self.parent = client
3608        self.stub = PeeringGroupResourcesStub(channel)
def create(self, peering_group_resource, timeout=None)
3610    def create(self, peering_group_resource, timeout=None):
3611        '''
3612         Create attaches a Resource to a PeeringGroup
3613        '''
3614        req = PeeringGroupResourceCreateRequest()
3615
3616        if peering_group_resource is not None:
3617            req.peering_group_resource.CopyFrom(
3618                plumbing.convert_peering_group_resource_to_plumbing(
3619                    peering_group_resource))
3620        tries = 0
3621        plumbing_response = None
3622        while True:
3623            try:
3624                plumbing_response = self.stub.Create(
3625                    req,
3626                    metadata=self.parent.get_metadata(
3627                        'PeeringGroupResources.Create', req),
3628                    timeout=timeout)
3629            except Exception as e:
3630                if self.parent.shouldRetry(tries, e):
3631                    tries += 1
3632                    self.parent.jitterSleep(tries)
3633                    continue
3634                raise plumbing.convert_error_to_porcelain(e) from e
3635            break
3636
3637        resp = models.PeeringGroupResourceCreateResponse()
3638        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3639            plumbing_response.meta)
3640        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3641            plumbing_response.peering_group_resource)
3642        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3643            plumbing_response.rate_limit)
3644        return resp

Create attaches a Resource to a PeeringGroup

def delete(self, id, timeout=None)
3646    def delete(self, id, timeout=None):
3647        '''
3648         Delete detaches a Resource to a PeeringGroup
3649        '''
3650        req = PeeringGroupResourceDeleteRequest()
3651
3652        req.id = (id)
3653        tries = 0
3654        plumbing_response = None
3655        while True:
3656            try:
3657                plumbing_response = self.stub.Delete(
3658                    req,
3659                    metadata=self.parent.get_metadata(
3660                        'PeeringGroupResources.Delete', req),
3661                    timeout=timeout)
3662            except Exception as e:
3663                if self.parent.shouldRetry(tries, e):
3664                    tries += 1
3665                    self.parent.jitterSleep(tries)
3666                    continue
3667                raise plumbing.convert_error_to_porcelain(e) from e
3668            break
3669
3670        resp = models.PeeringGroupResourceDeleteResponse()
3671        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3672            plumbing_response.meta)
3673        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3674            plumbing_response.rate_limit)
3675        return resp

Delete detaches a Resource to a PeeringGroup

def get(self, id, timeout=None)
3677    def get(self, id, timeout=None):
3678        '''
3679         Get reads the information of one peering group to resource attachment.
3680        '''
3681        req = PeeringGroupResourceGetRequest()
3682        if self.parent.snapshot_datetime is not None:
3683            req.meta.CopyFrom(GetRequestMetadata())
3684            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3685
3686        req.id = (id)
3687        tries = 0
3688        plumbing_response = None
3689        while True:
3690            try:
3691                plumbing_response = self.stub.Get(
3692                    req,
3693                    metadata=self.parent.get_metadata(
3694                        'PeeringGroupResources.Get', req),
3695                    timeout=timeout)
3696            except Exception as e:
3697                if self.parent.shouldRetry(tries, e):
3698                    tries += 1
3699                    self.parent.jitterSleep(tries)
3700                    continue
3701                raise plumbing.convert_error_to_porcelain(e) from e
3702            break
3703
3704        resp = models.PeeringGroupResourceGetResponse()
3705        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3706            plumbing_response.meta)
3707        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3708            plumbing_response.peering_group_resource)
3709        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3710            plumbing_response.rate_limit)
3711        return resp

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

def list(self, filter, *args, timeout=None)
3713    def list(self, filter, *args, timeout=None):
3714        '''
3715         List gets a list of peering group resource attachments.
3716        '''
3717        req = PeeringGroupResourceListRequest()
3718        req.meta.CopyFrom(ListRequestMetadata())
3719        if self.parent.page_limit > 0:
3720            req.meta.limit = self.parent.page_limit
3721        if self.parent.snapshot_datetime is not None:
3722            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3723
3724        req.filter = plumbing.quote_filter_args(filter, *args)
3725
3726        def generator(svc, req):
3727            tries = 0
3728            while True:
3729                try:
3730                    plumbing_response = svc.stub.List(
3731                        req,
3732                        metadata=svc.parent.get_metadata(
3733                            'PeeringGroupResources.List', req),
3734                        timeout=timeout)
3735                except Exception as e:
3736                    if self.parent.shouldRetry(tries, e):
3737                        tries += 1
3738                        self.parent.jitterSleep(tries)
3739                        continue
3740                    raise plumbing.convert_error_to_porcelain(e) from e
3741                tries = 0
3742                for plumbing_item in plumbing_response.peering_group_resources:
3743                    yield plumbing.convert_peering_group_resource_to_porcelain(
3744                        plumbing_item)
3745                if plumbing_response.meta.next_cursor == '':
3746                    break
3747                req.meta.cursor = plumbing_response.meta.next_cursor
3748
3749        return generator(self, req)

List gets a list of peering group resource attachments.

class PeeringGroups:
3752class PeeringGroups:
3753    '''
3754     PeeringGroups provides the building blocks necessary to obtain explicit network topology and routing.
3755    See `strongdm.models.PeeringGroup`.
3756    '''
3757    def __init__(self, channel, client):
3758        self.parent = client
3759        self.stub = PeeringGroupsStub(channel)
3760
3761    def create(self, peering_group, timeout=None):
3762        '''
3763         Create registers a new PeeringGroup.
3764        '''
3765        req = PeeringGroupCreateRequest()
3766
3767        if peering_group is not None:
3768            req.peering_group.CopyFrom(
3769                plumbing.convert_peering_group_to_plumbing(peering_group))
3770        tries = 0
3771        plumbing_response = None
3772        while True:
3773            try:
3774                plumbing_response = self.stub.Create(
3775                    req,
3776                    metadata=self.parent.get_metadata('PeeringGroups.Create',
3777                                                      req),
3778                    timeout=timeout)
3779            except Exception as e:
3780                if self.parent.shouldRetry(tries, e):
3781                    tries += 1
3782                    self.parent.jitterSleep(tries)
3783                    continue
3784                raise plumbing.convert_error_to_porcelain(e) from e
3785            break
3786
3787        resp = models.PeeringGroupCreateResponse()
3788        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3789            plumbing_response.meta)
3790        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3791            plumbing_response.peering_group)
3792        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3793            plumbing_response.rate_limit)
3794        return resp
3795
3796    def delete(self, id, timeout=None):
3797        '''
3798         Delete removes a PeeringGroup by ID.
3799        '''
3800        req = PeeringGroupDeleteRequest()
3801
3802        req.id = (id)
3803        tries = 0
3804        plumbing_response = None
3805        while True:
3806            try:
3807                plumbing_response = self.stub.Delete(
3808                    req,
3809                    metadata=self.parent.get_metadata('PeeringGroups.Delete',
3810                                                      req),
3811                    timeout=timeout)
3812            except Exception as e:
3813                if self.parent.shouldRetry(tries, e):
3814                    tries += 1
3815                    self.parent.jitterSleep(tries)
3816                    continue
3817                raise plumbing.convert_error_to_porcelain(e) from e
3818            break
3819
3820        resp = models.PeeringGroupDeleteResponse()
3821        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3822            plumbing_response.meta)
3823        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3824            plumbing_response.rate_limit)
3825        return resp
3826
3827    def get(self, id, timeout=None):
3828        '''
3829         Get reads one PeeringGroup by ID. It will load all its dependencies.
3830        '''
3831        req = PeeringGroupGetRequest()
3832        if self.parent.snapshot_datetime is not None:
3833            req.meta.CopyFrom(GetRequestMetadata())
3834            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3835
3836        req.id = (id)
3837        tries = 0
3838        plumbing_response = None
3839        while True:
3840            try:
3841                plumbing_response = self.stub.Get(
3842                    req,
3843                    metadata=self.parent.get_metadata('PeeringGroups.Get',
3844                                                      req),
3845                    timeout=timeout)
3846            except Exception as e:
3847                if self.parent.shouldRetry(tries, e):
3848                    tries += 1
3849                    self.parent.jitterSleep(tries)
3850                    continue
3851                raise plumbing.convert_error_to_porcelain(e) from e
3852            break
3853
3854        resp = models.PeeringGroupGetResponse()
3855        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3856            plumbing_response.meta)
3857        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3858            plumbing_response.peering_group)
3859        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3860            plumbing_response.rate_limit)
3861        return resp
3862
3863    def list(self, filter, *args, timeout=None):
3864        '''
3865         List gets a list of Peering Groups.
3866        '''
3867        req = PeeringGroupListRequest()
3868        req.meta.CopyFrom(ListRequestMetadata())
3869        if self.parent.page_limit > 0:
3870            req.meta.limit = self.parent.page_limit
3871        if self.parent.snapshot_datetime is not None:
3872            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3873
3874        req.filter = plumbing.quote_filter_args(filter, *args)
3875
3876        def generator(svc, req):
3877            tries = 0
3878            while True:
3879                try:
3880                    plumbing_response = svc.stub.List(
3881                        req,
3882                        metadata=svc.parent.get_metadata(
3883                            'PeeringGroups.List', req),
3884                        timeout=timeout)
3885                except Exception as e:
3886                    if self.parent.shouldRetry(tries, e):
3887                        tries += 1
3888                        self.parent.jitterSleep(tries)
3889                        continue
3890                    raise plumbing.convert_error_to_porcelain(e) from e
3891                tries = 0
3892                for plumbing_item in plumbing_response.peering_groups:
3893                    yield plumbing.convert_peering_group_to_porcelain(
3894                        plumbing_item)
3895                if plumbing_response.meta.next_cursor == '':
3896                    break
3897                req.meta.cursor = plumbing_response.meta.next_cursor
3898
3899        return generator(self, req)

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

PeeringGroups(channel, client)
3757    def __init__(self, channel, client):
3758        self.parent = client
3759        self.stub = PeeringGroupsStub(channel)
def create(self, peering_group, timeout=None)
3761    def create(self, peering_group, timeout=None):
3762        '''
3763         Create registers a new PeeringGroup.
3764        '''
3765        req = PeeringGroupCreateRequest()
3766
3767        if peering_group is not None:
3768            req.peering_group.CopyFrom(
3769                plumbing.convert_peering_group_to_plumbing(peering_group))
3770        tries = 0
3771        plumbing_response = None
3772        while True:
3773            try:
3774                plumbing_response = self.stub.Create(
3775                    req,
3776                    metadata=self.parent.get_metadata('PeeringGroups.Create',
3777                                                      req),
3778                    timeout=timeout)
3779            except Exception as e:
3780                if self.parent.shouldRetry(tries, e):
3781                    tries += 1
3782                    self.parent.jitterSleep(tries)
3783                    continue
3784                raise plumbing.convert_error_to_porcelain(e) from e
3785            break
3786
3787        resp = models.PeeringGroupCreateResponse()
3788        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
3789            plumbing_response.meta)
3790        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3791            plumbing_response.peering_group)
3792        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3793            plumbing_response.rate_limit)
3794        return resp

Create registers a new PeeringGroup.

def delete(self, id, timeout=None)
3796    def delete(self, id, timeout=None):
3797        '''
3798         Delete removes a PeeringGroup by ID.
3799        '''
3800        req = PeeringGroupDeleteRequest()
3801
3802        req.id = (id)
3803        tries = 0
3804        plumbing_response = None
3805        while True:
3806            try:
3807                plumbing_response = self.stub.Delete(
3808                    req,
3809                    metadata=self.parent.get_metadata('PeeringGroups.Delete',
3810                                                      req),
3811                    timeout=timeout)
3812            except Exception as e:
3813                if self.parent.shouldRetry(tries, e):
3814                    tries += 1
3815                    self.parent.jitterSleep(tries)
3816                    continue
3817                raise plumbing.convert_error_to_porcelain(e) from e
3818            break
3819
3820        resp = models.PeeringGroupDeleteResponse()
3821        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
3822            plumbing_response.meta)
3823        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3824            plumbing_response.rate_limit)
3825        return resp

Delete removes a PeeringGroup by ID.

def get(self, id, timeout=None)
3827    def get(self, id, timeout=None):
3828        '''
3829         Get reads one PeeringGroup by ID. It will load all its dependencies.
3830        '''
3831        req = PeeringGroupGetRequest()
3832        if self.parent.snapshot_datetime is not None:
3833            req.meta.CopyFrom(GetRequestMetadata())
3834            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3835
3836        req.id = (id)
3837        tries = 0
3838        plumbing_response = None
3839        while True:
3840            try:
3841                plumbing_response = self.stub.Get(
3842                    req,
3843                    metadata=self.parent.get_metadata('PeeringGroups.Get',
3844                                                      req),
3845                    timeout=timeout)
3846            except Exception as e:
3847                if self.parent.shouldRetry(tries, e):
3848                    tries += 1
3849                    self.parent.jitterSleep(tries)
3850                    continue
3851                raise plumbing.convert_error_to_porcelain(e) from e
3852            break
3853
3854        resp = models.PeeringGroupGetResponse()
3855        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3856            plumbing_response.meta)
3857        resp.peering_group = plumbing.convert_peering_group_to_porcelain(
3858            plumbing_response.peering_group)
3859        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3860            plumbing_response.rate_limit)
3861        return resp

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

def list(self, filter, *args, timeout=None)
3863    def list(self, filter, *args, timeout=None):
3864        '''
3865         List gets a list of Peering Groups.
3866        '''
3867        req = PeeringGroupListRequest()
3868        req.meta.CopyFrom(ListRequestMetadata())
3869        if self.parent.page_limit > 0:
3870            req.meta.limit = self.parent.page_limit
3871        if self.parent.snapshot_datetime is not None:
3872            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3873
3874        req.filter = plumbing.quote_filter_args(filter, *args)
3875
3876        def generator(svc, req):
3877            tries = 0
3878            while True:
3879                try:
3880                    plumbing_response = svc.stub.List(
3881                        req,
3882                        metadata=svc.parent.get_metadata(
3883                            'PeeringGroups.List', req),
3884                        timeout=timeout)
3885                except Exception as e:
3886                    if self.parent.shouldRetry(tries, e):
3887                        tries += 1
3888                        self.parent.jitterSleep(tries)
3889                        continue
3890                    raise plumbing.convert_error_to_porcelain(e) from e
3891                tries = 0
3892                for plumbing_item in plumbing_response.peering_groups:
3893                    yield plumbing.convert_peering_group_to_porcelain(
3894                        plumbing_item)
3895                if plumbing_response.meta.next_cursor == '':
3896                    break
3897                req.meta.cursor = plumbing_response.meta.next_cursor
3898
3899        return generator(self, req)

List gets a list of Peering Groups.

class Policies:
3902class Policies:
3903    '''
3904     Policies are the collection of one or more statements that enforce fine-grained access
3905     control for the users of an organization.
3906    See `strongdm.models.Policy`.
3907    '''
3908    def __init__(self, channel, client):
3909        self.parent = client
3910        self.stub = PoliciesStub(channel)
3911
3912    def create(self, policy, timeout=None):
3913        '''
3914         Create creates a new Policy.
3915        '''
3916        req = PolicyCreateRequest()
3917
3918        if policy is not None:
3919            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3920        tries = 0
3921        plumbing_response = None
3922        while True:
3923            try:
3924                plumbing_response = self.stub.Create(
3925                    req,
3926                    metadata=self.parent.get_metadata('Policies.Create', req),
3927                    timeout=timeout)
3928            except Exception as e:
3929                if self.parent.shouldRetry(tries, e):
3930                    tries += 1
3931                    self.parent.jitterSleep(tries)
3932                    continue
3933                raise plumbing.convert_error_to_porcelain(e) from e
3934            break
3935
3936        resp = models.PolicyCreateResponse()
3937        resp.policy = plumbing.convert_policy_to_porcelain(
3938            plumbing_response.policy)
3939        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3940            plumbing_response.rate_limit)
3941        return resp
3942
3943    def delete(self, id, timeout=None):
3944        '''
3945         Delete removes a Policy by ID.
3946        '''
3947        req = PolicyDeleteRequest()
3948
3949        req.id = (id)
3950        tries = 0
3951        plumbing_response = None
3952        while True:
3953            try:
3954                plumbing_response = self.stub.Delete(
3955                    req,
3956                    metadata=self.parent.get_metadata('Policies.Delete', req),
3957                    timeout=timeout)
3958            except Exception as e:
3959                if self.parent.shouldRetry(tries, e):
3960                    tries += 1
3961                    self.parent.jitterSleep(tries)
3962                    continue
3963                raise plumbing.convert_error_to_porcelain(e) from e
3964            break
3965
3966        resp = models.PolicyDeleteResponse()
3967        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3968            plumbing_response.rate_limit)
3969        return resp
3970
3971    def update(self, policy, timeout=None):
3972        '''
3973         Update replaces all the fields of a Policy by ID.
3974        '''
3975        req = PolicyUpdateRequest()
3976
3977        if policy is not None:
3978            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3979        tries = 0
3980        plumbing_response = None
3981        while True:
3982            try:
3983                plumbing_response = self.stub.Update(
3984                    req,
3985                    metadata=self.parent.get_metadata('Policies.Update', req),
3986                    timeout=timeout)
3987            except Exception as e:
3988                if self.parent.shouldRetry(tries, e):
3989                    tries += 1
3990                    self.parent.jitterSleep(tries)
3991                    continue
3992                raise plumbing.convert_error_to_porcelain(e) from e
3993            break
3994
3995        resp = models.PolicyUpdateResponse()
3996        resp.policy = plumbing.convert_policy_to_porcelain(
3997            plumbing_response.policy)
3998        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3999            plumbing_response.rate_limit)
4000        return resp
4001
4002    def get(self, id, timeout=None):
4003        '''
4004         Get reads one Policy by ID.
4005        '''
4006        req = PolicyGetRequest()
4007        if self.parent.snapshot_datetime is not None:
4008            req.meta.CopyFrom(GetRequestMetadata())
4009            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4010
4011        req.id = (id)
4012        tries = 0
4013        plumbing_response = None
4014        while True:
4015            try:
4016                plumbing_response = self.stub.Get(
4017                    req,
4018                    metadata=self.parent.get_metadata('Policies.Get', req),
4019                    timeout=timeout)
4020            except Exception as e:
4021                if self.parent.shouldRetry(tries, e):
4022                    tries += 1
4023                    self.parent.jitterSleep(tries)
4024                    continue
4025                raise plumbing.convert_error_to_porcelain(e) from e
4026            break
4027
4028        resp = models.PolicyGetResponse()
4029        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4030            plumbing_response.meta)
4031        resp.policy = plumbing.convert_policy_to_porcelain(
4032            plumbing_response.policy)
4033        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4034            plumbing_response.rate_limit)
4035        return resp
4036
4037    def list(self, filter, *args, timeout=None):
4038        '''
4039         List gets a list of Policy matching a given set of criteria
4040        '''
4041        req = PolicyListRequest()
4042        req.meta.CopyFrom(ListRequestMetadata())
4043        if self.parent.page_limit > 0:
4044            req.meta.limit = self.parent.page_limit
4045        if self.parent.snapshot_datetime is not None:
4046            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4047
4048        req.filter = plumbing.quote_filter_args(filter, *args)
4049
4050        def generator(svc, req):
4051            tries = 0
4052            while True:
4053                try:
4054                    plumbing_response = svc.stub.List(
4055                        req,
4056                        metadata=svc.parent.get_metadata('Policies.List', req),
4057                        timeout=timeout)
4058                except Exception as e:
4059                    if self.parent.shouldRetry(tries, e):
4060                        tries += 1
4061                        self.parent.jitterSleep(tries)
4062                        continue
4063                    raise plumbing.convert_error_to_porcelain(e) from e
4064                tries = 0
4065                for plumbing_item in plumbing_response.policies:
4066                    yield plumbing.convert_policy_to_porcelain(plumbing_item)
4067                if plumbing_response.meta.next_cursor == '':
4068                    break
4069                req.meta.cursor = plumbing_response.meta.next_cursor
4070
4071        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)
3908    def __init__(self, channel, client):
3909        self.parent = client
3910        self.stub = PoliciesStub(channel)
def create(self, policy, timeout=None)
3912    def create(self, policy, timeout=None):
3913        '''
3914         Create creates a new Policy.
3915        '''
3916        req = PolicyCreateRequest()
3917
3918        if policy is not None:
3919            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3920        tries = 0
3921        plumbing_response = None
3922        while True:
3923            try:
3924                plumbing_response = self.stub.Create(
3925                    req,
3926                    metadata=self.parent.get_metadata('Policies.Create', req),
3927                    timeout=timeout)
3928            except Exception as e:
3929                if self.parent.shouldRetry(tries, e):
3930                    tries += 1
3931                    self.parent.jitterSleep(tries)
3932                    continue
3933                raise plumbing.convert_error_to_porcelain(e) from e
3934            break
3935
3936        resp = models.PolicyCreateResponse()
3937        resp.policy = plumbing.convert_policy_to_porcelain(
3938            plumbing_response.policy)
3939        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3940            plumbing_response.rate_limit)
3941        return resp

Create creates a new Policy.

def delete(self, id, timeout=None)
3943    def delete(self, id, timeout=None):
3944        '''
3945         Delete removes a Policy by ID.
3946        '''
3947        req = PolicyDeleteRequest()
3948
3949        req.id = (id)
3950        tries = 0
3951        plumbing_response = None
3952        while True:
3953            try:
3954                plumbing_response = self.stub.Delete(
3955                    req,
3956                    metadata=self.parent.get_metadata('Policies.Delete', req),
3957                    timeout=timeout)
3958            except Exception as e:
3959                if self.parent.shouldRetry(tries, e):
3960                    tries += 1
3961                    self.parent.jitterSleep(tries)
3962                    continue
3963                raise plumbing.convert_error_to_porcelain(e) from e
3964            break
3965
3966        resp = models.PolicyDeleteResponse()
3967        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3968            plumbing_response.rate_limit)
3969        return resp

Delete removes a Policy by ID.

def update(self, policy, timeout=None)
3971    def update(self, policy, timeout=None):
3972        '''
3973         Update replaces all the fields of a Policy by ID.
3974        '''
3975        req = PolicyUpdateRequest()
3976
3977        if policy is not None:
3978            req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
3979        tries = 0
3980        plumbing_response = None
3981        while True:
3982            try:
3983                plumbing_response = self.stub.Update(
3984                    req,
3985                    metadata=self.parent.get_metadata('Policies.Update', req),
3986                    timeout=timeout)
3987            except Exception as e:
3988                if self.parent.shouldRetry(tries, e):
3989                    tries += 1
3990                    self.parent.jitterSleep(tries)
3991                    continue
3992                raise plumbing.convert_error_to_porcelain(e) from e
3993            break
3994
3995        resp = models.PolicyUpdateResponse()
3996        resp.policy = plumbing.convert_policy_to_porcelain(
3997            plumbing_response.policy)
3998        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3999            plumbing_response.rate_limit)
4000        return resp

Update replaces all the fields of a Policy by ID.

def get(self, id, timeout=None)
4002    def get(self, id, timeout=None):
4003        '''
4004         Get reads one Policy by ID.
4005        '''
4006        req = PolicyGetRequest()
4007        if self.parent.snapshot_datetime is not None:
4008            req.meta.CopyFrom(GetRequestMetadata())
4009            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4010
4011        req.id = (id)
4012        tries = 0
4013        plumbing_response = None
4014        while True:
4015            try:
4016                plumbing_response = self.stub.Get(
4017                    req,
4018                    metadata=self.parent.get_metadata('Policies.Get', req),
4019                    timeout=timeout)
4020            except Exception as e:
4021                if self.parent.shouldRetry(tries, e):
4022                    tries += 1
4023                    self.parent.jitterSleep(tries)
4024                    continue
4025                raise plumbing.convert_error_to_porcelain(e) from e
4026            break
4027
4028        resp = models.PolicyGetResponse()
4029        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4030            plumbing_response.meta)
4031        resp.policy = plumbing.convert_policy_to_porcelain(
4032            plumbing_response.policy)
4033        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4034            plumbing_response.rate_limit)
4035        return resp

Get reads one Policy by ID.

def list(self, filter, *args, timeout=None)
4037    def list(self, filter, *args, timeout=None):
4038        '''
4039         List gets a list of Policy matching a given set of criteria
4040        '''
4041        req = PolicyListRequest()
4042        req.meta.CopyFrom(ListRequestMetadata())
4043        if self.parent.page_limit > 0:
4044            req.meta.limit = self.parent.page_limit
4045        if self.parent.snapshot_datetime is not None:
4046            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4047
4048        req.filter = plumbing.quote_filter_args(filter, *args)
4049
4050        def generator(svc, req):
4051            tries = 0
4052            while True:
4053                try:
4054                    plumbing_response = svc.stub.List(
4055                        req,
4056                        metadata=svc.parent.get_metadata('Policies.List', req),
4057                        timeout=timeout)
4058                except Exception as e:
4059                    if self.parent.shouldRetry(tries, e):
4060                        tries += 1
4061                        self.parent.jitterSleep(tries)
4062                        continue
4063                    raise plumbing.convert_error_to_porcelain(e) from e
4064                tries = 0
4065                for plumbing_item in plumbing_response.policies:
4066                    yield plumbing.convert_policy_to_porcelain(plumbing_item)
4067                if plumbing_response.meta.next_cursor == '':
4068                    break
4069                req.meta.cursor = plumbing_response.meta.next_cursor
4070
4071        return generator(self, req)

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

class SnapshotPolicies:
4074class SnapshotPolicies:
4075    '''
4076    SnapshotPolicies exposes the read only methods of the Policies
4077    service for historical queries.
4078    '''
4079    def __init__(self, policies):
4080        self.policies = policies
4081
4082    def get(self, id, timeout=None):
4083        '''
4084         Get reads one Policy by ID.
4085        '''
4086        return self.policies.get(id, timeout=timeout)
4087
4088    def list(self, filter, *args, timeout=None):
4089        '''
4090         List gets a list of Policy matching a given set of criteria
4091        '''
4092        return self.policies.list(filter, *args, timeout=timeout)

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

SnapshotPolicies(policies)
4079    def __init__(self, policies):
4080        self.policies = policies
def get(self, id, timeout=None)
4082    def get(self, id, timeout=None):
4083        '''
4084         Get reads one Policy by ID.
4085        '''
4086        return self.policies.get(id, timeout=timeout)

Get reads one Policy by ID.

def list(self, filter, *args, timeout=None)
4088    def list(self, filter, *args, timeout=None):
4089        '''
4090         List gets a list of Policy matching a given set of criteria
4091        '''
4092        return self.policies.list(filter, *args, timeout=timeout)

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

class PoliciesHistory:
4095class PoliciesHistory:
4096    '''
4097     PoliciesHistory records all changes to the state of a Policy.
4098    See `strongdm.models.PolicyHistory`.
4099    '''
4100    def __init__(self, channel, client):
4101        self.parent = client
4102        self.stub = PoliciesHistoryStub(channel)
4103
4104    def list(self, filter, *args, timeout=None):
4105        '''
4106         List gets a list of PolicyHistory records matching a given set of criteria.
4107        '''
4108        req = PoliciesHistoryListRequest()
4109        req.meta.CopyFrom(ListRequestMetadata())
4110        if self.parent.page_limit > 0:
4111            req.meta.limit = self.parent.page_limit
4112        if self.parent.snapshot_datetime is not None:
4113            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4114
4115        req.filter = plumbing.quote_filter_args(filter, *args)
4116
4117        def generator(svc, req):
4118            tries = 0
4119            while True:
4120                try:
4121                    plumbing_response = svc.stub.List(
4122                        req,
4123                        metadata=svc.parent.get_metadata(
4124                            'PoliciesHistory.List', req),
4125                        timeout=timeout)
4126                except Exception as e:
4127                    if self.parent.shouldRetry(tries, e):
4128                        tries += 1
4129                        self.parent.jitterSleep(tries)
4130                        continue
4131                    raise plumbing.convert_error_to_porcelain(e) from e
4132                tries = 0
4133                for plumbing_item in plumbing_response.history:
4134                    yield plumbing.convert_policy_history_to_porcelain(
4135                        plumbing_item)
4136                if plumbing_response.meta.next_cursor == '':
4137                    break
4138                req.meta.cursor = plumbing_response.meta.next_cursor
4139
4140        return generator(self, req)

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

PoliciesHistory(channel, client)
4100    def __init__(self, channel, client):
4101        self.parent = client
4102        self.stub = PoliciesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
4104    def list(self, filter, *args, timeout=None):
4105        '''
4106         List gets a list of PolicyHistory records matching a given set of criteria.
4107        '''
4108        req = PoliciesHistoryListRequest()
4109        req.meta.CopyFrom(ListRequestMetadata())
4110        if self.parent.page_limit > 0:
4111            req.meta.limit = self.parent.page_limit
4112        if self.parent.snapshot_datetime is not None:
4113            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4114
4115        req.filter = plumbing.quote_filter_args(filter, *args)
4116
4117        def generator(svc, req):
4118            tries = 0
4119            while True:
4120                try:
4121                    plumbing_response = svc.stub.List(
4122                        req,
4123                        metadata=svc.parent.get_metadata(
4124                            'PoliciesHistory.List', req),
4125                        timeout=timeout)
4126                except Exception as e:
4127                    if self.parent.shouldRetry(tries, e):
4128                        tries += 1
4129                        self.parent.jitterSleep(tries)
4130                        continue
4131                    raise plumbing.convert_error_to_porcelain(e) from e
4132                tries = 0
4133                for plumbing_item in plumbing_response.history:
4134                    yield plumbing.convert_policy_history_to_porcelain(
4135                        plumbing_item)
4136                if plumbing_response.meta.next_cursor == '':
4137                    break
4138                req.meta.cursor = plumbing_response.meta.next_cursor
4139
4140        return generator(self, req)

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

class ProxyClusterKeys:
4143class ProxyClusterKeys:
4144    '''
4145     Proxy Cluster Keys are authentication keys for all proxies within a cluster.
4146     The proxies within a cluster share the same key. One cluster can have
4147     multiple keys in order to facilitate key rotation.
4148    See `strongdm.models.ProxyClusterKey`.
4149    '''
4150    def __init__(self, channel, client):
4151        self.parent = client
4152        self.stub = ProxyClusterKeysStub(channel)
4153
4154    def create(self, proxy_cluster_key, timeout=None):
4155        '''
4156         Create registers a new ProxyClusterKey.
4157        '''
4158        req = ProxyClusterKeyCreateRequest()
4159
4160        if proxy_cluster_key is not None:
4161            req.proxy_cluster_key.CopyFrom(
4162                plumbing.convert_proxy_cluster_key_to_plumbing(
4163                    proxy_cluster_key))
4164        tries = 0
4165        plumbing_response = None
4166        while True:
4167            try:
4168                plumbing_response = self.stub.Create(
4169                    req,
4170                    metadata=self.parent.get_metadata(
4171                        'ProxyClusterKeys.Create', req),
4172                    timeout=timeout)
4173            except Exception as e:
4174                if self.parent.shouldRetry(tries, e):
4175                    tries += 1
4176                    self.parent.jitterSleep(tries)
4177                    continue
4178                raise plumbing.convert_error_to_porcelain(e) from e
4179            break
4180
4181        resp = models.ProxyClusterKeyCreateResponse()
4182        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4183            plumbing_response.meta)
4184        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
4185            plumbing_response.proxy_cluster_key)
4186        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4187            plumbing_response.rate_limit)
4188        resp.secret_key = (plumbing_response.secret_key)
4189        return resp
4190
4191    def get(self, id, timeout=None):
4192        '''
4193         Get reads one ProxyClusterKey by ID.
4194        '''
4195        req = ProxyClusterKeyGetRequest()
4196        if self.parent.snapshot_datetime is not None:
4197            req.meta.CopyFrom(GetRequestMetadata())
4198            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4199
4200        req.id = (id)
4201        tries = 0
4202        plumbing_response = None
4203        while True:
4204            try:
4205                plumbing_response = self.stub.Get(
4206                    req,
4207                    metadata=self.parent.get_metadata('ProxyClusterKeys.Get',
4208                                                      req),
4209                    timeout=timeout)
4210            except Exception as e:
4211                if self.parent.shouldRetry(tries, e):
4212                    tries += 1
4213                    self.parent.jitterSleep(tries)
4214                    continue
4215                raise plumbing.convert_error_to_porcelain(e) from e
4216            break
4217
4218        resp = models.ProxyClusterKeyGetResponse()
4219        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4220            plumbing_response.meta)
4221        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
4222            plumbing_response.proxy_cluster_key)
4223        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4224            plumbing_response.rate_limit)
4225        return resp
4226
4227    def delete(self, id, timeout=None):
4228        '''
4229         Delete removes a ProxyClusterKey by ID.
4230        '''
4231        req = ProxyClusterKeyDeleteRequest()
4232
4233        req.id = (id)
4234        tries = 0
4235        plumbing_response = None
4236        while True:
4237            try:
4238                plumbing_response = self.stub.Delete(
4239                    req,
4240                    metadata=self.parent.get_metadata(
4241                        'ProxyClusterKeys.Delete', req),
4242                    timeout=timeout)
4243            except Exception as e:
4244                if self.parent.shouldRetry(tries, e):
4245                    tries += 1
4246                    self.parent.jitterSleep(tries)
4247                    continue
4248                raise plumbing.convert_error_to_porcelain(e) from e
4249            break
4250
4251        resp = models.ProxyClusterKeyDeleteResponse()
4252        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4253            plumbing_response.meta)
4254        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4255            plumbing_response.rate_limit)
4256        return resp
4257
4258    def list(self, filter, *args, timeout=None):
4259        '''
4260         List gets a list of ProxyClusterKeys matching a given set of criteria.
4261        '''
4262        req = ProxyClusterKeyListRequest()
4263        req.meta.CopyFrom(ListRequestMetadata())
4264        if self.parent.page_limit > 0:
4265            req.meta.limit = self.parent.page_limit
4266        if self.parent.snapshot_datetime is not None:
4267            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4268
4269        req.filter = plumbing.quote_filter_args(filter, *args)
4270
4271        def generator(svc, req):
4272            tries = 0
4273            while True:
4274                try:
4275                    plumbing_response = svc.stub.List(
4276                        req,
4277                        metadata=svc.parent.get_metadata(
4278                            'ProxyClusterKeys.List', 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                tries = 0
4287                for plumbing_item in plumbing_response.proxy_cluster_keys:
4288                    yield plumbing.convert_proxy_cluster_key_to_porcelain(
4289                        plumbing_item)
4290                if plumbing_response.meta.next_cursor == '':
4291                    break
4292                req.meta.cursor = plumbing_response.meta.next_cursor
4293
4294        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)
4150    def __init__(self, channel, client):
4151        self.parent = client
4152        self.stub = ProxyClusterKeysStub(channel)
def create(self, proxy_cluster_key, timeout=None)
4154    def create(self, proxy_cluster_key, timeout=None):
4155        '''
4156         Create registers a new ProxyClusterKey.
4157        '''
4158        req = ProxyClusterKeyCreateRequest()
4159
4160        if proxy_cluster_key is not None:
4161            req.proxy_cluster_key.CopyFrom(
4162                plumbing.convert_proxy_cluster_key_to_plumbing(
4163                    proxy_cluster_key))
4164        tries = 0
4165        plumbing_response = None
4166        while True:
4167            try:
4168                plumbing_response = self.stub.Create(
4169                    req,
4170                    metadata=self.parent.get_metadata(
4171                        'ProxyClusterKeys.Create', req),
4172                    timeout=timeout)
4173            except Exception as e:
4174                if self.parent.shouldRetry(tries, e):
4175                    tries += 1
4176                    self.parent.jitterSleep(tries)
4177                    continue
4178                raise plumbing.convert_error_to_porcelain(e) from e
4179            break
4180
4181        resp = models.ProxyClusterKeyCreateResponse()
4182        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4183            plumbing_response.meta)
4184        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
4185            plumbing_response.proxy_cluster_key)
4186        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4187            plumbing_response.rate_limit)
4188        resp.secret_key = (plumbing_response.secret_key)
4189        return resp

Create registers a new ProxyClusterKey.

def get(self, id, timeout=None)
4191    def get(self, id, timeout=None):
4192        '''
4193         Get reads one ProxyClusterKey by ID.
4194        '''
4195        req = ProxyClusterKeyGetRequest()
4196        if self.parent.snapshot_datetime is not None:
4197            req.meta.CopyFrom(GetRequestMetadata())
4198            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4199
4200        req.id = (id)
4201        tries = 0
4202        plumbing_response = None
4203        while True:
4204            try:
4205                plumbing_response = self.stub.Get(
4206                    req,
4207                    metadata=self.parent.get_metadata('ProxyClusterKeys.Get',
4208                                                      req),
4209                    timeout=timeout)
4210            except Exception as e:
4211                if self.parent.shouldRetry(tries, e):
4212                    tries += 1
4213                    self.parent.jitterSleep(tries)
4214                    continue
4215                raise plumbing.convert_error_to_porcelain(e) from e
4216            break
4217
4218        resp = models.ProxyClusterKeyGetResponse()
4219        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4220            plumbing_response.meta)
4221        resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
4222            plumbing_response.proxy_cluster_key)
4223        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4224            plumbing_response.rate_limit)
4225        return resp

Get reads one ProxyClusterKey by ID.

def delete(self, id, timeout=None)
4227    def delete(self, id, timeout=None):
4228        '''
4229         Delete removes a ProxyClusterKey by ID.
4230        '''
4231        req = ProxyClusterKeyDeleteRequest()
4232
4233        req.id = (id)
4234        tries = 0
4235        plumbing_response = None
4236        while True:
4237            try:
4238                plumbing_response = self.stub.Delete(
4239                    req,
4240                    metadata=self.parent.get_metadata(
4241                        'ProxyClusterKeys.Delete', req),
4242                    timeout=timeout)
4243            except Exception as e:
4244                if self.parent.shouldRetry(tries, e):
4245                    tries += 1
4246                    self.parent.jitterSleep(tries)
4247                    continue
4248                raise plumbing.convert_error_to_porcelain(e) from e
4249            break
4250
4251        resp = models.ProxyClusterKeyDeleteResponse()
4252        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4253            plumbing_response.meta)
4254        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4255            plumbing_response.rate_limit)
4256        return resp

Delete removes a ProxyClusterKey by ID.

def list(self, filter, *args, timeout=None)
4258    def list(self, filter, *args, timeout=None):
4259        '''
4260         List gets a list of ProxyClusterKeys matching a given set of criteria.
4261        '''
4262        req = ProxyClusterKeyListRequest()
4263        req.meta.CopyFrom(ListRequestMetadata())
4264        if self.parent.page_limit > 0:
4265            req.meta.limit = self.parent.page_limit
4266        if self.parent.snapshot_datetime is not None:
4267            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4268
4269        req.filter = plumbing.quote_filter_args(filter, *args)
4270
4271        def generator(svc, req):
4272            tries = 0
4273            while True:
4274                try:
4275                    plumbing_response = svc.stub.List(
4276                        req,
4277                        metadata=svc.parent.get_metadata(
4278                            'ProxyClusterKeys.List', 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                tries = 0
4287                for plumbing_item in plumbing_response.proxy_cluster_keys:
4288                    yield plumbing.convert_proxy_cluster_key_to_porcelain(
4289                        plumbing_item)
4290                if plumbing_response.meta.next_cursor == '':
4291                    break
4292                req.meta.cursor = plumbing_response.meta.next_cursor
4293
4294        return generator(self, req)

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

class SnapshotProxyClusterKeys:
4297class SnapshotProxyClusterKeys:
4298    '''
4299    SnapshotProxyClusterKeys exposes the read only methods of the ProxyClusterKeys
4300    service for historical queries.
4301    '''
4302    def __init__(self, proxy_cluster_keys):
4303        self.proxy_cluster_keys = proxy_cluster_keys
4304
4305    def get(self, id, timeout=None):
4306        '''
4307         Get reads one ProxyClusterKey by ID.
4308        '''
4309        return self.proxy_cluster_keys.get(id, timeout=timeout)
4310
4311    def list(self, filter, *args, timeout=None):
4312        '''
4313         List gets a list of ProxyClusterKeys matching a given set of criteria.
4314        '''
4315        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)
4302    def __init__(self, proxy_cluster_keys):
4303        self.proxy_cluster_keys = proxy_cluster_keys
def get(self, id, timeout=None)
4305    def get(self, id, timeout=None):
4306        '''
4307         Get reads one ProxyClusterKey by ID.
4308        '''
4309        return self.proxy_cluster_keys.get(id, timeout=timeout)

Get reads one ProxyClusterKey by ID.

def list(self, filter, *args, timeout=None)
4311    def list(self, filter, *args, timeout=None):
4312        '''
4313         List gets a list of ProxyClusterKeys matching a given set of criteria.
4314        '''
4315        return self.proxy_cluster_keys.list(filter, *args, timeout=timeout)

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

class Queries:
4318class Queries:
4319    '''
4320     A Query is a record of a single client request to a resource, such as a SQL query.
4321     Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries.
4322     The Queries service is read-only.
4323    See `strongdm.models.Query`.
4324    '''
4325    def __init__(self, channel, client):
4326        self.parent = client
4327        self.stub = QueriesStub(channel)
4328
4329    def list(self, filter, *args, timeout=None):
4330        '''
4331         List gets a list of Queries matching a given set of criteria.
4332        '''
4333        req = QueryListRequest()
4334        req.meta.CopyFrom(ListRequestMetadata())
4335        if self.parent.page_limit > 0:
4336            req.meta.limit = self.parent.page_limit
4337        if self.parent.snapshot_datetime is not None:
4338            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4339
4340        req.filter = plumbing.quote_filter_args(filter, *args)
4341
4342        def generator(svc, req):
4343            tries = 0
4344            while True:
4345                try:
4346                    plumbing_response = svc.stub.List(
4347                        req,
4348                        metadata=svc.parent.get_metadata('Queries.List', req),
4349                        timeout=timeout)
4350                except Exception as e:
4351                    if self.parent.shouldRetry(tries, e):
4352                        tries += 1
4353                        self.parent.jitterSleep(tries)
4354                        continue
4355                    raise plumbing.convert_error_to_porcelain(e) from e
4356                tries = 0
4357                for plumbing_item in plumbing_response.queries:
4358                    yield plumbing.convert_query_to_porcelain(plumbing_item)
4359                if plumbing_response.meta.next_cursor == '':
4360                    break
4361                req.meta.cursor = plumbing_response.meta.next_cursor
4362
4363        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)
4325    def __init__(self, channel, client):
4326        self.parent = client
4327        self.stub = QueriesStub(channel)
def list(self, filter, *args, timeout=None)
4329    def list(self, filter, *args, timeout=None):
4330        '''
4331         List gets a list of Queries matching a given set of criteria.
4332        '''
4333        req = QueryListRequest()
4334        req.meta.CopyFrom(ListRequestMetadata())
4335        if self.parent.page_limit > 0:
4336            req.meta.limit = self.parent.page_limit
4337        if self.parent.snapshot_datetime is not None:
4338            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4339
4340        req.filter = plumbing.quote_filter_args(filter, *args)
4341
4342        def generator(svc, req):
4343            tries = 0
4344            while True:
4345                try:
4346                    plumbing_response = svc.stub.List(
4347                        req,
4348                        metadata=svc.parent.get_metadata('Queries.List', req),
4349                        timeout=timeout)
4350                except Exception as e:
4351                    if self.parent.shouldRetry(tries, e):
4352                        tries += 1
4353                        self.parent.jitterSleep(tries)
4354                        continue
4355                    raise plumbing.convert_error_to_porcelain(e) from e
4356                tries = 0
4357                for plumbing_item in plumbing_response.queries:
4358                    yield plumbing.convert_query_to_porcelain(plumbing_item)
4359                if plumbing_response.meta.next_cursor == '':
4360                    break
4361                req.meta.cursor = plumbing_response.meta.next_cursor
4362
4363        return generator(self, req)

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

class RemoteIdentities:
4366class RemoteIdentities:
4367    '''
4368     RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource.
4369    See `strongdm.models.RemoteIdentity`.
4370    '''
4371    def __init__(self, channel, client):
4372        self.parent = client
4373        self.stub = RemoteIdentitiesStub(channel)
4374
4375    def create(self, remote_identity, timeout=None):
4376        '''
4377         Create registers a new RemoteIdentity.
4378        '''
4379        req = RemoteIdentityCreateRequest()
4380
4381        if remote_identity is not None:
4382            req.remote_identity.CopyFrom(
4383                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4384        tries = 0
4385        plumbing_response = None
4386        while True:
4387            try:
4388                plumbing_response = self.stub.Create(
4389                    req,
4390                    metadata=self.parent.get_metadata(
4391                        'RemoteIdentities.Create', req),
4392                    timeout=timeout)
4393            except Exception as e:
4394                if self.parent.shouldRetry(tries, e):
4395                    tries += 1
4396                    self.parent.jitterSleep(tries)
4397                    continue
4398                raise plumbing.convert_error_to_porcelain(e) from e
4399            break
4400
4401        resp = models.RemoteIdentityCreateResponse()
4402        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4403            plumbing_response.meta)
4404        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4405            plumbing_response.rate_limit)
4406        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4407            plumbing_response.remote_identity)
4408        return resp
4409
4410    def get(self, id, timeout=None):
4411        '''
4412         Get reads one RemoteIdentity by ID.
4413        '''
4414        req = RemoteIdentityGetRequest()
4415        if self.parent.snapshot_datetime is not None:
4416            req.meta.CopyFrom(GetRequestMetadata())
4417            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4418
4419        req.id = (id)
4420        tries = 0
4421        plumbing_response = None
4422        while True:
4423            try:
4424                plumbing_response = self.stub.Get(
4425                    req,
4426                    metadata=self.parent.get_metadata('RemoteIdentities.Get',
4427                                                      req),
4428                    timeout=timeout)
4429            except Exception as e:
4430                if self.parent.shouldRetry(tries, e):
4431                    tries += 1
4432                    self.parent.jitterSleep(tries)
4433                    continue
4434                raise plumbing.convert_error_to_porcelain(e) from e
4435            break
4436
4437        resp = models.RemoteIdentityGetResponse()
4438        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4439            plumbing_response.meta)
4440        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4441            plumbing_response.rate_limit)
4442        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4443            plumbing_response.remote_identity)
4444        return resp
4445
4446    def update(self, remote_identity, timeout=None):
4447        '''
4448         Update replaces all the fields of a RemoteIdentity by ID.
4449        '''
4450        req = RemoteIdentityUpdateRequest()
4451
4452        if remote_identity is not None:
4453            req.remote_identity.CopyFrom(
4454                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4455        tries = 0
4456        plumbing_response = None
4457        while True:
4458            try:
4459                plumbing_response = self.stub.Update(
4460                    req,
4461                    metadata=self.parent.get_metadata(
4462                        'RemoteIdentities.Update', req),
4463                    timeout=timeout)
4464            except Exception as e:
4465                if self.parent.shouldRetry(tries, e):
4466                    tries += 1
4467                    self.parent.jitterSleep(tries)
4468                    continue
4469                raise plumbing.convert_error_to_porcelain(e) from e
4470            break
4471
4472        resp = models.RemoteIdentityUpdateResponse()
4473        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4474            plumbing_response.meta)
4475        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4476            plumbing_response.rate_limit)
4477        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4478            plumbing_response.remote_identity)
4479        return resp
4480
4481    def delete(self, id, timeout=None):
4482        '''
4483         Delete removes a RemoteIdentity by ID.
4484        '''
4485        req = RemoteIdentityDeleteRequest()
4486
4487        req.id = (id)
4488        tries = 0
4489        plumbing_response = None
4490        while True:
4491            try:
4492                plumbing_response = self.stub.Delete(
4493                    req,
4494                    metadata=self.parent.get_metadata(
4495                        'RemoteIdentities.Delete', req),
4496                    timeout=timeout)
4497            except Exception as e:
4498                if self.parent.shouldRetry(tries, e):
4499                    tries += 1
4500                    self.parent.jitterSleep(tries)
4501                    continue
4502                raise plumbing.convert_error_to_porcelain(e) from e
4503            break
4504
4505        resp = models.RemoteIdentityDeleteResponse()
4506        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4507            plumbing_response.meta)
4508        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4509            plumbing_response.rate_limit)
4510        return resp
4511
4512    def list(self, filter, *args, timeout=None):
4513        '''
4514         List gets a list of RemoteIdentities matching a given set of criteria.
4515        '''
4516        req = RemoteIdentityListRequest()
4517        req.meta.CopyFrom(ListRequestMetadata())
4518        if self.parent.page_limit > 0:
4519            req.meta.limit = self.parent.page_limit
4520        if self.parent.snapshot_datetime is not None:
4521            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4522
4523        req.filter = plumbing.quote_filter_args(filter, *args)
4524
4525        def generator(svc, req):
4526            tries = 0
4527            while True:
4528                try:
4529                    plumbing_response = svc.stub.List(
4530                        req,
4531                        metadata=svc.parent.get_metadata(
4532                            'RemoteIdentities.List', req),
4533                        timeout=timeout)
4534                except Exception as e:
4535                    if self.parent.shouldRetry(tries, e):
4536                        tries += 1
4537                        self.parent.jitterSleep(tries)
4538                        continue
4539                    raise plumbing.convert_error_to_porcelain(e) from e
4540                tries = 0
4541                for plumbing_item in plumbing_response.remote_identities:
4542                    yield plumbing.convert_remote_identity_to_porcelain(
4543                        plumbing_item)
4544                if plumbing_response.meta.next_cursor == '':
4545                    break
4546                req.meta.cursor = plumbing_response.meta.next_cursor
4547
4548        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)
4371    def __init__(self, channel, client):
4372        self.parent = client
4373        self.stub = RemoteIdentitiesStub(channel)
def create(self, remote_identity, timeout=None)
4375    def create(self, remote_identity, timeout=None):
4376        '''
4377         Create registers a new RemoteIdentity.
4378        '''
4379        req = RemoteIdentityCreateRequest()
4380
4381        if remote_identity is not None:
4382            req.remote_identity.CopyFrom(
4383                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4384        tries = 0
4385        plumbing_response = None
4386        while True:
4387            try:
4388                plumbing_response = self.stub.Create(
4389                    req,
4390                    metadata=self.parent.get_metadata(
4391                        'RemoteIdentities.Create', req),
4392                    timeout=timeout)
4393            except Exception as e:
4394                if self.parent.shouldRetry(tries, e):
4395                    tries += 1
4396                    self.parent.jitterSleep(tries)
4397                    continue
4398                raise plumbing.convert_error_to_porcelain(e) from e
4399            break
4400
4401        resp = models.RemoteIdentityCreateResponse()
4402        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
4403            plumbing_response.meta)
4404        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4405            plumbing_response.rate_limit)
4406        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4407            plumbing_response.remote_identity)
4408        return resp

Create registers a new RemoteIdentity.

def get(self, id, timeout=None)
4410    def get(self, id, timeout=None):
4411        '''
4412         Get reads one RemoteIdentity by ID.
4413        '''
4414        req = RemoteIdentityGetRequest()
4415        if self.parent.snapshot_datetime is not None:
4416            req.meta.CopyFrom(GetRequestMetadata())
4417            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4418
4419        req.id = (id)
4420        tries = 0
4421        plumbing_response = None
4422        while True:
4423            try:
4424                plumbing_response = self.stub.Get(
4425                    req,
4426                    metadata=self.parent.get_metadata('RemoteIdentities.Get',
4427                                                      req),
4428                    timeout=timeout)
4429            except Exception as e:
4430                if self.parent.shouldRetry(tries, e):
4431                    tries += 1
4432                    self.parent.jitterSleep(tries)
4433                    continue
4434                raise plumbing.convert_error_to_porcelain(e) from e
4435            break
4436
4437        resp = models.RemoteIdentityGetResponse()
4438        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4439            plumbing_response.meta)
4440        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4441            plumbing_response.rate_limit)
4442        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4443            plumbing_response.remote_identity)
4444        return resp

Get reads one RemoteIdentity by ID.

def update(self, remote_identity, timeout=None)
4446    def update(self, remote_identity, timeout=None):
4447        '''
4448         Update replaces all the fields of a RemoteIdentity by ID.
4449        '''
4450        req = RemoteIdentityUpdateRequest()
4451
4452        if remote_identity is not None:
4453            req.remote_identity.CopyFrom(
4454                plumbing.convert_remote_identity_to_plumbing(remote_identity))
4455        tries = 0
4456        plumbing_response = None
4457        while True:
4458            try:
4459                plumbing_response = self.stub.Update(
4460                    req,
4461                    metadata=self.parent.get_metadata(
4462                        'RemoteIdentities.Update', req),
4463                    timeout=timeout)
4464            except Exception as e:
4465                if self.parent.shouldRetry(tries, e):
4466                    tries += 1
4467                    self.parent.jitterSleep(tries)
4468                    continue
4469                raise plumbing.convert_error_to_porcelain(e) from e
4470            break
4471
4472        resp = models.RemoteIdentityUpdateResponse()
4473        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
4474            plumbing_response.meta)
4475        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4476            plumbing_response.rate_limit)
4477        resp.remote_identity = plumbing.convert_remote_identity_to_porcelain(
4478            plumbing_response.remote_identity)
4479        return resp

Update replaces all the fields of a RemoteIdentity by ID.

def delete(self, id, timeout=None)
4481    def delete(self, id, timeout=None):
4482        '''
4483         Delete removes a RemoteIdentity by ID.
4484        '''
4485        req = RemoteIdentityDeleteRequest()
4486
4487        req.id = (id)
4488        tries = 0
4489        plumbing_response = None
4490        while True:
4491            try:
4492                plumbing_response = self.stub.Delete(
4493                    req,
4494                    metadata=self.parent.get_metadata(
4495                        'RemoteIdentities.Delete', req),
4496                    timeout=timeout)
4497            except Exception as e:
4498                if self.parent.shouldRetry(tries, e):
4499                    tries += 1
4500                    self.parent.jitterSleep(tries)
4501                    continue
4502                raise plumbing.convert_error_to_porcelain(e) from e
4503            break
4504
4505        resp = models.RemoteIdentityDeleteResponse()
4506        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
4507            plumbing_response.meta)
4508        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4509            plumbing_response.rate_limit)
4510        return resp

Delete removes a RemoteIdentity by ID.

def list(self, filter, *args, timeout=None)
4512    def list(self, filter, *args, timeout=None):
4513        '''
4514         List gets a list of RemoteIdentities matching a given set of criteria.
4515        '''
4516        req = RemoteIdentityListRequest()
4517        req.meta.CopyFrom(ListRequestMetadata())
4518        if self.parent.page_limit > 0:
4519            req.meta.limit = self.parent.page_limit
4520        if self.parent.snapshot_datetime is not None:
4521            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4522
4523        req.filter = plumbing.quote_filter_args(filter, *args)
4524
4525        def generator(svc, req):
4526            tries = 0
4527            while True:
4528                try:
4529                    plumbing_response = svc.stub.List(
4530                        req,
4531                        metadata=svc.parent.get_metadata(
4532                            'RemoteIdentities.List', req),
4533                        timeout=timeout)
4534                except Exception as e:
4535                    if self.parent.shouldRetry(tries, e):
4536                        tries += 1
4537                        self.parent.jitterSleep(tries)
4538                        continue
4539                    raise plumbing.convert_error_to_porcelain(e) from e
4540                tries = 0
4541                for plumbing_item in plumbing_response.remote_identities:
4542                    yield plumbing.convert_remote_identity_to_porcelain(
4543                        plumbing_item)
4544                if plumbing_response.meta.next_cursor == '':
4545                    break
4546                req.meta.cursor = plumbing_response.meta.next_cursor
4547
4548        return generator(self, req)

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

class SnapshotRemoteIdentities:
4551class SnapshotRemoteIdentities:
4552    '''
4553    SnapshotRemoteIdentities exposes the read only methods of the RemoteIdentities
4554    service for historical queries.
4555    '''
4556    def __init__(self, remote_identities):
4557        self.remote_identities = remote_identities
4558
4559    def get(self, id, timeout=None):
4560        '''
4561         Get reads one RemoteIdentity by ID.
4562        '''
4563        return self.remote_identities.get(id, timeout=timeout)
4564
4565    def list(self, filter, *args, timeout=None):
4566        '''
4567         List gets a list of RemoteIdentities matching a given set of criteria.
4568        '''
4569        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)
4556    def __init__(self, remote_identities):
4557        self.remote_identities = remote_identities
def get(self, id, timeout=None)
4559    def get(self, id, timeout=None):
4560        '''
4561         Get reads one RemoteIdentity by ID.
4562        '''
4563        return self.remote_identities.get(id, timeout=timeout)

Get reads one RemoteIdentity by ID.

def list(self, filter, *args, timeout=None)
4565    def list(self, filter, *args, timeout=None):
4566        '''
4567         List gets a list of RemoteIdentities matching a given set of criteria.
4568        '''
4569        return self.remote_identities.list(filter, *args, timeout=timeout)

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

class RemoteIdentitiesHistory:
4572class RemoteIdentitiesHistory:
4573    '''
4574     RemoteIdentitiesHistory records all changes to the state of a RemoteIdentity.
4575    See `strongdm.models.RemoteIdentityHistory`.
4576    '''
4577    def __init__(self, channel, client):
4578        self.parent = client
4579        self.stub = RemoteIdentitiesHistoryStub(channel)
4580
4581    def list(self, filter, *args, timeout=None):
4582        '''
4583         List gets a list of RemoteIdentityHistory records matching a given set of criteria.
4584        '''
4585        req = RemoteIdentityHistoryListRequest()
4586        req.meta.CopyFrom(ListRequestMetadata())
4587        if self.parent.page_limit > 0:
4588            req.meta.limit = self.parent.page_limit
4589        if self.parent.snapshot_datetime is not None:
4590            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4591
4592        req.filter = plumbing.quote_filter_args(filter, *args)
4593
4594        def generator(svc, req):
4595            tries = 0
4596            while True:
4597                try:
4598                    plumbing_response = svc.stub.List(
4599                        req,
4600                        metadata=svc.parent.get_metadata(
4601                            'RemoteIdentitiesHistory.List', req),
4602                        timeout=timeout)
4603                except Exception as e:
4604                    if self.parent.shouldRetry(tries, e):
4605                        tries += 1
4606                        self.parent.jitterSleep(tries)
4607                        continue
4608                    raise plumbing.convert_error_to_porcelain(e) from e
4609                tries = 0
4610                for plumbing_item in plumbing_response.history:
4611                    yield plumbing.convert_remote_identity_history_to_porcelain(
4612                        plumbing_item)
4613                if plumbing_response.meta.next_cursor == '':
4614                    break
4615                req.meta.cursor = plumbing_response.meta.next_cursor
4616
4617        return generator(self, req)

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

RemoteIdentitiesHistory(channel, client)
4577    def __init__(self, channel, client):
4578        self.parent = client
4579        self.stub = RemoteIdentitiesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
4581    def list(self, filter, *args, timeout=None):
4582        '''
4583         List gets a list of RemoteIdentityHistory records matching a given set of criteria.
4584        '''
4585        req = RemoteIdentityHistoryListRequest()
4586        req.meta.CopyFrom(ListRequestMetadata())
4587        if self.parent.page_limit > 0:
4588            req.meta.limit = self.parent.page_limit
4589        if self.parent.snapshot_datetime is not None:
4590            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4591
4592        req.filter = plumbing.quote_filter_args(filter, *args)
4593
4594        def generator(svc, req):
4595            tries = 0
4596            while True:
4597                try:
4598                    plumbing_response = svc.stub.List(
4599                        req,
4600                        metadata=svc.parent.get_metadata(
4601                            'RemoteIdentitiesHistory.List', req),
4602                        timeout=timeout)
4603                except Exception as e:
4604                    if self.parent.shouldRetry(tries, e):
4605                        tries += 1
4606                        self.parent.jitterSleep(tries)
4607                        continue
4608                    raise plumbing.convert_error_to_porcelain(e) from e
4609                tries = 0
4610                for plumbing_item in plumbing_response.history:
4611                    yield plumbing.convert_remote_identity_history_to_porcelain(
4612                        plumbing_item)
4613                if plumbing_response.meta.next_cursor == '':
4614                    break
4615                req.meta.cursor = plumbing_response.meta.next_cursor
4616
4617        return generator(self, req)

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

class RemoteIdentityGroups:
4620class RemoteIdentityGroups:
4621    '''
4622     A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts.
4623     An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects.
4624    See `strongdm.models.RemoteIdentityGroup`.
4625    '''
4626    def __init__(self, channel, client):
4627        self.parent = client
4628        self.stub = RemoteIdentityGroupsStub(channel)
4629
4630    def get(self, id, timeout=None):
4631        '''
4632         Get reads one RemoteIdentityGroup by ID.
4633        '''
4634        req = RemoteIdentityGroupGetRequest()
4635        if self.parent.snapshot_datetime is not None:
4636            req.meta.CopyFrom(GetRequestMetadata())
4637            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4638
4639        req.id = (id)
4640        tries = 0
4641        plumbing_response = None
4642        while True:
4643            try:
4644                plumbing_response = self.stub.Get(
4645                    req,
4646                    metadata=self.parent.get_metadata(
4647                        'RemoteIdentityGroups.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.RemoteIdentityGroupGetResponse()
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.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain(
4663            plumbing_response.remote_identity_group)
4664        return resp
4665
4666    def list(self, filter, *args, timeout=None):
4667        '''
4668         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4669        '''
4670        req = RemoteIdentityGroupListRequest()
4671        req.meta.CopyFrom(ListRequestMetadata())
4672        if self.parent.page_limit > 0:
4673            req.meta.limit = self.parent.page_limit
4674        if self.parent.snapshot_datetime is not None:
4675            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4676
4677        req.filter = plumbing.quote_filter_args(filter, *args)
4678
4679        def generator(svc, req):
4680            tries = 0
4681            while True:
4682                try:
4683                    plumbing_response = svc.stub.List(
4684                        req,
4685                        metadata=svc.parent.get_metadata(
4686                            'RemoteIdentityGroups.List', req),
4687                        timeout=timeout)
4688                except Exception as e:
4689                    if self.parent.shouldRetry(tries, e):
4690                        tries += 1
4691                        self.parent.jitterSleep(tries)
4692                        continue
4693                    raise plumbing.convert_error_to_porcelain(e) from e
4694                tries = 0
4695                for plumbing_item in plumbing_response.remote_identity_groups:
4696                    yield plumbing.convert_remote_identity_group_to_porcelain(
4697                        plumbing_item)
4698                if plumbing_response.meta.next_cursor == '':
4699                    break
4700                req.meta.cursor = plumbing_response.meta.next_cursor
4701
4702        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)
4626    def __init__(self, channel, client):
4627        self.parent = client
4628        self.stub = RemoteIdentityGroupsStub(channel)
def get(self, id, timeout=None)
4630    def get(self, id, timeout=None):
4631        '''
4632         Get reads one RemoteIdentityGroup by ID.
4633        '''
4634        req = RemoteIdentityGroupGetRequest()
4635        if self.parent.snapshot_datetime is not None:
4636            req.meta.CopyFrom(GetRequestMetadata())
4637            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4638
4639        req.id = (id)
4640        tries = 0
4641        plumbing_response = None
4642        while True:
4643            try:
4644                plumbing_response = self.stub.Get(
4645                    req,
4646                    metadata=self.parent.get_metadata(
4647                        'RemoteIdentityGroups.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.RemoteIdentityGroupGetResponse()
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.remote_identity_group = plumbing.convert_remote_identity_group_to_porcelain(
4663            plumbing_response.remote_identity_group)
4664        return resp

Get reads one RemoteIdentityGroup by ID.

def list(self, filter, *args, timeout=None)
4666    def list(self, filter, *args, timeout=None):
4667        '''
4668         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4669        '''
4670        req = RemoteIdentityGroupListRequest()
4671        req.meta.CopyFrom(ListRequestMetadata())
4672        if self.parent.page_limit > 0:
4673            req.meta.limit = self.parent.page_limit
4674        if self.parent.snapshot_datetime is not None:
4675            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4676
4677        req.filter = plumbing.quote_filter_args(filter, *args)
4678
4679        def generator(svc, req):
4680            tries = 0
4681            while True:
4682                try:
4683                    plumbing_response = svc.stub.List(
4684                        req,
4685                        metadata=svc.parent.get_metadata(
4686                            'RemoteIdentityGroups.List', req),
4687                        timeout=timeout)
4688                except Exception as e:
4689                    if self.parent.shouldRetry(tries, e):
4690                        tries += 1
4691                        self.parent.jitterSleep(tries)
4692                        continue
4693                    raise plumbing.convert_error_to_porcelain(e) from e
4694                tries = 0
4695                for plumbing_item in plumbing_response.remote_identity_groups:
4696                    yield plumbing.convert_remote_identity_group_to_porcelain(
4697                        plumbing_item)
4698                if plumbing_response.meta.next_cursor == '':
4699                    break
4700                req.meta.cursor = plumbing_response.meta.next_cursor
4701
4702        return generator(self, req)

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

class SnapshotRemoteIdentityGroups:
4705class SnapshotRemoteIdentityGroups:
4706    '''
4707    SnapshotRemoteIdentityGroups exposes the read only methods of the RemoteIdentityGroups
4708    service for historical queries.
4709    '''
4710    def __init__(self, remote_identity_groups):
4711        self.remote_identity_groups = remote_identity_groups
4712
4713    def get(self, id, timeout=None):
4714        '''
4715         Get reads one RemoteIdentityGroup by ID.
4716        '''
4717        return self.remote_identity_groups.get(id, timeout=timeout)
4718
4719    def list(self, filter, *args, timeout=None):
4720        '''
4721         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4722        '''
4723        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)
4710    def __init__(self, remote_identity_groups):
4711        self.remote_identity_groups = remote_identity_groups
def get(self, id, timeout=None)
4713    def get(self, id, timeout=None):
4714        '''
4715         Get reads one RemoteIdentityGroup by ID.
4716        '''
4717        return self.remote_identity_groups.get(id, timeout=timeout)

Get reads one RemoteIdentityGroup by ID.

def list(self, filter, *args, timeout=None)
4719    def list(self, filter, *args, timeout=None):
4720        '''
4721         List gets a list of RemoteIdentityGroups matching a given set of criteria.
4722        '''
4723        return self.remote_identity_groups.list(filter, *args, timeout=timeout)

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

class RemoteIdentityGroupsHistory:
4726class RemoteIdentityGroupsHistory:
4727    '''
4728     RemoteIdentityGroupsHistory records all changes to the state of a RemoteIdentityGroup.
4729    See `strongdm.models.RemoteIdentityGroupHistory`.
4730    '''
4731    def __init__(self, channel, client):
4732        self.parent = client
4733        self.stub = RemoteIdentityGroupsHistoryStub(channel)
4734
4735    def list(self, filter, *args, timeout=None):
4736        '''
4737         List gets a list of RemoteIdentityGroupHistory records matching a given set of criteria.
4738        '''
4739        req = RemoteIdentityGroupHistoryListRequest()
4740        req.meta.CopyFrom(ListRequestMetadata())
4741        if self.parent.page_limit > 0:
4742            req.meta.limit = self.parent.page_limit
4743        if self.parent.snapshot_datetime is not None:
4744            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4745
4746        req.filter = plumbing.quote_filter_args(filter, *args)
4747
4748        def generator(svc, req):
4749            tries = 0
4750            while True:
4751                try:
4752                    plumbing_response = svc.stub.List(
4753                        req,
4754                        metadata=svc.parent.get_metadata(
4755                            'RemoteIdentityGroupsHistory.List', req),
4756                        timeout=timeout)
4757                except Exception as e:
4758                    if self.parent.shouldRetry(tries, e):
4759                        tries += 1
4760                        self.parent.jitterSleep(tries)
4761                        continue
4762                    raise plumbing.convert_error_to_porcelain(e) from e
4763                tries = 0
4764                for plumbing_item in plumbing_response.history:
4765                    yield plumbing.convert_remote_identity_group_history_to_porcelain(
4766                        plumbing_item)
4767                if plumbing_response.meta.next_cursor == '':
4768                    break
4769                req.meta.cursor = plumbing_response.meta.next_cursor
4770
4771        return generator(self, req)

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

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

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

class Replays:
4774class Replays:
4775    '''
4776     A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session
4777     (otherwise referred to as a query). The Replays service is read-only.
4778    See `strongdm.models.ReplayChunk`.
4779    '''
4780    def __init__(self, channel, client):
4781        self.parent = client
4782        self.stub = ReplaysStub(channel)
4783
4784    def list(self, filter, *args, timeout=None):
4785        '''
4786         List gets a list of ReplayChunks for the Query ID specified by the filter criteria.
4787        '''
4788        req = ReplayListRequest()
4789        req.meta.CopyFrom(ListRequestMetadata())
4790        if self.parent.page_limit > 0:
4791            req.meta.limit = self.parent.page_limit
4792        if self.parent.snapshot_datetime is not None:
4793            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4794
4795        req.filter = plumbing.quote_filter_args(filter, *args)
4796
4797        def generator(svc, req):
4798            tries = 0
4799            while True:
4800                try:
4801                    plumbing_response = svc.stub.List(
4802                        req,
4803                        metadata=svc.parent.get_metadata('Replays.List', req),
4804                        timeout=timeout)
4805                except Exception as e:
4806                    if self.parent.shouldRetry(tries, e):
4807                        tries += 1
4808                        self.parent.jitterSleep(tries)
4809                        continue
4810                    raise plumbing.convert_error_to_porcelain(e) from e
4811                tries = 0
4812                for plumbing_item in plumbing_response.chunks:
4813                    yield plumbing.convert_replay_chunk_to_porcelain(
4814                        plumbing_item)
4815                if plumbing_response.meta.next_cursor == '':
4816                    break
4817                req.meta.cursor = plumbing_response.meta.next_cursor
4818
4819        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)
4780    def __init__(self, channel, client):
4781        self.parent = client
4782        self.stub = ReplaysStub(channel)
def list(self, filter, *args, timeout=None)
4784    def list(self, filter, *args, timeout=None):
4785        '''
4786         List gets a list of ReplayChunks for the Query ID specified by the filter criteria.
4787        '''
4788        req = ReplayListRequest()
4789        req.meta.CopyFrom(ListRequestMetadata())
4790        if self.parent.page_limit > 0:
4791            req.meta.limit = self.parent.page_limit
4792        if self.parent.snapshot_datetime is not None:
4793            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4794
4795        req.filter = plumbing.quote_filter_args(filter, *args)
4796
4797        def generator(svc, req):
4798            tries = 0
4799            while True:
4800                try:
4801                    plumbing_response = svc.stub.List(
4802                        req,
4803                        metadata=svc.parent.get_metadata('Replays.List', req),
4804                        timeout=timeout)
4805                except Exception as e:
4806                    if self.parent.shouldRetry(tries, e):
4807                        tries += 1
4808                        self.parent.jitterSleep(tries)
4809                        continue
4810                    raise plumbing.convert_error_to_porcelain(e) from e
4811                tries = 0
4812                for plumbing_item in plumbing_response.chunks:
4813                    yield plumbing.convert_replay_chunk_to_porcelain(
4814                        plumbing_item)
4815                if plumbing_response.meta.next_cursor == '':
4816                    break
4817                req.meta.cursor = plumbing_response.meta.next_cursor
4818
4819        return generator(self, req)

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

class Resources:
4822class Resources:
4823    '''
4824     Resources are databases, servers, clusters, websites, or clouds that strongDM
4825     delegates access to.
4826    See:
4827    `strongdm.models.Aerospike`
4828    `strongdm.models.AKS`
4829    `strongdm.models.AKSBasicAuth`
4830    `strongdm.models.AKSServiceAccount`
4831    `strongdm.models.AKSServiceAccountUserImpersonation`
4832    `strongdm.models.AKSUserImpersonation`
4833    `strongdm.models.AmazonEKS`
4834    `strongdm.models.AmazonEKSInstanceProfile`
4835    `strongdm.models.AmazonEKSInstanceProfileUserImpersonation`
4836    `strongdm.models.AmazonEKSUserImpersonation`
4837    `strongdm.models.AmazonES`
4838    `strongdm.models.AmazonESIAM`
4839    `strongdm.models.AmazonMQAMQP091`
4840    `strongdm.models.Athena`
4841    `strongdm.models.AthenaIAM`
4842    `strongdm.models.AuroraMysql`
4843    `strongdm.models.AuroraMysqlIAM`
4844    `strongdm.models.AuroraPostgres`
4845    `strongdm.models.AuroraPostgresIAM`
4846    `strongdm.models.AWS`
4847    `strongdm.models.AWSConsole`
4848    `strongdm.models.AWSConsoleStaticKeyPair`
4849    `strongdm.models.AWSInstanceProfile`
4850    `strongdm.models.Azure`
4851    `strongdm.models.AzureCertificate`
4852    `strongdm.models.AzureMysql`
4853    `strongdm.models.AzurePostgres`
4854    `strongdm.models.AzurePostgresManagedIdentity`
4855    `strongdm.models.BigQuery`
4856    `strongdm.models.Cassandra`
4857    `strongdm.models.Citus`
4858    `strongdm.models.ClickHouseHTTP`
4859    `strongdm.models.ClickHouseMySQL`
4860    `strongdm.models.ClickHouseTCP`
4861    `strongdm.models.Clustrix`
4862    `strongdm.models.Cockroach`
4863    `strongdm.models.CouchbaseDatabase`
4864    `strongdm.models.CouchbaseWebUI`
4865    `strongdm.models.DB2I`
4866    `strongdm.models.DB2LUW`
4867    `strongdm.models.DocumentDBHost`
4868    `strongdm.models.DocumentDBHostIAM`
4869    `strongdm.models.DocumentDBReplicaSet`
4870    `strongdm.models.DocumentDBReplicaSetIAM`
4871    `strongdm.models.Druid`
4872    `strongdm.models.DynamoDB`
4873    `strongdm.models.DynamoDBIAM`
4874    `strongdm.models.Elastic`
4875    `strongdm.models.ElasticacheRedis`
4876    `strongdm.models.GCP`
4877    `strongdm.models.GCPConsole`
4878    `strongdm.models.GCPWIF`
4879    `strongdm.models.GoogleGKE`
4880    `strongdm.models.GoogleGKEUserImpersonation`
4881    `strongdm.models.Greenplum`
4882    `strongdm.models.HTTPAuth`
4883    `strongdm.models.HTTPBasicAuth`
4884    `strongdm.models.HTTPNoAuth`
4885    `strongdm.models.Kubernetes`
4886    `strongdm.models.KubernetesBasicAuth`
4887    `strongdm.models.KubernetesPodIdentity`
4888    `strongdm.models.KubernetesServiceAccount`
4889    `strongdm.models.KubernetesServiceAccountUserImpersonation`
4890    `strongdm.models.KubernetesUserImpersonation`
4891    `strongdm.models.Maria`
4892    `strongdm.models.Memcached`
4893    `strongdm.models.Memsql`
4894    `strongdm.models.MongoHost`
4895    `strongdm.models.MongoLegacyHost`
4896    `strongdm.models.MongoLegacyReplicaset`
4897    `strongdm.models.MongoReplicaSet`
4898    `strongdm.models.MongoShardedCluster`
4899    `strongdm.models.MTLSMysql`
4900    `strongdm.models.MTLSPostgres`
4901    `strongdm.models.Mysql`
4902    `strongdm.models.Neptune`
4903    `strongdm.models.NeptuneIAM`
4904    `strongdm.models.Oracle`
4905    `strongdm.models.OracleNNE`
4906    `strongdm.models.Postgres`
4907    `strongdm.models.Presto`
4908    `strongdm.models.RabbitMQAMQP091`
4909    `strongdm.models.RawTCP`
4910    `strongdm.models.RDP`
4911    `strongdm.models.RDPCert`
4912    `strongdm.models.RDSPostgresIAM`
4913    `strongdm.models.Redis`
4914    `strongdm.models.RedisCluster`
4915    `strongdm.models.Redshift`
4916    `strongdm.models.RedshiftIAM`
4917    `strongdm.models.RedshiftServerlessIAM`
4918    `strongdm.models.SingleStore`
4919    `strongdm.models.Snowflake`
4920    `strongdm.models.Snowsight`
4921    `strongdm.models.SQLServer`
4922    `strongdm.models.SQLServerAzureAD`
4923    `strongdm.models.SQLServerKerberosAD`
4924    `strongdm.models.SSH`
4925    `strongdm.models.SSHCert`
4926    `strongdm.models.SSHCustomerKey`
4927    `strongdm.models.SSHPassword`
4928    `strongdm.models.Sybase`
4929    `strongdm.models.SybaseIQ`
4930    `strongdm.models.Teradata`
4931    `strongdm.models.Trino`
4932    `strongdm.models.Vertica`
4933    '''
4934    def __init__(self, channel, client):
4935        self.parent = client
4936        self.stub = ResourcesStub(channel)
4937
4938    def enumerate_tags(self, filter, *args, timeout=None):
4939        '''
4940         EnumerateTags gets a list of the filter matching tags.
4941        '''
4942        req = EnumerateTagsRequest()
4943        req.meta.CopyFrom(ListRequestMetadata())
4944        if self.parent.page_limit > 0:
4945            req.meta.limit = self.parent.page_limit
4946        if self.parent.snapshot_datetime is not None:
4947            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
4948
4949        req.filter = plumbing.quote_filter_args(filter, *args)
4950
4951        def generator(svc, req):
4952            tries = 0
4953            while True:
4954                try:
4955                    plumbing_response = svc.stub.EnumerateTags(
4956                        req,
4957                        metadata=svc.parent.get_metadata(
4958                            'Resources.EnumerateTags', req),
4959                        timeout=timeout)
4960                except Exception as e:
4961                    if self.parent.shouldRetry(tries, e):
4962                        tries += 1
4963                        self.parent.jitterSleep(tries)
4964                        continue
4965                    raise plumbing.convert_error_to_porcelain(e) from e
4966                tries = 0
4967                for plumbing_item in plumbing_response.matches:
4968                    yield plumbing.convert_tag_to_porcelain(plumbing_item)
4969                if plumbing_response.meta.next_cursor == '':
4970                    break
4971                req.meta.cursor = plumbing_response.meta.next_cursor
4972
4973        return generator(self, req)
4974
4975    def create(self, resource, timeout=None):
4976        '''
4977         Create registers a new Resource.
4978        '''
4979        req = ResourceCreateRequest()
4980
4981        if resource is not None:
4982            req.resource.CopyFrom(
4983                plumbing.convert_resource_to_plumbing(resource))
4984        tries = 0
4985        plumbing_response = None
4986        while True:
4987            try:
4988                plumbing_response = self.stub.Create(
4989                    req,
4990                    metadata=self.parent.get_metadata('Resources.Create', req),
4991                    timeout=timeout)
4992            except Exception as e:
4993                if self.parent.shouldRetry(tries, e):
4994                    tries += 1
4995                    self.parent.jitterSleep(tries)
4996                    continue
4997                raise plumbing.convert_error_to_porcelain(e) from e
4998            break
4999
5000        resp = models.ResourceCreateResponse()
5001        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5002            plumbing_response.meta)
5003        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5004            plumbing_response.rate_limit)
5005        resp.resource = plumbing.convert_resource_to_porcelain(
5006            plumbing_response.resource)
5007        return resp
5008
5009    def get(self, id, timeout=None):
5010        '''
5011         Get reads one Resource by ID.
5012        '''
5013        req = ResourceGetRequest()
5014        if self.parent.snapshot_datetime is not None:
5015            req.meta.CopyFrom(GetRequestMetadata())
5016            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5017
5018        req.id = (id)
5019        tries = 0
5020        plumbing_response = None
5021        while True:
5022            try:
5023                plumbing_response = self.stub.Get(
5024                    req,
5025                    metadata=self.parent.get_metadata('Resources.Get', req),
5026                    timeout=timeout)
5027            except Exception as e:
5028                if self.parent.shouldRetry(tries, e):
5029                    tries += 1
5030                    self.parent.jitterSleep(tries)
5031                    continue
5032                raise plumbing.convert_error_to_porcelain(e) from e
5033            break
5034
5035        resp = models.ResourceGetResponse()
5036        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5037            plumbing_response.meta)
5038        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5039            plumbing_response.rate_limit)
5040        resp.resource = plumbing.convert_resource_to_porcelain(
5041            plumbing_response.resource)
5042        return resp
5043
5044    def update(self, resource, timeout=None):
5045        '''
5046         Update replaces all the fields of a Resource by ID.
5047        '''
5048        req = ResourceUpdateRequest()
5049
5050        if resource is not None:
5051            req.resource.CopyFrom(
5052                plumbing.convert_resource_to_plumbing(resource))
5053        tries = 0
5054        plumbing_response = None
5055        while True:
5056            try:
5057                plumbing_response = self.stub.Update(
5058                    req,
5059                    metadata=self.parent.get_metadata('Resources.Update', req),
5060                    timeout=timeout)
5061            except Exception as e:
5062                if self.parent.shouldRetry(tries, e):
5063                    tries += 1
5064                    self.parent.jitterSleep(tries)
5065                    continue
5066                raise plumbing.convert_error_to_porcelain(e) from e
5067            break
5068
5069        resp = models.ResourceUpdateResponse()
5070        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5071            plumbing_response.meta)
5072        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5073            plumbing_response.rate_limit)
5074        resp.resource = plumbing.convert_resource_to_porcelain(
5075            plumbing_response.resource)
5076        return resp
5077
5078    def delete(self, id, timeout=None):
5079        '''
5080         Delete removes a Resource by ID.
5081        '''
5082        req = ResourceDeleteRequest()
5083
5084        req.id = (id)
5085        tries = 0
5086        plumbing_response = None
5087        while True:
5088            try:
5089                plumbing_response = self.stub.Delete(
5090                    req,
5091                    metadata=self.parent.get_metadata('Resources.Delete', req),
5092                    timeout=timeout)
5093            except Exception as e:
5094                if self.parent.shouldRetry(tries, e):
5095                    tries += 1
5096                    self.parent.jitterSleep(tries)
5097                    continue
5098                raise plumbing.convert_error_to_porcelain(e) from e
5099            break
5100
5101        resp = models.ResourceDeleteResponse()
5102        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5103            plumbing_response.meta)
5104        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5105            plumbing_response.rate_limit)
5106        return resp
5107
5108    def list(self, filter, *args, timeout=None):
5109        '''
5110         List gets a list of Resources matching a given set of criteria.
5111        '''
5112        req = ResourceListRequest()
5113        req.meta.CopyFrom(ListRequestMetadata())
5114        if self.parent.page_limit > 0:
5115            req.meta.limit = self.parent.page_limit
5116        if self.parent.snapshot_datetime is not None:
5117            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5118
5119        req.filter = plumbing.quote_filter_args(filter, *args)
5120
5121        def generator(svc, req):
5122            tries = 0
5123            while True:
5124                try:
5125                    plumbing_response = svc.stub.List(
5126                        req,
5127                        metadata=svc.parent.get_metadata(
5128                            'Resources.List', req),
5129                        timeout=timeout)
5130                except Exception as e:
5131                    if self.parent.shouldRetry(tries, e):
5132                        tries += 1
5133                        self.parent.jitterSleep(tries)
5134                        continue
5135                    raise plumbing.convert_error_to_porcelain(e) from e
5136                tries = 0
5137                for plumbing_item in plumbing_response.resources:
5138                    yield plumbing.convert_resource_to_porcelain(plumbing_item)
5139                if plumbing_response.meta.next_cursor == '':
5140                    break
5141                req.meta.cursor = plumbing_response.meta.next_cursor
5142
5143        return generator(self, req)
5144
5145    def healthcheck(self, id, timeout=None):
5146        '''
5147         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
5148         large network of Nodes. The call will return immediately, and the updated health of the
5149         Resource can be retrieved via Get or List.
5150        '''
5151        req = ResourceHealthcheckRequest()
5152
5153        req.id = (id)
5154        tries = 0
5155        plumbing_response = None
5156        while True:
5157            try:
5158                plumbing_response = self.stub.Healthcheck(
5159                    req,
5160                    metadata=self.parent.get_metadata('Resources.Healthcheck',
5161                                                      req),
5162                    timeout=timeout)
5163            except Exception as e:
5164                if self.parent.shouldRetry(tries, e):
5165                    tries += 1
5166                    self.parent.jitterSleep(tries)
5167                    continue
5168                raise plumbing.convert_error_to_porcelain(e) from e
5169            break
5170
5171        resp = models.ResourceHealthcheckResponse()
5172        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5173            plumbing_response.meta)
5174        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5175            plumbing_response.rate_limit)
5176        return resp

Resources are databases, servers, clusters, websites, or clouds that strongDM delegates access to. See: strongdm.models.Aerospike 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.DocumentDBReplicaSetIAM 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.KubernetesPodIdentity 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.OracleNNE 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.RedisCluster strongdm.models.Redshift strongdm.models.RedshiftIAM strongdm.models.RedshiftServerlessIAM 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 strongdm.models.Vertica

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

EnumerateTags gets a list of the filter matching tags.

def create(self, resource, timeout=None)
4975    def create(self, resource, timeout=None):
4976        '''
4977         Create registers a new Resource.
4978        '''
4979        req = ResourceCreateRequest()
4980
4981        if resource is not None:
4982            req.resource.CopyFrom(
4983                plumbing.convert_resource_to_plumbing(resource))
4984        tries = 0
4985        plumbing_response = None
4986        while True:
4987            try:
4988                plumbing_response = self.stub.Create(
4989                    req,
4990                    metadata=self.parent.get_metadata('Resources.Create', req),
4991                    timeout=timeout)
4992            except Exception as e:
4993                if self.parent.shouldRetry(tries, e):
4994                    tries += 1
4995                    self.parent.jitterSleep(tries)
4996                    continue
4997                raise plumbing.convert_error_to_porcelain(e) from e
4998            break
4999
5000        resp = models.ResourceCreateResponse()
5001        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5002            plumbing_response.meta)
5003        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5004            plumbing_response.rate_limit)
5005        resp.resource = plumbing.convert_resource_to_porcelain(
5006            plumbing_response.resource)
5007        return resp

Create registers a new Resource.

def get(self, id, timeout=None)
5009    def get(self, id, timeout=None):
5010        '''
5011         Get reads one Resource by ID.
5012        '''
5013        req = ResourceGetRequest()
5014        if self.parent.snapshot_datetime is not None:
5015            req.meta.CopyFrom(GetRequestMetadata())
5016            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5017
5018        req.id = (id)
5019        tries = 0
5020        plumbing_response = None
5021        while True:
5022            try:
5023                plumbing_response = self.stub.Get(
5024                    req,
5025                    metadata=self.parent.get_metadata('Resources.Get', req),
5026                    timeout=timeout)
5027            except Exception as e:
5028                if self.parent.shouldRetry(tries, e):
5029                    tries += 1
5030                    self.parent.jitterSleep(tries)
5031                    continue
5032                raise plumbing.convert_error_to_porcelain(e) from e
5033            break
5034
5035        resp = models.ResourceGetResponse()
5036        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5037            plumbing_response.meta)
5038        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5039            plumbing_response.rate_limit)
5040        resp.resource = plumbing.convert_resource_to_porcelain(
5041            plumbing_response.resource)
5042        return resp

Get reads one Resource by ID.

def update(self, resource, timeout=None)
5044    def update(self, resource, timeout=None):
5045        '''
5046         Update replaces all the fields of a Resource by ID.
5047        '''
5048        req = ResourceUpdateRequest()
5049
5050        if resource is not None:
5051            req.resource.CopyFrom(
5052                plumbing.convert_resource_to_plumbing(resource))
5053        tries = 0
5054        plumbing_response = None
5055        while True:
5056            try:
5057                plumbing_response = self.stub.Update(
5058                    req,
5059                    metadata=self.parent.get_metadata('Resources.Update', req),
5060                    timeout=timeout)
5061            except Exception as e:
5062                if self.parent.shouldRetry(tries, e):
5063                    tries += 1
5064                    self.parent.jitterSleep(tries)
5065                    continue
5066                raise plumbing.convert_error_to_porcelain(e) from e
5067            break
5068
5069        resp = models.ResourceUpdateResponse()
5070        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5071            plumbing_response.meta)
5072        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5073            plumbing_response.rate_limit)
5074        resp.resource = plumbing.convert_resource_to_porcelain(
5075            plumbing_response.resource)
5076        return resp

Update replaces all the fields of a Resource by ID.

def delete(self, id, timeout=None)
5078    def delete(self, id, timeout=None):
5079        '''
5080         Delete removes a Resource by ID.
5081        '''
5082        req = ResourceDeleteRequest()
5083
5084        req.id = (id)
5085        tries = 0
5086        plumbing_response = None
5087        while True:
5088            try:
5089                plumbing_response = self.stub.Delete(
5090                    req,
5091                    metadata=self.parent.get_metadata('Resources.Delete', req),
5092                    timeout=timeout)
5093            except Exception as e:
5094                if self.parent.shouldRetry(tries, e):
5095                    tries += 1
5096                    self.parent.jitterSleep(tries)
5097                    continue
5098                raise plumbing.convert_error_to_porcelain(e) from e
5099            break
5100
5101        resp = models.ResourceDeleteResponse()
5102        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5103            plumbing_response.meta)
5104        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5105            plumbing_response.rate_limit)
5106        return resp

Delete removes a Resource by ID.

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

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

def healthcheck(self, id, timeout=None)
5145    def healthcheck(self, id, timeout=None):
5146        '''
5147         Healthcheck triggers a remote healthcheck. It may take minutes to propagate across a
5148         large network of Nodes. The call will return immediately, and the updated health of the
5149         Resource can be retrieved via Get or List.
5150        '''
5151        req = ResourceHealthcheckRequest()
5152
5153        req.id = (id)
5154        tries = 0
5155        plumbing_response = None
5156        while True:
5157            try:
5158                plumbing_response = self.stub.Healthcheck(
5159                    req,
5160                    metadata=self.parent.get_metadata('Resources.Healthcheck',
5161                                                      req),
5162                    timeout=timeout)
5163            except Exception as e:
5164                if self.parent.shouldRetry(tries, e):
5165                    tries += 1
5166                    self.parent.jitterSleep(tries)
5167                    continue
5168                raise plumbing.convert_error_to_porcelain(e) from e
5169            break
5170
5171        resp = models.ResourceHealthcheckResponse()
5172        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5173            plumbing_response.meta)
5174        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5175            plumbing_response.rate_limit)
5176        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:
5179class SnapshotResources:
5180    '''
5181    SnapshotResources exposes the read only methods of the Resources
5182    service for historical queries.
5183    '''
5184    def __init__(self, resources):
5185        self.resources = resources
5186
5187    def get(self, id, timeout=None):
5188        '''
5189         Get reads one Resource by ID.
5190        '''
5191        return self.resources.get(id, timeout=timeout)
5192
5193    def list(self, filter, *args, timeout=None):
5194        '''
5195         List gets a list of Resources matching a given set of criteria.
5196        '''
5197        return self.resources.list(filter, *args, timeout=timeout)

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

SnapshotResources(resources)
5184    def __init__(self, resources):
5185        self.resources = resources
def get(self, id, timeout=None)
5187    def get(self, id, timeout=None):
5188        '''
5189         Get reads one Resource by ID.
5190        '''
5191        return self.resources.get(id, timeout=timeout)

Get reads one Resource by ID.

def list(self, filter, *args, timeout=None)
5193    def list(self, filter, *args, timeout=None):
5194        '''
5195         List gets a list of Resources matching a given set of criteria.
5196        '''
5197        return self.resources.list(filter, *args, timeout=timeout)

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

class ResourcesHistory:
5200class ResourcesHistory:
5201    '''
5202     ResourcesHistory records all changes to the state of a Resource.
5203    See `strongdm.models.ResourceHistory`.
5204    '''
5205    def __init__(self, channel, client):
5206        self.parent = client
5207        self.stub = ResourcesHistoryStub(channel)
5208
5209    def list(self, filter, *args, timeout=None):
5210        '''
5211         List gets a list of ResourceHistory records matching a given set of criteria.
5212        '''
5213        req = ResourceHistoryListRequest()
5214        req.meta.CopyFrom(ListRequestMetadata())
5215        if self.parent.page_limit > 0:
5216            req.meta.limit = self.parent.page_limit
5217        if self.parent.snapshot_datetime is not None:
5218            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5219
5220        req.filter = plumbing.quote_filter_args(filter, *args)
5221
5222        def generator(svc, req):
5223            tries = 0
5224            while True:
5225                try:
5226                    plumbing_response = svc.stub.List(
5227                        req,
5228                        metadata=svc.parent.get_metadata(
5229                            'ResourcesHistory.List', req),
5230                        timeout=timeout)
5231                except Exception as e:
5232                    if self.parent.shouldRetry(tries, e):
5233                        tries += 1
5234                        self.parent.jitterSleep(tries)
5235                        continue
5236                    raise plumbing.convert_error_to_porcelain(e) from e
5237                tries = 0
5238                for plumbing_item in plumbing_response.history:
5239                    yield plumbing.convert_resource_history_to_porcelain(
5240                        plumbing_item)
5241                if plumbing_response.meta.next_cursor == '':
5242                    break
5243                req.meta.cursor = plumbing_response.meta.next_cursor
5244
5245        return generator(self, req)

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

ResourcesHistory(channel, client)
5205    def __init__(self, channel, client):
5206        self.parent = client
5207        self.stub = ResourcesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
5209    def list(self, filter, *args, timeout=None):
5210        '''
5211         List gets a list of ResourceHistory records matching a given set of criteria.
5212        '''
5213        req = ResourceHistoryListRequest()
5214        req.meta.CopyFrom(ListRequestMetadata())
5215        if self.parent.page_limit > 0:
5216            req.meta.limit = self.parent.page_limit
5217        if self.parent.snapshot_datetime is not None:
5218            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5219
5220        req.filter = plumbing.quote_filter_args(filter, *args)
5221
5222        def generator(svc, req):
5223            tries = 0
5224            while True:
5225                try:
5226                    plumbing_response = svc.stub.List(
5227                        req,
5228                        metadata=svc.parent.get_metadata(
5229                            'ResourcesHistory.List', req),
5230                        timeout=timeout)
5231                except Exception as e:
5232                    if self.parent.shouldRetry(tries, e):
5233                        tries += 1
5234                        self.parent.jitterSleep(tries)
5235                        continue
5236                    raise plumbing.convert_error_to_porcelain(e) from e
5237                tries = 0
5238                for plumbing_item in plumbing_response.history:
5239                    yield plumbing.convert_resource_history_to_porcelain(
5240                        plumbing_item)
5241                if plumbing_response.meta.next_cursor == '':
5242                    break
5243                req.meta.cursor = plumbing_response.meta.next_cursor
5244
5245        return generator(self, req)

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

class RoleResources:
5248class RoleResources:
5249    '''
5250     RoleResources enumerates the resources to which roles have access.
5251     The RoleResources service is read-only.
5252    See `strongdm.models.RoleResource`.
5253    '''
5254    def __init__(self, channel, client):
5255        self.parent = client
5256        self.stub = RoleResourcesStub(channel)
5257
5258    def list(self, filter, *args, timeout=None):
5259        '''
5260         List gets a list of RoleResource records matching a given set of criteria.
5261        '''
5262        req = RoleResourceListRequest()
5263        req.meta.CopyFrom(ListRequestMetadata())
5264        if self.parent.page_limit > 0:
5265            req.meta.limit = self.parent.page_limit
5266        if self.parent.snapshot_datetime is not None:
5267            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5268
5269        req.filter = plumbing.quote_filter_args(filter, *args)
5270
5271        def generator(svc, req):
5272            tries = 0
5273            while True:
5274                try:
5275                    plumbing_response = svc.stub.List(
5276                        req,
5277                        metadata=svc.parent.get_metadata(
5278                            'RoleResources.List', req),
5279                        timeout=timeout)
5280                except Exception as e:
5281                    if self.parent.shouldRetry(tries, e):
5282                        tries += 1
5283                        self.parent.jitterSleep(tries)
5284                        continue
5285                    raise plumbing.convert_error_to_porcelain(e) from e
5286                tries = 0
5287                for plumbing_item in plumbing_response.role_resources:
5288                    yield plumbing.convert_role_resource_to_porcelain(
5289                        plumbing_item)
5290                if plumbing_response.meta.next_cursor == '':
5291                    break
5292                req.meta.cursor = plumbing_response.meta.next_cursor
5293
5294        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)
5254    def __init__(self, channel, client):
5255        self.parent = client
5256        self.stub = RoleResourcesStub(channel)
def list(self, filter, *args, timeout=None)
5258    def list(self, filter, *args, timeout=None):
5259        '''
5260         List gets a list of RoleResource records matching a given set of criteria.
5261        '''
5262        req = RoleResourceListRequest()
5263        req.meta.CopyFrom(ListRequestMetadata())
5264        if self.parent.page_limit > 0:
5265            req.meta.limit = self.parent.page_limit
5266        if self.parent.snapshot_datetime is not None:
5267            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5268
5269        req.filter = plumbing.quote_filter_args(filter, *args)
5270
5271        def generator(svc, req):
5272            tries = 0
5273            while True:
5274                try:
5275                    plumbing_response = svc.stub.List(
5276                        req,
5277                        metadata=svc.parent.get_metadata(
5278                            'RoleResources.List', req),
5279                        timeout=timeout)
5280                except Exception as e:
5281                    if self.parent.shouldRetry(tries, e):
5282                        tries += 1
5283                        self.parent.jitterSleep(tries)
5284                        continue
5285                    raise plumbing.convert_error_to_porcelain(e) from e
5286                tries = 0
5287                for plumbing_item in plumbing_response.role_resources:
5288                    yield plumbing.convert_role_resource_to_porcelain(
5289                        plumbing_item)
5290                if plumbing_response.meta.next_cursor == '':
5291                    break
5292                req.meta.cursor = plumbing_response.meta.next_cursor
5293
5294        return generator(self, req)

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

class SnapshotRoleResources:
5297class SnapshotRoleResources:
5298    '''
5299    SnapshotRoleResources exposes the read only methods of the RoleResources
5300    service for historical queries.
5301    '''
5302    def __init__(self, role_resources):
5303        self.role_resources = role_resources
5304
5305    def list(self, filter, *args, timeout=None):
5306        '''
5307         List gets a list of RoleResource records matching a given set of criteria.
5308        '''
5309        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)
5302    def __init__(self, role_resources):
5303        self.role_resources = role_resources
def list(self, filter, *args, timeout=None)
5305    def list(self, filter, *args, timeout=None):
5306        '''
5307         List gets a list of RoleResource records matching a given set of criteria.
5308        '''
5309        return self.role_resources.list(filter, *args, timeout=timeout)

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

class RoleResourcesHistory:
5312class RoleResourcesHistory:
5313    '''
5314     RoleResourcesHistory records all changes to the state of a RoleResource.
5315    See `strongdm.models.RoleResourceHistory`.
5316    '''
5317    def __init__(self, channel, client):
5318        self.parent = client
5319        self.stub = RoleResourcesHistoryStub(channel)
5320
5321    def list(self, filter, *args, timeout=None):
5322        '''
5323         List gets a list of RoleResourceHistory records matching a given set of criteria.
5324        '''
5325        req = RoleResourceHistoryListRequest()
5326        req.meta.CopyFrom(ListRequestMetadata())
5327        if self.parent.page_limit > 0:
5328            req.meta.limit = self.parent.page_limit
5329        if self.parent.snapshot_datetime is not None:
5330            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5331
5332        req.filter = plumbing.quote_filter_args(filter, *args)
5333
5334        def generator(svc, req):
5335            tries = 0
5336            while True:
5337                try:
5338                    plumbing_response = svc.stub.List(
5339                        req,
5340                        metadata=svc.parent.get_metadata(
5341                            'RoleResourcesHistory.List', req),
5342                        timeout=timeout)
5343                except Exception as e:
5344                    if self.parent.shouldRetry(tries, e):
5345                        tries += 1
5346                        self.parent.jitterSleep(tries)
5347                        continue
5348                    raise plumbing.convert_error_to_porcelain(e) from e
5349                tries = 0
5350                for plumbing_item in plumbing_response.history:
5351                    yield plumbing.convert_role_resource_history_to_porcelain(
5352                        plumbing_item)
5353                if plumbing_response.meta.next_cursor == '':
5354                    break
5355                req.meta.cursor = plumbing_response.meta.next_cursor
5356
5357        return generator(self, req)

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

RoleResourcesHistory(channel, client)
5317    def __init__(self, channel, client):
5318        self.parent = client
5319        self.stub = RoleResourcesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
5321    def list(self, filter, *args, timeout=None):
5322        '''
5323         List gets a list of RoleResourceHistory records matching a given set of criteria.
5324        '''
5325        req = RoleResourceHistoryListRequest()
5326        req.meta.CopyFrom(ListRequestMetadata())
5327        if self.parent.page_limit > 0:
5328            req.meta.limit = self.parent.page_limit
5329        if self.parent.snapshot_datetime is not None:
5330            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5331
5332        req.filter = plumbing.quote_filter_args(filter, *args)
5333
5334        def generator(svc, req):
5335            tries = 0
5336            while True:
5337                try:
5338                    plumbing_response = svc.stub.List(
5339                        req,
5340                        metadata=svc.parent.get_metadata(
5341                            'RoleResourcesHistory.List', req),
5342                        timeout=timeout)
5343                except Exception as e:
5344                    if self.parent.shouldRetry(tries, e):
5345                        tries += 1
5346                        self.parent.jitterSleep(tries)
5347                        continue
5348                    raise plumbing.convert_error_to_porcelain(e) from e
5349                tries = 0
5350                for plumbing_item in plumbing_response.history:
5351                    yield plumbing.convert_role_resource_history_to_porcelain(
5352                        plumbing_item)
5353                if plumbing_response.meta.next_cursor == '':
5354                    break
5355                req.meta.cursor = plumbing_response.meta.next_cursor
5356
5357        return generator(self, req)

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

class Roles:
5360class Roles:
5361    '''
5362     A Role has a list of access rules which determine which Resources the members
5363     of the Role have access to. An Account can be a member of multiple Roles via
5364     AccountAttachments.
5365    See `strongdm.models.Role`.
5366    '''
5367    def __init__(self, channel, client):
5368        self.parent = client
5369        self.stub = RolesStub(channel)
5370
5371    def create(self, role, timeout=None):
5372        '''
5373         Create registers a new Role.
5374        '''
5375        req = RoleCreateRequest()
5376
5377        if role is not None:
5378            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5379        tries = 0
5380        plumbing_response = None
5381        while True:
5382            try:
5383                plumbing_response = self.stub.Create(
5384                    req,
5385                    metadata=self.parent.get_metadata('Roles.Create', req),
5386                    timeout=timeout)
5387            except Exception as e:
5388                if self.parent.shouldRetry(tries, e):
5389                    tries += 1
5390                    self.parent.jitterSleep(tries)
5391                    continue
5392                raise plumbing.convert_error_to_porcelain(e) from e
5393            break
5394
5395        resp = models.RoleCreateResponse()
5396        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5397            plumbing_response.meta)
5398        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5399            plumbing_response.rate_limit)
5400        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5401        return resp
5402
5403    def get(self, id, timeout=None):
5404        '''
5405         Get reads one Role by ID.
5406        '''
5407        req = RoleGetRequest()
5408        if self.parent.snapshot_datetime is not None:
5409            req.meta.CopyFrom(GetRequestMetadata())
5410            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5411
5412        req.id = (id)
5413        tries = 0
5414        plumbing_response = None
5415        while True:
5416            try:
5417                plumbing_response = self.stub.Get(
5418                    req,
5419                    metadata=self.parent.get_metadata('Roles.Get', req),
5420                    timeout=timeout)
5421            except Exception as e:
5422                if self.parent.shouldRetry(tries, e):
5423                    tries += 1
5424                    self.parent.jitterSleep(tries)
5425                    continue
5426                raise plumbing.convert_error_to_porcelain(e) from e
5427            break
5428
5429        resp = models.RoleGetResponse()
5430        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5431            plumbing_response.meta)
5432        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5433            plumbing_response.rate_limit)
5434        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5435        return resp
5436
5437    def update(self, role, timeout=None):
5438        '''
5439         Update replaces all the fields of a Role by ID.
5440        '''
5441        req = RoleUpdateRequest()
5442
5443        if role is not None:
5444            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5445        tries = 0
5446        plumbing_response = None
5447        while True:
5448            try:
5449                plumbing_response = self.stub.Update(
5450                    req,
5451                    metadata=self.parent.get_metadata('Roles.Update', req),
5452                    timeout=timeout)
5453            except Exception as e:
5454                if self.parent.shouldRetry(tries, e):
5455                    tries += 1
5456                    self.parent.jitterSleep(tries)
5457                    continue
5458                raise plumbing.convert_error_to_porcelain(e) from e
5459            break
5460
5461        resp = models.RoleUpdateResponse()
5462        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5463            plumbing_response.meta)
5464        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5465            plumbing_response.rate_limit)
5466        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5467        return resp
5468
5469    def delete(self, id, timeout=None):
5470        '''
5471         Delete removes a Role by ID.
5472        '''
5473        req = RoleDeleteRequest()
5474
5475        req.id = (id)
5476        tries = 0
5477        plumbing_response = None
5478        while True:
5479            try:
5480                plumbing_response = self.stub.Delete(
5481                    req,
5482                    metadata=self.parent.get_metadata('Roles.Delete', 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            break
5491
5492        resp = models.RoleDeleteResponse()
5493        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5494            plumbing_response.meta)
5495        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5496            plumbing_response.rate_limit)
5497        return resp
5498
5499    def list(self, filter, *args, timeout=None):
5500        '''
5501         List gets a list of Roles matching a given set of criteria.
5502        '''
5503        req = RoleListRequest()
5504        req.meta.CopyFrom(ListRequestMetadata())
5505        if self.parent.page_limit > 0:
5506            req.meta.limit = self.parent.page_limit
5507        if self.parent.snapshot_datetime is not None:
5508            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5509
5510        req.filter = plumbing.quote_filter_args(filter, *args)
5511
5512        def generator(svc, req):
5513            tries = 0
5514            while True:
5515                try:
5516                    plumbing_response = svc.stub.List(
5517                        req,
5518                        metadata=svc.parent.get_metadata('Roles.List', req),
5519                        timeout=timeout)
5520                except Exception as e:
5521                    if self.parent.shouldRetry(tries, e):
5522                        tries += 1
5523                        self.parent.jitterSleep(tries)
5524                        continue
5525                    raise plumbing.convert_error_to_porcelain(e) from e
5526                tries = 0
5527                for plumbing_item in plumbing_response.roles:
5528                    yield plumbing.convert_role_to_porcelain(plumbing_item)
5529                if plumbing_response.meta.next_cursor == '':
5530                    break
5531                req.meta.cursor = plumbing_response.meta.next_cursor
5532
5533        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)
5367    def __init__(self, channel, client):
5368        self.parent = client
5369        self.stub = RolesStub(channel)
def create(self, role, timeout=None)
5371    def create(self, role, timeout=None):
5372        '''
5373         Create registers a new Role.
5374        '''
5375        req = RoleCreateRequest()
5376
5377        if role is not None:
5378            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5379        tries = 0
5380        plumbing_response = None
5381        while True:
5382            try:
5383                plumbing_response = self.stub.Create(
5384                    req,
5385                    metadata=self.parent.get_metadata('Roles.Create', req),
5386                    timeout=timeout)
5387            except Exception as e:
5388                if self.parent.shouldRetry(tries, e):
5389                    tries += 1
5390                    self.parent.jitterSleep(tries)
5391                    continue
5392                raise plumbing.convert_error_to_porcelain(e) from e
5393            break
5394
5395        resp = models.RoleCreateResponse()
5396        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5397            plumbing_response.meta)
5398        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5399            plumbing_response.rate_limit)
5400        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5401        return resp

Create registers a new Role.

def get(self, id, timeout=None)
5403    def get(self, id, timeout=None):
5404        '''
5405         Get reads one Role by ID.
5406        '''
5407        req = RoleGetRequest()
5408        if self.parent.snapshot_datetime is not None:
5409            req.meta.CopyFrom(GetRequestMetadata())
5410            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5411
5412        req.id = (id)
5413        tries = 0
5414        plumbing_response = None
5415        while True:
5416            try:
5417                plumbing_response = self.stub.Get(
5418                    req,
5419                    metadata=self.parent.get_metadata('Roles.Get', req),
5420                    timeout=timeout)
5421            except Exception as e:
5422                if self.parent.shouldRetry(tries, e):
5423                    tries += 1
5424                    self.parent.jitterSleep(tries)
5425                    continue
5426                raise plumbing.convert_error_to_porcelain(e) from e
5427            break
5428
5429        resp = models.RoleGetResponse()
5430        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5431            plumbing_response.meta)
5432        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5433            plumbing_response.rate_limit)
5434        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5435        return resp

Get reads one Role by ID.

def update(self, role, timeout=None)
5437    def update(self, role, timeout=None):
5438        '''
5439         Update replaces all the fields of a Role by ID.
5440        '''
5441        req = RoleUpdateRequest()
5442
5443        if role is not None:
5444            req.role.CopyFrom(plumbing.convert_role_to_plumbing(role))
5445        tries = 0
5446        plumbing_response = None
5447        while True:
5448            try:
5449                plumbing_response = self.stub.Update(
5450                    req,
5451                    metadata=self.parent.get_metadata('Roles.Update', req),
5452                    timeout=timeout)
5453            except Exception as e:
5454                if self.parent.shouldRetry(tries, e):
5455                    tries += 1
5456                    self.parent.jitterSleep(tries)
5457                    continue
5458                raise plumbing.convert_error_to_porcelain(e) from e
5459            break
5460
5461        resp = models.RoleUpdateResponse()
5462        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5463            plumbing_response.meta)
5464        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5465            plumbing_response.rate_limit)
5466        resp.role = plumbing.convert_role_to_porcelain(plumbing_response.role)
5467        return resp

Update replaces all the fields of a Role by ID.

def delete(self, id, timeout=None)
5469    def delete(self, id, timeout=None):
5470        '''
5471         Delete removes a Role by ID.
5472        '''
5473        req = RoleDeleteRequest()
5474
5475        req.id = (id)
5476        tries = 0
5477        plumbing_response = None
5478        while True:
5479            try:
5480                plumbing_response = self.stub.Delete(
5481                    req,
5482                    metadata=self.parent.get_metadata('Roles.Delete', 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            break
5491
5492        resp = models.RoleDeleteResponse()
5493        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5494            plumbing_response.meta)
5495        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5496            plumbing_response.rate_limit)
5497        return resp

Delete removes a Role by ID.

def list(self, filter, *args, timeout=None)
5499    def list(self, filter, *args, timeout=None):
5500        '''
5501         List gets a list of Roles matching a given set of criteria.
5502        '''
5503        req = RoleListRequest()
5504        req.meta.CopyFrom(ListRequestMetadata())
5505        if self.parent.page_limit > 0:
5506            req.meta.limit = self.parent.page_limit
5507        if self.parent.snapshot_datetime is not None:
5508            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5509
5510        req.filter = plumbing.quote_filter_args(filter, *args)
5511
5512        def generator(svc, req):
5513            tries = 0
5514            while True:
5515                try:
5516                    plumbing_response = svc.stub.List(
5517                        req,
5518                        metadata=svc.parent.get_metadata('Roles.List', req),
5519                        timeout=timeout)
5520                except Exception as e:
5521                    if self.parent.shouldRetry(tries, e):
5522                        tries += 1
5523                        self.parent.jitterSleep(tries)
5524                        continue
5525                    raise plumbing.convert_error_to_porcelain(e) from e
5526                tries = 0
5527                for plumbing_item in plumbing_response.roles:
5528                    yield plumbing.convert_role_to_porcelain(plumbing_item)
5529                if plumbing_response.meta.next_cursor == '':
5530                    break
5531                req.meta.cursor = plumbing_response.meta.next_cursor
5532
5533        return generator(self, req)

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

class SnapshotRoles:
5536class SnapshotRoles:
5537    '''
5538    SnapshotRoles exposes the read only methods of the Roles
5539    service for historical queries.
5540    '''
5541    def __init__(self, roles):
5542        self.roles = roles
5543
5544    def get(self, id, timeout=None):
5545        '''
5546         Get reads one Role by ID.
5547        '''
5548        return self.roles.get(id, timeout=timeout)
5549
5550    def list(self, filter, *args, timeout=None):
5551        '''
5552         List gets a list of Roles matching a given set of criteria.
5553        '''
5554        return self.roles.list(filter, *args, timeout=timeout)

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

SnapshotRoles(roles)
5541    def __init__(self, roles):
5542        self.roles = roles
def get(self, id, timeout=None)
5544    def get(self, id, timeout=None):
5545        '''
5546         Get reads one Role by ID.
5547        '''
5548        return self.roles.get(id, timeout=timeout)

Get reads one Role by ID.

def list(self, filter, *args, timeout=None)
5550    def list(self, filter, *args, timeout=None):
5551        '''
5552         List gets a list of Roles matching a given set of criteria.
5553        '''
5554        return self.roles.list(filter, *args, timeout=timeout)

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

class RolesHistory:
5557class RolesHistory:
5558    '''
5559     RolesHistory records all changes to the state of a Role.
5560    See `strongdm.models.RoleHistory`.
5561    '''
5562    def __init__(self, channel, client):
5563        self.parent = client
5564        self.stub = RolesHistoryStub(channel)
5565
5566    def list(self, filter, *args, timeout=None):
5567        '''
5568         List gets a list of RoleHistory records matching a given set of criteria.
5569        '''
5570        req = RoleHistoryListRequest()
5571        req.meta.CopyFrom(ListRequestMetadata())
5572        if self.parent.page_limit > 0:
5573            req.meta.limit = self.parent.page_limit
5574        if self.parent.snapshot_datetime is not None:
5575            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5576
5577        req.filter = plumbing.quote_filter_args(filter, *args)
5578
5579        def generator(svc, req):
5580            tries = 0
5581            while True:
5582                try:
5583                    plumbing_response = svc.stub.List(
5584                        req,
5585                        metadata=svc.parent.get_metadata(
5586                            'RolesHistory.List', req),
5587                        timeout=timeout)
5588                except Exception as e:
5589                    if self.parent.shouldRetry(tries, e):
5590                        tries += 1
5591                        self.parent.jitterSleep(tries)
5592                        continue
5593                    raise plumbing.convert_error_to_porcelain(e) from e
5594                tries = 0
5595                for plumbing_item in plumbing_response.history:
5596                    yield plumbing.convert_role_history_to_porcelain(
5597                        plumbing_item)
5598                if plumbing_response.meta.next_cursor == '':
5599                    break
5600                req.meta.cursor = plumbing_response.meta.next_cursor
5601
5602        return generator(self, req)

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

RolesHistory(channel, client)
5562    def __init__(self, channel, client):
5563        self.parent = client
5564        self.stub = RolesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
5566    def list(self, filter, *args, timeout=None):
5567        '''
5568         List gets a list of RoleHistory records matching a given set of criteria.
5569        '''
5570        req = RoleHistoryListRequest()
5571        req.meta.CopyFrom(ListRequestMetadata())
5572        if self.parent.page_limit > 0:
5573            req.meta.limit = self.parent.page_limit
5574        if self.parent.snapshot_datetime is not None:
5575            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5576
5577        req.filter = plumbing.quote_filter_args(filter, *args)
5578
5579        def generator(svc, req):
5580            tries = 0
5581            while True:
5582                try:
5583                    plumbing_response = svc.stub.List(
5584                        req,
5585                        metadata=svc.parent.get_metadata(
5586                            'RolesHistory.List', req),
5587                        timeout=timeout)
5588                except Exception as e:
5589                    if self.parent.shouldRetry(tries, e):
5590                        tries += 1
5591                        self.parent.jitterSleep(tries)
5592                        continue
5593                    raise plumbing.convert_error_to_porcelain(e) from e
5594                tries = 0
5595                for plumbing_item in plumbing_response.history:
5596                    yield plumbing.convert_role_history_to_porcelain(
5597                        plumbing_item)
5598                if plumbing_response.meta.next_cursor == '':
5599                    break
5600                req.meta.cursor = plumbing_response.meta.next_cursor
5601
5602        return generator(self, req)

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

class SecretStores:
5605class SecretStores:
5606    '''
5607     SecretStores are servers where resource secrets (passwords, keys) are stored.
5608    See:
5609    `strongdm.models.ActiveDirectoryStore`
5610    `strongdm.models.AWSStore`
5611    `strongdm.models.AWSCertX509Store`
5612    `strongdm.models.AzureStore`
5613    `strongdm.models.CyberarkConjurStore`
5614    `strongdm.models.CyberarkPAMStore`
5615    `strongdm.models.CyberarkPAMExperimentalStore`
5616    `strongdm.models.DelineaStore`
5617    `strongdm.models.GCPStore`
5618    `strongdm.models.GCPCertX509Store`
5619    `strongdm.models.KeyfactorSSHStore`
5620    `strongdm.models.KeyfactorX509Store`
5621    `strongdm.models.VaultAppRoleStore`
5622    `strongdm.models.VaultAppRoleCertSSHStore`
5623    `strongdm.models.VaultAppRoleCertX509Store`
5624    `strongdm.models.VaultAWSEC2Store`
5625    `strongdm.models.VaultAWSIAMStore`
5626    `strongdm.models.VaultTLSStore`
5627    `strongdm.models.VaultTLSCertSSHStore`
5628    `strongdm.models.VaultTLSCertX509Store`
5629    `strongdm.models.VaultTokenStore`
5630    `strongdm.models.VaultTokenCertSSHStore`
5631    `strongdm.models.VaultTokenCertX509Store`
5632    '''
5633    def __init__(self, channel, client):
5634        self.parent = client
5635        self.stub = SecretStoresStub(channel)
5636
5637    def create(self, secret_store, timeout=None):
5638        req = SecretStoreCreateRequest()
5639
5640        if secret_store is not None:
5641            req.secret_store.CopyFrom(
5642                plumbing.convert_secret_store_to_plumbing(secret_store))
5643        tries = 0
5644        plumbing_response = None
5645        while True:
5646            try:
5647                plumbing_response = self.stub.Create(
5648                    req,
5649                    metadata=self.parent.get_metadata('SecretStores.Create',
5650                                                      req),
5651                    timeout=timeout)
5652            except Exception as e:
5653                if self.parent.shouldRetry(tries, e):
5654                    tries += 1
5655                    self.parent.jitterSleep(tries)
5656                    continue
5657                raise plumbing.convert_error_to_porcelain(e) from e
5658            break
5659
5660        resp = models.SecretStoreCreateResponse()
5661        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5662            plumbing_response.meta)
5663        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5664            plumbing_response.rate_limit)
5665        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5666            plumbing_response.secret_store)
5667        return resp
5668
5669    def get(self, id, timeout=None):
5670        '''
5671         Get reads one SecretStore by ID.
5672        '''
5673        req = SecretStoreGetRequest()
5674        if self.parent.snapshot_datetime is not None:
5675            req.meta.CopyFrom(GetRequestMetadata())
5676            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5677
5678        req.id = (id)
5679        tries = 0
5680        plumbing_response = None
5681        while True:
5682            try:
5683                plumbing_response = self.stub.Get(
5684                    req,
5685                    metadata=self.parent.get_metadata('SecretStores.Get', req),
5686                    timeout=timeout)
5687            except Exception as e:
5688                if self.parent.shouldRetry(tries, e):
5689                    tries += 1
5690                    self.parent.jitterSleep(tries)
5691                    continue
5692                raise plumbing.convert_error_to_porcelain(e) from e
5693            break
5694
5695        resp = models.SecretStoreGetResponse()
5696        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5697            plumbing_response.meta)
5698        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5699            plumbing_response.rate_limit)
5700        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5701            plumbing_response.secret_store)
5702        return resp
5703
5704    def update(self, secret_store, timeout=None):
5705        '''
5706         Update replaces all the fields of a SecretStore by ID.
5707        '''
5708        req = SecretStoreUpdateRequest()
5709
5710        if secret_store is not None:
5711            req.secret_store.CopyFrom(
5712                plumbing.convert_secret_store_to_plumbing(secret_store))
5713        tries = 0
5714        plumbing_response = None
5715        while True:
5716            try:
5717                plumbing_response = self.stub.Update(
5718                    req,
5719                    metadata=self.parent.get_metadata('SecretStores.Update',
5720                                                      req),
5721                    timeout=timeout)
5722            except Exception as e:
5723                if self.parent.shouldRetry(tries, e):
5724                    tries += 1
5725                    self.parent.jitterSleep(tries)
5726                    continue
5727                raise plumbing.convert_error_to_porcelain(e) from e
5728            break
5729
5730        resp = models.SecretStoreUpdateResponse()
5731        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5732            plumbing_response.meta)
5733        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5734            plumbing_response.rate_limit)
5735        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5736            plumbing_response.secret_store)
5737        return resp
5738
5739    def delete(self, id, timeout=None):
5740        '''
5741         Delete removes a SecretStore by ID.
5742        '''
5743        req = SecretStoreDeleteRequest()
5744
5745        req.id = (id)
5746        tries = 0
5747        plumbing_response = None
5748        while True:
5749            try:
5750                plumbing_response = self.stub.Delete(
5751                    req,
5752                    metadata=self.parent.get_metadata('SecretStores.Delete',
5753                                                      req),
5754                    timeout=timeout)
5755            except Exception as e:
5756                if self.parent.shouldRetry(tries, e):
5757                    tries += 1
5758                    self.parent.jitterSleep(tries)
5759                    continue
5760                raise plumbing.convert_error_to_porcelain(e) from e
5761            break
5762
5763        resp = models.SecretStoreDeleteResponse()
5764        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5765            plumbing_response.meta)
5766        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5767            plumbing_response.rate_limit)
5768        return resp
5769
5770    def list(self, filter, *args, timeout=None):
5771        '''
5772         List gets a list of SecretStores matching a given set of criteria.
5773        '''
5774        req = SecretStoreListRequest()
5775        req.meta.CopyFrom(ListRequestMetadata())
5776        if self.parent.page_limit > 0:
5777            req.meta.limit = self.parent.page_limit
5778        if self.parent.snapshot_datetime is not None:
5779            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5780
5781        req.filter = plumbing.quote_filter_args(filter, *args)
5782
5783        def generator(svc, req):
5784            tries = 0
5785            while True:
5786                try:
5787                    plumbing_response = svc.stub.List(
5788                        req,
5789                        metadata=svc.parent.get_metadata(
5790                            'SecretStores.List', req),
5791                        timeout=timeout)
5792                except Exception as e:
5793                    if self.parent.shouldRetry(tries, e):
5794                        tries += 1
5795                        self.parent.jitterSleep(tries)
5796                        continue
5797                    raise plumbing.convert_error_to_porcelain(e) from e
5798                tries = 0
5799                for plumbing_item in plumbing_response.secret_stores:
5800                    yield plumbing.convert_secret_store_to_porcelain(
5801                        plumbing_item)
5802                if plumbing_response.meta.next_cursor == '':
5803                    break
5804                req.meta.cursor = plumbing_response.meta.next_cursor
5805
5806        return generator(self, req)
SecretStores(channel, client)
5633    def __init__(self, channel, client):
5634        self.parent = client
5635        self.stub = SecretStoresStub(channel)
def create(self, secret_store, timeout=None)
5637    def create(self, secret_store, timeout=None):
5638        req = SecretStoreCreateRequest()
5639
5640        if secret_store is not None:
5641            req.secret_store.CopyFrom(
5642                plumbing.convert_secret_store_to_plumbing(secret_store))
5643        tries = 0
5644        plumbing_response = None
5645        while True:
5646            try:
5647                plumbing_response = self.stub.Create(
5648                    req,
5649                    metadata=self.parent.get_metadata('SecretStores.Create',
5650                                                      req),
5651                    timeout=timeout)
5652            except Exception as e:
5653                if self.parent.shouldRetry(tries, e):
5654                    tries += 1
5655                    self.parent.jitterSleep(tries)
5656                    continue
5657                raise plumbing.convert_error_to_porcelain(e) from e
5658            break
5659
5660        resp = models.SecretStoreCreateResponse()
5661        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5662            plumbing_response.meta)
5663        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5664            plumbing_response.rate_limit)
5665        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5666            plumbing_response.secret_store)
5667        return resp
def get(self, id, timeout=None)
5669    def get(self, id, timeout=None):
5670        '''
5671         Get reads one SecretStore by ID.
5672        '''
5673        req = SecretStoreGetRequest()
5674        if self.parent.snapshot_datetime is not None:
5675            req.meta.CopyFrom(GetRequestMetadata())
5676            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5677
5678        req.id = (id)
5679        tries = 0
5680        plumbing_response = None
5681        while True:
5682            try:
5683                plumbing_response = self.stub.Get(
5684                    req,
5685                    metadata=self.parent.get_metadata('SecretStores.Get', req),
5686                    timeout=timeout)
5687            except Exception as e:
5688                if self.parent.shouldRetry(tries, e):
5689                    tries += 1
5690                    self.parent.jitterSleep(tries)
5691                    continue
5692                raise plumbing.convert_error_to_porcelain(e) from e
5693            break
5694
5695        resp = models.SecretStoreGetResponse()
5696        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5697            plumbing_response.meta)
5698        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5699            plumbing_response.rate_limit)
5700        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5701            plumbing_response.secret_store)
5702        return resp

Get reads one SecretStore by ID.

def update(self, secret_store, timeout=None)
5704    def update(self, secret_store, timeout=None):
5705        '''
5706         Update replaces all the fields of a SecretStore by ID.
5707        '''
5708        req = SecretStoreUpdateRequest()
5709
5710        if secret_store is not None:
5711            req.secret_store.CopyFrom(
5712                plumbing.convert_secret_store_to_plumbing(secret_store))
5713        tries = 0
5714        plumbing_response = None
5715        while True:
5716            try:
5717                plumbing_response = self.stub.Update(
5718                    req,
5719                    metadata=self.parent.get_metadata('SecretStores.Update',
5720                                                      req),
5721                    timeout=timeout)
5722            except Exception as e:
5723                if self.parent.shouldRetry(tries, e):
5724                    tries += 1
5725                    self.parent.jitterSleep(tries)
5726                    continue
5727                raise plumbing.convert_error_to_porcelain(e) from e
5728            break
5729
5730        resp = models.SecretStoreUpdateResponse()
5731        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5732            plumbing_response.meta)
5733        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5734            plumbing_response.rate_limit)
5735        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5736            plumbing_response.secret_store)
5737        return resp

Update replaces all the fields of a SecretStore by ID.

def delete(self, id, timeout=None)
5739    def delete(self, id, timeout=None):
5740        '''
5741         Delete removes a SecretStore by ID.
5742        '''
5743        req = SecretStoreDeleteRequest()
5744
5745        req.id = (id)
5746        tries = 0
5747        plumbing_response = None
5748        while True:
5749            try:
5750                plumbing_response = self.stub.Delete(
5751                    req,
5752                    metadata=self.parent.get_metadata('SecretStores.Delete',
5753                                                      req),
5754                    timeout=timeout)
5755            except Exception as e:
5756                if self.parent.shouldRetry(tries, e):
5757                    tries += 1
5758                    self.parent.jitterSleep(tries)
5759                    continue
5760                raise plumbing.convert_error_to_porcelain(e) from e
5761            break
5762
5763        resp = models.SecretStoreDeleteResponse()
5764        resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
5765            plumbing_response.meta)
5766        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5767            plumbing_response.rate_limit)
5768        return resp

Delete removes a SecretStore by ID.

def list(self, filter, *args, timeout=None)
5770    def list(self, filter, *args, timeout=None):
5771        '''
5772         List gets a list of SecretStores matching a given set of criteria.
5773        '''
5774        req = SecretStoreListRequest()
5775        req.meta.CopyFrom(ListRequestMetadata())
5776        if self.parent.page_limit > 0:
5777            req.meta.limit = self.parent.page_limit
5778        if self.parent.snapshot_datetime is not None:
5779            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5780
5781        req.filter = plumbing.quote_filter_args(filter, *args)
5782
5783        def generator(svc, req):
5784            tries = 0
5785            while True:
5786                try:
5787                    plumbing_response = svc.stub.List(
5788                        req,
5789                        metadata=svc.parent.get_metadata(
5790                            'SecretStores.List', req),
5791                        timeout=timeout)
5792                except Exception as e:
5793                    if self.parent.shouldRetry(tries, e):
5794                        tries += 1
5795                        self.parent.jitterSleep(tries)
5796                        continue
5797                    raise plumbing.convert_error_to_porcelain(e) from e
5798                tries = 0
5799                for plumbing_item in plumbing_response.secret_stores:
5800                    yield plumbing.convert_secret_store_to_porcelain(
5801                        plumbing_item)
5802                if plumbing_response.meta.next_cursor == '':
5803                    break
5804                req.meta.cursor = plumbing_response.meta.next_cursor
5805
5806        return generator(self, req)

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

class SnapshotSecretStores:
5809class SnapshotSecretStores:
5810    '''
5811    SnapshotSecretStores exposes the read only methods of the SecretStores
5812    service for historical queries.
5813    '''
5814    def __init__(self, secret_stores):
5815        self.secret_stores = secret_stores
5816
5817    def get(self, id, timeout=None):
5818        '''
5819         Get reads one SecretStore by ID.
5820        '''
5821        return self.secret_stores.get(id, timeout=timeout)
5822
5823    def list(self, filter, *args, timeout=None):
5824        '''
5825         List gets a list of SecretStores matching a given set of criteria.
5826        '''
5827        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)
5814    def __init__(self, secret_stores):
5815        self.secret_stores = secret_stores
def get(self, id, timeout=None)
5817    def get(self, id, timeout=None):
5818        '''
5819         Get reads one SecretStore by ID.
5820        '''
5821        return self.secret_stores.get(id, timeout=timeout)

Get reads one SecretStore by ID.

def list(self, filter, *args, timeout=None)
5823    def list(self, filter, *args, timeout=None):
5824        '''
5825         List gets a list of SecretStores matching a given set of criteria.
5826        '''
5827        return self.secret_stores.list(filter, *args, timeout=timeout)

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

class SecretEngines:
5830class SecretEngines:
5831    '''
5832
5833    See:
5834    `strongdm.models.ActiveDirectoryEngine`
5835    `strongdm.models.KeyValueEngine`
5836    '''
5837    def __init__(self, channel, client):
5838        self.parent = client
5839        self.stub = SecretEnginesStub(channel)
5840
5841    def list(self, filter, *args, timeout=None):
5842        '''
5843         List returns a list of Secret Engines
5844        '''
5845        req = SecretEngineListRequest()
5846        req.meta.CopyFrom(ListRequestMetadata())
5847        if self.parent.page_limit > 0:
5848            req.meta.limit = self.parent.page_limit
5849        if self.parent.snapshot_datetime is not None:
5850            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5851
5852        req.filter = plumbing.quote_filter_args(filter, *args)
5853
5854        def generator(svc, req):
5855            tries = 0
5856            while True:
5857                try:
5858                    plumbing_response = svc.stub.List(
5859                        req,
5860                        metadata=svc.parent.get_metadata(
5861                            'SecretEngines.List', req),
5862                        timeout=timeout)
5863                except Exception as e:
5864                    if self.parent.shouldRetry(tries, e):
5865                        tries += 1
5866                        self.parent.jitterSleep(tries)
5867                        continue
5868                    raise plumbing.convert_error_to_porcelain(e) from e
5869                tries = 0
5870                for plumbing_item in plumbing_response.secret_engines:
5871                    yield plumbing.convert_secret_engine_to_porcelain(
5872                        plumbing_item)
5873                if plumbing_response.meta.next_cursor == '':
5874                    break
5875                req.meta.cursor = plumbing_response.meta.next_cursor
5876
5877        return generator(self, req)
5878
5879    def get(self, id, timeout=None):
5880        '''
5881         Get returns a secret engine details
5882        '''
5883        req = SecretEngineGetRequest()
5884        if self.parent.snapshot_datetime is not None:
5885            req.meta.CopyFrom(GetRequestMetadata())
5886            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5887
5888        req.id = (id)
5889        tries = 0
5890        plumbing_response = None
5891        while True:
5892            try:
5893                plumbing_response = self.stub.Get(
5894                    req,
5895                    metadata=self.parent.get_metadata('SecretEngines.Get',
5896                                                      req),
5897                    timeout=timeout)
5898            except Exception as e:
5899                if self.parent.shouldRetry(tries, e):
5900                    tries += 1
5901                    self.parent.jitterSleep(tries)
5902                    continue
5903                raise plumbing.convert_error_to_porcelain(e) from e
5904            break
5905
5906        resp = models.SecretEngineGetResponse()
5907        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5908            plumbing_response.meta)
5909        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5910            plumbing_response.rate_limit)
5911        resp.secret_engine = plumbing.convert_secret_engine_to_porcelain(
5912            plumbing_response.secret_engine)
5913        return resp
5914
5915    def create(self, secret_engine, timeout=None):
5916        '''
5917         Create creates a secret engine
5918        '''
5919        req = SecretEngineCreateRequest()
5920
5921        if secret_engine is not None:
5922            req.secret_engine.CopyFrom(
5923                plumbing.convert_secret_engine_to_plumbing(secret_engine))
5924        tries = 0
5925        plumbing_response = None
5926        while True:
5927            try:
5928                plumbing_response = self.stub.Create(
5929                    req,
5930                    metadata=self.parent.get_metadata('SecretEngines.Create',
5931                                                      req),
5932                    timeout=timeout)
5933            except Exception as e:
5934                if self.parent.shouldRetry(tries, e):
5935                    tries += 1
5936                    self.parent.jitterSleep(tries)
5937                    continue
5938                raise plumbing.convert_error_to_porcelain(e) from e
5939            break
5940
5941        resp = models.SecretEngineCreateResponse()
5942        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5943            plumbing_response.meta)
5944        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5945            plumbing_response.rate_limit)
5946        resp.secret_engine = plumbing.convert_secret_engine_to_porcelain(
5947            plumbing_response.secret_engine)
5948        return resp
5949
5950    def update(self, secret_engine, timeout=None):
5951        '''
5952         Update updates a secret engine
5953        '''
5954        req = SecretEngineUpdateRequest()
5955
5956        if secret_engine is not None:
5957            req.secret_engine.CopyFrom(
5958                plumbing.convert_secret_engine_to_plumbing(secret_engine))
5959        tries = 0
5960        plumbing_response = None
5961        while True:
5962            try:
5963                plumbing_response = self.stub.Update(
5964                    req,
5965                    metadata=self.parent.get_metadata('SecretEngines.Update',
5966                                                      req),
5967                    timeout=timeout)
5968            except Exception as e:
5969                if self.parent.shouldRetry(tries, e):
5970                    tries += 1
5971                    self.parent.jitterSleep(tries)
5972                    continue
5973                raise plumbing.convert_error_to_porcelain(e) from e
5974            break
5975
5976        resp = models.SecretEngineUpdateResponse()
5977        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5978            plumbing_response.meta)
5979        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5980            plumbing_response.rate_limit)
5981        resp.secret_engine = plumbing.convert_secret_engine_to_porcelain(
5982            plumbing_response.secret_engine)
5983        return resp
5984
5985    def delete(self, id, timeout=None):
5986        '''
5987         Delete deletes a secret engine
5988        '''
5989        req = SecretEngineDeleteRequest()
5990
5991        req.id = (id)
5992        tries = 0
5993        plumbing_response = None
5994        while True:
5995            try:
5996                plumbing_response = self.stub.Delete(
5997                    req,
5998                    metadata=self.parent.get_metadata('SecretEngines.Delete',
5999                                                      req),
6000                    timeout=timeout)
6001            except Exception as e:
6002                if self.parent.shouldRetry(tries, e):
6003                    tries += 1
6004                    self.parent.jitterSleep(tries)
6005                    continue
6006                raise plumbing.convert_error_to_porcelain(e) from e
6007            break
6008
6009        resp = models.SecretEngineDeleteResponse()
6010        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6011            plumbing_response.rate_limit)
6012        return resp
6013
6014    def list_secret_stores(self, filter, *args, timeout=None):
6015        '''
6016         ListSecretStores returns a list of Secret Stores that can be used as a backing store
6017         for Secret Engine
6018        '''
6019        req = SecretStoreListRequest()
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.ListSecretStores(
6033                        req,
6034                        metadata=svc.parent.get_metadata(
6035                            'SecretEngines.ListSecretStores', 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.secret_stores:
6045                    yield plumbing.convert_secret_store_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    def generate_keys(self, secret_engine_id, timeout=None):
6054        '''
6055         GenerateKeys generates a private key, stores it in a secret store and stores a public key in a secret engine
6056        '''
6057        req = GenerateKeysRequest()
6058
6059        req.secret_engine_id = (secret_engine_id)
6060        tries = 0
6061        plumbing_response = None
6062        while True:
6063            try:
6064                plumbing_response = self.stub.GenerateKeys(
6065                    req,
6066                    metadata=self.parent.get_metadata(
6067                        'SecretEngines.GenerateKeys', req),
6068                    timeout=timeout)
6069            except Exception as e:
6070                if self.parent.shouldRetry(tries, e):
6071                    tries += 1
6072                    self.parent.jitterSleep(tries)
6073                    continue
6074                raise plumbing.convert_error_to_porcelain(e) from e
6075            break
6076
6077        resp = models.GenerateKeysResponse()
6078        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6079            plumbing_response.rate_limit)
6080        return resp
6081
6082    def healthcheck(self, secret_engine_id, timeout=None):
6083        '''
6084         Healthcheck triggers a healthcheck for all nodes serving a secret engine
6085        '''
6086        req = HealthcheckRequest()
6087
6088        req.secret_engine_id = (secret_engine_id)
6089        tries = 0
6090        plumbing_response = None
6091        while True:
6092            try:
6093                plumbing_response = self.stub.Healthcheck(
6094                    req,
6095                    metadata=self.parent.get_metadata(
6096                        'SecretEngines.Healthcheck', req),
6097                    timeout=timeout)
6098            except Exception as e:
6099                if self.parent.shouldRetry(tries, e):
6100                    tries += 1
6101                    self.parent.jitterSleep(tries)
6102                    continue
6103                raise plumbing.convert_error_to_porcelain(e) from e
6104            break
6105
6106        resp = models.HealthcheckResponse()
6107        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6108            plumbing_response.rate_limit)
6109        resp.status = plumbing.convert_repeated_healthcheck_status_to_porcelain(
6110            plumbing_response.status)
6111        return resp
6112
6113    def rotate(self, id, password_policy, timeout=None):
6114        '''
6115         Rotate rotates secret engine's credentials
6116        '''
6117        req = SecretEngineRotateRequest()
6118
6119        req.id = (id)
6120        if password_policy is not None:
6121            req.password_policy.CopyFrom(
6122                plumbing.convert_secret_engine_password_policy_to_plumbing(
6123                    password_policy))
6124        tries = 0
6125        plumbing_response = None
6126        while True:
6127            try:
6128                plumbing_response = self.stub.Rotate(
6129                    req,
6130                    metadata=self.parent.get_metadata('SecretEngines.Rotate',
6131                                                      req),
6132                    timeout=timeout)
6133            except Exception as e:
6134                if self.parent.shouldRetry(tries, e):
6135                    tries += 1
6136                    self.parent.jitterSleep(tries)
6137                    continue
6138                raise plumbing.convert_error_to_porcelain(e) from e
6139            break
6140
6141        resp = models.SecretEngineRotateResponse()
6142        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6143            plumbing_response.rate_limit)
6144        return resp
SecretEngines(channel, client)
5837    def __init__(self, channel, client):
5838        self.parent = client
5839        self.stub = SecretEnginesStub(channel)
def list(self, filter, *args, timeout=None)
5841    def list(self, filter, *args, timeout=None):
5842        '''
5843         List returns a list of Secret Engines
5844        '''
5845        req = SecretEngineListRequest()
5846        req.meta.CopyFrom(ListRequestMetadata())
5847        if self.parent.page_limit > 0:
5848            req.meta.limit = self.parent.page_limit
5849        if self.parent.snapshot_datetime is not None:
5850            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5851
5852        req.filter = plumbing.quote_filter_args(filter, *args)
5853
5854        def generator(svc, req):
5855            tries = 0
5856            while True:
5857                try:
5858                    plumbing_response = svc.stub.List(
5859                        req,
5860                        metadata=svc.parent.get_metadata(
5861                            'SecretEngines.List', req),
5862                        timeout=timeout)
5863                except Exception as e:
5864                    if self.parent.shouldRetry(tries, e):
5865                        tries += 1
5866                        self.parent.jitterSleep(tries)
5867                        continue
5868                    raise plumbing.convert_error_to_porcelain(e) from e
5869                tries = 0
5870                for plumbing_item in plumbing_response.secret_engines:
5871                    yield plumbing.convert_secret_engine_to_porcelain(
5872                        plumbing_item)
5873                if plumbing_response.meta.next_cursor == '':
5874                    break
5875                req.meta.cursor = plumbing_response.meta.next_cursor
5876
5877        return generator(self, req)

List returns a list of Secret Engines

def get(self, id, timeout=None)
5879    def get(self, id, timeout=None):
5880        '''
5881         Get returns a secret engine details
5882        '''
5883        req = SecretEngineGetRequest()
5884        if self.parent.snapshot_datetime is not None:
5885            req.meta.CopyFrom(GetRequestMetadata())
5886            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5887
5888        req.id = (id)
5889        tries = 0
5890        plumbing_response = None
5891        while True:
5892            try:
5893                plumbing_response = self.stub.Get(
5894                    req,
5895                    metadata=self.parent.get_metadata('SecretEngines.Get',
5896                                                      req),
5897                    timeout=timeout)
5898            except Exception as e:
5899                if self.parent.shouldRetry(tries, e):
5900                    tries += 1
5901                    self.parent.jitterSleep(tries)
5902                    continue
5903                raise plumbing.convert_error_to_porcelain(e) from e
5904            break
5905
5906        resp = models.SecretEngineGetResponse()
5907        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
5908            plumbing_response.meta)
5909        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5910            plumbing_response.rate_limit)
5911        resp.secret_engine = plumbing.convert_secret_engine_to_porcelain(
5912            plumbing_response.secret_engine)
5913        return resp

Get returns a secret engine details

def create(self, secret_engine, timeout=None)
5915    def create(self, secret_engine, timeout=None):
5916        '''
5917         Create creates a secret engine
5918        '''
5919        req = SecretEngineCreateRequest()
5920
5921        if secret_engine is not None:
5922            req.secret_engine.CopyFrom(
5923                plumbing.convert_secret_engine_to_plumbing(secret_engine))
5924        tries = 0
5925        plumbing_response = None
5926        while True:
5927            try:
5928                plumbing_response = self.stub.Create(
5929                    req,
5930                    metadata=self.parent.get_metadata('SecretEngines.Create',
5931                                                      req),
5932                    timeout=timeout)
5933            except Exception as e:
5934                if self.parent.shouldRetry(tries, e):
5935                    tries += 1
5936                    self.parent.jitterSleep(tries)
5937                    continue
5938                raise plumbing.convert_error_to_porcelain(e) from e
5939            break
5940
5941        resp = models.SecretEngineCreateResponse()
5942        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
5943            plumbing_response.meta)
5944        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5945            plumbing_response.rate_limit)
5946        resp.secret_engine = plumbing.convert_secret_engine_to_porcelain(
5947            plumbing_response.secret_engine)
5948        return resp

Create creates a secret engine

def update(self, secret_engine, timeout=None)
5950    def update(self, secret_engine, timeout=None):
5951        '''
5952         Update updates a secret engine
5953        '''
5954        req = SecretEngineUpdateRequest()
5955
5956        if secret_engine is not None:
5957            req.secret_engine.CopyFrom(
5958                plumbing.convert_secret_engine_to_plumbing(secret_engine))
5959        tries = 0
5960        plumbing_response = None
5961        while True:
5962            try:
5963                plumbing_response = self.stub.Update(
5964                    req,
5965                    metadata=self.parent.get_metadata('SecretEngines.Update',
5966                                                      req),
5967                    timeout=timeout)
5968            except Exception as e:
5969                if self.parent.shouldRetry(tries, e):
5970                    tries += 1
5971                    self.parent.jitterSleep(tries)
5972                    continue
5973                raise plumbing.convert_error_to_porcelain(e) from e
5974            break
5975
5976        resp = models.SecretEngineUpdateResponse()
5977        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5978            plumbing_response.meta)
5979        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5980            plumbing_response.rate_limit)
5981        resp.secret_engine = plumbing.convert_secret_engine_to_porcelain(
5982            plumbing_response.secret_engine)
5983        return resp

Update updates a secret engine

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

Delete deletes a secret engine

def list_secret_stores(self, filter, *args, timeout=None)
6014    def list_secret_stores(self, filter, *args, timeout=None):
6015        '''
6016         ListSecretStores returns a list of Secret Stores that can be used as a backing store
6017         for Secret Engine
6018        '''
6019        req = SecretStoreListRequest()
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.ListSecretStores(
6033                        req,
6034                        metadata=svc.parent.get_metadata(
6035                            'SecretEngines.ListSecretStores', 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.secret_stores:
6045                    yield plumbing.convert_secret_store_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)

ListSecretStores returns a list of Secret Stores that can be used as a backing store for Secret Engine

def generate_keys(self, secret_engine_id, timeout=None)
6053    def generate_keys(self, secret_engine_id, timeout=None):
6054        '''
6055         GenerateKeys generates a private key, stores it in a secret store and stores a public key in a secret engine
6056        '''
6057        req = GenerateKeysRequest()
6058
6059        req.secret_engine_id = (secret_engine_id)
6060        tries = 0
6061        plumbing_response = None
6062        while True:
6063            try:
6064                plumbing_response = self.stub.GenerateKeys(
6065                    req,
6066                    metadata=self.parent.get_metadata(
6067                        'SecretEngines.GenerateKeys', req),
6068                    timeout=timeout)
6069            except Exception as e:
6070                if self.parent.shouldRetry(tries, e):
6071                    tries += 1
6072                    self.parent.jitterSleep(tries)
6073                    continue
6074                raise plumbing.convert_error_to_porcelain(e) from e
6075            break
6076
6077        resp = models.GenerateKeysResponse()
6078        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6079            plumbing_response.rate_limit)
6080        return resp

GenerateKeys generates a private key, stores it in a secret store and stores a public key in a secret engine

def healthcheck(self, secret_engine_id, timeout=None)
6082    def healthcheck(self, secret_engine_id, timeout=None):
6083        '''
6084         Healthcheck triggers a healthcheck for all nodes serving a secret engine
6085        '''
6086        req = HealthcheckRequest()
6087
6088        req.secret_engine_id = (secret_engine_id)
6089        tries = 0
6090        plumbing_response = None
6091        while True:
6092            try:
6093                plumbing_response = self.stub.Healthcheck(
6094                    req,
6095                    metadata=self.parent.get_metadata(
6096                        'SecretEngines.Healthcheck', req),
6097                    timeout=timeout)
6098            except Exception as e:
6099                if self.parent.shouldRetry(tries, e):
6100                    tries += 1
6101                    self.parent.jitterSleep(tries)
6102                    continue
6103                raise plumbing.convert_error_to_porcelain(e) from e
6104            break
6105
6106        resp = models.HealthcheckResponse()
6107        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6108            plumbing_response.rate_limit)
6109        resp.status = plumbing.convert_repeated_healthcheck_status_to_porcelain(
6110            plumbing_response.status)
6111        return resp

Healthcheck triggers a healthcheck for all nodes serving a secret engine

def rotate(self, id, password_policy, timeout=None)
6113    def rotate(self, id, password_policy, timeout=None):
6114        '''
6115         Rotate rotates secret engine's credentials
6116        '''
6117        req = SecretEngineRotateRequest()
6118
6119        req.id = (id)
6120        if password_policy is not None:
6121            req.password_policy.CopyFrom(
6122                plumbing.convert_secret_engine_password_policy_to_plumbing(
6123                    password_policy))
6124        tries = 0
6125        plumbing_response = None
6126        while True:
6127            try:
6128                plumbing_response = self.stub.Rotate(
6129                    req,
6130                    metadata=self.parent.get_metadata('SecretEngines.Rotate',
6131                                                      req),
6132                    timeout=timeout)
6133            except Exception as e:
6134                if self.parent.shouldRetry(tries, e):
6135                    tries += 1
6136                    self.parent.jitterSleep(tries)
6137                    continue
6138                raise plumbing.convert_error_to_porcelain(e) from e
6139            break
6140
6141        resp = models.SecretEngineRotateResponse()
6142        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6143            plumbing_response.rate_limit)
6144        return resp

Rotate rotates secret engine's credentials

class SecretStoreHealths:
6147class SecretStoreHealths:
6148    '''
6149     SecretStoreHealths exposes health states for secret stores.
6150    See `strongdm.models.SecretStoreHealth`.
6151    '''
6152    def __init__(self, channel, client):
6153        self.parent = client
6154        self.stub = SecretStoreHealthsStub(channel)
6155
6156    def list(self, filter, *args, timeout=None):
6157        '''
6158         List reports the health status of node to secret store pairs.
6159        '''
6160        req = SecretStoreHealthListRequest()
6161        req.meta.CopyFrom(ListRequestMetadata())
6162        if self.parent.page_limit > 0:
6163            req.meta.limit = self.parent.page_limit
6164        if self.parent.snapshot_datetime is not None:
6165            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6166
6167        req.filter = plumbing.quote_filter_args(filter, *args)
6168
6169        def generator(svc, req):
6170            tries = 0
6171            while True:
6172                try:
6173                    plumbing_response = svc.stub.List(
6174                        req,
6175                        metadata=svc.parent.get_metadata(
6176                            'SecretStoreHealths.List', req),
6177                        timeout=timeout)
6178                except Exception as e:
6179                    if self.parent.shouldRetry(tries, e):
6180                        tries += 1
6181                        self.parent.jitterSleep(tries)
6182                        continue
6183                    raise plumbing.convert_error_to_porcelain(e) from e
6184                tries = 0
6185                for plumbing_item in plumbing_response.secret_store_healths:
6186                    yield plumbing.convert_secret_store_health_to_porcelain(
6187                        plumbing_item)
6188                if plumbing_response.meta.next_cursor == '':
6189                    break
6190                req.meta.cursor = plumbing_response.meta.next_cursor
6191
6192        return generator(self, req)
6193
6194    def healthcheck(self, secret_store_id, timeout=None):
6195        '''
6196         Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
6197         to propagate across a large network of Nodes. The call will return immediately, and the
6198         updated health of the Secret Store can be retrieved via List.
6199        '''
6200        req = SecretStoreHealthcheckRequest()
6201
6202        req.secret_store_id = (secret_store_id)
6203        tries = 0
6204        plumbing_response = None
6205        while True:
6206            try:
6207                plumbing_response = self.stub.Healthcheck(
6208                    req,
6209                    metadata=self.parent.get_metadata(
6210                        'SecretStoreHealths.Healthcheck', req),
6211                    timeout=timeout)
6212            except Exception as e:
6213                if self.parent.shouldRetry(tries, e):
6214                    tries += 1
6215                    self.parent.jitterSleep(tries)
6216                    continue
6217                raise plumbing.convert_error_to_porcelain(e) from e
6218            break
6219
6220        resp = models.SecretStoreHealthcheckResponse()
6221        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6222            plumbing_response.rate_limit)
6223        return resp

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

SecretStoreHealths(channel, client)
6152    def __init__(self, channel, client):
6153        self.parent = client
6154        self.stub = SecretStoreHealthsStub(channel)
def list(self, filter, *args, timeout=None)
6156    def list(self, filter, *args, timeout=None):
6157        '''
6158         List reports the health status of node to secret store pairs.
6159        '''
6160        req = SecretStoreHealthListRequest()
6161        req.meta.CopyFrom(ListRequestMetadata())
6162        if self.parent.page_limit > 0:
6163            req.meta.limit = self.parent.page_limit
6164        if self.parent.snapshot_datetime is not None:
6165            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6166
6167        req.filter = plumbing.quote_filter_args(filter, *args)
6168
6169        def generator(svc, req):
6170            tries = 0
6171            while True:
6172                try:
6173                    plumbing_response = svc.stub.List(
6174                        req,
6175                        metadata=svc.parent.get_metadata(
6176                            'SecretStoreHealths.List', req),
6177                        timeout=timeout)
6178                except Exception as e:
6179                    if self.parent.shouldRetry(tries, e):
6180                        tries += 1
6181                        self.parent.jitterSleep(tries)
6182                        continue
6183                    raise plumbing.convert_error_to_porcelain(e) from e
6184                tries = 0
6185                for plumbing_item in plumbing_response.secret_store_healths:
6186                    yield plumbing.convert_secret_store_health_to_porcelain(
6187                        plumbing_item)
6188                if plumbing_response.meta.next_cursor == '':
6189                    break
6190                req.meta.cursor = plumbing_response.meta.next_cursor
6191
6192        return generator(self, req)

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

def healthcheck(self, secret_store_id, timeout=None)
6194    def healthcheck(self, secret_store_id, timeout=None):
6195        '''
6196         Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
6197         to propagate across a large network of Nodes. The call will return immediately, and the
6198         updated health of the Secret Store can be retrieved via List.
6199        '''
6200        req = SecretStoreHealthcheckRequest()
6201
6202        req.secret_store_id = (secret_store_id)
6203        tries = 0
6204        plumbing_response = None
6205        while True:
6206            try:
6207                plumbing_response = self.stub.Healthcheck(
6208                    req,
6209                    metadata=self.parent.get_metadata(
6210                        'SecretStoreHealths.Healthcheck', req),
6211                    timeout=timeout)
6212            except Exception as e:
6213                if self.parent.shouldRetry(tries, e):
6214                    tries += 1
6215                    self.parent.jitterSleep(tries)
6216                    continue
6217                raise plumbing.convert_error_to_porcelain(e) from e
6218            break
6219
6220        resp = models.SecretStoreHealthcheckResponse()
6221        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6222            plumbing_response.rate_limit)
6223        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:
6226class SecretStoresHistory:
6227    '''
6228     SecretStoresHistory records all changes to the state of a SecretStore.
6229    See `strongdm.models.SecretStoreHistory`.
6230    '''
6231    def __init__(self, channel, client):
6232        self.parent = client
6233        self.stub = SecretStoresHistoryStub(channel)
6234
6235    def list(self, filter, *args, timeout=None):
6236        '''
6237         List gets a list of SecretStoreHistory records matching a given set of criteria.
6238        '''
6239        req = SecretStoreHistoryListRequest()
6240        req.meta.CopyFrom(ListRequestMetadata())
6241        if self.parent.page_limit > 0:
6242            req.meta.limit = self.parent.page_limit
6243        if self.parent.snapshot_datetime is not None:
6244            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6245
6246        req.filter = plumbing.quote_filter_args(filter, *args)
6247
6248        def generator(svc, req):
6249            tries = 0
6250            while True:
6251                try:
6252                    plumbing_response = svc.stub.List(
6253                        req,
6254                        metadata=svc.parent.get_metadata(
6255                            'SecretStoresHistory.List', req),
6256                        timeout=timeout)
6257                except Exception as e:
6258                    if self.parent.shouldRetry(tries, e):
6259                        tries += 1
6260                        self.parent.jitterSleep(tries)
6261                        continue
6262                    raise plumbing.convert_error_to_porcelain(e) from e
6263                tries = 0
6264                for plumbing_item in plumbing_response.history:
6265                    yield plumbing.convert_secret_store_history_to_porcelain(
6266                        plumbing_item)
6267                if plumbing_response.meta.next_cursor == '':
6268                    break
6269                req.meta.cursor = plumbing_response.meta.next_cursor
6270
6271        return generator(self, req)

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

SecretStoresHistory(channel, client)
6231    def __init__(self, channel, client):
6232        self.parent = client
6233        self.stub = SecretStoresHistoryStub(channel)
def list(self, filter, *args, timeout=None)
6235    def list(self, filter, *args, timeout=None):
6236        '''
6237         List gets a list of SecretStoreHistory records matching a given set of criteria.
6238        '''
6239        req = SecretStoreHistoryListRequest()
6240        req.meta.CopyFrom(ListRequestMetadata())
6241        if self.parent.page_limit > 0:
6242            req.meta.limit = self.parent.page_limit
6243        if self.parent.snapshot_datetime is not None:
6244            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6245
6246        req.filter = plumbing.quote_filter_args(filter, *args)
6247
6248        def generator(svc, req):
6249            tries = 0
6250            while True:
6251                try:
6252                    plumbing_response = svc.stub.List(
6253                        req,
6254                        metadata=svc.parent.get_metadata(
6255                            'SecretStoresHistory.List', req),
6256                        timeout=timeout)
6257                except Exception as e:
6258                    if self.parent.shouldRetry(tries, e):
6259                        tries += 1
6260                        self.parent.jitterSleep(tries)
6261                        continue
6262                    raise plumbing.convert_error_to_porcelain(e) from e
6263                tries = 0
6264                for plumbing_item in plumbing_response.history:
6265                    yield plumbing.convert_secret_store_history_to_porcelain(
6266                        plumbing_item)
6267                if plumbing_response.meta.next_cursor == '':
6268                    break
6269                req.meta.cursor = plumbing_response.meta.next_cursor
6270
6271        return generator(self, req)

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

class WorkflowApprovers:
6274class WorkflowApprovers:
6275    '''
6276     WorkflowApprovers is an account or a role with the ability to approve requests bound to a workflow.
6277    See `strongdm.models.WorkflowApprover`.
6278    '''
6279    def __init__(self, channel, client):
6280        self.parent = client
6281        self.stub = WorkflowApproversStub(channel)
6282
6283    def create(self, workflow_approver, timeout=None):
6284        '''
6285         Create creates a new workflow approver
6286        '''
6287        req = WorkflowApproversCreateRequest()
6288
6289        if workflow_approver is not None:
6290            req.workflow_approver.CopyFrom(
6291                plumbing.convert_workflow_approver_to_plumbing(
6292                    workflow_approver))
6293        tries = 0
6294        plumbing_response = None
6295        while True:
6296            try:
6297                plumbing_response = self.stub.Create(
6298                    req,
6299                    metadata=self.parent.get_metadata(
6300                        'WorkflowApprovers.Create', req),
6301                    timeout=timeout)
6302            except Exception as e:
6303                if self.parent.shouldRetry(tries, e):
6304                    tries += 1
6305                    self.parent.jitterSleep(tries)
6306                    continue
6307                raise plumbing.convert_error_to_porcelain(e) from e
6308            break
6309
6310        resp = models.WorkflowApproversCreateResponse()
6311        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6312            plumbing_response.rate_limit)
6313        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
6314            plumbing_response.workflow_approver)
6315        return resp
6316
6317    def get(self, id, timeout=None):
6318        '''
6319         Get reads one workflow approver by ID.
6320        '''
6321        req = WorkflowApproverGetRequest()
6322        if self.parent.snapshot_datetime is not None:
6323            req.meta.CopyFrom(GetRequestMetadata())
6324            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6325
6326        req.id = (id)
6327        tries = 0
6328        plumbing_response = None
6329        while True:
6330            try:
6331                plumbing_response = self.stub.Get(
6332                    req,
6333                    metadata=self.parent.get_metadata('WorkflowApprovers.Get',
6334                                                      req),
6335                    timeout=timeout)
6336            except Exception as e:
6337                if self.parent.shouldRetry(tries, e):
6338                    tries += 1
6339                    self.parent.jitterSleep(tries)
6340                    continue
6341                raise plumbing.convert_error_to_porcelain(e) from e
6342            break
6343
6344        resp = models.WorkflowApproverGetResponse()
6345        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6346            plumbing_response.meta)
6347        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6348            plumbing_response.rate_limit)
6349        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
6350            plumbing_response.workflow_approver)
6351        return resp
6352
6353    def delete(self, id, timeout=None):
6354        '''
6355         Delete deletes a workflow approver
6356        '''
6357        req = WorkflowApproversDeleteRequest()
6358
6359        req.id = (id)
6360        tries = 0
6361        plumbing_response = None
6362        while True:
6363            try:
6364                plumbing_response = self.stub.Delete(
6365                    req,
6366                    metadata=self.parent.get_metadata(
6367                        'WorkflowApprovers.Delete', req),
6368                    timeout=timeout)
6369            except Exception as e:
6370                if self.parent.shouldRetry(tries, e):
6371                    tries += 1
6372                    self.parent.jitterSleep(tries)
6373                    continue
6374                raise plumbing.convert_error_to_porcelain(e) from e
6375            break
6376
6377        resp = models.WorkflowApproversDeleteResponse()
6378        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6379            plumbing_response.rate_limit)
6380        return resp
6381
6382    def list(self, filter, *args, timeout=None):
6383        '''
6384         Lists existing workflow approvers.
6385        '''
6386        req = WorkflowApproversListRequest()
6387        req.meta.CopyFrom(ListRequestMetadata())
6388        if self.parent.page_limit > 0:
6389            req.meta.limit = self.parent.page_limit
6390        if self.parent.snapshot_datetime is not None:
6391            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6392
6393        req.filter = plumbing.quote_filter_args(filter, *args)
6394
6395        def generator(svc, req):
6396            tries = 0
6397            while True:
6398                try:
6399                    plumbing_response = svc.stub.List(
6400                        req,
6401                        metadata=svc.parent.get_metadata(
6402                            'WorkflowApprovers.List', req),
6403                        timeout=timeout)
6404                except Exception as e:
6405                    if self.parent.shouldRetry(tries, e):
6406                        tries += 1
6407                        self.parent.jitterSleep(tries)
6408                        continue
6409                    raise plumbing.convert_error_to_porcelain(e) from e
6410                tries = 0
6411                for plumbing_item in plumbing_response.workflow_approvers:
6412                    yield plumbing.convert_workflow_approver_to_porcelain(
6413                        plumbing_item)
6414                if plumbing_response.meta.next_cursor == '':
6415                    break
6416                req.meta.cursor = plumbing_response.meta.next_cursor
6417
6418        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)
6279    def __init__(self, channel, client):
6280        self.parent = client
6281        self.stub = WorkflowApproversStub(channel)
def create(self, workflow_approver, timeout=None)
6283    def create(self, workflow_approver, timeout=None):
6284        '''
6285         Create creates a new workflow approver
6286        '''
6287        req = WorkflowApproversCreateRequest()
6288
6289        if workflow_approver is not None:
6290            req.workflow_approver.CopyFrom(
6291                plumbing.convert_workflow_approver_to_plumbing(
6292                    workflow_approver))
6293        tries = 0
6294        plumbing_response = None
6295        while True:
6296            try:
6297                plumbing_response = self.stub.Create(
6298                    req,
6299                    metadata=self.parent.get_metadata(
6300                        'WorkflowApprovers.Create', req),
6301                    timeout=timeout)
6302            except Exception as e:
6303                if self.parent.shouldRetry(tries, e):
6304                    tries += 1
6305                    self.parent.jitterSleep(tries)
6306                    continue
6307                raise plumbing.convert_error_to_porcelain(e) from e
6308            break
6309
6310        resp = models.WorkflowApproversCreateResponse()
6311        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6312            plumbing_response.rate_limit)
6313        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
6314            plumbing_response.workflow_approver)
6315        return resp

Create creates a new workflow approver

def get(self, id, timeout=None)
6317    def get(self, id, timeout=None):
6318        '''
6319         Get reads one workflow approver by ID.
6320        '''
6321        req = WorkflowApproverGetRequest()
6322        if self.parent.snapshot_datetime is not None:
6323            req.meta.CopyFrom(GetRequestMetadata())
6324            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6325
6326        req.id = (id)
6327        tries = 0
6328        plumbing_response = None
6329        while True:
6330            try:
6331                plumbing_response = self.stub.Get(
6332                    req,
6333                    metadata=self.parent.get_metadata('WorkflowApprovers.Get',
6334                                                      req),
6335                    timeout=timeout)
6336            except Exception as e:
6337                if self.parent.shouldRetry(tries, e):
6338                    tries += 1
6339                    self.parent.jitterSleep(tries)
6340                    continue
6341                raise plumbing.convert_error_to_porcelain(e) from e
6342            break
6343
6344        resp = models.WorkflowApproverGetResponse()
6345        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6346            plumbing_response.meta)
6347        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6348            plumbing_response.rate_limit)
6349        resp.workflow_approver = plumbing.convert_workflow_approver_to_porcelain(
6350            plumbing_response.workflow_approver)
6351        return resp

Get reads one workflow approver by ID.

def delete(self, id, timeout=None)
6353    def delete(self, id, timeout=None):
6354        '''
6355         Delete deletes a workflow approver
6356        '''
6357        req = WorkflowApproversDeleteRequest()
6358
6359        req.id = (id)
6360        tries = 0
6361        plumbing_response = None
6362        while True:
6363            try:
6364                plumbing_response = self.stub.Delete(
6365                    req,
6366                    metadata=self.parent.get_metadata(
6367                        'WorkflowApprovers.Delete', req),
6368                    timeout=timeout)
6369            except Exception as e:
6370                if self.parent.shouldRetry(tries, e):
6371                    tries += 1
6372                    self.parent.jitterSleep(tries)
6373                    continue
6374                raise plumbing.convert_error_to_porcelain(e) from e
6375            break
6376
6377        resp = models.WorkflowApproversDeleteResponse()
6378        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6379            plumbing_response.rate_limit)
6380        return resp

Delete deletes a workflow approver

def list(self, filter, *args, timeout=None)
6382    def list(self, filter, *args, timeout=None):
6383        '''
6384         Lists existing workflow approvers.
6385        '''
6386        req = WorkflowApproversListRequest()
6387        req.meta.CopyFrom(ListRequestMetadata())
6388        if self.parent.page_limit > 0:
6389            req.meta.limit = self.parent.page_limit
6390        if self.parent.snapshot_datetime is not None:
6391            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6392
6393        req.filter = plumbing.quote_filter_args(filter, *args)
6394
6395        def generator(svc, req):
6396            tries = 0
6397            while True:
6398                try:
6399                    plumbing_response = svc.stub.List(
6400                        req,
6401                        metadata=svc.parent.get_metadata(
6402                            'WorkflowApprovers.List', req),
6403                        timeout=timeout)
6404                except Exception as e:
6405                    if self.parent.shouldRetry(tries, e):
6406                        tries += 1
6407                        self.parent.jitterSleep(tries)
6408                        continue
6409                    raise plumbing.convert_error_to_porcelain(e) from e
6410                tries = 0
6411                for plumbing_item in plumbing_response.workflow_approvers:
6412                    yield plumbing.convert_workflow_approver_to_porcelain(
6413                        plumbing_item)
6414                if plumbing_response.meta.next_cursor == '':
6415                    break
6416                req.meta.cursor = plumbing_response.meta.next_cursor
6417
6418        return generator(self, req)

Lists existing workflow approvers.

class SnapshotWorkflowApprovers:
6421class SnapshotWorkflowApprovers:
6422    '''
6423    SnapshotWorkflowApprovers exposes the read only methods of the WorkflowApprovers
6424    service for historical queries.
6425    '''
6426    def __init__(self, workflow_approvers):
6427        self.workflow_approvers = workflow_approvers
6428
6429    def get(self, id, timeout=None):
6430        '''
6431         Get reads one workflow approver by ID.
6432        '''
6433        return self.workflow_approvers.get(id, timeout=timeout)
6434
6435    def list(self, filter, *args, timeout=None):
6436        '''
6437         Lists existing workflow approvers.
6438        '''
6439        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)
6426    def __init__(self, workflow_approvers):
6427        self.workflow_approvers = workflow_approvers
def get(self, id, timeout=None)
6429    def get(self, id, timeout=None):
6430        '''
6431         Get reads one workflow approver by ID.
6432        '''
6433        return self.workflow_approvers.get(id, timeout=timeout)

Get reads one workflow approver by ID.

def list(self, filter, *args, timeout=None)
6435    def list(self, filter, *args, timeout=None):
6436        '''
6437         Lists existing workflow approvers.
6438        '''
6439        return self.workflow_approvers.list(filter, *args, timeout=timeout)

Lists existing workflow approvers.

class WorkflowApproversHistory:
6442class WorkflowApproversHistory:
6443    '''
6444     WorkflowApproversHistory provides records of all changes to the state of a WorkflowApprover.
6445    See `strongdm.models.WorkflowApproverHistory`.
6446    '''
6447    def __init__(self, channel, client):
6448        self.parent = client
6449        self.stub = WorkflowApproversHistoryStub(channel)
6450
6451    def list(self, filter, *args, timeout=None):
6452        '''
6453         List gets a list of WorkflowApproversHistory records matching a given set of criteria.
6454        '''
6455        req = WorkflowApproversHistoryListRequest()
6456        req.meta.CopyFrom(ListRequestMetadata())
6457        if self.parent.page_limit > 0:
6458            req.meta.limit = self.parent.page_limit
6459        if self.parent.snapshot_datetime is not None:
6460            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6461
6462        req.filter = plumbing.quote_filter_args(filter, *args)
6463
6464        def generator(svc, req):
6465            tries = 0
6466            while True:
6467                try:
6468                    plumbing_response = svc.stub.List(
6469                        req,
6470                        metadata=svc.parent.get_metadata(
6471                            'WorkflowApproversHistory.List', req),
6472                        timeout=timeout)
6473                except Exception as e:
6474                    if self.parent.shouldRetry(tries, e):
6475                        tries += 1
6476                        self.parent.jitterSleep(tries)
6477                        continue
6478                    raise plumbing.convert_error_to_porcelain(e) from e
6479                tries = 0
6480                for plumbing_item in plumbing_response.history:
6481                    yield plumbing.convert_workflow_approver_history_to_porcelain(
6482                        plumbing_item)
6483                if plumbing_response.meta.next_cursor == '':
6484                    break
6485                req.meta.cursor = plumbing_response.meta.next_cursor
6486
6487        return generator(self, req)

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

WorkflowApproversHistory(channel, client)
6447    def __init__(self, channel, client):
6448        self.parent = client
6449        self.stub = WorkflowApproversHistoryStub(channel)
def list(self, filter, *args, timeout=None)
6451    def list(self, filter, *args, timeout=None):
6452        '''
6453         List gets a list of WorkflowApproversHistory records matching a given set of criteria.
6454        '''
6455        req = WorkflowApproversHistoryListRequest()
6456        req.meta.CopyFrom(ListRequestMetadata())
6457        if self.parent.page_limit > 0:
6458            req.meta.limit = self.parent.page_limit
6459        if self.parent.snapshot_datetime is not None:
6460            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6461
6462        req.filter = plumbing.quote_filter_args(filter, *args)
6463
6464        def generator(svc, req):
6465            tries = 0
6466            while True:
6467                try:
6468                    plumbing_response = svc.stub.List(
6469                        req,
6470                        metadata=svc.parent.get_metadata(
6471                            'WorkflowApproversHistory.List', req),
6472                        timeout=timeout)
6473                except Exception as e:
6474                    if self.parent.shouldRetry(tries, e):
6475                        tries += 1
6476                        self.parent.jitterSleep(tries)
6477                        continue
6478                    raise plumbing.convert_error_to_porcelain(e) from e
6479                tries = 0
6480                for plumbing_item in plumbing_response.history:
6481                    yield plumbing.convert_workflow_approver_history_to_porcelain(
6482                        plumbing_item)
6483                if plumbing_response.meta.next_cursor == '':
6484                    break
6485                req.meta.cursor = plumbing_response.meta.next_cursor
6486
6487        return generator(self, req)

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

class WorkflowAssignments:
6490class WorkflowAssignments:
6491    '''
6492     WorkflowAssignments links a Resource to a Workflow. The assigned resources are those that a user can request
6493     access to via the workflow.
6494    See `strongdm.models.WorkflowAssignment`.
6495    '''
6496    def __init__(self, channel, client):
6497        self.parent = client
6498        self.stub = WorkflowAssignmentsStub(channel)
6499
6500    def list(self, filter, *args, timeout=None):
6501        '''
6502         Lists existing workflow assignments.
6503        '''
6504        req = WorkflowAssignmentsListRequest()
6505        req.meta.CopyFrom(ListRequestMetadata())
6506        if self.parent.page_limit > 0:
6507            req.meta.limit = self.parent.page_limit
6508        if self.parent.snapshot_datetime is not None:
6509            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6510
6511        req.filter = plumbing.quote_filter_args(filter, *args)
6512
6513        def generator(svc, req):
6514            tries = 0
6515            while True:
6516                try:
6517                    plumbing_response = svc.stub.List(
6518                        req,
6519                        metadata=svc.parent.get_metadata(
6520                            'WorkflowAssignments.List', req),
6521                        timeout=timeout)
6522                except Exception as e:
6523                    if self.parent.shouldRetry(tries, e):
6524                        tries += 1
6525                        self.parent.jitterSleep(tries)
6526                        continue
6527                    raise plumbing.convert_error_to_porcelain(e) from e
6528                tries = 0
6529                for plumbing_item in plumbing_response.workflow_assignments:
6530                    yield plumbing.convert_workflow_assignment_to_porcelain(
6531                        plumbing_item)
6532                if plumbing_response.meta.next_cursor == '':
6533                    break
6534                req.meta.cursor = plumbing_response.meta.next_cursor
6535
6536        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)
6496    def __init__(self, channel, client):
6497        self.parent = client
6498        self.stub = WorkflowAssignmentsStub(channel)
def list(self, filter, *args, timeout=None)
6500    def list(self, filter, *args, timeout=None):
6501        '''
6502         Lists existing workflow assignments.
6503        '''
6504        req = WorkflowAssignmentsListRequest()
6505        req.meta.CopyFrom(ListRequestMetadata())
6506        if self.parent.page_limit > 0:
6507            req.meta.limit = self.parent.page_limit
6508        if self.parent.snapshot_datetime is not None:
6509            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6510
6511        req.filter = plumbing.quote_filter_args(filter, *args)
6512
6513        def generator(svc, req):
6514            tries = 0
6515            while True:
6516                try:
6517                    plumbing_response = svc.stub.List(
6518                        req,
6519                        metadata=svc.parent.get_metadata(
6520                            'WorkflowAssignments.List', req),
6521                        timeout=timeout)
6522                except Exception as e:
6523                    if self.parent.shouldRetry(tries, e):
6524                        tries += 1
6525                        self.parent.jitterSleep(tries)
6526                        continue
6527                    raise plumbing.convert_error_to_porcelain(e) from e
6528                tries = 0
6529                for plumbing_item in plumbing_response.workflow_assignments:
6530                    yield plumbing.convert_workflow_assignment_to_porcelain(
6531                        plumbing_item)
6532                if plumbing_response.meta.next_cursor == '':
6533                    break
6534                req.meta.cursor = plumbing_response.meta.next_cursor
6535
6536        return generator(self, req)

Lists existing workflow assignments.

class SnapshotWorkflowAssignments:
6539class SnapshotWorkflowAssignments:
6540    '''
6541    SnapshotWorkflowAssignments exposes the read only methods of the WorkflowAssignments
6542    service for historical queries.
6543    '''
6544    def __init__(self, workflow_assignments):
6545        self.workflow_assignments = workflow_assignments
6546
6547    def list(self, filter, *args, timeout=None):
6548        '''
6549         Lists existing workflow assignments.
6550        '''
6551        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)
6544    def __init__(self, workflow_assignments):
6545        self.workflow_assignments = workflow_assignments
def list(self, filter, *args, timeout=None)
6547    def list(self, filter, *args, timeout=None):
6548        '''
6549         Lists existing workflow assignments.
6550        '''
6551        return self.workflow_assignments.list(filter, *args, timeout=timeout)

Lists existing workflow assignments.

class WorkflowAssignmentsHistory:
6554class WorkflowAssignmentsHistory:
6555    '''
6556     WorkflowAssignmentsHistory provides records of all changes to the state of a WorkflowAssignment.
6557    See `strongdm.models.WorkflowAssignmentHistory`.
6558    '''
6559    def __init__(self, channel, client):
6560        self.parent = client
6561        self.stub = WorkflowAssignmentsHistoryStub(channel)
6562
6563    def list(self, filter, *args, timeout=None):
6564        '''
6565         List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.
6566        '''
6567        req = WorkflowAssignmentsHistoryListRequest()
6568        req.meta.CopyFrom(ListRequestMetadata())
6569        if self.parent.page_limit > 0:
6570            req.meta.limit = self.parent.page_limit
6571        if self.parent.snapshot_datetime is not None:
6572            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6573
6574        req.filter = plumbing.quote_filter_args(filter, *args)
6575
6576        def generator(svc, req):
6577            tries = 0
6578            while True:
6579                try:
6580                    plumbing_response = svc.stub.List(
6581                        req,
6582                        metadata=svc.parent.get_metadata(
6583                            'WorkflowAssignmentsHistory.List', req),
6584                        timeout=timeout)
6585                except Exception as e:
6586                    if self.parent.shouldRetry(tries, e):
6587                        tries += 1
6588                        self.parent.jitterSleep(tries)
6589                        continue
6590                    raise plumbing.convert_error_to_porcelain(e) from e
6591                tries = 0
6592                for plumbing_item in plumbing_response.history:
6593                    yield plumbing.convert_workflow_assignment_history_to_porcelain(
6594                        plumbing_item)
6595                if plumbing_response.meta.next_cursor == '':
6596                    break
6597                req.meta.cursor = plumbing_response.meta.next_cursor
6598
6599        return generator(self, req)

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

WorkflowAssignmentsHistory(channel, client)
6559    def __init__(self, channel, client):
6560        self.parent = client
6561        self.stub = WorkflowAssignmentsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
6563    def list(self, filter, *args, timeout=None):
6564        '''
6565         List gets a list of WorkflowAssignmentsHistory records matching a given set of criteria.
6566        '''
6567        req = WorkflowAssignmentsHistoryListRequest()
6568        req.meta.CopyFrom(ListRequestMetadata())
6569        if self.parent.page_limit > 0:
6570            req.meta.limit = self.parent.page_limit
6571        if self.parent.snapshot_datetime is not None:
6572            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6573
6574        req.filter = plumbing.quote_filter_args(filter, *args)
6575
6576        def generator(svc, req):
6577            tries = 0
6578            while True:
6579                try:
6580                    plumbing_response = svc.stub.List(
6581                        req,
6582                        metadata=svc.parent.get_metadata(
6583                            'WorkflowAssignmentsHistory.List', req),
6584                        timeout=timeout)
6585                except Exception as e:
6586                    if self.parent.shouldRetry(tries, e):
6587                        tries += 1
6588                        self.parent.jitterSleep(tries)
6589                        continue
6590                    raise plumbing.convert_error_to_porcelain(e) from e
6591                tries = 0
6592                for plumbing_item in plumbing_response.history:
6593                    yield plumbing.convert_workflow_assignment_history_to_porcelain(
6594                        plumbing_item)
6595                if plumbing_response.meta.next_cursor == '':
6596                    break
6597                req.meta.cursor = plumbing_response.meta.next_cursor
6598
6599        return generator(self, req)

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

class WorkflowRoles:
6602class WorkflowRoles:
6603    '''
6604     WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
6605     to request access to a resource via the workflow.
6606    See `strongdm.models.WorkflowRole`.
6607    '''
6608    def __init__(self, channel, client):
6609        self.parent = client
6610        self.stub = WorkflowRolesStub(channel)
6611
6612    def create(self, workflow_role, timeout=None):
6613        '''
6614         Create creates a new workflow role
6615        '''
6616        req = WorkflowRolesCreateRequest()
6617
6618        if workflow_role is not None:
6619            req.workflow_role.CopyFrom(
6620                plumbing.convert_workflow_role_to_plumbing(workflow_role))
6621        tries = 0
6622        plumbing_response = None
6623        while True:
6624            try:
6625                plumbing_response = self.stub.Create(
6626                    req,
6627                    metadata=self.parent.get_metadata('WorkflowRoles.Create',
6628                                                      req),
6629                    timeout=timeout)
6630            except Exception as e:
6631                if self.parent.shouldRetry(tries, e):
6632                    tries += 1
6633                    self.parent.jitterSleep(tries)
6634                    continue
6635                raise plumbing.convert_error_to_porcelain(e) from e
6636            break
6637
6638        resp = models.WorkflowRolesCreateResponse()
6639        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6640            plumbing_response.rate_limit)
6641        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
6642            plumbing_response.workflow_role)
6643        return resp
6644
6645    def get(self, id, timeout=None):
6646        '''
6647         Get reads one workflow role by ID.
6648        '''
6649        req = WorkflowRoleGetRequest()
6650        if self.parent.snapshot_datetime is not None:
6651            req.meta.CopyFrom(GetRequestMetadata())
6652            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6653
6654        req.id = (id)
6655        tries = 0
6656        plumbing_response = None
6657        while True:
6658            try:
6659                plumbing_response = self.stub.Get(
6660                    req,
6661                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
6662                                                      req),
6663                    timeout=timeout)
6664            except Exception as e:
6665                if self.parent.shouldRetry(tries, e):
6666                    tries += 1
6667                    self.parent.jitterSleep(tries)
6668                    continue
6669                raise plumbing.convert_error_to_porcelain(e) from e
6670            break
6671
6672        resp = models.WorkflowRoleGetResponse()
6673        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6674            plumbing_response.meta)
6675        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6676            plumbing_response.rate_limit)
6677        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
6678            plumbing_response.workflow_role)
6679        return resp
6680
6681    def delete(self, id, timeout=None):
6682        '''
6683         Delete deletes a workflow role
6684        '''
6685        req = WorkflowRolesDeleteRequest()
6686
6687        req.id = (id)
6688        tries = 0
6689        plumbing_response = None
6690        while True:
6691            try:
6692                plumbing_response = self.stub.Delete(
6693                    req,
6694                    metadata=self.parent.get_metadata('WorkflowRoles.Delete',
6695                                                      req),
6696                    timeout=timeout)
6697            except Exception as e:
6698                if self.parent.shouldRetry(tries, e):
6699                    tries += 1
6700                    self.parent.jitterSleep(tries)
6701                    continue
6702                raise plumbing.convert_error_to_porcelain(e) from e
6703            break
6704
6705        resp = models.WorkflowRolesDeleteResponse()
6706        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6707            plumbing_response.rate_limit)
6708        return resp
6709
6710    def list(self, filter, *args, timeout=None):
6711        '''
6712         Lists existing workflow roles.
6713        '''
6714        req = WorkflowRolesListRequest()
6715        req.meta.CopyFrom(ListRequestMetadata())
6716        if self.parent.page_limit > 0:
6717            req.meta.limit = self.parent.page_limit
6718        if self.parent.snapshot_datetime is not None:
6719            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6720
6721        req.filter = plumbing.quote_filter_args(filter, *args)
6722
6723        def generator(svc, req):
6724            tries = 0
6725            while True:
6726                try:
6727                    plumbing_response = svc.stub.List(
6728                        req,
6729                        metadata=svc.parent.get_metadata(
6730                            'WorkflowRoles.List', req),
6731                        timeout=timeout)
6732                except Exception as e:
6733                    if self.parent.shouldRetry(tries, e):
6734                        tries += 1
6735                        self.parent.jitterSleep(tries)
6736                        continue
6737                    raise plumbing.convert_error_to_porcelain(e) from e
6738                tries = 0
6739                for plumbing_item in plumbing_response.workflow_role:
6740                    yield plumbing.convert_workflow_role_to_porcelain(
6741                        plumbing_item)
6742                if plumbing_response.meta.next_cursor == '':
6743                    break
6744                req.meta.cursor = plumbing_response.meta.next_cursor
6745
6746        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)
6608    def __init__(self, channel, client):
6609        self.parent = client
6610        self.stub = WorkflowRolesStub(channel)
def create(self, workflow_role, timeout=None)
6612    def create(self, workflow_role, timeout=None):
6613        '''
6614         Create creates a new workflow role
6615        '''
6616        req = WorkflowRolesCreateRequest()
6617
6618        if workflow_role is not None:
6619            req.workflow_role.CopyFrom(
6620                plumbing.convert_workflow_role_to_plumbing(workflow_role))
6621        tries = 0
6622        plumbing_response = None
6623        while True:
6624            try:
6625                plumbing_response = self.stub.Create(
6626                    req,
6627                    metadata=self.parent.get_metadata('WorkflowRoles.Create',
6628                                                      req),
6629                    timeout=timeout)
6630            except Exception as e:
6631                if self.parent.shouldRetry(tries, e):
6632                    tries += 1
6633                    self.parent.jitterSleep(tries)
6634                    continue
6635                raise plumbing.convert_error_to_porcelain(e) from e
6636            break
6637
6638        resp = models.WorkflowRolesCreateResponse()
6639        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6640            plumbing_response.rate_limit)
6641        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
6642            plumbing_response.workflow_role)
6643        return resp

Create creates a new workflow role

def get(self, id, timeout=None)
6645    def get(self, id, timeout=None):
6646        '''
6647         Get reads one workflow role by ID.
6648        '''
6649        req = WorkflowRoleGetRequest()
6650        if self.parent.snapshot_datetime is not None:
6651            req.meta.CopyFrom(GetRequestMetadata())
6652            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6653
6654        req.id = (id)
6655        tries = 0
6656        plumbing_response = None
6657        while True:
6658            try:
6659                plumbing_response = self.stub.Get(
6660                    req,
6661                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
6662                                                      req),
6663                    timeout=timeout)
6664            except Exception as e:
6665                if self.parent.shouldRetry(tries, e):
6666                    tries += 1
6667                    self.parent.jitterSleep(tries)
6668                    continue
6669                raise plumbing.convert_error_to_porcelain(e) from e
6670            break
6671
6672        resp = models.WorkflowRoleGetResponse()
6673        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6674            plumbing_response.meta)
6675        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6676            plumbing_response.rate_limit)
6677        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
6678            plumbing_response.workflow_role)
6679        return resp

Get reads one workflow role by ID.

def delete(self, id, timeout=None)
6681    def delete(self, id, timeout=None):
6682        '''
6683         Delete deletes a workflow role
6684        '''
6685        req = WorkflowRolesDeleteRequest()
6686
6687        req.id = (id)
6688        tries = 0
6689        plumbing_response = None
6690        while True:
6691            try:
6692                plumbing_response = self.stub.Delete(
6693                    req,
6694                    metadata=self.parent.get_metadata('WorkflowRoles.Delete',
6695                                                      req),
6696                    timeout=timeout)
6697            except Exception as e:
6698                if self.parent.shouldRetry(tries, e):
6699                    tries += 1
6700                    self.parent.jitterSleep(tries)
6701                    continue
6702                raise plumbing.convert_error_to_porcelain(e) from e
6703            break
6704
6705        resp = models.WorkflowRolesDeleteResponse()
6706        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6707            plumbing_response.rate_limit)
6708        return resp

Delete deletes a workflow role

def list(self, filter, *args, timeout=None)
6710    def list(self, filter, *args, timeout=None):
6711        '''
6712         Lists existing workflow roles.
6713        '''
6714        req = WorkflowRolesListRequest()
6715        req.meta.CopyFrom(ListRequestMetadata())
6716        if self.parent.page_limit > 0:
6717            req.meta.limit = self.parent.page_limit
6718        if self.parent.snapshot_datetime is not None:
6719            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6720
6721        req.filter = plumbing.quote_filter_args(filter, *args)
6722
6723        def generator(svc, req):
6724            tries = 0
6725            while True:
6726                try:
6727                    plumbing_response = svc.stub.List(
6728                        req,
6729                        metadata=svc.parent.get_metadata(
6730                            'WorkflowRoles.List', req),
6731                        timeout=timeout)
6732                except Exception as e:
6733                    if self.parent.shouldRetry(tries, e):
6734                        tries += 1
6735                        self.parent.jitterSleep(tries)
6736                        continue
6737                    raise plumbing.convert_error_to_porcelain(e) from e
6738                tries = 0
6739                for plumbing_item in plumbing_response.workflow_role:
6740                    yield plumbing.convert_workflow_role_to_porcelain(
6741                        plumbing_item)
6742                if plumbing_response.meta.next_cursor == '':
6743                    break
6744                req.meta.cursor = plumbing_response.meta.next_cursor
6745
6746        return generator(self, req)

Lists existing workflow roles.

class SnapshotWorkflowRoles:
6749class SnapshotWorkflowRoles:
6750    '''
6751    SnapshotWorkflowRoles exposes the read only methods of the WorkflowRoles
6752    service for historical queries.
6753    '''
6754    def __init__(self, workflow_roles):
6755        self.workflow_roles = workflow_roles
6756
6757    def get(self, id, timeout=None):
6758        '''
6759         Get reads one workflow role by ID.
6760        '''
6761        return self.workflow_roles.get(id, timeout=timeout)
6762
6763    def list(self, filter, *args, timeout=None):
6764        '''
6765         Lists existing workflow roles.
6766        '''
6767        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)
6754    def __init__(self, workflow_roles):
6755        self.workflow_roles = workflow_roles
def get(self, id, timeout=None)
6757    def get(self, id, timeout=None):
6758        '''
6759         Get reads one workflow role by ID.
6760        '''
6761        return self.workflow_roles.get(id, timeout=timeout)

Get reads one workflow role by ID.

def list(self, filter, *args, timeout=None)
6763    def list(self, filter, *args, timeout=None):
6764        '''
6765         Lists existing workflow roles.
6766        '''
6767        return self.workflow_roles.list(filter, *args, timeout=timeout)

Lists existing workflow roles.

class WorkflowRolesHistory:
6770class WorkflowRolesHistory:
6771    '''
6772     WorkflowRolesHistory provides records of all changes to the state of a WorkflowRole
6773    See `strongdm.models.WorkflowRoleHistory`.
6774    '''
6775    def __init__(self, channel, client):
6776        self.parent = client
6777        self.stub = WorkflowRolesHistoryStub(channel)
6778
6779    def list(self, filter, *args, timeout=None):
6780        '''
6781         List gets a list of WorkflowRolesHistory records matching a given set of criteria.
6782        '''
6783        req = WorkflowRolesHistoryListRequest()
6784        req.meta.CopyFrom(ListRequestMetadata())
6785        if self.parent.page_limit > 0:
6786            req.meta.limit = self.parent.page_limit
6787        if self.parent.snapshot_datetime is not None:
6788            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6789
6790        req.filter = plumbing.quote_filter_args(filter, *args)
6791
6792        def generator(svc, req):
6793            tries = 0
6794            while True:
6795                try:
6796                    plumbing_response = svc.stub.List(
6797                        req,
6798                        metadata=svc.parent.get_metadata(
6799                            'WorkflowRolesHistory.List', req),
6800                        timeout=timeout)
6801                except Exception as e:
6802                    if self.parent.shouldRetry(tries, e):
6803                        tries += 1
6804                        self.parent.jitterSleep(tries)
6805                        continue
6806                    raise plumbing.convert_error_to_porcelain(e) from e
6807                tries = 0
6808                for plumbing_item in plumbing_response.history:
6809                    yield plumbing.convert_workflow_role_history_to_porcelain(
6810                        plumbing_item)
6811                if plumbing_response.meta.next_cursor == '':
6812                    break
6813                req.meta.cursor = plumbing_response.meta.next_cursor
6814
6815        return generator(self, req)

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

WorkflowRolesHistory(channel, client)
6775    def __init__(self, channel, client):
6776        self.parent = client
6777        self.stub = WorkflowRolesHistoryStub(channel)
def list(self, filter, *args, timeout=None)
6779    def list(self, filter, *args, timeout=None):
6780        '''
6781         List gets a list of WorkflowRolesHistory records matching a given set of criteria.
6782        '''
6783        req = WorkflowRolesHistoryListRequest()
6784        req.meta.CopyFrom(ListRequestMetadata())
6785        if self.parent.page_limit > 0:
6786            req.meta.limit = self.parent.page_limit
6787        if self.parent.snapshot_datetime is not None:
6788            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6789
6790        req.filter = plumbing.quote_filter_args(filter, *args)
6791
6792        def generator(svc, req):
6793            tries = 0
6794            while True:
6795                try:
6796                    plumbing_response = svc.stub.List(
6797                        req,
6798                        metadata=svc.parent.get_metadata(
6799                            'WorkflowRolesHistory.List', req),
6800                        timeout=timeout)
6801                except Exception as e:
6802                    if self.parent.shouldRetry(tries, e):
6803                        tries += 1
6804                        self.parent.jitterSleep(tries)
6805                        continue
6806                    raise plumbing.convert_error_to_porcelain(e) from e
6807                tries = 0
6808                for plumbing_item in plumbing_response.history:
6809                    yield plumbing.convert_workflow_role_history_to_porcelain(
6810                        plumbing_item)
6811                if plumbing_response.meta.next_cursor == '':
6812                    break
6813                req.meta.cursor = plumbing_response.meta.next_cursor
6814
6815        return generator(self, req)

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

class Workflows:
6818class Workflows:
6819    '''
6820     Workflows are the collection of rules that define the resources to which access can be requested,
6821     the users that can request that access, and the mechanism for approving those requests which can either
6822     be automatic approval or a set of users authorized to approve the requests.
6823    See `strongdm.models.Workflow`.
6824    '''
6825    def __init__(self, channel, client):
6826        self.parent = client
6827        self.stub = WorkflowsStub(channel)
6828
6829    def create(self, workflow, timeout=None):
6830        '''
6831         Create creates a new workflow and requires a name for the workflow.
6832        '''
6833        req = WorkflowCreateRequest()
6834
6835        if workflow is not None:
6836            req.workflow.CopyFrom(
6837                plumbing.convert_workflow_to_plumbing(workflow))
6838        tries = 0
6839        plumbing_response = None
6840        while True:
6841            try:
6842                plumbing_response = self.stub.Create(
6843                    req,
6844                    metadata=self.parent.get_metadata('Workflows.Create', req),
6845                    timeout=timeout)
6846            except Exception as e:
6847                if self.parent.shouldRetry(tries, e):
6848                    tries += 1
6849                    self.parent.jitterSleep(tries)
6850                    continue
6851                raise plumbing.convert_error_to_porcelain(e) from e
6852            break
6853
6854        resp = models.WorkflowCreateResponse()
6855        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6856            plumbing_response.rate_limit)
6857        resp.workflow = plumbing.convert_workflow_to_porcelain(
6858            plumbing_response.workflow)
6859        return resp
6860
6861    def get(self, id, timeout=None):
6862        '''
6863         Get reads one workflow by ID.
6864        '''
6865        req = WorkflowGetRequest()
6866        if self.parent.snapshot_datetime is not None:
6867            req.meta.CopyFrom(GetRequestMetadata())
6868            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6869
6870        req.id = (id)
6871        tries = 0
6872        plumbing_response = None
6873        while True:
6874            try:
6875                plumbing_response = self.stub.Get(
6876                    req,
6877                    metadata=self.parent.get_metadata('Workflows.Get', req),
6878                    timeout=timeout)
6879            except Exception as e:
6880                if self.parent.shouldRetry(tries, e):
6881                    tries += 1
6882                    self.parent.jitterSleep(tries)
6883                    continue
6884                raise plumbing.convert_error_to_porcelain(e) from e
6885            break
6886
6887        resp = models.WorkflowGetResponse()
6888        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6889            plumbing_response.meta)
6890        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6891            plumbing_response.rate_limit)
6892        resp.workflow = plumbing.convert_workflow_to_porcelain(
6893            plumbing_response.workflow)
6894        return resp
6895
6896    def delete(self, id, timeout=None):
6897        '''
6898         Delete deletes an existing workflow.
6899        '''
6900        req = WorkflowDeleteRequest()
6901
6902        req.id = (id)
6903        tries = 0
6904        plumbing_response = None
6905        while True:
6906            try:
6907                plumbing_response = self.stub.Delete(
6908                    req,
6909                    metadata=self.parent.get_metadata('Workflows.Delete', req),
6910                    timeout=timeout)
6911            except Exception as e:
6912                if self.parent.shouldRetry(tries, e):
6913                    tries += 1
6914                    self.parent.jitterSleep(tries)
6915                    continue
6916                raise plumbing.convert_error_to_porcelain(e) from e
6917            break
6918
6919        resp = models.WorkflowDeleteResponse()
6920        resp.id = (plumbing_response.id)
6921        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6922            plumbing_response.rate_limit)
6923        return resp
6924
6925    def update(self, workflow, timeout=None):
6926        '''
6927         Update updates an existing workflow.
6928        '''
6929        req = WorkflowUpdateRequest()
6930
6931        if workflow is not None:
6932            req.workflow.CopyFrom(
6933                plumbing.convert_workflow_to_plumbing(workflow))
6934        tries = 0
6935        plumbing_response = None
6936        while True:
6937            try:
6938                plumbing_response = self.stub.Update(
6939                    req,
6940                    metadata=self.parent.get_metadata('Workflows.Update', req),
6941                    timeout=timeout)
6942            except Exception as e:
6943                if self.parent.shouldRetry(tries, e):
6944                    tries += 1
6945                    self.parent.jitterSleep(tries)
6946                    continue
6947                raise plumbing.convert_error_to_porcelain(e) from e
6948            break
6949
6950        resp = models.WorkflowUpdateResponse()
6951        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6952            plumbing_response.rate_limit)
6953        resp.workflow = plumbing.convert_workflow_to_porcelain(
6954            plumbing_response.workflow)
6955        return resp
6956
6957    def list(self, filter, *args, timeout=None):
6958        '''
6959         Lists existing workflows.
6960        '''
6961        req = WorkflowListRequest()
6962        req.meta.CopyFrom(ListRequestMetadata())
6963        if self.parent.page_limit > 0:
6964            req.meta.limit = self.parent.page_limit
6965        if self.parent.snapshot_datetime is not None:
6966            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6967
6968        req.filter = plumbing.quote_filter_args(filter, *args)
6969
6970        def generator(svc, req):
6971            tries = 0
6972            while True:
6973                try:
6974                    plumbing_response = svc.stub.List(
6975                        req,
6976                        metadata=svc.parent.get_metadata(
6977                            'Workflows.List', req),
6978                        timeout=timeout)
6979                except Exception as e:
6980                    if self.parent.shouldRetry(tries, e):
6981                        tries += 1
6982                        self.parent.jitterSleep(tries)
6983                        continue
6984                    raise plumbing.convert_error_to_porcelain(e) from e
6985                tries = 0
6986                for plumbing_item in plumbing_response.workflows:
6987                    yield plumbing.convert_workflow_to_porcelain(plumbing_item)
6988                if plumbing_response.meta.next_cursor == '':
6989                    break
6990                req.meta.cursor = plumbing_response.meta.next_cursor
6991
6992        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)
6825    def __init__(self, channel, client):
6826        self.parent = client
6827        self.stub = WorkflowsStub(channel)
def create(self, workflow, timeout=None)
6829    def create(self, workflow, timeout=None):
6830        '''
6831         Create creates a new workflow and requires a name for the workflow.
6832        '''
6833        req = WorkflowCreateRequest()
6834
6835        if workflow is not None:
6836            req.workflow.CopyFrom(
6837                plumbing.convert_workflow_to_plumbing(workflow))
6838        tries = 0
6839        plumbing_response = None
6840        while True:
6841            try:
6842                plumbing_response = self.stub.Create(
6843                    req,
6844                    metadata=self.parent.get_metadata('Workflows.Create', req),
6845                    timeout=timeout)
6846            except Exception as e:
6847                if self.parent.shouldRetry(tries, e):
6848                    tries += 1
6849                    self.parent.jitterSleep(tries)
6850                    continue
6851                raise plumbing.convert_error_to_porcelain(e) from e
6852            break
6853
6854        resp = models.WorkflowCreateResponse()
6855        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6856            plumbing_response.rate_limit)
6857        resp.workflow = plumbing.convert_workflow_to_porcelain(
6858            plumbing_response.workflow)
6859        return resp

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

def get(self, id, timeout=None)
6861    def get(self, id, timeout=None):
6862        '''
6863         Get reads one workflow by ID.
6864        '''
6865        req = WorkflowGetRequest()
6866        if self.parent.snapshot_datetime is not None:
6867            req.meta.CopyFrom(GetRequestMetadata())
6868            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6869
6870        req.id = (id)
6871        tries = 0
6872        plumbing_response = None
6873        while True:
6874            try:
6875                plumbing_response = self.stub.Get(
6876                    req,
6877                    metadata=self.parent.get_metadata('Workflows.Get', req),
6878                    timeout=timeout)
6879            except Exception as e:
6880                if self.parent.shouldRetry(tries, e):
6881                    tries += 1
6882                    self.parent.jitterSleep(tries)
6883                    continue
6884                raise plumbing.convert_error_to_porcelain(e) from e
6885            break
6886
6887        resp = models.WorkflowGetResponse()
6888        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
6889            plumbing_response.meta)
6890        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6891            plumbing_response.rate_limit)
6892        resp.workflow = plumbing.convert_workflow_to_porcelain(
6893            plumbing_response.workflow)
6894        return resp

Get reads one workflow by ID.

def delete(self, id, timeout=None)
6896    def delete(self, id, timeout=None):
6897        '''
6898         Delete deletes an existing workflow.
6899        '''
6900        req = WorkflowDeleteRequest()
6901
6902        req.id = (id)
6903        tries = 0
6904        plumbing_response = None
6905        while True:
6906            try:
6907                plumbing_response = self.stub.Delete(
6908                    req,
6909                    metadata=self.parent.get_metadata('Workflows.Delete', req),
6910                    timeout=timeout)
6911            except Exception as e:
6912                if self.parent.shouldRetry(tries, e):
6913                    tries += 1
6914                    self.parent.jitterSleep(tries)
6915                    continue
6916                raise plumbing.convert_error_to_porcelain(e) from e
6917            break
6918
6919        resp = models.WorkflowDeleteResponse()
6920        resp.id = (plumbing_response.id)
6921        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6922            plumbing_response.rate_limit)
6923        return resp

Delete deletes an existing workflow.

def update(self, workflow, timeout=None)
6925    def update(self, workflow, timeout=None):
6926        '''
6927         Update updates an existing workflow.
6928        '''
6929        req = WorkflowUpdateRequest()
6930
6931        if workflow is not None:
6932            req.workflow.CopyFrom(
6933                plumbing.convert_workflow_to_plumbing(workflow))
6934        tries = 0
6935        plumbing_response = None
6936        while True:
6937            try:
6938                plumbing_response = self.stub.Update(
6939                    req,
6940                    metadata=self.parent.get_metadata('Workflows.Update', req),
6941                    timeout=timeout)
6942            except Exception as e:
6943                if self.parent.shouldRetry(tries, e):
6944                    tries += 1
6945                    self.parent.jitterSleep(tries)
6946                    continue
6947                raise plumbing.convert_error_to_porcelain(e) from e
6948            break
6949
6950        resp = models.WorkflowUpdateResponse()
6951        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6952            plumbing_response.rate_limit)
6953        resp.workflow = plumbing.convert_workflow_to_porcelain(
6954            plumbing_response.workflow)
6955        return resp

Update updates an existing workflow.

def list(self, filter, *args, timeout=None)
6957    def list(self, filter, *args, timeout=None):
6958        '''
6959         Lists existing workflows.
6960        '''
6961        req = WorkflowListRequest()
6962        req.meta.CopyFrom(ListRequestMetadata())
6963        if self.parent.page_limit > 0:
6964            req.meta.limit = self.parent.page_limit
6965        if self.parent.snapshot_datetime is not None:
6966            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6967
6968        req.filter = plumbing.quote_filter_args(filter, *args)
6969
6970        def generator(svc, req):
6971            tries = 0
6972            while True:
6973                try:
6974                    plumbing_response = svc.stub.List(
6975                        req,
6976                        metadata=svc.parent.get_metadata(
6977                            'Workflows.List', req),
6978                        timeout=timeout)
6979                except Exception as e:
6980                    if self.parent.shouldRetry(tries, e):
6981                        tries += 1
6982                        self.parent.jitterSleep(tries)
6983                        continue
6984                    raise plumbing.convert_error_to_porcelain(e) from e
6985                tries = 0
6986                for plumbing_item in plumbing_response.workflows:
6987                    yield plumbing.convert_workflow_to_porcelain(plumbing_item)
6988                if plumbing_response.meta.next_cursor == '':
6989                    break
6990                req.meta.cursor = plumbing_response.meta.next_cursor
6991
6992        return generator(self, req)

Lists existing workflows.

class SnapshotWorkflows:
6995class SnapshotWorkflows:
6996    '''
6997    SnapshotWorkflows exposes the read only methods of the Workflows
6998    service for historical queries.
6999    '''
7000    def __init__(self, workflows):
7001        self.workflows = workflows
7002
7003    def get(self, id, timeout=None):
7004        '''
7005         Get reads one workflow by ID.
7006        '''
7007        return self.workflows.get(id, timeout=timeout)
7008
7009    def list(self, filter, *args, timeout=None):
7010        '''
7011         Lists existing workflows.
7012        '''
7013        return self.workflows.list(filter, *args, timeout=timeout)

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

SnapshotWorkflows(workflows)
7000    def __init__(self, workflows):
7001        self.workflows = workflows
def get(self, id, timeout=None)
7003    def get(self, id, timeout=None):
7004        '''
7005         Get reads one workflow by ID.
7006        '''
7007        return self.workflows.get(id, timeout=timeout)

Get reads one workflow by ID.

def list(self, filter, *args, timeout=None)
7009    def list(self, filter, *args, timeout=None):
7010        '''
7011         Lists existing workflows.
7012        '''
7013        return self.workflows.list(filter, *args, timeout=timeout)

Lists existing workflows.

class WorkflowsHistory:
7016class WorkflowsHistory:
7017    '''
7018     WorkflowsHistory provides records of all changes to the state of a Workflow.
7019    See `strongdm.models.WorkflowHistory`.
7020    '''
7021    def __init__(self, channel, client):
7022        self.parent = client
7023        self.stub = WorkflowsHistoryStub(channel)
7024
7025    def list(self, filter, *args, timeout=None):
7026        '''
7027         List gets a list of WorkflowHistory records matching a given set of criteria.
7028        '''
7029        req = WorkflowHistoryListRequest()
7030        req.meta.CopyFrom(ListRequestMetadata())
7031        if self.parent.page_limit > 0:
7032            req.meta.limit = self.parent.page_limit
7033        if self.parent.snapshot_datetime is not None:
7034            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
7035
7036        req.filter = plumbing.quote_filter_args(filter, *args)
7037
7038        def generator(svc, req):
7039            tries = 0
7040            while True:
7041                try:
7042                    plumbing_response = svc.stub.List(
7043                        req,
7044                        metadata=svc.parent.get_metadata(
7045                            'WorkflowsHistory.List', req),
7046                        timeout=timeout)
7047                except Exception as e:
7048                    if self.parent.shouldRetry(tries, e):
7049                        tries += 1
7050                        self.parent.jitterSleep(tries)
7051                        continue
7052                    raise plumbing.convert_error_to_porcelain(e) from e
7053                tries = 0
7054                for plumbing_item in plumbing_response.history:
7055                    yield plumbing.convert_workflow_history_to_porcelain(
7056                        plumbing_item)
7057                if plumbing_response.meta.next_cursor == '':
7058                    break
7059                req.meta.cursor = plumbing_response.meta.next_cursor
7060
7061        return generator(self, req)

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

WorkflowsHistory(channel, client)
7021    def __init__(self, channel, client):
7022        self.parent = client
7023        self.stub = WorkflowsHistoryStub(channel)
def list(self, filter, *args, timeout=None)
7025    def list(self, filter, *args, timeout=None):
7026        '''
7027         List gets a list of WorkflowHistory records matching a given set of criteria.
7028        '''
7029        req = WorkflowHistoryListRequest()
7030        req.meta.CopyFrom(ListRequestMetadata())
7031        if self.parent.page_limit > 0:
7032            req.meta.limit = self.parent.page_limit
7033        if self.parent.snapshot_datetime is not None:
7034            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
7035
7036        req.filter = plumbing.quote_filter_args(filter, *args)
7037
7038        def generator(svc, req):
7039            tries = 0
7040            while True:
7041                try:
7042                    plumbing_response = svc.stub.List(
7043                        req,
7044                        metadata=svc.parent.get_metadata(
7045                            'WorkflowsHistory.List', req),
7046                        timeout=timeout)
7047                except Exception as e:
7048                    if self.parent.shouldRetry(tries, e):
7049                        tries += 1
7050                        self.parent.jitterSleep(tries)
7051                        continue
7052                    raise plumbing.convert_error_to_porcelain(e) from e
7053                tries = 0
7054                for plumbing_item in plumbing_response.history:
7055                    yield plumbing.convert_workflow_history_to_porcelain(
7056                        plumbing_item)
7057                if plumbing_response.meta.next_cursor == '':
7058                    break
7059                req.meta.cursor = plumbing_response.meta.next_cursor
7060
7061        return generator(self, req)

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