google-cloud-compute-v1 2.5.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +4 -3
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +4 -3
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +4 -3
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +277 -1
  6. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +182 -0
  7. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +196 -3
  8. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +120 -0
  9. data/lib/google/cloud/compute/v1/compute_pb.rb +79 -1
  10. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +4 -3
  11. data/lib/google/cloud/compute/v1/disks/rest/client.rb +4 -3
  12. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +1 -1
  13. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +1 -1
  14. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +1 -1
  15. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +4 -3
  16. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +1 -1
  17. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +1 -1
  18. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +2 -2
  19. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +4 -3
  20. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
  21. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +1 -1
  22. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +4 -3
  23. data/lib/google/cloud/compute/v1/images/rest/client.rb +1 -1
  24. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +7 -6
  25. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +5 -4
  26. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +4 -3
  27. data/lib/google/cloud/compute/v1/instances/rest/client.rb +109 -4
  28. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +62 -0
  29. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +4 -3
  30. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
  31. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +1 -1
  32. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +94 -2
  33. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
  34. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +1 -1
  35. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +1 -1
  36. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +4 -3
  37. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +108 -3
  38. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +62 -0
  39. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +3 -2
  40. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +5 -4
  41. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1 -1
  42. data/lib/google/cloud/compute/v1/networks/rest/client.rb +2 -2
  43. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +5 -4
  44. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +4 -3
  45. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +4 -3
  46. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +4 -3
  47. data/lib/google/cloud/compute/v1/projects/rest/client.rb +2 -2
  48. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +202 -4
  49. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +120 -0
  50. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +208 -3
  51. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +122 -0
  52. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +1 -1
  53. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +301 -1
  54. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +184 -0
  55. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +4 -3
  56. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
  57. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +1 -1
  58. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +1 -1
  59. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +1 -1
  60. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +4 -4
  61. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +2 -2
  62. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +1 -1
  63. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +314 -4
  64. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +185 -0
  65. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1 -1
  66. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +1 -1
  67. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
  68. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +417 -5
  69. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +246 -0
  70. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +1 -1
  71. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +2 -2
  72. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +1 -1
  73. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +1 -1
  74. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +1 -1
  75. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +1 -1
  76. data/lib/google/cloud/compute/v1/regions/rest/client.rb +1 -1
  77. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +4 -3
  78. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +4 -3
  79. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  80. data/lib/google/cloud/compute/v1/routers/rest/client.rb +101 -4
  81. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +61 -0
  82. data/lib/google/cloud/compute/v1/routes/rest/client.rb +1 -1
  83. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +11 -6
  84. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +4 -3
  85. data/lib/google/cloud/compute/v1/snapshot_settings_service/credentials.rb +52 -0
  86. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +480 -0
  87. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +167 -0
  88. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest.rb +51 -0
  89. data/lib/google/cloud/compute/v1/snapshot_settings_service.rb +47 -0
  90. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +1 -1
  91. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +4 -3
  92. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +5 -4
  93. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +5 -4
  94. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +1 -1
  95. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +4 -3
  96. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +4 -3
  97. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +108 -3
  98. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +62 -0
  99. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +108 -3
  100. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +62 -0
  101. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +1 -1
  102. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +4 -3
  103. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +4 -3
  104. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +4 -3
  105. data/lib/google/cloud/compute/v1/version.rb +1 -1
  106. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +4 -3
  107. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +4 -3
  108. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
  109. data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
  110. data/lib/google/cloud/compute/v1.rb +1 -0
  111. data/proto_docs/google/api/client.rb +13 -0
  112. data/proto_docs/google/cloud/compute/v1/compute.rb +1654 -196
  113. data/proto_docs/google/protobuf/any.rb +144 -0
  114. metadata +8 -2
@@ -448,7 +448,7 @@ module Google
448
448
  # the default parameter values, pass an empty Hash as a request object (see above).
449
449
  #
450
450
  # @param filter [::String]
451
- # 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. 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 `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. 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`.
451
+ # 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.
452
452
  # @param max_results [::Integer]
453
453
  # 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`)
454
454
  # @param order_by [::String]
@@ -330,7 +330,7 @@ module Google
330
330
  # the default parameter values, pass an empty Hash as a request object (see above).
331
331
  #
332
332
  # @param filter [::String]
