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,66 @@ 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
|
+
# Baseline implementation for the add_rule REST call
|
57
|
+
#
|
58
|
+
# @param request_pb [::Google::Cloud::Compute::V1::AddRuleRegionSecurityPolicyRequest]
|
59
|
+
# A request object representing the call parameters. Required.
|
60
|
+
# @param options [::Gapic::CallOptions]
|
61
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
62
|
+
#
|
63
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
64
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
65
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
66
|
+
#
|
67
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
68
|
+
# A result object deserialized from the server's reply
|
69
|
+
def add_rule request_pb, options = nil
|
70
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
71
|
+
|
72
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_add_rule_request request_pb
|
73
|
+
query_string_params = if query_string_params.any?
|
74
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
75
|
+
else
|
76
|
+
{}
|
77
|
+
end
|
78
|
+
|
79
|
+
response = @client_stub.make_http_request(
|
80
|
+
verb,
|
81
|
+
uri: uri,
|
82
|
+
body: body || "",
|
83
|
+
params: query_string_params,
|
84
|
+
options: options
|
85
|
+
)
|
86
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
87
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
88
|
+
|
89
|
+
yield result, operation if block_given?
|
90
|
+
result
|
91
|
+
end
|
92
|
+
|
43
93
|
##
|
44
94
|
# Baseline implementation for the delete REST call
|
45
95
|
#
|
@@ -116,6 +166,44 @@ module Google
|
|
116
166
|
result
|
117
167
|
end
|
118
168
|
|
169
|
+
##
|
170
|
+
# Baseline implementation for the get_rule REST call
|
171
|
+
#
|
172
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetRuleRegionSecurityPolicyRequest]
|
173
|
+
# A request object representing the call parameters. Required.
|
174
|
+
# @param options [::Gapic::CallOptions]
|
175
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
176
|
+
#
|
177
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
178
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyRule]
|
179
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
180
|
+
#
|
181
|
+
# @return [::Google::Cloud::Compute::V1::SecurityPolicyRule]
|
182
|
+
# A result object deserialized from the server's reply
|
183
|
+
def get_rule request_pb, options = nil
|
184
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
185
|
+
|
186
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_rule_request request_pb
|
187
|
+
query_string_params = if query_string_params.any?
|
188
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
189
|
+
else
|
190
|
+
{}
|
191
|
+
end
|
192
|
+
|
193
|
+
response = @client_stub.make_http_request(
|
194
|
+
verb,
|
195
|
+
uri: uri,
|
196
|
+
body: body || "",
|
197
|
+
params: query_string_params,
|
198
|
+
options: options
|
199
|
+
)
|
200
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
201
|
+
result = ::Google::Cloud::Compute::V1::SecurityPolicyRule.decode_json response.body, ignore_unknown_fields: true
|
202
|
+
|
203
|
+
yield result, operation if block_given?
|
204
|
+
result
|
205
|
+
end
|
206
|
+
|
119
207
|
##
|
120
208
|
# Baseline implementation for the insert REST call
|
121
209
|
#
|
@@ -230,6 +318,106 @@ module Google
|
|
230
318
|
result
|
231
319
|
end
|
232
320
|
|
321
|
+
##
|
322
|
+
# Baseline implementation for the patch_rule REST call
|
323
|
+
#
|
324
|
+
# @param request_pb [::Google::Cloud::Compute::V1::PatchRuleRegionSecurityPolicyRequest]
|
325
|
+
# A request object representing the call parameters. Required.
|
326
|
+
# @param options [::Gapic::CallOptions]
|
327
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
328
|
+
#
|
329
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
330
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
331
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
332
|
+
#
|
333
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
334
|
+
# A result object deserialized from the server's reply
|
335
|
+
def patch_rule request_pb, options = nil
|
336
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
337
|
+
|
338
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_patch_rule_request request_pb
|
339
|
+
query_string_params = if query_string_params.any?
|
340
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
341
|
+
else
|
342
|
+
{}
|
343
|
+
end
|
344
|
+
|
345
|
+
response = @client_stub.make_http_request(
|
346
|
+
verb,
|
347
|
+
uri: uri,
|
348
|
+
body: body || "",
|
349
|
+
params: query_string_params,
|
350
|
+
options: options
|
351
|
+
)
|
352
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
353
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
354
|
+
|
355
|
+
yield result, operation if block_given?
|
356
|
+
result
|
357
|
+
end
|
358
|
+
|
359
|
+
##
|
360
|
+
# Baseline implementation for the remove_rule REST call
|
361
|
+
#
|
362
|
+
# @param request_pb [::Google::Cloud::Compute::V1::RemoveRuleRegionSecurityPolicyRequest]
|
363
|
+
# A request object representing the call parameters. Required.
|
364
|
+
# @param options [::Gapic::CallOptions]
|
365
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
366
|
+
#
|
367
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
368
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
369
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
370
|
+
#
|
371
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
372
|
+
# A result object deserialized from the server's reply
|
373
|
+
def remove_rule request_pb, options = nil
|
374
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
375
|
+
|
376
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_remove_rule_request request_pb
|
377
|
+
query_string_params = if query_string_params.any?
|
378
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
379
|
+
else
|
380
|
+
{}
|
381
|
+
end
|
382
|
+
|
383
|
+
response = @client_stub.make_http_request(
|
384
|
+
verb,
|
385
|
+
uri: uri,
|
386
|
+
body: body || "",
|
387
|
+
params: query_string_params,
|
388
|
+
options: options
|
389
|
+
)
|
390
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
391
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
392
|
+
|
393
|
+
yield result, operation if block_given?
|
394
|
+
result
|
395
|
+
end
|
396
|
+
|
397
|
+
##
|
398
|
+
# @private
|
399
|
+
#
|
400
|
+
# GRPC transcoding helper method for the add_rule REST call
|
401
|
+
#
|
402
|
+
# @param request_pb [::Google::Cloud::Compute::V1::AddRuleRegionSecurityPolicyRequest]
|
403
|
+
# A request object representing the call parameters. Required.
|
404
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
405
|
+
# Uri, Body, Query string parameters
|
406
|
+
def self.transcode_add_rule_request request_pb
|
407
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
408
|
+
.with_bindings(
|
409
|
+
uri_method: :post,
|
410
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/addRule",
|
411
|
+
body: "security_policy_rule_resource",
|
412
|
+
matches: [
|
413
|
+
["project", %r{^[^/]+/?$}, false],
|
414
|
+
["region", %r{^[^/]+/?$}, false],
|
415
|
+
["security_policy", %r{^[^/]+/?$}, false]
|
416
|
+
]
|
417
|
+
)
|
418
|
+
transcoder.transcode request_pb
|
419
|
+
end
|
420
|
+
|
233
421
|
##
|
234
422
|
# @private
|
235
423
|
#
|
@@ -276,6 +464,29 @@ module Google
|
|
276
464
|
transcoder.transcode request_pb
|
277
465
|
end
|
278
466
|
|
467
|
+
##
|
468
|
+
# @private
|
469
|
+
#
|
470
|
+
# GRPC transcoding helper method for the get_rule REST call
|
471
|
+
#
|
472
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetRuleRegionSecurityPolicyRequest]
|
473
|
+
# A request object representing the call parameters. Required.
|
474
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
475
|
+
# Uri, Body, Query string parameters
|
476
|
+
def self.transcode_get_rule_request request_pb
|
477
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
478
|
+
.with_bindings(
|
479
|
+
uri_method: :get,
|
480
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/getRule",
|
481
|
+
matches: [
|
482
|
+
["project", %r{^[^/]+/?$}, false],
|
483
|
+
["region", %r{^[^/]+/?$}, false],
|
484
|
+
["security_policy", %r{^[^/]+/?$}, false]
|
485
|
+
]
|
486
|
+
)
|
487
|
+
transcoder.transcode request_pb
|
488
|
+
end
|
489
|
+
|
279
490
|
##
|
280
491
|
# @private
|
281
492
|
#
|
@@ -344,6 +555,53 @@ module Google
|
|
344
555
|
)
|
345
556
|
transcoder.transcode request_pb
|
346
557
|
end
|
558
|
+
|
559
|
+
##
|
560
|
+
# @private
|
561
|
+
#
|
562
|
+
# GRPC transcoding helper method for the patch_rule REST call
|
563
|
+
#
|
564
|
+
# @param request_pb [::Google::Cloud::Compute::V1::PatchRuleRegionSecurityPolicyRequest]
|
565
|
+
# A request object representing the call parameters. Required.
|
566
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
567
|
+
# Uri, Body, Query string parameters
|
568
|
+
def self.transcode_patch_rule_request request_pb
|
569
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
570
|
+
.with_bindings(
|
571
|
+
uri_method: :post,
|
572
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/patchRule",
|
573
|
+
body: "security_policy_rule_resource",
|
574
|
+
matches: [
|
575
|
+
["project", %r{^[^/]+/?$}, false],
|
576
|
+
["region", %r{^[^/]+/?$}, false],
|
577
|
+
["security_policy", %r{^[^/]+/?$}, false]
|
578
|
+
]
|
579
|
+
)
|
580
|
+
transcoder.transcode request_pb
|
581
|
+
end
|
582
|
+
|
583
|
+
##
|
584
|
+
# @private
|
585
|
+
#
|
586
|
+
# GRPC transcoding helper method for the remove_rule REST call
|
587
|
+
#
|
588
|
+
# @param request_pb [::Google::Cloud::Compute::V1::RemoveRuleRegionSecurityPolicyRequest]
|
589
|
+
# A request object representing the call parameters. Required.
|
590
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
591
|
+
# Uri, Body, Query string parameters
|
592
|
+
def self.transcode_remove_rule_request request_pb
|
593
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
594
|
+
.with_bindings(
|
595
|
+
uri_method: :post,
|
596
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/removeRule",
|
597
|
+
matches: [
|
598
|
+
["project", %r{^[^/]+/?$}, false],
|
599
|
+
["region", %r{^[^/]+/?$}, false],
|
600
|
+
["security_policy", %r{^[^/]+/?$}, false]
|
601
|
+
]
|
602
|
+
)
|
603
|
+
transcoder.transcode request_pb
|
604
|
+
end
|
347
605
|
end
|
348
606
|
end
|
349
607
|
end
|
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The RegionSslCertificates API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :region_ssl_certificates_stub
|
38
41
|
|
@@ -105,6 +108,15 @@ module Google
|
|
105
108
|
@config
|
106
109
|
end
|
107
110
|
|
111
|
+
##
|
112
|
+
# The effective universe domain
|
113
|
+
#
|
114
|
+
# @return [String]
|
115
|
+
#
|
116
|
+
def universe_domain
|
117
|
+
@region_ssl_certificates_stub.universe_domain
|
118
|
+
end
|
119
|
+
|
108
120
|
##
|
109
121
|
# Create a new RegionSslCertificates REST client object.
|
110
122
|
#
|
@@ -132,8 +144,9 @@ module Google
|
|
132
144
|
credentials = @config.credentials
|
133
145
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
134
146
|
# but only if the default endpoint does not have a region prefix.
|
135
|
-
enable_self_signed_jwt = @config.endpoint
|
136
|
-
|
147
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
148
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
149
|
+
!@config.endpoint.split(".").first.include?("-"))
|
137
150
|
credentials ||= Credentials.default scope: @config.scope,
|
138
151
|
enable_self_signed_jwt: enable_self_signed_jwt
|
139
152
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -147,9 +160,15 @@ module Google
|
|
147
160
|
config.credentials = credentials
|
148
161
|
config.quota_project = @quota_project_id
|
149
162
|
config.endpoint = @config.endpoint
|
163
|
+
config.universe_domain = @config.universe_domain
|
150
164
|
end
|
151
165
|
|
152
|
-
@region_ssl_certificates_stub = ::Google::Cloud::Compute::V1::RegionSslCertificates::Rest::ServiceStub.new
|
166
|
+
@region_ssl_certificates_stub = ::Google::Cloud::Compute::V1::RegionSslCertificates::Rest::ServiceStub.new(
|
167
|
+
endpoint: @config.endpoint,
|
168
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
169
|
+
universe_domain: @config.universe_domain,
|
170
|
+
credentials: credentials
|
171
|
+
)
|
153
172
|
end
|
154
173
|
|
155
174
|
##
|
@@ -448,7 +467,7 @@ module Google
|
|
448
467
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
449
468
|
#
|
450
469
|
# @param filter [::String]
|
451
|
-
# 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
|
470
|
+
# 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.
|
452
471
|
# @param max_results [::Integer]
|
453
472
|
# 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`)
|
454
473
|
# @param order_by [::String]
|
@@ -550,9 +569,9 @@ module Google
|
|
550
569
|
# end
|
551
570
|
#
|
552
571
|
# @!attribute [rw] endpoint
|
553
|
-
#
|
554
|
-
#
|
555
|
-
# @return [::String]
|
572
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
573
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
574
|
+
# @return [::String,nil]
|
556
575
|
# @!attribute [rw] credentials
|
557
576
|
# Credentials to send with calls. You may provide any of the following types:
|
558
577
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -589,13 +608,20 @@ module Google
|
|
589
608
|
# @!attribute [rw] quota_project
|
590
609
|
# A separate project against which to charge quota.
|
591
610
|
# @return [::String]
|
611
|
+
# @!attribute [rw] universe_domain
|
612
|
+
# The universe domain within which to make requests. This determines the
|
613
|
+
# default endpoint URL. The default value of nil uses the environment
|
614
|
+
# universe (usually the default "googleapis.com" universe).
|
615
|
+
# @return [::String,nil]
|
592
616
|
#
|
593
617
|
class Configuration
|
594
618
|
extend ::Gapic::Config
|
595
619
|
|
620
|
+
# @private
|
621
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
596
622
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
597
623
|
|
598
|
-
config_attr :endpoint,
|
624
|
+
config_attr :endpoint, nil, ::String, nil
|
599
625
|
config_attr :credentials, nil do |value|
|
600
626
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
601
627
|
allowed.any? { |klass| klass === value }
|
@@ -607,6 +633,7 @@ module Google
|
|
607
633
|
config_attr :metadata, nil, ::Hash, nil
|
608
634
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
609
635
|
config_attr :quota_project, nil, ::String, nil
|
636
|
+
config_attr :universe_domain, nil, ::String, nil
|
610
637
|
|
611
638
|
# @private
|
612
639
|
def initialize parent_config = nil
|
@@ -30,16 +30,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 RegionSslPolicies API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :region_ssl_policies_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
|
+
@region_ssl_policies_stub.universe_domain
|
125
|
+
end
|
126
|
+
|
115
127
|
##
|
116
128
|
# Create a new RegionSslPolicies 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
|
-
@region_ssl_policies_stub = ::Google::Cloud::Compute::V1::RegionSslPolicies::Rest::ServiceStub.new
|
173
|
+
@region_ssl_policies_stub = ::Google::Cloud::Compute::V1::RegionSslPolicies::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
|
##
|
@@ -455,7 +474,7 @@ module Google
|
|
455
474
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
456
475
|
#
|
457
476
|
# @param filter [::String]
|
458
|
-
# 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
|
477
|
+
# 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.
|
459
478
|
# @param max_results [::Integer]
|
460
479
|
# 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`)
|
461
480
|
# @param order_by [::String]
|
@@ -546,7 +565,7 @@ module Google
|
|
546
565
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
547
566
|
#
|
548
567
|
# @param filter [::String]
|
549
|
-
# 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
|
568
|
+
# 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.
|
550
569
|
# @param max_results [::Integer]
|
551
570
|
# 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`)
|
552
571
|
# @param order_by [::String]
|
@@ -742,9 +761,9 @@ module Google
|
|
742
761
|
# end
|
743
762
|
#
|
744
763
|
# @!attribute [rw] endpoint
|
745
|
-
#
|
746
|
-
#
|
747
|
-
# @return [::String]
|
764
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
765
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
766
|
+
# @return [::String,nil]
|
748
767
|
# @!attribute [rw] credentials
|
749
768
|
# Credentials to send with calls. You may provide any of the following types:
|
750
769
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -781,13 +800,20 @@ module Google
|
|
781
800
|
# @!attribute [rw] quota_project
|
782
801
|
# A separate project against which to charge quota.
|
783
802
|
# @return [::String]
|
803
|
+
# @!attribute [rw] universe_domain
|
804
|
+
# The universe domain within which to make requests. This determines the
|
805
|
+
# default endpoint URL. The default value of nil uses the environment
|
806
|
+
# universe (usually the default "googleapis.com" universe).
|
807
|
+
# @return [::String,nil]
|
784
808
|
#
|
785
809
|
class Configuration
|
786
810
|
extend ::Gapic::Config
|
787
811
|
|
812
|
+
# @private
|
813
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
788
814
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
789
815
|
|
790
|
-
config_attr :endpoint,
|
816
|
+
config_attr :endpoint, nil, ::String, nil
|
791
817
|
config_attr :credentials, nil do |value|
|
792
818
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
793
819
|
allowed.any? { |klass| klass === value }
|
@@ -799,6 +825,7 @@ module Google
|
|
799
825
|
config_attr :metadata, nil, ::Hash, nil
|
800
826
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
801
827
|
config_attr :quota_project, nil, ::String, nil
|
828
|
+
config_attr :universe_domain, nil, ::String, nil
|
802
829
|
|
803
830
|
# @private
|
804
831
|
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
|
#
|