google-cloud-compute-v1 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +181 -14
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +330 -20
  4. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +64 -0
  5. data/lib/google/cloud/compute/v1/advice/credentials.rb +52 -0
  6. data/lib/google/cloud/compute/v1/advice/rest/client.rb +431 -0
  7. data/lib/google/cloud/compute/v1/advice/rest/service_stub.rb +144 -0
  8. data/lib/google/cloud/compute/v1/advice/rest.rb +51 -0
  9. data/lib/google/cloud/compute/v1/advice.rb +47 -0
  10. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +334 -21
  11. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +64 -0
  12. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +198 -23
  13. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +499 -40
  14. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +62 -0
  15. data/lib/google/cloud/compute/v1/compute_pb.rb +281 -25
  16. data/lib/google/cloud/compute/v1/cross_site_networks/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/cross_site_networks/rest/client.rb +975 -0
  18. data/lib/google/cloud/compute/v1/cross_site_networks/rest/service_stub.rb +391 -0
  19. data/lib/google/cloud/compute/v1/cross_site_networks/rest.rb +51 -0
  20. data/lib/google/cloud/compute/v1/cross_site_networks.rb +47 -0
  21. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +181 -14
  22. data/lib/google/cloud/compute/v1/disks/rest/client.rb +390 -42
  23. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +118 -11
  24. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +240 -25
  25. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +238 -13
  26. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +63 -0
  27. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +258 -23
  28. data/lib/google/cloud/compute/v1/future_reservations/credentials.rb +52 -0
  29. data/lib/google/cloud/compute/v1/future_reservations/rest/client.rb +1287 -0
  30. data/lib/google/cloud/compute/v1/future_reservations/rest/service_stub.rb +520 -0
  31. data/lib/google/cloud/compute/v1/future_reservations/rest.rb +51 -0
  32. data/lib/google/cloud/compute/v1/future_reservations.rb +47 -0
  33. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +217 -10
  34. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +63 -0
  35. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +151 -15
  36. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +246 -21
  37. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +203 -18
  38. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +91 -9
  39. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +128 -10
  40. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +333 -21
  41. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +63 -0
  42. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +2 -1
  43. data/lib/google/cloud/compute/v1/images/rest/client.rb +161 -18
  44. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +159 -24
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +920 -95
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +473 -40
  47. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +64 -0
  48. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +13 -1
  49. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +220 -20
  50. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1144 -99
  51. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +127 -0
  52. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +235 -21
  53. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/rest/client.rb +139 -14
  54. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +242 -21
  55. data/lib/google/cloud/compute/v1/interconnect_groups/rest/client.rb +139 -14
  56. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +87 -7
  57. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +87 -7
  58. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +145 -14
  59. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +9 -2
  60. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +161 -16
  61. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +124 -13
  62. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +181 -14
  63. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +232 -20
  64. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +138 -12
  65. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +361 -37
  66. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +354 -33
  67. data/lib/google/cloud/compute/v1/network_profiles/rest/client.rb +85 -6
  68. data/lib/google/cloud/compute/v1/networks/rest/client.rb +281 -23
  69. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +381 -32
  70. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +213 -19
  71. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +181 -14
  72. data/lib/google/cloud/compute/v1/organization_security_policies/credentials.rb +52 -0
  73. data/lib/google/cloud/compute/v1/organization_security_policies/rest/client.rb +2259 -0
  74. data/lib/google/cloud/compute/v1/organization_security_policies/rest/service_stub.rb +1054 -0
  75. data/lib/google/cloud/compute/v1/organization_security_policies/rest.rb +51 -0
  76. data/lib/google/cloud/compute/v1/organization_security_policies.rb +47 -0
  77. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +226 -19
  78. data/lib/google/cloud/compute/v1/preview_features/credentials.rb +52 -0
  79. data/lib/google/cloud/compute/v1/preview_features/rest/client.rb +739 -0
  80. data/lib/google/cloud/compute/v1/preview_features/rest/service_stub.rb +267 -0
  81. data/lib/google/cloud/compute/v1/preview_features/rest.rb +51 -0
  82. data/lib/google/cloud/compute/v1/preview_features.rb +47 -0
  83. data/lib/google/cloud/compute/v1/projects/rest/client.rb +346 -30
  84. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +154 -12
  85. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +255 -22
  86. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +238 -13
  87. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +64 -0
  88. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +260 -26
  89. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +212 -18
  90. data/lib/google/cloud/compute/v1/region_composite_health_checks/credentials.rb +52 -0
  91. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/client.rb +1268 -0
  92. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/service_stub.rb +521 -0
  93. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest.rb +51 -0
  94. data/lib/google/cloud/compute/v1/region_composite_health_checks.rb +47 -0
  95. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +83 -5
  96. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +269 -29
  97. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/credentials.rb +52 -0
  98. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/client.rb +1268 -0
  99. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/service_stub.rb +521 -0
  100. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest.rb +51 -0
  101. data/lib/google/cloud/compute/v1/region_health_aggregation_policies.rb +47 -0
  102. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +427 -17
  103. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +125 -0
  104. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +238 -13
  105. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +64 -0
  106. data/lib/google/cloud/compute/v1/region_health_sources/credentials.rb +52 -0
  107. data/lib/google/cloud/compute/v1/region_health_sources/rest/client.rb +1268 -0
  108. data/lib/google/cloud/compute/v1/region_health_sources/rest/service_stub.rb +521 -0
  109. data/lib/google/cloud/compute/v1/region_health_sources/rest.rb +51 -0
  110. data/lib/google/cloud/compute/v1/region_health_sources.rb +47 -0
  111. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +750 -64
  112. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +280 -14
  113. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +64 -0
  114. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +115 -10
  115. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +15 -2
  116. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +139 -13
  117. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +264 -28
  118. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +213 -20
  119. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +399 -11
  120. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +125 -0
  121. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +107 -10
  122. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +149 -14
  123. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +116 -10
  124. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +220 -20
  125. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +126 -10
  126. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +158 -14
  127. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +113 -9
  128. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +104 -14
  129. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +85 -6
  130. data/lib/google/cloud/compute/v1/regions/rest/client.rb +120 -7
  131. data/lib/google/cloud/compute/v1/reservation_blocks/rest/client.rb +396 -11
  132. data/lib/google/cloud/compute/v1/reservation_blocks/rest/service_stub.rb +194 -0
  133. data/lib/google/cloud/compute/v1/reservation_slots/credentials.rb +52 -0
  134. data/lib/google/cloud/compute/v1/reservation_slots/rest/client.rb +863 -0
  135. data/lib/google/cloud/compute/v1/reservation_slots/rest/service_stub.rb +338 -0
  136. data/lib/google/cloud/compute/v1/reservation_slots/rest.rb +51 -0
  137. data/lib/google/cloud/compute/v1/reservation_slots.rb +47 -0
  138. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/client.rb +642 -12
  139. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/service_stub.rb +327 -3
  140. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +257 -24
  141. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +224 -19
  142. data/lib/google/cloud/compute/v1/rest.rb +10 -0
  143. data/lib/google/cloud/compute/v1/routers/rest/client.rb +555 -50
  144. data/lib/google/cloud/compute/v1/routes/rest/client.rb +202 -8
  145. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +63 -0
  146. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +316 -26
  147. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +234 -22
  148. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +13 -1
  149. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +130 -13
  150. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +210 -17
  151. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +315 -27
  152. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +181 -14
  153. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +321 -28
  154. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +378 -34
  155. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +128 -10
  156. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +240 -20
  157. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +306 -30
  158. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +320 -20
  159. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +64 -0
  160. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +387 -26
  161. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +64 -0
  162. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +281 -19
  163. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +63 -0
  164. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +329 -20
  165. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +63 -0
  166. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +224 -19
  167. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +354 -24
  168. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +63 -0
  169. data/lib/google/cloud/compute/v1/version.rb +1 -1
  170. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +224 -19
  171. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +224 -19
  172. data/lib/google/cloud/compute/v1/wire_groups/credentials.rb +52 -0
  173. data/lib/google/cloud/compute/v1/wire_groups/rest/client.rb +980 -0
  174. data/lib/google/cloud/compute/v1/wire_groups/rest/service_stub.rb +396 -0
  175. data/lib/google/cloud/compute/v1/wire_groups/rest.rb +51 -0
  176. data/lib/google/cloud/compute/v1/wire_groups.rb +47 -0
  177. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +106 -10
  178. data/lib/google/cloud/compute/v1/zones/rest/client.rb +83 -5
  179. data/lib/google/cloud/compute/v1.rb +10 -0
  180. data/proto_docs/google/api/client.rb +149 -29
  181. data/proto_docs/google/cloud/compute/v1/compute.rb +44226 -5514
  182. metadata +52 -2
