strongdm 1.0.11 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/doc/LICENSE.html +1 -3
  3. data/doc/Object.html +1 -1
  4. data/doc/README_md.html +1 -3
  5. data/doc/SDM.html +1 -1
  6. data/doc/SDM/AKS.html +1 -1
  7. data/doc/SDM/AKSBasicAuth.html +1 -1
  8. data/doc/SDM/AKSServiceAccount.html +1 -1
  9. data/doc/SDM/AccountAttachment.html +2 -2
  10. data/doc/SDM/AccountAttachmentCreateResponse.html +1 -1
  11. data/doc/SDM/AccountAttachmentDeleteResponse.html +1 -1
  12. data/doc/SDM/AccountAttachmentGetResponse.html +1 -1
  13. data/doc/SDM/AccountAttachments.html +2 -2
  14. data/doc/SDM/AccountCreateResponse.html +1 -1
  15. data/doc/SDM/AccountDeleteResponse.html +1 -1
  16. data/doc/SDM/AccountGetResponse.html +1 -1
  17. data/doc/SDM/AccountGrant.html +1 -1
  18. data/doc/SDM/AccountGrantCreateResponse.html +1 -1
  19. data/doc/SDM/AccountGrantDeleteResponse.html +1 -1
  20. data/doc/SDM/AccountGrantGetResponse.html +1 -1
  21. data/doc/SDM/AccountGrants.html +1 -1
  22. data/doc/SDM/AccountUpdateResponse.html +1 -1
  23. data/doc/SDM/Accounts.html +9 -9
  24. data/doc/SDM/AlreadyExistsError.html +1 -1
  25. data/doc/SDM/AmazonEKS.html +1 -1
  26. data/doc/SDM/AmazonES.html +1 -1
  27. data/doc/SDM/Athena.html +1 -1
  28. data/doc/SDM/AuroraMysql.html +1 -1
  29. data/doc/SDM/AuroraPostgres.html +1 -1
  30. data/doc/SDM/AuthenticationError.html +1 -1
  31. data/doc/SDM/BadRequestError.html +1 -1
  32. data/doc/SDM/BigQuery.html +1 -1
  33. data/doc/SDM/Cassandra.html +1 -1
  34. data/doc/SDM/Citus.html +1 -1
  35. data/doc/SDM/Client.html +8 -8
  36. data/doc/SDM/Clustrix.html +1 -1
  37. data/doc/SDM/Cockroach.html +1 -1
  38. data/doc/SDM/CreateResponseMetadata.html +1 -1
  39. data/doc/SDM/DB2LUW.html +1 -1
  40. data/doc/SDM/DB2i.html +1 -1
  41. data/doc/SDM/DeadlineExceededError.html +1 -1
  42. data/doc/SDM/DeleteResponseMetadata.html +1 -1
  43. data/doc/SDM/Druid.html +1 -1
  44. data/doc/SDM/DynamoDB.html +1 -1
  45. data/doc/SDM/Elastic.html +1 -1
  46. data/doc/SDM/ElasticacheRedis.html +1 -1
  47. data/doc/SDM/Gateway.html +2 -2
  48. data/doc/SDM/GetResponseMetadata.html +1 -1
  49. data/doc/SDM/GoogleGKE.html +1 -1
  50. data/doc/SDM/Greenplum.html +1 -1
  51. data/doc/SDM/HTTPAuth.html +1 -1
  52. data/doc/SDM/HTTPBasicAuth.html +1 -1
  53. data/doc/SDM/HTTPNoAuth.html +1 -1
  54. data/doc/SDM/InternalError.html +1 -1
  55. data/doc/SDM/Kubernetes.html +1 -1
  56. data/doc/SDM/KubernetesBasicAuth.html +1 -1
  57. data/doc/SDM/KubernetesServiceAccount.html +1 -1
  58. data/doc/SDM/Maria.html +1 -1
  59. data/doc/SDM/Memcached.html +1 -1
  60. data/doc/SDM/Memsql.html +1 -1
  61. data/doc/SDM/MongoHost.html +1 -1
  62. data/doc/SDM/MongoLegacyHost.html +1 -1
  63. data/doc/SDM/MongoLegacyReplicaset.html +1 -1
  64. data/doc/SDM/MongoReplicaSet.html +1 -1
  65. data/doc/SDM/Mysql.html +1 -1
  66. data/doc/SDM/NodeCreateResponse.html +1 -1
  67. data/doc/SDM/NodeDeleteResponse.html +1 -1
  68. data/doc/SDM/NodeGetResponse.html +1 -1
  69. data/doc/SDM/NodeUpdateResponse.html +1 -1
  70. data/doc/SDM/Nodes.html +11 -11
  71. data/doc/SDM/NotFoundError.html +1 -1
  72. data/doc/SDM/Oracle.html +1 -1
  73. data/doc/SDM/PermissionError.html +1 -1
  74. data/doc/SDM/Plumbing.html +1 -1
  75. data/doc/SDM/Postgres.html +1 -1
  76. data/doc/SDM/Presto.html +1 -1
  77. data/doc/SDM/RDP.html +1 -1
  78. data/doc/SDM/RPCError.html +1 -1
  79. data/doc/SDM/RateLimitError.html +1 -1
  80. data/doc/SDM/RateLimitMetadata.html +1 -1
  81. data/doc/SDM/Redis.html +1 -1
  82. data/doc/SDM/Redshift.html +1 -1
  83. data/doc/SDM/Relay.html +2 -2
  84. data/doc/SDM/ResourceCreateResponse.html +1 -1
  85. data/doc/SDM/ResourceDeleteResponse.html +1 -1
  86. data/doc/SDM/ResourceGetResponse.html +1 -1
  87. data/doc/SDM/ResourceUpdateResponse.html +1 -1
  88. data/doc/SDM/Resources.html +7 -7
  89. data/doc/SDM/Role.html +4 -4
  90. data/doc/SDM/RoleAttachment.html +1 -1
  91. data/doc/SDM/RoleAttachmentCreateResponse.html +1 -1
  92. data/doc/SDM/RoleAttachmentDeleteResponse.html +1 -1
  93. data/doc/SDM/RoleAttachmentGetResponse.html +1 -1
  94. data/doc/SDM/RoleAttachments.html +6 -6
  95. data/doc/SDM/RoleCreateResponse.html +3 -3
  96. data/doc/SDM/RoleDeleteResponse.html +3 -3
  97. data/doc/SDM/RoleGetResponse.html +3 -3
  98. data/doc/SDM/RoleGrant.html +3 -3
  99. data/doc/SDM/RoleGrantCreateResponse.html +1 -1
  100. data/doc/SDM/RoleGrantDeleteResponse.html +1 -1
  101. data/doc/SDM/RoleGrantGetResponse.html +1 -1
  102. data/doc/SDM/RoleGrants.html +6 -6
  103. data/doc/SDM/RoleUpdateResponse.html +3 -3
  104. data/doc/SDM/Roles.html +7 -7
  105. data/doc/SDM/SQLServer.html +1 -1
  106. data/doc/SDM/SSH.html +1 -1
  107. data/doc/SDM/SSHCert.html +1 -1
  108. data/doc/SDM/Service.html +1 -1
  109. data/doc/SDM/Snowflake.html +1 -1
  110. data/doc/SDM/Sybase.html +1 -1
  111. data/doc/SDM/SybaseIQ.html +1 -1
  112. data/doc/SDM/Teradata.html +1 -1
  113. data/doc/SDM/UpdateResponseMetadata.html +1 -1
  114. data/doc/SDM/User.html +1 -1
  115. data/doc/V1.html +1 -1
  116. data/doc/V1/AccountAttachments.html +1 -1
  117. data/doc/V1/AccountAttachments/Service.html +2 -2
  118. data/doc/V1/AccountGrants.html +1 -1
  119. data/doc/V1/AccountGrants/Service.html +1 -1
  120. data/doc/V1/Accounts.html +1 -1
  121. data/doc/V1/Accounts/Service.html +3 -3
  122. data/doc/V1/Nodes.html +1 -1
  123. data/doc/V1/Nodes/Service.html +5 -5
  124. data/doc/V1/Resources.html +1 -1
  125. data/doc/V1/Resources/Service.html +1 -1
  126. data/doc/V1/RoleAttachments.html +1 -1
  127. data/doc/V1/RoleAttachments/Service.html +1 -1
  128. data/doc/V1/RoleGrants.html +1 -1
  129. data/doc/V1/RoleGrants/Service.html +1 -1
  130. data/doc/V1/Roles.html +1 -1
  131. data/doc/V1/Roles/Service.html +1 -1
  132. data/doc/V1/Tags.html +1 -1
  133. data/doc/created.rid +35 -39
  134. data/doc/css/rdoc.css +13 -5
  135. data/doc/examples/Gemfile.html +1 -3
  136. data/doc/index.html +1 -3
  137. data/doc/js/navigation.js.gz +0 -0
  138. data/doc/js/search_index.js +1 -1
  139. data/doc/js/search_index.js.gz +0 -0
  140. data/doc/js/searcher.js.gz +0 -0
  141. data/doc/lib/version.html +2 -4
  142. data/doc/table_of_contents.html +1 -6
  143. data/examples/Gemfile +2 -2
  144. data/examples/listUsers.rb +8 -8
  145. data/lib/errors/errors.rb +55 -53
  146. data/lib/grpc/account_attachments_pb.rb +9 -9
  147. data/lib/grpc/account_attachments_services_pb.rb +8 -9
  148. data/lib/grpc/account_grants_pb.rb +10 -10
  149. data/lib/grpc/account_grants_services_pb.rb +7 -8
  150. data/lib/grpc/accounts_pb.rb +10 -10
  151. data/lib/grpc/accounts_services_pb.rb +10 -12
  152. data/lib/grpc/drivers_pb.rb +8 -8
  153. data/lib/grpc/nodes_pb.rb +10 -10
  154. data/lib/grpc/nodes_services_pb.rb +10 -12
  155. data/lib/grpc/options_pb.rb +5 -5
  156. data/lib/grpc/plumbing.rb +4386 -4387
  157. data/lib/grpc/protoc-gen-swagger/options/annotations_pb.rb +4 -4
  158. data/lib/grpc/resources_pb.rb +9 -9
  159. data/lib/grpc/resources_services_pb.rb +7 -8
  160. data/lib/grpc/role_attachments_pb.rb +9 -9
  161. data/lib/grpc/role_attachments_services_pb.rb +7 -8
  162. data/lib/grpc/role_grants_pb.rb +9 -9
  163. data/lib/grpc/role_grants_services_pb.rb +7 -8
  164. data/lib/grpc/roles_pb.rb +10 -10
  165. data/lib/grpc/roles_services_pb.rb +7 -8
  166. data/lib/grpc/spec_pb.rb +7 -7
  167. data/lib/grpc/tags_pb.rb +6 -6
  168. data/lib/models/porcelain.rb +12 -5354
  169. data/lib/strongdm.rb +92 -95
  170. data/lib/svc.rb +1198 -1222
  171. data/lib/version +1 -1
  172. data/lib/version.rb +1 -1
  173. data/strongdm.gemspec +10 -10
  174. metadata +3 -3
@@ -1,17 +1,17 @@
1
1
  # Copyright 2020 StrongDM Inc
2
- #
2
+ #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
- #
6
+ #
7
7
  # http://www.apache.org/licenses/LICENSE-2.0
8
- #
8
+ #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- #
14
+ #
15
15
 
16
16
  # This file was generated by protogen. DO NOT EDIT.
17
17
 
@@ -25,104 +25,101 @@ DEFAULT_MAX_RETRY_DELAY = 300 # 300 seconds
25
25
 
26
26
  module SDM
27
27
 
