strongdm.svc

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

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

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

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

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

Lists existing access requests.

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

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

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

Lists existing access requests.

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

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

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

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

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

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

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

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

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

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

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

Create registers a new AccountAttachment.

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

Get reads one AccountAttachment by ID.

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

Delete removes a AccountAttachment by ID.

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

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

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

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

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

Get reads one AccountAttachment by ID.

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

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

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

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

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

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

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

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

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

Create registers a new AccountGrant.

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

Get reads one AccountGrant by ID.

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

Delete removes a AccountGrant by ID.

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

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

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

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

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

Get reads one AccountGrant by ID.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Create registers a new Account.

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

Get reads one Account by ID.

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

Update replaces all the fields of an Account by ID.

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

Delete removes an Account by ID.

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

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

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

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

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

Get reads one Account by ID.

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

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

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

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

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

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

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

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

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

Get reads one Activity by ID.

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

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

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

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

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

Create creates a new approval workflow approver.

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

Get reads one approval workflow approver by ID.

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

Delete deletes an existing approval workflow approver.

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

Lists existing approval workflow approvers.

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

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

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

Get reads one approval workflow approver by ID.

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

Lists existing approval workflow approvers.

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

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

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

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

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

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

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

Create creates a new approval workflow step.

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

Get reads one approval workflow step by ID.

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

Delete deletes an existing approval workflow step.

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

Lists existing approval workflow steps.

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

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

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

Get reads one approval workflow step by ID.

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

Lists existing approval workflow steps.

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

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

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

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

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

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

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

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

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

Get reads one approval workflow by ID.

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

Delete deletes an existing approval workflow.

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

Update updates an existing approval workflow.

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

Lists existing approval workflows.

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

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

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

Get reads one approval workflow by ID.

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

Lists existing approval workflows.

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

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

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

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

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

ControlPanel contains all administrative controls.

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

GetSSHCAPublicKey retrieves the SSH CA public key.

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

GetRDPCAPublicKey retrieves the RDP CA public key.

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

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

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

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

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

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

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

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

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

Create registers a new IdentityAlias.

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

Get reads one IdentityAlias by ID.

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

Update replaces all the fields of a IdentityAlias by ID.

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

Delete removes a IdentityAlias by ID.

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

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

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

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

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

Get reads one IdentityAlias by ID.

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

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

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

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

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

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

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

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

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

Create registers a new IdentitySet.

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

Get reads one IdentitySet by ID.

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

Update replaces all the fields of a IdentitySet by ID.

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

Delete removes a IdentitySet by ID.

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

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

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

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

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

Get reads one IdentitySet by ID.

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

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

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

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

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

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

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

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

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

Create registers a new Node.

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

Get reads one Node by ID.

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

Update replaces all the fields of a Node by ID.

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

Delete removes a Node by ID.

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

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

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

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

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

Get reads one Node by ID.

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

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

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

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

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

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

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

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

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

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

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

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

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

Create attaches a Node to a PeeringGroup

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

Delete detaches a Node to a PeeringGroup.

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

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

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

List gets a list of peering group node attachments.

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

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

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

Create links two peering groups.

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

Delete unlinks two peering groups.

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

Get reads the information of one peering group link.

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

List gets a list of peering group links.

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

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

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

Create attaches a Resource to a PeeringGroup

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

Delete detaches a Resource to a PeeringGroup

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

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

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

List gets a list of peering group resource attachments.

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

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

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

Create registers a new PeeringGroup.

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

Delete removes a PeeringGroup by ID.

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

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

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

List gets a list of Peering Groups.

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

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

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

Create creates a new Policy.

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

Delete removes a Policy by ID.

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

Update replaces all the fields of a Policy by ID.

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

Get reads one Policy by ID.

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

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

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

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

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

Get reads one Policy by ID.

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

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

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

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

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

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

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

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

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

Create registers a new ProxyClusterKey.

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

Get reads one ProxyClusterKey by ID.

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

Delete removes a ProxyClusterKey by ID.

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

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

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

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

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