@@ -76,6 +76,11 @@ module Google
76
76
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
77
77
  }
78
78
 
79
+ default_config.rpcs.get_iam_policy.timeout = 600.0
80
+ default_config.rpcs.get_iam_policy.retry_policy = {
81
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
82
+ }
83
+
79
84
  default_config.rpcs.list.timeout = 600.0
80
85
  default_config.rpcs.list.retry_policy = {
81
86
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
@@ -83,6 +88,10 @@ module Google
83
88
 
84
89
  default_config.rpcs.perform_maintenance.timeout = 600.0
85
90
 
91
+ default_config.rpcs.set_iam_policy.timeout = 600.0
92
+
93
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
94
+
86
95
  default_config
87
96
  end
88
97
  yield @configure if block_given?
@@ -222,9 +231,11 @@ module Google
222
231
  # @param project [::String]
223
232
  # Project ID for this request.
224
233
  # @param reservation [::String]
225
- # The name of the reservation. Name should conform to RFC1035 or be a resource ID.
234
+ # The name of the reservation.
235
+ # Name should conform to RFC1035 or be a resource ID.
226
236
  # @param reservation_block [::String]
227
- # The name of the reservation block. Name should conform to RFC1035 or be a resource ID.
237
+ # The name of the reservation block.
238
+ # Name should conform to RFC1035 or be a resource ID.
228
239
  # @param view [::String]
229
240
  # View of the Block.
230
241
  # Check the View enum for the list of possible values.
@@ -288,6 +299,93 @@ module Google
288
299
  raise ::Google::Cloud::Error.from_error(e)
289
300
  end
290
301
 
302
+ ##
303
+ # Gets the access control policy for a resource. May be empty if no such
304
+ # policy or resource exists.
305
+ #
306
+ # @overload get_iam_policy(request, options = nil)
307
+ # Pass arguments to `get_iam_policy` via a request object, either of type
308
+ # {::Google::Cloud::Compute::V1::GetIamPolicyReservationBlockRequest} or an equivalent Hash.
309
+ #
310
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyReservationBlockRequest, ::Hash]
311
+ # A request object representing the call parameters. Required. To specify no
312
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
313
+ # @param options [::Gapic::CallOptions, ::Hash]
314
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
315
+ #
316
+ # @overload get_iam_policy(options_requested_policy_version: nil, parent_resource: nil, project: nil, resource: nil, zone: nil)
317
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
318
+ # least one keyword argument is required. To specify no parameters, or to keep all
319
+ # the default parameter values, pass an empty Hash as a request object (see above).
320
+ #
321
+ # @param options_requested_policy_version [::Integer]
322
+ # Requested IAM Policy version.
323
+ # @param parent_resource [::String]
324
+ # Name or id of parent resource of the resource for this request.
325
+ # @param project [::String]
326
+ # Project ID for this request.
327
+ # @param resource [::String]
328
+ # Name or id of the resource for this request.
329
+ # @param zone [::String]
330
+ # The name of the zone for this request.
331
+ # @yield [result, operation] Access the result along with the TransportOperation object
332
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
333
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
334
+ #
335
+ # @return [::Google::Cloud::Compute::V1::Policy]
336
+ #
337
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
338
+ #
339
+ # @example Basic example
340
+ # require "google/cloud/compute/v1"
341
+ #
342
+ # # Create a client object. The client can be reused for multiple calls.
343
+ # client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new
344
+ #
345
+ # # Create a request. To set request fields, pass in keyword arguments.
346
+ # request = Google::Cloud::Compute::V1::GetIamPolicyReservationBlockRequest.new
347
+ #
348
+ # # Call the get_iam_policy method.
349
+ # result = client.get_iam_policy request
350
+ #
351
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
352
+ # p result
353
+ #
354
+ def get_iam_policy request, options = nil
355
+ raise ::ArgumentError, "request must be provided" if request.nil?
356
+
357
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyReservationBlockRequest
358
+
359
+ # Converts hash and nil to an options object
360
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
361
+
362
+ # Customize the options with defaults
363
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
364
+
365
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
366
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
367
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
368
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
369
+ transports_version_send: [:rest]
370
+
371
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
372
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
373
+
374
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
375
+ metadata: call_metadata,
376
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
377
+
378
+ options.apply_defaults timeout: @config.timeout,
379
+ metadata: @config.metadata,
380
+ retry_policy: @config.retry_policy
381
+
382
+ @reservation_blocks_stub.get_iam_policy request, options do |result, operation|
383
+ yield result, operation if block_given?
384
+ end
385
+ rescue ::Gapic::Rest::Error => e
386
+ raise ::Google::Cloud::Error.from_error(e)
387
+ end
388
+
291
389
  ##
