google-cloud-compute-v1 2.10.0 → 2.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +9 -3
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +17 -7
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +17 -7
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +27 -12
  6. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +35 -16
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +51 -1
  8. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +9 -3
  9. data/lib/google/cloud/compute/v1/disks/rest/client.rb +39 -18
  10. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +15 -6
  11. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +39 -18
  12. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +15 -6
  13. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +19 -8
  14. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +15 -6
  15. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +17 -7
  16. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +17 -7
  17. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +13 -5
  18. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +9 -3
  19. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +13 -5
  20. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +17 -7
  21. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +5 -1
  22. data/lib/google/cloud/compute/v1/images/rest/client.rb +25 -11
  23. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/credentials.rb +52 -0
  24. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +837 -0
  25. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/service_stub.rb +378 -0
  26. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest.rb +51 -0
  27. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests.rb +47 -0
  28. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +43 -20
  29. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +21 -9
  30. data/lib/google/cloud/compute/v1/instance_settings_service/credentials.rb +52 -0
  31. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +517 -0
  32. data/lib/google/cloud/compute/v1/instance_settings_service/rest/service_stub.rb +190 -0
  33. data/lib/google/cloud/compute/v1/instance_settings_service/rest.rb +51 -0
  34. data/lib/google/cloud/compute/v1/instance_settings_service.rb +47 -0
  35. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +19 -8
  36. data/lib/google/cloud/compute/v1/instances/rest/client.rb +99 -48
  37. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +21 -9
  38. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +17 -7
  39. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +7 -2
  40. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +7 -2
  41. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +19 -8
  42. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +7 -2
  43. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +17 -7
  44. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +17 -7
  45. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +9 -3
  46. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +21 -9
  47. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +13 -5
  48. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +21 -9
  49. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +35 -16
  50. data/lib/google/cloud/compute/v1/networks/rest/client.rb +25 -11
  51. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +136 -14
  52. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +62 -0
  53. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +19 -8
  54. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +9 -3
  55. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +17 -7
  56. data/lib/google/cloud/compute/v1/projects/rest/client.rb +31 -14
  57. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +17 -7
  58. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +19 -8
  59. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +15 -6
  60. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +27 -12
  61. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +13 -5
  62. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +7 -2
  63. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +37 -17
  64. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +13 -5
  65. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +15 -6
  66. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +41 -19
  67. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +11 -4
  68. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +11 -4
  69. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +5 -1
  70. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +19 -8
  71. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +17 -7
  72. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +37 -17
  73. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +11 -4
  74. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +11 -4
  75. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +21 -9
  76. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +11 -4
  77. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +15 -6
  78. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +13 -5
  79. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +17 -7
  80. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +11 -4
  81. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +17 -7
  82. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +5 -1
  83. data/lib/google/cloud/compute/v1/regions/rest/client.rb +7 -2
  84. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +23 -10
  85. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +21 -9
  86. data/lib/google/cloud/compute/v1/rest.rb +4 -0
  87. data/lib/google/cloud/compute/v1/routers/rest/client.rb +25 -11
  88. data/lib/google/cloud/compute/v1/routes/rest/client.rb +11 -4
  89. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +27 -12
  90. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +21 -9
  91. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +7 -2
  92. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +19 -8
  93. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +13 -5
  94. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +17 -7
  95. data/lib/google/cloud/compute/v1/storage_pool_types/credentials.rb +53 -0
  96. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +609 -0
  97. data/lib/google/cloud/compute/v1/storage_pool_types/rest/service_stub.rb +249 -0
  98. data/lib/google/cloud/compute/v1/storage_pool_types/rest.rb +51 -0
  99. data/lib/google/cloud/compute/v1/storage_pool_types.rb +47 -0
  100. data/lib/google/cloud/compute/v1/storage_pools/credentials.rb +52 -0
  101. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +1326 -0
  102. data/lib/google/cloud/compute/v1/storage_pools/rest/service_stub.rb +679 -0
  103. data/lib/google/cloud/compute/v1/storage_pools/rest.rb +51 -0
  104. data/lib/google/cloud/compute/v1/storage_pools.rb +47 -0
  105. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +27 -12
  106. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +13 -5
  107. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +17 -7
  108. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +25 -11
  109. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +15 -6
  110. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +27 -12
  111. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +21 -9
  112. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +17 -7
  113. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +15 -6
  114. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +21 -9
  115. data/lib/google/cloud/compute/v1/version.rb +1 -1
  116. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +19 -8
  117. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +15 -6
  118. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +11 -4
  119. data/lib/google/cloud/compute/v1/zones/rest/client.rb +7 -2
  120. data/lib/google/cloud/compute/v1.rb +4 -0
  121. data/proto_docs/google/api/client.rb +4 -0
  122. data/proto_docs/google/cloud/compute/v1/compute.rb +1333 -37
  123. metadata +22 -2
