google-cloud-compute-v1 0.1.0 → 0.2.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 +1 -1
- data/README.md +10 -8
- data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +6 -3
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +12 -6
- data/lib/google/cloud/compute/v1/addresses/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/autoscalers/rest/grpc_transcoding.rb +5 -0
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +24 -12
- data/lib/google/cloud/compute/v1/backend_buckets/rest/grpc_transcoding.rb +4 -0
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +32 -16
- data/lib/google/cloud/compute/v1/backend_services/rest/grpc_transcoding.rb +5 -0
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +6 -3
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +38 -19
- data/lib/google/cloud/compute/v1/disks/rest/grpc_transcoding.rb +8 -0
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +14 -7
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/firewall_policies.rb +44 -0
- data/lib/google/cloud/compute/v1/firewall_policies/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/firewall_policies/rest.rb +35 -0
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +1459 -0
- data/lib/google/cloud/compute/v1/firewall_policies/rest/grpc_transcoding.rb +269 -0
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/firewalls/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +10 -5
- data/lib/google/cloud/compute/v1/global_addresses/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +10 -5
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +6 -3
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes.rb +44 -0
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest.rb +35 -0
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +576 -0
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/grpc_transcoding.rb +100 -0
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/health_checks/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/images/rest/client.rb +28 -14
- data/lib/google/cloud/compute/v1/images/rest/grpc_transcoding.rb +4 -0
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +60 -30
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/grpc_transcoding.rb +10 -0
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +28 -14
- data/lib/google/cloud/compute/v1/instance_groups/rest/grpc_transcoding.rb +9 -0
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +16 -8
- data/lib/google/cloud/compute/v1/instance_templates/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +120 -60
- data/lib/google/cloud/compute/v1/instances/rest/grpc_transcoding.rb +27 -0
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +16 -8
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +4 -2
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +16 -8
- data/lib/google/cloud/compute/v1/interconnects/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +4 -2
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +16 -8
- data/lib/google/cloud/compute/v1/licenses/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +6 -3
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +26 -13
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/grpc_transcoding.rb +8 -0
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +30 -15
- data/lib/google/cloud/compute/v1/networks/rest/grpc_transcoding.rb +5 -0
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +36 -18
- data/lib/google/cloud/compute/v1/node_groups/rest/grpc_transcoding.rb +6 -0
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/node_templates/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +6 -3
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +42 -21
- data/lib/google/cloud/compute/v1/projects/rest/grpc_transcoding.rb +12 -0
- data/lib/google/cloud/compute/v1/public_advertised_prefixes.rb +44 -0
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +35 -0
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +576 -0
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/grpc_transcoding.rb +100 -0
- data/lib/google/cloud/compute/v1/public_delegated_prefixes.rb +44 -0
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +35 -0
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +671 -0
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/grpc_transcoding.rb +118 -0
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/grpc_transcoding.rb +5 -0
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/region_backend_services/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +10 -5
- data/lib/google/cloud/compute/v1/region_commitments/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +4 -2
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +36 -18
- data/lib/google/cloud/compute/v1/region_disks/rest/grpc_transcoding.rb +7 -0
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +14 -7
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/region_health_checks/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +58 -29
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/grpc_transcoding.rb +10 -0
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +12 -6
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/grpc_transcoding.rb +6 -0
- data/lib/google/cloud/compute/v1/region_instances.rb +44 -0
- data/lib/google/cloud/compute/v1/region_instances/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_instances/rest.rb +35 -0
- data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +287 -0
- data/lib/google/cloud/compute/v1/region_instances/rest/grpc_transcoding.rb +46 -0
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +10 -5
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +10 -5
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +8 -4
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +10 -5
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +14 -7
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/region_url_maps/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +4 -2
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +22 -11
- data/lib/google/cloud/compute/v1/reservations/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/resource_policies/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +26 -13
- data/lib/google/cloud/compute/v1/routers/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +10 -5
- data/lib/google/cloud/compute/v1/routes/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +26 -13
- data/lib/google/cloud/compute/v1/security_policies/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +14 -7
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +12 -6
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +16 -8
- data/lib/google/cloud/compute/v1/ssl_policies/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +32 -16
- data/lib/google/cloud/compute/v1/subnetworks/rest/grpc_transcoding.rb +5 -0
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +14 -7
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +28 -14
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/grpc_transcoding.rb +5 -0
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +12 -6
- data/lib/google/cloud/compute/v1/target_instances/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +34 -17
- data/lib/google/cloud/compute/v1/target_pools/rest/grpc_transcoding.rb +7 -0
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +26 -13
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/grpc_transcoding.rb +5 -0
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +18 -9
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/grpc_transcoding.rb +3 -0
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +12 -6
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +26 -13
- data/lib/google/cloud/compute/v1/url_maps/rest/grpc_transcoding.rb +4 -0
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +20 -10
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/grpc_transcoding.rb +2 -0
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +12 -6
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/grpc_transcoding.rb +1 -0
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +8 -4
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +4 -2
- metadata +37 -12
@@ -46,6 +46,7 @@ module Google
|
|
46
46
|
uri = "/compute/v1/projects/#{request_pb.project}/disableXpnResource"
|
47
47
|
body = request_pb.projects_disable_xpn_resource_request_resource.to_json
|
48
48
|
query_string_params = {}
|
49
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
49
50
|
|
50
51
|
[uri, body, query_string_params]
|
51
52
|
end
|
@@ -71,6 +72,7 @@ module Google
|
|
71
72
|
uri = "/compute/v1/projects/#{request_pb.project}/enableXpnResource"
|
72
73
|
body = request_pb.projects_enable_xpn_resource_request_resource.to_json
|
73
74
|
query_string_params = {}
|
75
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
74
76
|
|
75
77
|
[uri, body, query_string_params]
|
76
78
|
end
|
@@ -124,6 +126,11 @@ module Google
|
|
124
126
|
uri = "/compute/v1/projects/#{request_pb.project}/listXpnHosts"
|
125
127
|
body = request_pb.projects_list_xpn_hosts_request_resource.to_json
|
126
128
|
query_string_params = {}
|
129
|
+
query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
|
130
|
+
query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
|
131
|
+
query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
|
132
|
+
query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
|
133
|
+
query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
|
127
134
|
|
128
135
|
[uri, body, query_string_params]
|
129
136
|
end
|
@@ -136,6 +143,7 @@ module Google
|
|
136
143
|
uri = "/compute/v1/projects/#{request_pb.project}/moveDisk"
|
137
144
|
body = request_pb.disk_move_request_resource.to_json
|
138
145
|
query_string_params = {}
|
146
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
139
147
|
|
140
148
|
[uri, body, query_string_params]
|
141
149
|
end
|
@@ -148,6 +156,7 @@ module Google
|
|
148
156
|
uri = "/compute/v1/projects/#{request_pb.project}/moveInstance"
|
149
157
|
body = request_pb.instance_move_request_resource.to_json
|
150
158
|
query_string_params = {}
|
159
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
151
160
|
|
152
161
|
[uri, body, query_string_params]
|
153
162
|
end
|
@@ -160,6 +169,7 @@ module Google
|
|
160
169
|
uri = "/compute/v1/projects/#{request_pb.project}/setCommonInstanceMetadata"
|
161
170
|
body = request_pb.metadata_resource.to_json
|
162
171
|
query_string_params = {}
|
172
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
163
173
|
|
164
174
|
[uri, body, query_string_params]
|
165
175
|
end
|
@@ -172,6 +182,7 @@ module Google
|
|
172
182
|
uri = "/compute/v1/projects/#{request_pb.project}/setDefaultNetworkTier"
|
173
183
|
body = request_pb.projects_set_default_network_tier_request_resource.to_json
|
174
184
|
query_string_params = {}
|
185
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
175
186
|
|
176
187
|
[uri, body, query_string_params]
|
177
188
|
end
|
@@ -184,6 +195,7 @@ module Google
|
|
184
195
|
uri = "/compute/v1/projects/#{request_pb.project}/setUsageExportBucket"
|
185
196
|
body = request_pb.usage_export_location_resource.to_json
|
186
197
|
query_string_params = {}
|
198
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
187
199
|
|
188
200
|
[uri, body, query_string_params]
|
189
201
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/config"
|
20
|
+
require "gapic/config/method"
|
21
|
+
|
22
|
+
require "google/cloud/compute/v1/version"
|
23
|
+
|
24
|
+
require "google/cloud/compute/v1/public_advertised_prefixes/credentials"
|
25
|
+
require "google/cloud/compute/v1/public_advertised_prefixes/rest"
|
26
|
+
|
27
|
+
module Google
|
28
|
+
module Cloud
|
29
|
+
module Compute
|
30
|
+
module V1
|
31
|
+
# To load this service and instantiate a REST client:
|
32
|
+
#
|
33
|
+
# require "google/cloud/compute/v1/public_advertised_prefixes"
|
34
|
+
# client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
|
35
|
+
#
|
36
|
+
module PublicAdvertisedPrefixes
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
helper_path = ::File.join __dir__, "public_advertised_prefixes", "helpers.rb"
|
44
|
+
require "google/cloud/compute/v1/public_advertised_prefixes/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Compute
|
24
|
+
module V1
|
25
|
+
module PublicAdvertisedPrefixes
|
26
|
+
# Credentials for the PublicAdvertisedPrefixes API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/compute",
|
30
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
31
|
+
]
|
32
|
+
self.env_vars = [
|
33
|
+
"COMPUTE_CREDENTIALS",
|
34
|
+
"COMPUTE_KEYFILE",
|
35
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
36
|
+
"GOOGLE_CLOUD_KEYFILE",
|
37
|
+
"GCLOUD_KEYFILE",
|
38
|
+
"COMPUTE_CREDENTIALS_JSON",
|
39
|
+
"COMPUTE_KEYFILE_JSON",
|
40
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
41
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
42
|
+
"GCLOUD_KEYFILE_JSON"
|
43
|
+
]
|
44
|
+
self.paths = [
|
45
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
46
|
+
]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/rest"
|
20
|
+
require "google/cloud/compute/v1/public_advertised_prefixes/rest/grpc_transcoding"
|
21
|
+
require "google/cloud/compute/v1/public_advertised_prefixes/rest/client"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Compute
|
26
|
+
module V1
|
27
|
+
module PublicAdvertisedPrefixes
|
28
|
+
# Client for the REST transport
|
29
|
+
module Rest
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,576 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/compute/v1/compute_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Compute
|
25
|
+
module V1
|
26
|
+
module PublicAdvertisedPrefixes
|
27
|
+
module Rest
|
28
|
+
##
|
29
|
+
# REST client for the PublicAdvertisedPrefixes service.
|
30
|
+
#
|
31
|
+
# The PublicAdvertisedPrefixes API.
|
32
|
+
#
|
33
|
+
class Client
|
34
|
+
include GrpcTranscoding
|
35
|
+
|
36
|
+
# @private
|
37
|
+
attr_reader :public_advertised_prefixes_stub
|
38
|
+
|
39
|
+
##
|
40
|
+
# Configure the PublicAdvertisedPrefixes Client class.
|
41
|
+
#
|
42
|
+
# See {::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client::Configuration}
|
43
|
+
# for a description of the configuration fields.
|
44
|
+
#
|
45
|
+
# ## Example
|
46
|
+
#
|
47
|
+
# To modify the configuration for all PublicAdvertisedPrefixes clients:
|
48
|
+
#
|
49
|
+
# ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.configure do |config|
|
50
|
+
# config.timeout = 10.0
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# @yield [config] Configure the Client client.
|
54
|
+
# @yieldparam config [Client::Configuration]
|
55
|
+
#
|
56
|
+
# @return [Client::Configuration]
|
57
|
+
#
|
58
|
+
def self.configure
|
59
|
+
@configure ||= begin
|
60
|
+
namespace = ["Google", "Cloud", "Compute", "V1"]
|
61
|
+
parent_config = while namespace.any?
|
62
|
+
parent_name = namespace.join "::"
|
63
|
+
parent_const = const_get parent_name
|
64
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
65
|
+
namespace.pop
|
66
|
+
end
|
67
|
+
default_config = Client::Configuration.new parent_config
|
68
|
+
|
69
|
+
default_config
|
70
|
+
end
|
71
|
+
yield @configure if block_given?
|
72
|
+
@configure
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Configure the PublicAdvertisedPrefixes Client instance.
|
77
|
+
#
|
78
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
79
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
80
|
+
# should be made on {Client.configure}.
|
81
|
+
#
|
82
|
+
# See {::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client::Configuration}
|
83
|
+
# for a description of the configuration fields.
|
84
|
+
#
|
85
|
+
# @yield [config] Configure the Client client.
|
86
|
+
# @yieldparam config [Client::Configuration]
|
87
|
+
#
|
88
|
+
# @return [Client::Configuration]
|
89
|
+
#
|
90
|
+
def configure
|
91
|
+
yield @config if block_given?
|
92
|
+
@config
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Create a new PublicAdvertisedPrefixes REST client object.
|
97
|
+
#
|
98
|
+
# ## Examples
|
99
|
+
#
|
100
|
+
# To create a new PublicAdvertisedPrefixes REST client with the default
|
101
|
+
# configuration:
|
102
|
+
#
|
103
|
+
# client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
|
104
|
+
#
|
105
|
+
# To create a new PublicAdvertisedPrefixes REST client with a custom
|
106
|
+
# configuration:
|
107
|
+
#
|
108
|
+
# client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new do |config|
|
109
|
+
# config.timeout = 10.0
|
110
|
+
# end
|
111
|
+
#
|
112
|
+
# @yield [config] Configure the PublicAdvertisedPrefixes client.
|
113
|
+
# @yieldparam config [Client::Configuration]
|
114
|
+
#
|
115
|
+
def initialize
|
116
|
+
# These require statements are intentionally placed here to initialize
|
117
|
+
# the REST modules only when it's required.
|
118
|
+
require "gapic/rest"
|
119
|
+
|
120
|
+
# Create the configuration object
|
121
|
+
@config = Configuration.new Client.configure
|
122
|
+
|
123
|
+
# Yield the configuration if needed
|
124
|
+
yield @config if block_given?
|
125
|
+
|
126
|
+
# Create credentials
|
127
|
+
credentials = @config.credentials
|
128
|
+
credentials ||= Credentials.default scope: @config.scope
|
129
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
130
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
131
|
+
end
|
132
|
+
|
133
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
|
134
|
+
end
|
135
|
+
|
136
|
+
# Service calls
|
137
|
+
|
138
|
+
##
|
139
|
+
# Deletes the specified PublicAdvertisedPrefix
|
140
|
+
#
|
141
|
+
# @overload delete(request, options = nil)
|
142
|
+
# Pass arguments to `delete` via a request object, either of type
|
143
|
+
# {::Google::Cloud::Compute::V1::DeletePublicAdvertisedPrefixeRequest} or an equivalent Hash.
|
144
|
+
#
|
145
|
+
# @param request [::Google::Cloud::Compute::V1::DeletePublicAdvertisedPrefixeRequest, ::Hash]
|
146
|
+
# A request object representing the call parameters. Required. To specify no
|
147
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
148
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
149
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
150
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
151
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
152
|
+
#
|
153
|
+
# @overload delete(project: nil, public_advertised_prefix: nil, request_id: nil)
|
154
|
+
# Pass arguments to `delete` via keyword arguments. Note that at
|
155
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
156
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
157
|
+
#
|
158
|
+
# @param project [::String]
|
159
|
+
# Project ID for this request.
|
160
|
+
# @param public_advertised_prefix [::String]
|
161
|
+
# Name of the PublicAdvertisedPrefix resource to delete.
|
162
|
+
# @param request_id [::String]
|
163
|
+
# An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
|
164
|
+
#
|
165
|
+
# For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
|
166
|
+
#
|
167
|
+
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
168
|
+
# @yield [result, env] Access the result along with the Faraday environment object
|
169
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
170
|
+
# @yieldparam response [::Faraday::Response]
|
171
|
+
#
|
172
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
173
|
+
#
|
174
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
175
|
+
def delete request, options = nil
|
176
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
177
|
+
|
178
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeletePublicAdvertisedPrefixeRequest
|
179
|
+
|
180
|
+
# Converts hash and nil to an options object
|
181
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
182
|
+
|
183
|
+
# Customize the options with defaults
|
184
|
+
call_metadata = {}
|
185
|
+
|
186
|
+
# Set x-goog-api-client header
|
187
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
188
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
189
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION
|
190
|
+
|
191
|
+
options.apply_defaults timeout: @config.timeout,
|
192
|
+
metadata: call_metadata
|
193
|
+
|
194
|
+
uri, _body, query_string_params = transcode_delete request
|
195
|
+
response = @client_stub.make_delete_request(
|
196
|
+
uri: uri,
|
197
|
+
params: query_string_params,
|
198
|
+
options: options
|
199
|
+
)
|
200
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
201
|
+
|
202
|
+
yield result, response if block_given?
|
203
|
+
result
|
204
|
+
rescue ::Faraday::Error => e
|
205
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
206
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# Returns the specified PublicAdvertisedPrefix resource.
|
211
|
+
#
|
212
|
+
# @overload get(request, options = nil)
|
213
|
+
# Pass arguments to `get` via a request object, either of type
|
214
|
+
# {::Google::Cloud::Compute::V1::GetPublicAdvertisedPrefixeRequest} or an equivalent Hash.
|
215
|
+
#
|
216
|
+
# @param request [::Google::Cloud::Compute::V1::GetPublicAdvertisedPrefixeRequest, ::Hash]
|
217
|
+
# A request object representing the call parameters. Required. To specify no
|
218
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
219
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
220
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
221
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
222
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
223
|
+
#
|
224
|
+
# @overload get(project: nil, public_advertised_prefix: nil)
|
225
|
+
# Pass arguments to `get` via keyword arguments. Note that at
|
226
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
227
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
228
|
+
#
|
229
|
+
# @param project [::String]
|
230
|
+
# Project ID for this request.
|
231
|
+
# @param public_advertised_prefix [::String]
|
232
|
+
# Name of the PublicAdvertisedPrefix resource to return.
|
233
|
+
# @yield [result, env] Access the result along with the Faraday environment object
|
234
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::PublicAdvertisedPrefix]
|
235
|
+
# @yieldparam response [::Faraday::Response]
|
236
|
+
#
|
237
|
+
# @return [::Google::Cloud::Compute::V1::PublicAdvertisedPrefix]
|
238
|
+
#
|
239
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
240
|
+
def get request, options = nil
|
241
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
242
|
+
|
243
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetPublicAdvertisedPrefixeRequest
|
244
|
+
|
245
|
+
# Converts hash and nil to an options object
|
246
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
247
|
+
|
248
|
+
# Customize the options with defaults
|
249
|
+
call_metadata = {}
|
250
|
+
|
251
|
+
# Set x-goog-api-client header
|
252
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
253
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
254
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION
|
255
|
+
|
256
|
+
options.apply_defaults timeout: @config.timeout,
|
257
|
+
metadata: call_metadata
|
258
|
+
|
259
|
+
uri, _body, _query_string_params = transcode_get request
|
260
|
+
response = @client_stub.make_get_request(
|
261
|
+
uri: uri,
|
262
|
+
options: options
|
263
|
+
)
|
264
|
+
result = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefix.decode_json response.body, ignore_unknown_fields: true
|
265
|
+
|
266
|
+
yield result, response if block_given?
|
267
|
+
result
|
268
|
+
rescue ::Faraday::Error => e
|
269
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
270
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request.
|
275
|
+
#
|
276
|
+
# @overload insert(request, options = nil)
|
277
|
+
# Pass arguments to `insert` via a request object, either of type
|
278
|
+
# {::Google::Cloud::Compute::V1::InsertPublicAdvertisedPrefixeRequest} or an equivalent Hash.
|
279
|
+
#
|
280
|
+
# @param request [::Google::Cloud::Compute::V1::InsertPublicAdvertisedPrefixeRequest, ::Hash]
|
281
|
+
# A request object representing the call parameters. Required. To specify no
|
282
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
283
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
284
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
285
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
286
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
287
|
+
#
|
288
|
+
# @overload insert(project: nil, public_advertised_prefix_resource: nil, request_id: nil)
|
289
|
+
# Pass arguments to `insert` via keyword arguments. Note that at
|
290
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
291
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
292
|
+
#
|
293
|
+
# @param project [::String]
|
294
|
+
# Project ID for this request.
|
295
|
+
# @param public_advertised_prefix_resource [::Google::Cloud::Compute::V1::PublicAdvertisedPrefix, ::Hash]
|
296
|
+
# The body resource for this request
|
297
|
+
# @param request_id [::String]
|
298
|
+
# An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
|
299
|
+
#
|
300
|
+
# For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
|
301
|
+
#
|
302
|
+
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
303
|
+
# @yield [result, env] Access the result along with the Faraday environment object
|
304
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
305
|
+
# @yieldparam response [::Faraday::Response]
|
306
|
+
#
|
307
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
308
|
+
#
|
309
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
310
|
+
def insert request, options = nil
|
311
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
312
|
+
|
313
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertPublicAdvertisedPrefixeRequest
|
314
|
+
|
315
|
+
# Converts hash and nil to an options object
|
316
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
317
|
+
|
318
|
+
# Customize the options with defaults
|
319
|
+
call_metadata = {}
|
320
|
+
|
321
|
+
# Set x-goog-api-client header
|
322
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
323
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
324
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION
|
325
|
+
|
326
|
+
options.apply_defaults timeout: @config.timeout,
|
327
|
+
metadata: call_metadata
|
328
|
+
|
329
|
+
uri, body, _query_string_params = transcode_insert request
|
330
|
+
response = @client_stub.make_post_request(
|
331
|
+
uri: uri,
|
332
|
+
body: body,
|
333
|
+
options: options
|
334
|
+
)
|
335
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
336
|
+
|
337
|
+
yield result, response if block_given?
|
338
|
+
result
|
339
|
+
rescue ::Faraday::Error => e
|
340
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
341
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# Lists the PublicAdvertisedPrefixes for a project.
|
346
|
+
#
|
347
|
+
# @overload list(request, options = nil)
|
348
|
+
# Pass arguments to `list` via a request object, either of type
|
349
|
+
# {::Google::Cloud::Compute::V1::ListPublicAdvertisedPrefixesRequest} or an equivalent Hash.
|
350
|
+
#
|
351
|
+
# @param request [::Google::Cloud::Compute::V1::ListPublicAdvertisedPrefixesRequest, ::Hash]
|
352
|
+
# A request object representing the call parameters. Required. To specify no
|
353
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
354
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
355
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
356
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
357
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
358
|
+
#
|
359
|
+
# @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
|
360
|
+
# Pass arguments to `list` via keyword arguments. Note that at
|
361
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
362
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
363
|
+
#
|
364
|
+
# @param filter [::String]
|
365
|
+
# A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
|
366
|
+
#
|
367
|
+
# For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
|
368
|
+
#
|
369
|
+
# 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.
|
370
|
+
#
|
371
|
+
# 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) ```
|
372
|
+
# @param max_results [::Integer]
|
373
|
+
# 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`)
|
374
|
+
# @param order_by [::String]
|
375
|
+
# Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
|
376
|
+
#
|
377
|
+
# You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
|
378
|
+
#
|
379
|
+
# Currently, only sorting by `name` or `creationTimestamp desc` is supported.
|
380
|
+
# @param page_token [::String]
|
381
|
+
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
|
382
|
+
# @param project [::String]
|
383
|
+
# Project ID for this request.
|
384
|
+
# @param return_partial_success [::Boolean]
|
385
|
+
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
|
386
|
+
# @yield [result, env] Access the result along with the Faraday environment object
|
387
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::PublicAdvertisedPrefixList]
|
388
|
+
# @yieldparam response [::Faraday::Response]
|
389
|
+
#
|
390
|
+
# @return [::Google::Cloud::Compute::V1::PublicAdvertisedPrefixList]
|
391
|
+
#
|
392
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
393
|
+
def list request, options = nil
|
394
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
395
|
+
|
396
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListPublicAdvertisedPrefixesRequest
|
397
|
+
|
398
|
+
# Converts hash and nil to an options object
|
399
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
400
|
+
|
401
|
+
# Customize the options with defaults
|
402
|
+
call_metadata = {}
|
403
|
+
|
404
|
+
# Set x-goog-api-client header
|
405
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
406
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
407
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION
|
408
|
+
|
409
|
+
options.apply_defaults timeout: @config.timeout,
|
410
|
+
metadata: call_metadata
|
411
|
+
|
412
|
+
uri, _body, query_string_params = transcode_list request
|
413
|
+
response = @client_stub.make_get_request(
|
414
|
+
uri: uri,
|
415
|
+
params: query_string_params,
|
416
|
+
options: options
|
417
|
+
)
|
418
|
+
result = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixList.decode_json response.body, ignore_unknown_fields: true
|
419
|
+
|
420
|
+
yield result, response if block_given?
|
421
|
+
result
|
422
|
+
rescue ::Faraday::Error => e
|
423
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
424
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
425
|
+
end
|
426
|
+
|
427
|
+
##
|
428
|
+
# Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
|
429
|
+
#
|
430
|
+
# @overload patch(request, options = nil)
|
431
|
+
# Pass arguments to `patch` via a request object, either of type
|
432
|
+
# {::Google::Cloud::Compute::V1::PatchPublicAdvertisedPrefixeRequest} or an equivalent Hash.
|
433
|
+
#
|
434
|
+
# @param request [::Google::Cloud::Compute::V1::PatchPublicAdvertisedPrefixeRequest, ::Hash]
|
435
|
+
# A request object representing the call parameters. Required. To specify no
|
436
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
437
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
438
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
439
|
+
# Note: currently retry functionality is not implemented. While it is possible
|
440
|
+
# to set it using ::Gapic::CallOptions, it will not be applied
|
441
|
+
#
|
442
|
+
# @overload patch(project: nil, public_advertised_prefix: nil, public_advertised_prefix_resource: nil, request_id: nil)
|
443
|
+
# Pass arguments to `patch` via keyword arguments. Note that at
|
444
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
445
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
446
|
+
#
|
447
|
+
# @param project [::String]
|
448
|
+
# Project ID for this request.
|
449
|
+
# @param public_advertised_prefix [::String]
|
450
|
+
# Name of the PublicAdvertisedPrefix resource to patch.
|
451
|
+
# @param public_advertised_prefix_resource [::Google::Cloud::Compute::V1::PublicAdvertisedPrefix, ::Hash]
|
452
|
+
# The body resource for this request
|
453
|
+
# @param request_id [::String]
|
454
|
+
# An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
|
455
|
+
#
|
456
|
+
# For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
|
457
|
+
#
|
458
|
+
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
459
|
+
# @yield [result, env] Access the result along with the Faraday environment object
|
460
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
461
|
+
# @yieldparam response [::Faraday::Response]
|
462
|
+
#
|
463
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
464
|
+
#
|
465
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
466
|
+
def patch request, options = nil
|
467
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
468
|
+
|
469
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchPublicAdvertisedPrefixeRequest
|
470
|
+
|
471
|
+
# Converts hash and nil to an options object
|
472
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
473
|
+
|
474
|
+
# Customize the options with defaults
|
475
|
+
call_metadata = {}
|
476
|
+
|
477
|
+
# Set x-goog-api-client header
|
478
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
479
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
480
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION
|
481
|
+
|
482
|
+
options.apply_defaults timeout: @config.timeout,
|
483
|
+
metadata: call_metadata
|
484
|
+
|
485
|
+
uri, body, _query_string_params = transcode_patch request
|
486
|
+
response = @client_stub.make_patch_request(
|
487
|
+
uri: uri,
|
488
|
+
body: body,
|
489
|
+
options: options
|
490
|
+
)
|
491
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
492
|
+
|
493
|
+
yield result, response if block_given?
|
494
|
+
result
|
495
|
+
rescue ::Faraday::Error => e
|
496
|
+
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
497
|
+
raise ::Google::Cloud::Error.from_error(gapic_error)
|
498
|
+
end
|
499
|
+
|
500
|
+
##
|
501
|
+
# Configuration class for the PublicAdvertisedPrefixes REST API.
|
502
|
+
#
|
503
|
+
# This class represents the configuration for PublicAdvertisedPrefixes REST,
|
504
|
+
# providing control over credentials, timeouts, retry behavior, logging.
|
505
|
+
#
|
506
|
+
# Configuration can be applied globally to all clients, or to a single client
|
507
|
+
# on construction.
|
508
|
+
#
|
509
|
+
# # Examples
|
510
|
+
#
|
511
|
+
# To modify the global config, setting the timeout for all calls to 10 seconds:
|
512
|
+
#
|
513
|
+
# ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Client.configure do |config|
|
514
|
+
# config.timeout = 10.0
|
515
|
+
# end
|
516
|
+
#
|
517
|
+
# To apply the above configuration only to a new client:
|
518
|
+
#
|
519
|
+
# client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Client.new do |config|
|
520
|
+
# config.timeout = 10.0
|
521
|
+
# end
|
522
|
+
#
|
523
|
+
# @!attribute [rw] endpoint
|
524
|
+
# The hostname or hostname:port of the service endpoint.
|
525
|
+
# Defaults to `"compute.googleapis.com"`.
|
526
|
+
# @return [::String]
|
527
|
+
# @!attribute [rw] credentials
|
528
|
+
# Credentials to send with calls. You may provide any of the following types:
|
529
|
+
# * (`String`) The path to a service account key file in JSON format
|
530
|
+
# * (`Hash`) A service account key as a Hash
|
531
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
532
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
533
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
534
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
535
|
+
# * (`nil`) indicating no credentials
|
536
|
+
# @return [::Object]
|
537
|
+
# @!attribute [rw] scope
|
538
|
+
# The OAuth scopes
|
539
|
+
# @return [::Array<::String>]
|
540
|
+
# @!attribute [rw] lib_name
|
541
|
+
# The library name as recorded in instrumentation and logging
|
542
|
+
# @return [::String]
|
543
|
+
# @!attribute [rw] lib_version
|
544
|
+
# The library version as recorded in instrumentation and logging
|
545
|
+
# @return [::String]
|
546
|
+
# @!attribute [rw] timeout
|
547
|
+
# The call timeout in seconds.
|
548
|
+
# @return [::Numeric]
|
549
|
+
#
|
550
|
+
class Configuration
|
551
|
+
extend ::Gapic::Config
|
552
|
+
|
553
|
+
config_attr :endpoint, "compute.googleapis.com", ::String
|
554
|
+
config_attr :credentials, nil do |value|
|
555
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
556
|
+
allowed.any? { |klass| klass === value }
|
557
|
+
end
|
558
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
559
|
+
config_attr :lib_name, nil, ::String, nil
|
560
|
+
config_attr :lib_version, nil, ::String, nil
|
561
|
+
config_attr :timeout, nil, ::Numeric, nil
|
562
|
+
|
563
|
+
# @private
|
564
|
+
def initialize parent_config = nil
|
565
|
+
@parent_config = parent_config unless parent_config.nil?
|
566
|
+
|
567
|
+
yield self if block_given?
|
568
|
+
end
|
569
|
+
end
|
570
|
+
end
|
571
|
+
end
|
572
|
+
end
|
573
|
+
end
|
574
|
+
end
|
575
|
+
end
|
576
|
+
end
|