292
390
  # Retrieves a list of reservation blocks under a single reservation.
293
391
  #
@@ -307,19 +405,98 @@ module Google
307
405
  # the default parameter values, pass an empty Hash as a request object (see above).
308
406
  #
309
407
  # @param filter [::String]
310
- # 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.
408
+ # A filter expression that filters resources listed in the response. Most
409
+ # Compute resources support two types of filter expressions:
410
+ # expressions that support regular expressions and expressions that follow
411
+ # API improvement proposal AIP-160.
412
+ # These two types of filter expressions cannot be mixed in one request.
413
+ #
414
+ # If you want to use AIP-160, your expression must specify the field name, an
415
+ # operator, and the value that you want to use for filtering. The value
416
+ # must be a string, a number, or a boolean. The operator
417
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
418
+ #
419
+ # For example, if you are filtering Compute Engine instances, you can
420
+ # exclude instances named `example-instance` by specifying
421
+ # `name != example-instance`.
422
+ #
423
+ # The `:*` comparison can be used to test whether a key has been defined.
424
+ # For example, to find all objects with `owner` label use:
425
+ # ```
426
+ # labels.owner:*
427
+ # ```
428
+ #
429
+ # You can also filter nested fields. For example, you could specify
430
+ # `scheduling.automaticRestart = false` to include instances only
431
+ # if they are not scheduled for automatic restarts. You can use filtering
432
+ # on nested fields to filter based onresource labels.
433
+ #
434
+ # To filter on multiple expressions, provide each separate expression within
435
+ # parentheses. For example:
436
+ # ```
437
+ # (scheduling.automaticRestart = true)
438
+ # (cpuPlatform = "Intel Skylake")
439
+ # ```
440
+ # By default, each expression is an `AND` expression. However, you
441
+ # can include `AND` and `OR` expressions explicitly.
442
+ # For example:
443
+ # ```
444
+ # (cpuPlatform = "Intel Skylake") OR
445
+ # (cpuPlatform = "Intel Broadwell") AND
446
+ # (scheduling.automaticRestart = true)
447
+ # ```
448
+ #
449
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
450
+ # (not equal) operator against a single un-parenthesized expression with or
451
+ # without quotes or against multiple parenthesized expressions. Examples:
452
+ #
453
+ # `fieldname eq unquoted literal`
454
+ # `fieldname eq 'single quoted literal'`
455
+ # `fieldname eq "double quoted literal"`
456
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
457
+ #
458
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
459
+ # The literal value must match the entire field.
460
+ #
461
+ # For example, to filter for instances that do not end with name "instance",
462
+ # you would use `name ne .*instance`.
463
+ #
464
+ # You cannot combine constraints on multiple fields using regular
465
+ # expressions.
311
466
  # @param max_results [::Integer]