28
- # Client bundles all the services together and initializes them.
29
- class Client
30
- # Creates a new strongDM API client.
31
- def initialize(api_access_key, api_secret_key, host:"api.strongdm.com:443", insecure:false)
32
- @api_access_key = api_access_key
33
- @api_secret_key = Base64.strict_decode64(api_secret_key)
34
- @max_retries = DEFAULT_MAX_RETRIES
35
- @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
36
- @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
37
- @account_attachments = AccountAttachments.new(host, insecure, self)
38
- @account_grants = AccountGrants.new(host, insecure, self)
39
- @accounts = Accounts.new(host, insecure, self)
40
- @nodes = Nodes.new(host, insecure, self)
41
- @resources = Resources.new(host, insecure, self)
42
- @role_attachments = RoleAttachments.new(host, insecure, self)
43
- @role_grants = RoleGrants.new(host, insecure, self)
44
- @roles = Roles.new(host, insecure, self)
45
- @_test_options = Hash.new
46
- end
47
-
48
- def get_metadata(method_name, req)
49
- return { 'x-sdm-authentication': @api_access_key,'x-sdm-signature': self.sign(method_name, req.to_proto)}
50
- end
51
-
52
- def sign(method_name, msg_bytes)
53
- current_utc_date = Time.now.utc
54
- date = sprintf("%04d-%02d-%02d",current_utc_date.year, current_utc_date.month, current_utc_date.day)
55
-
56
- signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
57
- signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, 'sdm_api_v1')
28
+ # Client bundles all the services together and initializes them.
29
+ class Client
30
+ # Creates a new strongDM API client.
31
+ def initialize(api_access_key, api_secret_key, host: "api.strongdm.com:443", insecure: false)
32
+ @api_access_key = api_access_key
33
+ @api_secret_key = Base64.strict_decode64(api_secret_key)
34
+ @max_retries = DEFAULT_MAX_RETRIES
35
+ @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
36
+ @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
37
+ @account_attachments = AccountAttachments.new(host, insecure, self)
38
+ @account_grants = AccountGrants.new(host, insecure, self)
39
+ @accounts = Accounts.new(host, insecure, self)
40
+ @nodes = Nodes.new(host, insecure, self)
41
+ @resources = Resources.new(host, insecure, self)
42
+ @role_attachments = RoleAttachments.new(host, insecure, self)
43
+ @role_grants = RoleGrants.new(host, insecure, self)
44
+ @roles = Roles.new(host, insecure, self)
45
+ @_test_options = Hash.new
46
+ end
58
47
 
59
- sha_req = Digest::SHA256.new
60
- sha_req << method_name
61
- sha_req << "\n"
62
- sha_req << msg_bytes
63
- request_hash = sha_req.digest
48
+ def get_metadata(method_name, req)
49
+ return { 'x-sdm-authentication': @api_access_key, 'x-sdm-signature': self.sign(method_name, req.to_proto) }
50
+ end
64
51
 
65
- return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
66
- end
52
+ def sign(method_name, msg_bytes)
53
+ current_utc_date = Time.now.utc
54
+ date = sprintf("%04d-%02d-%02d", current_utc_date.year, current_utc_date.month, current_utc_date.day)
67
55
 
68
- def jitterSleep(iter)
69
- dur_max = @base_retry_delay * 2**iter
70
- if (dur_max > @max_retry_delay)
71
- dur_max = @max_retry_delay
72
- end
73
- dur = rand() * dur_max
74
- sleep(dur)
75
- end
56
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
57
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, "sdm_api_v1")
76
58
 
77
- def shouldRetry(iter, err)
78
- if (iter >= @max_retries-1)
79
- return false
80
- end
81
- if not err .is_a? GRPC::BadStatus
82
- return true
83
- end
84
- return err.code() == 13
85
- end
59
+ sha_req = Digest::SHA256.new
60
+ sha_req << method_name
61
+ sha_req << "\n"
62
+ sha_req << msg_bytes
63
+ request_hash = sha_req.digest
86
64
 
87
- attr_reader :max_retries
88
- attr_reader :base_retry_delay
89
- attr_reader :max_retry_delay
65
+ return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
66
+ end
90
67
 
91
- # API authentication token (read-only).
92
- attr_reader :api_access_key
93
- # AccountAttachments assign an account to a role.
94
- attr_reader :account_attachments
95
- # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
96
- attr_reader :account_grants
97
- # Accounts are users that have access to strongDM.
98
- # There are two types of accounts:
99
- # 1. **Regular users:** humans who are authenticated through username and password or SSO
100
- # 2. **Service users:** machines that are authneticated using a service token
101
- attr_reader :accounts
102
- # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
103
- # There are two types of nodes:
104
- # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
105
- # 1. **Gateways:** a relay that also listens for connections from strongDM clients
106
- attr_reader :nodes
68
+ def jitterSleep(iter)
69
+ dur_max = @base_retry_delay * 2 ** iter
70
+ if (dur_max > @max_retry_delay)
71
+ dur_max = @max_retry_delay
72
+ end
73
+ dur = rand() * dur_max
74
+ sleep(dur)
75
+ end
107
76
 
108
- attr_reader :resources
109
- # RoleAttachments represent relationships between composite roles and the roles
110
- # that make up those composite roles. When a composite role is attached to another
111
- # role, the permissions granted to members of the composite role are augmented to
112
- # include the permissions granted to members of the attached role.
113
- attr_reader :role_attachments
114
- # RoleGrants represent relationships between composite roles and the roles
115
- # that make up those composite roles. When a composite role is attached to another
116
- # role, the permissions granted to members of the composite role are augmented to
117
- # include the permissions granted to members of the attached role.
118
- attr_reader :role_grants
119
- # Roles are tools for controlling user access to resources. Each Role holds a
120
- # list of resources which they grant access to. Composite roles are a special
121
- # type of Role which have no resource associations of their own, but instead
122
- # grant access to the combined resources associated with a set of child roles.
123
- # Each user can be a member of one Role or composite role.
124
- attr_reader :roles
125
- attr_reader :_test_options
77
+ def shouldRetry(iter, err)
78
+ if (iter >= @max_retries - 1)
79
+ return false
80
+ end
81
+ if not err.is_a? GRPC::BadStatus
82
+ return true
83
+ end
84
+ return err.code() == 13
126
85
  end
127
86
 
87
+ attr_reader :max_retries
88
+ attr_reader :base_retry_delay
89
+ attr_reader :max_retry_delay
90
+
91
+ # API authentication token (read-only).
92
+ attr_reader :api_access_key
93
+ # AccountAttachments assign an account to a role or composite role.
94
+ attr_reader :account_attachments
95
+ # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
96
+ attr_reader :account_grants
97
+ # Accounts are users that have access to strongDM. There are two types of accounts:
98
+ # 1. **Users:** humans who are authenticated through username and password or SSO.
99
+ # 2. **Service Accounts:** machines that are authenticated using a service token.
100
+ attr_reader :accounts
101
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
102
+ # - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
103
+ # - **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.
104
+ attr_reader :nodes
105
+
106
+ attr_reader :resources
107
+ # RoleAttachments represent relationships between composite roles and the roles
108
+ # that make up those composite roles. When a composite role is attached to another
109
+ # role, the permissions granted to members of the composite role are augmented to
110
+ # include the permissions granted to members of the attached role.
111
+ attr_reader :role_attachments
112
+ # RoleGrants represent relationships between composite roles and the roles
113
+ # that make up those composite roles. When a composite role is attached to another
114
+ # role, the permissions granted to members of the composite role are augmented to
115
+ # include the permissions granted to members of the attached role.
116
+ attr_reader :role_grants
117
+ # Roles are tools for controlling user access to resources. Each Role holds a
118
+ # list of resources which they grant access to. Composite roles are a special
119
+ # type of Role which have no resource associations of their own, but instead
120
+ # grant access to the combined resources associated with a set of child roles.
121
+ # Each user can be a member of one Role or composite role.
122
+ attr_reader :roles
123
+ attr_reader :_test_options
124
+ end
128
125
  end
data/lib/svc.rb CHANGED
@@ -1,1329 +1,1305 @@
1
1
  # Copyright 2020 StrongDM Inc
2
- #
2
+ #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
- #
6
+ #
7
7
  # http://www.apache.org/licenses/LICENSE-2.0
8
- #
8
+ #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- #
14
+ #
15
15
 
16
16
  # This file was generated by protogen. DO NOT EDIT.
17
17
 
18
18
  this_dir = File.expand_path(File.dirname(__FILE__))
19
- lib_dir = File.join(this_dir, 'grpc')
19
+ lib_dir = File.join(this_dir, "grpc")
20
20
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
21
- require 'grpc'
22
- require 'enumerator'
23
- Dir[File.join(__dir__, 'grpc', '*.rb')].each {|file| require file }
24
- Dir[File.join(__dir__, 'models', '*.rb')].each {|file| require file }
21
+ require "grpc"
22
+ require "enumerator"
23
+ Dir[File.join(__dir__, "grpc", "*.rb")].each { |file| require file }
24
+ Dir[File.join(__dir__, "models", "*.rb")].each { |file| require file }
25
25
 
26
26
  module SDM
27
- # AccountAttachments assign an account to a role.
28
- class AccountAttachments
29
- def initialize(host, insecure, parent)
30
- begin
31
- if insecure
32
- @stub = V1::AccountAttachments::Stub.new(host, :this_channel_is_insecure)
33
- else
34
- cred = GRPC::Core::ChannelCredentials.new()
35
- @stub = V1::AccountAttachments::Stub.new(host, cred)
36
- end
37
- rescue => exception
38
- raise Plumbing::convert_error_to_porcelain(exception)
39
- end
40
- @parent = parent
27
+ # AccountAttachments assign an account to a role or composite role.
28
+ class AccountAttachments
29
+ def initialize(host, insecure, parent)
30
+ begin
31
+ if insecure
32
+ @stub = V1::AccountAttachments::Stub.new(host, :this_channel_is_insecure)
33
+ else
34
+ cred = GRPC::Core::ChannelCredentials.new()
35
+ @stub = V1::AccountAttachments::Stub.new(host, cred)
41
36
  end
42
- # Create registers a new AccountAttachment.
43
- def create(
44
- account_attachment \
45
- ,
46
- deadline:nil)
47
- req = V1::AccountAttachmentCreateRequest.new()
48
-
49
- req.account_attachment = Plumbing::convert_account_attachment_to_plumbing(account_attachment)
50
- tries = 0
51
- plumbing_response = nil
52
- loop do
53
- begin
54
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('AccountAttachments.Create', req), deadline:deadline)
55
- rescue => exception
56
- if (@parent.shouldRetry(tries, exception))
57
- tries++
58
- @parent.jitterSleep(tries)
59
- next
60
- end
61
- raise Plumbing::convert_error_to_porcelain(exception)
62
- end
63
- break
64
- end
37
+ rescue => exception
38
+ raise Plumbing::convert_error_to_porcelain(exception)
39
+ end
40
+ @parent = parent
41
+ end
65
42
 
66
-
67
- resp = AccountAttachmentCreateResponse.new()
68
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
69
- resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
70
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
71
- resp
43
+ # Create registers a new AccountAttachment.
44
+ def create(
45
+ account_attachment,
46
+ deadline: nil
47
+ )
48
+ req = V1::AccountAttachmentCreateRequest.new()
49
+
50
+ req.account_attachment = Plumbing::convert_account_attachment_to_plumbing(account_attachment)
51
+ tries = 0
52
+ plumbing_response = nil
53
+ loop do
54
+ begin
55
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("AccountAttachments.Create", req), deadline: deadline)
56
+ rescue => exception
57
+ if (@parent.shouldRetry(tries, exception))
58
+ tries + +@parent.jitterSleep(tries)
59
+ next
60
+ end
61
+ raise Plumbing::convert_error_to_porcelain(exception)
72
62
  end
73
- # Get reads one AccountAttachment by ID.
74
- def get(
75
- id \
76
- ,
77
- deadline:nil)
78
- req = V1::AccountAttachmentGetRequest.new()
79
-
80
- req.id = (id)
81
- tries = 0
82
- plumbing_response = nil
83
- loop do
84
- begin
85
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('AccountAttachments.Get', req), deadline:deadline)
86
- rescue => exception
87
- if (@parent.shouldRetry(tries, exception))
88
- tries++
89
- @parent.jitterSleep(tries)
90
- next
91
- end
92
- raise Plumbing::convert_error_to_porcelain(exception)
93
- end
94
- break
95
- end
63
+ break
64
+ end
96
65
 
