strongdm 1.0.10 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) 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 +22 -58
  7. data/doc/SDM/AKSBasicAuth.html +22 -4
  8. data/doc/SDM/AKSServiceAccount.html +22 -4
  9. data/doc/SDM/{DB2.html → AWS.html} +38 -56
  10. data/doc/SDM/AWSStore.html +283 -0
  11. data/doc/SDM/AccessRuleCreateResponse.html +267 -0
  12. data/doc/SDM/AccessRuleDeleteResponse.html +249 -0
  13. data/doc/SDM/AccessRuleUpdateResponse.html +267 -0
  14. data/doc/SDM/AccountAttachment.html +2 -2
  15. data/doc/SDM/AccountAttachmentCreateResponse.html +1 -1
  16. data/doc/SDM/AccountAttachmentDeleteResponse.html +1 -1
  17. data/doc/SDM/AccountAttachmentGetResponse.html +1 -1
  18. data/doc/SDM/AccountAttachments.html +2 -2
  19. data/doc/SDM/AccountCreateResponse.html +1 -1
  20. data/doc/SDM/AccountDeleteResponse.html +1 -1
  21. data/doc/SDM/AccountGetResponse.html +1 -1
  22. data/doc/SDM/AccountGrant.html +1 -1
  23. data/doc/SDM/AccountGrantCreateResponse.html +1 -1
  24. data/doc/SDM/AccountGrantDeleteResponse.html +1 -1
  25. data/doc/SDM/AccountGrantGetResponse.html +1 -1
  26. data/doc/SDM/AccountGrants.html +1 -1
  27. data/doc/SDM/AccountUpdateResponse.html +1 -1
  28. data/doc/SDM/Accounts.html +9 -9
  29. data/doc/SDM/AlreadyExistsError.html +1 -1
  30. data/doc/SDM/AmazonEKS.html +22 -22
  31. data/doc/SDM/AmazonES.html +22 -4
  32. data/doc/SDM/Athena.html +22 -4
  33. data/doc/SDM/AuroraMysql.html +22 -4
  34. data/doc/SDM/AuroraPostgres.html +22 -4
  35. data/doc/SDM/AuthenticationError.html +1 -1
  36. data/doc/SDM/BadRequestError.html +1 -1
  37. data/doc/SDM/BigQuery.html +22 -4
  38. data/doc/SDM/Cassandra.html +22 -4
  39. data/doc/SDM/Citus.html +22 -4
  40. data/doc/SDM/Client.html +40 -12
  41. data/doc/SDM/Clustrix.html +22 -4
  42. data/doc/SDM/Cockroach.html +22 -4
  43. data/doc/SDM/ControlPanel.html +236 -0
  44. data/doc/SDM/ControlPanelGetSSHCAPublicKeyResponse.html +267 -0
  45. data/doc/SDM/CreateResponseMetadata.html +1 -1
  46. data/doc/SDM/DB2LUW.html +22 -4
  47. data/doc/SDM/DB2i.html +22 -4
  48. data/doc/SDM/DeadlineExceededError.html +1 -1
  49. data/doc/SDM/DeleteResponseMetadata.html +1 -1
  50. data/doc/SDM/Druid.html +22 -4
  51. data/doc/SDM/DynamoDB.html +22 -4
  52. data/doc/SDM/Elastic.html +22 -4
  53. data/doc/SDM/ElasticacheRedis.html +22 -4
  54. data/doc/SDM/Gateway.html +4 -4
  55. data/doc/SDM/GetResponseMetadata.html +1 -1
  56. data/doc/SDM/GoogleGKE.html +14 -32
  57. data/doc/SDM/Greenplum.html +22 -4
  58. data/doc/SDM/HTTPAuth.html +22 -4
  59. data/doc/SDM/HTTPBasicAuth.html +22 -4
  60. data/doc/SDM/HTTPNoAuth.html +22 -4
  61. data/doc/SDM/InternalError.html +1 -1
  62. data/doc/SDM/Kubernetes.html +22 -58
  63. data/doc/SDM/KubernetesBasicAuth.html +22 -4
  64. data/doc/SDM/KubernetesServiceAccount.html +22 -4
  65. data/doc/SDM/Maria.html +22 -4
  66. data/doc/SDM/Memcached.html +22 -4
  67. data/doc/SDM/Memsql.html +22 -4
  68. data/doc/SDM/MongoHost.html +22 -4
  69. data/doc/SDM/MongoLegacyHost.html +22 -4
  70. data/doc/SDM/MongoLegacyReplicaset.html +22 -4
  71. data/doc/SDM/MongoReplicaSet.html +22 -4
  72. data/doc/SDM/Mysql.html +22 -4
  73. data/doc/SDM/NodeCreateResponse.html +3 -3
  74. data/doc/SDM/NodeDeleteResponse.html +3 -3
  75. data/doc/SDM/NodeGetResponse.html +3 -3
  76. data/doc/SDM/NodeUpdateResponse.html +3 -3
  77. data/doc/SDM/Nodes.html +11 -11
  78. data/doc/SDM/NotFoundError.html +1 -1
  79. data/doc/SDM/Oracle.html +22 -4
  80. data/doc/SDM/PermissionError.html +1 -1
  81. data/doc/SDM/Plumbing.html +2911 -1141
  82. data/doc/SDM/Postgres.html +22 -4
  83. data/doc/SDM/Presto.html +22 -4
  84. data/doc/SDM/RDP.html +22 -4
  85. data/doc/SDM/RPCError.html +1 -1
  86. data/doc/SDM/RateLimitError.html +1 -1
  87. data/doc/SDM/RateLimitMetadata.html +1 -1
  88. data/doc/SDM/Redis.html +22 -4
  89. data/doc/SDM/Redshift.html +22 -4
  90. data/doc/SDM/Relay.html +4 -4
  91. data/doc/SDM/ResourceCreateResponse.html +3 -3
  92. data/doc/SDM/ResourceDeleteResponse.html +3 -3
  93. data/doc/SDM/ResourceGetResponse.html +3 -3
  94. data/doc/SDM/ResourceUpdateResponse.html +3 -3
  95. data/doc/SDM/Resources.html +7 -7
  96. data/doc/SDM/Role.html +4 -4
  97. data/doc/SDM/RoleAttachment.html +3 -3
  98. data/doc/SDM/RoleAttachmentCreateResponse.html +3 -3
  99. data/doc/SDM/RoleAttachmentDeleteResponse.html +3 -3
  100. data/doc/SDM/RoleAttachmentGetResponse.html +3 -3
  101. data/doc/SDM/RoleAttachments.html +6 -6
  102. data/doc/SDM/RoleCreateResponse.html +3 -3
  103. data/doc/SDM/RoleDeleteResponse.html +3 -3
  104. data/doc/SDM/RoleGetResponse.html +3 -3
  105. data/doc/SDM/RoleGrant.html +3 -3
  106. data/doc/SDM/RoleGrantCreateResponse.html +3 -3
  107. data/doc/SDM/RoleGrantDeleteResponse.html +3 -3
  108. data/doc/SDM/RoleGrantGetResponse.html +3 -3
  109. data/doc/SDM/RoleGrants.html +6 -6
  110. data/doc/SDM/RoleUpdateResponse.html +3 -3
  111. data/doc/SDM/Roles.html +7 -7
  112. data/doc/SDM/SQLServer.html +22 -4
  113. data/doc/SDM/SSH.html +22 -4
  114. data/doc/SDM/SSHCert.html +22 -4
  115. data/doc/SDM/SecretStore.html +303 -0
  116. data/doc/SDM/SecretStoreCreateResponse.html +267 -0
  117. data/doc/SDM/SecretStoreDeleteResponse.html +249 -0
  118. data/doc/SDM/SecretStoreGetResponse.html +267 -0
  119. data/doc/SDM/SecretStoreUpdateResponse.html +267 -0
  120. data/doc/SDM/SecretStores.html +492 -0
  121. data/doc/SDM/Service.html +1 -1
  122. data/doc/SDM/Snowflake.html +22 -4
  123. data/doc/SDM/Sybase.html +22 -4
  124. data/doc/SDM/SybaseIQ.html +22 -4
  125. data/doc/SDM/Teradata.html +22 -4
  126. data/doc/SDM/UpdateResponseMetadata.html +1 -1
  127. data/doc/SDM/User.html +1 -1
  128. data/doc/SDM/VaultTLSStore.html +337 -0
  129. data/doc/SDM/VaultTokenStore.html +283 -0
  130. data/doc/V1.html +256 -1
  131. data/doc/V1/AccessRules.html +113 -0
  132. data/doc/V1/AccessRules/Service.html +119 -0
  133. data/doc/V1/AccountAttachments.html +1 -1
  134. data/doc/V1/AccountAttachments/Service.html +2 -2
  135. data/doc/V1/AccountGrants.html +1 -1
  136. data/doc/V1/AccountGrants/Service.html +1 -1
  137. data/doc/V1/Accounts.html +1 -1
  138. data/doc/V1/Accounts/Service.html +3 -3
  139. data/doc/V1/Audits.html +113 -0
  140. data/doc/V1/Audits/Service.html +119 -0
  141. data/doc/V1/ControlPanel.html +113 -0
  142. data/doc/V1/ControlPanel/Service.html +119 -0
  143. data/doc/V1/DemoProvisioningRequests.html +113 -0
  144. data/doc/V1/DemoProvisioningRequests/Service.html +119 -0
  145. data/doc/V1/Nodes.html +1 -1
  146. data/doc/V1/Nodes/Service.html +5 -5
  147. data/doc/V1/Resources.html +1 -1
  148. data/doc/V1/Resources/Service.html +1 -1
  149. data/doc/V1/RoleAttachments.html +1 -1
  150. data/doc/V1/RoleAttachments/Service.html +1 -1
  151. data/doc/V1/RoleGrants.html +1 -1
  152. data/doc/V1/RoleGrants/Service.html +1 -1
  153. data/doc/V1/Roles.html +1 -1
  154. data/doc/V1/Roles/Service.html +1 -1
  155. data/doc/V1/SecretStoreHealths.html +113 -0
  156. data/doc/V1/SecretStoreHealths/Service.html +119 -0
  157. data/doc/V1/SecretStores.html +113 -0
  158. data/doc/V1/SecretStores/Service.html +119 -0
  159. data/doc/V1/Tags.html +1 -1
  160. data/doc/created.rid +47 -38
  161. data/doc/css/rdoc.css +13 -5
  162. data/doc/examples/Gemfile.html +1 -3
  163. data/doc/index.html +47 -3
  164. data/doc/js/navigation.js.gz +0 -0
  165. data/doc/js/search_index.js +1 -1
  166. data/doc/js/search_index.js.gz +0 -0
  167. data/doc/js/searcher.js.gz +0 -0
  168. data/doc/lib/version.html +2 -4
  169. data/doc/table_of_contents.html +680 -240
  170. data/examples/Gemfile +2 -2
  171. data/examples/listUsers.rb +8 -8
  172. data/lib/errors/errors.rb +55 -53
  173. data/lib/grpc/access_rules_pb.rb +115 -0
  174. data/lib/grpc/access_rules_services_pb.rb +50 -0
  175. data/lib/grpc/account_attachments_pb.rb +7 -9
  176. data/lib/grpc/account_attachments_services_pb.rb +8 -9
  177. data/lib/grpc/account_grants_pb.rb +8 -10
  178. data/lib/grpc/account_grants_services_pb.rb +7 -8
  179. data/lib/grpc/accounts_pb.rb +8 -10
  180. data/lib/grpc/accounts_services_pb.rb +10 -12
  181. data/lib/grpc/audits_pb.rb +40 -0
  182. data/lib/grpc/audits_services_pb.rb +37 -0
  183. data/lib/grpc/control_panel_pb.rb +38 -0
  184. data/lib/grpc/control_panel_services_pb.rb +37 -0
  185. data/lib/grpc/demo_provisioning_requests_pb.rb +93 -0
  186. data/lib/grpc/demo_provisioning_requests_services_pb.rb +49 -0
  187. data/lib/grpc/drivers_pb.rb +68 -17
  188. data/lib/grpc/nodes_pb.rb +8 -10
  189. data/lib/grpc/nodes_services_pb.rb +10 -12
  190. data/lib/grpc/options_pb.rb +23 -5
  191. data/lib/grpc/plumbing.rb +4920 -4418
  192. data/lib/grpc/resources_pb.rb +8 -9
  193. data/lib/grpc/resources_services_pb.rb +7 -8
  194. data/lib/grpc/role_attachments_pb.rb +7 -9
  195. data/lib/grpc/role_attachments_services_pb.rb +7 -8
  196. data/lib/grpc/role_grants_pb.rb +7 -9
  197. data/lib/grpc/role_grants_services_pb.rb +7 -8
  198. data/lib/grpc/roles_pb.rb +8 -10
  199. data/lib/grpc/roles_services_pb.rb +7 -8
  200. data/lib/grpc/secret_store_healths_pb.rb +61 -0
  201. data/lib/grpc/secret_store_healths_services_pb.rb +39 -0
  202. data/lib/grpc/secret_store_types_pb.rb +60 -0
  203. data/lib/grpc/secret_stores_pb.rb +84 -0
  204. data/lib/grpc/secret_stores_services_pb.rb +44 -0
  205. data/lib/grpc/spec_pb.rb +7 -7
  206. data/lib/grpc/tags_pb.rb +6 -6
  207. data/lib/models/porcelain.rb +5645 -5348
  208. data/lib/strongdm.rb +98 -95
  209. data/lib/svc.rb +1414 -1221
  210. data/lib/version +1 -1
  211. data/lib/version.rb +1 -1
  212. data/strongdm.gemspec +10 -10
  213. metadata +43 -5
  214. data/lib/grpc/protoc-gen-swagger/options/annotations_pb.rb +0 -15
