strongdm.svc

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

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

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

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

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

Lists existing access requests.

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

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

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

Lists existing access requests.

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

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

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

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

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

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

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

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

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

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

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

Create registers a new AccountAttachment.

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

Get reads one AccountAttachment by ID.

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

Delete removes a AccountAttachment by ID.

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

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

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

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

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

Get reads one AccountAttachment by ID.

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

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

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

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

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

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

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

AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource. See strongdm.models.AccountGrant.

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

Create registers a new AccountGrant.

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

Get reads one AccountGrant by ID.

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

Delete removes a AccountGrant by ID.

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

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

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

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

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

Get reads one AccountGrant by ID.

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

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

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

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

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

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

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

AccountPermissions records the granular permissions accounts have, allowing them to execute relevant commands via StrongDM's APIs. See strongdm.models.AccountPermission.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Create registers a new Account.

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

Get reads one Account by ID.

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

Update replaces all the fields of an Account by ID.

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

Delete removes an Account by ID.

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

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

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

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

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

Get reads one Account by ID.

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

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

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

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

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

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

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

An Activity is a record of an action taken against a strongDM deployment, e.g. a user creation, resource deletion, sso configuration change, etc. The Activities service is read-only. See strongdm.models.Activity.

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

Get reads one Activity by ID.

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

List gets a list of Activities matching a given set of criteria. The 'before' and 'after' filters can be used to control the time range of the output activities. If not provided, one week of back of activities will be returned.

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

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

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

Create creates a new approval workflow approver.

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

Get reads one approval workflow approver by ID.

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

Delete deletes an existing approval workflow approver.

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

Lists existing approval workflow approvers.

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

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

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

Get reads one approval workflow approver by ID.

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

Lists existing approval workflow approvers.

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

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

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

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

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

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

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

Create creates a new approval workflow step.

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

Get reads one approval workflow step by ID.

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

Delete deletes an existing approval workflow step.

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

Lists existing approval workflow steps.

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

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

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

Get reads one approval workflow step by ID.

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

Lists existing approval workflow steps.

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

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

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

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

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

ApprovalWorkflows are the mechanism by which requests for access can be viewed by authorized approvers and be approved or denied. See strongdm.models.ApprovalWorkflow.

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

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

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

Get reads one approval workflow by ID.

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

Delete deletes an existing approval workflow.

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

Update updates an existing approval workflow.

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

Lists existing approval workflows.

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

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

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

Get reads one approval workflow by ID.

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

Lists existing approval workflows.

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

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

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

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

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

ControlPanel contains all administrative controls.

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

GetSSHCAPublicKey retrieves the SSH CA public key.

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

GetRDPCAPublicKey retrieves the RDP CA public key.

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

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

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

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

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

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

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

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

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

Create registers a new IdentityAlias.

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

Get reads one IdentityAlias by ID.

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

Update replaces all the fields of a IdentityAlias by ID.

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

Delete removes a IdentityAlias by ID.

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

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

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

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

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

Get reads one IdentityAlias by ID.

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

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

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

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

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

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

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

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

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

Create registers a new IdentitySet.

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

Get reads one IdentitySet by ID.

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

Update replaces all the fields of a IdentitySet by ID.

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

Delete removes a IdentitySet by ID.

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

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

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

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

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

Get reads one IdentitySet by ID.

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

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

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

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

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

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

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

Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:

  • Gateways are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
  • Relays are used to extend the strongDM network into segmented subnets. They provide access to databases and servers but do not listen for incoming connections. See: strongdm.models.Gateway strongdm.models.ProxyCluster strongdm.models.Relay