97
-
98
- resp = AccountAttachmentGetResponse.new()
99
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
100
- resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
101
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
102
- resp
66
+ resp = AccountAttachmentCreateResponse.new()
67
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
68
+ resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
69
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
70
+ resp
71
+ end
72
+
73
+ # Get reads one AccountAttachment by ID.
74
+ def get(
75
+ id,
76
+ deadline: nil
77
+ )
78
+ req = V1::AccountAttachmentGetRequest.new()
79
+
80
+ req.id = (id)
81
+ tries = 0
82
+ plumbing_response = nil
83
+ loop do
84
+ begin
85
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("AccountAttachments.Get", req), deadline: deadline)
86
+ rescue => exception
87
+ if (@parent.shouldRetry(tries, exception))
88
+ tries + +@parent.jitterSleep(tries)
89
+ next
90
+ end
91
+ raise Plumbing::convert_error_to_porcelain(exception)
103
92
  end
104
- # Delete removes a AccountAttachment by ID.
105
- def delete(
106
- id \
107
- ,
108
- deadline:nil)
109
- req = V1::AccountAttachmentDeleteRequest.new()
110
-
111
- req.id = (id)
112
- tries = 0
113
- plumbing_response = nil
114
- loop do
115
- begin
116
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('AccountAttachments.Delete', req), deadline:deadline)
117
- rescue => exception
118
- if (@parent.shouldRetry(tries, exception))
119
- tries++
120
- @parent.jitterSleep(tries)
121
- next
122
- end
123
- raise Plumbing::convert_error_to_porcelain(exception)
124
- end
125
- break
126
- end
93
+ break
94
+ end
127
95
 
128
-
129
- resp = AccountAttachmentDeleteResponse.new()
130
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
131
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
132
- resp
96
+ resp = AccountAttachmentGetResponse.new()
97
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
98
+ resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
99
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
100
+ resp
101
+ end
102
+
103
+ # Delete removes a AccountAttachment by ID.
104
+ def delete(
105
+ id,
106
+ deadline: nil
107
+ )
108
+ req = V1::AccountAttachmentDeleteRequest.new()
109
+
110
+ req.id = (id)
111
+ tries = 0
112
+ plumbing_response = nil
113
+ loop do
114
+ begin
115
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("AccountAttachments.Delete", req), deadline: deadline)
116
+ rescue => exception
117
+ if (@parent.shouldRetry(tries, exception))
118
+ tries + +@parent.jitterSleep(tries)
119
+ next
120
+ end
121
+ raise Plumbing::convert_error_to_porcelain(exception)
133
122
  end
134
- # List gets a list of AccountAttachments matching a given set of criteria.
135
- def list(
136
- filter \
137
- ,
138
- *args,
139
- deadline:nil)
140
- req = V1::AccountAttachmentListRequest.new()
141
- req.meta = V1::ListRequestMetadata.new()
142
- page_size_option = @parent._test_options['PageSize']
143
- if page_size_option.is_a? Integer
144
- req.meta.limit = page_size_option
123
+ break
124
+ end
125
+
126
+ resp = AccountAttachmentDeleteResponse.new()
127
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
128
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
129
+ resp
130
+ end
131
+
132
+ # List gets a list of AccountAttachments matching a given set of criteria.
133
+ def list(
134
+ filter,
135
+ *args,
136
+ deadline: nil
137
+ )
138
+ req = V1::AccountAttachmentListRequest.new()
139
+ req.meta = V1::ListRequestMetadata.new()
140
+ page_size_option = @parent._test_options["PageSize"]
141
+ if page_size_option.is_a? Integer
142
+ req.meta.limit = page_size_option
143
+ end
144
+
145
+ req.filter = Plumbing::quote_filter_args(filter, *args)
146
+ resp = Enumerator::Generator.new { |g|
147
+ tries = 0
148
+ loop do
149
+ begin
150
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("AccountAttachments.List", req), deadline: deadline)
151
+ rescue => exception
152
+ if (@parent.shouldRetry(tries, exception))
153
+ tries + +@parent.jitterSleep(tries)
154
+ next
145
155
  end
146
-
147
- req.filter = Plumbing::quote_filter_args(filter, *args)
148
- resp = Enumerator::Generator.new { |g|
149
- tries = 0
150
- loop do
151
- begin
152
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('AccountAttachments.List', req), deadline:deadline)
153
- rescue => exception
154
- if (@parent.shouldRetry(tries, exception))
155
- tries++
156
- @parent.jitterSleep(tries)
157
- next
158
- end
159
- raise Plumbing::convert_error_to_porcelain(exception)
160
- end
161
- tries = 0
162
- plumbing_response.account_attachments.each do |plumbing_item|
163
- g.yield Plumbing::convert_account_attachment_to_porcelain(plumbing_item)
164
- end
165
- break if plumbing_response.meta.next_cursor == ""
166
- req.meta.cursor = plumbing_response.meta.next_cursor
167
- end
168
- }
169
- resp
156
+ raise Plumbing::convert_error_to_porcelain(exception)
157
+ end
158
+ tries = 0
159
+ plumbing_response.account_attachments.each do |plumbing_item|
160
+ g.yield Plumbing::convert_account_attachment_to_porcelain(plumbing_item)
161
+ end
162
+ break if plumbing_response.meta.next_cursor == ""
163
+ req.meta.cursor = plumbing_response.meta.next_cursor
170
164
  end
165
+ }
166
+ resp
171
167
  end
172
- # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
173
- class AccountGrants
174
- def initialize(host, insecure, parent)
175
- begin
176
- if insecure
177
- @stub = V1::AccountGrants::Stub.new(host, :this_channel_is_insecure)
178
- else
179
- cred = GRPC::Core::ChannelCredentials.new()
180
- @stub = V1::AccountGrants::Stub.new(host, cred)
181
- end
182
- rescue => exception
183
- raise Plumbing::convert_error_to_porcelain(exception)
184
- end
185
- @parent = parent
168
+ end
169
+
170
+ # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
171
+ class AccountGrants
172
+ def initialize(host, insecure, parent)
173
+ begin
174
+ if insecure
175
+ @stub = V1::AccountGrants::Stub.new(host, :this_channel_is_insecure)
176
+ else
177
+ cred = GRPC::Core::ChannelCredentials.new()
178
+ @stub = V1::AccountGrants::Stub.new(host, cred)
186
179
  end
187
- # Create registers a new AccountGrant.
188
- def create(
189
- account_grant \
190
- ,
191
- deadline:nil)
192
- req = V1::AccountGrantCreateRequest.new()
193
-
194
- req.account_grant = Plumbing::convert_account_grant_to_plumbing(account_grant)
195
- tries = 0
196
- plumbing_response = nil
197
- loop do
198
- begin
199
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('AccountGrants.Create', req), deadline:deadline)
200
- rescue => exception
201
- if (@parent.shouldRetry(tries, exception))
202
- tries++
203
- @parent.jitterSleep(tries)
204
- next
205
- end
206
- raise Plumbing::convert_error_to_porcelain(exception)
207
- end
208
- break
209
- end
180
+ rescue => exception
181
+ raise Plumbing::convert_error_to_porcelain(exception)
182
+ end
183
+ @parent = parent
184
+ end
185
+
186
+ # Create registers a new AccountGrant.
187
+ def create(
188
+ account_grant,
189
+ deadline: nil
190
+ )
191
+ req = V1::AccountGrantCreateRequest.new()
210
192
 
211
-
212
- resp = AccountGrantCreateResponse.new()
213
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
214
- resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
215
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
216
- resp
193
+ req.account_grant = Plumbing::convert_account_grant_to_plumbing(account_grant)
194
+ tries = 0
195
+ plumbing_response = nil
196
+ loop do
197
+ begin
198
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("AccountGrants.Create", req), deadline: deadline)
199
+ rescue => exception
200
+ if (@parent.shouldRetry(tries, exception))
201
+ tries + +@parent.jitterSleep(tries)
202
+ next
203
+ end
204
+ raise Plumbing::convert_error_to_porcelain(exception)
217
205
  end
218
- # Get reads one AccountGrant by ID.
219
- def get(
220
- id \
221
- ,
222
- deadline:nil)
223
- req = V1::AccountGrantGetRequest.new()
224
-
225
- req.id = (id)
226
- tries = 0
227
- plumbing_response = nil
228
- loop do
229
- begin
230
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('AccountGrants.Get', req), deadline:deadline)
231
- rescue => exception
232
- if (@parent.shouldRetry(tries, exception))
233
- tries++
234
- @parent.jitterSleep(tries)
235
- next
236
- end
237
- raise Plumbing::convert_error_to_porcelain(exception)
238
- end
239
- break
240
- end
206
+ break
207
+ end
208
+
209
+ resp = AccountGrantCreateResponse.new()
210
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
211
+ resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
212
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
213
+ resp
214
+ end
241
215
 
242
-
243
- resp = AccountGrantGetResponse.new()
244
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
245
- resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
246
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
247
- resp
216
+ # Get reads one AccountGrant by ID.
217
+ def get(
218
+ id,
219
+ deadline: nil
220
+ )
221
+ req = V1::AccountGrantGetRequest.new()
222
+
223
+ req.id = (id)
224
+ tries = 0
225
+ plumbing_response = nil
226
+ loop do
227
+ begin
228
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("AccountGrants.Get", req), deadline: deadline)
229
+ rescue => exception
230
+ if (@parent.shouldRetry(tries, exception))
231
+ tries + +@parent.jitterSleep(tries)
232
+ next
233
+ end
234
+ raise Plumbing::convert_error_to_porcelain(exception)
248
235
  end
249
- # Delete removes a AccountGrant by ID.
250
- def delete(
251
- id \
252
- ,
253
- deadline:nil)
254
- req = V1::AccountGrantDeleteRequest.new()
255
-
256
- req.id = (id)
257
- tries = 0
258
- plumbing_response = nil
259
- loop do
260
- begin
261
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('AccountGrants.Delete', req), deadline:deadline)
262
- rescue => exception
263
- if (@parent.shouldRetry(tries, exception))
264
- tries++
265
- @parent.jitterSleep(tries)
266
- next
267
- end
268
- raise Plumbing::convert_error_to_porcelain(exception)
269
- end
270
- break
271
- end
236
+ break
237
+ end
238
+
239
+ resp = AccountGrantGetResponse.new()
240
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
241
+ resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
242
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
243
+ resp
244
+ end
245
+
246
+ # Delete removes a AccountGrant by ID.
247
+ def delete(
248
+ id,
249
+ deadline: nil
250
+ )
251
+ req = V1::AccountGrantDeleteRequest.new()
272
252
 
273
-
274
- resp = AccountGrantDeleteResponse.new()
275
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
276
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
277
- resp
253
+ req.id = (id)
254
+ tries = 0
255
+ plumbing_response = nil
256
+ loop do
257
+ begin
258
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("AccountGrants.Delete", req), deadline: deadline)
259
+ rescue => exception
260
+ if (@parent.shouldRetry(tries, exception))
261
+ tries + +@parent.jitterSleep(tries)
262
+ next
263
+ end
264
+ raise Plumbing::convert_error_to_porcelain(exception)
278
265
  end
279
- # List gets a list of AccountGrants matching a given set of criteria.
280
- def list(
281
- filter \
282
- ,
283
- *args,
284
- deadline:nil)
285
- req = V1::AccountGrantListRequest.new()
286
- req.meta = V1::ListRequestMetadata.new()
287
- page_size_option = @parent._test_options['PageSize']
288
- if page_size_option.is_a? Integer
289
- req.meta.limit = page_size_option
266
+ break
267
+ end
268
+
269
+ resp = AccountGrantDeleteResponse.new()
270
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
271
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
272
+ resp
273
+ end
274
+
275
+ # List gets a list of AccountGrants matching a given set of criteria.
276
+ def list(
277
+ filter,
278
+ *args,
279
+ deadline: nil
280
+ )
281
+ req = V1::AccountGrantListRequest.new()
282
+ req.meta = V1::ListRequestMetadata.new()
283
+ page_size_option = @parent._test_options["PageSize"]
284
+ if page_size_option.is_a? Integer
285
+ req.meta.limit = page_size_option
286
+ end
287
+
288
+ req.filter = Plumbing::quote_filter_args(filter, *args)
289
+ resp = Enumerator::Generator.new { |g|
290
+ tries = 0
291
+ loop do
292
+ begin
293
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("AccountGrants.List", req), deadline: deadline)
294
+ rescue => exception
295
+ if (@parent.shouldRetry(tries, exception))
296
+ tries + +@parent.jitterSleep(tries)
297
+ next
290
298
  end
