google-cloud-compute-v1 2.6.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +23 -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 +23 -2
- data/lib/google/cloud/compute/v1/images/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +23 -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 +23 -2
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +23 -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 +23 -2
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +23 -2
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +23 -2
- data/proto_docs/google/api/client.rb +1 -0
- metadata +5 -5
@@ -30,16 +30,37 @@ 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
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
43
64
|
##
|
44
65
|
# Baseline implementation for the delete REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The RegionTargetHttpProxies 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_target_http_proxies_stub
|
38
41
|
|
@@ -107,6 +110,15 @@ module Google
|
|
107
110
|
@config
|
108
111
|
end
|
109
112
|
|
113
|
+
##
|
114
|
+
# The effective universe domain
|
115
|
+
#
|
116
|
+
# @return [String]
|
117
|
+
#
|
118
|
+
def universe_domain
|
119
|
+
@region_target_http_proxies_stub.universe_domain
|
120
|
+
end
|
121
|
+
|
110
122
|
##
|
111
123
|
# Create a new RegionTargetHttpProxies REST client object.
|
112
124
|
#
|
@@ -134,8 +146,9 @@ module Google
|
|
134
146
|
credentials = @config.credentials
|
135
147
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
136
148
|
# but only if the default endpoint does not have a region prefix.
|
137
|
-
enable_self_signed_jwt = @config.endpoint
|
138
|
-
|
149
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
150
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
151
|
+
!@config.endpoint.split(".").first.include?("-"))
|
139
152
|
credentials ||= Credentials.default scope: @config.scope,
|
140
153
|
enable_self_signed_jwt: enable_self_signed_jwt
|
141
154
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -149,9 +162,15 @@ module Google
|
|
149
162
|
config.credentials = credentials
|
150
163
|
config.quota_project = @quota_project_id
|
151
164
|
config.endpoint = @config.endpoint
|
165
|
+
config.universe_domain = @config.universe_domain
|
152
166
|
end
|
153
167
|
|
154
|
-
@region_target_http_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::ServiceStub.new
|
168
|
+
@region_target_http_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::ServiceStub.new(
|
169
|
+
endpoint: @config.endpoint,
|
170
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
171
|
+
universe_domain: @config.universe_domain,
|
172
|
+
credentials: credentials
|
173
|
+
)
|
155
174
|
end
|
156
175
|
|
157
176
|
##
|
@@ -647,9 +666,9 @@ module Google
|
|
647
666
|
# end
|
648
667
|
#
|
649
668
|
# @!attribute [rw] endpoint
|
650
|
-
#
|
651
|
-
#
|
652
|
-
# @return [::String]
|
669
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
670
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
671
|
+
# @return [::String,nil]
|
653
672
|
# @!attribute [rw] credentials
|
654
673
|
# Credentials to send with calls. You may provide any of the following types:
|
655
674
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -686,13 +705,20 @@ module Google
|
|
686
705
|
# @!attribute [rw] quota_project
|
687
706
|
# A separate project against which to charge quota.
|
688
707
|
# @return [::String]
|
708
|
+
# @!attribute [rw] universe_domain
|
709
|
+
# The universe domain within which to make requests. This determines the
|
710
|
+
# default endpoint URL. The default value of nil uses the environment
|
711
|
+
# universe (usually the default "googleapis.com" universe).
|
712
|
+
# @return [::String,nil]
|
689
713
|
#
|
690
714
|
class Configuration
|
691
715
|
extend ::Gapic::Config
|
692
716
|
|
717
|
+
# @private
|
718
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
693
719
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
694
720
|
|
695
|
-
config_attr :endpoint,
|
721
|
+
config_attr :endpoint, nil, ::String, nil
|
696
722
|
config_attr :credentials, nil do |value|
|
697
723
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
698
724
|
allowed.any? { |klass| klass === value }
|
@@ -704,6 +730,7 @@ module Google
|
|
704
730
|
config_attr :metadata, nil, ::Hash, nil
|
705
731
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
706
732
|
config_attr :quota_project, nil, ::String, nil
|
733
|
+
config_attr :universe_domain, nil, ::String, nil
|
707
734
|
|
708
735
|
# @private
|
709
736
|
def initialize parent_config = nil
|
@@ -30,16 +30,37 @@ 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
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
43
64
|
##
|
44
65
|
# Baseline implementation for the delete REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The RegionTargetHttpsProxies 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_target_https_proxies_stub
|
38
41
|
|
@@ -111,6 +114,15 @@ module Google
|
|
111
114
|
@config
|
112
115
|
end
|
113
116
|
|
117
|
+
##
|
118
|
+
# The effective universe domain
|
119
|
+
#
|
120
|
+
# @return [String]
|
121
|
+
#
|
122
|
+
def universe_domain
|
123
|
+
@region_target_https_proxies_stub.universe_domain
|
124
|
+
end
|
125
|
+
|
114
126
|
##
|
115
127
|
# Create a new RegionTargetHttpsProxies REST client object.
|
116
128
|
#
|
@@ -138,8 +150,9 @@ module Google
|
|
138
150
|
credentials = @config.credentials
|
139
151
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
140
152
|
# but only if the default endpoint does not have a region prefix.
|
141
|
-
enable_self_signed_jwt = @config.endpoint
|
142
|
-
|
153
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
154
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
155
|
+
!@config.endpoint.split(".").first.include?("-"))
|
143
156
|
credentials ||= Credentials.default scope: @config.scope,
|
144
157
|
enable_self_signed_jwt: enable_self_signed_jwt
|
145
158
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -153,9 +166,15 @@ module Google
|
|
153
166
|
config.credentials = credentials
|
154
167
|
config.quota_project = @quota_project_id
|
155
168
|
config.endpoint = @config.endpoint
|
169
|
+
config.universe_domain = @config.universe_domain
|
156
170
|
end
|
157
171
|
|
158
|
-
@region_target_https_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetHttpsProxies::Rest::ServiceStub.new
|
172
|
+
@region_target_https_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetHttpsProxies::Rest::ServiceStub.new(
|
173
|
+
endpoint: @config.endpoint,
|
174
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
175
|
+
universe_domain: @config.universe_domain,
|
176
|
+
credentials: credentials
|
177
|
+
)
|
159
178
|
end
|
160
179
|
|
161
180
|
##
|
@@ -841,9 +860,9 @@ module Google
|
|
841
860
|
# end
|
842
861
|
#
|
843
862
|
# @!attribute [rw] endpoint
|
844
|
-
#
|
845
|
-
#
|
846
|
-
# @return [::String]
|
863
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
864
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
865
|
+
# @return [::String,nil]
|
847
866
|
# @!attribute [rw] credentials
|
848
867
|
# Credentials to send with calls. You may provide any of the following types:
|
849
868
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -880,13 +899,20 @@ module Google
|
|
880
899
|
# @!attribute [rw] quota_project
|
881
900
|
# A separate project against which to charge quota.
|
882
901
|
# @return [::String]
|
902
|
+
# @!attribute [rw] universe_domain
|
903
|
+
# The universe domain within which to make requests. This determines the
|
904
|
+
# default endpoint URL. The default value of nil uses the environment
|
905
|
+
# universe (usually the default "googleapis.com" universe).
|
906
|
+
# @return [::String,nil]
|
883
907
|
#
|
884
908
|
class Configuration
|
885
909
|
extend ::Gapic::Config
|
886
910
|
|
911
|
+
# @private
|
912
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
887
913
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
888
914
|
|
889
|
-
config_attr :endpoint,
|
915
|
+
config_attr :endpoint, nil, ::String, nil
|
890
916
|
config_attr :credentials, nil do |value|
|
891
917
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
892
918
|
allowed.any? { |klass| klass === value }
|
@@ -898,6 +924,7 @@ module Google
|
|
898
924
|
config_attr :metadata, nil, ::Hash, nil
|
899
925
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
900
926
|
config_attr :quota_project, nil, ::String, nil
|
927
|
+
config_attr :universe_domain, nil, ::String, nil
|
901
928
|
|
902
929
|
# @private
|
903
930
|
def initialize parent_config = nil
|
@@ -30,16 +30,37 @@ 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
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
43
64
|
##
|
44
65
|
# Baseline implementation for the delete REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The RegionTargetTcpProxies 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_target_tcp_proxies_stub
|
38
41
|
|
@@ -105,6 +108,15 @@ module Google
|
|
105
108
|
@config
|
106
109
|
end
|
107
110
|
|
111
|
+
##
|
112
|
+
# The effective universe domain
|
113
|
+
#
|
114
|
+
# @return [String]
|
115
|
+
#
|
116
|
+
def universe_domain
|
117
|
+
@region_target_tcp_proxies_stub.universe_domain
|
118
|
+
end
|
119
|
+
|
108
120
|
##
|
109
121
|
# Create a new RegionTargetTcpProxies REST client object.
|
110
122
|
#
|
@@ -132,8 +144,9 @@ module Google
|
|
132
144
|
credentials = @config.credentials
|
133
145
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
134
146
|
# but only if the default endpoint does not have a region prefix.
|
135
|
-
enable_self_signed_jwt = @config.endpoint
|
136
|
-
|
147
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
148
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
149
|
+
!@config.endpoint.split(".").first.include?("-"))
|
137
150
|
credentials ||= Credentials.default scope: @config.scope,
|
138
151
|
enable_self_signed_jwt: enable_self_signed_jwt
|
139
152
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -147,9 +160,15 @@ module Google
|
|
147
160
|
config.credentials = credentials
|
148
161
|
config.quota_project = @quota_project_id
|
149
162
|
config.endpoint = @config.endpoint
|
163
|
+
config.universe_domain = @config.universe_domain
|
150
164
|
end
|
151
165
|
|
152
|
-
@region_target_tcp_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::ServiceStub.new
|
166
|
+
@region_target_tcp_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetTcpProxies::Rest::ServiceStub.new(
|
167
|
+
endpoint: @config.endpoint,
|
168
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
169
|
+
universe_domain: @config.universe_domain,
|
170
|
+
credentials: credentials
|
171
|
+
)
|
153
172
|
end
|
154
173
|
|
155
174
|
##
|
@@ -550,9 +569,9 @@ module Google
|
|
550
569
|
# end
|
551
570
|
#
|
552
571
|
# @!attribute [rw] endpoint
|
553
|
-
#
|
554
|
-
#
|
555
|
-
# @return [::String]
|
572
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
573
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
574
|
+
# @return [::String,nil]
|
556
575
|
# @!attribute [rw] credentials
|
557
576
|
# Credentials to send with calls. You may provide any of the following types:
|
558
577
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -589,13 +608,20 @@ module Google
|
|
589
608
|
# @!attribute [rw] quota_project
|
590
609
|
# A separate project against which to charge quota.
|
591
610
|
# @return [::String]
|
611
|
+
# @!attribute [rw] universe_domain
|
612
|
+
# The universe domain within which to make requests. This determines the
|
613
|
+
# default endpoint URL. The default value of nil uses the environment
|
614
|
+
# universe (usually the default "googleapis.com" universe).
|
615
|
+
# @return [::String,nil]
|
592
616
|
#
|
593
617
|
class Configuration
|
594
618
|
extend ::Gapic::Config
|
595
619
|
|
620
|
+
# @private
|
621
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
596
622
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
597
623
|
|
598
|
-
config_attr :endpoint,
|
624
|
+
config_attr :endpoint, nil, ::String, nil
|
599
625
|
config_attr :credentials, nil do |value|
|
600
626
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
601
627
|
allowed.any? { |klass| klass === value }
|
@@ -607,6 +633,7 @@ module Google
|
|
607
633
|
config_attr :metadata, nil, ::Hash, nil
|
608
634
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
609
635
|
config_attr :quota_project, nil, ::String, nil
|
636
|
+
config_attr :universe_domain, nil, ::String, nil
|
610
637
|
|
611
638
|
# @private
|
612
639
|
def initialize parent_config = nil
|
@@ -30,16 +30,37 @@ 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
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
43
64
|
##
|
44
65
|
# Baseline implementation for the delete REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The RegionUrlMaps 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_url_maps_stub
|
38
41
|
|
@@ -111,6 +114,15 @@ module Google
|
|
111
114
|
@config
|
112
115
|
end
|
113
116
|
|
117
|
+
##
|
118
|
+
# The effective universe domain
|
119
|
+
#
|
120
|
+
# @return [String]
|
121
|
+
#
|
122
|
+
def universe_domain
|
123
|
+
@region_url_maps_stub.universe_domain
|
124
|
+
end
|
125
|
+
|
114
126
|
##
|
115
127
|
# Create a new RegionUrlMaps REST client object.
|
116
128
|
#
|
@@ -138,8 +150,9 @@ module Google
|
|
138
150
|
credentials = @config.credentials
|
139
151
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
140
152
|
# but only if the default endpoint does not have a region prefix.
|
141
|
-
enable_self_signed_jwt = @config.endpoint
|
142
|
-
|
153
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
154
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
155
|
+
!@config.endpoint.split(".").first.include?("-"))
|
143
156
|
credentials ||= Credentials.default scope: @config.scope,
|
144
157
|
enable_self_signed_jwt: enable_self_signed_jwt
|
145
158
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -153,9 +166,15 @@ module Google
|
|
153
166
|
config.credentials = credentials
|
154
167
|
config.quota_project = @quota_project_id
|
155
168
|
config.endpoint = @config.endpoint
|
169
|
+
config.universe_domain = @config.universe_domain
|
156
170
|
end
|
157
171
|
|
158
|
-
@region_url_maps_stub = ::Google::Cloud::Compute::V1::RegionUrlMaps::Rest::ServiceStub.new
|
172
|
+
@region_url_maps_stub = ::Google::Cloud::Compute::V1::RegionUrlMaps::Rest::ServiceStub.new(
|
173
|
+
endpoint: @config.endpoint,
|
174
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
175
|
+
universe_domain: @config.universe_domain,
|
176
|
+
credentials: credentials
|
177
|
+
)
|
159
178
|
end
|
160
179
|
|
161
180
|
##
|
@@ -830,9 +849,9 @@ module Google
|
|
830
849
|
# end
|
831
850
|
#
|
832
851
|
# @!attribute [rw] endpoint
|
833
|
-
#
|
834
|
-
#
|
835
|
-
# @return [::String]
|
852
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
853
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
854
|
+
# @return [::String,nil]
|
836
855
|
# @!attribute [rw] credentials
|
837
856
|
# Credentials to send with calls. You may provide any of the following types:
|
838
857
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -869,13 +888,20 @@ module Google
|
|
869
888
|
# @!attribute [rw] quota_project
|
870
889
|
# A separate project against which to charge quota.
|
871
890
|
# @return [::String]
|
891
|
+
# @!attribute [rw] universe_domain
|
892
|
+
# The universe domain within which to make requests. This determines the
|
893
|
+
# default endpoint URL. The default value of nil uses the environment
|
894
|
+
# universe (usually the default "googleapis.com" universe).
|
895
|
+
# @return [::String,nil]
|
872
896
|
#
|
873
897
|
class Configuration
|
874
898
|
extend ::Gapic::Config
|
875
899
|
|
900
|
+
# @private
|
901
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
876
902
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
877
903
|
|
878
|
-
config_attr :endpoint,
|
904
|
+
config_attr :endpoint, nil, ::String, nil
|
879
905
|
config_attr :credentials, nil do |value|
|
880
906
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
881
907
|
allowed.any? { |klass| klass === value }
|
@@ -887,6 +913,7 @@ module Google
|
|
887
913
|
config_attr :metadata, nil, ::Hash, nil
|
888
914
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
889
915
|
config_attr :quota_project, nil, ::String, nil
|
916
|
+
config_attr :universe_domain, nil, ::String, nil
|
890
917
|
|
891
918
|
# @private
|
892
919
|
def initialize parent_config = nil
|
@@ -30,16 +30,37 @@ 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
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
43
64
|
##
|
44
65
|
# Baseline implementation for the delete REST call
|
45
66
|
#
|