333
- # 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. 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 `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. 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`.
333
+ # 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.
334
334
  # @param max_results [::Integer]
335
335
  # 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`)
336
336
  # @param order_by [::String]
@@ -65,6 +65,8 @@ module Google
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
67
67
 
68
+ default_config.rpcs.add_rule.timeout = 600.0
69
+
68
70
  default_config.rpcs.delete.timeout = 600.0
69
71
 
70
72
  default_config.rpcs.get.timeout = 600.0
@@ -72,6 +74,11 @@ module Google
72
74
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
73
75
  }
74
76
 
77
+ default_config.rpcs.get_rule.timeout = 600.0
78
+ default_config.rpcs.get_rule.retry_policy = {
79
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
80
+ }
81
+
75
82
  default_config.rpcs.insert.timeout = 600.0
76
83
 
77
84
  default_config.rpcs.list.timeout = 600.0
@@ -81,6 +88,10 @@ module Google
81
88
 
82
89
  default_config.rpcs.patch.timeout = 600.0
83
90
 
91
+ default_config.rpcs.patch_rule.timeout = 600.0
92
+
93
+ default_config.rpcs.remove_rule.timeout = 600.0
94
+
84
95
  default_config
85
96
  end
86
97
  yield @configure if block_given?
@@ -163,6 +174,101 @@ module Google
163
174
 
164
175
  # Service calls
165
176
 
177
+ ##
178
+ # Inserts a rule into a security policy.
179
+ #
180
+ # @overload add_rule(request, options = nil)
181
+ # Pass arguments to `add_rule` via a request object, either of type
182
+ # {::Google::Cloud::Compute::V1::AddRuleRegionSecurityPolicyRequest} or an equivalent Hash.
183
+ #
184
+ # @param request [::Google::Cloud::Compute::V1::AddRuleRegionSecurityPolicyRequest, ::Hash]
185
+ # A request object representing the call parameters. Required. To specify no
186
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
187
+ # @param options [::Gapic::CallOptions, ::Hash]
188
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
189
+ #
190
+ # @overload add_rule(project: nil, region: nil, security_policy: nil, security_policy_rule_resource: nil, validate_only: nil)
191
+ # Pass arguments to `add_rule` via keyword arguments. Note that at
192
+ # least one keyword argument is required. To specify no parameters, or to keep all
193
+ # the default parameter values, pass an empty Hash as a request object (see above).
194
+ #
195
+ # @param project [::String]
196
+ # Project ID for this request.
197
+ # @param region [::String]
198
+ # Name of the region scoping this request.
199
+ # @param security_policy [::String]
200
+ # Name of the security policy to update.
201
+ # @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
202
+ # The body resource for this request
203
+ # @param validate_only [::Boolean]
204
+ # If true, the request will not be committed.
205
+ # @yield [result, operation] Access the result along with the TransportOperation object
206
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
207
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
208
+ #
209
+ # @return [::Gapic::GenericLRO::Operation]
210
+ #
211
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
212
+ #
213
+ # @example Basic example
214
+ # require "google/cloud/compute/v1"
215
+ #
216
+ # # Create a client object. The client can be reused for multiple calls.
217
+ # client = Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.new
218
+ #
219
+ # # Create a request. To set request fields, pass in keyword arguments.
220
+ # request = Google::Cloud::Compute::V1::AddRuleRegionSecurityPolicyRequest.new
221
+ #
222
+ # # Call the add_rule method.
223
+ # result = client.add_rule request
224
+ #
225
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
226
+ # p result
227
+ #
228
+ def add_rule request, options = nil
229
+ raise ::ArgumentError, "request must be provided" if request.nil?
230
+
231
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddRuleRegionSecurityPolicyRequest
232
+
233
+ # Converts hash and nil to an options object
234
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
235
+
236
+ # Customize the options with defaults
237
+ call_metadata = @config.rpcs.add_rule.metadata.to_h
238
+
239
+ # Set x-goog-api-client and x-goog-user-project headers
240
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
241
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
242
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
243
+ transports_version_send: [:rest]
244
+
245
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
246
+
247
+ options.apply_defaults timeout: @config.rpcs.add_rule.timeout,
248
+ metadata: call_metadata,
249
+ retry_policy: @config.rpcs.add_rule.retry_policy
250
+
251
+ options.apply_defaults timeout: @config.timeout,
252
+ metadata: @config.metadata,
253
+ retry_policy: @config.retry_policy
254
+
255
+ @region_security_policies_stub.add_rule request, options do |result, response|
256
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
257
+ operation: result,
258
+ client: region_operations,
259
+ request_values: {
260
+ "project" => request.project,
261
+ "region" => request.region
262
+ },
263
+ options: options
264
+ )
265
+ yield result, response if block_given?
266
+ return result
267
+ end
268
+ rescue ::Gapic::Rest::Error => e
269
+ raise ::Google::Cloud::Error.from_error(e)
270
+ end
271
+
166
272
  ##