291
-
292
- req.filter = Plumbing::quote_filter_args(filter, *args)
293
- resp = Enumerator::Generator.new { |g|
294
- tries = 0
295
- loop do
296
- begin
297
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('AccountGrants.List', req), deadline:deadline)
298
- rescue => exception
299
- if (@parent.shouldRetry(tries, exception))
300
- tries++
301
- @parent.jitterSleep(tries)
302
- next
303
- end
304
- raise Plumbing::convert_error_to_porcelain(exception)
305
- end
306
- tries = 0
307
- plumbing_response.account_grants.each do |plumbing_item|
308
- g.yield Plumbing::convert_account_grant_to_porcelain(plumbing_item)
309
- end
310
- break if plumbing_response.meta.next_cursor == ""
311
- req.meta.cursor = plumbing_response.meta.next_cursor
312
- end
313
- }
314
- resp
299
+ raise Plumbing::convert_error_to_porcelain(exception)
300
+ end
301
+ tries = 0
302
+ plumbing_response.account_grants.each do |plumbing_item|
303
+ g.yield Plumbing::convert_account_grant_to_porcelain(plumbing_item)
304
+ end
305
+ break if plumbing_response.meta.next_cursor == ""
306
+ req.meta.cursor = plumbing_response.meta.next_cursor
315
307
  end
308
+ }
309
+ resp
316
310
  end
317
- # Accounts are users that have access to strongDM.
318
- # There are two types of accounts:
319
- # 1. **Regular users:** humans who are authenticated through username and password or SSO
320
- # 2. **Service users:** machines that are authneticated using a service token
321
- class Accounts
322
- def initialize(host, insecure, parent)
323
- begin
324
- if insecure
325
- @stub = V1::Accounts::Stub.new(host, :this_channel_is_insecure)
326
- else
327
- cred = GRPC::Core::ChannelCredentials.new()
328
- @stub = V1::Accounts::Stub.new(host, cred)
329
- end
330
- rescue => exception
331
- raise Plumbing::convert_error_to_porcelain(exception)
332
- end
333
- @parent = parent
311
+ end
312
+
313
+ # Accounts are users that have access to strongDM. There are two types of accounts:
314
+ # 1. **Users:** humans who are authenticated through username and password or SSO.
315
+ # 2. **Service Accounts:** machines that are authenticated using a service token.
316
+ class Accounts
317
+ def initialize(host, insecure, parent)
318
+ begin
319
+ if insecure
320
+ @stub = V1::Accounts::Stub.new(host, :this_channel_is_insecure)
321
+ else
322
+ cred = GRPC::Core::ChannelCredentials.new()
323
+ @stub = V1::Accounts::Stub.new(host, cred)
334
324
  end
335
- # Create registers a new Account.
336
- def create(
337
- account \
338
- ,
339
- deadline:nil)
340
- req = V1::AccountCreateRequest.new()
341
-
342
- req.account = Plumbing::convert_account_to_plumbing(account)
343
- tries = 0
344
- plumbing_response = nil
345
- loop do
346
- begin
347
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Accounts.Create', req), deadline:deadline)
348
- rescue => exception
349
- if (@parent.shouldRetry(tries, exception))
350
- tries++
351
- @parent.jitterSleep(tries)
352
- next
353
- end
354
- raise Plumbing::convert_error_to_porcelain(exception)
355
- end
356
- break
357
- end
325
+ rescue => exception
326
+ raise Plumbing::convert_error_to_porcelain(exception)
327
+ end
328
+ @parent = parent
329
+ end
330
+
331
+ # Create registers a new Account.
332
+ def create(
333
+ account,
334
+ deadline: nil
335
+ )
336
+ req = V1::AccountCreateRequest.new()
358
337
 
359
-
360
- resp = AccountCreateResponse.new()
361
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
362
- resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
363
- resp.token = (plumbing_response.token)
364
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
365
- resp
338
+ req.account = Plumbing::convert_account_to_plumbing(account)
339
+ tries = 0
340
+ plumbing_response = nil
341
+ loop do
342
+ begin
343
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Accounts.Create", req), deadline: deadline)
344
+ rescue => exception
345
+ if (@parent.shouldRetry(tries, exception))
346
+ tries + +@parent.jitterSleep(tries)
347
+ next
348
+ end
349
+ raise Plumbing::convert_error_to_porcelain(exception)
366
350
  end
367
- # Get reads one Account by ID.
368
- def get(
369
- id \
370
- ,
371
- deadline:nil)
372
- req = V1::AccountGetRequest.new()
373
-
374
- req.id = (id)
375
- tries = 0
376
- plumbing_response = nil
377
- loop do
378
- begin
379
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Accounts.Get', req), deadline:deadline)
380
- rescue => exception
381
- if (@parent.shouldRetry(tries, exception))
382
- tries++
383
- @parent.jitterSleep(tries)
384
- next
385
- end
386
- raise Plumbing::convert_error_to_porcelain(exception)
387
- end
388
- break
389
- end
351
+ break
352
+ end
353
+
354
+ resp = AccountCreateResponse.new()
355
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
356
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
357
+ resp.token = (plumbing_response.token)
358
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
359
+ resp
360
+ end
390
361
 
391
-
392
- resp = AccountGetResponse.new()
393
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
394
- resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
395
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
396
- resp
362
+ # Get reads one Account by ID.
363
+ def get(
364
+ id,
365
+ deadline: nil
366
+ )
367
+ req = V1::AccountGetRequest.new()
368
+
369
+ req.id = (id)
370
+ tries = 0
371
+ plumbing_response = nil
372
+ loop do
373
+ begin
374
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Accounts.Get", req), deadline: deadline)
375
+ rescue => exception
376
+ if (@parent.shouldRetry(tries, exception))
377
+ tries + +@parent.jitterSleep(tries)
378
+ next
379
+ end
380
+ raise Plumbing::convert_error_to_porcelain(exception)
397
381
  end
398
- # Update patches a Account by ID.
399
- def update(
400
- account \
401
- ,
402
- deadline:nil)
403
- req = V1::AccountUpdateRequest.new()
404
-
405
- req.account = Plumbing::convert_account_to_plumbing(account)
406
- tries = 0
407
- plumbing_response = nil
408
- loop do
409
- begin
410
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Accounts.Update', req), deadline:deadline)
411
- rescue => exception
412
- if (@parent.shouldRetry(tries, exception))
413
- tries++
414
- @parent.jitterSleep(tries)
415
- next
416
- end
417
- raise Plumbing::convert_error_to_porcelain(exception)
418
- end
419
- break
420
- end
382
+ break
383
+ end
421
384
 
422
-
423
- resp = AccountUpdateResponse.new()
424
- resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
425
- resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
426
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
427
- resp
385
+ resp = AccountGetResponse.new()
386
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
387
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
388
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
389
+ resp
390
+ end
391
+
392
+ # Update patches a Account by ID.
393
+ def update(
394
+ account,
395
+ deadline: nil
396
+ )
397
+ req = V1::AccountUpdateRequest.new()
398
+
399
+ req.account = Plumbing::convert_account_to_plumbing(account)
400
+ tries = 0
401
+ plumbing_response = nil
402
+ loop do
403
+ begin
404
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Accounts.Update", req), deadline: deadline)
405
+ rescue => exception
406
+ if (@parent.shouldRetry(tries, exception))
407
+ tries + +@parent.jitterSleep(tries)
408
+ next
409
+ end
410
+ raise Plumbing::convert_error_to_porcelain(exception)
428
411
  end
429
- # Delete removes a Account by ID.
430
- def delete(
431
- id \
432
- ,
433
- deadline:nil)
434
- req = V1::AccountDeleteRequest.new()
435
-
436
- req.id = (id)
437
- tries = 0
438
- plumbing_response = nil
439
- loop do
440
- begin
441
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Accounts.Delete', req), deadline:deadline)
442
- rescue => exception
443
- if (@parent.shouldRetry(tries, exception))
444
- tries++
445
- @parent.jitterSleep(tries)
446
- next
447
- end
448
- raise Plumbing::convert_error_to_porcelain(exception)
449
- end
450
- break
451
- end
412
+ break
413
+ end
452
414
 
453
-
454
- resp = AccountDeleteResponse.new()
455
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
456
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
457
- resp
415
+ resp = AccountUpdateResponse.new()
416
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
417
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
418
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
419
+ resp
420
+ end
421
+
422
+ # Delete removes a Account by ID.
423
+ def delete(
424
+ id,
425
+ deadline: nil
426
+ )
427
+ req = V1::AccountDeleteRequest.new()
428
+
429
+ req.id = (id)
430
+ tries = 0
431
+ plumbing_response = nil
432
+ loop do
433
+ begin
434
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Accounts.Delete", req), deadline: deadline)
435
+ rescue => exception
436
+ if (@parent.shouldRetry(tries, exception))
437
+ tries + +@parent.jitterSleep(tries)
438
+ next
439
+ end
440
+ raise Plumbing::convert_error_to_porcelain(exception)
458
441
  end
459
- # List gets a list of Accounts matching a given set of criteria.
460
- def list(
461
- filter \
462
- ,
463
- *args,
464
- deadline:nil)
465
- req = V1::AccountListRequest.new()
466
- req.meta = V1::ListRequestMetadata.new()
467
- page_size_option = @parent._test_options['PageSize']
468
- if page_size_option.is_a? Integer
469
- req.meta.limit = page_size_option
442
+ break
443
+ end
444
+
445
+ resp = AccountDeleteResponse.new()
446
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
447
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
448
+ resp
449
+ end
450
+
451
+ # List gets a list of Accounts matching a given set of criteria.
452
+ def list(
453
+ filter,
454
+ *args,
455
+ deadline: nil
456
+ )
457
+ req = V1::AccountListRequest.new()
458
+ req.meta = V1::ListRequestMetadata.new()
459
+ page_size_option = @parent._test_options["PageSize"]
460
+ if page_size_option.is_a? Integer
461
+ req.meta.limit = page_size_option
462
+ end
463
+
464
+ req.filter = Plumbing::quote_filter_args(filter, *args)
465
+ resp = Enumerator::Generator.new { |g|
466
+ tries = 0
467
+ loop do
468
+ begin
469
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Accounts.List", req), deadline: deadline)
470
+ rescue => exception
471
+ if (@parent.shouldRetry(tries, exception))
472
+ tries + +@parent.jitterSleep(tries)
473
+ next
470
474
  end
471
-
472
- req.filter = Plumbing::quote_filter_args(filter, *args)
473
- resp = Enumerator::Generator.new { |g|
474
- tries = 0
475
- loop do
476
- begin
477
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Accounts.List', req), deadline:deadline)
478
- rescue => exception
479
- if (@parent.shouldRetry(tries, exception))
480
- tries++
481
- @parent.jitterSleep(tries)
482
- next
483
- end
484
- raise Plumbing::convert_error_to_porcelain(exception)
485
- end
486
- tries = 0
487
- plumbing_response.accounts.each do |plumbing_item|
488
- g.yield Plumbing::convert_account_to_porcelain(plumbing_item)
489
- end
490
- break if plumbing_response.meta.next_cursor == ""
491
- req.meta.cursor = plumbing_response.meta.next_cursor
492
- end
493
- }
494
- resp
475
+ raise Plumbing::convert_error_to_porcelain(exception)
476
+ end
477
+ tries = 0
478
+ plumbing_response.accounts.each do |plumbing_item|
479
+ g.yield Plumbing::convert_account_to_porcelain(plumbing_item)
480
+ end
481
+ break if plumbing_response.meta.next_cursor == ""
482
+ req.meta.cursor = plumbing_response.meta.next_cursor
495
483
  end
484
+ }
485
+ resp
496
486
  end