@@ -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,107 @@ 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
+ @control_panel = ControlPanel.new(host, insecure, self)
41
+ @nodes = Nodes.new(host, insecure, self)
42
+ @resources = Resources.new(host, insecure, self)
43
+ @role_attachments = RoleAttachments.new(host, insecure, self)
44
+ @role_grants = RoleGrants.new(host, insecure, self)
45
+ @roles = Roles.new(host, insecure, self)
46
+ @secret_stores = SecretStores.new(host, insecure, self)
47
+ @_test_options = Hash.new
48
+ end
58
49
 
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
50
+ def get_metadata(method_name, req)
51
+ return { 'x-sdm-authentication': @api_access_key, 'x-sdm-signature': self.sign(method_name, req.to_proto) }
52
+ end
64
53
 
65
- return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
66
- end
54
+ def sign(method_name, msg_bytes)
55
+ current_utc_date = Time.now.utc
56
+ date = sprintf("%04d-%02d-%02d", current_utc_date.year, current_utc_date.month, current_utc_date.day)
67
57
 
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
58
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
59
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, "sdm_api_v1")
76
60
 
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
61
+ sha_req = Digest::SHA256.new
62
+ sha_req << method_name
63
+ sha_req << "\n"
64
+ sha_req << msg_bytes
65
+ request_hash = sha_req.digest
86
66
 
