google-cloud-compute-v1 1.1.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +2 -2
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +37 -8
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +59 -14
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +84 -22
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +95 -26
- data/lib/google/cloud/compute/v1/compute_pb.rb +671 -3
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +2 -2
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +93 -24
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +44 -10
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +98 -31
- data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +2 -2
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +54 -13
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +70 -17
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +64 -16
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +55 -14
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +2 -2
- data/lib/google/cloud/compute/v1/global_operations/rest/nonstandard_lro.rb +68 -0
- data/lib/google/cloud/compute/v1/global_operations.rb +1 -0
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +1 -1
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/nonstandard_lro.rb +68 -0
- data/lib/google/cloud/compute/v1/global_organization_operations.rb +1 -0
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +44 -10
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +55 -14
- data/lib/google/cloud/compute/v1/images/rest/client.rb +64 -16
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +177 -52
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +72 -19
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +372 -101
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +48 -11
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +1 -1
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +44 -10
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +2 -2
- data/lib/google/cloud/compute/v1/network_edge_security_services/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +679 -0
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +279 -0
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/network_edge_security_services.rb +44 -0
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +60 -15
- data/lib/google/cloud/compute/v1/network_firewall_policies/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +1552 -0
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +778 -0
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/network_firewall_policies.rb +44 -0
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +85 -23
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +82 -21
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +37 -8
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +2 -2
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +48 -11
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +105 -29
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +44 -10
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +48 -11
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +58 -13
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +58 -13
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +37 -8
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +1 -1
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +91 -22
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +47 -10
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +58 -13
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +176 -51
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +26 -5
- data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +24 -3
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +36 -7
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +1670 -0
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +823 -0
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/region_network_firewall_policies.rb +44 -0
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +36 -7
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +1 -1
- data/lib/google/cloud/compute/v1/region_operations/rest/nonstandard_lro.rb +68 -0
- data/lib/google/cloud/compute/v1/region_operations.rb +1 -0
- data/lib/google/cloud/compute/v1/region_security_policies/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +676 -0
- data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +276 -0
- data/lib/google/cloud/compute/v1/region_security_policies/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/region_security_policies.rb +44 -0
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +36 -7
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +47 -10
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +145 -13
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +46 -0
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +58 -13
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +1 -1
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +59 -14
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +37 -8
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +60 -15
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +170 -23
- data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +55 -1
- data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +48 -11
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +44 -10
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +45 -11
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +71 -18
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +44 -10
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +55 -14
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +169 -23
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +46 -0
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +37 -8
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +92 -23
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +158 -19
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +46 -0
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +54 -13
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +37 -8
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +65 -17
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +48 -11
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +37 -8
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +1 -1
- data/lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb +68 -0
- data/lib/google/cloud/compute/v1/zone_operations.rb +1 -0
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +1 -1
- data/lib/google/cloud/compute/v1.rb +6 -0
- data/proto_docs/google/cloud/compute/v1/compute.rb +1946 -229
- metadata +27 -3
@@ -0,0 +1,276 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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/compute/v1/compute_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Compute
|
24
|
+
module V1
|
25
|
+
module RegionSecurityPolicies
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the RegionSecurityPolicies service.
|
29
|
+
# service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call and deserialing the response
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Baseline implementation for the delete REST call
|
43
|
+
#
|
44
|
+
# @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionSecurityPolicyRequest]
|
45
|
+
# A request object representing the call parameters. Required.
|
46
|
+
# @param options [::Gapic::CallOptions]
|
47
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
48
|
+
#
|
49
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
50
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
51
|
+
# @yieldparam response [::Faraday::Response]
|
52
|
+
#
|
53
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
54
|
+
# A result object deserialized from the server's reply
|
55
|
+
def delete request_pb, options = nil
|
56
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
57
|
+
|
58
|
+
uri, _body, query_string_params = transcode_delete_request request_pb
|
59
|
+
response = @client_stub.make_delete_request(
|
60
|
+
uri: uri,
|
61
|
+
params: query_string_params,
|
62
|
+
options: options
|
63
|
+
)
|
64
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
65
|
+
|
66
|
+
yield result, response if block_given?
|
67
|
+
result
|
68
|
+
end
|
69
|
+
|
70
|
+
##
|
71
|
+
# GRPC transcoding helper method for the delete REST call
|
72
|
+
#
|
73
|
+
# @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionSecurityPolicyRequest]
|
74
|
+
# A request object representing the call parameters. Required.
|
75
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
76
|
+
# Uri, Body, Query string parameters
|
77
|
+
def transcode_delete_request request_pb
|
78
|
+
uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/securityPolicies/#{request_pb.security_policy}"
|
79
|
+
body = nil
|
80
|
+
query_string_params = {}
|
81
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
82
|
+
|
83
|
+
[uri, body, query_string_params]
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Baseline implementation for the get REST call
|
88
|
+
#
|
89
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetRegionSecurityPolicyRequest]
|
90
|
+
# A request object representing the call parameters. Required.
|
91
|
+
# @param options [::Gapic::CallOptions]
|
92
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
93
|
+
#
|
94
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
95
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicy]
|
96
|
+
# @yieldparam response [::Faraday::Response]
|
97
|
+
#
|
98
|
+
# @return [::Google::Cloud::Compute::V1::SecurityPolicy]
|
99
|
+
# A result object deserialized from the server's reply
|
100
|
+
def get request_pb, options = nil
|
101
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
102
|
+
|
103
|
+
uri, _body, _query_string_params = transcode_get_request request_pb
|
104
|
+
response = @client_stub.make_get_request(
|
105
|
+
uri: uri,
|
106
|
+
options: options
|
107
|
+
)
|
108
|
+
result = ::Google::Cloud::Compute::V1::SecurityPolicy.decode_json response.body, ignore_unknown_fields: true
|
109
|
+
|
110
|
+
yield result, response if block_given?
|
111
|
+
result
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# GRPC transcoding helper method for the get REST call
|
116
|
+
#
|
117
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetRegionSecurityPolicyRequest]
|
118
|
+
# A request object representing the call parameters. Required.
|
119
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
120
|
+
# Uri, Body, Query string parameters
|
121
|
+
def transcode_get_request request_pb
|
122
|
+
uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/securityPolicies/#{request_pb.security_policy}"
|
123
|
+
body = nil
|
124
|
+
query_string_params = {}
|
125
|
+
|
126
|
+
[uri, body, query_string_params]
|
127
|
+
end
|
128
|
+
|
129
|
+
##
|
130
|
+
# Baseline implementation for the insert REST call
|
131
|
+
#
|
132
|
+
# @param request_pb [::Google::Cloud::Compute::V1::InsertRegionSecurityPolicyRequest]
|
133
|
+
# A request object representing the call parameters. Required.
|
134
|
+
# @param options [::Gapic::CallOptions]
|
135
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
136
|
+
#
|
137
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
138
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
139
|
+
# @yieldparam response [::Faraday::Response]
|
140
|
+
#
|
141
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
142
|
+
# A result object deserialized from the server's reply
|
143
|
+
def insert request_pb, options = nil
|
144
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
145
|
+
|
146
|
+
uri, body, query_string_params = transcode_insert_request request_pb
|
147
|
+
response = @client_stub.make_post_request(
|
148
|
+
uri: uri,
|
149
|
+
body: body,
|
150
|
+
params: query_string_params,
|
151
|
+
options: options
|
152
|
+
)
|
153
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
154
|
+
|
155
|
+
yield result, response if block_given?
|
156
|
+
result
|
157
|
+
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# GRPC transcoding helper method for the insert REST call
|
161
|
+
#
|
162
|
+
# @param request_pb [::Google::Cloud::Compute::V1::InsertRegionSecurityPolicyRequest]
|
163
|
+
# A request object representing the call parameters. Required.
|
164
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
165
|
+
# Uri, Body, Query string parameters
|
166
|
+
def transcode_insert_request request_pb
|
167
|
+
uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/securityPolicies"
|
168
|
+
body = request_pb.security_policy_resource.to_json
|
169
|
+
query_string_params = {}
|
170
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
171
|
+
query_string_params["validateOnly"] = request_pb.validate_only.to_s if request_pb.has_validate_only?
|
172
|
+
|
173
|
+
[uri, body, query_string_params]
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# Baseline implementation for the list REST call
|
178
|
+
#
|
179
|
+
# @param request_pb [::Google::Cloud::Compute::V1::ListRegionSecurityPoliciesRequest]
|
180
|
+
# A request object representing the call parameters. Required.
|
181
|
+
# @param options [::Gapic::CallOptions]
|
182
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
183
|
+
#
|
184
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
185
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyList]
|
186
|
+
# @yieldparam response [::Faraday::Response]
|
187
|
+
#
|
188
|
+
# @return [::Google::Cloud::Compute::V1::SecurityPolicyList]
|
189
|
+
# A result object deserialized from the server's reply
|
190
|
+
def list request_pb, options = nil
|
191
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
192
|
+
|
193
|
+
uri, _body, query_string_params = transcode_list_request request_pb
|
194
|
+
response = @client_stub.make_get_request(
|
195
|
+
uri: uri,
|
196
|
+
params: query_string_params,
|
197
|
+
options: options
|
198
|
+
)
|
199
|
+
result = ::Google::Cloud::Compute::V1::SecurityPolicyList.decode_json response.body, ignore_unknown_fields: true
|
200
|
+
|
201
|
+
yield result, response if block_given?
|
202
|
+
result
|
203
|
+
end
|
204
|
+
|
205
|
+
##
|
206
|
+
# GRPC transcoding helper method for the list REST call
|
207
|
+
#
|
208
|
+
# @param request_pb [::Google::Cloud::Compute::V1::ListRegionSecurityPoliciesRequest]
|
209
|
+
# A request object representing the call parameters. Required.
|
210
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
211
|
+
# Uri, Body, Query string parameters
|
212
|
+
def transcode_list_request request_pb
|
213
|
+
uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/securityPolicies"
|
214
|
+
body = nil
|
215
|
+
query_string_params = {}
|
216
|
+
query_string_params["filter"] = request_pb.filter.to_s if request_pb.has_filter?
|
217
|
+
query_string_params["maxResults"] = request_pb.max_results.to_s if request_pb.has_max_results?
|
218
|
+
query_string_params["orderBy"] = request_pb.order_by.to_s if request_pb.has_order_by?
|
219
|
+
query_string_params["pageToken"] = request_pb.page_token.to_s if request_pb.has_page_token?
|
220
|
+
query_string_params["returnPartialSuccess"] = request_pb.return_partial_success.to_s if request_pb.has_return_partial_success?
|
221
|
+
|
222
|
+
[uri, body, query_string_params]
|
223
|
+
end
|
224
|
+
|
225
|
+
##
|
226
|
+
# Baseline implementation for the patch REST call
|
227
|
+
#
|
228
|
+
# @param request_pb [::Google::Cloud::Compute::V1::PatchRegionSecurityPolicyRequest]
|
229
|
+
# A request object representing the call parameters. Required.
|
230
|
+
# @param options [::Gapic::CallOptions]
|
231
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
232
|
+
#
|
233
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
234
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
235
|
+
# @yieldparam response [::Faraday::Response]
|
236
|
+
#
|
237
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
238
|
+
# A result object deserialized from the server's reply
|
239
|
+
def patch request_pb, options = nil
|
240
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
241
|
+
|
242
|
+
uri, body, query_string_params = transcode_patch_request request_pb
|
243
|
+
response = @client_stub.make_patch_request(
|
244
|
+
uri: uri,
|
245
|
+
body: body,
|
246
|
+
params: query_string_params,
|
247
|
+
options: options
|
248
|
+
)
|
249
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
250
|
+
|
251
|
+
yield result, response if block_given?
|
252
|
+
result
|
253
|
+
end
|
254
|
+
|
255
|
+
##
|
256
|
+
# GRPC transcoding helper method for the patch REST call
|
257
|
+
#
|
258
|
+
# @param request_pb [::Google::Cloud::Compute::V1::PatchRegionSecurityPolicyRequest]
|
259
|
+
# A request object representing the call parameters. Required.
|
260
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
261
|
+
# Uri, Body, Query string parameters
|
262
|
+
def transcode_patch_request request_pb
|
263
|
+
uri = "/compute/v1/projects/#{request_pb.project}/regions/#{request_pb.region}/securityPolicies/#{request_pb.security_policy}"
|
264
|
+
body = request_pb.security_policy_resource.to_json
|
265
|
+
query_string_params = {}
|
266
|
+
query_string_params["requestId"] = request_pb.request_id.to_s if request_pb.has_request_id?
|
267
|
+
|
268
|
+
[uri, body, query_string_params]
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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/compute/v1/region_security_policies/rest/client"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Compute
|
24
|
+
module V1
|
25
|
+
module RegionSecurityPolicies
|
26
|
+
# Client for the REST transport
|
27
|
+
module Rest
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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/region_security_policies/credentials"
|
25
|
+
require "google/cloud/compute/v1/region_security_policies/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/region_security_policies"
|
34
|
+
# client = ::Google::Cloud::Compute::V1::RegionSecurityPolicies::Rest::Client.new
|
35
|
+
#
|
36
|
+
module RegionSecurityPolicies
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
helper_path = ::File.join __dir__, "region_security_policies", "helpers.rb"
|
44
|
+
require "google/cloud/compute/v1/region_security_policies/helpers" if ::File.file? helper_path
|
@@ -19,6 +19,7 @@
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/compute/v1/compute_pb"
|
21
21
|
require "google/cloud/compute/v1/region_ssl_certificates/rest/service_stub"
|
22
|
+
require "google/cloud/compute/v1/region_operations/rest"
|
22
23
|
|
23
24
|
module Google
|
24
25
|
module Cloud
|
@@ -134,9 +135,21 @@ module Google
|
|
134
135
|
credentials = Credentials.new credentials, scope: @config.scope
|
135
136
|
end
|
136
137
|
|
138
|
+
@region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
|
139
|
+
config.credentials = credentials
|
140
|
+
config.endpoint = @config.endpoint
|
141
|
+
end
|
142
|
+
|
137
143
|
@region_ssl_certificates_stub = ::Google::Cloud::Compute::V1::RegionSslCertificates::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
138
144
|
end
|
139
145
|
|
146
|
+
##
|
147
|
+
# Get the associated client for long-running operations via RegionOperations.
|
148
|
+
#
|
149
|
+
# @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
|
150
|
+
#
|
151
|
+
attr_reader :region_operations
|
152
|
+
|
140
153
|
# Service calls
|
141
154
|
|
142
155
|
##
|
@@ -168,10 +181,10 @@ module Google
|
|
168
181
|
# @param ssl_certificate [::String]
|
169
182
|
# Name of the SslCertificate resource to delete.
|
170
183
|
# @yield [result, response] Access the result along with the Faraday response object
|
171
|
-
# @yieldparam result [::Gapic::
|
184
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
172
185
|
# @yieldparam response [::Faraday::Response]
|
173
186
|
#
|
174
|
-
# @return [::Gapic::
|
187
|
+
# @return [::Gapic::GenericLRO::Operation]
|
175
188
|
#
|
176
189
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
177
190
|
def delete request, options = nil
|
@@ -198,7 +211,15 @@ module Google
|
|
198
211
|
metadata: @config.metadata
|
199
212
|
|
200
213
|
@region_ssl_certificates_stub.delete request, options do |result, response|
|
201
|
-
result = ::
|
214
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
215
|
+
operation: result,
|
216
|
+
client: region_operations,
|
217
|
+
request_values: {
|
218
|
+
"project" => request.project,
|
219
|
+
"region" => request.region
|
220
|
+
},
|
221
|
+
options: options
|
222
|
+
)
|
202
223
|
yield result, response if block_given?
|
203
224
|
return result
|
204
225
|
end
|
@@ -301,10 +322,10 @@ module Google
|
|
301
322
|
# @param ssl_certificate_resource [::Google::Cloud::Compute::V1::SslCertificate, ::Hash]
|
302
323
|
# The body resource for this request
|
303
324
|
# @yield [result, response] Access the result along with the Faraday response object
|
304
|
-
# @yieldparam result [::Gapic::
|
325
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
305
326
|
# @yieldparam response [::Faraday::Response]
|
306
327
|
#
|
307
|
-
# @return [::Gapic::
|
328
|
+
# @return [::Gapic::GenericLRO::Operation]
|
308
329
|
#
|
309
330
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
310
331
|
def insert request, options = nil
|
@@ -331,7 +352,15 @@ module Google
|
|
331
352
|
metadata: @config.metadata
|
332
353
|
|
333
354
|
@region_ssl_certificates_stub.insert request, options do |result, response|
|
334
|
-
result = ::
|
355
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
356
|
+
operation: result,
|
357
|
+
client: region_operations,
|
358
|
+
request_values: {
|
359
|
+
"project" => request.project,
|
360
|
+
"region" => request.region
|
361
|
+
},
|
362
|
+
options: options
|
363
|
+
)
|
335
364
|
yield result, response if block_given?
|
336
365
|
return result
|
337
366
|
end
|
@@ -361,7 +390,7 @@ module Google
|
|
361
390
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
362
391
|
#
|
363
392
|
# @param filter [::String]
|
364
|
-
# A filter expression that filters resources listed in the response.
|
393
|
+
# 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 `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. 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`.
|
365
394
|
# @param max_results [::Integer]
|
366
395
|
# 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`)
|
367
396
|
# @param order_by [::String]
|
@@ -19,6 +19,7 @@
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/compute/v1/compute_pb"
|
21
21
|
require "google/cloud/compute/v1/region_target_http_proxies/rest/service_stub"
|
22
|
+
require "google/cloud/compute/v1/region_operations/rest"
|
22
23
|
|
23
24
|
module Google
|
24
25
|
module Cloud
|
@@ -136,9 +137,21 @@ module Google
|
|
136
137
|
credentials = Credentials.new credentials, scope: @config.scope
|
137
138
|
end
|
138
139
|
|
140
|
+
@region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
|
141
|
+
config.credentials = credentials
|
142
|
+
config.endpoint = @config.endpoint
|
143
|
+
end
|
144
|
+
|
139
145
|
@region_target_http_proxies_stub = ::Google::Cloud::Compute::V1::RegionTargetHttpProxies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
140
146
|
end
|
141
147
|
|
148
|
+
##
|
149
|
+
# Get the associated client for long-running operations via RegionOperations.
|
150
|
+
#
|
151
|
+
# @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
|
152
|
+
#
|
153
|
+
attr_reader :region_operations
|
154
|
+
|
142
155
|
# Service calls
|
143
156
|
|
144
157
|
##
|
@@ -170,10 +183,10 @@ module Google
|
|
170
183
|
# @param target_http_proxy [::String]
|
171
184
|
# Name of the TargetHttpProxy resource to delete.
|
172
185
|
# @yield [result, response] Access the result along with the Faraday response object
|
173
|
-
# @yieldparam result [::Gapic::
|
186
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
174
187
|
# @yieldparam response [::Faraday::Response]
|
175
188
|
#
|
176
|
-
# @return [::Gapic::
|
189
|
+
# @return [::Gapic::GenericLRO::Operation]
|
177
190
|
#
|
178
191
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
179
192
|
def delete request, options = nil
|
@@ -200,7 +213,15 @@ module Google
|
|
200
213
|
metadata: @config.metadata
|
201
214
|
|
202
215
|
@region_target_http_proxies_stub.delete request, options do |result, response|
|
203
|
-
result = ::
|
216
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
217
|
+
operation: result,
|
218
|
+
client: region_operations,
|
219
|
+
request_values: {
|
220
|
+
"project" => request.project,
|
221
|
+
"region" => request.region
|
222
|
+
},
|
223
|
+
options: options
|
224
|
+
)
|
204
225
|
yield result, response if block_given?
|
205
226
|
return result
|
206
227
|
end
|
@@ -303,10 +324,10 @@ module Google
|
|
303
324
|
# @param target_http_proxy_resource [::Google::Cloud::Compute::V1::TargetHttpProxy, ::Hash]
|
304
325
|
# The body resource for this request
|
305
326
|
# @yield [result, response] Access the result along with the Faraday response object
|
306
|
-
# @yieldparam result [::Gapic::
|
327
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
307
328
|
# @yieldparam response [::Faraday::Response]
|
308
329
|
#
|
309
|
-
# @return [::Gapic::
|
330
|
+
# @return [::Gapic::GenericLRO::Operation]
|
310
331
|
#
|
311
332
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
312
333
|
def insert request, options = nil
|
@@ -333,7 +354,15 @@ module Google
|
|
333
354
|
metadata: @config.metadata
|
334
355
|
|
335
356
|
@region_target_http_proxies_stub.insert request, options do |result, response|
|
336
|
-
result = ::
|
357
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
358
|
+
operation: result,
|
359
|
+
client: region_operations,
|
360
|
+
request_values: {
|
361
|
+
"project" => request.project,
|
362
|
+
"region" => request.region
|
363
|
+
},
|
364
|
+
options: options
|
365
|
+
)
|
337
366
|
yield result, response if block_given?
|
338
367
|
return result
|
339
368
|
end
|
@@ -363,7 +392,7 @@ module Google
|
|
363
392
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
364
393
|
#
|
365
394
|
# @param filter [::String]
|
366
|
-
# A filter expression that filters resources listed in the response.
|
395
|
+
# 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 `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. 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`.
|
367
396
|
# @param max_results [::Integer]
|
368
397
|
# 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`)
|
369
398
|
# @param order_by [::String]
|
@@ -447,10 +476,10 @@ module Google
|
|
447
476
|
# @param url_map_reference_resource [::Google::Cloud::Compute::V1::UrlMapReference, ::Hash]
|
448
477
|
# The body resource for this request
|
449
478
|
# @yield [result, response] Access the result along with the Faraday response object
|
450
|
-
# @yieldparam result [::Gapic::
|
479
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
451
480
|
# @yieldparam response [::Faraday::Response]
|
452
481
|
#
|
453
|
-
# @return [::Gapic::
|
482
|
+
# @return [::Gapic::GenericLRO::Operation]
|
454
483
|
#
|
455
484
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
456
485
|
def set_url_map request, options = nil
|
@@ -477,7 +506,15 @@ module Google
|
|
477
506
|
metadata: @config.metadata
|
478
507
|
|
479
508
|
@region_target_http_proxies_stub.set_url_map request, options do |result, response|
|
480
|
-
result = ::
|
509
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
510
|
+
operation: result,
|
511
|
+
client: region_operations,
|
512
|
+
request_values: {
|
513
|
+
"project" => request.project,
|
514
|
+
"region" => request.region
|
515
|
+
},
|
516
|
+
options: options
|
517
|
+
)
|
481
518
|
yield result, response if block_given?
|
482
519
|
return result
|
483
520
|
end
|