497
- # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
498
- # There are two types of nodes:
499
- # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
500
- # 1. **Gateways:** a relay that also listens for connections from strongDM clients
501
- class Nodes
502
- def initialize(host, insecure, parent)
503
- begin
504
- if insecure
505
- @stub = V1::Nodes::Stub.new(host, :this_channel_is_insecure)
506
- else
507
- cred = GRPC::Core::ChannelCredentials.new()
508
- @stub = V1::Nodes::Stub.new(host, cred)
509
- end
510
- rescue => exception
511
- raise Plumbing::convert_error_to_porcelain(exception)
512
- end
513
- @parent = parent
487
+ end
488
+
489
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
490
+ # - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
491
+ # - **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.
492
+ class Nodes
493
+ def initialize(host, insecure, parent)
494
+ begin
495
+ if insecure
496
+ @stub = V1::Nodes::Stub.new(host, :this_channel_is_insecure)
497
+ else
498
+ cred = GRPC::Core::ChannelCredentials.new()
499
+ @stub = V1::Nodes::Stub.new(host, cred)
514
500
  end
515
- # Create registers a new Node.
516
- def create(
517
- node \
518
- ,
519
- deadline:nil)
520
- req = V1::NodeCreateRequest.new()
521
-
522
- req.node = Plumbing::convert_node_to_plumbing(node)
523
- tries = 0
524
- plumbing_response = nil
525
- loop do
526
- begin
527
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Nodes.Create', req), deadline:deadline)
528
- rescue => exception
529
- if (@parent.shouldRetry(tries, exception))
530
- tries++
531
- @parent.jitterSleep(tries)
532
- next
533
- end
534
- raise Plumbing::convert_error_to_porcelain(exception)
535
- end
536
- break
537
- end
501
+ rescue => exception
502
+ raise Plumbing::convert_error_to_porcelain(exception)
503
+ end
504
+ @parent = parent
505
+ end
506
+
507
+ # Create registers a new Node.
508
+ def create(
509
+ node,
510
+ deadline: nil
511
+ )
512
+ req = V1::NodeCreateRequest.new()
538
513
 
539
-
540
- resp = NodeCreateResponse.new()
541
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
542
- resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
543
- resp.token = (plumbing_response.token)
544
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
545
- resp
514
+ req.node = Plumbing::convert_node_to_plumbing(node)
515
+ tries = 0
516
+ plumbing_response = nil
517
+ loop do
518
+ begin
519
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Nodes.Create", req), deadline: deadline)
520
+ rescue => exception
521
+ if (@parent.shouldRetry(tries, exception))
522
+ tries + +@parent.jitterSleep(tries)
523
+ next
524
+ end
525
+ raise Plumbing::convert_error_to_porcelain(exception)
546
526
  end
547
- # Get reads one Node by ID.
548
- def get(
549
- id \
550
- ,
551
- deadline:nil)
552
- req = V1::NodeGetRequest.new()
553
-
554
- req.id = (id)
555
- tries = 0
556
- plumbing_response = nil
557
- loop do
558
- begin
559
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Nodes.Get', req), deadline:deadline)
560
- rescue => exception
561
- if (@parent.shouldRetry(tries, exception))
562
- tries++
563
- @parent.jitterSleep(tries)
564
- next
565
- end
566
- raise Plumbing::convert_error_to_porcelain(exception)
567
- end
568
- break
569
- end
527
+ break
528
+ end
529
+
530
+ resp = NodeCreateResponse.new()
531
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
532
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
533
+ resp.token = (plumbing_response.token)
534
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
535
+ resp
536
+ end
570
537
 
571
-
572
- resp = NodeGetResponse.new()
573
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
574
- resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
575
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
576
- resp
538
+ # Get reads one Node by ID.
539
+ def get(
540
+ id,
541
+ deadline: nil
542
+ )
543
+ req = V1::NodeGetRequest.new()
544
+
545
+ req.id = (id)
546
+ tries = 0
547
+ plumbing_response = nil
548
+ loop do
549
+ begin
550
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Nodes.Get", req), deadline: deadline)
551
+ rescue => exception
552
+ if (@parent.shouldRetry(tries, exception))
553
+ tries + +@parent.jitterSleep(tries)
554
+ next
555
+ end
556
+ raise Plumbing::convert_error_to_porcelain(exception)
577
557
  end
578
- # Update patches a Node by ID.
579
- def update(
580
- node \
581
- ,
582
- deadline:nil)
583
- req = V1::NodeUpdateRequest.new()
584
-
585
- req.node = Plumbing::convert_node_to_plumbing(node)
586
- tries = 0
587
- plumbing_response = nil
588
- loop do
589
- begin
590
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Nodes.Update', req), deadline:deadline)
591
- rescue => exception
592
- if (@parent.shouldRetry(tries, exception))
593
- tries++
594
- @parent.jitterSleep(tries)
595
- next
596
- end
597
- raise Plumbing::convert_error_to_porcelain(exception)
598
- end
599
- break
600
- end
558
+ break
559
+ end
560
+
561
+ resp = NodeGetResponse.new()
562
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
563
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
564
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
565
+ resp
566
+ end
601
567
 
602
-
603
- resp = NodeUpdateResponse.new()
604
- resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
605
- resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
606
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
607
- resp
568
+ # Update patches a Node by ID.
569
+ def update(
570
+ node,
571
+ deadline: nil
572
+ )
573
+ req = V1::NodeUpdateRequest.new()
574
+
575
+ req.node = Plumbing::convert_node_to_plumbing(node)
576
+ tries = 0
577
+ plumbing_response = nil
578
+ loop do
579
+ begin
580
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Nodes.Update", req), deadline: deadline)
581
+ rescue => exception
582
+ if (@parent.shouldRetry(tries, exception))
583
+ tries + +@parent.jitterSleep(tries)
584
+ next
585
+ end
586
+ raise Plumbing::convert_error_to_porcelain(exception)
608
587
  end
609
- # Delete removes a Node by ID.
610
- def delete(
611
- id \
612
- ,
613
- deadline:nil)
614
- req = V1::NodeDeleteRequest.new()
615
-
616
- req.id = (id)
617
- tries = 0
618
- plumbing_response = nil
619
- loop do
620
- begin
621
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Nodes.Delete', req), deadline:deadline)
622
- rescue => exception
623
- if (@parent.shouldRetry(tries, exception))
624
- tries++
625
- @parent.jitterSleep(tries)
626
- next
627
- end
628
- raise Plumbing::convert_error_to_porcelain(exception)
629
- end
630
- break
631
- end
588
+ break
589
+ end
590
+
591
+ resp = NodeUpdateResponse.new()
592
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
593
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
594
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
595
+ resp
596
+ end
597
+
598
+ # Delete removes a Node by ID.
599
+ def delete(
600
+ id,
601
+ deadline: nil
602
+ )
603
+ req = V1::NodeDeleteRequest.new()
632
604
 
633
-
634
- resp = NodeDeleteResponse.new()
635
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
636
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
637
- resp
605
+ req.id = (id)
606
+ tries = 0
607
+ plumbing_response = nil
608
+ loop do
609
+ begin
610
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Nodes.Delete", req), deadline: deadline)
611
+ rescue => exception
612
+ if (@parent.shouldRetry(tries, exception))
613
+ tries + +@parent.jitterSleep(tries)
614
+ next
615
+ end
616
+ raise Plumbing::convert_error_to_porcelain(exception)
638
617
  end
639
- # List gets a list of Nodes matching a given set of criteria.
640
- def list(
641
- filter \
642
- ,
643
- *args,
644
- deadline:nil)
645
- req = V1::NodeListRequest.new()
646
- req.meta = V1::ListRequestMetadata.new()
647
- page_size_option = @parent._test_options['PageSize']
648
- if page_size_option.is_a? Integer
649
- req.meta.limit = page_size_option
618
+ break
619
+ end
620
+
621
+ resp = NodeDeleteResponse.new()
622
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
623
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
624
+ resp
625
+ end
626
+
627
+ # List gets a list of Nodes matching a given set of criteria.
628
+ def list(
629
+ filter,
630
+ *args,
631
+ deadline: nil
632
+ )
633
+ req = V1::NodeListRequest.new()
634
+ req.meta = V1::ListRequestMetadata.new()
635
+ page_size_option = @parent._test_options["PageSize"]
636
+ if page_size_option.is_a? Integer
637
+ req.meta.limit = page_size_option
638
+ end
639
+
640
+ req.filter = Plumbing::quote_filter_args(filter, *args)
641
+ resp = Enumerator::Generator.new { |g|
642
+ tries = 0
643
+ loop do
644
+ begin
645
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Nodes.List", req), deadline: deadline)
646
+ rescue => exception
647
+ if (@parent.shouldRetry(tries, exception))
648
+ tries + +@parent.jitterSleep(tries)
649
+ next
650
650
  end
651
-
652
- req.filter = Plumbing::quote_filter_args(filter, *args)
653
- resp = Enumerator::Generator.new { |g|
654
- tries = 0
655
- loop do
656
- begin
657
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Nodes.List', req), deadline:deadline)
658
- rescue => exception
659
- if (@parent.shouldRetry(tries, exception))
660
- tries++
661
- @parent.jitterSleep(tries)
662
- next
663
- end
664
- raise Plumbing::convert_error_to_porcelain(exception)
665
- end
666
- tries = 0
667
- plumbing_response.nodes.each do |plumbing_item|
668
- g.yield Plumbing::convert_node_to_porcelain(plumbing_item)
669
- end
670
- break if plumbing_response.meta.next_cursor == ""
671
- req.meta.cursor = plumbing_response.meta.next_cursor
672
- end
673
- }
674
- resp
651
+ raise Plumbing::convert_error_to_porcelain(exception)
652
+ end
653
+ tries = 0
654
+ plumbing_response.nodes.each do |plumbing_item|
655
+ g.yield Plumbing::convert_node_to_porcelain(plumbing_item)
656
+ end
657
+ break if plumbing_response.meta.next_cursor == ""
658
+ req.meta.cursor = plumbing_response.meta.next_cursor
675
659
  end
660
+ }
661
+ resp
676
662
  end
663
+ end
677
664
 
678
- class Resources
679
- def initialize(host, insecure, parent)
680
- begin
681
- if insecure
682
- @stub = V1::Resources::Stub.new(host, :this_channel_is_insecure)
683
- else
684
- cred = GRPC::Core::ChannelCredentials.new()
685
- @stub = V1::Resources::Stub.new(host, cred)
686
- end
687
- rescue => exception
688
- raise Plumbing::convert_error_to_porcelain(exception)
689
- end
690
- @parent = parent
665
+ class Resources
666
+ def initialize(host, insecure, parent)
667
+ begin
668
+ if insecure
669
+ @stub = V1::Resources::Stub.new(host, :this_channel_is_insecure)
670
+ else
671
+ cred = GRPC::Core::ChannelCredentials.new()
672
+ @stub = V1::Resources::Stub.new(host, cred)
691
673
  end
692
- # Create registers a new Resource.
693
- def create(
694
- resource \
695
- ,
696
- deadline:nil)
697
- req = V1::ResourceCreateRequest.new()
698
-
699
- req.resource = Plumbing::convert_resource_to_plumbing(resource)
700
- tries = 0
701
- plumbing_response = nil
702
- loop do
703
- begin
704
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Resources.Create', req), deadline:deadline)
705
- rescue => exception
706
- if (@parent.shouldRetry(tries, exception))
707
- tries++
708
- @parent.jitterSleep(tries)
709
- next
710
- end
711
- raise Plumbing::convert_error_to_porcelain(exception)
712
- end
713
- break
714
- end
674
+ rescue => exception
675
+ raise Plumbing::convert_error_to_porcelain(exception)
676
+ end
677
+ @parent = parent
678
+ end
715
679
 
716
-
717
- resp = ResourceCreateResponse.new()
718
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
719
- resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
720
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
721
- resp
680
+ # Create registers a new Resource.
681
+ def create(
682
+ resource,
683
+ deadline: nil
684
+ )
685
+ req = V1::ResourceCreateRequest.new()
686
+
687
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
688
+ tries = 0
689
+ plumbing_response = nil
690
+ loop do
691
+ begin
692
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Resources.Create", req), deadline: deadline)
693
+ rescue => exception
694
+ if (@parent.shouldRetry(tries, exception))
695
+ tries + +@parent.jitterSleep(tries)
696
+ next
697
+ end
698
+ raise Plumbing::convert_error_to_porcelain(exception)
722
699
  end