87
- attr_reader :max_retries
88
- attr_reader :base_retry_delay
89
- attr_reader :max_retry_delay
67
+ return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
68
+ end
90
69
 
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
70
+ def jitterSleep(iter)
71
+ dur_max = @base_retry_delay * 2 ** iter
72
+ if (dur_max > @max_retry_delay)
73
+ dur_max = @max_retry_delay
74
+ end
75
+ dur = rand() * dur_max
76
+ sleep(dur)
77
+ end
107
78
 
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
79
+ def shouldRetry(iter, err)
80
+ if (iter >= @max_retries - 1)
81
+ return false
82
+ end
83
+ if not err.is_a? GRPC::BadStatus
84
+ return true
85
+ end
86
+ return err.code() == 13
126
87
  end
127
88
 
89
+ attr_reader :max_retries
90
+ attr_reader :base_retry_delay
91
+ attr_reader :max_retry_delay
92
+
93
+ # API authentication token (read-only).
94
+ attr_reader :api_access_key
95
+ # AccountAttachments assign an account to a role or composite role.
96
+ attr_reader :account_attachments
97
+ # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
98
+ attr_reader :account_grants
99
+ # Accounts are users that have access to strongDM. There are two types of accounts:
100
+ # 1. **Users:** humans who are authenticated through username and password or SSO.
101
+ # 2. **Service Accounts:** machines that are authenticated using a service token.
102
+ attr_reader :accounts
103
+ # ControlPanel contains all administrative controls.
104
+ attr_reader :control_panel
105
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
106
+ # - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
107
+ # - **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.
108
+ attr_reader :nodes
109
+
110
+ attr_reader :resources
111
+ # RoleAttachments represent relationships between composite roles and the roles
112
+ # that make up those composite roles. When a composite role is attached to another
113
+ # role, the permissions granted to members of the composite role are augmented to
114
+ # include the permissions granted to members of the attached role.
115
+ attr_reader :role_attachments
116
+ # RoleGrants represent relationships between composite roles and the roles
117
+ # that make up those composite roles. When a composite role is attached to another
118
+ # role, the permissions granted to members of the composite role are augmented to
119
+ # include the permissions granted to members of the attached role.
120
+ attr_reader :role_grants
121
+ # Roles are tools for controlling user access to resources. Each Role holds a
122
+ # list of resources which they grant access to. Composite roles are a special
123
+ # type of Role which have no resource associations of their own, but instead
124
+ # grant access to the combined resources associated with a set of child roles.
125
+ # Each user can be a member of one Role or composite role.
126
+ attr_reader :roles
127
+ # SecretStores are servers where resource secrets (passwords, keys) are stored.
128
+ attr_reader :secret_stores
129
+ attr_reader :_test_options
130
+ end
128
131
  end
data/lib/svc.rb CHANGED
@@ -1,1329 +1,1522 @@
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
65
+
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()
96
79
 
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
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
95
+
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()
127
109
 
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
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
215
+
216
+ # Get reads one AccountGrant by ID.
217
+ def get(
218
+ id,
219
+ deadline: nil
220
+ )
221
+ req = V1::AccountGrantGetRequest.new()
241
222
 
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
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
384
+
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()
421
398
 
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
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
414
+
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
452
421
 
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
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
+ # ControlPanel contains all administrative controls.
490
+ class ControlPanel
491
+ def initialize(host, insecure, parent)
492
+ begin
493
+ if insecure
494
+ @stub = V1::ControlPanel::Stub.new(host, :this_channel_is_insecure)
495
+ else
496
+ cred = GRPC::Core::ChannelCredentials.new()
497
+ @stub = V1::ControlPanel::Stub.new(host, cred)
514
498
  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
499
+ rescue => exception
500
+ raise Plumbing::convert_error_to_porcelain(exception)
501
+ end
502
+ @parent = parent
503
+ end
538
504
 
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
505
+ # GetSSHCAPublicKey retrieves the SSH CA public key.
506
+ def get_sshca_public_key(
507
+ deadline: nil
508
+ )
509
+ req = V1::ControlPanelGetSSHCAPublicKeyRequest.new()
510
+
511
+ tries = 0
512
+ plumbing_response = nil
513
+ loop do
514
+ begin
515
+ plumbing_response = @stub.get_sshca_public_key(req, metadata: @parent.get_metadata("ControlPanel.GetSSHCAPublicKey", req), deadline: deadline)
516
+ rescue => exception
517
+ if (@parent.shouldRetry(tries, exception))
518
+ tries + +@parent.jitterSleep(tries)
519
+ next
520
+ end
521
+ raise Plumbing::convert_error_to_porcelain(exception)
546
522
  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
