google-cloud-app_engine-v1 0.5.0 → 0.6.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 +2 -2
- data/lib/google/appengine/v1/appengine_pb.rb +0 -1
- data/lib/google/cloud/app_engine/v1/applications/client.rb +12 -12
- data/lib/google/cloud/app_engine/v1/applications/operations.rb +12 -14
- data/lib/google/cloud/app_engine/v1/applications/rest/client.rb +589 -0
- data/lib/google/cloud/app_engine/v1/applications/rest/operations.rb +793 -0
- data/lib/google/cloud/app_engine/v1/applications/rest/service_stub.rb +285 -0
- data/lib/google/cloud/app_engine/v1/applications/rest.rb +52 -0
- data/lib/google/cloud/app_engine/v1/applications.rb +7 -1
- data/lib/google/cloud/app_engine/v1/authorized_certificates/client.rb +4 -6
- data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/client.rb +643 -0
- data/lib/google/cloud/app_engine/v1/authorized_certificates/rest/service_stub.rb +345 -0
- data/lib/google/cloud/app_engine/v1/authorized_certificates/rest.rb +52 -0
- data/lib/google/cloud/app_engine/v1/authorized_certificates.rb +7 -1
- data/lib/google/cloud/app_engine/v1/authorized_domains/client.rb +4 -6
- data/lib/google/cloud/app_engine/v1/authorized_domains/rest/client.rb +349 -0
- data/lib/google/cloud/app_engine/v1/authorized_domains/rest/service_stub.rb +107 -0
- data/lib/google/cloud/app_engine/v1/authorized_domains/rest.rb +53 -0
- data/lib/google/cloud/app_engine/v1/authorized_domains.rb +7 -1
- data/lib/google/cloud/app_engine/v1/domain_mappings/client.rb +16 -18
- data/lib/google/cloud/app_engine/v1/domain_mappings/operations.rb +12 -14
- data/lib/google/cloud/app_engine/v1/domain_mappings/rest/client.rb +659 -0
- data/lib/google/cloud/app_engine/v1/domain_mappings/rest/operations.rb +793 -0
- data/lib/google/cloud/app_engine/v1/domain_mappings/rest/service_stub.rb +345 -0
- data/lib/google/cloud/app_engine/v1/domain_mappings/rest.rb +52 -0
- data/lib/google/cloud/app_engine/v1/domain_mappings.rb +7 -1
- data/lib/google/cloud/app_engine/v1/firewall/client.rb +4 -6
- data/lib/google/cloud/app_engine/v1/firewall/rest/client.rb +732 -0
- data/lib/google/cloud/app_engine/v1/firewall/rest/service_stub.rb +405 -0
- data/lib/google/cloud/app_engine/v1/firewall/rest.rb +60 -0
- data/lib/google/cloud/app_engine/v1/firewall.rb +7 -1
- data/lib/google/cloud/app_engine/v1/instances/client.rb +12 -14
- data/lib/google/cloud/app_engine/v1/instances/operations.rb +12 -14
- data/lib/google/cloud/app_engine/v1/instances/rest/client.rb +602 -0
- data/lib/google/cloud/app_engine/v1/instances/rest/operations.rb +793 -0
- data/lib/google/cloud/app_engine/v1/instances/rest/service_stub.rb +285 -0
- data/lib/google/cloud/app_engine/v1/instances/rest.rb +52 -0
- data/lib/google/cloud/app_engine/v1/instances.rb +7 -1
- data/lib/google/cloud/app_engine/v1/rest.rb +44 -0
- data/lib/google/cloud/app_engine/v1/services/client.rb +12 -14
- data/lib/google/cloud/app_engine/v1/services/operations.rb +12 -14
- data/lib/google/cloud/app_engine/v1/services/rest/client.rb +587 -0
- data/lib/google/cloud/app_engine/v1/services/rest/operations.rb +793 -0
- data/lib/google/cloud/app_engine/v1/services/rest/service_stub.rb +285 -0
- data/lib/google/cloud/app_engine/v1/services/rest.rb +52 -0
- data/lib/google/cloud/app_engine/v1/services.rb +7 -1
- data/lib/google/cloud/app_engine/v1/version.rb +1 -1
- data/lib/google/cloud/app_engine/v1/versions/client.rb +16 -18
- data/lib/google/cloud/app_engine/v1/versions/operations.rb +12 -14
- data/lib/google/cloud/app_engine/v1/versions/rest/client.rb +692 -0
- data/lib/google/cloud/app_engine/v1/versions/rest/operations.rb +793 -0
- data/lib/google/cloud/app_engine/v1/versions/rest/service_stub.rb +345 -0
- data/lib/google/cloud/app_engine/v1/versions/rest.rb +52 -0
- data/lib/google/cloud/app_engine/v1/versions.rb +7 -1
- data/lib/google/cloud/app_engine/v1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +40 -8
@@ -0,0 +1,732 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/appengine/v1/appengine_pb"
|
21
|
+
require "google/cloud/app_engine/v1/firewall/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module AppEngine
|
26
|
+
module V1
|
27
|
+
module Firewall
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the Firewall service.
|
31
|
+
#
|
32
|
+
# Firewall resources are used to define a collection of access control rules
|
33
|
+
# for an Application. Each rule is defined with a position which specifies
|
34
|
+
# the rule's order in the sequence of rules, an IP range to be matched against
|
35
|
+
# requests, and an action to take upon matching requests.
|
36
|
+
#
|
37
|
+
# Every request is evaluated against the Firewall rules in priority order.
|
38
|
+
# Processesing stops at the first rule which matches the request's IP address.
|
39
|
+
# A final rule always specifies an action that applies to all remaining
|
40
|
+
# IP addresses. The default final rule for a newly-created application will be
|
41
|
+
# set to "allow" if not otherwise specified by the user.
|
42
|
+
#
|
43
|
+
class Client
|
44
|
+
# @private
|
45
|
+
attr_reader :firewall_stub
|
46
|
+
|
47
|
+
##
|
48
|
+
# Configure the Firewall Client class.
|
49
|
+
#
|
50
|
+
# See {::Google::Cloud::AppEngine::V1::Firewall::Rest::Client::Configuration}
|
51
|
+
# for a description of the configuration fields.
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
#
|
55
|
+
# # Modify the configuration for all Firewall clients
|
56
|
+
# ::Google::Cloud::AppEngine::V1::Firewall::Rest::Client.configure do |config|
|
57
|
+
# config.timeout = 10.0
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# @yield [config] Configure the Client client.
|
61
|
+
# @yieldparam config [Client::Configuration]
|
62
|
+
#
|
63
|
+
# @return [Client::Configuration]
|
64
|
+
#
|
65
|
+
def self.configure
|
66
|
+
@configure ||= begin
|
67
|
+
namespace = ["Google", "Cloud", "AppEngine", "V1"]
|
68
|
+
parent_config = while namespace.any?
|
69
|
+
parent_name = namespace.join "::"
|
70
|
+
parent_const = const_get parent_name
|
71
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
72
|
+
namespace.pop
|
73
|
+
end
|
74
|
+
default_config = Client::Configuration.new parent_config
|
75
|
+
|
76
|
+
default_config
|
77
|
+
end
|
78
|
+
yield @configure if block_given?
|
79
|
+
@configure
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Configure the Firewall Client instance.
|
84
|
+
#
|
85
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
86
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
87
|
+
# should be made on {Client.configure}.
|
88
|
+
#
|
89
|
+
# See {::Google::Cloud::AppEngine::V1::Firewall::Rest::Client::Configuration}
|
90
|
+
# for a description of the configuration fields.
|
91
|
+
#
|
92
|
+
# @yield [config] Configure the Client client.
|
93
|
+
# @yieldparam config [Client::Configuration]
|
94
|
+
#
|
95
|
+
# @return [Client::Configuration]
|
96
|
+
#
|
97
|
+
def configure
|
98
|
+
yield @config if block_given?
|
99
|
+
@config
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
# Create a new Firewall REST client object.
|
104
|
+
#
|
105
|
+
# @example
|
106
|
+
#
|
107
|
+
# # Create a client using the default configuration
|
108
|
+
# client = ::Google::Cloud::AppEngine::V1::Firewall::Rest::Client.new
|
109
|
+
#
|
110
|
+
# # Create a client using a custom configuration
|
111
|
+
# client = ::Google::Cloud::AppEngine::V1::Firewall::Rest::Client.new do |config|
|
112
|
+
# config.timeout = 10.0
|
113
|
+
# end
|
114
|
+
#
|
115
|
+
# @yield [config] Configure the Firewall client.
|
116
|
+
# @yieldparam config [Client::Configuration]
|
117
|
+
#
|
118
|
+
def initialize
|
119
|
+
# Create the configuration object
|
120
|
+
@config = Configuration.new Client.configure
|
121
|
+
|
122
|
+
# Yield the configuration if needed
|
123
|
+
yield @config if block_given?
|
124
|
+
|
125
|
+
# Create credentials
|
126
|
+
credentials = @config.credentials
|
127
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
128
|
+
# but only if the default endpoint does not have a region prefix.
|
129
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
130
|
+
!@config.endpoint.split(".").first.include?("-")
|
131
|
+
credentials ||= Credentials.default scope: @config.scope,
|
132
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
133
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
134
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
135
|
+
end
|
136
|
+
|
137
|
+
@quota_project_id = @config.quota_project
|
138
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
139
|
+
|
140
|
+
@firewall_stub = ::Google::Cloud::AppEngine::V1::Firewall::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
141
|
+
end
|
142
|
+
|
143
|
+
# Service calls
|
144
|
+
|
145
|
+
##
|
146
|
+
# Lists the firewall rules of an application.
|
147
|
+
#
|
148
|
+
# @overload list_ingress_rules(request, options = nil)
|
149
|
+
# Pass arguments to `list_ingress_rules` via a request object, either of type
|
150
|
+
# {::Google::Cloud::AppEngine::V1::ListIngressRulesRequest} or an equivalent Hash.
|
151
|
+
#
|
152
|
+
# @param request [::Google::Cloud::AppEngine::V1::ListIngressRulesRequest, ::Hash]
|
153
|
+
# A request object representing the call parameters. Required. To specify no
|
154
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
155
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
156
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
157
|
+
#
|
158
|
+
# @overload list_ingress_rules(parent: nil, page_size: nil, page_token: nil, matching_address: nil)
|
159
|
+
# Pass arguments to `list_ingress_rules` via keyword arguments. Note that at
|
160
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
161
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
162
|
+
#
|
163
|
+
# @param parent [::String]
|
164
|
+
# Name of the Firewall collection to retrieve.
|
165
|
+
# Example: `apps/myapp/firewall/ingressRules`.
|
166
|
+
# @param page_size [::Integer]
|
167
|
+
# Maximum results to return per page.
|
168
|
+
# @param page_token [::String]
|
169
|
+
# Continuation token for fetching the next page of results.
|
170
|
+
# @param matching_address [::String]
|
171
|
+
# A valid IP Address. If set, only rules matching this address will be
|
172
|
+
# returned. The first returned rule will be the rule that fires on requests
|
173
|
+
# from this IP.
|
174
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
175
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::FirewallRule>]
|
176
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
177
|
+
#
|
178
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::FirewallRule>]
|
179
|
+
#
|
180
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
181
|
+
def list_ingress_rules request, options = nil
|
182
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
183
|
+
|
184
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListIngressRulesRequest
|
185
|
+
|
186
|
+
# Converts hash and nil to an options object
|
187
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
188
|
+
|
189
|
+
# Customize the options with defaults
|
190
|
+
call_metadata = @config.rpcs.list_ingress_rules.metadata.to_h
|
191
|
+
|
192
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
193
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
194
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
195
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
196
|
+
transports_version_send: [:rest]
|
197
|
+
|
198
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
199
|
+
|
200
|
+
options.apply_defaults timeout: @config.rpcs.list_ingress_rules.timeout,
|
201
|
+
metadata: call_metadata,
|
202
|
+
retry_policy: @config.rpcs.list_ingress_rules.retry_policy
|
203
|
+
|
204
|
+
options.apply_defaults timeout: @config.timeout,
|
205
|
+
metadata: @config.metadata,
|
206
|
+
retry_policy: @config.retry_policy
|
207
|
+
|
208
|
+
@firewall_stub.list_ingress_rules request, options do |result, operation|
|
209
|
+
result = ::Gapic::Rest::PagedEnumerable.new @firewall_stub, :list_ingress_rules, "ingress_rules", request, result, options
|
210
|
+
yield result, operation if block_given?
|
211
|
+
return result
|
212
|
+
end
|
213
|
+
rescue ::Gapic::Rest::Error => e
|
214
|
+
raise ::Google::Cloud::Error.from_error(e)
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# Replaces the entire firewall ruleset in one bulk operation. This overrides
|
219
|
+
# and replaces the rules of an existing firewall with the new rules.
|
220
|
+
#
|
221
|
+
# If the final rule does not match traffic with the '*' wildcard IP range,
|
222
|
+
# then an "allow all" rule is explicitly added to the end of the list.
|
223
|
+
#
|
224
|
+
# @overload batch_update_ingress_rules(request, options = nil)
|
225
|
+
# Pass arguments to `batch_update_ingress_rules` via a request object, either of type
|
226
|
+
# {::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest} or an equivalent Hash.
|
227
|
+
#
|
228
|
+
# @param request [::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest, ::Hash]
|
229
|
+
# A request object representing the call parameters. Required. To specify no
|
230
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
231
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
232
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
233
|
+
#
|
234
|
+
# @overload batch_update_ingress_rules(name: nil, ingress_rules: nil)
|
235
|
+
# Pass arguments to `batch_update_ingress_rules` via keyword arguments. Note that at
|
236
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
237
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
238
|
+
#
|
239
|
+
# @param name [::String]
|
240
|
+
# Name of the Firewall collection to set.
|
241
|
+
# Example: `apps/myapp/firewall/ingressRules`.
|
242
|
+
# @param ingress_rules [::Array<::Google::Cloud::AppEngine::V1::FirewallRule, ::Hash>]
|
243
|
+
# A list of FirewallRules to replace the existing set.
|
244
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
245
|
+
# @yieldparam result [::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse]
|
246
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
247
|
+
#
|
248
|
+
# @return [::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse]
|
249
|
+
#
|
250
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
251
|
+
def batch_update_ingress_rules request, options = nil
|
252
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
253
|
+
|
254
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest
|
255
|
+
|
256
|
+
# Converts hash and nil to an options object
|
257
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
258
|
+
|
259
|
+
# Customize the options with defaults
|
260
|
+
call_metadata = @config.rpcs.batch_update_ingress_rules.metadata.to_h
|
261
|
+
|
262
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
263
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
264
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
265
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
266
|
+
transports_version_send: [:rest]
|
267
|
+
|
268
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
269
|
+
|
270
|
+
options.apply_defaults timeout: @config.rpcs.batch_update_ingress_rules.timeout,
|
271
|
+
metadata: call_metadata,
|
272
|
+
retry_policy: @config.rpcs.batch_update_ingress_rules.retry_policy
|
273
|
+
|
274
|
+
options.apply_defaults timeout: @config.timeout,
|
275
|
+
metadata: @config.metadata,
|
276
|
+
retry_policy: @config.retry_policy
|
277
|
+
|
278
|
+
@firewall_stub.batch_update_ingress_rules request, options do |result, operation|
|
279
|
+
yield result, operation if block_given?
|
280
|
+
return result
|
281
|
+
end
|
282
|
+
rescue ::Gapic::Rest::Error => e
|
283
|
+
raise ::Google::Cloud::Error.from_error(e)
|
284
|
+
end
|
285
|
+
|
286
|
+
##
|
287
|
+
# Creates a firewall rule for the application.
|
288
|
+
#
|
289
|
+
# @overload create_ingress_rule(request, options = nil)
|
290
|
+
# Pass arguments to `create_ingress_rule` via a request object, either of type
|
291
|
+
# {::Google::Cloud::AppEngine::V1::CreateIngressRuleRequest} or an equivalent Hash.
|
292
|
+
#
|
293
|
+
# @param request [::Google::Cloud::AppEngine::V1::CreateIngressRuleRequest, ::Hash]
|
294
|
+
# A request object representing the call parameters. Required. To specify no
|
295
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
296
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
297
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
298
|
+
#
|
299
|
+
# @overload create_ingress_rule(parent: nil, rule: nil)
|
300
|
+
# Pass arguments to `create_ingress_rule` via keyword arguments. Note that at
|
301
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
302
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
303
|
+
#
|
304
|
+
# @param parent [::String]
|
305
|
+
# Name of the parent Firewall collection in which to create a new rule.
|
306
|
+
# Example: `apps/myapp/firewall/ingressRules`.
|
307
|
+
# @param rule [::Google::Cloud::AppEngine::V1::FirewallRule, ::Hash]
|
308
|
+
# A FirewallRule containing the new resource.
|
309
|
+
#
|
310
|
+
# The user may optionally provide a position at which the new rule will be
|
311
|
+
# placed. The positions define a sequential list starting at 1. If a rule
|
312
|
+
# already exists at the given position, rules greater than the provided
|
313
|
+
# position will be moved forward by one.
|
314
|
+
#
|
315
|
+
# If no position is provided, the server will place the rule as the second to
|
316
|
+
# last rule in the sequence before the required default allow-all or deny-all
|
317
|
+
# rule.
|
318
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
319
|
+
# @yieldparam result [::Google::Cloud::AppEngine::V1::FirewallRule]
|
320
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
321
|
+
#
|
322
|
+
# @return [::Google::Cloud::AppEngine::V1::FirewallRule]
|
323
|
+
#
|
324
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
325
|
+
def create_ingress_rule request, options = nil
|
326
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
327
|
+
|
328
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::CreateIngressRuleRequest
|
329
|
+
|
330
|
+
# Converts hash and nil to an options object
|
331
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
332
|
+
|
333
|
+
# Customize the options with defaults
|
334
|
+
call_metadata = @config.rpcs.create_ingress_rule.metadata.to_h
|
335
|
+
|
336
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
337
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
338
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
339
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
340
|
+
transports_version_send: [:rest]
|
341
|
+
|
342
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
343
|
+
|
344
|
+
options.apply_defaults timeout: @config.rpcs.create_ingress_rule.timeout,
|
345
|
+
metadata: call_metadata,
|
346
|
+
retry_policy: @config.rpcs.create_ingress_rule.retry_policy
|
347
|
+
|
348
|
+
options.apply_defaults timeout: @config.timeout,
|
349
|
+
metadata: @config.metadata,
|
350
|
+
retry_policy: @config.retry_policy
|
351
|
+
|
352
|
+
@firewall_stub.create_ingress_rule request, options do |result, operation|
|
353
|
+
yield result, operation if block_given?
|
354
|
+
return result
|
355
|
+
end
|
356
|
+
rescue ::Gapic::Rest::Error => e
|
357
|
+
raise ::Google::Cloud::Error.from_error(e)
|
358
|
+
end
|
359
|
+
|
360
|
+
##
|
361
|
+
# Gets the specified firewall rule.
|
362
|
+
#
|
363
|
+
# @overload get_ingress_rule(request, options = nil)
|
364
|
+
# Pass arguments to `get_ingress_rule` via a request object, either of type
|
365
|
+
# {::Google::Cloud::AppEngine::V1::GetIngressRuleRequest} or an equivalent Hash.
|
366
|
+
#
|
367
|
+
# @param request [::Google::Cloud::AppEngine::V1::GetIngressRuleRequest, ::Hash]
|
368
|
+
# A request object representing the call parameters. Required. To specify no
|
369
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
370
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
371
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
372
|
+
#
|
373
|
+
# @overload get_ingress_rule(name: nil)
|
374
|
+
# Pass arguments to `get_ingress_rule` via keyword arguments. Note that at
|
375
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
376
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
377
|
+
#
|
378
|
+
# @param name [::String]
|
379
|
+
# Name of the Firewall resource to retrieve.
|
380
|
+
# Example: `apps/myapp/firewall/ingressRules/100`.
|
381
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
382
|
+
# @yieldparam result [::Google::Cloud::AppEngine::V1::FirewallRule]
|
383
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
384
|
+
#
|
385
|
+
# @return [::Google::Cloud::AppEngine::V1::FirewallRule]
|
386
|
+
#
|
387
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
388
|
+
def get_ingress_rule request, options = nil
|
389
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
390
|
+
|
391
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::GetIngressRuleRequest
|
392
|
+
|
393
|
+
# Converts hash and nil to an options object
|
394
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
395
|
+
|
396
|
+
# Customize the options with defaults
|
397
|
+
call_metadata = @config.rpcs.get_ingress_rule.metadata.to_h
|
398
|
+
|
399
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
400
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
401
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
402
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
403
|
+
transports_version_send: [:rest]
|
404
|
+
|
405
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
406
|
+
|
407
|
+
options.apply_defaults timeout: @config.rpcs.get_ingress_rule.timeout,
|
408
|
+
metadata: call_metadata,
|
409
|
+
retry_policy: @config.rpcs.get_ingress_rule.retry_policy
|
410
|
+
|
411
|
+
options.apply_defaults timeout: @config.timeout,
|
412
|
+
metadata: @config.metadata,
|
413
|
+
retry_policy: @config.retry_policy
|
414
|
+
|
415
|
+
@firewall_stub.get_ingress_rule request, options do |result, operation|
|
416
|
+
yield result, operation if block_given?
|
417
|
+
return result
|
418
|
+
end
|
419
|
+
rescue ::Gapic::Rest::Error => e
|
420
|
+
raise ::Google::Cloud::Error.from_error(e)
|
421
|
+
end
|
422
|
+
|
423
|
+
##
|
424
|
+
# Updates the specified firewall rule.
|
425
|
+
#
|
426
|
+
# @overload update_ingress_rule(request, options = nil)
|
427
|
+
# Pass arguments to `update_ingress_rule` via a request object, either of type
|
428
|
+
# {::Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest} or an equivalent Hash.
|
429
|
+
#
|
430
|
+
# @param request [::Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest, ::Hash]
|
431
|
+
# A request object representing the call parameters. Required. To specify no
|
432
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
433
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
434
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
435
|
+
#
|
436
|
+
# @overload update_ingress_rule(name: nil, rule: nil, update_mask: nil)
|
437
|
+
# Pass arguments to `update_ingress_rule` via keyword arguments. Note that at
|
438
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
439
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
440
|
+
#
|
441
|
+
# @param name [::String]
|
442
|
+
# Name of the Firewall resource to update.
|
443
|
+
# Example: `apps/myapp/firewall/ingressRules/100`.
|
444
|
+
# @param rule [::Google::Cloud::AppEngine::V1::FirewallRule, ::Hash]
|
445
|
+
# A FirewallRule containing the updated resource
|
446
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
447
|
+
# Standard field mask for the set of fields to be updated.
|
448
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
449
|
+
# @yieldparam result [::Google::Cloud::AppEngine::V1::FirewallRule]
|
450
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
451
|
+
#
|
452
|
+
# @return [::Google::Cloud::AppEngine::V1::FirewallRule]
|
453
|
+
#
|
454
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
455
|
+
def update_ingress_rule request, options = nil
|
456
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
457
|
+
|
458
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest
|
459
|
+
|
460
|
+
# Converts hash and nil to an options object
|
461
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
462
|
+
|
463
|
+
# Customize the options with defaults
|
464
|
+
call_metadata = @config.rpcs.update_ingress_rule.metadata.to_h
|
465
|
+
|
466
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
467
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
468
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
469
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
470
|
+
transports_version_send: [:rest]
|
471
|
+
|
472
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
473
|
+
|
474
|
+
options.apply_defaults timeout: @config.rpcs.update_ingress_rule.timeout,
|
475
|
+
metadata: call_metadata,
|
476
|
+
retry_policy: @config.rpcs.update_ingress_rule.retry_policy
|
477
|
+
|
478
|
+
options.apply_defaults timeout: @config.timeout,
|
479
|
+
metadata: @config.metadata,
|
480
|
+
retry_policy: @config.retry_policy
|
481
|
+
|
482
|
+
@firewall_stub.update_ingress_rule request, options do |result, operation|
|
483
|
+
yield result, operation if block_given?
|
484
|
+
return result
|
485
|
+
end
|
486
|
+
rescue ::Gapic::Rest::Error => e
|
487
|
+
raise ::Google::Cloud::Error.from_error(e)
|
488
|
+
end
|
489
|
+
|
490
|
+
##
|
491
|
+
# Deletes the specified firewall rule.
|
492
|
+
#
|
493
|
+
# @overload delete_ingress_rule(request, options = nil)
|
494
|
+
# Pass arguments to `delete_ingress_rule` via a request object, either of type
|
495
|
+
# {::Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest} or an equivalent Hash.
|
496
|
+
#
|
497
|
+
# @param request [::Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest, ::Hash]
|
498
|
+
# A request object representing the call parameters. Required. To specify no
|
499
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
500
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
501
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
502
|
+
#
|
503
|
+
# @overload delete_ingress_rule(name: nil)
|
504
|
+
# Pass arguments to `delete_ingress_rule` via keyword arguments. Note that at
|
505
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
506
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
507
|
+
#
|
508
|
+
# @param name [::String]
|
509
|
+
# Name of the Firewall resource to delete.
|
510
|
+
# Example: `apps/myapp/firewall/ingressRules/100`.
|
511
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
512
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
513
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
514
|
+
#
|
515
|
+
# @return [::Google::Protobuf::Empty]
|
516
|
+
#
|
517
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
518
|
+
def delete_ingress_rule request, options = nil
|
519
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
520
|
+
|
521
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest
|
522
|
+
|
523
|
+
# Converts hash and nil to an options object
|
524
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
525
|
+
|
526
|
+
# Customize the options with defaults
|
527
|
+
call_metadata = @config.rpcs.delete_ingress_rule.metadata.to_h
|
528
|
+
|
529
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
530
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
531
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
532
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
533
|
+
transports_version_send: [:rest]
|
534
|
+
|
535
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
536
|
+
|
537
|
+
options.apply_defaults timeout: @config.rpcs.delete_ingress_rule.timeout,
|
538
|
+
metadata: call_metadata,
|
539
|
+
retry_policy: @config.rpcs.delete_ingress_rule.retry_policy
|
540
|
+
|
541
|
+
options.apply_defaults timeout: @config.timeout,
|
542
|
+
metadata: @config.metadata,
|
543
|
+
retry_policy: @config.retry_policy
|
544
|
+
|
545
|
+
@firewall_stub.delete_ingress_rule request, options do |result, operation|
|
546
|
+
yield result, operation if block_given?
|
547
|
+
return result
|
548
|
+
end
|
549
|
+
rescue ::Gapic::Rest::Error => e
|
550
|
+
raise ::Google::Cloud::Error.from_error(e)
|
551
|
+
end
|
552
|
+
|
553
|
+
##
|
554
|
+
# Configuration class for the Firewall REST API.
|
555
|
+
#
|
556
|
+
# This class represents the configuration for Firewall REST,
|
557
|
+
# providing control over timeouts, retry behavior, logging, transport
|
558
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
559
|
+
# applied individually to specific RPCs. See
|
560
|
+
# {::Google::Cloud::AppEngine::V1::Firewall::Rest::Client::Configuration::Rpcs}
|
561
|
+
# for a list of RPCs that can be configured independently.
|
562
|
+
#
|
563
|
+
# Configuration can be applied globally to all clients, or to a single client
|
564
|
+
# on construction.
|
565
|
+
#
|
566
|
+
# @example
|
567
|
+
#
|
568
|
+
# # Modify the global config, setting the timeout for
|
569
|
+
# # list_ingress_rules to 20 seconds,
|
570
|
+
# # and all remaining timeouts to 10 seconds.
|
571
|
+
# ::Google::Cloud::AppEngine::V1::Firewall::Rest::Client.configure do |config|
|
572
|
+
# config.timeout = 10.0
|
573
|
+
# config.rpcs.list_ingress_rules.timeout = 20.0
|
574
|
+
# end
|
575
|
+
#
|
576
|
+
# # Apply the above configuration only to a new client.
|
577
|
+
# client = ::Google::Cloud::AppEngine::V1::Firewall::Rest::Client.new do |config|
|
578
|
+
# config.timeout = 10.0
|
579
|
+
# config.rpcs.list_ingress_rules.timeout = 20.0
|
580
|
+
# end
|
581
|
+
#
|
582
|
+
# @!attribute [rw] endpoint
|
583
|
+
# The hostname or hostname:port of the service endpoint.
|
584
|
+
# Defaults to `"appengine.googleapis.com"`.
|
585
|
+
# @return [::String]
|
586
|
+
# @!attribute [rw] credentials
|
587
|
+
# Credentials to send with calls. You may provide any of the following types:
|
588
|
+
# * (`String`) The path to a service account key file in JSON format
|
589
|
+
# * (`Hash`) A service account key as a Hash
|
590
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
591
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
592
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
593
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
594
|
+
# * (`nil`) indicating no credentials
|
595
|
+
# @return [::Object]
|
596
|
+
# @!attribute [rw] scope
|
597
|
+
# The OAuth scopes
|
598
|
+
# @return [::Array<::String>]
|
599
|
+
# @!attribute [rw] lib_name
|
600
|
+
# The library name as recorded in instrumentation and logging
|
601
|
+
# @return [::String]
|
602
|
+
# @!attribute [rw] lib_version
|
603
|
+
# The library version as recorded in instrumentation and logging
|
604
|
+
# @return [::String]
|
605
|
+
# @!attribute [rw] timeout
|
606
|
+
# The call timeout in seconds.
|
607
|
+
# @return [::Numeric]
|
608
|
+
# @!attribute [rw] metadata
|
609
|
+
# Additional headers to be sent with the call.
|
610
|
+
# @return [::Hash{::Symbol=>::String}]
|
611
|
+
# @!attribute [rw] retry_policy
|
612
|
+
# The retry policy. The value is a hash with the following keys:
|
613
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
614
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
615
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
616
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
617
|
+
# trigger a retry.
|
618
|
+
# @return [::Hash]
|
619
|
+
# @!attribute [rw] quota_project
|
620
|
+
# A separate project against which to charge quota.
|
621
|
+
# @return [::String]
|
622
|
+
#
|
623
|
+
class Configuration
|
624
|
+
extend ::Gapic::Config
|
625
|
+
|
626
|
+
config_attr :endpoint, "appengine.googleapis.com", ::String
|
627
|
+
config_attr :credentials, nil do |value|
|
628
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
629
|
+
allowed.any? { |klass| klass === value }
|
630
|
+
end
|
631
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
632
|
+
config_attr :lib_name, nil, ::String, nil
|
633
|
+
config_attr :lib_version, nil, ::String, nil
|
634
|
+
config_attr :timeout, nil, ::Numeric, nil
|
635
|
+
config_attr :metadata, nil, ::Hash, nil
|
636
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
637
|
+
config_attr :quota_project, nil, ::String, nil
|
638
|
+
|
639
|
+
# @private
|
640
|
+
def initialize parent_config = nil
|
641
|
+
@parent_config = parent_config unless parent_config.nil?
|
642
|
+
|
643
|
+
yield self if block_given?
|
644
|
+
end
|
645
|
+
|
646
|
+
##
|
647
|
+
# Configurations for individual RPCs
|
648
|
+
# @return [Rpcs]
|
649
|
+
#
|
650
|
+
def rpcs
|
651
|
+
@rpcs ||= begin
|
652
|
+
parent_rpcs = nil
|
653
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
654
|
+
Rpcs.new parent_rpcs
|
655
|
+
end
|
656
|
+
end
|
657
|
+
|
658
|
+
##
|
659
|
+
# Configuration RPC class for the Firewall API.
|
660
|
+
#
|
661
|
+
# Includes fields providing the configuration for each RPC in this service.
|
662
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
663
|
+
# the following configuration fields:
|
664
|
+
#
|
665
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
666
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
667
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
668
|
+
# include the following keys:
|
669
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
670
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
671
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
672
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
673
|
+
# trigger a retry.
|
674
|
+
#
|
675
|
+
class Rpcs
|
676
|
+
##
|
677
|
+
# RPC-specific configuration for `list_ingress_rules`
|
678
|
+
# @return [::Gapic::Config::Method]
|
679
|
+
#
|
680
|
+
attr_reader :list_ingress_rules
|
681
|
+
##
|
682
|
+
# RPC-specific configuration for `batch_update_ingress_rules`
|
683
|
+
# @return [::Gapic::Config::Method]
|
684
|
+
#
|
685
|
+
attr_reader :batch_update_ingress_rules
|
686
|
+
##
|
687
|
+
# RPC-specific configuration for `create_ingress_rule`
|
688
|
+
# @return [::Gapic::Config::Method]
|
689
|
+
#
|
690
|
+
attr_reader :create_ingress_rule
|
691
|
+
##
|
692
|
+
# RPC-specific configuration for `get_ingress_rule`
|
693
|
+
# @return [::Gapic::Config::Method]
|
694
|
+
#
|
695
|
+
attr_reader :get_ingress_rule
|
696
|
+
##
|
697
|
+
# RPC-specific configuration for `update_ingress_rule`
|
698
|
+
# @return [::Gapic::Config::Method]
|
699
|
+
#
|
700
|
+
attr_reader :update_ingress_rule
|
701
|
+
##
|
702
|
+
# RPC-specific configuration for `delete_ingress_rule`
|
703
|
+
# @return [::Gapic::Config::Method]
|
704
|
+
#
|
705
|
+
attr_reader :delete_ingress_rule
|
706
|
+
|
707
|
+
# @private
|
708
|
+
def initialize parent_rpcs = nil
|
709
|
+
list_ingress_rules_config = parent_rpcs.list_ingress_rules if parent_rpcs.respond_to? :list_ingress_rules
|
710
|
+
@list_ingress_rules = ::Gapic::Config::Method.new list_ingress_rules_config
|
711
|
+
batch_update_ingress_rules_config = parent_rpcs.batch_update_ingress_rules if parent_rpcs.respond_to? :batch_update_ingress_rules
|
712
|
+
@batch_update_ingress_rules = ::Gapic::Config::Method.new batch_update_ingress_rules_config
|
713
|
+
create_ingress_rule_config = parent_rpcs.create_ingress_rule if parent_rpcs.respond_to? :create_ingress_rule
|
714
|
+
@create_ingress_rule = ::Gapic::Config::Method.new create_ingress_rule_config
|
715
|
+
get_ingress_rule_config = parent_rpcs.get_ingress_rule if parent_rpcs.respond_to? :get_ingress_rule
|
716
|
+
@get_ingress_rule = ::Gapic::Config::Method.new get_ingress_rule_config
|
717
|
+
update_ingress_rule_config = parent_rpcs.update_ingress_rule if parent_rpcs.respond_to? :update_ingress_rule
|
718
|
+
@update_ingress_rule = ::Gapic::Config::Method.new update_ingress_rule_config
|
719
|
+
delete_ingress_rule_config = parent_rpcs.delete_ingress_rule if parent_rpcs.respond_to? :delete_ingress_rule
|
720
|
+
@delete_ingress_rule = ::Gapic::Config::Method.new delete_ingress_rule_config
|
721
|
+
|
722
|
+
yield self if block_given?
|
723
|
+
end
|
724
|
+
end
|
725
|
+
end
|
726
|
+
end
|
727
|
+
end
|
728
|
+
end
|
729
|
+
end
|
730
|
+
end
|
731
|
+
end
|
732
|
+
end
|