723
- # Get reads one Resource by ID.
724
- def get(
725
- id \
726
- ,
727
- deadline:nil)
728
- req = V1::ResourceGetRequest.new()
729
-
730
- req.id = (id)
731
- tries = 0
732
- plumbing_response = nil
733
- loop do
734
- begin
735
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Resources.Get', req), deadline:deadline)
736
- rescue => exception
737
- if (@parent.shouldRetry(tries, exception))
738
- tries++
739
- @parent.jitterSleep(tries)
740
- next
741
- end
742
- raise Plumbing::convert_error_to_porcelain(exception)
743
- end
744
- break
745
- end
700
+ break
701
+ end
746
702
 
747
-
748
- resp = ResourceGetResponse.new()
749
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
750
- resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
751
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
752
- resp
703
+ resp = ResourceCreateResponse.new()
704
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
705
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
706
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
707
+ resp
708
+ end
709
+
710
+ # Get reads one Resource by ID.
711
+ def get(
712
+ id,
713
+ deadline: nil
714
+ )
715
+ req = V1::ResourceGetRequest.new()
716
+
717
+ req.id = (id)
718
+ tries = 0
719
+ plumbing_response = nil
720
+ loop do
721
+ begin
722
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Resources.Get", req), deadline: deadline)
723
+ rescue => exception
724
+ if (@parent.shouldRetry(tries, exception))
725
+ tries + +@parent.jitterSleep(tries)
726
+ next
727
+ end
728
+ raise Plumbing::convert_error_to_porcelain(exception)
753
729
  end
754
- # Update patches a Resource by ID.
755
- def update(
756
- resource \
757
- ,
758
- deadline:nil)
759
- req = V1::ResourceUpdateRequest.new()
760
-
761
- req.resource = Plumbing::convert_resource_to_plumbing(resource)
762
- tries = 0
763
- plumbing_response = nil
764
- loop do
765
- begin
766
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Resources.Update', req), deadline:deadline)
767
- rescue => exception
768
- if (@parent.shouldRetry(tries, exception))
769
- tries++
770
- @parent.jitterSleep(tries)
771
- next
772
- end
773
- raise Plumbing::convert_error_to_porcelain(exception)
774
- end
775
- break
776
- end
730
+ break
731
+ end
777
732
 
778
-
779
- resp = ResourceUpdateResponse.new()
780
- resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
781
- resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
782
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
783
- resp
733
+ resp = ResourceGetResponse.new()
734
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
735
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
736
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
737
+ resp
738
+ end
739
+
740
+ # Update patches a Resource by ID.
741
+ def update(
742
+ resource,
743
+ deadline: nil
744
+ )
745
+ req = V1::ResourceUpdateRequest.new()
746
+
747
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
748
+ tries = 0
749
+ plumbing_response = nil
750
+ loop do
751
+ begin
752
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Resources.Update", req), deadline: deadline)
753
+ rescue => exception
754
+ if (@parent.shouldRetry(tries, exception))
755
+ tries + +@parent.jitterSleep(tries)
756
+ next
757
+ end
758
+ raise Plumbing::convert_error_to_porcelain(exception)
784
759
  end
785
- # Delete removes a Resource by ID.
786
- def delete(
787
- id \
788
- ,
789
- deadline:nil)
790
- req = V1::ResourceDeleteRequest.new()
791
-
792
- req.id = (id)
793
- tries = 0
794
- plumbing_response = nil
795
- loop do
796
- begin
797
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Resources.Delete', req), deadline:deadline)
798
- rescue => exception
799
- if (@parent.shouldRetry(tries, exception))
800
- tries++
801
- @parent.jitterSleep(tries)
802
- next
803
- end
804
- raise Plumbing::convert_error_to_porcelain(exception)
805
- end
806
- break
807
- end
760
+ break
761
+ end
762
+
763
+ resp = ResourceUpdateResponse.new()
764
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
765
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
766
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
767
+ resp
768
+ end
808
769
 
809
-
810
- resp = ResourceDeleteResponse.new()
811
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
812
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
813
- resp
770
+ # Delete removes a Resource by ID.
771
+ def delete(
772
+ id,
773
+ deadline: nil
774
+ )
775
+ req = V1::ResourceDeleteRequest.new()
776
+
777
+ req.id = (id)
778
+ tries = 0
779
+ plumbing_response = nil
780
+ loop do
781
+ begin
782
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Resources.Delete", req), deadline: deadline)
783
+ rescue => exception
784
+ if (@parent.shouldRetry(tries, exception))
785
+ tries + +@parent.jitterSleep(tries)
786
+ next
787
+ end
788
+ raise Plumbing::convert_error_to_porcelain(exception)
814
789
  end
815
- # List gets a list of Resources matching a given set of criteria.
816
- def list(
817
- filter \
818
- ,
819
- *args,
820
- deadline:nil)
821
- req = V1::ResourceListRequest.new()
822
- req.meta = V1::ListRequestMetadata.new()
823
- page_size_option = @parent._test_options['PageSize']
824
- if page_size_option.is_a? Integer
825
- req.meta.limit = page_size_option
790
+ break
791
+ end
792
+
793
+ resp = ResourceDeleteResponse.new()
794
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
795
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
796
+ resp
797
+ end
798
+
799
+ # List gets a list of Resources matching a given set of criteria.
800
+ def list(
801
+ filter,
802
+ *args,
803
+ deadline: nil
804
+ )
805
+ req = V1::ResourceListRequest.new()
806
+ req.meta = V1::ListRequestMetadata.new()
807
+ page_size_option = @parent._test_options["PageSize"]
808
+ if page_size_option.is_a? Integer
809
+ req.meta.limit = page_size_option
810
+ end
811
+
812
+ req.filter = Plumbing::quote_filter_args(filter, *args)
813
+ resp = Enumerator::Generator.new { |g|
814
+ tries = 0
815
+ loop do
816
+ begin
817
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Resources.List", req), deadline: deadline)
818
+ rescue => exception
819
+ if (@parent.shouldRetry(tries, exception))
820
+ tries + +@parent.jitterSleep(tries)
821
+ next
826
822
  end
827
-
828
- req.filter = Plumbing::quote_filter_args(filter, *args)
829
- resp = Enumerator::Generator.new { |g|
830
- tries = 0
831
- loop do
832
- begin
833
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Resources.List', req), deadline:deadline)
834
- rescue => exception
835
- if (@parent.shouldRetry(tries, exception))
836
- tries++
837
- @parent.jitterSleep(tries)
838
- next
839
- end
840
- raise Plumbing::convert_error_to_porcelain(exception)
841
- end
842
- tries = 0
843
- plumbing_response.resources.each do |plumbing_item|
844
- g.yield Plumbing::convert_resource_to_porcelain(plumbing_item)
845
- end
846
- break if plumbing_response.meta.next_cursor == ""
847
- req.meta.cursor = plumbing_response.meta.next_cursor
848
- end
849
- }
850
- resp
823
+ raise Plumbing::convert_error_to_porcelain(exception)
824
+ end
825
+ tries = 0
826
+ plumbing_response.resources.each do |plumbing_item|
827
+ g.yield Plumbing::convert_resource_to_porcelain(plumbing_item)
828
+ end
829
+ break if plumbing_response.meta.next_cursor == ""
830
+ req.meta.cursor = plumbing_response.meta.next_cursor
851
831
  end
832
+ }
833
+ resp
852
834
  end
853
- # RoleAttachments represent relationships between composite roles and the roles
854
- # that make up those composite roles. When a composite role is attached to another
855
- # role, the permissions granted to members of the composite role are augmented to
856
- # include the permissions granted to members of the attached role.
857
- class RoleAttachments
858
- def initialize(host, insecure, parent)
859
- begin
860
- if insecure
861
- @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
862
- else
863
- cred = GRPC::Core::ChannelCredentials.new()
864
- @stub = V1::RoleAttachments::Stub.new(host, cred)
865
- end
866
- rescue => exception
867
- raise Plumbing::convert_error_to_porcelain(exception)
868
- end
869
- @parent = parent
835
+ end
836
+
837
+ # RoleAttachments represent relationships between composite roles and the roles
838
+ # that make up those composite roles. When a composite role is attached to another
839
+ # role, the permissions granted to members of the composite role are augmented to
840
+ # include the permissions granted to members of the attached role.
841
+ class RoleAttachments
842
+ def initialize(host, insecure, parent)
843
+ begin
844
+ if insecure
845
+ @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
846
+ else
847
+ cred = GRPC::Core::ChannelCredentials.new()
848
+ @stub = V1::RoleAttachments::Stub.new(host, cred)
870
849
  end
871
- # Create registers a new RoleAttachment.
872
- def create(
873
- role_attachment \
874
- ,
875
- deadline:nil)
876
- req = V1::RoleAttachmentCreateRequest.new()
877
-
878
- req.role_attachment = Plumbing::convert_role_attachment_to_plumbing(role_attachment)
879
- tries = 0
880
- plumbing_response = nil
881
- loop do
882
- begin
883
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('RoleAttachments.Create', req), deadline:deadline)
884
- rescue => exception
885
- if (@parent.shouldRetry(tries, exception))
886
- tries++
887
- @parent.jitterSleep(tries)
888
- next
889
- end
890
- raise Plumbing::convert_error_to_porcelain(exception)
891
- end
892
- break
893
- end
850
+ rescue => exception
851
+ raise Plumbing::convert_error_to_porcelain(exception)
852
+ end
853
+ @parent = parent
854
+ end
894
855
 
895
-
896
- resp = RoleAttachmentCreateResponse.new()
897
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
898
- resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
899
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
900
- resp
856
+ # Create registers a new RoleAttachment.
857
+ def create(
858
+ role_attachment,
859
+ deadline: nil
860
+ )
861
+ req = V1::RoleAttachmentCreateRequest.new()
862
+
863
+ req.role_attachment = Plumbing::convert_role_attachment_to_plumbing(role_attachment)
864
+ tries = 0
865
+ plumbing_response = nil
866
+ loop do
867
+ begin
868
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleAttachments.Create", req), deadline: deadline)
869
+ rescue => exception
870
+ if (@parent.shouldRetry(tries, exception))
871
+ tries + +@parent.jitterSleep(tries)
872
+ next
873
+ end
874
+ raise Plumbing::convert_error_to_porcelain(exception)
901
875
  end
902
- # Get reads one RoleAttachment by ID.
903
- def get(
904
- id \
905
- ,
906
- deadline:nil)
907
- req = V1::RoleAttachmentGetRequest.new()
908
-
909
- req.id = (id)
910
- tries = 0
911
- plumbing_response = nil
912
- loop do
913
- begin
914
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('RoleAttachments.Get', req), deadline:deadline)
915
- rescue => exception
916
- if (@parent.shouldRetry(tries, exception))
917
- tries++
918
- @parent.jitterSleep(tries)
919
- next
920
- end
921
- raise Plumbing::convert_error_to_porcelain(exception)
922
- end
923
- break
924
- end
876
+ break
877
+ end
878
+
879
+ resp = RoleAttachmentCreateResponse.new()
880
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
881
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
882
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
883
+ resp
884
+ end
885
+
886
+ # Get reads one RoleAttachment by ID.
887
+ def get(
888
+ id,
889
+ deadline: nil
890
+ )
891
+ req = V1::RoleAttachmentGetRequest.new()
925
892
 
926
-
927
- resp = RoleAttachmentGetResponse.new()
928
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
929
- resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
930
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
931
- resp
893
+ req.id = (id)
894
+ tries = 0
895
+ plumbing_response = nil
896
+ loop do
897
+ begin
898
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleAttachments.Get", req), deadline: deadline)
899
+ rescue => exception
900
+ if (@parent.shouldRetry(tries, exception))
901
+ tries + +@parent.jitterSleep(tries)
902
+ next
903
+ end
904
+ raise Plumbing::convert_error_to_porcelain(exception)
932
905
  end
933
- # Delete removes a RoleAttachment by ID.
934
- def delete(
935
- id \
936
- ,
937
- deadline:nil)
938
- req = V1::RoleAttachmentDeleteRequest.new()
939
-
940
- req.id = (id)
941
- tries = 0
942
- plumbing_response = nil
943
- loop do
944
- begin
945
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('RoleAttachments.Delete', req), deadline:deadline)
946
- rescue => exception
947
- if (@parent.shouldRetry(tries, exception))
948
- tries++
949
- @parent.jitterSleep(tries)
950
- next
951
- end
952
- raise Plumbing::convert_error_to_porcelain(exception)
953
- end
954
- break
955
- end
906
+ break
907
+ end
908
+
909
+ resp = RoleAttachmentGetResponse.new()
910
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
911
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
912
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
913
+ resp
914
+ end
956
915
 