523
+ break
524
+ end
525
+
526
+ resp = ControlPanelGetSSHCAPublicKeyResponse.new()
527
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
528
+ resp.public_key = (plumbing_response.public_key)
529
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
530
+ resp
531
+ end
532
+ end
570
533
 
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
534
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources. There are two types of nodes:
535
+ # - **Gateways** are the entry points into network. They listen for connection from the strongDM client, and provide access to databases and servers.
536
+ # - **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.
537
+ class Nodes
538
+ def initialize(host, insecure, parent)
539
+ begin
540
+ if insecure
541
+ @stub = V1::Nodes::Stub.new(host, :this_channel_is_insecure)
542
+ else
543
+ cred = GRPC::Core::ChannelCredentials.new()
544
+ @stub = V1::Nodes::Stub.new(host, cred)
577
545
  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
546
+ rescue => exception
547
+ raise Plumbing::convert_error_to_porcelain(exception)
548
+ end
549
+ @parent = parent
550
+ end
601
551
 
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
552
+ # Create registers a new Node.
553
+ def create(
554
+ node,
555
+ deadline: nil
556
+ )
557
+ req = V1::NodeCreateRequest.new()
558
+
559
+ req.node = Plumbing::convert_node_to_plumbing(node)
560
+ tries = 0
561
+ plumbing_response = nil
562
+ loop do
563
+ begin
564
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Nodes.Create", req), deadline: deadline)
565
+ rescue => exception
566
+ if (@parent.shouldRetry(tries, exception))
567
+ tries + +@parent.jitterSleep(tries)
568
+ next
569
+ end
570
+ raise Plumbing::convert_error_to_porcelain(exception)
608
571
  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
572
+ break
573
+ end
574
+
575
+ resp = NodeCreateResponse.new()
576
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
577
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
578
+ resp.token = (plumbing_response.token)
579
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
580
+ resp
581
+ end
582
+
583
+ # Get reads one Node by ID.
584
+ def get(
585
+ id,
586
+ deadline: nil
587
+ )
588
+ req = V1::NodeGetRequest.new()
632
589
 
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
590
+ req.id = (id)
591
+ tries = 0
592
+ plumbing_response = nil
593
+ loop do
594
+ begin
595
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Nodes.Get", req), deadline: deadline)
596
+ rescue => exception
597
+ if (@parent.shouldRetry(tries, exception))
598
+ tries + +@parent.jitterSleep(tries)
599
+ next
600
+ end
601
+ raise Plumbing::convert_error_to_porcelain(exception)
638
602
  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
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
603
+ break
604
+ end
605
+
606
+ resp = NodeGetResponse.new()
607
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
608
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
609
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
610
+ resp
611
+ end
612
+
613
+ # Update patches a Node by ID.
614
+ def update(
615
+ node,
616
+ deadline: nil
617
+ )
618
+ req = V1::NodeUpdateRequest.new()
619
+
620
+ req.node = Plumbing::convert_node_to_plumbing(node)
621
+ tries = 0
622
+ plumbing_response = nil
623
+ loop do
624
+ begin
625
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Nodes.Update", req), deadline: deadline)
626
+ rescue => exception
627
+ if (@parent.shouldRetry(tries, exception))
628
+ tries + +@parent.jitterSleep(tries)
629
+ next
630
+ end
631
+ raise Plumbing::convert_error_to_porcelain(exception)
675
632
  end
633
+ break
634
+ end
635
+
636
+ resp = NodeUpdateResponse.new()
637
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
638
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
639
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
640
+ resp
676
641
  end
677
642
 
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
643
+ # Delete removes a Node by ID.
644
+ def delete(
645
+ id,
646
+ deadline: nil
647
+ )
648
+ req = V1::NodeDeleteRequest.new()
649
+
650
+ req.id = (id)
651
+ tries = 0
652
+ plumbing_response = nil
653
+ loop do
654
+ begin
655
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Nodes.Delete", req), deadline: deadline)
656
+ rescue => exception
657
+ if (@parent.shouldRetry(tries, exception))
658
+ tries + +@parent.jitterSleep(tries)
659
+ next
660
+ end
661
+ raise Plumbing::convert_error_to_porcelain(exception)
691
662
  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
663
+ break
664
+ end
665
+
666
+ resp = NodeDeleteResponse.new()
667
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
668
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
669
+ resp
670
+ end
671
+
672
+ # List gets a list of Nodes matching a given set of criteria.
673
+ def list(
674
+ filter,
675
+ *args,
676
+ deadline: nil
677
+ )
678
+ req = V1::NodeListRequest.new()
679
+ req.meta = V1::ListRequestMetadata.new()
680
+ page_size_option = @parent._test_options["PageSize"]
681
+ if page_size_option.is_a? Integer
682
+ req.meta.limit = page_size_option
683
+ end
684
+
685
+ req.filter = Plumbing::quote_filter_args(filter, *args)
686
+ resp = Enumerator::Generator.new { |g|
687
+ tries = 0
688
+ loop do
689
+ begin
690
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Nodes.List", req), deadline: deadline)
691
+ rescue => exception
692
+ if (@parent.shouldRetry(tries, exception))
693
+ tries + +@parent.jitterSleep(tries)
694
+ next
714
695
  end
696
+ raise Plumbing::convert_error_to_porcelain(exception)
697
+ end
698
+ tries = 0
699
+ plumbing_response.nodes.each do |plumbing_item|
700
+ g.yield Plumbing::convert_node_to_porcelain(plumbing_item)
701
+ end
702
+ break if plumbing_response.meta.next_cursor == ""
703
+ req.meta.cursor = plumbing_response.meta.next_cursor
704
+ end
705
+ }
706
+ resp
707
+ end
708
+ end
715
709
 
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
710
+ class Resources
711
+ def initialize(host, insecure, parent)
712
+ begin
713
+ if insecure
714
+ @stub = V1::Resources::Stub.new(host, :this_channel_is_insecure)
715
+ else
716
+ cred = GRPC::Core::ChannelCredentials.new()
717
+ @stub = V1::Resources::Stub.new(host, cred)
722
718
  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