312
- # 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`)
467
+ # The maximum number of results per page that should be returned.
468
+ # If the number of available results is larger than `maxResults`,
469
+ # Compute Engine returns a `nextPageToken` that can be used to get
470
+ # the next page of results in subsequent list requests. Acceptable values are
471
+ # `0` to `500`, inclusive. (Default: `500`)
313
472
  # @param order_by [::String]
314
- # 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.
473
+ # Sorts list results by a certain order. By default, results
474
+ # are returned in alphanumerical order based on the resource name.
475
+ #
476
+ # You can also sort results in descending order based on the creation
477
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
478
+ # results based on the `creationTimestamp` field in
479
+ # reverse chronological order (newest result first). Use this to sort
480
+ # resources like operations so that the newest operation is returned first.
481
+ #
482
+ # Currently, only sorting by `name` or
483
+ # `creationTimestamp desc` is supported.
315
484
  # @param page_token [::String]
316
- # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
485
+ # Specifies a page token to use. Set `pageToken` to the
486
+ # `nextPageToken` returned by a previous list request to get
487
+ # the next page of results.
317
488
  # @param project [::String]
318
489
  # Project ID for this request.
319
490
  # @param reservation [::String]
320
- # The name of the reservation. Name should conform to RFC1035 or be a resource ID.
491
+ # The name of the reservation.
492
+ # Name should conform to RFC1035 or be a resource ID.
321
493
  # @param return_partial_success [::Boolean]