Get reads one ProxyClusterKey by ID.

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

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

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

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

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

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

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

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

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

Create registers a new RemoteIdentity.

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

Get reads one RemoteIdentity by ID.

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

Update replaces all the fields of a RemoteIdentity by ID.

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

Delete removes a RemoteIdentity by ID.

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

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

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

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

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

Get reads one RemoteIdentity by ID.

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

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

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

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

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

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

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

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

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

Get reads one RemoteIdentityGroup by ID.

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

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

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

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

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

Get reads one RemoteIdentityGroup by ID.

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

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

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

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

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

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

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

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

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

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

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

Resources are databases, servers, clusters, websites, or clouds that strongDM delegates access to. See: strongdm.models.AKS strongdm.models.AKSBasicAuth strongdm.models.AKSServiceAccount strongdm.models.AKSServiceAccountUserImpersonation strongdm.models.AKSUserImpersonation strongdm.models.AmazonEKS strongdm.models.AmazonEKSInstanceProfile strongdm.models.AmazonEKSInstanceProfileUserImpersonation strongdm.models.AmazonEKSUserImpersonation strongdm.models.AmazonES strongdm.models.AmazonESIAM strongdm.models.AmazonMQAMQP091 strongdm.models.Athena strongdm.models.AthenaIAM strongdm.models.AuroraMysql strongdm.models.AuroraMysqlIAM strongdm.models.AuroraPostgres strongdm.models.AuroraPostgresIAM strongdm.models.AWS strongdm.models.AWSConsole strongdm.models.AWSConsoleStaticKeyPair strongdm.models.AWSInstanceProfile strongdm.models.Azure strongdm.models.AzureCertificate strongdm.models.AzureMysql strongdm.models.AzurePostgres strongdm.models.AzurePostgresManagedIdentity strongdm.models.BigQuery strongdm.models.Cassandra strongdm.models.Citus strongdm.models.ClickHouseHTTP strongdm.models.ClickHouseMySQL strongdm.models.ClickHouseTCP strongdm.models.Clustrix strongdm.models.Cockroach strongdm.models.CouchbaseDatabase strongdm.models.CouchbaseWebUI strongdm.models.DB2I strongdm.models.DB2LUW strongdm.models.DocumentDBHost strongdm.models.DocumentDBHostIAM strongdm.models.DocumentDBReplicaSet strongdm.models.Druid strongdm.models.DynamoDB strongdm.models.DynamoDBIAM strongdm.models.Elastic strongdm.models.ElasticacheRedis strongdm.models.GCP strongdm.models.GCPConsole strongdm.models.GCPWIF strongdm.models.GoogleGKE strongdm.models.GoogleGKEUserImpersonation strongdm.models.Greenplum strongdm.models.HTTPAuth strongdm.models.HTTPBasicAuth strongdm.models.HTTPNoAuth strongdm.models.Kubernetes strongdm.models.KubernetesBasicAuth strongdm.models.KubernetesPodIdentity strongdm.models.KubernetesServiceAccount strongdm.models.KubernetesServiceAccountUserImpersonation strongdm.models.KubernetesUserImpersonation strongdm.models.Maria strongdm.models.Memcached strongdm.models.Memsql strongdm.models.MongoHost strongdm.models.MongoLegacyHost strongdm.models.MongoLegacyReplicaset strongdm.models.MongoReplicaSet strongdm.models.MongoShardedCluster strongdm.models.MTLSMysql strongdm.models.MTLSPostgres strongdm.models.Mysql strongdm.models.Neptune strongdm.models.NeptuneIAM strongdm.models.Oracle strongdm.models.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.RedshiftIAM strongdm.models.RedshiftServerlessIAM strongdm.models.SingleStore strongdm.models.Snowflake strongdm.models.Snowsight strongdm.models.SQLServer strongdm.models.SQLServerAzureAD strongdm.models.SQLServerKerberosAD strongdm.models.SSH strongdm.models.SSHCert strongdm.models.SSHCustomerKey strongdm.models.SSHPassword strongdm.models.Sybase strongdm.models.SybaseIQ strongdm.models.Teradata strongdm.models.Trino strongdm.models.Vertica

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