957
-
958
- resp = RoleAttachmentDeleteResponse.new()
959
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
960
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
961
- resp
916
+ # Delete removes a RoleAttachment by ID.
917
+ def delete(
918
+ id,
919
+ deadline: nil
920
+ )
921
+ req = V1::RoleAttachmentDeleteRequest.new()
922
+
923
+ req.id = (id)
924
+ tries = 0
925
+ plumbing_response = nil
926
+ loop do
927
+ begin
928
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleAttachments.Delete", req), deadline: deadline)
929
+ rescue => exception
930
+ if (@parent.shouldRetry(tries, exception))
931
+ tries + +@parent.jitterSleep(tries)
932
+ next
933
+ end
934
+ raise Plumbing::convert_error_to_porcelain(exception)
962
935
  end
963
- # List gets a list of RoleAttachments matching a given set of criteria.
964
- def list(
965
- filter \
966
- ,
967
- *args,
968
- deadline:nil)
969
- req = V1::RoleAttachmentListRequest.new()
970
- req.meta = V1::ListRequestMetadata.new()
971
- page_size_option = @parent._test_options['PageSize']
972
- if page_size_option.is_a? Integer
973
- req.meta.limit = page_size_option
936
+ break
937
+ end
938
+
939
+ resp = RoleAttachmentDeleteResponse.new()
940
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
941
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
942
+ resp
943
+ end
944
+
945
+ # List gets a list of RoleAttachments matching a given set of criteria.
946
+ def list(
947
+ filter,
948
+ *args,
949
+ deadline: nil
950
+ )
951
+ req = V1::RoleAttachmentListRequest.new()
952
+ req.meta = V1::ListRequestMetadata.new()
953
+ page_size_option = @parent._test_options["PageSize"]
954
+ if page_size_option.is_a? Integer
955
+ req.meta.limit = page_size_option
956
+ end
957
+
958
+ req.filter = Plumbing::quote_filter_args(filter, *args)
959
+ resp = Enumerator::Generator.new { |g|
960
+ tries = 0
961
+ loop do
962
+ begin
963
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleAttachments.List", req), deadline: deadline)
964
+ rescue => exception
965
+ if (@parent.shouldRetry(tries, exception))
966
+ tries + +@parent.jitterSleep(tries)
967
+ next
974
968
  end
975
-
976
- req.filter = Plumbing::quote_filter_args(filter, *args)
977
- resp = Enumerator::Generator.new { |g|
978
- tries = 0
979
- loop do
980
- begin
981
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('RoleAttachments.List', req), deadline:deadline)
982
- rescue => exception
983
- if (@parent.shouldRetry(tries, exception))
984
- tries++
985
- @parent.jitterSleep(tries)
986
- next
987
- end
988
- raise Plumbing::convert_error_to_porcelain(exception)
989
- end
990
- tries = 0
991
- plumbing_response.role_attachments.each do |plumbing_item|
992
- g.yield Plumbing::convert_role_attachment_to_porcelain(plumbing_item)
993
- end
994
- break if plumbing_response.meta.next_cursor == ""
995
- req.meta.cursor = plumbing_response.meta.next_cursor
996
- end
997
- }
998
- resp
969
+ raise Plumbing::convert_error_to_porcelain(exception)
970
+ end
971
+ tries = 0
972
+ plumbing_response.role_attachments.each do |plumbing_item|
973
+ g.yield Plumbing::convert_role_attachment_to_porcelain(plumbing_item)
974
+ end
975
+ break if plumbing_response.meta.next_cursor == ""
976
+ req.meta.cursor = plumbing_response.meta.next_cursor
999
977
  end
978
+ }
979
+ resp
1000
980
  end
1001
- # RoleGrants represent relationships between composite roles and the roles
1002
- # that make up those composite roles. When a composite role is attached to another
1003
- # role, the permissions granted to members of the composite role are augmented to
1004
- # include the permissions granted to members of the attached role.
1005
- class RoleGrants
1006
- def initialize(host, insecure, parent)
1007
- begin
1008
- if insecure
1009
- @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
1010
- else
1011
- cred = GRPC::Core::ChannelCredentials.new()
1012
- @stub = V1::RoleGrants::Stub.new(host, cred)
1013
- end
1014
- rescue => exception
1015
- raise Plumbing::convert_error_to_porcelain(exception)
1016
- end
1017
- @parent = parent
981
+ end
982
+
983
+ # RoleGrants represent relationships between composite roles and the roles
984
+ # that make up those composite roles. When a composite role is attached to another
985
+ # role, the permissions granted to members of the composite role are augmented to
986
+ # include the permissions granted to members of the attached role.
987
+ class RoleGrants
988
+ def initialize(host, insecure, parent)
989
+ begin
990
+ if insecure
991
+ @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
992
+ else
993
+ cred = GRPC::Core::ChannelCredentials.new()
994
+ @stub = V1::RoleGrants::Stub.new(host, cred)
1018
995
  end
1019
- # Create registers a new RoleGrant.
1020
- def create(
1021
- role_grant \
1022
- ,
1023
- deadline:nil)
1024
- req = V1::RoleGrantCreateRequest.new()
1025
-
1026
- req.role_grant = Plumbing::convert_role_grant_to_plumbing(role_grant)
1027
- tries = 0
1028
- plumbing_response = nil
1029
- loop do
1030
- begin
1031
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('RoleGrants.Create', req), deadline:deadline)
1032
- rescue => exception
1033
- if (@parent.shouldRetry(tries, exception))
1034
- tries++
1035
- @parent.jitterSleep(tries)
1036
- next
1037
- end
1038
- raise Plumbing::convert_error_to_porcelain(exception)
1039
- end
1040
- break
1041
- end
996
+ rescue => exception
997
+ raise Plumbing::convert_error_to_porcelain(exception)
998
+ end
999
+ @parent = parent
1000
+ end
1042
1001
 
1043
-
1044
- resp = RoleGrantCreateResponse.new()
1045
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1046
- resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1047
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1048
- resp
1002
+ # Create registers a new RoleGrant.
1003
+ def create(
1004
+ role_grant,
1005
+ deadline: nil
1006
+ )
1007
+ req = V1::RoleGrantCreateRequest.new()
1008
+
1009
+ req.role_grant = Plumbing::convert_role_grant_to_plumbing(role_grant)
1010
+ tries = 0
1011
+ plumbing_response = nil
1012
+ loop do
1013
+ begin
1014
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleGrants.Create", req), deadline: deadline)
1015
+ rescue => exception
1016
+ if (@parent.shouldRetry(tries, exception))
1017
+ tries + +@parent.jitterSleep(tries)
1018
+ next
1019
+ end
1020
+ raise Plumbing::convert_error_to_porcelain(exception)
1049
1021
  end
1050
- # Get reads one RoleGrant by ID.
1051
- def get(
1052
- id \
1053
- ,
1054
- deadline:nil)
1055
- req = V1::RoleGrantGetRequest.new()
1056
-
1057
- req.id = (id)
1058
- tries = 0
1059
- plumbing_response = nil
1060
- loop do
1061
- begin
1062
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('RoleGrants.Get', req), deadline:deadline)
1063
- rescue => exception
1064
- if (@parent.shouldRetry(tries, exception))
1065
- tries++
1066
- @parent.jitterSleep(tries)
1067
- next
1068
- end
1069
- raise Plumbing::convert_error_to_porcelain(exception)
1070
- end
1071
- break
1072
- end
1022
+ break
1023
+ end
1073
1024
 
1074
-
1075
- resp = RoleGrantGetResponse.new()
1076
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1077
- resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1078
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1079
- resp
1025
+ resp = RoleGrantCreateResponse.new()
1026
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1027
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1028
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1029
+ resp
1030
+ end
1031
+
1032
+ # Get reads one RoleGrant by ID.
1033
+ def get(
1034
+ id,
1035
+ deadline: nil
1036
+ )
1037
+ req = V1::RoleGrantGetRequest.new()
1038
+
1039
+ req.id = (id)
1040
+ tries = 0
1041
+ plumbing_response = nil
1042
+ loop do
1043
+ begin
1044
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleGrants.Get", req), deadline: deadline)
1045
+ rescue => exception
1046
+ if (@parent.shouldRetry(tries, exception))
1047
+ tries + +@parent.jitterSleep(tries)
1048
+ next
1049
+ end
1050
+ raise Plumbing::convert_error_to_porcelain(exception)
1080
1051
  end
1081
- # Delete removes a RoleGrant by ID.
1082
- def delete(
1083
- id \
1084
- ,
1085
- deadline:nil)
1086
- req = V1::RoleGrantDeleteRequest.new()
1087
-
1088
- req.id = (id)
1089
- tries = 0
1090
- plumbing_response = nil
1091
- loop do
1092
- begin
1093
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('RoleGrants.Delete', req), deadline:deadline)
1094
- rescue => exception
1095
- if (@parent.shouldRetry(tries, exception))
1096
- tries++
1097
- @parent.jitterSleep(tries)
1098
- next
1099
- end
1100
- raise Plumbing::convert_error_to_porcelain(exception)
1101
- end
1102
- break
1103
- end
1052
+ break
1053
+ end
1104
1054
 
1105
-
1106
- resp = RoleGrantDeleteResponse.new()
1107
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1108
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1109
- resp
1055
+ resp = RoleGrantGetResponse.new()
1056
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1057
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1058
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1059
+ resp
1060
+ end
1061
+
1062
+ # Delete removes a RoleGrant by ID.
1063
+ def delete(
1064
+ id,
1065
+ deadline: nil
1066
+ )
1067
+ req = V1::RoleGrantDeleteRequest.new()
1068
+
1069
+ req.id = (id)
1070
+ tries = 0
1071
+ plumbing_response = nil
1072
+ loop do
1073
+ begin
1074
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleGrants.Delete", req), deadline: deadline)
1075
+ rescue => exception
1076
+ if (@parent.shouldRetry(tries, exception))
1077
+ tries + +@parent.jitterSleep(tries)
1078
+ next
1079
+ end
1080
+ raise Plumbing::convert_error_to_porcelain(exception)
1110
1081
  end
1111
- # List gets a list of RoleGrants matching a given set of criteria.
1112
- def list(
1113
- filter \
1114
- ,
1115
- *args,
1116
- deadline:nil)
1117
- req = V1::RoleGrantListRequest.new()
1118
- req.meta = V1::ListRequestMetadata.new()
1119
- page_size_option = @parent._test_options['PageSize']
1120
- if page_size_option.is_a? Integer
1121
- req.meta.limit = page_size_option
1082
+ break
1083
+ end
1084
+
1085
+ resp = RoleGrantDeleteResponse.new()
1086
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1087
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1088
+ resp
1089
+ end
1090
+
1091
+ # List gets a list of RoleGrants matching a given set of criteria.
1092
+ def list(
1093
+ filter,
1094
+ *args,
1095
+ deadline: nil
1096
+ )
1097
+ req = V1::RoleGrantListRequest.new()
1098
+ req.meta = V1::ListRequestMetadata.new()
1099
+ page_size_option = @parent._test_options["PageSize"]
1100
+ if page_size_option.is_a? Integer
1101
+ req.meta.limit = page_size_option
1102
+ end
1103
+
1104
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1105
+ resp = Enumerator::Generator.new { |g|
1106
+ tries = 0
1107
+ loop do
1108
+ begin
1109
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleGrants.List", req), deadline: deadline)
1110
+ rescue => exception
1111
+ if (@parent.shouldRetry(tries, exception))
1112
+ tries + +@parent.jitterSleep(tries)
1113
+ next
1122
1114
  end
1123
-
1124
- req.filter = Plumbing::quote_filter_args(filter, *args)
1125
- resp = Enumerator::Generator.new { |g|
1126
- tries = 0
1127
- loop do
1128
- begin
1129
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('RoleGrants.List', req), deadline:deadline)
1130
- rescue => exception
1131
- if (@parent.shouldRetry(tries, exception))
1132
- tries++
1133
- @parent.jitterSleep(tries)
1134
- next
1135
- end
1136
- raise Plumbing::convert_error_to_porcelain(exception)
1137
- end
1138
- tries = 0
1139
- plumbing_response.role_grants.each do |plumbing_item|
1140
- g.yield Plumbing::convert_role_grant_to_porcelain(plumbing_item)
1141
- end
1142
- break if plumbing_response.meta.next_cursor == ""
1143
- req.meta.cursor = plumbing_response.meta.next_cursor
1144
- end
1145
- }
1146
- resp
1115
+ raise Plumbing::convert_error_to_porcelain(exception)
1116
+ end
1117
+ tries = 0
1118
+ plumbing_response.role_grants.each do |plumbing_item|
1119
+ g.yield Plumbing::convert_role_grant_to_porcelain(plumbing_item)
1120
+ end
1121
+ break if plumbing_response.meta.next_cursor == ""
1122
+ req.meta.cursor = plumbing_response.meta.next_cursor
1147
1123
  end