322
- # 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.
494
+ # Opt-in for partial success behavior which provides partial results in case
495
+ # of failure. The default value is false.
496
+ #
497
+ # For example, when partial success behavior is enabled, aggregatedList for a
498
+ # single zone scope either returns all resources in the zone or no resources,
499
+ # with an error code.
323
500
  # @param zone [::String]
324
501
  # Name of the zone for this request. Zone name should conform to RFC1035.
325
502
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -403,11 +580,25 @@ module Google
403
580
  # @param project [::String]
404
581
  # Project ID for this request.
405
582
  # @param request_id [::String]
406
- # 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).
583
+ # An optional request ID to identify requests. Specify a unique request ID so
584
+ # that if you must retry your request, the server will know to ignore the
585
+ # request if it has already been completed.
586
+ #
587
+ # For example, consider a situation where you make an initial request and
588
+ # the request times out. If you make the request again with the same
589
+ # request ID, the server can check if original operation with the same
590
+ # request ID was received, and if so, will ignore the second request. This
591
+ # prevents clients from accidentally creating duplicate commitments.
592
+ #
593
+ # The request ID must be
594
+ # a valid UUID with the exception that zero UUID is not supported
595
+ # (00000000-0000-0000-0000-000000000000).
407
596
  # @param reservation [::String]
408
- # The name of the reservation. Name should conform to RFC1035 or be a resource ID.
597
+ # The name of the reservation.
598
+ # Name should conform to RFC1035 or be a resource ID.
409
599
  # @param reservation_block [::String]
410
- # The name of the reservation block. Name should conform to RFC1035 or be a resource ID.
600
+ # The name of the reservation block.
601
+ # Name should conform to RFC1035 or be a resource ID.
411
602
  # @param reservations_blocks_perform_maintenance_request_resource [::Google::Cloud::Compute::V1::ReservationsBlocksPerformMaintenanceRequest, ::Hash]
412
603
  # The body resource for this request