167
273
  # Deletes the specified policy.
168
274
  #
@@ -338,6 +444,90 @@ module Google
338
444
  raise ::Google::Cloud::Error.from_error(e)
339
445
  end
340
446
 
447
+ ##
448
+ # Gets a rule at the specified priority.
449
+ #
450
+ # @overload get_rule(request, options = nil)
451
+ # Pass arguments to `get_rule` via a request object, either of type
452
+ # {::Google::Cloud::Compute::V1::GetRuleRegionSecurityPolicyRequest} or an equivalent Hash.
453
+ #
454
+ # @param request [::Google::Cloud::Compute::V1::GetRuleRegionSecurityPolicyRequest, ::Hash]
455
+ # A request object representing the call parameters. Required. To specify no
456
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
457
+ # @param options [::Gapic::CallOptions, ::Hash]
458
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
459
+ #
460
+ # @overload get_rule(priority: nil, project: nil, region: nil, security_policy: nil)
461
+ # Pass arguments to `get_rule` via keyword arguments. Note that at
462
+ # least one keyword argument is required. To specify no parameters, or to keep all
463
+ # the default parameter values, pass an empty Hash as a request object (see above).
464
+ #
465
+ # @param priority [::Integer]
466
+ # The priority of the rule to get from the security policy.
467
+ # @param project [::String]
468
+ # Project ID for this request.
469
+ # @param region [::String]
470
+ # Name of the region scoping this request.
471
+ # @param security_policy [::String]
472
+ # Name of the security policy to which the queried rule belongs.
473
+ # @yield [result, operation] Access the result along with the TransportOperation object
474
+ # @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyRule]
475
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
476
+ #
477
+ # @return [::Google::Cloud::Compute::V1::SecurityPolicyRule]
478
+ #
479
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
480
+ #
481
+ # @example Basic example
482
+ # require "google/cloud/compute/v1"
483
+ #
484
+ # # Create a client object. The client can be reused for multiple calls.
485
+ # client = Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.new
486
+ #
487
+ # # Create a request. To set request fields, pass in keyword arguments.
488
+ # request = Google::Cloud::Compute::V1::GetRuleRegionSecurityPolicyRequest.new
489
+ #
490
+ # # Call the get_rule method.
491
+ # result = client.get_rule request
492
+ #
493
+ # # The returned object is of type Google::Cloud::Compute::V1::SecurityPolicyRule.
494
+ # p result
495
+ #
496
+ def get_rule request, options = nil
497
+ raise ::ArgumentError, "request must be provided" if request.nil?
498
+
499
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRuleRegionSecurityPolicyRequest
500
+
501
+ # Converts hash and nil to an options object
502
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
503
+
504
+ # Customize the options with defaults
505
+ call_metadata = @config.rpcs.get_rule.metadata.to_h
506
+
507
+ # Set x-goog-api-client and x-goog-user-project headers
508
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
509
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
510
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
511
+ transports_version_send: [:rest]
512
+
513
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
514
+
515
+ options.apply_defaults timeout: @config.rpcs.get_rule.timeout,
516
+ metadata: call_metadata,
517
+ retry_policy: @config.rpcs.get_rule.retry_policy
518
+
519
+ options.apply_defaults timeout: @config.timeout,
520
+ metadata: @config.metadata,
521
+ retry_policy: @config.retry_policy
522
+
523
+ @region_security_policies_stub.get_rule request, options do |result, operation|
524
+ yield result, operation if block_given?
525
+ return result
526
+ end
527
+ rescue ::Gapic::Rest::Error => e
528
+ raise ::Google::Cloud::Error.from_error(e)
529
+ end
530
+
341
531
  ##