719
+ rescue => exception
720
+ raise Plumbing::convert_error_to_porcelain(exception)
721
+ end
722
+ @parent = parent
723
+ end
724
+
725
+ # Create registers a new Resource.
726
+ def create(
727
+ resource,
728
+ deadline: nil
729
+ )
730
+ req = V1::ResourceCreateRequest.new()
746
731
 
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
732
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
733
+ tries = 0
734
+ plumbing_response = nil
735
+ loop do
736
+ begin
737
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Resources.Create", req), deadline: deadline)
738
+ rescue => exception
739
+ if (@parent.shouldRetry(tries, exception))
740
+ tries + +@parent.jitterSleep(tries)
741
+ next
742
+ end
743
+ raise Plumbing::convert_error_to_porcelain(exception)
753
744
  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
745
+ break
746
+ end
777
747
 
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
748
+ resp = ResourceCreateResponse.new()
749
+ resp.meta = Plumbing::convert_create_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
753
+ end
754
+
755
+ # Get reads one Resource by ID.
756
+ def get(
757
+ id,
758
+ deadline: nil
759
+ )
760
+ req = V1::ResourceGetRequest.new()
761
+
762
+ req.id = (id)
763
+ tries = 0
764
+ plumbing_response = nil
765
+ loop do
766
+ begin
767
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Resources.Get", req), deadline: deadline)
768
+ rescue => exception
769
+ if (@parent.shouldRetry(tries, exception))
770
+ tries + +@parent.jitterSleep(tries)
771
+ next
772
+ end
773
+ raise Plumbing::convert_error_to_porcelain(exception)
784
774
  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
775
+ break
776
+ end
777
+
778
+ resp = ResourceGetResponse.new()
779
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
780
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
781
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
782
+ resp
783
+ end
784
+
785
+ # Update patches a Resource by ID.
786
+ def update(
787
+ resource,
788
+ deadline: nil
789
+ )
790
+ req = V1::ResourceUpdateRequest.new()
808
791
 
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
792
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
793
+ tries = 0
794
+ plumbing_response = nil
795
+ loop do
796
+ begin
797
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Resources.Update", req), deadline: deadline)
798
+ rescue => exception
799
+ if (@parent.shouldRetry(tries, exception))
800
+ tries + +@parent.jitterSleep(tries)
801
+ next
802
+ end
803
+ raise Plumbing::convert_error_to_porcelain(exception)
814
804
  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
826
- 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
805
+ break
806
+ end
807
+
808
+ resp = ResourceUpdateResponse.new()
809
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
810
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
811
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
812
+ resp
813
+ end
814
+
815
+ # Delete removes a Resource by ID.
816
+ def delete(
817
+ id,
818
+ deadline: nil
819
+ )
820
+ req = V1::ResourceDeleteRequest.new()
821
+
822
+ req.id = (id)
823
+ tries = 0
824
+ plumbing_response = nil
825
+ loop do
826
+ begin
827
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Resources.Delete", req), deadline: deadline)
828
+ rescue => exception
829
+ if (@parent.shouldRetry(tries, exception))
830
+ tries + +@parent.jitterSleep(tries)
831
+ next
832
+ end
833
+ raise Plumbing::convert_error_to_porcelain(exception)
851
834
  end
835
+ break
836
+ end
837
+
838
+ resp = ResourceDeleteResponse.new()
839
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
840
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
841
+ resp
852
842
  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)
843
+
844
+ # List gets a list of Resources matching a given set of criteria.
845
+ def list(
846
+ filter,
847
+ *args,
848
+ deadline: nil
849
+ )
850
+ req = V1::ResourceListRequest.new()
851
+ req.meta = V1::ListRequestMetadata.new()
852
+ page_size_option = @parent._test_options["PageSize"]
853
+ if page_size_option.is_a? Integer
854
+ req.meta.limit = page_size_option
855
+ end
856
+
857
+ req.filter = Plumbing::quote_filter_args(filter, *args)
858
+ resp = Enumerator::Generator.new { |g|
859
+ tries = 0
860
+ loop do
861
+ begin
862
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Resources.List", req), deadline: deadline)
863
+ rescue => exception
864
+ if (@parent.shouldRetry(tries, exception))
865
+ tries + +@parent.jitterSleep(tries)
866
+ next
868
867
  end
869
- @parent = parent
868
+ raise Plumbing::convert_error_to_porcelain(exception)
869
+ end
870
+ tries = 0
871
+ plumbing_response.resources.each do |plumbing_item|
872
+ g.yield Plumbing::convert_resource_to_porcelain(plumbing_item)
873
+ end
874
+ break if plumbing_response.meta.next_cursor == ""
875
+ req.meta.cursor = plumbing_response.meta.next_cursor
870
876
  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
877
+ }
878
+ resp
879
+ end
880
+ end
894
881
 
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
882
+ # RoleAttachments represent relationships between composite roles and the roles
883
+ # that make up those composite roles. When a composite role is attached to another
884
+ # role, the permissions granted to members of the composite role are augmented to
885
+ # include the permissions granted to members of the attached role.
886
+ class RoleAttachments
887
+ def initialize(host, insecure, parent)
888
+ begin
889
+ if insecure
890
+ @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
891
+ else
892
+ cred = GRPC::Core::ChannelCredentials.new()
893
+ @stub = V1::RoleAttachments::Stub.new(host, cred)
901
894
  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
895
+ rescue => exception
896
+ raise Plumbing::convert_error_to_porcelain(exception)
897
+ end
898
+ @parent = parent
899
+ end
900
+
901
+ # Create registers a new RoleAttachment.
902
+ def create(
903
+ role_attachment,
904
+ deadline: nil
905
+ )
906
+ req = V1::RoleAttachmentCreateRequest.new()
925
907
 
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
908
+ req.role_attachment = Plumbing::convert_role_attachment_to_plumbing(role_attachment)
909
+ tries = 0
910
+ plumbing_response = nil
911
+ loop do
912
+ begin
913
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleAttachments.Create", req), deadline: deadline)
914
+ rescue => exception
915
+ if (@parent.shouldRetry(tries, exception))
916
+ tries + +@parent.jitterSleep(tries)
917
+ next
918
+ end
919
+ raise Plumbing::convert_error_to_porcelain(exception)
932
920
  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
921
+ break
922
+ end
923
+
924
+ resp = RoleAttachmentCreateResponse.new()
925
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
926
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
927
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
928
+ resp
929
+ end
956
930
 
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
931
+ # Get reads one RoleAttachment by ID.
932
+ def get(
933
+ id,
934
+ deadline: nil
935
+ )
936
+ req = V1::RoleAttachmentGetRequest.new()
937
+
938
+ req.id = (id)
939
+ tries = 0
940
+ plumbing_response = nil
941
+ loop do
942
+ begin
943
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleAttachments.Get", req), deadline: deadline)
944
+ rescue => exception
945
+ if (@parent.shouldRetry(tries, exception))
946
+ tries + +@parent.jitterSleep(tries)
947
+ next
948
+ end
949
+ raise Plumbing::convert_error_to_porcelain(exception)
962
950
  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
