google-cloud-compute-v1 2.5.0 → 2.7.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/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +311 -8
- data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +196 -2
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +230 -10
- data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +134 -2
- data/lib/google/cloud/compute/v1/compute_pb.rb +79 -1
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/images/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +41 -13
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +143 -11
- data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +128 -9
- data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +74 -2
- data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +142 -10
- data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +37 -9
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +236 -11
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +134 -2
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +242 -10
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +136 -2
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +335 -8
- data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +198 -2
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +38 -11
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +348 -11
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +199 -2
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +451 -12
- data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +260 -2
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/rest.rb +1 -0
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +135 -11
- data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +75 -2
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +45 -13
- data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +14 -2
- 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 +507 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +179 -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 +35 -8
- data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +142 -10
- data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +142 -10
- data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1.rb +1 -0
- data/proto_docs/google/api/client.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
|
@@ -30,16 +30,28 @@ module Google
|
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
|
31
31
|
#
|
|
32
32
|
class ServiceStub
|
|
33
|
-
def initialize endpoint:, credentials:
|
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
|
34
34
|
# These require statements are intentionally placed here to initialize
|
|
35
35
|
# the REST modules only when it's required.
|
|
36
36
|
require "gapic/rest"
|
|
37
37
|
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
39
|
+
endpoint_template: endpoint_template,
|
|
40
|
+
universe_domain: universe_domain,
|
|
41
|
+
credentials: credentials,
|
|
39
42
|
numeric_enums: false,
|
|
40
43
|
raise_faraday_errors: false
|
|
41
44
|
end
|
|
42
45
|
|
|
46
|
+
##
|
|
47
|
+
# The effective universe domain
|
|
48
|
+
#
|
|
49
|
+
# @return [String]
|
|
50
|
+
#
|
|
51
|
+
def universe_domain
|
|
52
|
+
@client_stub.universe_domain
|
|
53
|
+
end
|
|
54
|
+
|
|
43
55
|
##
|
|
44
56
|
# Baseline implementation for the delete REST call
|
|
45
57
|
#
|
|
@@ -268,6 +280,44 @@ module Google
|
|
|
268
280
|
result
|
|
269
281
|
end
|
|
270
282
|
|
|
283
|
+
##
|
|
284
|
+
# Baseline implementation for the list_usable REST call
|
|
285
|
+
#
|
|
286
|
+
# @param request_pb [::Google::Cloud::Compute::V1::ListUsableRegionBackendServicesRequest]
|
|
287
|
+
# A request object representing the call parameters. Required.
|
|
288
|
+
# @param options [::Gapic::CallOptions]
|
|
289
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
290
|
+
#
|
|
291
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
292
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::BackendServiceListUsable]
|
|
293
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
294
|
+
#
|
|
295
|
+
# @return [::Google::Cloud::Compute::V1::BackendServiceListUsable]
|
|
296
|
+
# A result object deserialized from the server's reply
|
|
297
|
+
def list_usable request_pb, options = nil
|
|
298
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
299
|
+
|
|
300
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_request request_pb
|
|
301
|
+
query_string_params = if query_string_params.any?
|
|
302
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
303
|
+
else
|
|
304
|
+
{}
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
response = @client_stub.make_http_request(
|
|
308
|
+
verb,
|
|
309
|
+
uri: uri,
|
|
310
|
+
body: body || "",
|
|
311
|
+
params: query_string_params,
|
|
312
|
+
options: options
|
|
313
|
+
)
|
|
314
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
315
|
+
result = ::Google::Cloud::Compute::V1::BackendServiceListUsable.decode_json response.body, ignore_unknown_fields: true
|
|
316
|
+
|
|
317
|
+
yield result, operation if block_given?
|
|
318
|
+
result
|
|
319
|
+
end
|
|
320
|
+
|
|
271
321
|
##
|
|
272
322
|
# Baseline implementation for the patch REST call
|
|
273
323
|
#
|
|
@@ -344,6 +394,82 @@ module Google
|
|
|
344
394
|
result
|
|
345
395
|
end
|
|
346
396
|
|
|
397
|
+
##
|
|
398
|
+
# Baseline implementation for the set_security_policy REST call
|
|
399
|
+
#
|
|
400
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetSecurityPolicyRegionBackendServiceRequest]
|
|
401
|
+
# A request object representing the call parameters. Required.
|
|
402
|
+
# @param options [::Gapic::CallOptions]
|
|
403
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
404
|
+
#
|
|
405
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
406
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
|
407
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
408
|
+
#
|
|
409
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
|
410
|
+
# A result object deserialized from the server's reply
|
|
411
|
+
def set_security_policy request_pb, options = nil
|
|
412
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
413
|
+
|
|
414
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_set_security_policy_request request_pb
|
|
415
|
+
query_string_params = if query_string_params.any?
|
|
416
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
417
|
+
else
|
|
418
|
+
{}
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
response = @client_stub.make_http_request(
|
|
422
|
+
verb,
|
|
423
|
+
uri: uri,
|
|
424
|
+
body: body || "",
|
|
425
|
+
params: query_string_params,
|
|
426
|
+
options: options
|
|
427
|
+
)
|
|
428
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
429
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
|
430
|
+
|
|
431
|
+
yield result, operation if block_given?
|
|
432
|
+
result
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
##
|
|
436
|
+
# Baseline implementation for the test_iam_permissions REST call
|
|
437
|
+
#
|
|
438
|
+
# @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsRegionBackendServiceRequest]
|
|
439
|
+
# A request object representing the call parameters. Required.
|
|
440
|
+
# @param options [::Gapic::CallOptions]
|
|
441
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
442
|
+
#
|
|
443
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
444
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
|
|
445
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
446
|
+
#
|
|
447
|
+
# @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
|
|
448
|
+
# A result object deserialized from the server's reply
|
|
449
|
+
def test_iam_permissions request_pb, options = nil
|
|
450
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
451
|
+
|
|
452
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
|
|
453
|
+
query_string_params = if query_string_params.any?
|
|
454
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
455
|
+
else
|
|
456
|
+
{}
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
response = @client_stub.make_http_request(
|
|
460
|
+
verb,
|
|
461
|
+
uri: uri,
|
|
462
|
+
body: body || "",
|
|
463
|
+
params: query_string_params,
|
|
464
|
+
options: options
|
|
465
|
+
)
|
|
466
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
467
|
+
result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
|
|
468
|
+
|
|
469
|
+
yield result, operation if block_given?
|
|
470
|
+
result
|
|
471
|
+
end
|
|
472
|
+
|
|
347
473
|
##
|
|
348
474
|
# Baseline implementation for the update REST call
|
|
349
475
|
#
|
|
@@ -520,6 +646,28 @@ module Google
|
|
|
520
646
|
transcoder.transcode request_pb
|
|
521
647
|
end
|
|
522
648
|
|
|
649
|
+
##
|
|
650
|
+
# @private
|
|
651
|
+
#
|
|
652
|
+
# GRPC transcoding helper method for the list_usable REST call
|
|
653
|
+
#
|
|
654
|
+
# @param request_pb [::Google::Cloud::Compute::V1::ListUsableRegionBackendServicesRequest]
|
|
655
|
+
# A request object representing the call parameters. Required.
|
|
656
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
657
|
+
# Uri, Body, Query string parameters
|
|
658
|
+
def self.transcode_list_usable_request request_pb
|
|
659
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
660
|
+
.with_bindings(
|
|
661
|
+
uri_method: :get,
|
|
662
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/backendServices/listUsable",
|
|
663
|
+
matches: [
|
|
664
|
+
["project", %r{^[^/]+/?$}, false],
|
|
665
|
+
["region", %r{^[^/]+/?$}, false]
|
|
666
|
+
]
|
|
667
|
+
)
|
|
668
|
+
transcoder.transcode request_pb
|
|
669
|
+
end
|
|
670
|
+
|
|
523
671
|
##
|
|
524
672
|
# @private
|
|
525
673
|
#
|
|
@@ -568,6 +716,54 @@ module Google
|
|
|
568
716
|
transcoder.transcode request_pb
|
|
569
717
|
end
|
|
570
718
|
|
|
719
|
+
##
|
|
720
|
+
# @private
|
|
721
|
+
#
|
|
722
|
+
# GRPC transcoding helper method for the set_security_policy REST call
|
|
723
|
+
#
|
|
724
|
+
# @param request_pb [::Google::Cloud::Compute::V1::SetSecurityPolicyRegionBackendServiceRequest]
|
|
725
|
+
# A request object representing the call parameters. Required.
|
|
726
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
727
|
+
# Uri, Body, Query string parameters
|
|
728
|
+
def self.transcode_set_security_policy_request request_pb
|
|
729
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
730
|
+
.with_bindings(
|
|
731
|
+
uri_method: :post,
|
|
732
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}/setSecurityPolicy",
|
|
733
|
+
body: "security_policy_reference_resource",
|
|
734
|
+
matches: [
|
|
735
|
+
["project", %r{^[^/]+/?$}, false],
|
|
736
|
+
["region", %r{^[^/]+/?$}, false],
|
|
737
|
+
["backend_service", %r{^[^/]+/?$}, false]
|
|
738
|
+
]
|
|
739
|
+
)
|
|
740
|
+
transcoder.transcode request_pb
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
##
|
|
744
|
+
# @private
|
|
745
|
+
#
|
|
746
|
+
# GRPC transcoding helper method for the test_iam_permissions REST call
|
|
747
|
+
#
|
|
748
|
+
# @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsRegionBackendServiceRequest]
|
|
749
|
+
# A request object representing the call parameters. Required.
|
|
750
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
751
|
+
# Uri, Body, Query string parameters
|
|
752
|
+
def self.transcode_test_iam_permissions_request request_pb
|
|
753
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
754
|
+
.with_bindings(
|
|
755
|
+
uri_method: :post,
|
|
756
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
|
|
757
|
+
body: "test_permissions_request_resource",
|
|
758
|
+
matches: [
|
|
759
|
+
["project", %r{^[^/]+/?$}, false],
|
|
760
|
+
["region", %r{^[^/]+/?$}, false],
|
|
761
|
+
["resource", %r{^[^/]+/?$}, false]
|
|
762
|
+
]
|
|
763
|
+
)
|
|
764
|
+
transcoder.transcode request_pb
|
|
765
|
+
end
|
|
766
|
+
|
|
571
767
|
##
|
|
572
768
|
# @private
|
|
573
769
|
#
|
|
@@ -33,6 +33,9 @@ module Google
|
|
|
33
33
|
# The RegionCommitments API.
|
|
34
34
|
#
|
|
35
35
|
class Client
|
|
36
|
+
# @private
|
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
|
38
|
+
|
|
36
39
|
# @private
|
|
37
40
|
attr_reader :region_commitments_stub
|
|
38
41
|
|
|
@@ -110,6 +113,15 @@ module Google
|
|
|
110
113
|
@config
|
|
111
114
|
end
|
|
112
115
|
|
|
116
|
+
##
|
|
117
|
+
# The effective universe domain
|
|
118
|
+
#
|
|
119
|
+
# @return [String]
|
|
120
|
+
#
|
|
121
|
+
def universe_domain
|
|
122
|
+
@region_commitments_stub.universe_domain
|
|
123
|
+
end
|
|
124
|
+
|
|
113
125
|
##
|
|
114
126
|
# Create a new RegionCommitments REST client object.
|
|
115
127
|
#
|
|
@@ -137,8 +149,9 @@ module Google
|
|
|
137
149
|
credentials = @config.credentials
|
|
138
150
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
139
151
|
# but only if the default endpoint does not have a region prefix.
|
|
140
|
-
enable_self_signed_jwt = @config.endpoint
|
|
141
|
-
|
|
152
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
|
153
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
154
|
+
!@config.endpoint.split(".").first.include?("-"))
|
|
142
155
|
credentials ||= Credentials.default scope: @config.scope,
|
|
143
156
|
enable_self_signed_jwt: enable_self_signed_jwt
|
|
144
157
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
|
@@ -152,9 +165,15 @@ module Google
|
|
|
152
165
|
config.credentials = credentials
|
|
153
166
|
config.quota_project = @quota_project_id
|
|
154
167
|
config.endpoint = @config.endpoint
|
|
168
|
+
config.universe_domain = @config.universe_domain
|
|
155
169
|
end
|
|
156
170
|
|
|
157
|
-
@region_commitments_stub = ::Google::Cloud::Compute::V1::RegionCommitments::Rest::ServiceStub.new
|
|
171
|
+
@region_commitments_stub = ::Google::Cloud::Compute::V1::RegionCommitments::Rest::ServiceStub.new(
|
|
172
|
+
endpoint: @config.endpoint,
|
|
173
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
|
174
|
+
universe_domain: @config.universe_domain,
|
|
175
|
+
credentials: credentials
|
|
176
|
+
)
|
|
158
177
|
end
|
|
159
178
|
|
|
160
179
|
##
|
|
@@ -179,13 +198,13 @@ module Google
|
|
|
179
198
|
# @param options [::Gapic::CallOptions, ::Hash]
|
|
180
199
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
181
200
|
#
|
|
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)
|
|
201
|
+
# @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
202
|
# Pass arguments to `aggregated_list` via keyword arguments. Note that at
|
|
184
203
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
185
204
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
186
205
|
#
|
|
187
206
|
# @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
|
|
207
|
+
# 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
208
|
# @param include_all_scopes [::Boolean]
|
|
190
209
|
# 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
210
|
# @param max_results [::Integer]
|
|
@@ -198,6 +217,7 @@ module Google
|
|
|
198
217
|
# Project ID for this request.
|
|
199
218
|
# @param return_partial_success [::Boolean]
|
|
200
219
|
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
|
|
220
|
+
# @param service_project_number [::Integer]
|
|
201
221
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
202
222
|
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::CommitmentsScopedList>]
|
|
203
223
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
@@ -451,7 +471,7 @@ module Google
|
|
|
451
471
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
452
472
|
#
|
|
453
473
|
# @param filter [::String]
|
|
454
|
-
# 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
|
|
474
|
+
# 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.
|
|
455
475
|
# @param max_results [::Integer]
|
|
456
476
|
# 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`)
|
|
457
477
|
# @param order_by [::String]
|
|
@@ -651,9 +671,9 @@ module Google
|
|
|
651
671
|
# end
|
|
652
672
|
#
|
|
653
673
|
# @!attribute [rw] endpoint
|
|
654
|
-
#
|
|
655
|
-
#
|
|
656
|
-
# @return [::String]
|
|
674
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
|
675
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
|
676
|
+
# @return [::String,nil]
|
|
657
677
|
# @!attribute [rw] credentials
|
|
658
678
|
# Credentials to send with calls. You may provide any of the following types:
|
|
659
679
|
# * (`String`) The path to a service account key file in JSON format
|
|
@@ -690,13 +710,20 @@ module Google
|
|
|
690
710
|
# @!attribute [rw] quota_project
|
|
691
711
|
# A separate project against which to charge quota.
|
|
692
712
|
# @return [::String]
|
|
713
|
+
# @!attribute [rw] universe_domain
|
|
714
|
+
# The universe domain within which to make requests. This determines the
|
|
715
|
+
# default endpoint URL. The default value of nil uses the environment
|
|
716
|
+
# universe (usually the default "googleapis.com" universe).
|
|
717
|
+
# @return [::String,nil]
|
|
693
718
|
#
|
|
694
719
|
class Configuration
|
|
695
720
|
extend ::Gapic::Config
|
|
696
721
|
|
|
722
|
+
# @private
|
|
723
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
|
697
724
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
|
698
725
|
|
|
699
|
-
config_attr :endpoint,
|
|
726
|
+
config_attr :endpoint, nil, ::String, nil
|
|
700
727
|
config_attr :credentials, nil do |value|
|
|
701
728
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
|
702
729
|
allowed.any? { |klass| klass === value }
|
|
@@ -708,6 +735,7 @@ module Google
|
|
|
708
735
|
config_attr :metadata, nil, ::Hash, nil
|
|
709
736
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
710
737
|
config_attr :quota_project, nil, ::String, nil
|
|
738
|
+
config_attr :universe_domain, nil, ::String, nil
|
|
711
739
|
|
|
712
740
|
# @private
|
|
713
741
|
def initialize parent_config = nil
|
|
@@ -30,16 +30,28 @@ module Google
|
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
|
31
31
|
#
|
|
32
32
|
class ServiceStub
|
|
33
|
-
def initialize endpoint:, credentials:
|
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
|
34
34
|
# These require statements are intentionally placed here to initialize
|
|
35
35
|
# the REST modules only when it's required.
|
|
36
36
|
require "gapic/rest"
|
|
37
37
|
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
39
|
+
endpoint_template: endpoint_template,
|
|
40
|
+
universe_domain: universe_domain,
|
|
41
|
+
credentials: credentials,
|
|
39
42
|
numeric_enums: false,
|
|
40
43
|
raise_faraday_errors: false
|
|
41
44
|
end
|
|
42
45
|
|
|
46
|
+
##
|
|
47
|
+
# The effective universe domain
|
|
48
|
+
#
|
|
49
|
+
# @return [String]
|
|
50
|
+
#
|
|
51
|
+
def universe_domain
|
|
52
|
+
@client_stub.universe_domain
|
|
53
|
+
end
|
|
54
|
+
|
|
43
55
|
##
|
|
44
56
|
# Baseline implementation for the aggregated_list REST call
|
|
45
57
|
#
|
|
@@ -32,6 +32,9 @@ module Google
|
|
|
32
32
|
# The RegionDiskTypes API.
|
|
33
33
|
#
|
|
34
34
|
class Client
|
|
35
|
+
# @private
|
|
36
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
|
37
|
+
|
|
35
38
|
# @private
|
|
36
39
|
attr_reader :region_disk_types_stub
|
|
37
40
|
|
|
@@ -100,6 +103,15 @@ module Google
|
|
|
100
103
|
@config
|
|
101
104
|
end
|
|
102
105
|
|
|
106
|
+
##
|
|
107
|
+
# The effective universe domain
|
|
108
|
+
#
|
|
109
|
+
# @return [String]
|
|
110
|
+
#
|
|
111
|
+
def universe_domain
|
|
112
|
+
@region_disk_types_stub.universe_domain
|
|
113
|
+
end
|
|
114
|
+
|
|
103
115
|
##
|
|
104
116
|
# Create a new RegionDiskTypes REST client object.
|
|
105
117
|
#
|
|
@@ -127,8 +139,9 @@ module Google
|
|
|
127
139
|
credentials = @config.credentials
|
|
128
140
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
129
141
|
# but only if the default endpoint does not have a region prefix.
|
|
130
|
-
enable_self_signed_jwt = @config.endpoint
|
|
131
|
-
|
|
142
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
|
143
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
144
|
+
!@config.endpoint.split(".").first.include?("-"))
|
|
132
145
|
credentials ||= Credentials.default scope: @config.scope,
|
|
133
146
|
enable_self_signed_jwt: enable_self_signed_jwt
|
|
134
147
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
|
@@ -138,7 +151,12 @@ module Google
|
|
|
138
151
|
@quota_project_id = @config.quota_project
|
|
139
152
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
140
153
|
|
|
141
|
-
@region_disk_types_stub = ::Google::Cloud::Compute::V1::RegionDiskTypes::Rest::ServiceStub.new
|
|
154
|
+
@region_disk_types_stub = ::Google::Cloud::Compute::V1::RegionDiskTypes::Rest::ServiceStub.new(
|
|
155
|
+
endpoint: @config.endpoint,
|
|
156
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
|
157
|
+
universe_domain: @config.universe_domain,
|
|
158
|
+
credentials: credentials
|
|
159
|
+
)
|
|
142
160
|
end
|
|
143
161
|
|
|
144
162
|
# Service calls
|
|
@@ -244,7 +262,7 @@ module Google
|
|
|
244
262
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
245
263
|
#
|
|
246
264
|
# @param filter [::String]
|
|
247
|
-
# 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
|
|
265
|
+
# 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.
|
|
248
266
|
# @param max_results [::Integer]
|
|
249
267
|
# 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`)
|
|
250
268
|
# @param order_by [::String]
|
|
@@ -346,9 +364,9 @@ module Google
|
|
|
346
364
|
# end
|
|
347
365
|
#
|
|
348
366
|
# @!attribute [rw] endpoint
|
|
349
|
-
#
|
|
350
|
-
#
|
|
351
|
-
# @return [::String]
|
|
367
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
|
368
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
|
369
|
+
# @return [::String,nil]
|
|
352
370
|
# @!attribute [rw] credentials
|
|
353
371
|
# Credentials to send with calls. You may provide any of the following types:
|
|
354
372
|
# * (`String`) The path to a service account key file in JSON format
|
|
@@ -385,13 +403,20 @@ module Google
|
|
|
385
403
|
# @!attribute [rw] quota_project
|
|
386
404
|
# A separate project against which to charge quota.
|
|
387
405
|
# @return [::String]
|
|
406
|
+
# @!attribute [rw] universe_domain
|
|
407
|
+
# The universe domain within which to make requests. This determines the
|
|
408
|
+
# default endpoint URL. The default value of nil uses the environment
|
|
409
|
+
# universe (usually the default "googleapis.com" universe).
|
|
410
|
+
# @return [::String,nil]
|
|
388
411
|
#
|
|
389
412
|
class Configuration
|
|
390
413
|
extend ::Gapic::Config
|
|
391
414
|
|
|
415
|
+
# @private
|
|
416
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
|
392
417
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
|
393
418
|
|
|
394
|
-
config_attr :endpoint,
|
|
419
|
+
config_attr :endpoint, nil, ::String, nil
|
|
395
420
|
config_attr :credentials, nil do |value|
|
|
396
421
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
|
397
422
|
allowed.any? { |klass| klass === value }
|
|
@@ -403,6 +428,7 @@ module Google
|
|
|
403
428
|
config_attr :metadata, nil, ::Hash, nil
|
|
404
429
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
405
430
|
config_attr :quota_project, nil, ::String, nil
|
|
431
|
+
config_attr :universe_domain, nil, ::String, nil
|
|
406
432
|
|
|
407
433
|
# @private
|
|
408
434
|
def initialize parent_config = nil
|
|
@@ -30,16 +30,28 @@ module Google
|
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
|
31
31
|
#
|
|
32
32
|
class ServiceStub
|
|
33
|
-
def initialize endpoint:, credentials:
|
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
|
34
34
|
# These require statements are intentionally placed here to initialize
|
|
35
35
|
# the REST modules only when it's required.
|
|
36
36
|
require "gapic/rest"
|
|
37
37
|
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
|
39
|
+
endpoint_template: endpoint_template,
|
|
40
|
+
universe_domain: universe_domain,
|
|
41
|
+
credentials: credentials,
|
|
39
42
|
numeric_enums: false,
|
|
40
43
|
raise_faraday_errors: false
|
|
41
44
|
end
|
|
42
45
|
|
|
46
|
+
##
|
|
47
|
+
# The effective universe domain
|
|
48
|
+
#
|
|
49
|
+
# @return [String]
|
|
50
|
+
#
|
|
51
|
+
def universe_domain
|
|
52
|
+
@client_stub.universe_domain
|
|
53
|
+
end
|
|
54
|
+
|
|
43
55
|
##
|
|
44
56
|
# Baseline implementation for the get REST call
|
|
45
57
|
#
|