342
532
  # Creates a new policy in the specified project using the data included in the request.
343
533
  #
@@ -452,7 +642,7 @@ module Google
452
642
  # the default parameter values, pass an empty Hash as a request object (see above).
453
643
  #
454
644
  # @param filter [::String]
455
- # 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. 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 `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. 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`.
645
+ # 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.
456
646
  # @param max_results [::Integer]
457
647
  # 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`)
458
648
  # @param order_by [::String]
@@ -537,7 +727,7 @@ module Google
537
727
  # @param options [::Gapic::CallOptions, ::Hash]
538
728
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
539
729
  #
540
- # @overload patch(project: nil, region: nil, request_id: nil, security_policy: nil, security_policy_resource: nil)
730
+ # @overload patch(project: nil, region: nil, request_id: nil, security_policy: nil, security_policy_resource: nil, update_mask: nil)
541
731
  # Pass arguments to `patch` via keyword arguments. Note that at
542
732
  # least one keyword argument is required. To specify no parameters, or to keep all
543
733
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -552,6 +742,8 @@ module Google
552
742
  # Name of the security policy to update.
553
743
  # @param security_policy_resource [::Google::Cloud::Compute::V1::SecurityPolicy, ::Hash]
554
744
  # The body resource for this request
745
+ # @param update_mask [::String]
746
+ # Indicates fields to be cleared as part of this request.
555
747
  # @yield [result, operation] Access the result along with the TransportOperation object
556
748
  # @yieldparam result [::Gapic::GenericLRO::Operation]
557
749
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -619,6 +811,198 @@ module Google
619
811
  raise ::Google::Cloud::Error.from_error(e)
620
812
  end
621
813
 