974
- 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
951
+ break
952
+ end
953
+
954
+ resp = RoleAttachmentGetResponse.new()
955
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
956
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
957
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
958
+ resp
959
+ end
960
+
961
+ # Delete removes a RoleAttachment by ID.
962
+ def delete(
963
+ id,
964
+ deadline: nil
965
+ )
966
+ req = V1::RoleAttachmentDeleteRequest.new()
967
+
968
+ req.id = (id)
969
+ tries = 0
970
+ plumbing_response = nil
971
+ loop do
972
+ begin
973
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleAttachments.Delete", req), deadline: deadline)
974
+ rescue => exception
975
+ if (@parent.shouldRetry(tries, exception))
976
+ tries + +@parent.jitterSleep(tries)
977
+ next
978
+ end
979
+ raise Plumbing::convert_error_to_porcelain(exception)
999
980
  end
981
+ break
982
+ end
983
+
984
+ resp = RoleAttachmentDeleteResponse.new()
985
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
986
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
987
+ resp
1000
988
  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)
989
+
990
+ # List gets a list of RoleAttachments matching a given set of criteria.
991
+ def list(
992
+ filter,
993
+ *args,
994
+ deadline: nil
995
+ )
996
+ req = V1::RoleAttachmentListRequest.new()
997
+ req.meta = V1::ListRequestMetadata.new()
998
+ page_size_option = @parent._test_options["PageSize"]
999
+ if page_size_option.is_a? Integer
1000
+ req.meta.limit = page_size_option
1001
+ end
1002
+
1003
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1004
+ resp = Enumerator::Generator.new { |g|
1005
+ tries = 0
1006
+ loop do
1007
+ begin
1008
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleAttachments.List", req), deadline: deadline)
1009
+ rescue => exception
1010
+ if (@parent.shouldRetry(tries, exception))
1011
+ tries + +@parent.jitterSleep(tries)
1012
+ next
1016
1013
  end
1017
- @parent = parent
1014
+ raise Plumbing::convert_error_to_porcelain(exception)
1015
+ end
1016
+ tries = 0
1017
+ plumbing_response.role_attachments.each do |plumbing_item|
1018
+ g.yield Plumbing::convert_role_attachment_to_porcelain(plumbing_item)
1019
+ end
1020
+ break if plumbing_response.meta.next_cursor == ""
1021
+ req.meta.cursor = plumbing_response.meta.next_cursor
1018
1022
  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
1023
+ }
1024
+ resp
1025
+ end
1026
+ end
1042
1027
 
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
1028
+ # RoleGrants represent relationships between composite roles and the roles
1029
+ # that make up those composite roles. When a composite role is attached to another
1030
+ # role, the permissions granted to members of the composite role are augmented to
1031
+ # include the permissions granted to members of the attached role.
1032
+ class RoleGrants
1033
+ def initialize(host, insecure, parent)
1034
+ begin
1035
+ if insecure
1036
+ @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
1037
+ else
1038
+ cred = GRPC::Core::ChannelCredentials.new()
1039
+ @stub = V1::RoleGrants::Stub.new(host, cred)
1049
1040
  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
1041
+ rescue => exception
1042
+ raise Plumbing::convert_error_to_porcelain(exception)
1043
+ end
1044
+ @parent = parent
1045
+ end
1046
+
1047
+ # Create registers a new RoleGrant.
1048
+ def create(
1049
+ role_grant,
1050
+ deadline: nil
1051
+ )
1052
+ req = V1::RoleGrantCreateRequest.new()
1073
1053
 
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
1054
+ req.role_grant = Plumbing::convert_role_grant_to_plumbing(role_grant)
1055
+ tries = 0
1056
+ plumbing_response = nil
1057
+ loop do
1058
+ begin
1059
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleGrants.Create", req), deadline: deadline)
1060
+ rescue => exception
1061
+ if (@parent.shouldRetry(tries, exception))
1062
+ tries + +@parent.jitterSleep(tries)
1063
+ next
1064
+ end
1065
+ raise Plumbing::convert_error_to_porcelain(exception)
1080
1066
  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
1067
+ break
1068
+ end
1069
+
1070
+ resp = RoleGrantCreateResponse.new()
1071
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1072
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1073
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1074
+ resp
1075
+ end
1104
1076
 
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
1077
+ # Get reads one RoleGrant by ID.
1078
+ def get(
1079
+ id,
1080
+ deadline: nil
1081
+ )
1082
+ req = V1::RoleGrantGetRequest.new()
1083
+
1084
+ req.id = (id)
1085
+ tries = 0
1086
+ plumbing_response = nil
1087
+ loop do
1088
+ begin
1089
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleGrants.Get", req), deadline: deadline)
1090
+ rescue => exception
1091
+ if (@parent.shouldRetry(tries, exception))
1092
+ tries + +@parent.jitterSleep(tries)
1093
+ next
1094
+ end
1095
+ raise Plumbing::convert_error_to_porcelain(exception)
1110
1096
  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
1122
- 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
1097
+ break
1098
+ end
1099
+
1100
+ resp = RoleGrantGetResponse.new()
1101
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1102
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1103
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1104
+ resp
1105
+ end
1106
+
1107
+ # Delete removes a RoleGrant by ID.
1108
+ def delete(
1109
+ id,
1110
+ deadline: nil
1111
+ )
1112
+ req = V1::RoleGrantDeleteRequest.new()
1113
+
1114
+ req.id = (id)
1115
+ tries = 0
1116
+ plumbing_response = nil
1117
+ loop do
1118
+ begin
1119
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleGrants.Delete", req), deadline: deadline)
1120
+ rescue => exception
1121
+ if (@parent.shouldRetry(tries, exception))
1122
+ tries + +@parent.jitterSleep(tries)
1123
+ next
1124
+ end
1125
+ raise Plumbing::convert_error_to_porcelain(exception)
1147
1126
  end
1127
+ break
1128
+ end
1129
+
1130
+ resp = RoleGrantDeleteResponse.new()
1131
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1132
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1133
+ resp
1148
1134
  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)