413
604
  # @param zone [::String]
@@ -480,6 +671,179 @@ module Google
480
671
  raise ::Google::Cloud::Error.from_error(e)
481
672
  end
482
673
 
674
+ ##
675
+ # Sets the access control policy on the specified resource.
676
+ # Replaces any existing policy.
677
+ #
678
+ # @overload set_iam_policy(request, options = nil)
679
+ # Pass arguments to `set_iam_policy` via a request object, either of type
680
+ # {::Google::Cloud::Compute::V1::SetIamPolicyReservationBlockRequest} or an equivalent Hash.
681
+ #
682
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyReservationBlockRequest, ::Hash]
683
+ # A request object representing the call parameters. Required. To specify no
684
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
685
+ # @param options [::Gapic::CallOptions, ::Hash]
686
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
687
+ #
688
+ # @overload set_iam_policy(parent_resource: nil, project: nil, resource: nil, zone: nil, zone_set_nested_policy_request_resource: nil)
689
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
690
+ # least one keyword argument is required. To specify no parameters, or to keep all
691
+ # the default parameter values, pass an empty Hash as a request object (see above).
692
+ #
693
+ # @param parent_resource [::String]
694
+ # Name or id of parent resource of the resource for this request.
695
+ # @param project [::String]
696
+ # Project ID for this request.
697
+ # @param resource [::String]
698
+ # Name or id of the resource for this request.
699
+ # @param zone [::String]
700
+ # The name of the zone for this request.
701
+ # @param zone_set_nested_policy_request_resource [::Google::Cloud::Compute::V1::ZoneSetNestedPolicyRequest, ::Hash]
702
+ # The body resource for this request
703
+ # @yield [result, operation] Access the result along with the TransportOperation object
704
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
705
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
706
+ #
707
+ # @return [::Google::Cloud::Compute::V1::Policy]
708
+ #
709
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
710
+ #
711
+ # @example Basic example
712
+ # require "google/cloud/compute/v1"
713
+ #
714
+ # # Create a client object. The client can be reused for multiple calls.
715
+ # client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new
716
+ #
717
+ # # Create a request. To set request fields, pass in keyword arguments.
718
+ # request = Google::Cloud::Compute::V1::SetIamPolicyReservationBlockRequest.new
719
+ #
720
+ # # Call the set_iam_policy method.
721
+ # result = client.set_iam_policy request
722
+ #
723
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
724
+ # p result
725
+ #
726
+ def set_iam_policy request, options = nil
727
+ raise ::ArgumentError, "request must be provided" if request.nil?
728
+
729
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyReservationBlockRequest
730
+
731
+ # Converts hash and nil to an options object
732
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
733
+
734
+ # Customize the options with defaults
735
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
736
+
737
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
738
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
739
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
740
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
741
+ transports_version_send: [:rest]
742
+
743
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
744
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
745
+
746
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
747
+ metadata: call_metadata,
748
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
749
+
750
+ options.apply_defaults timeout: @config.timeout,
751
+ metadata: @config.metadata,
752
+ retry_policy: @config.retry_policy
753
+
754
+ @reservation_blocks_stub.set_iam_policy request, options do |result, operation|
755
+ yield result, operation if block_given?
756
+ end
757
+ rescue ::Gapic::Rest::Error => e
758
+ raise ::Google::Cloud::Error.from_error(e)
759
+ end
760
+
761
+ ##
762
+ # Returns permissions that a caller has on the specified resource.
763
+ #
764
+ # @overload test_iam_permissions(request, options = nil)
765
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
766
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsReservationBlockRequest} or an equivalent Hash.
767
+ #
768
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsReservationBlockRequest, ::Hash]
769
+ # A request object representing the call parameters. Required. To specify no
770
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
771
+ # @param options [::Gapic::CallOptions, ::Hash]
772
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
773
+ #
774
+ # @overload test_iam_permissions(parent_resource: nil, project: nil, resource: nil, test_permissions_request_resource: nil, zone: nil)
775
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
776
+ # least one keyword argument is required. To specify no parameters, or to keep all
777
+ # the default parameter values, pass an empty Hash as a request object (see above).
778
+ #
779
+ # @param parent_resource [::String]
780
+ # Name or id of parent resource of the resource for this request.
781
+ # @param project [::String]
782
+ # Project ID for this request.
783
+ # @param resource [::String]
784
+ # Name or id of the resource for this request.
785
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
786
+ # The body resource for this request
787
+ # @param zone [::String]
788
+ # The name of the zone for this request.
789
+ # @yield [result, operation] Access the result along with the TransportOperation object
790
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
791
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
792
+ #
793
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
794
+ #
795
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
796
+ #
797
+ # @example Basic example
798
+ # require "google/cloud/compute/v1"
799
+ #
800
+ # # Create a client object. The client can be reused for multiple calls.
801
+ # client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new
802
+ #
803
+ # # Create a request. To set request fields, pass in keyword arguments.
804
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsReservationBlockRequest.new
805
+ #
806
+ # # Call the test_iam_permissions method.
807
+ # result = client.test_iam_permissions request
808
+ #
809
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
810
+ # p result
811
+ #
812
+ def test_iam_permissions request, options = nil
813
+ raise ::ArgumentError, "request must be provided" if request.nil?
814
+
815
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsReservationBlockRequest
816
+
817
+ # Converts hash and nil to an options object
818
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
819
+
820
+ # Customize the options with defaults
821
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
822
+
823
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
824
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
825
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
826
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
827
+ transports_version_send: [:rest]
828
+
829
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
830
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
831
+
832
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
833
+ metadata: call_metadata,
834
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
835
+
836
+ options.apply_defaults timeout: @config.timeout,
837
+ metadata: @config.metadata,
838
+ retry_policy: @config.retry_policy
839
+
840
+ @reservation_blocks_stub.test_iam_permissions request, options do |result, operation|
841
+ yield result, operation if block_given?
842
+ end
843
+ rescue ::Gapic::Rest::Error => e
844
+ raise ::Google::Cloud::Error.from_error(e)
845
+ end
846
+
483
847
  ##
