strongdm 7.1.0__zip → 12.2.0__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {strongdm-7.1.0 → strongdm-12.2.0}/PKG-INFO +2 -2
- {strongdm-7.1.0 → strongdm-12.2.0}/setup.py +2 -2
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/access_request_events_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/access_requests_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/access_requests_pb2.py +45 -16
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_grants_pb2.py +6 -4
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/accounts_pb2.py +47 -34
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/accounts_pb2_grpc.py +3 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_approvers_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_approvers_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_steps_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_steps_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflows_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflows_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/client.py +108 -13
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/constants.py +86 -12
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/drivers_pb2.py +745 -227
- strongdm-12.2.0/strongdm/health_checks_pb2.py +107 -0
- strongdm-12.2.0/strongdm/health_checks_pb2_grpc.py +87 -0
- strongdm-12.2.0/strongdm/identity_aliases_history_pb2.py +100 -0
- strongdm-12.2.0/strongdm/identity_aliases_history_pb2_grpc.py +84 -0
- strongdm-12.2.0/strongdm/identity_aliases_pb2.py +220 -0
- strongdm-12.2.0/strongdm/identity_aliases_pb2_grpc.py +223 -0
- strongdm-12.2.0/strongdm/identity_sets_history_pb2.py +100 -0
- strongdm-12.2.0/strongdm/identity_sets_history_pb2_grpc.py +84 -0
- strongdm-12.2.0/strongdm/identity_sets_pb2.py +216 -0
- strongdm-12.2.0/strongdm/identity_sets_pb2_grpc.py +223 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/models.py +7628 -3440
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/nodes_pb2.py +41 -15
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/options_pb2.py +24 -24
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/organization_history_pb2.py +13 -5
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_group_nodes_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_group_peers_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_group_resources_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_groups_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/plumbing.py +3138 -1165
- strongdm-12.2.0/strongdm/policies_history_pb2.py +100 -0
- strongdm-12.2.0/strongdm/policies_history_pb2_grpc.py +84 -0
- strongdm-12.2.0/strongdm/policies_pb2.py +216 -0
- strongdm-12.2.0/strongdm/policies_pb2_grpc.py +223 -0
- strongdm-12.2.0/strongdm/proxy_cluster_keys_pb2.py +191 -0
- strongdm-12.2.0/strongdm/proxy_cluster_keys_pb2_grpc.py +192 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/queries_pb2.py +17 -11
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identities_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identities_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identity_groups_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identity_groups_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/replays_pb2.py +8 -6
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/secret_store_types_pb2.py +164 -40
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/spec_pb2.py +12 -8
- strongdm-12.2.0/strongdm/spec_pb2_grpc.py +18 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/svc.py +1345 -339
- strongdm-12.2.0/strongdm/tags_pb2_grpc.py +18 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_approvers_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_approvers_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_assignments_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_assignments_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_roles_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_roles_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflows_history_pb2.py +3 -3
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflows_pb2.py +31 -26
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm.egg-info/PKG-INFO +2 -2
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm.egg-info/SOURCES.txt +18 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/LICENSE +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/README.md +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/setup.cfg +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/__init__.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/access_request_events_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/access_requests_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/access_requests_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_attachments_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_attachments_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_attachments_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_attachments_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_grants_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_grants_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_grants_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_permissions_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_permissions_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_resources_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_resources_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_resources_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/account_resources_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/accounts_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/accounts_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/activities_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/activities_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_approvers_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_approvers_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_steps_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflow_steps_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflows_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/approval_workflows_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/control_panel_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/control_panel_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/drivers_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/errors.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/nodes_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/nodes_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/nodes_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/options_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/organization_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_group_nodes_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_group_peers_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_group_resources_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/peering_groups_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/queries_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identities_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identities_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identity_groups_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/remote_identity_groups_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/replays_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/resources_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/resources_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/resources_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/resources_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/role_resources_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/role_resources_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/role_resources_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/role_resources_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/roles_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/roles_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/roles_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/roles_pb2_grpc.py +0 -0
- /strongdm-7.1.0/strongdm/secret_store_types_pb2_grpc.py → /strongdm-12.2.0/strongdm/secret_engine_policy_pb2_grpc.py +0 -0
- /strongdm-7.1.0/strongdm/spec_pb2_grpc.py → /strongdm-12.2.0/strongdm/secret_engine_types_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/secret_store_healths_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/secret_store_healths_pb2_grpc.py +0 -0
- /strongdm-7.1.0/strongdm/tags_pb2_grpc.py → /strongdm-12.2.0/strongdm/secret_store_types_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/secret_stores_history_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/secret_stores_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/secret_stores_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/secret_stores_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/tags_pb2.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_approvers_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_approvers_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_assignments_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_assignments_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_roles_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflow_roles_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflows_history_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm/workflows_pb2_grpc.py +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm.egg-info/dependency_links.txt +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm.egg-info/requires.txt +0 -0
- {strongdm-7.1.0 → strongdm-12.2.0}/strongdm.egg-info/top_level.txt +0 -0
@@ -66,6 +66,16 @@ from .control_panel_pb2 import *
|
|
66
66
|
from .control_panel_pb2_grpc import *
|
67
67
|
from .drivers_pb2 import *
|
68
68
|
from .drivers_pb2_grpc import *
|
69
|
+
from .health_checks_pb2 import *
|
70
|
+
from .health_checks_pb2_grpc import *
|
71
|
+
from .identity_aliases_pb2 import *
|
72
|
+
from .identity_aliases_pb2_grpc import *
|
73
|
+
from .identity_aliases_history_pb2 import *
|
74
|
+
from .identity_aliases_history_pb2_grpc import *
|
75
|
+
from .identity_sets_pb2 import *
|
76
|
+
from .identity_sets_pb2_grpc import *
|
77
|
+
from .identity_sets_history_pb2 import *
|
78
|
+
from .identity_sets_history_pb2_grpc import *
|
69
79
|
from .nodes_pb2 import *
|
70
80
|
from .nodes_pb2_grpc import *
|
71
81
|
from .nodes_history_pb2 import *
|
@@ -80,6 +90,12 @@ from .peering_group_resources_pb2 import *
|
|
80
90
|
from .peering_group_resources_pb2_grpc import *
|
81
91
|
from .peering_groups_pb2 import *
|
82
92
|
from .peering_groups_pb2_grpc import *
|
93
|
+
from .policies_pb2 import *
|
94
|
+
from .policies_pb2_grpc import *
|
95
|
+
from .policies_history_pb2 import *
|
96
|
+
from .policies_history_pb2_grpc import *
|
97
|
+
from .proxy_cluster_keys_pb2 import *
|
98
|
+
from .proxy_cluster_keys_pb2_grpc import *
|
83
99
|
from .queries_pb2 import *
|
84
100
|
from .queries_pb2_grpc import *
|
85
101
|
from .remote_identities_pb2 import *
|
@@ -104,12 +120,12 @@ from .roles_pb2 import *
|
|
104
120
|
from .roles_pb2_grpc import *
|
105
121
|
from .roles_history_pb2 import *
|
106
122
|
from .roles_history_pb2_grpc import *
|
107
|
-
from .secret_store_healths_pb2 import *
|
108
|
-
from .secret_store_healths_pb2_grpc import *
|
109
123
|
from .secret_store_types_pb2 import *
|
110
124
|
from .secret_store_types_pb2_grpc import *
|
111
125
|
from .secret_stores_pb2 import *
|
112
126
|
from .secret_stores_pb2_grpc import *
|
127
|
+
from .secret_store_healths_pb2 import *
|
128
|
+
from .secret_store_healths_pb2_grpc import *
|
113
129
|
from .secret_stores_history_pb2 import *
|
114
130
|
from .secret_stores_history_pb2_grpc import *
|
115
131
|
from .workflow_approvers_pb2 import *
|
@@ -925,8 +941,10 @@ class Accounts:
|
|
925
941
|
Accounts are users that have access to strongDM. There are two types of accounts:
|
926
942
|
1. **Users:** humans who are authenticated through username and password or SSO.
|
927
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.
|
928
945
|
See:
|
929
946
|
`strongdm.models.Service`
|
947
|
+
`strongdm.models.Token`
|
930
948
|
`strongdm.models.User`
|
931
949
|
'''
|
932
950
|
def __init__(self, channel, client):
|
@@ -958,12 +976,14 @@ class Accounts:
|
|
958
976
|
break
|
959
977
|
|
960
978
|
resp = models.AccountCreateResponse()
|
979
|
+
resp.access_key = (plumbing_response.access_key)
|
961
980
|
resp.account = plumbing.convert_account_to_porcelain(
|
962
981
|
plumbing_response.account)
|
963
982
|
resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
|
964
983
|
plumbing_response.meta)
|
965
984
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
966
985
|
plumbing_response.rate_limit)
|
986
|
+
resp.secret_key = (plumbing_response.secret_key)
|
967
987
|
resp.token = (plumbing_response.token)
|
968
988
|
return resp
|
969
989
|
|
@@ -2051,34 +2071,82 @@ class ControlPanel:
|
|
2051
2071
|
return resp
|
2052
2072
|
|
2053
2073
|
|
2054
|
-
class
|
2074
|
+
class HealthChecks:
|
2055
2075
|
'''
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
See:
|
2060
|
-
`strongdm.models.Gateway`
|
2061
|
-
`strongdm.models.Relay`
|
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`.
|
2062
2079
|
'''
|
2063
2080
|
def __init__(self, channel, client):
|
2064
2081
|
self.parent = client
|
2065
|
-
self.stub =
|
2082
|
+
self.stub = HealthChecksStub(channel)
|
2066
2083
|
|
2067
|
-
def
|
2084
|
+
def list(self, filter, *args, timeout=None):
|
2068
2085
|
'''
|
2069
|
-
|
2086
|
+
List gets a list of Healthchecks matching a given set of criteria.
|
2070
2087
|
'''
|
2071
|
-
req =
|
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)
|
2072
2094
|
|
2073
|
-
|
2074
|
-
|
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
|
+
|
2123
|
+
class 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))
|
2075
2142
|
tries = 0
|
2076
2143
|
plumbing_response = None
|
2077
2144
|
while True:
|
2078
2145
|
try:
|
2079
2146
|
plumbing_response = self.stub.Create(
|
2080
2147
|
req,
|
2081
|
-
metadata=self.parent.get_metadata('
|
2148
|
+
metadata=self.parent.get_metadata('IdentityAliases.Create',
|
2149
|
+
req),
|
2082
2150
|
timeout=timeout)
|
2083
2151
|
except Exception as e:
|
2084
2152
|
if self.parent.shouldRetry(tries, e):
|
@@ -2088,20 +2156,20 @@ class Nodes:
|
|
2088
2156
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2089
2157
|
break
|
2090
2158
|
|
2091
|
-
resp = models.
|
2159
|
+
resp = models.IdentityAliasCreateResponse()
|
2160
|
+
resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
|
2161
|
+
plumbing_response.identity_alias)
|
2092
2162
|
resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
|
2093
2163
|
plumbing_response.meta)
|
2094
|
-
resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
|
2095
2164
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2096
2165
|
plumbing_response.rate_limit)
|
2097
|
-
resp.token = (plumbing_response.token)
|
2098
2166
|
return resp
|
2099
2167
|
|
2100
2168
|
def get(self, id, timeout=None):
|
2101
2169
|
'''
|
2102
|
-
Get reads one
|
2170
|
+
Get reads one IdentityAlias by ID.
|
2103
2171
|
'''
|
2104
|
-
req =
|
2172
|
+
req = IdentityAliasGetRequest()
|
2105
2173
|
if self.parent.snapshot_datetime is not None:
|
2106
2174
|
req.meta.CopyFrom(GetRequestMetadata())
|
2107
2175
|
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
@@ -2113,7 +2181,8 @@ class Nodes:
|
|
2113
2181
|
try:
|
2114
2182
|
plumbing_response = self.stub.Get(
|
2115
2183
|
req,
|
2116
|
-
metadata=self.parent.get_metadata('
|
2184
|
+
metadata=self.parent.get_metadata('IdentityAliases.Get',
|
2185
|
+
req),
|
2117
2186
|
timeout=timeout)
|
2118
2187
|
except Exception as e:
|
2119
2188
|
if self.parent.shouldRetry(tries, e):
|
@@ -2123,29 +2192,32 @@ class Nodes:
|
|
2123
2192
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2124
2193
|
break
|
2125
2194
|
|
2126
|
-
resp = models.
|
2195
|
+
resp = models.IdentityAliasGetResponse()
|
2196
|
+
resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
|
2197
|
+
plumbing_response.identity_alias)
|
2127
2198
|
resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
|
2128
2199
|
plumbing_response.meta)
|
2129
|
-
resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
|
2130
2200
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2131
2201
|
plumbing_response.rate_limit)
|
2132
2202
|
return resp
|
2133
2203
|
|
2134
|
-
def update(self,
|
2204
|
+
def update(self, identity_alias, timeout=None):
|
2135
2205
|
'''
|
2136
|
-
Update replaces all the fields of a
|
2206
|
+
Update replaces all the fields of a IdentityAlias by ID.
|
2137
2207
|
'''
|
2138
|
-
req =
|
2208
|
+
req = IdentityAliasUpdateRequest()
|
2139
2209
|
|
2140
|
-
if
|
2141
|
-
req.
|
2210
|
+
if identity_alias is not None:
|
2211
|
+
req.identity_alias.CopyFrom(
|
2212
|
+
plumbing.convert_identity_alias_to_plumbing(identity_alias))
|
2142
2213
|
tries = 0
|
2143
2214
|
plumbing_response = None
|
2144
2215
|
while True:
|
2145
2216
|
try:
|
2146
2217
|
plumbing_response = self.stub.Update(
|
2147
2218
|
req,
|
2148
|
-
metadata=self.parent.get_metadata('
|
2219
|
+
metadata=self.parent.get_metadata('IdentityAliases.Update',
|
2220
|
+
req),
|
2149
2221
|
timeout=timeout)
|
2150
2222
|
except Exception as e:
|
2151
2223
|
if self.parent.shouldRetry(tries, e):
|
@@ -2155,19 +2227,20 @@ class Nodes:
|
|
2155
2227
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2156
2228
|
break
|
2157
2229
|
|
2158
|
-
resp = models.
|
2230
|
+
resp = models.IdentityAliasUpdateResponse()
|
2231
|
+
resp.identity_alias = plumbing.convert_identity_alias_to_porcelain(
|
2232
|
+
plumbing_response.identity_alias)
|
2159
2233
|
resp.meta = plumbing.convert_update_response_metadata_to_porcelain(
|
2160
2234
|
plumbing_response.meta)
|
2161
|
-
resp.node = plumbing.convert_node_to_porcelain(plumbing_response.node)
|
2162
2235
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2163
2236
|
plumbing_response.rate_limit)
|
2164
2237
|
return resp
|
2165
2238
|
|
2166
2239
|
def delete(self, id, timeout=None):
|
2167
2240
|
'''
|
2168
|
-
Delete removes a
|
2241
|
+
Delete removes a IdentityAlias by ID.
|
2169
2242
|
'''
|
2170
|
-
req =
|
2243
|
+
req = IdentityAliasDeleteRequest()
|
2171
2244
|
|
2172
2245
|
req.id = (id)
|
2173
2246
|
tries = 0
|
@@ -2176,7 +2249,8 @@ class Nodes:
|
|
2176
2249
|
try:
|
2177
2250
|
plumbing_response = self.stub.Delete(
|
2178
2251
|
req,
|
2179
|
-
metadata=self.parent.get_metadata('
|
2252
|
+
metadata=self.parent.get_metadata('IdentityAliases.Delete',
|
2253
|
+
req),
|
2180
2254
|
timeout=timeout)
|
2181
2255
|
except Exception as e:
|
2182
2256
|
if self.parent.shouldRetry(tries, e):
|
@@ -2186,7 +2260,7 @@ class Nodes:
|
|
2186
2260
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2187
2261
|
break
|
2188
2262
|
|
2189
|
-
resp = models.
|
2263
|
+
resp = models.IdentityAliasDeleteResponse()
|
2190
2264
|
resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
|
2191
2265
|
plumbing_response.meta)
|
2192
2266
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
@@ -2195,9 +2269,9 @@ class Nodes:
|
|
2195
2269
|
|
2196
2270
|
def list(self, filter, *args, timeout=None):
|
2197
2271
|
'''
|
2198
|
-
List gets a list of
|
2272
|
+
List gets a list of IdentityAliases matching a given set of criteria.
|
2199
2273
|
'''
|
2200
|
-
req =
|
2274
|
+
req = IdentityAliasListRequest()
|
2201
2275
|
req.meta.CopyFrom(ListRequestMetadata())
|
2202
2276
|
if self.parent.page_limit > 0:
|
2203
2277
|
req.meta.limit = self.parent.page_limit
|
@@ -2212,7 +2286,8 @@ class Nodes:
|
|
2212
2286
|
try:
|
2213
2287
|
plumbing_response = svc.stub.List(
|
2214
2288
|
req,
|
2215
|
-
metadata=svc.parent.get_metadata(
|
2289
|
+
metadata=svc.parent.get_metadata(
|
2290
|
+
'IdentityAliases.List', req),
|
2216
2291
|
timeout=timeout)
|
2217
2292
|
except Exception as e:
|
2218
2293
|
if self.parent.shouldRetry(tries, e):
|
@@ -2221,8 +2296,9 @@ class Nodes:
|
|
2221
2296
|
continue
|
2222
2297
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2223
2298
|
tries = 0
|
2224
|
-
for plumbing_item in plumbing_response.
|
2225
|
-
yield plumbing.
|
2299
|
+
for plumbing_item in plumbing_response.identity_aliases:
|
2300
|
+
yield plumbing.convert_identity_alias_to_porcelain(
|
2301
|
+
plumbing_item)
|
2226
2302
|
if plumbing_response.meta.next_cursor == '':
|
2227
2303
|
break
|
2228
2304
|
req.meta.cursor = plumbing_response.meta.next_cursor
|
@@ -2230,41 +2306,41 @@ class Nodes:
|
|
2230
2306
|
return generator(self, req)
|
2231
2307
|
|
2232
2308
|
|
2233
|
-
class
|
2309
|
+
class SnapshotIdentityAliases:
|
2234
2310
|
'''
|
2235
|
-
|
2311
|
+
SnapshotIdentityAliases exposes the read only methods of the IdentityAliases
|
2236
2312
|
service for historical queries.
|
2237
2313
|
'''
|
2238
|
-
def __init__(self,
|
2239
|
-
self.
|
2314
|
+
def __init__(self, identity_aliases):
|
2315
|
+
self.identity_aliases = identity_aliases
|
2240
2316
|
|
2241
2317
|
def get(self, id, timeout=None):
|
2242
2318
|
'''
|
2243
|
-
Get reads one
|
2319
|
+
Get reads one IdentityAlias by ID.
|
2244
2320
|
'''
|
2245
|
-
return self.
|
2321
|
+
return self.identity_aliases.get(id, timeout=timeout)
|
2246
2322
|
|
2247
2323
|
def list(self, filter, *args, timeout=None):
|
2248
2324
|
'''
|
2249
|
-
List gets a list of
|
2325
|
+
List gets a list of IdentityAliases matching a given set of criteria.
|
2250
2326
|
'''
|
2251
|
-
return self.
|
2327
|
+
return self.identity_aliases.list(filter, *args, timeout=timeout)
|
2252
2328
|
|
2253
2329
|
|
2254
|
-
class
|
2330
|
+
class IdentityAliasesHistory:
|
2255
2331
|
'''
|
2256
|
-
|
2257
|
-
See `strongdm.models.
|
2332
|
+
IdentityAliasesHistory records all changes to the state of a IdentityAlias.
|
2333
|
+
See `strongdm.models.IdentityAliasHistory`.
|
2258
2334
|
'''
|
2259
2335
|
def __init__(self, channel, client):
|
2260
2336
|
self.parent = client
|
2261
|
-
self.stub =
|
2337
|
+
self.stub = IdentityAliasesHistoryStub(channel)
|
2262
2338
|
|
2263
2339
|
def list(self, filter, *args, timeout=None):
|
2264
2340
|
'''
|
2265
|
-
List gets a list of
|
2341
|
+
List gets a list of IdentityAliasHistory records matching a given set of criteria.
|
2266
2342
|
'''
|
2267
|
-
req =
|
2343
|
+
req = IdentityAliasHistoryListRequest()
|
2268
2344
|
req.meta.CopyFrom(ListRequestMetadata())
|
2269
2345
|
if self.parent.page_limit > 0:
|
2270
2346
|
req.meta.limit = self.parent.page_limit
|
@@ -2280,7 +2356,7 @@ class NodesHistory:
|
|
2280
2356
|
plumbing_response = svc.stub.List(
|
2281
2357
|
req,
|
2282
2358
|
metadata=svc.parent.get_metadata(
|
2283
|
-
'
|
2359
|
+
'IdentityAliasesHistory.List', req),
|
2284
2360
|
timeout=timeout)
|
2285
2361
|
except Exception as e:
|
2286
2362
|
if self.parent.shouldRetry(tries, e):
|
@@ -2290,7 +2366,7 @@ class NodesHistory:
|
|
2290
2366
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2291
2367
|
tries = 0
|
2292
2368
|
for plumbing_item in plumbing_response.history:
|
2293
|
-
yield plumbing.
|
2369
|
+
yield plumbing.convert_identity_alias_history_to_porcelain(
|
2294
2370
|
plumbing_item)
|
2295
2371
|
if plumbing_response.meta.next_cursor == '':
|
2296
2372
|
break
|
@@ -2299,81 +2375,68 @@ class NodesHistory:
|
|
2299
2375
|
return generator(self, req)
|
2300
2376
|
|
2301
2377
|
|
2302
|
-
class
|
2378
|
+
class IdentitySets:
|
2303
2379
|
'''
|
2304
|
-
|
2305
|
-
|
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`.
|
2306
2383
|
'''
|
2307
2384
|
def __init__(self, channel, client):
|
2308
2385
|
self.parent = client
|
2309
|
-
self.stub =
|
2386
|
+
self.stub = IdentitySetsStub(channel)
|
2310
2387
|
|
2311
|
-
def
|
2388
|
+
def create(self, identity_set, timeout=None):
|
2312
2389
|
'''
|
2313
|
-
|
2390
|
+
Create registers a new IdentitySet.
|
2314
2391
|
'''
|
2315
|
-
req =
|
2316
|
-
req.meta.CopyFrom(ListRequestMetadata())
|
2317
|
-
if self.parent.page_limit > 0:
|
2318
|
-
req.meta.limit = self.parent.page_limit
|
2319
|
-
if self.parent.snapshot_datetime is not None:
|
2320
|
-
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
2321
|
-
|
2322
|
-
req.filter = plumbing.quote_filter_args(filter, *args)
|
2323
|
-
|
2324
|
-
def generator(svc, req):
|
2325
|
-
tries = 0
|
2326
|
-
while True:
|
2327
|
-
try:
|
2328
|
-
plumbing_response = svc.stub.List(
|
2329
|
-
req,
|
2330
|
-
metadata=svc.parent.get_metadata(
|
2331
|
-
'OrganizationHistory.List', req),
|
2332
|
-
timeout=timeout)
|
2333
|
-
except Exception as e:
|
2334
|
-
if self.parent.shouldRetry(tries, e):
|
2335
|
-
tries += 1
|
2336
|
-
self.parent.jitterSleep(tries)
|
2337
|
-
continue
|
2338
|
-
raise plumbing.convert_error_to_porcelain(e) from e
|
2339
|
-
tries = 0
|
2340
|
-
for plumbing_item in plumbing_response.history:
|
2341
|
-
yield plumbing.convert_organization_history_record_to_porcelain(
|
2342
|
-
plumbing_item)
|
2343
|
-
if plumbing_response.meta.next_cursor == '':
|
2344
|
-
break
|
2345
|
-
req.meta.cursor = plumbing_response.meta.next_cursor
|
2346
|
-
|
2347
|
-
return generator(self, req)
|
2392
|
+
req = IdentitySetCreateRequest()
|
2348
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
|
2349
2413
|
|
2350
|
-
|
2351
|
-
|
2352
|
-
|
2353
|
-
|
2354
|
-
|
2355
|
-
|
2356
|
-
|
2357
|
-
|
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
|
2358
2422
|
|
2359
|
-
def
|
2423
|
+
def get(self, id, timeout=None):
|
2360
2424
|
'''
|
2361
|
-
|
2425
|
+
Get reads one IdentitySet by ID.
|
2362
2426
|
'''
|
2363
|
-
req =
|
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)
|
2364
2431
|
|
2365
|
-
|
2366
|
-
req.peering_group_node.CopyFrom(
|
2367
|
-
plumbing.convert_peering_group_node_to_plumbing(
|
2368
|
-
peering_group_node))
|
2432
|
+
req.id = (id)
|
2369
2433
|
tries = 0
|
2370
2434
|
plumbing_response = None
|
2371
2435
|
while True:
|
2372
2436
|
try:
|
2373
|
-
plumbing_response = self.stub.
|
2437
|
+
plumbing_response = self.stub.Get(
|
2374
2438
|
req,
|
2375
|
-
metadata=self.parent.get_metadata(
|
2376
|
-
'PeeringGroupNodes.Create', req),
|
2439
|
+
metadata=self.parent.get_metadata('IdentitySets.Get', req),
|
2377
2440
|
timeout=timeout)
|
2378
2441
|
except Exception as e:
|
2379
2442
|
if self.parent.shouldRetry(tries, e):
|
@@ -2383,30 +2446,32 @@ class PeeringGroupNodes:
|
|
2383
2446
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2384
2447
|
break
|
2385
2448
|
|
2386
|
-
resp = models.
|
2387
|
-
resp.
|
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(
|
2388
2453
|
plumbing_response.meta)
|
2389
|
-
resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
|
2390
|
-
plumbing_response.peering_group_node)
|
2391
2454
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2392
2455
|
plumbing_response.rate_limit)
|
2393
2456
|
return resp
|
2394
2457
|
|
2395
|
-
def
|
2458
|
+
def update(self, identity_set, timeout=None):
|
2396
2459
|
'''
|
2397
|
-
|
2460
|
+
Update replaces all the fields of a IdentitySet by ID.
|
2398
2461
|
'''
|
2399
|
-
req =
|
2462
|
+
req = IdentitySetUpdateRequest()
|
2400
2463
|
|
2401
|
-
|
2464
|
+
if identity_set is not None:
|
2465
|
+
req.identity_set.CopyFrom(
|
2466
|
+
plumbing.convert_identity_set_to_plumbing(identity_set))
|
2402
2467
|
tries = 0
|
2403
2468
|
plumbing_response = None
|
2404
2469
|
while True:
|
2405
2470
|
try:
|
2406
|
-
plumbing_response = self.stub.
|
2471
|
+
plumbing_response = self.stub.Update(
|
2407
2472
|
req,
|
2408
|
-
metadata=self.parent.get_metadata(
|
2409
|
-
|
2473
|
+
metadata=self.parent.get_metadata('IdentitySets.Update',
|
2474
|
+
req),
|
2410
2475
|
timeout=timeout)
|
2411
2476
|
except Exception as e:
|
2412
2477
|
if self.parent.shouldRetry(tries, e):
|
@@ -2416,30 +2481,29 @@ class PeeringGroupNodes:
|
|
2416
2481
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2417
2482
|
break
|
2418
2483
|
|
2419
|
-
resp = models.
|
2420
|
-
resp.
|
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(
|
2421
2488
|
plumbing_response.meta)
|
2422
2489
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2423
2490
|
plumbing_response.rate_limit)
|
2424
2491
|
return resp
|
2425
2492
|
|
2426
|
-
def
|
2493
|
+
def delete(self, id, timeout=None):
|
2427
2494
|
'''
|
2428
|
-
|
2495
|
+
Delete removes a IdentitySet by ID.
|
2429
2496
|
'''
|
2430
|
-
req =
|
2431
|
-
if self.parent.snapshot_datetime is not None:
|
2432
|
-
req.meta.CopyFrom(GetRequestMetadata())
|
2433
|
-
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
2497
|
+
req = IdentitySetDeleteRequest()
|
2434
2498
|
|
2435
2499
|
req.id = (id)
|
2436
2500
|
tries = 0
|
2437
2501
|
plumbing_response = None
|
2438
2502
|
while True:
|
2439
2503
|
try:
|
2440
|
-
plumbing_response = self.stub.
|
2504
|
+
plumbing_response = self.stub.Delete(
|
2441
2505
|
req,
|
2442
|
-
metadata=self.parent.get_metadata('
|
2506
|
+
metadata=self.parent.get_metadata('IdentitySets.Delete',
|
2443
2507
|
req),
|
2444
2508
|
timeout=timeout)
|
2445
2509
|
except Exception as e:
|
@@ -2450,20 +2514,18 @@ class PeeringGroupNodes:
|
|
2450
2514
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2451
2515
|
break
|
2452
2516
|
|
2453
|
-
resp = models.
|
2454
|
-
resp.meta = plumbing.
|
2517
|
+
resp = models.IdentitySetDeleteResponse()
|
2518
|
+
resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
|
2455
2519
|
plumbing_response.meta)
|
2456
|
-
resp.peering_group_node = plumbing.convert_peering_group_node_to_porcelain(
|
2457
|
-
plumbing_response.peering_group_node)
|
2458
2520
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2459
2521
|
plumbing_response.rate_limit)
|
2460
2522
|
return resp
|
2461
2523
|
|
2462
2524
|
def list(self, filter, *args, timeout=None):
|
2463
2525
|
'''
|
2464
|
-
List gets a list of
|
2526
|
+
List gets a list of IdentitySets matching a given set of criteria.
|
2465
2527
|
'''
|
2466
|
-
req =
|
2528
|
+
req = IdentitySetListRequest()
|
2467
2529
|
req.meta.CopyFrom(ListRequestMetadata())
|
2468
2530
|
if self.parent.page_limit > 0:
|
2469
2531
|
req.meta.limit = self.parent.page_limit
|
@@ -2479,7 +2541,7 @@ class PeeringGroupNodes:
|
|
2479
2541
|
plumbing_response = svc.stub.List(
|
2480
2542
|
req,
|
2481
2543
|
metadata=svc.parent.get_metadata(
|
2482
|
-
'
|
2544
|
+
'IdentitySets.List', req),
|
2483
2545
|
timeout=timeout)
|
2484
2546
|
except Exception as e:
|
2485
2547
|
if self.parent.shouldRetry(tries, e):
|
@@ -2488,8 +2550,8 @@ class PeeringGroupNodes:
|
|
2488
2550
|
continue
|
2489
2551
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2490
2552
|
tries = 0
|
2491
|
-
for plumbing_item in plumbing_response.
|
2492
|
-
yield plumbing.
|
2553
|
+
for plumbing_item in plumbing_response.identity_sets:
|
2554
|
+
yield plumbing.convert_identity_set_to_porcelain(
|
2493
2555
|
plumbing_item)
|
2494
2556
|
if plumbing_response.meta.next_cursor == '':
|
2495
2557
|
break
|
@@ -2498,33 +2560,734 @@ class PeeringGroupNodes:
|
|
2498
2560
|
return generator(self, req)
|
2499
2561
|
|
2500
2562
|
|
2501
|
-
class
|
2563
|
+
class SnapshotIdentitySets:
|
2502
2564
|
'''
|
2503
|
-
|
2504
|
-
|
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
|
+
|
2584
|
+
class IdentitySetsHistory:
|
2585
|
+
'''
|
2586
|
+
IdentitySetsHistory records all changes to the state of a IdentitySet.
|
2587
|
+
See `strongdm.models.IdentitySetHistory`.
|
2505
2588
|
'''
|
2506
2589
|
def __init__(self, channel, client):
|
2507
2590
|
self.parent = client
|
2508
|
-
self.stub =
|
2591
|
+
self.stub = IdentitySetsHistoryStub(channel)
|
2509
2592
|
|
2510
|
-
def
|
2593
|
+
def list(self, filter, *args, timeout=None):
|
2511
2594
|
'''
|
2512
|
-
|
2595
|
+
List gets a list of IdentitySetHistory records matching a given set of criteria.
|
2513
2596
|
'''
|
2514
|
-
req =
|
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)
|
2515
2603
|
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
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
|
+
|
2632
|
+
class 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
|
+
|
2812
|
+
class 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
|
+
|
2833
|
+
class 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
|
+
|
2881
|
+
class 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
|
+
|
2929
|
+
class 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
|
+
|
3080
|
+
class 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
|
+
|
3231
|
+
class 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
|
2522
3285
|
while True:
|
2523
3286
|
try:
|
2524
|
-
plumbing_response = self.stub.
|
3287
|
+
plumbing_response = self.stub.Delete(
|
2525
3288
|
req,
|
2526
3289
|
metadata=self.parent.get_metadata(
|
2527
|
-
'
|
3290
|
+
'PeeringGroupResources.Delete', req),
|
2528
3291
|
timeout=timeout)
|
2529
3292
|
except Exception as e:
|
2530
3293
|
if self.parent.shouldRetry(tries, e):
|
@@ -2534,20 +3297,137 @@ class PeeringGroupPeers:
|
|
2534
3297
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2535
3298
|
break
|
2536
3299
|
|
2537
|
-
resp = models.
|
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
|
+
|
3382
|
+
class 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()
|
2538
3418
|
resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
|
2539
3419
|
plumbing_response.meta)
|
2540
|
-
resp.
|
2541
|
-
plumbing_response.
|
3420
|
+
resp.peering_group = plumbing.convert_peering_group_to_porcelain(
|
3421
|
+
plumbing_response.peering_group)
|
2542
3422
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2543
3423
|
plumbing_response.rate_limit)
|
2544
3424
|
return resp
|
2545
3425
|
|
2546
3426
|
def delete(self, id, timeout=None):
|
2547
3427
|
'''
|
2548
|
-
Delete
|
3428
|
+
Delete removes a PeeringGroup by ID.
|
2549
3429
|
'''
|
2550
|
-
req =
|
3430
|
+
req = PeeringGroupDeleteRequest()
|
2551
3431
|
|
2552
3432
|
req.id = (id)
|
2553
3433
|
tries = 0
|
@@ -2556,8 +3436,8 @@ class PeeringGroupPeers:
|
|
2556
3436
|
try:
|
2557
3437
|
plumbing_response = self.stub.Delete(
|
2558
3438
|
req,
|
2559
|
-
metadata=self.parent.get_metadata(
|
2560
|
-
|
3439
|
+
metadata=self.parent.get_metadata('PeeringGroups.Delete',
|
3440
|
+
req),
|
2561
3441
|
timeout=timeout)
|
2562
3442
|
except Exception as e:
|
2563
3443
|
if self.parent.shouldRetry(tries, e):
|
@@ -2567,7 +3447,7 @@ class PeeringGroupPeers:
|
|
2567
3447
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2568
3448
|
break
|
2569
3449
|
|
2570
|
-
resp = models.
|
3450
|
+
resp = models.PeeringGroupDeleteResponse()
|
2571
3451
|
resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
|
2572
3452
|
plumbing_response.meta)
|
2573
3453
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
@@ -2576,9 +3456,9 @@ class PeeringGroupPeers:
|
|
2576
3456
|
|
2577
3457
|
def get(self, id, timeout=None):
|
2578
3458
|
'''
|
2579
|
-
Get reads
|
3459
|
+
Get reads one PeeringGroup by ID. It will load all its dependencies.
|
2580
3460
|
'''
|
2581
|
-
req =
|
3461
|
+
req = PeeringGroupGetRequest()
|
2582
3462
|
if self.parent.snapshot_datetime is not None:
|
2583
3463
|
req.meta.CopyFrom(GetRequestMetadata())
|
2584
3464
|
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
@@ -2590,7 +3470,7 @@ class PeeringGroupPeers:
|
|
2590
3470
|
try:
|
2591
3471
|
plumbing_response = self.stub.Get(
|
2592
3472
|
req,
|
2593
|
-
metadata=self.parent.get_metadata('
|
3473
|
+
metadata=self.parent.get_metadata('PeeringGroups.Get',
|
2594
3474
|
req),
|
2595
3475
|
timeout=timeout)
|
2596
3476
|
except Exception as e:
|
@@ -2601,20 +3481,20 @@ class PeeringGroupPeers:
|
|
2601
3481
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2602
3482
|
break
|
2603
3483
|
|
2604
|
-
resp = models.
|
3484
|
+
resp = models.PeeringGroupGetResponse()
|
2605
3485
|
resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
|
2606
3486
|
plumbing_response.meta)
|
2607
|
-
resp.
|
2608
|
-
plumbing_response.
|
3487
|
+
resp.peering_group = plumbing.convert_peering_group_to_porcelain(
|
3488
|
+
plumbing_response.peering_group)
|
2609
3489
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2610
3490
|
plumbing_response.rate_limit)
|
2611
3491
|
return resp
|
2612
3492
|
|
2613
3493
|
def list(self, filter, *args, timeout=None):
|
2614
3494
|
'''
|
2615
|
-
List gets a list of
|
3495
|
+
List gets a list of Peering Groups.
|
2616
3496
|
'''
|
2617
|
-
req =
|
3497
|
+
req = PeeringGroupListRequest()
|
2618
3498
|
req.meta.CopyFrom(ListRequestMetadata())
|
2619
3499
|
if self.parent.page_limit > 0:
|
2620
3500
|
req.meta.limit = self.parent.page_limit
|
@@ -2630,7 +3510,7 @@ class PeeringGroupPeers:
|
|
2630
3510
|
plumbing_response = svc.stub.List(
|
2631
3511
|
req,
|
2632
3512
|
metadata=svc.parent.get_metadata(
|
2633
|
-
'
|
3513
|
+
'PeeringGroups.List', req),
|
2634
3514
|
timeout=timeout)
|
2635
3515
|
except Exception as e:
|
2636
3516
|
if self.parent.shouldRetry(tries, e):
|
@@ -2639,8 +3519,8 @@ class PeeringGroupPeers:
|
|
2639
3519
|
continue
|
2640
3520
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2641
3521
|
tries = 0
|
2642
|
-
for plumbing_item in plumbing_response.
|
2643
|
-
yield plumbing.
|
3522
|
+
for plumbing_item in plumbing_response.peering_groups:
|
3523
|
+
yield plumbing.convert_peering_group_to_porcelain(
|
2644
3524
|
plumbing_item)
|
2645
3525
|
if plumbing_response.meta.next_cursor == '':
|
2646
3526
|
break
|
@@ -2649,33 +3529,31 @@ class PeeringGroupPeers:
|
|
2649
3529
|
return generator(self, req)
|
2650
3530
|
|
2651
3531
|
|
2652
|
-
class
|
3532
|
+
class Policies:
|
2653
3533
|
'''
|
2654
|
-
|
2655
|
-
|
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`.
|
2656
3537
|
'''
|
2657
3538
|
def __init__(self, channel, client):
|
2658
3539
|
self.parent = client
|
2659
|
-
self.stub =
|
3540
|
+
self.stub = PoliciesStub(channel)
|
2660
3541
|
|
2661
|
-
def create(self,
|
3542
|
+
def create(self, policy, timeout=None):
|
2662
3543
|
'''
|
2663
|
-
Create
|
3544
|
+
Create creates a new Policy.
|
2664
3545
|
'''
|
2665
|
-
req =
|
3546
|
+
req = PolicyCreateRequest()
|
2666
3547
|
|
2667
|
-
if
|
2668
|
-
req.
|
2669
|
-
plumbing.convert_peering_group_resource_to_plumbing(
|
2670
|
-
peering_group_resource))
|
3548
|
+
if policy is not None:
|
3549
|
+
req.policy.CopyFrom(plumbing.convert_policy_to_plumbing(policy))
|
2671
3550
|
tries = 0
|
2672
3551
|
plumbing_response = None
|
2673
3552
|
while True:
|
2674
3553
|
try:
|
2675
3554
|
plumbing_response = self.stub.Create(
|
2676
3555
|
req,
|
2677
|
-
metadata=self.parent.get_metadata(
|
2678
|
-
'PeeringGroupResources.Create', req),
|
3556
|
+
metadata=self.parent.get_metadata('Policies.Create', req),
|
2679
3557
|
timeout=timeout)
|
2680
3558
|
except Exception as e:
|
2681
3559
|
if self.parent.shouldRetry(tries, e):
|
@@ -2685,20 +3563,18 @@ class PeeringGroupResources:
|
|
2685
3563
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2686
3564
|
break
|
2687
3565
|
|
2688
|
-
resp = models.
|
2689
|
-
resp.
|
2690
|
-
plumbing_response.
|
2691
|
-
resp.peering_group_resource = plumbing.convert_peering_group_resource_to_porcelain(
|
2692
|
-
plumbing_response.peering_group_resource)
|
3566
|
+
resp = models.PolicyCreateResponse()
|
3567
|
+
resp.policy = plumbing.convert_policy_to_porcelain(
|
3568
|
+
plumbing_response.policy)
|
2693
3569
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2694
3570
|
plumbing_response.rate_limit)
|
2695
3571
|
return resp
|
2696
3572
|
|
2697
3573
|
def delete(self, id, timeout=None):
|
2698
3574
|
'''
|
2699
|
-
Delete
|
3575
|
+
Delete removes a Policy by ID.
|
2700
3576
|
'''
|
2701
|
-
req =
|
3577
|
+
req = PolicyDeleteRequest()
|
2702
3578
|
|
2703
3579
|
req.id = (id)
|
2704
3580
|
tries = 0
|
@@ -2707,8 +3583,7 @@ class PeeringGroupResources:
|
|
2707
3583
|
try:
|
2708
3584
|
plumbing_response = self.stub.Delete(
|
2709
3585
|
req,
|
2710
|
-
metadata=self.parent.get_metadata(
|
2711
|
-
'PeeringGroupResources.Delete', req),
|
3586
|
+
metadata=self.parent.get_metadata('Policies.Delete', req),
|
2712
3587
|
timeout=timeout)
|
2713
3588
|
except Exception as e:
|
2714
3589
|
if self.parent.shouldRetry(tries, e):
|
@@ -2718,18 +3593,47 @@ class PeeringGroupResources:
|
|
2718
3593
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2719
3594
|
break
|
2720
3595
|
|
2721
|
-
resp = models.
|
2722
|
-
resp.
|
2723
|
-
plumbing_response.
|
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)
|
2724
3628
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2725
3629
|
plumbing_response.rate_limit)
|
2726
3630
|
return resp
|
2727
3631
|
|
2728
3632
|
def get(self, id, timeout=None):
|
2729
3633
|
'''
|
2730
|
-
Get reads
|
3634
|
+
Get reads one Policy by ID.
|
2731
3635
|
'''
|
2732
|
-
req =
|
3636
|
+
req = PolicyGetRequest()
|
2733
3637
|
if self.parent.snapshot_datetime is not None:
|
2734
3638
|
req.meta.CopyFrom(GetRequestMetadata())
|
2735
3639
|
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
@@ -2741,8 +3645,7 @@ class PeeringGroupResources:
|
|
2741
3645
|
try:
|
2742
3646
|
plumbing_response = self.stub.Get(
|
2743
3647
|
req,
|
2744
|
-
metadata=self.parent.get_metadata(
|
2745
|
-
'PeeringGroupResources.Get', req),
|
3648
|
+
metadata=self.parent.get_metadata('Policies.Get', req),
|
2746
3649
|
timeout=timeout)
|
2747
3650
|
except Exception as e:
|
2748
3651
|
if self.parent.shouldRetry(tries, e):
|
@@ -2752,20 +3655,87 @@ class PeeringGroupResources:
|
|
2752
3655
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2753
3656
|
break
|
2754
3657
|
|
2755
|
-
resp = models.
|
2756
|
-
resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
|
2757
|
-
plumbing_response.meta)
|
2758
|
-
resp.
|
2759
|
-
plumbing_response.
|
2760
|
-
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2761
|
-
plumbing_response.rate_limit)
|
2762
|
-
return resp
|
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
|
+
|
3704
|
+
class 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)
|
2763
3717
|
|
2764
3718
|
def list(self, filter, *args, timeout=None):
|
2765
3719
|
'''
|
2766
|
-
List gets a list of
|
3720
|
+
List gets a list of Policy matching a given set of criteria
|
2767
3721
|
'''
|
2768
|
-
|
3722
|
+
return self.policies.list(filter, *args, timeout=timeout)
|
3723
|
+
|
3724
|
+
|
3725
|
+
class 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()
|
2769
3739
|
req.meta.CopyFrom(ListRequestMetadata())
|
2770
3740
|
if self.parent.page_limit > 0:
|
2771
3741
|
req.meta.limit = self.parent.page_limit
|
@@ -2781,7 +3751,7 @@ class PeeringGroupResources:
|
|
2781
3751
|
plumbing_response = svc.stub.List(
|
2782
3752
|
req,
|
2783
3753
|
metadata=svc.parent.get_metadata(
|
2784
|
-
'
|
3754
|
+
'PoliciesHistory.List', req),
|
2785
3755
|
timeout=timeout)
|
2786
3756
|
except Exception as e:
|
2787
3757
|
if self.parent.shouldRetry(tries, e):
|
@@ -2790,8 +3760,8 @@ class PeeringGroupResources:
|
|
2790
3760
|
continue
|
2791
3761
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2792
3762
|
tries = 0
|
2793
|
-
for plumbing_item in plumbing_response.
|
2794
|
-
yield plumbing.
|
3763
|
+
for plumbing_item in plumbing_response.history:
|
3764
|
+
yield plumbing.convert_policy_history_to_porcelain(
|
2795
3765
|
plumbing_item)
|
2796
3766
|
if plumbing_response.meta.next_cursor == '':
|
2797
3767
|
break
|
@@ -2800,32 +3770,35 @@ class PeeringGroupResources:
|
|
2800
3770
|
return generator(self, req)
|
2801
3771
|
|
2802
3772
|
|
2803
|
-
class
|
3773
|
+
class ProxyClusterKeys:
|
2804
3774
|
'''
|
2805
|
-
|
2806
|
-
|
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`.
|
2807
3779
|
'''
|
2808
3780
|
def __init__(self, channel, client):
|
2809
3781
|
self.parent = client
|
2810
|
-
self.stub =
|
3782
|
+
self.stub = ProxyClusterKeysStub(channel)
|
2811
3783
|
|
2812
|
-
def create(self,
|
3784
|
+
def create(self, proxy_cluster_key, timeout=None):
|
2813
3785
|
'''
|
2814
|
-
Create registers a new
|
3786
|
+
Create registers a new ProxyClusterKey.
|
2815
3787
|
'''
|
2816
|
-
req =
|
3788
|
+
req = ProxyClusterKeyCreateRequest()
|
2817
3789
|
|
2818
|
-
if
|
2819
|
-
req.
|
2820
|
-
plumbing.
|
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))
|
2821
3794
|
tries = 0
|
2822
3795
|
plumbing_response = None
|
2823
3796
|
while True:
|
2824
3797
|
try:
|
2825
3798
|
plumbing_response = self.stub.Create(
|
2826
3799
|
req,
|
2827
|
-
metadata=self.parent.get_metadata(
|
2828
|
-
|
3800
|
+
metadata=self.parent.get_metadata(
|
3801
|
+
'ProxyClusterKeys.Create', req),
|
2829
3802
|
timeout=timeout)
|
2830
3803
|
except Exception as e:
|
2831
3804
|
if self.parent.shouldRetry(tries, e):
|
@@ -2835,29 +3808,33 @@ class PeeringGroups:
|
|
2835
3808
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2836
3809
|
break
|
2837
3810
|
|
2838
|
-
resp = models.
|
3811
|
+
resp = models.ProxyClusterKeyCreateResponse()
|
2839
3812
|
resp.meta = plumbing.convert_create_response_metadata_to_porcelain(
|
2840
3813
|
plumbing_response.meta)
|
2841
|
-
resp.
|
2842
|
-
plumbing_response.
|
3814
|
+
resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
|
3815
|
+
plumbing_response.proxy_cluster_key)
|
2843
3816
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2844
3817
|
plumbing_response.rate_limit)
|
3818
|
+
resp.secret_key = (plumbing_response.secret_key)
|
2845
3819
|
return resp
|
2846
3820
|
|
2847
|
-
def
|
3821
|
+
def get(self, id, timeout=None):
|
2848
3822
|
'''
|
2849
|
-
|
3823
|
+
Get reads one ProxyClusterKey by ID.
|
2850
3824
|
'''
|
2851
|
-
req =
|
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)
|
2852
3829
|
|
2853
3830
|
req.id = (id)
|
2854
3831
|
tries = 0
|
2855
3832
|
plumbing_response = None
|
2856
3833
|
while True:
|
2857
3834
|
try:
|
2858
|
-
plumbing_response = self.stub.
|
3835
|
+
plumbing_response = self.stub.Get(
|
2859
3836
|
req,
|
2860
|
-
metadata=self.parent.get_metadata('
|
3837
|
+
metadata=self.parent.get_metadata('ProxyClusterKeys.Get',
|
2861
3838
|
req),
|
2862
3839
|
timeout=timeout)
|
2863
3840
|
except Exception as e:
|
@@ -2868,31 +3845,30 @@ class PeeringGroups:
|
|
2868
3845
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2869
3846
|
break
|
2870
3847
|
|
2871
|
-
resp = models.
|
2872
|
-
resp.meta = plumbing.
|
3848
|
+
resp = models.ProxyClusterKeyGetResponse()
|
3849
|
+
resp.meta = plumbing.convert_get_response_metadata_to_porcelain(
|
2873
3850
|
plumbing_response.meta)
|
3851
|
+
resp.proxy_cluster_key = plumbing.convert_proxy_cluster_key_to_porcelain(
|
3852
|
+
plumbing_response.proxy_cluster_key)
|
2874
3853
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2875
3854
|
plumbing_response.rate_limit)
|
2876
3855
|
return resp
|
2877
3856
|
|
2878
|
-
def
|
3857
|
+
def delete(self, id, timeout=None):
|
2879
3858
|
'''
|
2880
|
-
|
3859
|
+
Delete removes a ProxyClusterKey by ID.
|
2881
3860
|
'''
|
2882
|
-
req =
|
2883
|
-
if self.parent.snapshot_datetime is not None:
|
2884
|
-
req.meta.CopyFrom(GetRequestMetadata())
|
2885
|
-
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
3861
|
+
req = ProxyClusterKeyDeleteRequest()
|
2886
3862
|
|
2887
3863
|
req.id = (id)
|
2888
3864
|
tries = 0
|
2889
3865
|
plumbing_response = None
|
2890
3866
|
while True:
|
2891
3867
|
try:
|
2892
|
-
plumbing_response = self.stub.
|
3868
|
+
plumbing_response = self.stub.Delete(
|
2893
3869
|
req,
|
2894
|
-
metadata=self.parent.get_metadata(
|
2895
|
-
|
3870
|
+
metadata=self.parent.get_metadata(
|
3871
|
+
'ProxyClusterKeys.Delete', req),
|
2896
3872
|
timeout=timeout)
|
2897
3873
|
except Exception as e:
|
2898
3874
|
if self.parent.shouldRetry(tries, e):
|
@@ -2902,20 +3878,18 @@ class PeeringGroups:
|
|
2902
3878
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2903
3879
|
break
|
2904
3880
|
|
2905
|
-
resp = models.
|
2906
|
-
resp.meta = plumbing.
|
3881
|
+
resp = models.ProxyClusterKeyDeleteResponse()
|
3882
|
+
resp.meta = plumbing.convert_delete_response_metadata_to_porcelain(
|
2907
3883
|
plumbing_response.meta)
|
2908
|
-
resp.peering_group = plumbing.convert_peering_group_to_porcelain(
|
2909
|
-
plumbing_response.peering_group)
|
2910
3884
|
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
2911
3885
|
plumbing_response.rate_limit)
|
2912
3886
|
return resp
|
2913
3887
|
|
2914
3888
|
def list(self, filter, *args, timeout=None):
|
2915
3889
|
'''
|
2916
|
-
List gets a list of
|
3890
|
+
List gets a list of ProxyClusterKeys matching a given set of criteria.
|
2917
3891
|
'''
|
2918
|
-
req =
|
3892
|
+
req = ProxyClusterKeyListRequest()
|
2919
3893
|
req.meta.CopyFrom(ListRequestMetadata())
|
2920
3894
|
if self.parent.page_limit > 0:
|
2921
3895
|
req.meta.limit = self.parent.page_limit
|
@@ -2931,7 +3905,7 @@ class PeeringGroups:
|
|
2931
3905
|
plumbing_response = svc.stub.List(
|
2932
3906
|
req,
|
2933
3907
|
metadata=svc.parent.get_metadata(
|
2934
|
-
'
|
3908
|
+
'ProxyClusterKeys.List', req),
|
2935
3909
|
timeout=timeout)
|
2936
3910
|
except Exception as e:
|
2937
3911
|
if self.parent.shouldRetry(tries, e):
|
@@ -2940,8 +3914,8 @@ class PeeringGroups:
|
|
2940
3914
|
continue
|
2941
3915
|
raise plumbing.convert_error_to_porcelain(e) from e
|
2942
3916
|
tries = 0
|
2943
|
-
for plumbing_item in plumbing_response.
|
2944
|
-
yield plumbing.
|
3917
|
+
for plumbing_item in plumbing_response.proxy_cluster_keys:
|
3918
|
+
yield plumbing.convert_proxy_cluster_key_to_porcelain(
|
2945
3919
|
plumbing_item)
|
2946
3920
|
if plumbing_response.meta.next_cursor == '':
|
2947
3921
|
break
|
@@ -2950,6 +3924,27 @@ class PeeringGroups:
|
|
2950
3924
|
return generator(self, req)
|
2951
3925
|
|
2952
3926
|
|
3927
|
+
class 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
|
+
|
2953
3948
|
class Queries:
|
2954
3949
|
'''
|
2955
3950
|
A Query is a record of a single client request to a resource, such as a SQL query.
|
@@ -3472,11 +4467,13 @@ class Resources:
|
|
3472
4467
|
`strongdm.models.AmazonMQAMQP091`
|
3473
4468
|
`strongdm.models.Athena`
|
3474
4469
|
`strongdm.models.AuroraMysql`
|
4470
|
+
`strongdm.models.AuroraMysqlIAM`
|
3475
4471
|
`strongdm.models.AuroraPostgres`
|
3476
4472
|
`strongdm.models.AuroraPostgresIAM`
|
3477
4473
|
`strongdm.models.AWS`
|
3478
4474
|
`strongdm.models.AWSConsole`
|
3479
4475
|
`strongdm.models.AWSConsoleStaticKeyPair`
|
4476
|
+
`strongdm.models.AWSInstanceProfile`
|
3480
4477
|
`strongdm.models.Azure`
|
3481
4478
|
`strongdm.models.AzureCertificate`
|
3482
4479
|
`strongdm.models.AzureMysql`
|
@@ -3487,6 +4484,8 @@ class Resources:
|
|
3487
4484
|
`strongdm.models.Citus`
|
3488
4485
|
`strongdm.models.Clustrix`
|
3489
4486
|
`strongdm.models.Cockroach`
|
4487
|
+
`strongdm.models.CouchbaseDatabase`
|
4488
|
+
`strongdm.models.CouchbaseWebUI`
|
3490
4489
|
`strongdm.models.DB2I`
|
3491
4490
|
`strongdm.models.DB2LUW`
|
3492
4491
|
`strongdm.models.DocumentDBHost`
|
@@ -3496,6 +4495,8 @@ class Resources:
|
|
3496
4495
|
`strongdm.models.Elastic`
|
3497
4496
|
`strongdm.models.ElasticacheRedis`
|
3498
4497
|
`strongdm.models.GCP`
|
4498
|
+
`strongdm.models.GCPConsole`
|
4499
|
+
`strongdm.models.GCPWIF`
|
3499
4500
|
`strongdm.models.GoogleGKE`
|
3500
4501
|
`strongdm.models.GoogleGKEUserImpersonation`
|
3501
4502
|
`strongdm.models.Greenplum`
|
@@ -3539,6 +4540,7 @@ class Resources:
|
|
3539
4540
|
`strongdm.models.SSH`
|
3540
4541
|
`strongdm.models.SSHCert`
|
3541
4542
|
`strongdm.models.SSHCustomerKey`
|
4543
|
+
`strongdm.models.SSHPassword`
|
3542
4544
|
`strongdm.models.Sybase`
|
3543
4545
|
`strongdm.models.SybaseIQ`
|
3544
4546
|
`strongdm.models.Teradata`
|
@@ -4215,85 +5217,6 @@ class RolesHistory:
|
|
4215
5217
|
return generator(self, req)
|
4216
5218
|
|
4217
5219
|
|
4218
|
-
class SecretStoreHealths:
|
4219
|
-
'''
|
4220
|
-
SecretStoreHealths exposes health states for secret stores.
|
4221
|
-
See `strongdm.models.SecretStoreHealth`.
|
4222
|
-
'''
|
4223
|
-
def __init__(self, channel, client):
|
4224
|
-
self.parent = client
|
4225
|
-
self.stub = SecretStoreHealthsStub(channel)
|
4226
|
-
|
4227
|
-
def list(self, filter, *args, timeout=None):
|
4228
|
-
'''
|
4229
|
-
List reports the health status of node to secret store pairs.
|
4230
|
-
'''
|
4231
|
-
req = SecretStoreHealthListRequest()
|
4232
|
-
req.meta.CopyFrom(ListRequestMetadata())
|
4233
|
-
if self.parent.page_limit > 0:
|
4234
|
-
req.meta.limit = self.parent.page_limit
|
4235
|
-
if self.parent.snapshot_datetime is not None:
|
4236
|
-
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
4237
|
-
|
4238
|
-
req.filter = plumbing.quote_filter_args(filter, *args)
|
4239
|
-
|
4240
|
-
def generator(svc, req):
|
4241
|
-
tries = 0
|
4242
|
-
while True:
|
4243
|
-
try:
|
4244
|
-
plumbing_response = svc.stub.List(
|
4245
|
-
req,
|
4246
|
-
metadata=svc.parent.get_metadata(
|
4247
|
-
'SecretStoreHealths.List', req),
|
4248
|
-
timeout=timeout)
|
4249
|
-
except Exception as e:
|
4250
|
-
if self.parent.shouldRetry(tries, e):
|
4251
|
-
tries += 1
|
4252
|
-
self.parent.jitterSleep(tries)
|
4253
|
-
continue
|
4254
|
-
raise plumbing.convert_error_to_porcelain(e) from e
|
4255
|
-
tries = 0
|
4256
|
-
for plumbing_item in plumbing_response.secret_store_healths:
|
4257
|
-
yield plumbing.convert_secret_store_health_to_porcelain(
|
4258
|
-
plumbing_item)
|
4259
|
-
if plumbing_response.meta.next_cursor == '':
|
4260
|
-
break
|
4261
|
-
req.meta.cursor = plumbing_response.meta.next_cursor
|
4262
|
-
|
4263
|
-
return generator(self, req)
|
4264
|
-
|
4265
|
-
def healthcheck(self, secret_store_id, timeout=None):
|
4266
|
-
'''
|
4267
|
-
Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
|
4268
|
-
to propagate across a large network of Nodes. The call will return immediately, and the
|
4269
|
-
updated health of the Secret Store can be retrieved via List.
|
4270
|
-
'''
|
4271
|
-
req = SecretStoreHealthcheckRequest()
|
4272
|
-
|
4273
|
-
req.secret_store_id = (secret_store_id)
|
4274
|
-
tries = 0
|
4275
|
-
plumbing_response = None
|
4276
|
-
while True:
|
4277
|
-
try:
|
4278
|
-
plumbing_response = self.stub.Healthcheck(
|
4279
|
-
req,
|
4280
|
-
metadata=self.parent.get_metadata(
|
4281
|
-
'SecretStoreHealths.Healthcheck', req),
|
4282
|
-
timeout=timeout)
|
4283
|
-
except Exception as e:
|
4284
|
-
if self.parent.shouldRetry(tries, e):
|
4285
|
-
tries += 1
|
4286
|
-
self.parent.jitterSleep(tries)
|
4287
|
-
continue
|
4288
|
-
raise plumbing.convert_error_to_porcelain(e) from e
|
4289
|
-
break
|
4290
|
-
|
4291
|
-
resp = models.SecretStoreHealthcheckResponse()
|
4292
|
-
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
4293
|
-
plumbing_response.rate_limit)
|
4294
|
-
return resp
|
4295
|
-
|
4296
|
-
|
4297
5220
|
class SecretStores:
|
4298
5221
|
'''
|
4299
5222
|
SecretStores are servers where resource secrets (passwords, keys) are stored.
|
@@ -4308,9 +5231,13 @@ class SecretStores:
|
|
4308
5231
|
`strongdm.models.DelineaStore`
|
4309
5232
|
`strongdm.models.GCPStore`
|
4310
5233
|
`strongdm.models.GCPCertX509Store`
|
5234
|
+
`strongdm.models.KeyfactorSSHStore`
|
5235
|
+
`strongdm.models.KeyfactorX509Store`
|
4311
5236
|
`strongdm.models.VaultAppRoleStore`
|
4312
5237
|
`strongdm.models.VaultAppRoleCertSSHStore`
|
4313
5238
|
`strongdm.models.VaultAppRoleCertX509Store`
|
5239
|
+
`strongdm.models.VaultAWSEC2Store`
|
5240
|
+
`strongdm.models.VaultAWSIAMStore`
|
4314
5241
|
`strongdm.models.VaultTLSStore`
|
4315
5242
|
`strongdm.models.VaultTLSCertSSHStore`
|
4316
5243
|
`strongdm.models.VaultTLSCertX509Store`
|
@@ -4515,6 +5442,85 @@ class SnapshotSecretStores:
|
|
4515
5442
|
return self.secret_stores.list(filter, *args, timeout=timeout)
|
4516
5443
|
|
4517
5444
|
|
5445
|
+
class SecretStoreHealths:
|
5446
|
+
'''
|
5447
|
+
SecretStoreHealths exposes health states for secret stores.
|
5448
|
+
See `strongdm.models.SecretStoreHealth`.
|
5449
|
+
'''
|
5450
|
+
def __init__(self, channel, client):
|
5451
|
+
self.parent = client
|
5452
|
+
self.stub = SecretStoreHealthsStub(channel)
|
5453
|
+
|
5454
|
+
def list(self, filter, *args, timeout=None):
|
5455
|
+
'''
|
5456
|
+
List reports the health status of node to secret store pairs.
|
5457
|
+
'''
|
5458
|
+
req = SecretStoreHealthListRequest()
|
5459
|
+
req.meta.CopyFrom(ListRequestMetadata())
|
5460
|
+
if self.parent.page_limit > 0:
|
5461
|
+
req.meta.limit = self.parent.page_limit
|
5462
|
+
if self.parent.snapshot_datetime is not None:
|
5463
|
+
req.meta.snapshot_at.FromDatetime(self.parent.snapshot_datetime)
|
5464
|
+
|
5465
|
+
req.filter = plumbing.quote_filter_args(filter, *args)
|
5466
|
+
|
5467
|
+
def generator(svc, req):
|
5468
|
+
tries = 0
|
5469
|
+
while True:
|
5470
|
+
try:
|
5471
|
+
plumbing_response = svc.stub.List(
|
5472
|
+
req,
|
5473
|
+
metadata=svc.parent.get_metadata(
|
5474
|
+
'SecretStoreHealths.List', req),
|
5475
|
+
timeout=timeout)
|
5476
|
+
except Exception as e:
|
5477
|
+
if self.parent.shouldRetry(tries, e):
|
5478
|
+
tries += 1
|
5479
|
+
self.parent.jitterSleep(tries)
|
5480
|
+
continue
|
5481
|
+
raise plumbing.convert_error_to_porcelain(e) from e
|
5482
|
+
tries = 0
|
5483
|
+
for plumbing_item in plumbing_response.secret_store_healths:
|
5484
|
+
yield plumbing.convert_secret_store_health_to_porcelain(
|
5485
|
+
plumbing_item)
|
5486
|
+
if plumbing_response.meta.next_cursor == '':
|
5487
|
+
break
|
5488
|
+
req.meta.cursor = plumbing_response.meta.next_cursor
|
5489
|
+
|
5490
|
+
return generator(self, req)
|
5491
|
+
|
5492
|
+
def healthcheck(self, secret_store_id, timeout=None):
|
5493
|
+
'''
|
5494
|
+
Healthcheck triggers a remote healthcheck request for a secret store. It may take minutes
|
5495
|
+
to propagate across a large network of Nodes. The call will return immediately, and the
|
5496
|
+
updated health of the Secret Store can be retrieved via List.
|
5497
|
+
'''
|
5498
|
+
req = SecretStoreHealthcheckRequest()
|
5499
|
+
|
5500
|
+
req.secret_store_id = (secret_store_id)
|
5501
|
+
tries = 0
|
5502
|
+
plumbing_response = None
|
5503
|
+
while True:
|
5504
|
+
try:
|
5505
|
+
plumbing_response = self.stub.Healthcheck(
|
5506
|
+
req,
|
5507
|
+
metadata=self.parent.get_metadata(
|
5508
|
+
'SecretStoreHealths.Healthcheck', req),
|
5509
|
+
timeout=timeout)
|
5510
|
+
except Exception as e:
|
5511
|
+
if self.parent.shouldRetry(tries, e):
|
5512
|
+
tries += 1
|
5513
|
+
self.parent.jitterSleep(tries)
|
5514
|
+
continue
|
5515
|
+
raise plumbing.convert_error_to_porcelain(e) from e
|
5516
|
+
break
|
5517
|
+
|
5518
|
+
resp = models.SecretStoreHealthcheckResponse()
|
5519
|
+
resp.rate_limit = plumbing.convert_rate_limit_metadata_to_porcelain(
|
5520
|
+
plumbing_response.rate_limit)
|
5521
|
+
return resp
|
5522
|
+
|
5523
|
+
|
4518
5524
|
class SecretStoresHistory:
|
4519
5525
|
'''
|
4520
5526
|
SecretStoresHistory records all changes to the state of a SecretStore.
|