google-cloud-compute-v1 2.4.0 → 2.6.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.
- checksums.yaml +4 -4
- data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +52 -3
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +116 -3
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +116 -3
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +421 -1
- data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +182 -0
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +420 -3
- data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +120 -0
- data/lib/google/cloud/compute/v1/compute_pb.rb +79 -1
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +52 -3
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +292 -3
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +97 -1
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +289 -1
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +97 -1
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +132 -3
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +97 -1
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +113 -1
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +114 -2
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +84 -3
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +49 -1
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +81 -1
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +116 -3
- data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +16 -0
- data/lib/google/cloud/compute/v1/images/rest/client.rb +177 -1
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +327 -6
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +149 -4
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +132 -3
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +845 -4
- data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +62 -0
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +116 -3
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +33 -1
- data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +33 -1
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +206 -2
- data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +60 -0
- data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +32 -0
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +113 -1
- data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +113 -1
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +52 -3
- data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +236 -3
- data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +62 -0
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +83 -2
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +149 -4
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +257 -1
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +178 -2
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +229 -4
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +132 -3
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +52 -3
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +116 -3
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +210 -2
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +282 -4
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +120 -0
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +304 -3
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +122 -0
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +97 -1
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +445 -1
- data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +184 -0
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +84 -3
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +33 -1
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +273 -1
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +81 -1
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +97 -1
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +308 -4
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +66 -2
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +65 -1
- data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +16 -0
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +378 -4
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +185 -0
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +273 -1
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +65 -1
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +65 -1
- data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +497 -5
- data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +246 -0
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +65 -1
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +98 -2
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +81 -1
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +113 -1
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +65 -1
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +113 -1
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +33 -1
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +164 -3
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +148 -3
- data/lib/google/cloud/compute/v1/rest.rb +1 -0
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +261 -4
- data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +61 -0
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +65 -1
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +203 -6
- data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +148 -3
- data/lib/google/cloud/compute/v1/snapshot_settings_service/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +480 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +167 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service.rb +47 -0
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +129 -1
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +84 -3
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +117 -4
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +197 -4
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +81 -1
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +116 -3
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +180 -3
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +188 -3
- data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +62 -0
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +284 -3
- data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +62 -0
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +145 -1
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +116 -3
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +100 -3
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +148 -3
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +132 -3
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +100 -3
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +65 -1
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +33 -1
- data/lib/google/cloud/compute/v1.rb +1 -0
- data/proto_docs/google/api/client.rb +13 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/compute/v1/compute.rb +1654 -196
- data/proto_docs/google/protobuf/any.rb +144 -0
- metadata +11 -5
|
@@ -84,6 +84,8 @@ module Google
|
|
|
84
84
|
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
default_config.rpcs.set_security_policy.timeout = 600.0
|
|
88
|
+
|
|
87
89
|
default_config
|
|
88
90
|
end
|
|
89
91
|
yield @configure if block_given?
|
|
@@ -179,13 +181,13 @@ module Google
|
|
|
179
181
|
# @param options [::Gapic::CallOptions, ::Hash]
|
|
180
182
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
181
183
|
#
|
|
182
|
-
# @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
|
|
184
|
+
# @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)
|
|
183
185
|
# Pass arguments to `aggregated_list` via keyword arguments. Note that at
|
|
184
186
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
185
187
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
186
188
|
#
|
|
187
189
|
# @param filter [::String]
|
|
188
|
-
# 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
|
|
190
|
+
# 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.
|
|
189
191
|
# @param include_all_scopes [::Boolean]
|
|
190
192
|
# 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.
|
|
191
193
|
# @param max_results [::Integer]
|
|
@@ -198,6 +200,7 @@ module Google
|
|
|
198
200
|
# Project ID for this request.
|
|
199
201
|
# @param return_partial_success [::Boolean]
|
|
200
202
|
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
|
|
203
|
+
# @param service_project_number [::Integer]
|
|
201
204
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
202
205
|
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::TargetInstancesScopedList>]
|
|
203
206
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
@@ -205,6 +208,22 @@ module Google
|
|
|
205
208
|
# @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::TargetInstancesScopedList>]
|
|
206
209
|
#
|
|
207
210
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
211
|
+
#
|
|
212
|
+
# @example Basic example
|
|
213
|
+
# require "google/cloud/compute/v1"
|
|
214
|
+
#
|
|
215
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
216
|
+
# client = Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new
|
|
217
|
+
#
|
|
218
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
219
|
+
# request = Google::Cloud::Compute::V1::AggregatedListTargetInstancesRequest.new
|
|
220
|
+
#
|
|
221
|
+
# # Call the aggregated_list method.
|
|
222
|
+
# result = client.aggregated_list request
|
|
223
|
+
#
|
|
224
|
+
# # The returned object is of type Google::Cloud::Compute::V1::TargetInstanceAggregatedList.
|
|
225
|
+
# p result
|
|
226
|
+
#
|
|
208
227
|
def aggregated_list request, options = nil
|
|
209
228
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
210
229
|
|
|
@@ -274,6 +293,22 @@ module Google
|
|
|
274
293
|
# @return [::Gapic::GenericLRO::Operation]
|
|
275
294
|
#
|
|
276
295
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
296
|
+
#
|
|
297
|
+
# @example Basic example
|
|
298
|
+
# require "google/cloud/compute/v1"
|
|
299
|
+
#
|
|
300
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
301
|
+
# client = Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new
|
|
302
|
+
#
|
|
303
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
304
|
+
# request = Google::Cloud::Compute::V1::DeleteTargetInstanceRequest.new
|
|
305
|
+
#
|
|
306
|
+
# # Call the delete method.
|
|
307
|
+
# result = client.delete request
|
|
308
|
+
#
|
|
309
|
+
# # The returned object is of type Google::Cloud::Compute::V1::Operation.
|
|
310
|
+
# p result
|
|
311
|
+
#
|
|
277
312
|
def delete request, options = nil
|
|
278
313
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
279
314
|
|
|
@@ -349,6 +384,22 @@ module Google
|
|
|
349
384
|
# @return [::Google::Cloud::Compute::V1::TargetInstance]
|
|
350
385
|
#
|
|
351
386
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
387
|
+
#
|
|
388
|
+
# @example Basic example
|
|
389
|
+
# require "google/cloud/compute/v1"
|
|
390
|
+
#
|
|
391
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
392
|
+
# client = Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new
|
|
393
|
+
#
|
|
394
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
395
|
+
# request = Google::Cloud::Compute::V1::GetTargetInstanceRequest.new
|
|
396
|
+
#
|
|
397
|
+
# # Call the get method.
|
|
398
|
+
# result = client.get request
|
|
399
|
+
#
|
|
400
|
+
# # The returned object is of type Google::Cloud::Compute::V1::TargetInstance.
|
|
401
|
+
# p result
|
|
402
|
+
#
|
|
352
403
|
def get request, options = nil
|
|
353
404
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
354
405
|
|
|
@@ -417,6 +468,22 @@ module Google
|
|
|
417
468
|
# @return [::Gapic::GenericLRO::Operation]
|
|
418
469
|
#
|
|
419
470
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
471
|
+
#
|
|
472
|
+
# @example Basic example
|
|
473
|
+
# require "google/cloud/compute/v1"
|
|
474
|
+
#
|
|
475
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
476
|
+
# client = Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new
|
|
477
|
+
#
|
|
478
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
479
|
+
# request = Google::Cloud::Compute::V1::InsertTargetInstanceRequest.new
|
|
480
|
+
#
|
|
481
|
+
# # Call the insert method.
|
|
482
|
+
# result = client.insert request
|
|
483
|
+
#
|
|
484
|
+
# # The returned object is of type Google::Cloud::Compute::V1::Operation.
|
|
485
|
+
# p result
|
|
486
|
+
#
|
|
420
487
|
def insert request, options = nil
|
|
421
488
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
422
489
|
|
|
@@ -480,7 +547,7 @@ module Google
|
|
|
480
547
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
481
548
|
#
|
|
482
549
|
# @param filter [::String]
|
|
483
|
-
# 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
|
|
550
|
+
# 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.
|
|
484
551
|
# @param max_results [::Integer]
|
|
485
552
|
# 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`)
|
|
486
553
|
# @param order_by [::String]
|
|
@@ -500,6 +567,22 @@ module Google
|
|
|
500
567
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::TargetInstance>]
|
|
501
568
|
#
|
|
502
569
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
570
|
+
#
|
|
571
|
+
# @example Basic example
|
|
572
|
+
# require "google/cloud/compute/v1"
|
|
573
|
+
#
|
|
574
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
575
|
+
# client = Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new
|
|
576
|
+
#
|
|
577
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
578
|
+
# request = Google::Cloud::Compute::V1::ListTargetInstancesRequest.new
|
|
579
|
+
#
|
|
580
|
+
# # Call the list method.
|
|
581
|
+
# result = client.list request
|
|
582
|
+
#
|
|
583
|
+
# # The returned object is of type Google::Cloud::Compute::V1::TargetInstanceList.
|
|
584
|
+
# p result
|
|
585
|
+
#
|
|
503
586
|
def list request, options = nil
|
|
504
587
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
505
588
|
|
|
@@ -536,6 +619,101 @@ module Google
|
|
|
536
619
|
raise ::Google::Cloud::Error.from_error(e)
|
|
537
620
|
end
|
|
538
621
|
|
|
622
|
+
##
|
|
623
|
+
# Sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview
|
|
624
|
+
#
|
|
625
|
+
# @overload set_security_policy(request, options = nil)
|
|
626
|
+
# Pass arguments to `set_security_policy` via a request object, either of type
|
|
627
|
+
# {::Google::Cloud::Compute::V1::SetSecurityPolicyTargetInstanceRequest} or an equivalent Hash.
|
|
628
|
+
#
|
|
629
|
+
# @param request [::Google::Cloud::Compute::V1::SetSecurityPolicyTargetInstanceRequest, ::Hash]
|
|
630
|
+
# A request object representing the call parameters. Required. To specify no
|
|
631
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
632
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
633
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
634
|
+
#
|
|
635
|
+
# @overload set_security_policy(project: nil, request_id: nil, security_policy_reference_resource: nil, target_instance: nil, zone: nil)
|
|
636
|
+
# Pass arguments to `set_security_policy` via keyword arguments. Note that at
|
|
637
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
638
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
639
|
+
#
|
|
640
|
+
# @param project [::String]
|
|
641
|
+
# Project ID for this request.
|
|
642
|
+
# @param request_id [::String]
|
|
643
|
+
# 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).
|
|
644
|
+
# @param security_policy_reference_resource [::Google::Cloud::Compute::V1::SecurityPolicyReference, ::Hash]
|
|
645
|
+
# The body resource for this request
|
|
646
|
+
# @param target_instance [::String]
|
|
647
|
+
# Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035.
|
|
648
|
+
# @param zone [::String]
|
|
649
|
+
# Name of the zone scoping this request.
|
|
650
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
651
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
|
652
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
653
|
+
#
|
|
654
|
+
# @return [::Gapic::GenericLRO::Operation]
|
|
655
|
+
#
|
|
656
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
657
|
+
#
|
|
658
|
+
# @example Basic example
|
|
659
|
+
# require "google/cloud/compute/v1"
|
|
660
|
+
#
|
|
661
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
662
|
+
# client = Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new
|
|
663
|
+
#
|
|
664
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
665
|
+
# request = Google::Cloud::Compute::V1::SetSecurityPolicyTargetInstanceRequest.new
|
|
666
|
+
#
|
|
667
|
+
# # Call the set_security_policy method.
|
|
668
|
+
# result = client.set_security_policy request
|
|
669
|
+
#
|
|
670
|
+
# # The returned object is of type Google::Cloud::Compute::V1::Operation.
|
|
671
|
+
# p result
|
|
672
|
+
#
|
|
673
|
+
def set_security_policy request, options = nil
|
|
674
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
675
|
+
|
|
676
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetSecurityPolicyTargetInstanceRequest
|
|
677
|
+
|
|
678
|
+
# Converts hash and nil to an options object
|
|
679
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
680
|
+
|
|
681
|
+
# Customize the options with defaults
|
|
682
|
+
call_metadata = @config.rpcs.set_security_policy.metadata.to_h
|
|
683
|
+
|
|
684
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
685
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
686
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
687
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
|
688
|
+
transports_version_send: [:rest]
|
|
689
|
+
|
|
690
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
691
|
+
|
|
692
|
+
options.apply_defaults timeout: @config.rpcs.set_security_policy.timeout,
|
|
693
|
+
metadata: call_metadata,
|
|
694
|
+
retry_policy: @config.rpcs.set_security_policy.retry_policy
|
|
695
|
+
|
|
696
|
+
options.apply_defaults timeout: @config.timeout,
|
|
697
|
+
metadata: @config.metadata,
|
|
698
|
+
retry_policy: @config.retry_policy
|
|
699
|
+
|
|
700
|
+
@target_instances_stub.set_security_policy request, options do |result, response|
|
|
701
|
+
result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
|
|
702
|
+
operation: result,
|
|
703
|
+
client: zone_operations,
|
|
704
|
+
request_values: {
|
|
705
|
+
"project" => request.project,
|
|
706
|
+
"zone" => request.zone
|
|
707
|
+
},
|
|
708
|
+
options: options
|
|
709
|
+
)
|
|
710
|
+
yield result, response if block_given?
|
|
711
|
+
return result
|
|
712
|
+
end
|
|
713
|
+
rescue ::Gapic::Rest::Error => e
|
|
714
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
715
|
+
end
|
|
716
|
+
|
|
539
717
|
##
|
|
540
718
|
# Configuration class for the TargetInstances REST API.
|
|
541
719
|
#
|
|
@@ -686,6 +864,11 @@ module Google
|
|
|
686
864
|
# @return [::Gapic::Config::Method]
|
|
687
865
|
#
|
|
688
866
|
attr_reader :list
|
|
867
|
+
##
|
|
868
|
+
# RPC-specific configuration for `set_security_policy`
|
|
869
|
+
# @return [::Gapic::Config::Method]
|
|
870
|
+
#
|
|
871
|
+
attr_reader :set_security_policy
|
|
689
872
|
|
|
690
873
|
# @private
|
|
691
874
|
def initialize parent_rpcs = nil
|
|
@@ -699,6 +882,8 @@ module Google
|
|
|
699
882
|
@insert = ::Gapic::Config::Method.new insert_config
|
|
700
883
|
list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
|
|
701
884
|
@list = ::Gapic::Config::Method.new list_config
|
|
885
|
+
set_security_policy_config = parent_rpcs.set_security_policy if parent_rpcs.respond_to? :set_security_policy
|
|
886
|
+
@set_security_policy = ::Gapic::Config::Method.new set_security_policy_config
|
|
702
887
|
|
|
703
888
|
yield self if block_given?
|
|
704
889
|
end
|
|
@@ -230,6 +230,44 @@ module Google
|
|
|
230
230
|
result
|
|
231
231
|
end
|
|
232
232
|
|
|
233
|
+
##
|
|
234
|
+
# Baseline implementation for the set_security_policy REST call
|
|
235
|
+
#
|
|
236
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetSecurityPolicyTargetInstanceRequest]
|
|
237
|
+
# A request object representing the call parameters. Required.
|
|
238
|
+
# @param options [::Gapic::CallOptions]
|
|
239
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
240
|
+
#
|
|
241
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
242
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
|
243
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
244
|
+
#
|
|
245
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
|
246
|
+
# A result object deserialized from the server's reply
|
|
247
|
+
def set_security_policy request_pb, options = nil
|
|
248
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
249
|
+
|
|
250
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_set_security_policy_request request_pb
|
|
251
|
+
query_string_params = if query_string_params.any?
|
|
252
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
253
|
+
else
|
|
254
|
+
{}
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
response = @client_stub.make_http_request(
|
|
258
|
+
verb,
|
|
259
|
+
uri: uri,
|
|
260
|
+
body: body || "",
|
|
261
|
+
params: query_string_params,
|
|
262
|
+
options: options
|
|
263
|
+
)
|
|
264
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
265
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
|
266
|
+
|
|
267
|
+
yield result, operation if block_given?
|
|
268
|
+
result
|
|
269
|
+
end
|
|
270
|
+
|
|
233
271
|
##
|
|
234
272
|
# @private
|
|
235
273
|
#
|
|
@@ -341,6 +379,30 @@ module Google
|
|
|
341
379
|
)
|
|
342
380
|
transcoder.transcode request_pb
|
|
343
381
|
end
|
|
382
|
+
|
|
383
|
+
##
|
|
384
|
+
# @private
|
|
385
|
+
#
|
|
386
|
+
# GRPC transcoding helper method for the set_security_policy REST call
|
|
387
|
+
#
|
|
388
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetSecurityPolicyTargetInstanceRequest]
|
|
389
|
+
# A request object representing the call parameters. Required.
|
|
390
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
391
|
+
# Uri, Body, Query string parameters
|
|
392
|
+
def self.transcode_set_security_policy_request request_pb
|
|
393
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
394
|
+
.with_bindings(
|
|
395
|
+
uri_method: :post,
|
|
396
|
+
uri_template: "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}/setSecurityPolicy",
|
|
397
|
+
body: "security_policy_reference_resource",
|
|
398
|
+
matches: [
|
|
399
|
+
["project", %r{^[^/]+/?$}, false],
|
|
400
|
+
["zone", %r{^[^/]+/?$}, false],
|
|
401
|
+
["target_instance", %r{^[^/]+/?$}, false]
|
|
402
|
+
]
|
|
403
|
+
)
|
|
404
|
+
transcoder.transcode request_pb
|
|
405
|
+
end
|
|
344
406
|
end
|
|
345
407
|
end
|
|
346
408
|
end
|