Nodes(channel, client)
2643    def __init__(self, channel, client):
2644        self.parent = client
2645        self.stub = NodesStub(channel)
def create(self, node, timeout=None)
2647    def create(self, node, timeout=None):
2648        '''
2649         Create registers a new Node.
2650        '''
2651        req = NodeCreateRequest()
2652
2653        if node is not None:
2654            req.node.CopyFrom(plumbing.convert_node_to_plumbing(node))
2655        tries = 0
2656        plumbing_response = None
2657        while True:
2658            try:
2659                plumbing_response = self.stub.Create(
2660                    req,
2661                    metadata=self.parent.get_metadata('Nodes.Create', req),
2662                    timeout=timeout)
2663            except Exception as e:
2664                if self.parent.shouldRetry(tries, e):
2665                    tries += 1
2666                    self.parent.jitterSleep(tries)
2667                    continue
2668                raise plumbing.convert_error_to_porcelain(e) from e
2669            break
2670
2671        resp = models.NodeCreateResponse()
2672        resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
2673            plumbing_response.meta)
2674        resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
2675        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
2676            plumbing_response.rate_limit)
2677        resp.token = (plumbing_response.token)
2678        return resp

Create registers a new Node.

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

Get reads one Node by ID.

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

Update replaces all the fields of a Node by ID.

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

Delete removes a Node by ID.

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

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

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

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

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

Get reads one Node by ID.

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

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

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

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

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

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

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

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

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

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

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

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

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

Create attaches a Node to a PeeringGroup

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

Delete detaches a Node to a PeeringGroup.

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

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

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

List gets a list of peering group node attachments.

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

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

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

Create links two peering groups.

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

Delete unlinks two peering groups.

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

Get reads the information of one peering group link.

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

List gets a list of peering group links.

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

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

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

Create attaches a Resource to a PeeringGroup

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

Delete detaches a Resource to a PeeringGroup

def get(self, id, timeout=None)
3308    def get(self, id, timeout=None):
3309        '''
3310         Get reads the information of one peering group to resource attachment.
3311        '''
3312        req = PeeringGroupResourceGetRequest()
3313        if self.parent.snapshot_datetime is not None:
3314            req.meta.CopyFrom(GetRequestMetadata())
3315            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
3316
3317        req.id = (id)
3318        tries = 0
3319        plumbing_response = None
3320        while True:
3321            try:
3322                plumbing_response = self.stub.Get(
3323                    req,
3324                    metadata=self.parent.get_metadata(
3325                        'PeeringGroupResources.Get', req),
3326                    timeout=timeout)
3327            except Exception as e:
3328                if self.parent.shouldRetry(tries, e):
3329                    tries += 1
3330                    self.parent.jitterSleep(tries)
3331                    continue
3332                raise plumbing.convert_error_to_porcelain(e) from e
3333            break
3334
3335        resp = models.PeeringGroupResourceGetResponse()
3336        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
3337            plumbing_response.meta)
3338        resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
3339            plumbing_response.peering_group_resource)
3340        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
3341            plumbing_response.rate_limit)
3342        return resp

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

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

List gets a list of peering group resource attachments.

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

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

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

Create registers a new PeeringGroup.

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

Delete removes a PeeringGroup by ID.

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

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

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

List gets a list of Peering Groups.

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

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

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

Create creates a new Policy.

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

Delete removes a Policy by ID.

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

Update replaces all the fields of a Policy by ID.

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

Get reads one Policy by ID.

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

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

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

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

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

Get reads one Policy by ID.

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

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

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

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

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

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

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

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

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

Create registers a new ProxyClusterKey.

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

Get reads one ProxyClusterKey by ID.

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

Delete removes a ProxyClusterKey by ID.

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

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

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

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

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

Get reads one ProxyClusterKey by ID.

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

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

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

A Query is a record of a single client request to a resource, such as a SQL query. Long-running SSH, RDP, or Kubernetes interactive sessions also count as queries. The Queries service is read-only. See strongdm.models.Query.

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

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

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

RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource. See strongdm.models.RemoteIdentity.

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

Create registers a new RemoteIdentity.

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

Get reads one RemoteIdentity by ID.

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

Update replaces all the fields of a RemoteIdentity by ID.

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

Delete removes a RemoteIdentity by ID.

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

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

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

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

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

Get reads one RemoteIdentity by ID.

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

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

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

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

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

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

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

A RemoteIdentityGroup is a named grouping of Remote Identities for Accounts. An Account's relationship to a RemoteIdentityGroup is defined via RemoteIdentity objects. See strongdm.models.RemoteIdentityGroup.

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

