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 aggregated_list REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The TargetHttpsProxies API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :target_https_proxies_stub
|
38
41
|
|
@@ -122,6 +125,15 @@ module Google
|
|
122
125
|
@config
|
123
126
|
end
|
124
127
|
|
128
|
+
##
|
129
|
+
# The effective universe domain
|
130
|
+
#
|
131
|
+
# @return [String]
|
132
|
+
#
|
133
|
+
def universe_domain
|
134
|
+
@target_https_proxies_stub.universe_domain
|
135
|
+
end
|
136
|
+
|
125
137
|
##
|
126
138
|
# Create a new TargetHttpsProxies REST client object.
|
127
139
|
#
|
@@ -149,8 +161,9 @@ module Google
|
|
149
161
|
credentials = @config.credentials
|
150
162
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
151
163
|
# but only if the default endpoint does not have a region prefix.
|
152
|
-
enable_self_signed_jwt = @config.endpoint
|
153
|
-
|
164
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
165
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
166
|
+
!@config.endpoint.split(".").first.include?("-"))
|
154
167
|
credentials ||= Credentials.default scope: @config.scope,
|
155
168
|
enable_self_signed_jwt: enable_self_signed_jwt
|
156
169
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -164,9 +177,15 @@ module Google
|
|
164
177
|
config.credentials = credentials
|
165
178
|
config.quota_project = @quota_project_id
|
166
179
|
config.endpoint = @config.endpoint
|
180
|
+
config.universe_domain = @config.universe_domain
|
167
181
|
end
|
168
182
|
|
169
|
-
@target_https_proxies_stub = ::Google::Cloud::Compute::V1::TargetHttpsProxies::Rest::ServiceStub.new
|
183
|
+
@target_https_proxies_stub = ::Google::Cloud::Compute::V1::TargetHttpsProxies::Rest::ServiceStub.new(
|
184
|
+
endpoint: @config.endpoint,
|
185
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
186
|
+
universe_domain: @config.universe_domain,
|
187
|
+
credentials: credentials
|
188
|
+
)
|
170
189
|
end
|
171
190
|
|
172
191
|
##
|
@@ -1201,9 +1220,9 @@ module Google
|
|
1201
1220
|
# end
|
1202
1221
|
#
|
1203
1222
|
# @!attribute [rw] endpoint
|
1204
|
-
#
|
1205
|
-
#
|
1206
|
-
# @return [::String]
|
1223
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1224
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1225
|
+
# @return [::String,nil]
|
1207
1226
|
# @!attribute [rw] credentials
|
1208
1227
|
# Credentials to send with calls. You may provide any of the following types:
|
1209
1228
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1240,13 +1259,20 @@ module Google
|
|
1240
1259
|
# @!attribute [rw] quota_project
|
1241
1260
|
# A separate project against which to charge quota.
|
1242
1261
|
# @return [::String]
|
1262
|
+
# @!attribute [rw] universe_domain
|
1263
|
+
# The universe domain within which to make requests. This determines the
|
1264
|
+
# default endpoint URL. The default value of nil uses the environment
|
1265
|
+
# universe (usually the default "googleapis.com" universe).
|
1266
|
+
# @return [::String,nil]
|
1243
1267
|
#
|
1244
1268
|
class Configuration
|
1245
1269
|
extend ::Gapic::Config
|
1246
1270
|
|
1271
|
+
# @private
|
1272
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1247
1273
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
1248
1274
|
|
1249
|
-
config_attr :endpoint,
|
1275
|
+
config_attr :endpoint, nil, ::String, nil
|
1250
1276
|
config_attr :credentials, nil do |value|
|
1251
1277
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1252
1278
|
allowed.any? { |klass| klass === value }
|
@@ -1258,6 +1284,7 @@ module Google
|
|
1258
1284
|
config_attr :metadata, nil, ::Hash, nil
|
1259
1285
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1260
1286
|
config_attr :quota_project, nil, ::String, nil
|
1287
|
+
config_attr :universe_domain, nil, ::String, nil
|
1261
1288
|
|
1262
1289
|
# @private
|
1263
1290
|
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 aggregated_list REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The TargetInstances API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :target_instances_stub
|
38
41
|
|
@@ -112,6 +115,15 @@ module Google
|
|
112
115
|
@config
|
113
116
|
end
|
114
117
|
|
118
|
+
##
|
119
|
+
# The effective universe domain
|
120
|
+
#
|
121
|
+
# @return [String]
|
122
|
+
#
|
123
|
+
def universe_domain
|
124
|
+
@target_instances_stub.universe_domain
|
125
|
+
end
|
126
|
+
|
115
127
|
##
|
116
128
|
# Create a new TargetInstances REST client object.
|
117
129
|
#
|
@@ -139,8 +151,9 @@ module Google
|
|
139
151
|
credentials = @config.credentials
|
140
152
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
141
153
|
# but only if the default endpoint does not have a region prefix.
|
142
|
-
enable_self_signed_jwt = @config.endpoint
|
143
|
-
|
154
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
155
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
156
|
+
!@config.endpoint.split(".").first.include?("-"))
|
144
157
|
credentials ||= Credentials.default scope: @config.scope,
|
145
158
|
enable_self_signed_jwt: enable_self_signed_jwt
|
146
159
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -154,9 +167,15 @@ module Google
|
|
154
167
|
config.credentials = credentials
|
155
168
|
config.quota_project = @quota_project_id
|
156
169
|
config.endpoint = @config.endpoint
|
170
|
+
config.universe_domain = @config.universe_domain
|
157
171
|
end
|
158
172
|
|
159
|
-
@target_instances_stub = ::Google::Cloud::Compute::V1::TargetInstances::Rest::ServiceStub.new
|
173
|
+
@target_instances_stub = ::Google::Cloud::Compute::V1::TargetInstances::Rest::ServiceStub.new(
|
174
|
+
endpoint: @config.endpoint,
|
175
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
176
|
+
universe_domain: @config.universe_domain,
|
177
|
+
credentials: credentials
|
178
|
+
)
|
160
179
|
end
|
161
180
|
|
162
181
|
##
|
@@ -744,9 +763,9 @@ module Google
|
|
744
763
|
# end
|
745
764
|
#
|
746
765
|
# @!attribute [rw] endpoint
|
747
|
-
#
|
748
|
-
#
|
749
|
-
# @return [::String]
|
766
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
767
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
768
|
+
# @return [::String,nil]
|
750
769
|
# @!attribute [rw] credentials
|
751
770
|
# Credentials to send with calls. You may provide any of the following types:
|
752
771
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -783,13 +802,20 @@ module Google
|
|
783
802
|
# @!attribute [rw] quota_project
|
784
803
|
# A separate project against which to charge quota.
|
785
804
|
# @return [::String]
|
805
|
+
# @!attribute [rw] universe_domain
|
806
|
+
# The universe domain within which to make requests. This determines the
|
807
|
+
# default endpoint URL. The default value of nil uses the environment
|
808
|
+
# universe (usually the default "googleapis.com" universe).
|
809
|
+
# @return [::String,nil]
|
786
810
|
#
|
787
811
|
class Configuration
|
788
812
|
extend ::Gapic::Config
|
789
813
|
|
814
|
+
# @private
|
815
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
790
816
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
791
817
|
|
792
|
-
config_attr :endpoint,
|
818
|
+
config_attr :endpoint, nil, ::String, nil
|
793
819
|
config_attr :credentials, nil do |value|
|
794
820
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
795
821
|
allowed.any? { |klass| klass === value }
|
@@ -801,6 +827,7 @@ module Google
|
|
801
827
|
config_attr :metadata, nil, ::Hash, nil
|
802
828
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
803
829
|
config_attr :quota_project, nil, ::String, nil
|
830
|
+
config_attr :universe_domain, nil, ::String, nil
|
804
831
|
|
805
832
|
# @private
|
806
833
|
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 aggregated_list REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The TargetPools API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :target_pools_stub
|
38
41
|
|
@@ -124,6 +127,15 @@ module Google
|
|
124
127
|
@config
|
125
128
|
end
|
126
129
|
|
130
|
+
##
|
131
|
+
# The effective universe domain
|
132
|
+
#
|
133
|
+
# @return [String]
|
134
|
+
#
|
135
|
+
def universe_domain
|
136
|
+
@target_pools_stub.universe_domain
|
137
|
+
end
|
138
|
+
|
127
139
|
##
|
128
140
|
# Create a new TargetPools REST client object.
|
129
141
|
#
|
@@ -151,8 +163,9 @@ module Google
|
|
151
163
|
credentials = @config.credentials
|
152
164
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
153
165
|
# but only if the default endpoint does not have a region prefix.
|
154
|
-
enable_self_signed_jwt = @config.endpoint
|
155
|
-
|
166
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
167
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
168
|
+
!@config.endpoint.split(".").first.include?("-"))
|
156
169
|
credentials ||= Credentials.default scope: @config.scope,
|
157
170
|
enable_self_signed_jwt: enable_self_signed_jwt
|
158
171
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -166,9 +179,15 @@ module Google
|
|
166
179
|
config.credentials = credentials
|
167
180
|
config.quota_project = @quota_project_id
|
168
181
|
config.endpoint = @config.endpoint
|
182
|
+
config.universe_domain = @config.universe_domain
|
169
183
|
end
|
170
184
|
|
171
|
-
@target_pools_stub = ::Google::Cloud::Compute::V1::TargetPools::Rest::ServiceStub.new
|
185
|
+
@target_pools_stub = ::Google::Cloud::Compute::V1::TargetPools::Rest::ServiceStub.new(
|
186
|
+
endpoint: @config.endpoint,
|
187
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
188
|
+
universe_domain: @config.universe_domain,
|
189
|
+
credentials: credentials
|
190
|
+
)
|
172
191
|
end
|
173
192
|
|
174
193
|
##
|
@@ -1317,9 +1336,9 @@ module Google
|
|
1317
1336
|
# end
|
1318
1337
|
#
|
1319
1338
|
# @!attribute [rw] endpoint
|
1320
|
-
#
|
1321
|
-
#
|
1322
|
-
# @return [::String]
|
1339
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1340
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1341
|
+
# @return [::String,nil]
|
1323
1342
|
# @!attribute [rw] credentials
|
1324
1343
|
# Credentials to send with calls. You may provide any of the following types:
|
1325
1344
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1356,13 +1375,20 @@ module Google
|
|
1356
1375
|
# @!attribute [rw] quota_project
|
1357
1376
|
# A separate project against which to charge quota.
|
1358
1377
|
# @return [::String]
|
1378
|
+
# @!attribute [rw] universe_domain
|
1379
|
+
# The universe domain within which to make requests. This determines the
|
1380
|
+
# default endpoint URL. The default value of nil uses the environment
|
1381
|
+
# universe (usually the default "googleapis.com" universe).
|
1382
|
+
# @return [::String,nil]
|
1359
1383
|
#
|
1360
1384
|
class Configuration
|
1361
1385
|
extend ::Gapic::Config
|
1362
1386
|
|
1387
|
+
# @private
|
1388
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1363
1389
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
1364
1390
|
|
1365
|
-
config_attr :endpoint,
|
1391
|
+
config_attr :endpoint, nil, ::String, nil
|
1366
1392
|
config_attr :credentials, nil do |value|
|
1367
1393
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1368
1394
|
allowed.any? { |klass| klass === value }
|
@@ -1374,6 +1400,7 @@ module Google
|
|
1374
1400
|
config_attr :metadata, nil, ::Hash, nil
|
1375
1401
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1376
1402
|
config_attr :quota_project, nil, ::String, nil
|
1403
|
+
config_attr :universe_domain, nil, ::String, nil
|
1377
1404
|
|
1378
1405
|
# @private
|
1379
1406
|
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 add_health_check REST call
|
45
66
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The TargetSslProxies API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :target_ssl_proxies_stub
|
38
41
|
|
@@ -115,6 +118,15 @@ module Google
|
|
115
118
|
@config
|
116
119
|
end
|
117
120
|
|
121
|
+
##
|
122
|
+
# The effective universe domain
|
123
|
+
#
|
124
|
+
# @return [String]
|
125
|
+
#
|
126
|
+
def universe_domain
|
127
|
+
@target_ssl_proxies_stub.universe_domain
|
128
|
+
end
|
129
|
+
|
118
130
|
##
|
119
131
|
# Create a new TargetSslProxies REST client object.
|
120
132
|
#
|
@@ -142,8 +154,9 @@ module Google
|
|
142
154
|
credentials = @config.credentials
|
143
155
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
144
156
|
# but only if the default endpoint does not have a region prefix.
|
145
|
-
enable_self_signed_jwt = @config.endpoint
|
146
|
-
|
157
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
158
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
159
|
+
!@config.endpoint.split(".").first.include?("-"))
|
147
160
|
credentials ||= Credentials.default scope: @config.scope,
|
148
161
|
enable_self_signed_jwt: enable_self_signed_jwt
|
149
162
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -157,9 +170,15 @@ module Google
|
|
157
170
|
config.credentials = credentials
|
158
171
|
config.quota_project = @quota_project_id
|
159
172
|
config.endpoint = @config.endpoint
|
173
|
+
config.universe_domain = @config.universe_domain
|
160
174
|
end
|
161
175
|
|
162
|
-
@target_ssl_proxies_stub = ::Google::Cloud::Compute::V1::TargetSslProxies::Rest::ServiceStub.new
|
176
|
+
@target_ssl_proxies_stub = ::Google::Cloud::Compute::V1::TargetSslProxies::Rest::ServiceStub.new(
|
177
|
+
endpoint: @config.endpoint,
|
178
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
179
|
+
universe_domain: @config.universe_domain,
|
180
|
+
credentials: credentials
|
181
|
+
)
|
163
182
|
end
|
164
183
|
|
165
184
|
##
|
@@ -1010,9 +1029,9 @@ module Google
|
|
1010
1029
|
# end
|
1011
1030
|
#
|
1012
1031
|
# @!attribute [rw] endpoint
|
1013
|
-
#
|
1014
|
-
#
|
1015
|
-
# @return [::String]
|
1032
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1033
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1034
|
+
# @return [::String,nil]
|
1016
1035
|
# @!attribute [rw] credentials
|
1017
1036
|
# Credentials to send with calls. You may provide any of the following types:
|
1018
1037
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1049,13 +1068,20 @@ module Google
|
|
1049
1068
|
# @!attribute [rw] quota_project
|
1050
1069
|
# A separate project against which to charge quota.
|
1051
1070
|
# @return [::String]
|
1071
|
+
# @!attribute [rw] universe_domain
|
1072
|
+
# The universe domain within which to make requests. This determines the
|
1073
|
+
# default endpoint URL. The default value of nil uses the environment
|
1074
|
+
# universe (usually the default "googleapis.com" universe).
|
1075
|
+
# @return [::String,nil]
|
1052
1076
|
#
|
1053
1077
|
class Configuration
|
1054
1078
|
extend ::Gapic::Config
|
1055
1079
|
|
1080
|
+
# @private
|
1081
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1056
1082
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
1057
1083
|
|
1058
|
-
config_attr :endpoint,
|
1084
|
+
config_attr :endpoint, nil, ::String, nil
|
1059
1085
|
config_attr :credentials, nil do |value|
|
1060
1086
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1061
1087
|
allowed.any? { |klass| klass === value }
|
@@ -1067,6 +1093,7 @@ module Google
|
|
1067
1093
|
config_attr :metadata, nil, ::Hash, nil
|
1068
1094
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1069
1095
|
config_attr :quota_project, nil, ::String, nil
|
1096
|
+
config_attr :universe_domain, nil, ::String, nil
|
1070
1097
|
|
1071
1098
|
# @private
|
1072
1099
|
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
|
#
|