EnumerateTags gets a list of the filter matching tags.

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

Create registers a new Resource.

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

Get reads one Resource by ID.

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

Update replaces all the fields of a Resource by ID.

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

Delete removes a Resource by ID.

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

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

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

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

SnapshotResources(resources)
4811    def __init__(self, resources):
4812        self.resources = resources
def get(self, id, timeout=None)
4814    def get(self, id, timeout=None):
4815        '''
4816         Get reads one Resource by ID.
4817        '''
4818        return self.resources.get(id, timeout=timeout)

Get reads one Resource by ID.

def list(self, filter, *args, timeout=None)
4820    def list(self, filter, *args, timeout=None):
4821        '''
4822         List gets a list of Resources matching a given set of criteria.
4823        '''
4824        return self.resources.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Create registers a new Role.

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

Get reads one Role by ID.

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

Update replaces all the fields of a Role by ID.

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

Delete removes a Role by ID.

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

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

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

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

SnapshotRoles(roles)
5168    def __init__(self, roles):
5169        self.roles = roles
def get(self, id, timeout=None)
5171    def get(self, id, timeout=None):
5172        '''
5173         Get reads one Role by ID.
5174        '''
5175        return self.roles.get(id, timeout=timeout)

Get reads one Role by ID.

def list(self, filter, *args, timeout=None)
5177    def list(self, filter, *args, timeout=None):
5178        '''
5179         List gets a list of Roles matching a given set of criteria.
5180        '''
5181        return self.roles.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

Get reads one SecretStore by ID.

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

Update replaces all the fields of a SecretStore by ID.

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

Delete removes a SecretStore by ID.

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

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

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

Get reads one SecretStore by ID.

def list(self, filter, *args, timeout=None)
5450    def list(self, filter, *args, timeout=None):
5451        '''
5452         List gets a list of SecretStores matching a given set of criteria.
5453        '''
5454        return self.secret_stores.list(filter, *args, timeout=timeout)

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

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

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

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

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

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

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

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

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

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

Create creates a new workflow approver

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

Get reads one workflow approver by ID.

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

Delete deletes a workflow approver

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

Lists existing workflow approvers.

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

Get reads one workflow approver by ID.

def list(self, filter, *args, timeout=None)
5745    def list(self, filter, *args, timeout=None):
5746        '''
5747         Lists existing workflow approvers.
5748        '''
5749        return self.workflow_approvers.list(filter, *args, timeout=timeout)

Lists existing workflow approvers.

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

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

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

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

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

Lists existing workflow assignments.

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

Lists existing workflow assignments.

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

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

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

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

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

Create creates a new workflow role

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

Get reads one workflow role by ID.

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

Delete deletes a workflow role

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

Lists existing workflow roles.

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

Get reads one workflow role by ID.

def list(self, filter, *args, timeout=None)
6073    def list(self, filter, *args, timeout=None):
6074        '''
6075         Lists existing workflow roles.
6076        '''
6077        return self.workflow_roles.list(filter, *args, timeout=timeout)

Lists existing workflow roles.

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

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

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

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

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

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

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

Get reads one workflow by ID.

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

Delete deletes an existing workflow.

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

Update updates an existing workflow.

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

Lists existing workflows.

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

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

SnapshotWorkflows(workflows)
6310    def __init__(self, workflows):
6311        self.workflows = workflows
def get(self, id, timeout=None)
6313    def get(self, id, timeout=None):
6314        '''
6315         Get reads one workflow by ID.
6316        '''
6317        return self.workflows.get(id, timeout=timeout)

Get reads one workflow by ID.

def list(self, filter, *args, timeout=None)
6319    def list(self, filter, *args, timeout=None):
6320        '''
6321         Lists existing workflows.
6322        '''
6323        return self.workflows.list(filter, *args, timeout=timeout)

Lists existing workflows.

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

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

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

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