Get reads one RemoteIdentityGroup by ID.

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

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

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

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

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

Get reads one RemoteIdentityGroup by ID.

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

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

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

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

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

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

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

A Replay captures the data transferred over a long-running SSH, RDP, or Kubernetes interactive session (otherwise referred to as a query). The Replays service is read-only. See strongdm.models.ReplayChunk.

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

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

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

Resources are databases, servers, clusters, websites, or clouds that strongDM delegates access to. See: strongdm.models.AKS strongdm.models.AKSBasicAuth strongdm.models.AKSServiceAccount strongdm.models.AKSServiceAccountUserImpersonation strongdm.models.AKSUserImpersonation strongdm.models.AmazonEKS strongdm.models.AmazonEKSInstanceProfile strongdm.models.AmazonEKSInstanceProfileUserImpersonation strongdm.models.AmazonEKSUserImpersonation strongdm.models.AmazonES strongdm.models.AmazonMQAMQP091 strongdm.models.Athena strongdm.models.AuroraMysql strongdm.models.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.DocumentDBReplicaSet strongdm.models.Druid strongdm.models.DynamoDB strongdm.models.DynamoDBIAM strongdm.models.Elastic strongdm.models.ElasticacheRedis strongdm.models.GCP strongdm.models.GCPConsole strongdm.models.GCPWIF strongdm.models.GoogleGKE strongdm.models.GoogleGKEUserImpersonation strongdm.models.Greenplum strongdm.models.HTTPAuth strongdm.models.HTTPBasicAuth strongdm.models.HTTPNoAuth strongdm.models.Kubernetes strongdm.models.KubernetesBasicAuth strongdm.models.KubernetesServiceAccount strongdm.models.KubernetesServiceAccountUserImpersonation strongdm.models.KubernetesUserImpersonation strongdm.models.Maria strongdm.models.Memcached strongdm.models.Memsql strongdm.models.MongoHost strongdm.models.MongoLegacyHost strongdm.models.MongoLegacyReplicaset strongdm.models.MongoReplicaSet strongdm.models.MongoShardedCluster strongdm.models.MTLSMysql strongdm.models.MTLSPostgres strongdm.models.Mysql strongdm.models.Neptune strongdm.models.NeptuneIAM strongdm.models.Oracle strongdm.models.Postgres strongdm.models.Presto strongdm.models.RabbitMQAMQP091 strongdm.models.RawTCP strongdm.models.RDP strongdm.models.RDPCert strongdm.models.RDSPostgresIAM strongdm.models.Redis strongdm.models.Redshift strongdm.models.SingleStore strongdm.models.Snowflake strongdm.models.Snowsight strongdm.models.SQLServer strongdm.models.SQLServerAzureAD strongdm.models.SQLServerKerberosAD strongdm.models.SSH strongdm.models.SSHCert strongdm.models.SSHCustomerKey strongdm.models.SSHPassword strongdm.models.Sybase strongdm.models.SybaseIQ strongdm.models.Teradata strongdm.models.Trino

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

EnumerateTags gets a list of the filter matching tags.

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

Create registers a new Resource.

def get(self, id, timeout=None)
4629    def get(self, id, timeout=None):
4630        '''
4631         Get reads one Resource by ID.
4632        '''
4633        req = ResourceGetRequest()
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('Resources.Get', req),
4646                    timeout=timeout)
4647            except Exception as e:
4648                if self.parent.shouldRetry(tries, e):
4649                    tries += 1
4650                    self.parent.jitterSleep(tries)
4651                    continue
4652                raise plumbing.convert_error_to_porcelain(e) from e
4653            break
4654
4655        resp = models.ResourceGetResponse()
4656        resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
4657            plumbing_response.meta)
4658        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
4659            plumbing_response.rate_limit)
4660        resp.resource = plumbing.convert_resource_to_porcelain(
4661            plumbing_response.resource)
4662        return resp

Get reads one Resource by ID.

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

Update replaces all the fields of a Resource by ID.

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

Delete removes a Resource by ID.

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

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

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

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

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