1124
+ }
1125
+ resp
1148
1126
  end
1149
- # Roles are tools for controlling user access to resources. Each Role holds a
1150
- # list of resources which they grant access to. Composite roles are a special
1151
- # type of Role which have no resource associations of their own, but instead
1152
- # grant access to the combined resources associated with a set of child roles.
1153
- # Each user can be a member of one Role or composite role.
1154
- class Roles
1155
- def initialize(host, insecure, parent)
1156
- begin
1157
- if insecure
1158
- @stub = V1::Roles::Stub.new(host, :this_channel_is_insecure)
1159
- else
1160
- cred = GRPC::Core::ChannelCredentials.new()
1161
- @stub = V1::Roles::Stub.new(host, cred)
1162
- end
1163
- rescue => exception
1164
- raise Plumbing::convert_error_to_porcelain(exception)
1165
- end
1166
- @parent = parent
1127
+ end
1128
+
1129
+ # Roles are tools for controlling user access to resources. Each Role holds a
1130
+ # list of resources which they grant access to. Composite roles are a special
1131
+ # type of Role which have no resource associations of their own, but instead
1132
+ # grant access to the combined resources associated with a set of child roles.
1133
+ # Each user can be a member of one Role or composite role.
1134
+ class Roles
1135
+ def initialize(host, insecure, parent)
1136
+ begin
1137
+ if insecure
1138
+ @stub = V1::Roles::Stub.new(host, :this_channel_is_insecure)
1139
+ else
1140
+ cred = GRPC::Core::ChannelCredentials.new()
1141
+ @stub = V1::Roles::Stub.new(host, cred)
1167
1142
  end
1168
- # Create registers a new Role.
1169
- def create(
1170
- role \
1171
- ,
1172
- deadline:nil)
1173
- req = V1::RoleCreateRequest.new()
1174
-
1175
- req.role = Plumbing::convert_role_to_plumbing(role)
1176
- tries = 0
1177
- plumbing_response = nil
1178
- loop do
1179
- begin
1180
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Roles.Create', req), deadline:deadline)
1181
- rescue => exception
1182
- if (@parent.shouldRetry(tries, exception))
1183
- tries++
1184
- @parent.jitterSleep(tries)
1185
- next
1186
- end
1187
- raise Plumbing::convert_error_to_porcelain(exception)
1188
- end
1189
- break
1190
- end
1143
+ rescue => exception
1144
+ raise Plumbing::convert_error_to_porcelain(exception)
1145
+ end
1146
+ @parent = parent
1147
+ end
1148
+
1149
+ # Create registers a new Role.
1150
+ def create(
1151
+ role,
1152
+ deadline: nil
1153
+ )
1154
+ req = V1::RoleCreateRequest.new()
1191
1155
 
1192
-
1193
- resp = RoleCreateResponse.new()
1194
- resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1195
- resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1196
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1197
- resp
1156
+ req.role = Plumbing::convert_role_to_plumbing(role)
1157
+ tries = 0
1158
+ plumbing_response = nil
1159
+ loop do
1160
+ begin
1161
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Roles.Create", req), deadline: deadline)
1162
+ rescue => exception
1163
+ if (@parent.shouldRetry(tries, exception))
1164
+ tries + +@parent.jitterSleep(tries)
1165
+ next
1166
+ end
1167
+ raise Plumbing::convert_error_to_porcelain(exception)
1198
1168
  end
1199
- # Get reads one Role by ID.
1200
- def get(
1201
- id \
1202
- ,
1203
- deadline:nil)
1204
- req = V1::RoleGetRequest.new()
1205
-
1206
- req.id = (id)
1207
- tries = 0
1208
- plumbing_response = nil
1209
- loop do
1210
- begin
1211
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Roles.Get', req), deadline:deadline)
1212
- rescue => exception
1213
- if (@parent.shouldRetry(tries, exception))
1214
- tries++
1215
- @parent.jitterSleep(tries)
1216
- next
1217
- end
1218
- raise Plumbing::convert_error_to_porcelain(exception)
1219
- end
1220
- break
1221
- end
1169
+ break
1170
+ end
1171
+
1172
+ resp = RoleCreateResponse.new()
1173
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1174
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1175
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1176
+ resp
1177
+ end
1222
1178
 
1223
-
1224
- resp = RoleGetResponse.new()
1225
- resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1226
- resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1227
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1228
- resp
1179
+ # Get reads one Role by ID.
1180
+ def get(
1181
+ id,
1182
+ deadline: nil
1183
+ )
1184
+ req = V1::RoleGetRequest.new()
1185
+
1186
+ req.id = (id)
1187
+ tries = 0
1188
+ plumbing_response = nil
1189
+ loop do
1190
+ begin
1191
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Roles.Get", req), deadline: deadline)
1192
+ rescue => exception
1193
+ if (@parent.shouldRetry(tries, exception))
1194
+ tries + +@parent.jitterSleep(tries)
1195
+ next
1196
+ end
1197
+ raise Plumbing::convert_error_to_porcelain(exception)
1229
1198
  end
1230
- # Update patches a Role by ID.
1231
- def update(
1232
- role \
1233
- ,
1234
- deadline:nil)
1235
- req = V1::RoleUpdateRequest.new()
1236
-
1237
- req.role = Plumbing::convert_role_to_plumbing(role)
1238
- tries = 0
1239
- plumbing_response = nil
1240
- loop do
1241
- begin
1242
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Roles.Update', req), deadline:deadline)
1243
- rescue => exception
1244
- if (@parent.shouldRetry(tries, exception))
1245
- tries++
1246
- @parent.jitterSleep(tries)
1247
- next
1248
- end
1249
- raise Plumbing::convert_error_to_porcelain(exception)
1250
- end
1251
- break
1252
- end
1199
+ break
1200
+ end
1201
+
1202
+ resp = RoleGetResponse.new()
1203
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1204
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1205
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1206
+ resp
1207
+ end
1253
1208
 
1254
-
1255
- resp = RoleUpdateResponse.new()
1256
- resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
1257
- resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1258
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1259
- resp
1209
+ # Update patches a Role by ID.
1210
+ def update(
1211
+ role,
1212
+ deadline: nil
1213
+ )
1214
+ req = V1::RoleUpdateRequest.new()
1215
+
1216
+ req.role = Plumbing::convert_role_to_plumbing(role)
1217
+ tries = 0
1218
+ plumbing_response = nil
1219
+ loop do
1220
+ begin
1221
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Roles.Update", req), deadline: deadline)
1222
+ rescue => exception
1223
+ if (@parent.shouldRetry(tries, exception))
1224
+ tries + +@parent.jitterSleep(tries)
1225
+ next
1226
+ end
1227
+ raise Plumbing::convert_error_to_porcelain(exception)
1260
1228
  end
1261
- # Delete removes a Role by ID.
1262
- def delete(
1263
- id \
1264
- ,
1265
- deadline:nil)
1266
- req = V1::RoleDeleteRequest.new()
1267
-
1268
- req.id = (id)
1269
- tries = 0
1270
- plumbing_response = nil
1271
- loop do
1272
- begin
1273
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Roles.Delete', req), deadline:deadline)
1274
- rescue => exception
1275
- if (@parent.shouldRetry(tries, exception))
1276
- tries++
1277
- @parent.jitterSleep(tries)
1278
- next
1279
- end
1280
- raise Plumbing::convert_error_to_porcelain(exception)
1281
- end
1282
- break
1283
- end
1229
+ break
1230
+ end
1231
+
1232
+ resp = RoleUpdateResponse.new()
1233
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
1234
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1235
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1236
+ resp
1237
+ end
1238
+
1239
+ # Delete removes a Role by ID.
1240
+ def delete(
1241
+ id,
1242
+ deadline: nil
1243
+ )
1244
+ req = V1::RoleDeleteRequest.new()
1284
1245
 
1285
-
1286
- resp = RoleDeleteResponse.new()
1287
- resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1288
- resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1289
- resp
1246
+ req.id = (id)
1247
+ tries = 0
1248
+ plumbing_response = nil
1249
+ loop do
1250
+ begin
1251
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Roles.Delete", req), deadline: deadline)
1252
+ rescue => exception
1253
+ if (@parent.shouldRetry(tries, exception))
1254
+ tries + +@parent.jitterSleep(tries)
1255
+ next
1256
+ end
1257
+ raise Plumbing::convert_error_to_porcelain(exception)
1290
1258
  end
1291
- # List gets a list of Roles matching a given set of criteria.
1292
- def list(
1293
- filter \
1294
- ,
1295
- *args,
1296
- deadline:nil)
1297
- req = V1::RoleListRequest.new()
1298
- req.meta = V1::ListRequestMetadata.new()
1299
- page_size_option = @parent._test_options['PageSize']
1300
- if page_size_option.is_a? Integer
1301
- req.meta.limit = page_size_option
1259
+ break
1260
+ end
1261
+
1262
+ resp = RoleDeleteResponse.new()
1263
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1264
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1265
+ resp
1266
+ end
1267
+
1268
+ # List gets a list of Roles matching a given set of criteria.
1269
+ def list(
1270
+ filter,
1271
+ *args,
1272
+ deadline: nil
1273
+ )
1274
+ req = V1::RoleListRequest.new()
1275
+ req.meta = V1::ListRequestMetadata.new()
1276
+ page_size_option = @parent._test_options["PageSize"]
1277
+ if page_size_option.is_a? Integer
1278
+ req.meta.limit = page_size_option
1279
+ end
1280
+
1281
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1282
+ resp = Enumerator::Generator.new { |g|
1283
+ tries = 0
1284
+ loop do
1285
+ begin
1286
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Roles.List", req), deadline: deadline)
1287
+ rescue => exception
1288
+ if (@parent.shouldRetry(tries, exception))
1289
+ tries + +@parent.jitterSleep(tries)
1290
+ next
1302
1291
  end
1303
-
1304
- req.filter = Plumbing::quote_filter_args(filter, *args)
1305
- resp = Enumerator::Generator.new { |g|
1306
- tries = 0
1307
- loop do
1308
- begin
1309
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Roles.List', req), deadline:deadline)
1310
- rescue => exception
1311
- if (@parent.shouldRetry(tries, exception))
1312
- tries++
1313
- @parent.jitterSleep(tries)
1314
- next
1315
- end
1316
- raise Plumbing::convert_error_to_porcelain(exception)
1317
- end
1318
- tries = 0
1319
- plumbing_response.roles.each do |plumbing_item|
1320
- g.yield Plumbing::convert_role_to_porcelain(plumbing_item)
1321
- end
1322
- break if plumbing_response.meta.next_cursor == ""
1323
- req.meta.cursor = plumbing_response.meta.next_cursor
1324
- end
1325
- }
1326
- resp
1292
+ raise Plumbing::convert_error_to_porcelain(exception)
1293
+ end
1294
+ tries = 0
1295
+ plumbing_response.roles.each do |plumbing_item|
1296
+ g.yield Plumbing::convert_role_to_porcelain(plumbing_item)
1297
+ end
1298
+ break if plumbing_response.meta.next_cursor == ""
1299
+ req.meta.cursor = plumbing_response.meta.next_cursor
1327
1300
  end
1301
+ }
1302
+ resp
1328
1303
  end
1304
+ end
1329
1305
  end