814
+ ##
815
+ # Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.
816
+ #
817
+ # @overload patch_rule(request, options = nil)
818
+ # Pass arguments to `patch_rule` via a request object, either of type
819
+ # {::Google::Cloud::Compute::V1::PatchRuleRegionSecurityPolicyRequest} or an equivalent Hash.
820
+ #
821
+ # @param request [::Google::Cloud::Compute::V1::PatchRuleRegionSecurityPolicyRequest, ::Hash]
822
+ # A request object representing the call parameters. Required. To specify no
823
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
824
+ # @param options [::Gapic::CallOptions, ::Hash]
825
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
826
+ #
827
+ # @overload patch_rule(priority: nil, project: nil, region: nil, security_policy: nil, security_policy_rule_resource: nil, update_mask: nil, validate_only: nil)
828
+ # Pass arguments to `patch_rule` via keyword arguments. Note that at
829
+ # least one keyword argument is required. To specify no parameters, or to keep all
830
+ # the default parameter values, pass an empty Hash as a request object (see above).
831
+ #
832
+ # @param priority [::Integer]
833
+ # The priority of the rule to patch.
834
+ # @param project [::String]
835
+ # Project ID for this request.
836
+ # @param region [::String]
837
+ # Name of the region scoping this request.
838
+ # @param security_policy [::String]
839
+ # Name of the security policy to update.
840
+ # @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
841
+ # The body resource for this request
842
+ # @param update_mask [::String]
843
+ # Indicates fields to be cleared as part of this request.
844
+ # @param validate_only [::Boolean]
845
+ # If true, the request will not be committed.
846
+ # @yield [result, operation] Access the result along with the TransportOperation object
847
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
848
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
849
+ #
850
+ # @return [::Gapic::GenericLRO::Operation]
851
+ #
852
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
853
+ #
854
+ # @example Basic example
855
+ # require "google/cloud/compute/v1"
856
+ #
857
+ # # Create a client object. The client can be reused for multiple calls.
858
+ # client = Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.new
859
+ #
860
+ # # Create a request. To set request fields, pass in keyword arguments.
861
+ # request = Google::Cloud::Compute::V1::PatchRuleRegionSecurityPolicyRequest.new
862
+ #
863
+ # # Call the patch_rule method.
864
+ # result = client.patch_rule request
865
+ #
866
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
867
+ # p result
868
+ #
869
+ def patch_rule request, options = nil
870
+ raise ::ArgumentError, "request must be provided" if request.nil?
871
+
872
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRuleRegionSecurityPolicyRequest
873
+
874
+ # Converts hash and nil to an options object
875
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
876
+
877
+ # Customize the options with defaults
878
+ call_metadata = @config.rpcs.patch_rule.metadata.to_h
879
+
880
+ # Set x-goog-api-client and x-goog-user-project headers
881
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
882
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
883
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
884
+ transports_version_send: [:rest]
885
+
886
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
887
+
888
+ options.apply_defaults timeout: @config.rpcs.patch_rule.timeout,
889
+ metadata: call_metadata,
890
+ retry_policy: @config.rpcs.patch_rule.retry_policy
891
+
892
+ options.apply_defaults timeout: @config.timeout,
893
+ metadata: @config.metadata,
894
+ retry_policy: @config.retry_policy
895
+
896
+ @region_security_policies_stub.patch_rule request, options do |result, response|
897
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
898
+ operation: result,
899
+ client: region_operations,
900
+ request_values: {
901
+ "project" => request.project,
902
+ "region" => request.region
903
+ },
904
+ options: options
905
+ )
906
+ yield result, response if block_given?
907
+ return result
908
+ end
909
+ rescue ::Gapic::Rest::Error => e
910
+ raise ::Google::Cloud::Error.from_error(e)
911
+ end
912
+
913
+ ##
914
+ # Deletes a rule at the specified priority.
915
+ #
916
+ # @overload remove_rule(request, options = nil)
917
+ # Pass arguments to `remove_rule` via a request object, either of type
918
+ # {::Google::Cloud::Compute::V1::RemoveRuleRegionSecurityPolicyRequest} or an equivalent Hash.
919
+ #
920
+ # @param request [::Google::Cloud::Compute::V1::RemoveRuleRegionSecurityPolicyRequest, ::Hash]
921
+ # A request object representing the call parameters. Required. To specify no
922
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
923
+ # @param options [::Gapic::CallOptions, ::Hash]
924
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
925
+ #
926
+ # @overload remove_rule(priority: nil, project: nil, region: nil, security_policy: nil)
927
+ # Pass arguments to `remove_rule` via keyword arguments. Note that at
928
+ # least one keyword argument is required. To specify no parameters, or to keep all
929
+ # the default parameter values, pass an empty Hash as a request object (see above).
930
+ #
931
+ # @param priority [::Integer]
932
+ # The priority of the rule to remove from the security policy.
933
+ # @param project [::String]
934
+ # Project ID for this request.
935
+ # @param region [::String]
936
+ # Name of the region scoping this request.
937
+ # @param security_policy [::String]
938
+ # Name of the security policy to update.
939
+ # @yield [result, operation] Access the result along with the TransportOperation object
940
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
941
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
942
+ #
943
+ # @return [::Gapic::GenericLRO::Operation]
944
+ #
945
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
946
+ #
947
+ # @example Basic example
948
+ # require "google/cloud/compute/v1"
949
+ #
950
+ # # Create a client object. The client can be reused for multiple calls.
951
+ # client = Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.new
952
+ #
953
+ # # Create a request. To set request fields, pass in keyword arguments.
954
+ # request = Google::Cloud::Compute::V1::RemoveRuleRegionSecurityPolicyRequest.new
955
+ #
956
+ # # Call the remove_rule method.
957
+ # result = client.remove_rule request
958
+ #
959
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
960
+ # p result
961
+ #
962
+ def remove_rule request, options = nil
963
+ raise ::ArgumentError, "request must be provided" if request.nil?
964
+
965
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveRuleRegionSecurityPolicyRequest
966
+
967
+ # Converts hash and nil to an options object
968
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
969
+
970
+ # Customize the options with defaults
971
+ call_metadata = @config.rpcs.remove_rule.metadata.to_h
972
+
973
+ # Set x-goog-api-client and x-goog-user-project headers
974
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
975
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
976
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
977
+ transports_version_send: [:rest]
978
+
979
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
980
+
981
+ options.apply_defaults timeout: @config.rpcs.remove_rule.timeout,
982
+ metadata: call_metadata,
983
+ retry_policy: @config.rpcs.remove_rule.retry_policy
984
+
985
+ options.apply_defaults timeout: @config.timeout,
986
+ metadata: @config.metadata,
987
+ retry_policy: @config.retry_policy
988
+
989
+ @region_security_policies_stub.remove_rule request, options do |result, response|
990
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
991
+ operation: result,
992
+ client: region_operations,
993
+ request_values: {
994
+ "project" => request.project,
995
+ "region" => request.region
996
+ },
997
+ options: options
998
+ )
999
+ yield result, response if block_given?
1000
+ return result
1001
+ end
1002
+ rescue ::Gapic::Rest::Error => e
1003
+ raise ::Google::Cloud::Error.from_error(e)
1004
+ end
1005
+
622
1006
  ##