Get reads one Resource by ID.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Create registers a new Role.

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

Get reads one Role by ID.

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

Update replaces all the fields of a Role by ID.

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

Delete removes a Role by ID.

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

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

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

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

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

Get reads one Role by ID.

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

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

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

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

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

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

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

Get reads one SecretStore by ID.

def update(self, secret_store, timeout=None)
5324    def update(self, secret_store, timeout=None):
5325        '''
5326         Update replaces all the fields of a SecretStore by ID.
5327        '''
5328        req = SecretStoreUpdateRequest()
5329
5330        if secret_store is not None:
5331            req.secret_store.CopyFrom(
5332                plumbing.convert_secret_store_to_plumbing(secret_store))
5333        tries = 0
5334        plumbing_response = None
5335        while True:
5336            try:
5337                plumbing_response = self.stub.Update(
5338                    req,
5339                    metadata=self.parent.get_metadata('SecretStores.Update',
5340                                                      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            break
5349
5350        resp = models.SecretStoreUpdateResponse()
5351        resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
5352            plumbing_response.meta)
5353        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5354            plumbing_response.rate_limit)
5355        resp.secret_store = plumbing.convert_secret_store_to_porcelain(
5356            plumbing_response.secret_store)
5357        return resp

Update replaces all the fields of a SecretStore by ID.

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

Delete removes a SecretStore by ID.

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

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

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

Get reads one SecretStore by ID.

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

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

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

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

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

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

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

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

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

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

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

Create creates a new workflow approver

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

Get reads one workflow approver by ID.

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

Delete deletes a workflow approver

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

Lists existing workflow approvers.

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

Get reads one workflow approver by ID.

def list(self, filter, *args, timeout=None)
5738    def list(self, filter, *args, timeout=None):
5739        '''
5740         Lists existing workflow approvers.
5741        '''
5742        return self.workflow_approvers.list(filter, *args, timeout=timeout)

Lists existing workflow approvers.

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

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

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

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

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

Lists existing workflow assignments.

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

Lists existing workflow assignments.

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

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

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

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

class WorkflowRoles:
5905class WorkflowRoles:
5906    '''
5907     WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of
5908     to request access to a resource via the workflow.
5909    See `strongdm.models.WorkflowRole`.
5910    '''
5911    def __init__(self, channel, client):
5912        self.parent = client
5913        self.stub = WorkflowRolesStub(channel)
5914
5915    def create(self, workflow_role, timeout=None):
5916        '''
5917         Create creates a new workflow role
5918        '''
5919        req = WorkflowRolesCreateRequest()
5920
5921        if workflow_role is not None:
5922            req.workflow_role.CopyFrom(
5923                plumbing.convert_workflow_role_to_plumbing(workflow_role))
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('WorkflowRoles.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.WorkflowRolesCreateResponse()
5942        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5943            plumbing_response.rate_limit)
5944        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5945            plumbing_response.workflow_role)
5946        return resp
5947
5948    def get(self, id, timeout=None):
5949        '''
5950         Get reads one workflow role by ID.
5951        '''
5952        req = WorkflowRoleGetRequest()
5953        if self.parent.snapshot_datetime is not None:
5954            req.meta.CopyFrom(GetRequestMetadata())
5955            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5956
5957        req.id = (id)
5958        tries = 0
5959        plumbing_response = None
5960        while True:
5961            try:
5962                plumbing_response = self.stub.Get(
5963                    req,
5964                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
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.WorkflowRoleGetResponse()
5976        resp.meta = plumbing.convert_get_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.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5981            plumbing_response.workflow_role)
5982        return resp
5983
5984    def delete(self, id, timeout=None):
5985        '''
5986         Delete deletes a workflow role
5987        '''
5988        req = WorkflowRolesDeleteRequest()
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('WorkflowRoles.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.WorkflowRolesDeleteResponse()
6009        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6010            plumbing_response.rate_limit)
6011        return resp
6012
6013    def list(self, filter, *args, timeout=None):
6014        '''
6015         Lists existing workflow roles.
6016        '''
6017        req = WorkflowRolesListRequest()
6018        req.meta.CopyFrom(ListRequestMetadata())
6019        if self.parent.page_limit > 0:
6020            req.meta.limit = self.parent.page_limit
6021        if self.parent.snapshot_datetime is not None:
6022            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
6023
6024        req.filter = plumbing.quote_filter_args(filter, *args)
6025
6026        def generator(svc, req):
6027            tries = 0
6028            while True:
6029                try:
6030                    plumbing_response = svc.stub.List(
6031                        req,
6032                        metadata=svc.parent.get_metadata(
6033                            'WorkflowRoles.List', req),
6034                        timeout=timeout)
6035                except Exception as e:
6036                    if self.parent.shouldRetry(tries, e):
6037                        tries += 1
6038                        self.parent.jitterSleep(tries)
6039                        continue
6040                    raise plumbing.convert_error_to_porcelain(e) from e
6041                tries = 0
6042                for plumbing_item in plumbing_response.workflow_role:
6043                    yield plumbing.convert_workflow_role_to_porcelain(
6044                        plumbing_item)
6045                if plumbing_response.meta.next_cursor == '':
6046                    break
6047                req.meta.cursor = plumbing_response.meta.next_cursor
6048
6049        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)
5911    def __init__(self, channel, client):
5912        self.parent = client
5913        self.stub = WorkflowRolesStub(channel)
def create(self, workflow_role, timeout=None)
5915    def create(self, workflow_role, timeout=None):
5916        '''
5917         Create creates a new workflow role
5918        '''
5919        req = WorkflowRolesCreateRequest()
5920
5921        if workflow_role is not None:
5922            req.workflow_role.CopyFrom(
5923                plumbing.convert_workflow_role_to_plumbing(workflow_role))
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('WorkflowRoles.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.WorkflowRolesCreateResponse()
5942        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
5943            plumbing_response.rate_limit)
5944        resp.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5945            plumbing_response.workflow_role)
5946        return resp