1135
+
1136
+ # List gets a list of RoleGrants matching a given set of criteria.
1137
+ def list(
1138
+ filter,
1139
+ *args,
1140
+ deadline: nil
1141
+ )
1142
+ req = V1::RoleGrantListRequest.new()
1143
+ req.meta = V1::ListRequestMetadata.new()
1144
+ page_size_option = @parent._test_options["PageSize"]
1145
+ if page_size_option.is_a? Integer
1146
+ req.meta.limit = page_size_option
1147
+ end
1148
+
1149
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1150
+ resp = Enumerator::Generator.new { |g|
1151
+ tries = 0
1152
+ loop do
1153
+ begin
1154
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleGrants.List", req), deadline: deadline)
1155
+ rescue => exception
1156
+ if (@parent.shouldRetry(tries, exception))
1157
+ tries + +@parent.jitterSleep(tries)
1158
+ next
1165
1159
  end
1166
- @parent = parent
1160
+ raise Plumbing::convert_error_to_porcelain(exception)
1161
+ end
1162
+ tries = 0
1163
+ plumbing_response.role_grants.each do |plumbing_item|
1164
+ g.yield Plumbing::convert_role_grant_to_porcelain(plumbing_item)
1165
+ end
1166
+ break if plumbing_response.meta.next_cursor == ""
1167
+ req.meta.cursor = plumbing_response.meta.next_cursor
1167
1168
  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
1169
+ }
1170
+ resp
1171
+ end
1172
+ end
1191
1173
 
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
1174
+ # Roles are tools for controlling user access to resources. Each Role holds a
1175
+ # list of resources which they grant access to. Composite roles are a special
1176
+ # type of Role which have no resource associations of their own, but instead
1177
+ # grant access to the combined resources associated with a set of child roles.
1178
+ # Each user can be a member of one Role or composite role.
1179
+ class Roles
1180
+ def initialize(host, insecure, parent)
1181
+ begin
1182
+ if insecure
1183
+ @stub = V1::Roles::Stub.new(host, :this_channel_is_insecure)
1184
+ else
1185
+ cred = GRPC::Core::ChannelCredentials.new()
1186
+ @stub = V1::Roles::Stub.new(host, cred)
1198
1187
  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
1188
+ rescue => exception
1189
+ raise Plumbing::convert_error_to_porcelain(exception)
1190
+ end
1191
+ @parent = parent
1192
+ end
1193
+
1194
+ # Create registers a new Role.
1195
+ def create(
1196
+ role,
1197
+ deadline: nil
1198
+ )
1199
+ req = V1::RoleCreateRequest.new()
1222
1200
 
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
1201
+ req.role = Plumbing::convert_role_to_plumbing(role)
1202
+ tries = 0
1203
+ plumbing_response = nil
1204
+ loop do
1205
+ begin
1206
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Roles.Create", req), deadline: deadline)
1207
+ rescue => exception
1208
+ if (@parent.shouldRetry(tries, exception))
1209
+ tries + +@parent.jitterSleep(tries)
1210
+ next
1211
+ end
1212
+ raise Plumbing::convert_error_to_porcelain(exception)
1229
1213
  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
1214
+ break
1215
+ end
1216
+
1217
+ resp = RoleCreateResponse.new()
1218
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1219
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1220
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1221
+ resp
1222
+ end
1223
+
1224
+ # Get reads one Role by ID.
1225
+ def get(
1226
+ id,
1227
+ deadline: nil
1228
+ )
1229
+ req = V1::RoleGetRequest.new()
1230
+
1231
+ req.id = (id)
1232
+ tries = 0
1233
+ plumbing_response = nil
1234
+ loop do
1235
+ begin
1236
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Roles.Get", req), deadline: deadline)
1237
+ rescue => exception
1238
+ if (@parent.shouldRetry(tries, exception))
1239
+ tries + +@parent.jitterSleep(tries)
1240
+ next
1241
+ end
1242
+ raise Plumbing::convert_error_to_porcelain(exception)
1243
+ end
1244
+ break
1245
+ end
1246
+
1247
+ resp = RoleGetResponse.new()
1248
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1249
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1250
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1251
+ resp
1252
+ end
1253
+
1254
+ # Update patches a Role by ID.
1255
+ def update(
1256
+ role,
1257
+ deadline: nil
1258
+ )
1259
+ req = V1::RoleUpdateRequest.new()
1253
1260
 
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
1261
+ req.role = Plumbing::convert_role_to_plumbing(role)
1262
+ tries = 0
1263
+ plumbing_response = nil
1264
+ loop do
1265
+ begin
1266
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Roles.Update", req), deadline: deadline)
1267
+ rescue => exception
1268
+ if (@parent.shouldRetry(tries, exception))
1269
+ tries + +@parent.jitterSleep(tries)
1270
+ next
1271
+ end
1272
+ raise Plumbing::convert_error_to_porcelain(exception)
1260
1273
  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
1274
+ break
1275
+ end
1276
+
1277
+ resp = RoleUpdateResponse.new()
1278
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
1279
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1280
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1281
+ resp
1282
+ end
1283
+
1284
+ # Delete removes a Role by ID.
1285
+ def delete(
1286
+ id,
1287
+ deadline: nil
1288
+ )
1289
+ req = V1::RoleDeleteRequest.new()
1290
+
1291
+ req.id = (id)
1292
+ tries = 0
1293
+ plumbing_response = nil
1294
+ loop do
1295
+ begin
1296
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Roles.Delete", req), deadline: deadline)
1297
+ rescue => exception
1298
+ if (@parent.shouldRetry(tries, exception))
1299
+ tries + +@parent.jitterSleep(tries)
1300
+ next
1301
+ end
1302
+ raise Plumbing::convert_error_to_porcelain(exception)
1303
+ end
1304
+ break
1305
+ end
1306
+
1307
+ resp = RoleDeleteResponse.new()
1308
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1309
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1310
+ resp
1311
+ end
1312
+
1313
+ # List gets a list of Roles matching a given set of criteria.
1314
+ def list(
1315
+ filter,
1316
+ *args,
1317
+ deadline: nil
1318
+ )
1319
+ req = V1::RoleListRequest.new()
1320
+ req.meta = V1::ListRequestMetadata.new()
1321
+ page_size_option = @parent._test_options["PageSize"]
1322
+ if page_size_option.is_a? Integer
1323
+ req.meta.limit = page_size_option
1324
+ end
1325
+
1326
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1327
+ resp = Enumerator::Generator.new { |g|
1328
+ tries = 0
1329
+ loop do
1330
+ begin
1331
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Roles.List", req), deadline: deadline)
1332
+ rescue => exception
1333
+ if (@parent.shouldRetry(tries, exception))
1334
+ tries + +@parent.jitterSleep(tries)
1335
+ next
1283
1336
  end
1337
+ raise Plumbing::convert_error_to_porcelain(exception)
1338
+ end
1339
+ tries = 0
1340
+ plumbing_response.roles.each do |plumbing_item|
1341
+ g.yield Plumbing::convert_role_to_porcelain(plumbing_item)
1342
+ end
1343
+ break if plumbing_response.meta.next_cursor == ""
1344
+ req.meta.cursor = plumbing_response.meta.next_cursor
1345
+ end
1346
+ }
1347
+ resp
1348
+ end
1349
+ end
1284
1350
 
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
1351
+ # SecretStores are servers where resource secrets (passwords, keys) are stored.
1352
+ class SecretStores
1353
+ def initialize(host, insecure, parent)
1354
+ begin
1355
+ if insecure
1356
+ @stub = V1::SecretStores::Stub.new(host, :this_channel_is_insecure)
1357
+ else
1358
+ cred = GRPC::Core::ChannelCredentials.new()
1359
+ @stub = V1::SecretStores::Stub.new(host, cred)
1290
1360
  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