623
1007
  # Configuration class for the RegionSecurityPolicies REST API.
624
1008
  #
@@ -635,17 +1019,17 @@ module Google
635
1019
  # @example
636
1020
  #
637
1021
  # # Modify the global config, setting the timeout for
638
- # # delete to 20 seconds,
1022
+ # # add_rule to 20 seconds,
639
1023
  # # and all remaining timeouts to 10 seconds.
640
1024
  # ::Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.configure do |config|
641
1025
  # config.timeout = 10.0
642
- # config.rpcs.delete.timeout = 20.0
1026
+ # config.rpcs.add_rule.timeout = 20.0
643
1027
  # end
644
1028
  #
645
1029
  # # Apply the above configuration only to a new client.
646
1030
  # client = ::Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.new do |config|
647
1031
  # config.timeout = 10.0
648
- # config.rpcs.delete.timeout = 20.0
1032
+ # config.rpcs.add_rule.timeout = 20.0
649
1033
  # end
650
1034
  #
651
1035
  # @!attribute [rw] endpoint
@@ -744,6 +1128,11 @@ module Google
744
1128
  # trigger a retry.
745
1129
  #
746
1130
  class Rpcs
1131
+ ##
1132
+ # RPC-specific configuration for `add_rule`
1133
+ # @return [::Gapic::Config::Method]
1134
+ #
1135
+ attr_reader :add_rule
747
1136
  ##
748
1137
  # RPC-specific configuration for `delete`
749
1138
  # @return [::Gapic::Config::Method]
@@ -755,6 +1144,11 @@ module Google
755
1144
  #
756
1145
  attr_reader :get
757
1146
  ##
1147
+ # RPC-specific configuration for `get_rule`
1148
+ # @return [::Gapic::Config::Method]
1149
+ #
1150
+ attr_reader :get_rule
1151
+ ##
758
1152
  # RPC-specific configuration for `insert`
759
1153
  # @return [::Gapic::Config::Method]
760
1154
  #
@@ -769,19 +1163,37 @@ module Google
769
1163
  # @return [::Gapic::Config::Method]
770
1164
  #
771
1165
  attr_reader :patch
1166
+ ##
1167
+ # RPC-specific configuration for `patch_rule`
1168
+ # @return [::Gapic::Config::Method]
1169
+ #
1170
+ attr_reader :patch_rule
1171
+ ##
1172
+ # RPC-specific configuration for `remove_rule`
1173
+ # @return [::Gapic::Config::Method]
1174
+ #
1175
+ attr_reader :remove_rule
772
1176
 
773
1177
  # @private
774
1178
  def initialize parent_rpcs = nil
1179
+ add_rule_config = parent_rpcs.add_rule if parent_rpcs.respond_to? :add_rule
1180
+ @add_rule = ::Gapic::Config::Method.new add_rule_config
775
1181
  delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
776
1182
  @delete = ::Gapic::Config::Method.new delete_config
777
1183
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
778
1184
  @get = ::Gapic::Config::Method.new get_config
1185
+ get_rule_config = parent_rpcs.get_rule if parent_rpcs.respond_to? :get_rule
1186
+ @get_rule = ::Gapic::Config::Method.new get_rule_config
779
1187
  insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
780
1188
  @insert = ::Gapic::Config::Method.new insert_config
781
1189
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
782
1190
  @list = ::Gapic::Config::Method.new list_config
783
1191
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
784
1192
  @patch = ::Gapic::Config::Method.new patch_config
1193
+ patch_rule_config = parent_rpcs.patch_rule if parent_rpcs.respond_to? :patch_rule
1194
+ @patch_rule = ::Gapic::Config::Method.new patch_rule_config
1195
+ remove_rule_config = parent_rpcs.remove_rule if parent_rpcs.respond_to? :remove_rule
1196
+ @remove_rule = ::Gapic::Config::Method.new remove_rule_config
785
1197
 
786
1198
  yield self if block_given?
787
1199
  end