484
848
  # Configuration class for the ReservationBlocks REST API.
485
849
  #
@@ -632,6 +996,11 @@ module Google
632
996
  #
633
997
  attr_reader :get
634
998
  ##
999
+ # RPC-specific configuration for `get_iam_policy`
1000
+ # @return [::Gapic::Config::Method]
1001
+ #
1002
+ attr_reader :get_iam_policy
1003
+ ##
635
1004
  # RPC-specific configuration for `list`
636
1005
  # @return [::Gapic::Config::Method]
637
1006
  #
@@ -641,15 +1010,31 @@ module Google
641
1010
  # @return [::Gapic::Config::Method]
642
1011
  #
643
1012
  attr_reader :perform_maintenance
1013
+ ##
1014
+ # RPC-specific configuration for `set_iam_policy`
1015
+ # @return [::Gapic::Config::Method]
1016
+ #
1017
+ attr_reader :set_iam_policy
1018
+ ##
1019
+ # RPC-specific configuration for `test_iam_permissions`
1020
+ # @return [::Gapic::Config::Method]
1021
+ #
1022
+ attr_reader :test_iam_permissions
644
1023
 
645
1024
  # @private
646
1025
  def initialize parent_rpcs = nil
647
1026
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
648
1027
  @get = ::Gapic::Config::Method.new get_config
1028
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1029
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
649
1030
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
650
1031
  @list = ::Gapic::Config::Method.new list_config
651
1032
  perform_maintenance_config = parent_rpcs.perform_maintenance if parent_rpcs.respond_to? :perform_maintenance
652
1033
  @perform_maintenance = ::Gapic::Config::Method.new perform_maintenance_config
1034
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1035
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1036
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1037
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
653
1038
 
654
1039
  yield self if block_given?
655
1040
  end