Create creates a new workflow role

def get(self, id, timeout=None)
5948    def get(self, id, timeout=None):
5949        '''
5950         Get reads one workflow role by ID.
5951        '''
5952        req = WorkflowRoleGetRequest()
5953        if self.parent.snapshot_datetime is not None:
5954            req.meta.CopyFrom(GetRequestMetadata())
5955            req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
5956
5957        req.id = (id)
5958        tries = 0
5959        plumbing_response = None
5960        while True:
5961            try:
5962                plumbing_response = self.stub.Get(
5963                    req,
5964                    metadata=self.parent.get_metadata('WorkflowRoles.Get',
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.WorkflowRoleGetResponse()
5976        resp.meta = plumbing.convert_get_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.workflow_role = plumbing.convert_workflow_role_to_porcelain(
5981            plumbing_response.workflow_role)
5982        return resp

Get reads one workflow role by ID.

def delete(self, id, timeout=None)
5984    def delete(self, id, timeout=None):
5985        '''
5986         Delete deletes a workflow role
5987        '''
5988        req = WorkflowRolesDeleteRequest()
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('WorkflowRoles.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.WorkflowRolesDeleteResponse()
6009        resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
6010            plumbing_response.rate_limit)
6011        return resp

Delete deletes a workflow role

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

Lists existing workflow roles.

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

Get reads one workflow role by ID.

def list(self, filter, *args, timeout=None)
6066    def list(self, filter, *args, timeout=None):
6067        '''
6068         Lists existing workflow roles.
6069        '''
6070        return self.workflow_roles.list(filter, *args, timeout=timeout)

Lists existing workflow roles.

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

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

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

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

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

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

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

Get reads one workflow by ID.

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

Delete deletes an existing workflow.

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

Update updates an existing workflow.

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

Lists existing workflows.

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

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

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

Get reads one workflow by ID.

def list(self, filter, *args, timeout=None)
6312    def list(self, filter, *args, timeout=None):
6313        '''
6314         Lists existing workflows.
6315        '''
6316        return self.workflows.list(filter, *args, timeout=timeout)

Lists existing workflows.

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

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

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

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