1361
+ rescue => exception
1362
+ raise Plumbing::convert_error_to_porcelain(exception)
1363
+ end
1364
+ @parent = parent
1365
+ end
1366
+
1367
+ def create(
1368
+ secret_store,
1369
+ deadline: nil
1370
+ )
1371
+ req = V1::SecretStoreCreateRequest.new()
1372
+
1373
+ req.secret_store = Plumbing::convert_secret_store_to_plumbing(secret_store)
1374
+ tries = 0
1375
+ plumbing_response = nil
1376
+ loop do
1377
+ begin
1378
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("SecretStores.Create", req), deadline: deadline)
1379
+ rescue => exception
1380
+ if (@parent.shouldRetry(tries, exception))
1381
+ tries + +@parent.jitterSleep(tries)
1382
+ next
1383
+ end
1384
+ raise Plumbing::convert_error_to_porcelain(exception)
1385
+ end
1386
+ break
1387
+ end
1388
+
1389
+ resp = SecretStoreCreateResponse.new()
1390
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1391
+ resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store)
1392
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1393
+ resp
1394
+ end
1395
+
1396
+ # Get reads one SecretStore by ID.
1397
+ def get(
1398
+ id,
1399
+ deadline: nil
1400
+ )
1401
+ req = V1::SecretStoreGetRequest.new()
1402
+
1403
+ req.id = (id)
1404
+ tries = 0
1405
+ plumbing_response = nil
1406
+ loop do
1407
+ begin
1408
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("SecretStores.Get", req), deadline: deadline)
1409
+ rescue => exception
1410
+ if (@parent.shouldRetry(tries, exception))
1411
+ tries + +@parent.jitterSleep(tries)
1412
+ next
1413
+ end
1414
+ raise Plumbing::convert_error_to_porcelain(exception)
1415
+ end
1416
+ break
1417
+ end
1418
+
1419
+ resp = SecretStoreGetResponse.new()
1420
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1421
+ resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store)
1422
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1423
+ resp
1424
+ end
1425
+
1426
+ # Update patches a SecretStore by ID.
1427
+ def update(
1428
+ secret_store,
1429
+ deadline: nil
1430
+ )
1431
+ req = V1::SecretStoreUpdateRequest.new()
1432
+
1433
+ req.secret_store = Plumbing::convert_secret_store_to_plumbing(secret_store)
1434
+ tries = 0
1435
+ plumbing_response = nil
1436
+ loop do
1437
+ begin
1438
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("SecretStores.Update", req), deadline: deadline)
1439
+ rescue => exception
1440
+ if (@parent.shouldRetry(tries, exception))
1441
+ tries + +@parent.jitterSleep(tries)
1442
+ next
1443
+ end
1444
+ raise Plumbing::convert_error_to_porcelain(exception)
1445
+ end
1446
+ break
1447
+ end
1448
+
1449
+ resp = SecretStoreUpdateResponse.new()
1450
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
1451
+ resp.secret_store = Plumbing::convert_secret_store_to_porcelain(plumbing_response.secret_store)
1452
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1453
+ resp
1454
+ end
1455
+
1456
+ # Delete removes a SecretStore by ID.
1457
+ def delete(
1458
+ id,
1459
+ deadline: nil
1460
+ )
1461
+ req = V1::SecretStoreDeleteRequest.new()
1462
+
1463
+ req.id = (id)
1464
+ tries = 0
1465
+ plumbing_response = nil
1466
+ loop do
1467
+ begin
1468
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("SecretStores.Delete", req), deadline: deadline)
1469
+ rescue => exception
1470
+ if (@parent.shouldRetry(tries, exception))
1471
+ tries + +@parent.jitterSleep(tries)
1472
+ next
1473
+ end
1474
+ raise Plumbing::convert_error_to_porcelain(exception)
1475
+ end
1476
+ break
1477
+ end
1478
+
1479
+ resp = SecretStoreDeleteResponse.new()
1480
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1481
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1482
+ resp
1483
+ end
1484
+
1485
+ # List gets a list of SecretStores matching a given set of criteria.
1486
+ def list(
1487
+ filter,
1488
+ *args,
1489
+ deadline: nil
1490
+ )
1491
+ req = V1::SecretStoreListRequest.new()
1492
+ req.meta = V1::ListRequestMetadata.new()
1493
+ page_size_option = @parent._test_options["PageSize"]
1494
+ if page_size_option.is_a? Integer
1495
+ req.meta.limit = page_size_option
1496
+ end
1497
+
1498
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1499
+ resp = Enumerator::Generator.new { |g|
1500
+ tries = 0
1501
+ loop do
1502
+ begin
1503
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("SecretStores.List", req), deadline: deadline)
1504
+ rescue => exception
1505
+ if (@parent.shouldRetry(tries, exception))
1506
+ tries + +@parent.jitterSleep(tries)
1507
+ next
1302
1508
  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
1509
+ raise Plumbing::convert_error_to_porcelain(exception)
1510
+ end
1511
+ tries = 0
1512
+ plumbing_response.secret_stores.each do |plumbing_item|
1513
+ g.yield Plumbing::convert_secret_store_to_porcelain(plumbing_item)
1514
+ end
1515
+ break if plumbing_response.meta.next_cursor == ""
1516
+ req.meta.cursor = plumbing_response.meta.next_cursor
1327
1517
  end
1518
+ }
1519
+ resp
1328
1520
  end
1521
+ end
1329
1522
  end