google-cloud-compute-v1 2.5.0 → 2.7.0
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 +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 add_association REST call
|
45
57
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The Firewalls API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :firewalls_stub
|
38
41
|
|
@@ -109,6 +112,15 @@ module Google
|
|
109
112
|
@config
|
110
113
|
end
|
111
114
|
|
115
|
+
##
|
116
|
+
# The effective universe domain
|
117
|
+
#
|
118
|
+
# @return [String]
|
119
|
+
#
|
120
|
+
def universe_domain
|
121
|
+
@firewalls_stub.universe_domain
|
122
|
+
end
|
123
|
+
|
112
124
|
##
|
113
125
|
# Create a new Firewalls REST client object.
|
114
126
|
#
|
@@ -136,8 +148,9 @@ module Google
|
|
136
148
|
credentials = @config.credentials
|
137
149
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
138
150
|
# but only if the default endpoint does not have a region prefix.
|
139
|
-
enable_self_signed_jwt = @config.endpoint
|
140
|
-
|
151
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
152
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
153
|
+
!@config.endpoint.split(".").first.include?("-"))
|
141
154
|
credentials ||= Credentials.default scope: @config.scope,
|
142
155
|
enable_self_signed_jwt: enable_self_signed_jwt
|
143
156
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -151,9 +164,15 @@ module Google
|
|
151
164
|
config.credentials = credentials
|
152
165
|
config.quota_project = @quota_project_id
|
153
166
|
config.endpoint = @config.endpoint
|
167
|
+
config.universe_domain = @config.universe_domain
|
154
168
|
end
|
155
169
|
|
156
|
-
@firewalls_stub = ::Google::Cloud::Compute::V1::Firewalls::Rest::ServiceStub.new
|
170
|
+
@firewalls_stub = ::Google::Cloud::Compute::V1::Firewalls::Rest::ServiceStub.new(
|
171
|
+
endpoint: @config.endpoint,
|
172
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
173
|
+
universe_domain: @config.universe_domain,
|
174
|
+
credentials: credentials
|
175
|
+
)
|
157
176
|
end
|
158
177
|
|
159
178
|
##
|
@@ -444,7 +463,7 @@ module Google
|
|
444
463
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
445
464
|
#
|
446
465
|
# @param filter [::String]
|
447
|
-
# 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
|
466
|
+
# 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.
|
448
467
|
# @param max_results [::Integer]
|
449
468
|
# 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`)
|
450
469
|
# @param order_by [::String]
|
@@ -728,9 +747,9 @@ module Google
|
|
728
747
|
# end
|
729
748
|
#
|
730
749
|
# @!attribute [rw] endpoint
|
731
|
-
#
|
732
|
-
#
|
733
|
-
# @return [::String]
|
750
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
751
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
752
|
+
# @return [::String,nil]
|
734
753
|
# @!attribute [rw] credentials
|
735
754
|
# Credentials to send with calls. You may provide any of the following types:
|
736
755
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -767,13 +786,20 @@ module Google
|
|
767
786
|
# @!attribute [rw] quota_project
|
768
787
|
# A separate project against which to charge quota.
|
769
788
|
# @return [::String]
|
789
|
+
# @!attribute [rw] universe_domain
|
790
|
+
# The universe domain within which to make requests. This determines the
|
791
|
+
# default endpoint URL. The default value of nil uses the environment
|
792
|
+
# universe (usually the default "googleapis.com" universe).
|
793
|
+
# @return [::String,nil]
|
770
794
|
#
|
771
795
|
class Configuration
|
772
796
|
extend ::Gapic::Config
|
773
797
|
|
798
|
+
# @private
|
799
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
774
800
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
775
801
|
|
776
|
-
config_attr :endpoint,
|
802
|
+
config_attr :endpoint, nil, ::String, nil
|
777
803
|
config_attr :credentials, nil do |value|
|
778
804
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
779
805
|
allowed.any? { |klass| klass === value }
|
@@ -785,6 +811,7 @@ module Google
|
|
785
811
|
config_attr :metadata, nil, ::Hash, nil
|
786
812
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
787
813
|
config_attr :quota_project, nil, ::String, nil
|
814
|
+
config_attr :universe_domain, nil, ::String, nil
|
788
815
|
|
789
816
|
# @private
|
790
817
|
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 delete REST call
|
45
57
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The ForwardingRules API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :forwarding_rules_stub
|
38
41
|
|
@@ -116,6 +119,15 @@ module Google
|
|
116
119
|
@config
|
117
120
|
end
|
118
121
|
|
122
|
+
##
|
123
|
+
# The effective universe domain
|
124
|
+
#
|
125
|
+
# @return [String]
|
126
|
+
#
|
127
|
+
def universe_domain
|
128
|
+
@forwarding_rules_stub.universe_domain
|
129
|
+
end
|
130
|
+
|
119
131
|
##
|
120
132
|
# Create a new ForwardingRules REST client object.
|
121
133
|
#
|
@@ -143,8 +155,9 @@ module Google
|
|
143
155
|
credentials = @config.credentials
|
144
156
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
145
157
|
# but only if the default endpoint does not have a region prefix.
|
146
|
-
enable_self_signed_jwt = @config.endpoint
|
147
|
-
|
158
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
159
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
160
|
+
!@config.endpoint.split(".").first.include?("-"))
|
148
161
|
credentials ||= Credentials.default scope: @config.scope,
|
149
162
|
enable_self_signed_jwt: enable_self_signed_jwt
|
150
163
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -158,9 +171,15 @@ module Google
|
|
158
171
|
config.credentials = credentials
|
159
172
|
config.quota_project = @quota_project_id
|
160
173
|
config.endpoint = @config.endpoint
|
174
|
+
config.universe_domain = @config.universe_domain
|
161
175
|
end
|
162
176
|
|
163
|
-
@forwarding_rules_stub = ::Google::Cloud::Compute::V1::ForwardingRules::Rest::ServiceStub.new
|
177
|
+
@forwarding_rules_stub = ::Google::Cloud::Compute::V1::ForwardingRules::Rest::ServiceStub.new(
|
178
|
+
endpoint: @config.endpoint,
|
179
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
180
|
+
universe_domain: @config.universe_domain,
|
181
|
+
credentials: credentials
|
182
|
+
)
|
164
183
|
end
|
165
184
|
|
166
185
|
##
|
@@ -185,13 +204,13 @@ module Google
|
|
185
204
|
# @param options [::Gapic::CallOptions, ::Hash]
|
186
205
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
187
206
|
#
|
188
|
-
# @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
|
207
|
+
# @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)
|
189
208
|
# Pass arguments to `aggregated_list` via keyword arguments. Note that at
|
190
209
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
191
210
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
192
211
|
#
|
193
212
|
# @param filter [::String]
|
194
|
-
# 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
|
213
|
+
# 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.
|
195
214
|
# @param include_all_scopes [::Boolean]
|
196
215
|
# 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.
|
197
216
|
# @param max_results [::Integer]
|
@@ -204,6 +223,7 @@ module Google
|
|
204
223
|
# Project ID for this request.
|
205
224
|
# @param return_partial_success [::Boolean]
|
206
225
|
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
|
226
|
+
# @param service_project_number [::Integer]
|
207
227
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
208
228
|
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::ForwardingRulesScopedList>]
|
209
229
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -550,7 +570,7 @@ module Google
|
|
550
570
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
551
571
|
#
|
552
572
|
# @param filter [::String]
|
553
|
-
# 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
|
573
|
+
# 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.
|
554
574
|
# @param max_results [::Integer]
|
555
575
|
# 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`)
|
556
576
|
# @param order_by [::String]
|
@@ -937,9 +957,9 @@ module Google
|
|
937
957
|
# end
|
938
958
|
#
|
939
959
|
# @!attribute [rw] endpoint
|
940
|
-
#
|
941
|
-
#
|
942
|
-
# @return [::String]
|
960
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
961
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
962
|
+
# @return [::String,nil]
|
943
963
|
# @!attribute [rw] credentials
|
944
964
|
# Credentials to send with calls. You may provide any of the following types:
|
945
965
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -976,13 +996,20 @@ module Google
|
|
976
996
|
# @!attribute [rw] quota_project
|
977
997
|
# A separate project against which to charge quota.
|
978
998
|
# @return [::String]
|
999
|
+
# @!attribute [rw] universe_domain
|
1000
|
+
# The universe domain within which to make requests. This determines the
|
1001
|
+
# default endpoint URL. The default value of nil uses the environment
|
1002
|
+
# universe (usually the default "googleapis.com" universe).
|
1003
|
+
# @return [::String,nil]
|
979
1004
|
#
|
980
1005
|
class Configuration
|
981
1006
|
extend ::Gapic::Config
|
982
1007
|
|
1008
|
+
# @private
|
1009
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
983
1010
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
984
1011
|
|
985
|
-
config_attr :endpoint,
|
1012
|
+
config_attr :endpoint, nil, ::String, nil
|
986
1013
|
config_attr :credentials, nil do |value|
|
987
1014
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
988
1015
|
allowed.any? { |klass| klass === value }
|
@@ -994,6 +1021,7 @@ module Google
|
|
994
1021
|
config_attr :metadata, nil, ::Hash, nil
|
995
1022
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
996
1023
|
config_attr :quota_project, nil, ::String, nil
|
1024
|
+
config_attr :universe_domain, nil, ::String, nil
|
997
1025
|
|
998
1026
|
# @private
|
999
1027
|
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
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The GlobalAddresses API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :global_addresses_stub
|
38
41
|
|
@@ -109,6 +112,15 @@ module Google
|
|
109
112
|
@config
|
110
113
|
end
|
111
114
|
|
115
|
+
##
|
116
|
+
# The effective universe domain
|
117
|
+
#
|
118
|
+
# @return [String]
|
119
|
+
#
|
120
|
+
def universe_domain
|
121
|
+
@global_addresses_stub.universe_domain
|
122
|
+
end
|
123
|
+
|
112
124
|
##
|
113
125
|
# Create a new GlobalAddresses REST client object.
|
114
126
|
#
|
@@ -136,8 +148,9 @@ module Google
|
|
136
148
|
credentials = @config.credentials
|
137
149
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
138
150
|
# but only if the default endpoint does not have a region prefix.
|
139
|
-
enable_self_signed_jwt = @config.endpoint
|
140
|
-
|
151
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
152
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
153
|
+
!@config.endpoint.split(".").first.include?("-"))
|
141
154
|
credentials ||= Credentials.default scope: @config.scope,
|
142
155
|
enable_self_signed_jwt: enable_self_signed_jwt
|
143
156
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -151,9 +164,15 @@ module Google
|
|
151
164
|
config.credentials = credentials
|
152
165
|
config.quota_project = @quota_project_id
|
153
166
|
config.endpoint = @config.endpoint
|
167
|
+
config.universe_domain = @config.universe_domain
|
154
168
|
end
|
155
169
|
|
156
|
-
@global_addresses_stub = ::Google::Cloud::Compute::V1::GlobalAddresses::Rest::ServiceStub.new
|
170
|
+
@global_addresses_stub = ::Google::Cloud::Compute::V1::GlobalAddresses::Rest::ServiceStub.new(
|
171
|
+
endpoint: @config.endpoint,
|
172
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
173
|
+
universe_domain: @config.universe_domain,
|
174
|
+
credentials: credentials
|
175
|
+
)
|
157
176
|
end
|
158
177
|
|
159
178
|
##
|
@@ -444,7 +463,7 @@ module Google
|
|
444
463
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
445
464
|
#
|
446
465
|
# @param filter [::String]
|
447
|
-
# 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
|
466
|
+
# 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.
|
448
467
|
# @param max_results [::Integer]
|
449
468
|
# 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`)
|
450
469
|
# @param order_by [::String]
|
@@ -726,9 +745,9 @@ module Google
|
|
726
745
|
# end
|
727
746
|
#
|
728
747
|
# @!attribute [rw] endpoint
|
729
|
-
#
|
730
|
-
#
|
731
|
-
# @return [::String]
|
748
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
749
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
750
|
+
# @return [::String,nil]
|
732
751
|
# @!attribute [rw] credentials
|
733
752
|
# Credentials to send with calls. You may provide any of the following types:
|
734
753
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -765,13 +784,20 @@ module Google
|
|
765
784
|
# @!attribute [rw] quota_project
|
766
785
|
# A separate project against which to charge quota.
|
767
786
|
# @return [::String]
|
787
|
+
# @!attribute [rw] universe_domain
|
788
|
+
# The universe domain within which to make requests. This determines the
|
789
|
+
# default endpoint URL. The default value of nil uses the environment
|
790
|
+
# universe (usually the default "googleapis.com" universe).
|
791
|
+
# @return [::String,nil]
|
768
792
|
#
|
769
793
|
class Configuration
|
770
794
|
extend ::Gapic::Config
|
771
795
|
|
796
|
+
# @private
|
797
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
772
798
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
773
799
|
|
774
|
-
config_attr :endpoint,
|
800
|
+
config_attr :endpoint, nil, ::String, nil
|
775
801
|
config_attr :credentials, nil do |value|
|
776
802
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
777
803
|
allowed.any? { |klass| klass === value }
|
@@ -783,6 +809,7 @@ module Google
|
|
783
809
|
config_attr :metadata, nil, ::Hash, nil
|
784
810
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
785
811
|
config_attr :quota_project, nil, ::String, nil
|
812
|
+
config_attr :universe_domain, nil, ::String, nil
|
786
813
|
|
787
814
|
# @private
|
788
815
|
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 delete REST call
|
45
57
|
#
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The GlobalForwardingRules API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :global_forwarding_rules_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
|
+
@global_forwarding_rules_stub.universe_domain
|
124
|
+
end
|
125
|
+
|
114
126
|
##
|
115
127
|
# Create a new GlobalForwardingRules 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
|
-
@global_forwarding_rules_stub = ::Google::Cloud::Compute::V1::GlobalForwardingRules::Rest::ServiceStub.new
|
172
|
+
@global_forwarding_rules_stub = ::Google::Cloud::Compute::V1::GlobalForwardingRules::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
|
##
|
@@ -446,7 +465,7 @@ module Google
|
|
446
465
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
447
466
|
#
|
448
467
|
# @param filter [::String]
|
449
|
-
# 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
|
468
|
+
# 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.
|
450
469
|
# @param max_results [::Integer]
|
451
470
|
# 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`)
|
452
471
|
# @param order_by [::String]
|
@@ -820,9 +839,9 @@ module Google
|
|
820
839
|
# end
|
821
840
|
#
|
822
841
|
# @!attribute [rw] endpoint
|
823
|
-
#
|
824
|
-
#
|
825
|
-
# @return [::String]
|
842
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
843
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
844
|
+
# @return [::String,nil]
|
826
845
|
# @!attribute [rw] credentials
|
827
846
|
# Credentials to send with calls. You may provide any of the following types:
|
828
847
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -859,13 +878,20 @@ module Google
|
|
859
878
|
# @!attribute [rw] quota_project
|
860
879
|
# A separate project against which to charge quota.
|
861
880
|
# @return [::String]
|
881
|
+
# @!attribute [rw] universe_domain
|
882
|
+
# The universe domain within which to make requests. This determines the
|
883
|
+
# default endpoint URL. The default value of nil uses the environment
|
884
|
+
# universe (usually the default "googleapis.com" universe).
|
885
|
+
# @return [::String,nil]
|
862
886
|
#
|
863
887
|
class Configuration
|
864
888
|
extend ::Gapic::Config
|
865
889
|
|
890
|
+
# @private
|
891
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
866
892
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
867
893
|
|
868
|
-
config_attr :endpoint,
|
894
|
+
config_attr :endpoint, nil, ::String, nil
|
869
895
|
config_attr :credentials, nil do |value|
|
870
896
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
871
897
|
allowed.any? { |klass| klass === value }
|
@@ -877,6 +903,7 @@ module Google
|
|
877
903
|
config_attr :metadata, nil, ::Hash, nil
|
878
904
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
879
905
|
config_attr :quota_project, nil, ::String, nil
|
906
|
+
config_attr :universe_domain, nil, ::String, nil
|
880
907
|
|
881
908
|
# @private
|
882
909
|
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 delete REST call
|
45
57
|
#
|