@@ -0,0 +1,1326 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/storage_pools/rest/service_stub"
22
+ require "google/cloud/compute/v1/zone_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module StoragePools
29
+ module Rest
30
+ ##
31
+ # REST client for the StoragePools service.
32
+ #
33
+ # The StoragePools API.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
41
+
42
+ # @private
43
+ attr_reader :storage_pools_stub
44
+
45
+ ##
46
+ # Configure the StoragePools Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::StoragePools::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all StoragePools clients
54
+ # ::Google::Cloud::Compute::V1::StoragePools::Rest::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Compute", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.aggregated_list.timeout = 600.0
75
+ default_config.rpcs.aggregated_list.retry_policy = {
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
77
+ }
78
+
79
+ default_config.rpcs.delete.timeout = 600.0
80
+
81
+ default_config.rpcs.get.timeout = 600.0
82
+ default_config.rpcs.get.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config.rpcs.get_iam_policy.timeout = 600.0
87
+ default_config.rpcs.get_iam_policy.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
89
+ }
90
+
91
+ default_config.rpcs.insert.timeout = 600.0
92
+
93
+ default_config.rpcs.list.timeout = 600.0
94
+ default_config.rpcs.list.retry_policy = {
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
96
+ }
97
+
98
+ default_config.rpcs.list_disks.timeout = 600.0
99
+ default_config.rpcs.list_disks.retry_policy = {
100
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
101
+ }
102
+
103
+ default_config.rpcs.set_iam_policy.timeout = 600.0
104
+
105
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
106
+
107
+ default_config.rpcs.update.timeout = 600.0
108
+
109
+ default_config
110
+ end
111
+ yield @configure if block_given?
112
+ @configure
113
+ end
114
+
115
+ ##
116
+ # Configure the StoragePools Client instance.
117
+ #
118
+ # The configuration is set to the derived mode, meaning that values can be changed,
119
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
120
+ # should be made on {Client.configure}.
121
+ #
122
+ # See {::Google::Cloud::Compute::V1::StoragePools::Rest::Client::Configuration}
123
+ # for a description of the configuration fields.
124
+ #
125
+ # @yield [config] Configure the Client client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ # @return [Client::Configuration]
129
+ #
130
+ def configure
131
+ yield @config if block_given?
132
+ @config
133
+ end
134
+
135
+ ##
136
+ # The effective universe domain
137
+ #
138
+ # @return [String]
139
+ #
140
+ def universe_domain
141
+ @storage_pools_stub.universe_domain
142
+ end
143
+
144
+ ##
145
+ # Create a new StoragePools REST client object.
146
+ #
147
+ # @example
148
+ #
149
+ # # Create a client using the default configuration
150
+ # client = ::Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
151
+ #
152
+ # # Create a client using a custom configuration
153
+ # client = ::Google::Cloud::Compute::V1::StoragePools::Rest::Client.new do |config|
154
+ # config.timeout = 10.0
155
+ # end
156
+ #
157
+ # @yield [config] Configure the StoragePools client.
158
+ # @yieldparam config [Client::Configuration]
159
+ #
160
+ def initialize
161
+ # Create the configuration object
162
+ @config = Configuration.new Client.configure
163
+
164
+ # Yield the configuration if needed
165
+ yield @config if block_given?
166
+
167
+ # Create credentials
168
+ credentials = @config.credentials
169
+ # Use self-signed JWT if the endpoint is unchanged from default,
170
+ # but only if the default endpoint does not have a region prefix.
171
+ enable_self_signed_jwt = @config.endpoint.nil? ||
172
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
173
+ !@config.endpoint.split(".").first.include?("-"))
174
+ credentials ||= Credentials.default scope: @config.scope,
175
+ enable_self_signed_jwt: enable_self_signed_jwt
176
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
177
+ credentials = Credentials.new credentials, scope: @config.scope
178
+ end
179
+
180
+ @quota_project_id = @config.quota_project
181
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
182
+
183
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
184
+ config.credentials = credentials
185
+ config.quota_project = @quota_project_id
186
+ config.endpoint = @config.endpoint
187
+ config.universe_domain = @config.universe_domain
188
+ end
189
+
190
+ @storage_pools_stub = ::Google::Cloud::Compute::V1::StoragePools::Rest::ServiceStub.new(
191
+ endpoint: @config.endpoint,
192
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
193
+ universe_domain: @config.universe_domain,
194
+ credentials: credentials
195
+ )
196
+ end
197
+
198
+ ##
199
+ # Get the associated client for long-running operations via ZoneOperations.
200
+ #
201
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
202
+ #
203
+ attr_reader :zone_operations
204
+
205
+ # Service calls
206
+
207
+ ##
208
+ # Retrieves an aggregated list of storage pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
209
+ #
210
+ # @overload aggregated_list(request, options = nil)
211
+ # Pass arguments to `aggregated_list` via a request object, either of type
212
+ # {::Google::Cloud::Compute::V1::AggregatedListStoragePoolsRequest} or an equivalent Hash.
213
+ #
214
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListStoragePoolsRequest, ::Hash]
215
+ # A request object representing the call parameters. Required. To specify no
216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
217
+ # @param options [::Gapic::CallOptions, ::Hash]
218
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
219
+ #
220
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, service_project_number: nil)
221
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
222
+ # least one keyword argument is required. To specify no parameters, or to keep all
223
+ # the default parameter values, pass an empty Hash as a request object (see above).
224
+ #
225
+ # @param filter [::String]
226
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
227
+ # @param include_all_scopes [::Boolean]
228
+ # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
229
+ # @param max_results [::Integer]
230
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
231
+ # @param order_by [::String]
232
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
233
+ # @param page_token [::String]
234
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
235
+ # @param project [::String]
236
+ # Project ID for this request.
237
+ # @param return_partial_success [::Boolean]
238
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
239
+ # @param service_project_number [::Integer]
240
+ # The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.
241
+ # @yield [result, operation] Access the result along with the TransportOperation object
242
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::StoragePoolsScopedList>]
243
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
244
+ #
245
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::StoragePoolsScopedList>]
246
+ #
247
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
248
+ #
249
+ # @example Basic example
250
+ # require "google/cloud/compute/v1"
251
+ #
252
+ # # Create a client object. The client can be reused for multiple calls.
253
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
254
+ #
255
+ # # Create a request. To set request fields, pass in keyword arguments.
256
+ # request = Google::Cloud::Compute::V1::AggregatedListStoragePoolsRequest.new
257
+ #
258
+ # # Call the aggregated_list method.
259
+ # result = client.aggregated_list request
260
+ #
261
+ # # The returned object is of type Google::Cloud::Compute::V1::StoragePoolAggregatedList.
262
+ # p result
263
+ #
264
+ def aggregated_list request, options = nil
265
+ raise ::ArgumentError, "request must be provided" if request.nil?
266
+
267
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListStoragePoolsRequest
268
+
269
+ # Converts hash and nil to an options object
270
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
271
+
272
+ # Customize the options with defaults
273
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
274
+
275
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
276
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
277
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
278
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
279
+ transports_version_send: [:rest]
280
+
281
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
282
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
283
+
284
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
285
+ metadata: call_metadata,
286
+ retry_policy: @config.rpcs.aggregated_list.retry_policy
287
+
288
+ options.apply_defaults timeout: @config.timeout,
289
+ metadata: @config.metadata,
290
+ retry_policy: @config.retry_policy
291
+
292
+ @storage_pools_stub.aggregated_list request, options do |result, operation|
293
+ result = ::Gapic::Rest::PagedEnumerable.new @storage_pools_stub, :aggregated_list, "items", request, result, options
294
+ yield result, operation if block_given?
295
+ return result
296
+ end
297
+ rescue ::Gapic::Rest::Error => e
298
+ raise ::Google::Cloud::Error.from_error(e)
299
+ end
300
+
301
+ ##
302
+ # Deletes the specified storage pool. Deleting a storagePool removes its data permanently and is irreversible. However, deleting a storagePool does not delete any snapshots previously made from the storagePool. You must separately delete snapshots.
303
+ #
304
+ # @overload delete(request, options = nil)
305
+ # Pass arguments to `delete` via a request object, either of type
306
+ # {::Google::Cloud::Compute::V1::DeleteStoragePoolRequest} or an equivalent Hash.
307
+ #
308
+ # @param request [::Google::Cloud::Compute::V1::DeleteStoragePoolRequest, ::Hash]
309
+ # A request object representing the call parameters. Required. To specify no
310
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
311
+ # @param options [::Gapic::CallOptions, ::Hash]
312
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
313
+ #
314
+ # @overload delete(project: nil, request_id: nil, storage_pool: nil, zone: nil)
315
+ # Pass arguments to `delete` via keyword arguments. Note that at
316
+ # least one keyword argument is required. To specify no parameters, or to keep all
317
+ # the default parameter values, pass an empty Hash as a request object (see above).
318
+ #
319
+ # @param project [::String]
320
+ # Project ID for this request.
321
+ # @param request_id [::String]
322
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
323
+ # @param storage_pool [::String]
324
+ # Name of the storage pool to delete.
325
+ # @param zone [::String]
326
+ # The name of the zone for this request.
327
+ # @yield [result, operation] Access the result along with the TransportOperation object
328
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
329
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
330
+ #
331
+ # @return [::Gapic::GenericLRO::Operation]
332
+ #
333
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
334
+ #
335
+ # @example Basic example
336
+ # require "google/cloud/compute/v1"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Cloud::Compute::V1::DeleteStoragePoolRequest.new
343
+ #
344
+ # # Call the delete method.
345
+ # result = client.delete request
346
+ #
347
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
348
+ # p result
349
+ #
350
+ def delete request, options = nil
351
+ raise ::ArgumentError, "request must be provided" if request.nil?
352
+
353
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteStoragePoolRequest
354
+
355
+ # Converts hash and nil to an options object
356
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
357
+
358
+ # Customize the options with defaults
359
+ call_metadata = @config.rpcs.delete.metadata.to_h
360
+
361
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
362
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
363
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
364
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
365
+ transports_version_send: [:rest]
366
+
367
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
368
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
369
+
370
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
371
+ metadata: call_metadata,
372
+ retry_policy: @config.rpcs.delete.retry_policy
373
+
374
+ options.apply_defaults timeout: @config.timeout,
375
+ metadata: @config.metadata,
376
+ retry_policy: @config.retry_policy
377
+
378
+ @storage_pools_stub.delete request, options do |result, response|
379
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
380
+ operation: result,
381
+ client: zone_operations,
382
+ request_values: {
383
+ "project" => request.project,
384
+ "zone" => request.zone
385
+ },
386
+ options: options
387
+ )
388
+ yield result, response if block_given?
389
+ return result
390
+ end
391
+ rescue ::Gapic::Rest::Error => e
392
+ raise ::Google::Cloud::Error.from_error(e)
393
+ end
394
+
395
+ ##
396
+ # Returns a specified storage pool. Gets a list of available storage pools by making a list() request.
397
+ #
398
+ # @overload get(request, options = nil)
399
+ # Pass arguments to `get` via a request object, either of type
400
+ # {::Google::Cloud::Compute::V1::GetStoragePoolRequest} or an equivalent Hash.
401
+ #
402
+ # @param request [::Google::Cloud::Compute::V1::GetStoragePoolRequest, ::Hash]
403
+ # A request object representing the call parameters. Required. To specify no
404
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
405
+ # @param options [::Gapic::CallOptions, ::Hash]
406
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
407
+ #
408
+ # @overload get(project: nil, storage_pool: nil, zone: nil)
409
+ # Pass arguments to `get` via keyword arguments. Note that at
410
+ # least one keyword argument is required. To specify no parameters, or to keep all
411
+ # the default parameter values, pass an empty Hash as a request object (see above).
412
+ #
413
+ # @param project [::String]
414
+ # Project ID for this request.
415
+ # @param storage_pool [::String]
416
+ # Name of the storage pool to return.
417
+ # @param zone [::String]
418
+ # The name of the zone for this request.
419
+ # @yield [result, operation] Access the result along with the TransportOperation object
420
+ # @yieldparam result [::Google::Cloud::Compute::V1::StoragePool]
421
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
422
+ #
423
+ # @return [::Google::Cloud::Compute::V1::StoragePool]
424
+ #
425
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
426
+ #
427
+ # @example Basic example
428
+ # require "google/cloud/compute/v1"
429
+ #
430
+ # # Create a client object. The client can be reused for multiple calls.
431
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
432
+ #
433
+ # # Create a request. To set request fields, pass in keyword arguments.
434
+ # request = Google::Cloud::Compute::V1::GetStoragePoolRequest.new
435
+ #
436
+ # # Call the get method.
437
+ # result = client.get request
438
+ #
439
+ # # The returned object is of type Google::Cloud::Compute::V1::StoragePool.
440
+ # p result
441
+ #
442
+ def get request, options = nil
443
+ raise ::ArgumentError, "request must be provided" if request.nil?
444
+
445
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetStoragePoolRequest
446
+
447
+ # Converts hash and nil to an options object
448
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
449
+
450
+ # Customize the options with defaults
451
+ call_metadata = @config.rpcs.get.metadata.to_h
452
+
453
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
454
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
455
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
456
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
457
+ transports_version_send: [:rest]
458
+
459
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
460
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
461
+
462
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
463
+ metadata: call_metadata,
464
+ retry_policy: @config.rpcs.get.retry_policy
465
+
466
+ options.apply_defaults timeout: @config.timeout,
467
+ metadata: @config.metadata,
468
+ retry_policy: @config.retry_policy
469
+
470
+ @storage_pools_stub.get request, options do |result, operation|
471
+ yield result, operation if block_given?
472
+ return result
473
+ end
474
+ rescue ::Gapic::Rest::Error => e
475
+ raise ::Google::Cloud::Error.from_error(e)
476
+ end
477
+
478
+ ##
479
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
480
+ #
481
+ # @overload get_iam_policy(request, options = nil)
482
+ # Pass arguments to `get_iam_policy` via a request object, either of type
483
+ # {::Google::Cloud::Compute::V1::GetIamPolicyStoragePoolRequest} or an equivalent Hash.
484
+ #
485
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyStoragePoolRequest, ::Hash]
486
+ # A request object representing the call parameters. Required. To specify no
487
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
488
+ # @param options [::Gapic::CallOptions, ::Hash]
489
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
490
+ #
491
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, resource: nil, zone: nil)
492
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
493
+ # least one keyword argument is required. To specify no parameters, or to keep all
494
+ # the default parameter values, pass an empty Hash as a request object (see above).
495
+ #
496
+ # @param options_requested_policy_version [::Integer]
497
+ # Requested IAM Policy version.
498
+ # @param project [::String]
499
+ # Project ID for this request.
500
+ # @param resource [::String]
501
+ # Name or id of the resource for this request.
502
+ # @param zone [::String]
503
+ # The name of the zone for this request.
504
+ # @yield [result, operation] Access the result along with the TransportOperation object
505
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
506
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
507
+ #
508
+ # @return [::Google::Cloud::Compute::V1::Policy]
509
+ #
510
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
511
+ #
512
+ # @example Basic example
513
+ # require "google/cloud/compute/v1"
514
+ #
515
+ # # Create a client object. The client can be reused for multiple calls.
516
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
517
+ #
518
+ # # Create a request. To set request fields, pass in keyword arguments.
519
+ # request = Google::Cloud::Compute::V1::GetIamPolicyStoragePoolRequest.new
520
+ #
521
+ # # Call the get_iam_policy method.
522
+ # result = client.get_iam_policy request
523
+ #
524
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
525
+ # p result
526
+ #
527
+ def get_iam_policy request, options = nil
528
+ raise ::ArgumentError, "request must be provided" if request.nil?
529
+
530
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyStoragePoolRequest
531
+
532
+ # Converts hash and nil to an options object
533
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
534
+
535
+ # Customize the options with defaults
536
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
537
+
538
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
539
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
540
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
541
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
542
+ transports_version_send: [:rest]
543
+
544
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
545
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
546
+
547
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
548
+ metadata: call_metadata,
549
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
550
+
551
+ options.apply_defaults timeout: @config.timeout,
552
+ metadata: @config.metadata,
553
+ retry_policy: @config.retry_policy
554
+
555
+ @storage_pools_stub.get_iam_policy request, options do |result, operation|
556
+ yield result, operation if block_given?
557
+ return result
558
+ end
559
+ rescue ::Gapic::Rest::Error => e
560
+ raise ::Google::Cloud::Error.from_error(e)
561
+ end
562
+
563
+ ##
564
+ # Creates a storage pool in the specified project using the data in the request.
565
+ #
566
+ # @overload insert(request, options = nil)
567
+ # Pass arguments to `insert` via a request object, either of type
568
+ # {::Google::Cloud::Compute::V1::InsertStoragePoolRequest} or an equivalent Hash.
569
+ #
570
+ # @param request [::Google::Cloud::Compute::V1::InsertStoragePoolRequest, ::Hash]
571
+ # A request object representing the call parameters. Required. To specify no
572
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
573
+ # @param options [::Gapic::CallOptions, ::Hash]
574
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
575
+ #
576
+ # @overload insert(project: nil, request_id: nil, storage_pool_resource: nil, zone: nil)
577
+ # Pass arguments to `insert` via keyword arguments. Note that at
578
+ # least one keyword argument is required. To specify no parameters, or to keep all
579
+ # the default parameter values, pass an empty Hash as a request object (see above).
580
+ #
581
+ # @param project [::String]
582
+ # Project ID for this request.
583
+ # @param request_id [::String]
584
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
585
+ # @param storage_pool_resource [::Google::Cloud::Compute::V1::StoragePool, ::Hash]
586
+ # The body resource for this request
587
+ # @param zone [::String]
588
+ # The name of the zone for this request.
589
+ # @yield [result, operation] Access the result along with the TransportOperation object
590
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
591
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
592
+ #
593
+ # @return [::Gapic::GenericLRO::Operation]
594
+ #
595
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
596
+ #
597
+ # @example Basic example
598
+ # require "google/cloud/compute/v1"
599
+ #
600
+ # # Create a client object. The client can be reused for multiple calls.
601
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
602
+ #
603
+ # # Create a request. To set request fields, pass in keyword arguments.
604
+ # request = Google::Cloud::Compute::V1::InsertStoragePoolRequest.new
605
+ #
606
+ # # Call the insert method.
607
+ # result = client.insert request
608
+ #
609
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
610
+ # p result
611
+ #
612
+ def insert request, options = nil
613
+ raise ::ArgumentError, "request must be provided" if request.nil?
614
+
615
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertStoragePoolRequest
616
+
617
+ # Converts hash and nil to an options object
618
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
619
+
620
+ # Customize the options with defaults
621
+ call_metadata = @config.rpcs.insert.metadata.to_h
622
+
623
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
624
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
625
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
626
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
627
+ transports_version_send: [:rest]
628
+
629
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
630
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
631
+
632
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
633
+ metadata: call_metadata,
634
+ retry_policy: @config.rpcs.insert.retry_policy
635
+
636
+ options.apply_defaults timeout: @config.timeout,
637
+ metadata: @config.metadata,
638
+ retry_policy: @config.retry_policy
639
+
640
+ @storage_pools_stub.insert request, options do |result, response|
641
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
642
+ operation: result,
643
+ client: zone_operations,
644
+ request_values: {
645
+ "project" => request.project,
646
+ "zone" => request.zone
647
+ },
648
+ options: options
649
+ )
650
+ yield result, response if block_given?
651
+ return result
652
+ end
653
+ rescue ::Gapic::Rest::Error => e
654
+ raise ::Google::Cloud::Error.from_error(e)
655
+ end
656
+
657
+ ##
658
+ # Retrieves a list of storage pools contained within the specified zone.
659
+ #
660
+ # @overload list(request, options = nil)
661
+ # Pass arguments to `list` via a request object, either of type
662
+ # {::Google::Cloud::Compute::V1::ListStoragePoolsRequest} or an equivalent Hash.
663
+ #
664
+ # @param request [::Google::Cloud::Compute::V1::ListStoragePoolsRequest, ::Hash]
665
+ # A request object representing the call parameters. Required. To specify no
666
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
667
+ # @param options [::Gapic::CallOptions, ::Hash]
668
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
669
+ #
670
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: nil)
671
+ # Pass arguments to `list` via keyword arguments. Note that at
672
+ # least one keyword argument is required. To specify no parameters, or to keep all
673
+ # the default parameter values, pass an empty Hash as a request object (see above).
674
+ #
675
+ # @param filter [::String]
676
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
677
+ # @param max_results [::Integer]
678
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
679
+ # @param order_by [::String]
680
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
681
+ # @param page_token [::String]
682
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
683
+ # @param project [::String]
684
+ # Project ID for this request.
685
+ # @param return_partial_success [::Boolean]
686
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
687
+ # @param zone [::String]
688
+ # The name of the zone for this request.
689
+ # @yield [result, operation] Access the result along with the TransportOperation object
690
+ # @yieldparam result [::Google::Cloud::Compute::V1::StoragePoolList]
691
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
692
+ #
693
+ # @return [::Google::Cloud::Compute::V1::StoragePoolList]
694
+ #
695
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
696
+ #
697
+ # @example Basic example
698
+ # require "google/cloud/compute/v1"
699
+ #
700
+ # # Create a client object. The client can be reused for multiple calls.
701
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
702
+ #
703
+ # # Create a request. To set request fields, pass in keyword arguments.
704
+ # request = Google::Cloud::Compute::V1::ListStoragePoolsRequest.new
705
+ #
706
+ # # Call the list method.
707
+ # result = client.list request
708
+ #
709
+ # # The returned object is of type Google::Cloud::Compute::V1::StoragePoolList.
710
+ # p result
711
+ #
712
+ def list request, options = nil
713
+ raise ::ArgumentError, "request must be provided" if request.nil?
714
+
715
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListStoragePoolsRequest
716
+
717
+ # Converts hash and nil to an options object
718
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
719
+
720
+ # Customize the options with defaults
721
+ call_metadata = @config.rpcs.list.metadata.to_h
722
+
723
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
724
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
725
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
726
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
727
+ transports_version_send: [:rest]
728
+
729
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
730
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
731
+
732
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
733
+ metadata: call_metadata,
734
+ retry_policy: @config.rpcs.list.retry_policy
735
+
736
+ options.apply_defaults timeout: @config.timeout,
737
+ metadata: @config.metadata,
738
+ retry_policy: @config.retry_policy
739
+
740
+ @storage_pools_stub.list request, options do |result, operation|
741
+ yield result, operation if block_given?
742
+ return result
743
+ end
744
+ rescue ::Gapic::Rest::Error => e
745
+ raise ::Google::Cloud::Error.from_error(e)
746
+ end
747
+
748
+ ##
749
+ # Lists the disks in a specified storage pool.
750
+ #
751
+ # @overload list_disks(request, options = nil)
752
+ # Pass arguments to `list_disks` via a request object, either of type
753
+ # {::Google::Cloud::Compute::V1::ListDisksStoragePoolsRequest} or an equivalent Hash.
754
+ #
755
+ # @param request [::Google::Cloud::Compute::V1::ListDisksStoragePoolsRequest, ::Hash]
756
+ # A request object representing the call parameters. Required. To specify no
757
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
758
+ # @param options [::Gapic::CallOptions, ::Hash]
759
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
760
+ #
761
+ # @overload list_disks(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, storage_pool: nil, zone: nil)
762
+ # Pass arguments to `list_disks` via keyword arguments. Note that at
763
+ # least one keyword argument is required. To specify no parameters, or to keep all
764
+ # the default parameter values, pass an empty Hash as a request object (see above).
765
+ #
766
+ # @param filter [::String]
767
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
768
+ # @param max_results [::Integer]
769
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
770
+ # @param order_by [::String]
771
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
772
+ # @param page_token [::String]
773
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
774
+ # @param project [::String]
775
+ # Project ID for this request.
776
+ # @param return_partial_success [::Boolean]
777
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
778
+ # @param storage_pool [::String]
779
+ # Name of the storage pool to list disks of.
780
+ # @param zone [::String]
781
+ # The name of the zone for this request.
782
+ # @yield [result, operation] Access the result along with the TransportOperation object
783
+ # @yieldparam result [::Google::Cloud::Compute::V1::StoragePoolListDisks]
784
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
785
+ #
786
+ # @return [::Google::Cloud::Compute::V1::StoragePoolListDisks]
787
+ #
788
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
789
+ #
790
+ # @example Basic example
791
+ # require "google/cloud/compute/v1"
792
+ #
793
+ # # Create a client object. The client can be reused for multiple calls.
794
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
795
+ #
796
+ # # Create a request. To set request fields, pass in keyword arguments.
797
+ # request = Google::Cloud::Compute::V1::ListDisksStoragePoolsRequest.new
798
+ #
799
+ # # Call the list_disks method.
800
+ # result = client.list_disks request
801
+ #
802
+ # # The returned object is of type Google::Cloud::Compute::V1::StoragePoolListDisks.
803
+ # p result
804
+ #
805
+ def list_disks request, options = nil
806
+ raise ::ArgumentError, "request must be provided" if request.nil?
807
+
808
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListDisksStoragePoolsRequest
809
+
810
+ # Converts hash and nil to an options object
811
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
812
+
813
+ # Customize the options with defaults
814
+ call_metadata = @config.rpcs.list_disks.metadata.to_h
815
+
816
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
817
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
818
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
819
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
820
+ transports_version_send: [:rest]
821
+
822
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
823
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
824
+
825
+ options.apply_defaults timeout: @config.rpcs.list_disks.timeout,
826
+ metadata: call_metadata,
827
+ retry_policy: @config.rpcs.list_disks.retry_policy
828
+
829
+ options.apply_defaults timeout: @config.timeout,
830
+ metadata: @config.metadata,
831
+ retry_policy: @config.retry_policy
832
+
833
+ @storage_pools_stub.list_disks request, options do |result, operation|
834
+ yield result, operation if block_given?
835
+ return result
836
+ end
837
+ rescue ::Gapic::Rest::Error => e
838
+ raise ::Google::Cloud::Error.from_error(e)
839
+ end
840
+
841
+ ##
842
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
843
+ #
844
+ # @overload set_iam_policy(request, options = nil)
845
+ # Pass arguments to `set_iam_policy` via a request object, either of type
846
+ # {::Google::Cloud::Compute::V1::SetIamPolicyStoragePoolRequest} or an equivalent Hash.
847
+ #
848
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyStoragePoolRequest, ::Hash]
849
+ # A request object representing the call parameters. Required. To specify no
850
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
851
+ # @param options [::Gapic::CallOptions, ::Hash]
852
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
853
+ #
854
+ # @overload set_iam_policy(project: nil, resource: nil, zone: nil, zone_set_policy_request_resource: nil)
855
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
856
+ # least one keyword argument is required. To specify no parameters, or to keep all
857
+ # the default parameter values, pass an empty Hash as a request object (see above).
858
+ #
859
+ # @param project [::String]
860
+ # Project ID for this request.
861
+ # @param resource [::String]
862
+ # Name or id of the resource for this request.
863
+ # @param zone [::String]
864
+ # The name of the zone for this request.
865
+ # @param zone_set_policy_request_resource [::Google::Cloud::Compute::V1::ZoneSetPolicyRequest, ::Hash]
866
+ # The body resource for this request
867
+ # @yield [result, operation] Access the result along with the TransportOperation object
868
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
869
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
870
+ #
871
+ # @return [::Google::Cloud::Compute::V1::Policy]
872
+ #
873
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
874
+ #
875
+ # @example Basic example
876
+ # require "google/cloud/compute/v1"
877
+ #
878
+ # # Create a client object. The client can be reused for multiple calls.
879
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
880
+ #
881
+ # # Create a request. To set request fields, pass in keyword arguments.
882
+ # request = Google::Cloud::Compute::V1::SetIamPolicyStoragePoolRequest.new
883
+ #
884
+ # # Call the set_iam_policy method.
885
+ # result = client.set_iam_policy request
886
+ #
887
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
888
+ # p result
889
+ #
890
+ def set_iam_policy request, options = nil
891
+ raise ::ArgumentError, "request must be provided" if request.nil?
892
+
893
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyStoragePoolRequest
894
+
895
+ # Converts hash and nil to an options object
896
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
897
+
898
+ # Customize the options with defaults
899
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
900
+
901
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
902
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
903
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
904
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
905
+ transports_version_send: [:rest]
906
+
907
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
908
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
909
+
910
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
911
+ metadata: call_metadata,
912
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
913
+
914
+ options.apply_defaults timeout: @config.timeout,
915
+ metadata: @config.metadata,
916
+ retry_policy: @config.retry_policy
917
+
918
+ @storage_pools_stub.set_iam_policy request, options do |result, operation|
919
+ yield result, operation if block_given?
920
+ return result
921
+ end
922
+ rescue ::Gapic::Rest::Error => e
923
+ raise ::Google::Cloud::Error.from_error(e)
924
+ end
925
+
926
+ ##
927
+ # Returns permissions that a caller has on the specified resource.
928
+ #
929
+ # @overload test_iam_permissions(request, options = nil)
930
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
931
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsStoragePoolRequest} or an equivalent Hash.
932
+ #
933
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsStoragePoolRequest, ::Hash]
934
+ # A request object representing the call parameters. Required. To specify no
935
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
936
+ # @param options [::Gapic::CallOptions, ::Hash]
937
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
938
+ #
939
+ # @overload test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil, zone: nil)
940
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
941
+ # least one keyword argument is required. To specify no parameters, or to keep all
942
+ # the default parameter values, pass an empty Hash as a request object (see above).
943
+ #
944
+ # @param project [::String]
945
+ # Project ID for this request.
946
+ # @param resource [::String]
947
+ # Name or id of the resource for this request.
948
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
949
+ # The body resource for this request
950
+ # @param zone [::String]
951
+ # The name of the zone for this request.
952
+ # @yield [result, operation] Access the result along with the TransportOperation object
953
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
954
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
955
+ #
956
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
957
+ #
958
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
959
+ #
960
+ # @example Basic example
961
+ # require "google/cloud/compute/v1"
962
+ #
963
+ # # Create a client object. The client can be reused for multiple calls.
964
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
965
+ #
966
+ # # Create a request. To set request fields, pass in keyword arguments.
967
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsStoragePoolRequest.new
968
+ #
969
+ # # Call the test_iam_permissions method.
970
+ # result = client.test_iam_permissions request
971
+ #
972
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
973
+ # p result
974
+ #
975
+ def test_iam_permissions request, options = nil
976
+ raise ::ArgumentError, "request must be provided" if request.nil?
977
+
978
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsStoragePoolRequest
979
+
980
+ # Converts hash and nil to an options object
981
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
982
+
983
+ # Customize the options with defaults
984
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
985
+
986
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
987
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
988
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
989
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
990
+ transports_version_send: [:rest]
991
+
992
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
993
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
994
+
995
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
996
+ metadata: call_metadata,
997
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
998
+
999
+ options.apply_defaults timeout: @config.timeout,
1000
+ metadata: @config.metadata,
1001
+ retry_policy: @config.retry_policy
1002
+
1003
+ @storage_pools_stub.test_iam_permissions request, options do |result, operation|
1004
+ yield result, operation if block_given?
1005
+ return result
1006
+ end
1007
+ rescue ::Gapic::Rest::Error => e
1008
+ raise ::Google::Cloud::Error.from_error(e)
1009
+ end
1010
+
1011
+ ##
1012
+ # Updates the specified storagePool with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: size_tb and provisioned_iops.
1013
+ #
1014
+ # @overload update(request, options = nil)
1015
+ # Pass arguments to `update` via a request object, either of type
1016
+ # {::Google::Cloud::Compute::V1::UpdateStoragePoolRequest} or an equivalent Hash.
1017
+ #
1018
+ # @param request [::Google::Cloud::Compute::V1::UpdateStoragePoolRequest, ::Hash]
1019
+ # A request object representing the call parameters. Required. To specify no
1020
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1021
+ # @param options [::Gapic::CallOptions, ::Hash]
1022
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1023
+ #
1024
+ # @overload update(project: nil, request_id: nil, storage_pool: nil, storage_pool_resource: nil, update_mask: nil, zone: nil)
1025
+ # Pass arguments to `update` via keyword arguments. Note that at
1026
+ # least one keyword argument is required. To specify no parameters, or to keep all
1027
+ # the default parameter values, pass an empty Hash as a request object (see above).
1028
+ #
1029
+ # @param project [::String]
1030
+ # Project ID for this request.
1031
+ # @param request_id [::String]
1032
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1033
+ # @param storage_pool [::String]
1034
+ # The storagePool name for this request.
1035
+ # @param storage_pool_resource [::Google::Cloud::Compute::V1::StoragePool, ::Hash]
1036
+ # The body resource for this request
1037
+ # @param update_mask [::String]
1038
+ # update_mask indicates fields to be updated as part of this request.
1039
+ # @param zone [::String]
1040
+ # The name of the zone for this request.
1041
+ # @yield [result, operation] Access the result along with the TransportOperation object
1042
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1043
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1044
+ #
1045
+ # @return [::Gapic::GenericLRO::Operation]
1046
+ #
1047
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1048
+ #
1049
+ # @example Basic example
1050
+ # require "google/cloud/compute/v1"
1051
+ #
1052
+ # # Create a client object. The client can be reused for multiple calls.
1053
+ # client = Google::Cloud::Compute::V1::StoragePools::Rest::Client.new
1054
+ #
1055
+ # # Create a request. To set request fields, pass in keyword arguments.
1056
+ # request = Google::Cloud::Compute::V1::UpdateStoragePoolRequest.new
1057
+ #
1058
+ # # Call the update method.
1059
+ # result = client.update request
1060
+ #
1061
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1062
+ # p result
1063
+ #
1064
+ def update request, options = nil
1065
+ raise ::ArgumentError, "request must be provided" if request.nil?
1066
+
1067
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateStoragePoolRequest
1068
+
1069
+ # Converts hash and nil to an options object
1070
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1071
+
1072
+ # Customize the options with defaults
1073
+ call_metadata = @config.rpcs.update.metadata.to_h
1074
+
1075
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1076
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1077
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1078
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1079
+ transports_version_send: [:rest]
1080
+
1081
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1082
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1083
+
1084
+ options.apply_defaults timeout: @config.rpcs.update.timeout,
1085
+ metadata: call_metadata,
1086
+ retry_policy: @config.rpcs.update.retry_policy
1087
+
1088
+ options.apply_defaults timeout: @config.timeout,
1089
+ metadata: @config.metadata,
1090
+ retry_policy: @config.retry_policy
1091
+
1092
+ @storage_pools_stub.update request, options do |result, response|
1093
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
1094
+ operation: result,
1095
+ client: zone_operations,
1096
+ request_values: {
1097
+ "project" => request.project,
1098
+ "zone" => request.zone
1099
+ },
1100
+ options: options
1101
+ )
1102
+ yield result, response if block_given?
1103
+ return result
1104
+ end
1105
+ rescue ::Gapic::Rest::Error => e
1106
+ raise ::Google::Cloud::Error.from_error(e)
1107
+ end
1108
+
1109
+ ##
1110
+ # Configuration class for the StoragePools REST API.
1111
+ #
1112
+ # This class represents the configuration for StoragePools REST,
1113
+ # providing control over timeouts, retry behavior, logging, transport
1114
+ # parameters, and other low-level controls. Certain parameters can also be
1115
+ # applied individually to specific RPCs. See
1116
+ # {::Google::Cloud::Compute::V1::StoragePools::Rest::Client::Configuration::Rpcs}
1117
+ # for a list of RPCs that can be configured independently.
1118
+ #
1119
+ # Configuration can be applied globally to all clients, or to a single client
1120
+ # on construction.
1121
+ #
1122
+ # @example
1123
+ #
1124
+ # # Modify the global config, setting the timeout for
1125
+ # # aggregated_list to 20 seconds,
1126
+ # # and all remaining timeouts to 10 seconds.
1127
+ # ::Google::Cloud::Compute::V1::StoragePools::Rest::Client.configure do |config|
1128
+ # config.timeout = 10.0
1129
+ # config.rpcs.aggregated_list.timeout = 20.0
1130
+ # end
1131
+ #
1132
+ # # Apply the above configuration only to a new client.
1133
+ # client = ::Google::Cloud::Compute::V1::StoragePools::Rest::Client.new do |config|
1134
+ # config.timeout = 10.0
1135
+ # config.rpcs.aggregated_list.timeout = 20.0
1136
+ # end
1137
+ #
1138
+ # @!attribute [rw] endpoint
1139
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1140
+ # nil, indicating to use the default endpoint in the current universe domain.
1141
+ # @return [::String,nil]
1142
+ # @!attribute [rw] credentials
1143
+ # Credentials to send with calls. You may provide any of the following types:
1144
+ # * (`String`) The path to a service account key file in JSON format
1145
+ # * (`Hash`) A service account key as a Hash
1146
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1147
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1148
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1149
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1150
+ # * (`nil`) indicating no credentials
1151
+ # @return [::Object]
1152
+ # @!attribute [rw] scope
1153
+ # The OAuth scopes
1154
+ # @return [::Array<::String>]
1155
+ # @!attribute [rw] lib_name
1156
+ # The library name as recorded in instrumentation and logging
1157
+ # @return [::String]
1158
+ # @!attribute [rw] lib_version
1159
+ # The library version as recorded in instrumentation and logging
1160
+ # @return [::String]
1161
+ # @!attribute [rw] timeout
1162
+ # The call timeout in seconds.
1163
+ # @return [::Numeric]
1164
+ # @!attribute [rw] metadata
1165
+ # Additional headers to be sent with the call.
1166
+ # @return [::Hash{::Symbol=>::String}]
1167
+ # @!attribute [rw] retry_policy
1168
+ # The retry policy. The value is a hash with the following keys:
1169
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1170
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1171
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1172
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1173
+ # trigger a retry.
1174
+ # @return [::Hash]
1175
+ # @!attribute [rw] quota_project
1176
+ # A separate project against which to charge quota.
1177
+ # @return [::String]
1178
+ # @!attribute [rw] universe_domain
1179
+ # The universe domain within which to make requests. This determines the
1180
+ # default endpoint URL. The default value of nil uses the environment
1181
+ # universe (usually the default "googleapis.com" universe).
1182
+ # @return [::String,nil]
1183
+ #
1184
+ class Configuration
1185
+ extend ::Gapic::Config
1186
+
1187
+ # @private
1188
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1189
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
1190
+
1191
+ config_attr :endpoint, nil, ::String, nil
1192
+ config_attr :credentials, nil do |value|
1193
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1194
+ allowed.any? { |klass| klass === value }
1195
+ end
1196
+ config_attr :scope, nil, ::String, ::Array, nil
1197
+ config_attr :lib_name, nil, ::String, nil
1198
+ config_attr :lib_version, nil, ::String, nil
1199
+ config_attr :timeout, nil, ::Numeric, nil
1200
+ config_attr :metadata, nil, ::Hash, nil
1201
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1202
+ config_attr :quota_project, nil, ::String, nil
1203
+ config_attr :universe_domain, nil, ::String, nil
1204
+
1205
+ # @private
1206
+ def initialize parent_config = nil
1207
+ @parent_config = parent_config unless parent_config.nil?
1208
+
1209
+ yield self if block_given?
1210
+ end
1211
+
1212
+ ##
1213
+ # Configurations for individual RPCs
1214
+ # @return [Rpcs]
1215
+ #
1216
+ def rpcs
1217
+ @rpcs ||= begin
1218
+ parent_rpcs = nil
1219
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1220
+ Rpcs.new parent_rpcs
1221
+ end
1222
+ end
1223
+
1224
+ ##
1225
+ # Configuration RPC class for the StoragePools API.
1226
+ #
1227
+ # Includes fields providing the configuration for each RPC in this service.
1228
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1229
+ # the following configuration fields:
1230
+ #
1231
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1232
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1233
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1234
+ # include the following keys:
1235
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1236
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1237
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1238
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1239
+ # trigger a retry.
1240
+ #
1241
+ class Rpcs
1242
+ ##
1243
+ # RPC-specific configuration for `aggregated_list`
1244
+ # @return [::Gapic::Config::Method]
1245
+ #
1246
+ attr_reader :aggregated_list
1247
+ ##
1248
+ # RPC-specific configuration for `delete`
1249
+ # @return [::Gapic::Config::Method]
1250
+ #
1251
+ attr_reader :delete
1252
+ ##
1253
+ # RPC-specific configuration for `get`
1254
+ # @return [::Gapic::Config::Method]
1255
+ #
1256
+ attr_reader :get
1257
+ ##
1258
+ # RPC-specific configuration for `get_iam_policy`
1259
+ # @return [::Gapic::Config::Method]
1260
+ #
1261
+ attr_reader :get_iam_policy
1262
+ ##
1263
+ # RPC-specific configuration for `insert`
1264
+ # @return [::Gapic::Config::Method]
1265
+ #
1266
+ attr_reader :insert
1267
+ ##
1268
+ # RPC-specific configuration for `list`
1269
+ # @return [::Gapic::Config::Method]
1270
+ #
1271
+ attr_reader :list
1272
+ ##
1273
+ # RPC-specific configuration for `list_disks`
1274
+ # @return [::Gapic::Config::Method]
1275
+ #
1276
+ attr_reader :list_disks
1277
+ ##
1278
+ # RPC-specific configuration for `set_iam_policy`
1279
+ # @return [::Gapic::Config::Method]
1280
+ #
1281
+ attr_reader :set_iam_policy
1282
+ ##
1283
+ # RPC-specific configuration for `test_iam_permissions`
1284
+ # @return [::Gapic::Config::Method]
1285
+ #
1286
+ attr_reader :test_iam_permissions
1287
+ ##
1288
+ # RPC-specific configuration for `update`
1289
+ # @return [::Gapic::Config::Method]
1290
+ #
1291
+ attr_reader :update
1292
+
1293
+ # @private
1294
+ def initialize parent_rpcs = nil
1295
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
1296
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
1297
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1298
+ @delete = ::Gapic::Config::Method.new delete_config
1299
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1300
+ @get = ::Gapic::Config::Method.new get_config
1301
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1302
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1303
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1304
+ @insert = ::Gapic::Config::Method.new insert_config
1305
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1306
+ @list = ::Gapic::Config::Method.new list_config
1307
+ list_disks_config = parent_rpcs.list_disks if parent_rpcs.respond_to? :list_disks
1308
+ @list_disks = ::Gapic::Config::Method.new list_disks_config
1309
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1310
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1311
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1312
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1313
+ update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
1314
+ @update = ::Gapic::Config::Method.new update_config
1315
+
1316
+ yield self if block_given?
1317
+ end
1318
+ end
1319
+ end
1320
+ end
1321
+ end
1322
+ end
1323
+ end
1324
+ end
1325
+ end
1326
+ end