google-cloud-app_engine-v1 0.4.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 +12 -7
- 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 +15 -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 +15 -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 +15 -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 +15 -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 +15 -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 +45 -13
@@ -0,0 +1,692 @@
|
|
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/versions/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module AppEngine
|
26
|
+
module V1
|
27
|
+
module Versions
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the Versions service.
|
31
|
+
#
|
32
|
+
# Manages versions of a service.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
attr_reader :versions_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the Versions Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::AppEngine::V1::Versions::Rest::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
#
|
46
|
+
# # Modify the configuration for all Versions clients
|
47
|
+
# ::Google::Cloud::AppEngine::V1::Versions::Rest::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @yield [config] Configure the Client client.
|
52
|
+
# @yieldparam config [Client::Configuration]
|
53
|
+
#
|
54
|
+
# @return [Client::Configuration]
|
55
|
+
#
|
56
|
+
def self.configure
|
57
|
+
@configure ||= begin
|
58
|
+
namespace = ["Google", "Cloud", "AppEngine", "V1"]
|
59
|
+
parent_config = while namespace.any?
|
60
|
+
parent_name = namespace.join "::"
|
61
|
+
parent_const = const_get parent_name
|
62
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
63
|
+
namespace.pop
|
64
|
+
end
|
65
|
+
default_config = Client::Configuration.new parent_config
|
66
|
+
|
67
|
+
default_config
|
68
|
+
end
|
69
|
+
yield @configure if block_given?
|
70
|
+
@configure
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# Configure the Versions Client instance.
|
75
|
+
#
|
76
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
77
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
78
|
+
# should be made on {Client.configure}.
|
79
|
+
#
|
80
|
+
# See {::Google::Cloud::AppEngine::V1::Versions::Rest::Client::Configuration}
|
81
|
+
# for a description of the configuration fields.
|
82
|
+
#
|
83
|
+
# @yield [config] Configure the Client client.
|
84
|
+
# @yieldparam config [Client::Configuration]
|
85
|
+
#
|
86
|
+
# @return [Client::Configuration]
|
87
|
+
#
|
88
|
+
def configure
|
89
|
+
yield @config if block_given?
|
90
|
+
@config
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Create a new Versions REST client object.
|
95
|
+
#
|
96
|
+
# @example
|
97
|
+
#
|
98
|
+
# # Create a client using the default configuration
|
99
|
+
# client = ::Google::Cloud::AppEngine::V1::Versions::Rest::Client.new
|
100
|
+
#
|
101
|
+
# # Create a client using a custom configuration
|
102
|
+
# client = ::Google::Cloud::AppEngine::V1::Versions::Rest::Client.new do |config|
|
103
|
+
# config.timeout = 10.0
|
104
|
+
# end
|
105
|
+
#
|
106
|
+
# @yield [config] Configure the Versions client.
|
107
|
+
# @yieldparam config [Client::Configuration]
|
108
|
+
#
|
109
|
+
def initialize
|
110
|
+
# Create the configuration object
|
111
|
+
@config = Configuration.new Client.configure
|
112
|
+
|
113
|
+
# Yield the configuration if needed
|
114
|
+
yield @config if block_given?
|
115
|
+
|
116
|
+
# Create credentials
|
117
|
+
credentials = @config.credentials
|
118
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
119
|
+
# but only if the default endpoint does not have a region prefix.
|
120
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
121
|
+
!@config.endpoint.split(".").first.include?("-")
|
122
|
+
credentials ||= Credentials.default scope: @config.scope,
|
123
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
124
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
125
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
126
|
+
end
|
127
|
+
|
128
|
+
@quota_project_id = @config.quota_project
|
129
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
130
|
+
|
131
|
+
@operations_client = ::Google::Cloud::AppEngine::V1::Versions::Rest::Operations.new do |config|
|
132
|
+
config.credentials = credentials
|
133
|
+
config.quota_project = @quota_project_id
|
134
|
+
config.endpoint = @config.endpoint
|
135
|
+
end
|
136
|
+
|
137
|
+
@versions_stub = ::Google::Cloud::AppEngine::V1::Versions::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Get the associated client for long-running operations.
|
142
|
+
#
|
143
|
+
# @return [::Google::Cloud::AppEngine::V1::Versions::Rest::Operations]
|
144
|
+
#
|
145
|
+
attr_reader :operations_client
|
146
|
+
|
147
|
+
# Service calls
|
148
|
+
|
149
|
+
##
|
150
|
+
# Lists the versions of a service.
|
151
|
+
#
|
152
|
+
# @overload list_versions(request, options = nil)
|
153
|
+
# Pass arguments to `list_versions` via a request object, either of type
|
154
|
+
# {::Google::Cloud::AppEngine::V1::ListVersionsRequest} or an equivalent Hash.
|
155
|
+
#
|
156
|
+
# @param request [::Google::Cloud::AppEngine::V1::ListVersionsRequest, ::Hash]
|
157
|
+
# A request object representing the call parameters. Required. To specify no
|
158
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
159
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
160
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
161
|
+
#
|
162
|
+
# @overload list_versions(parent: nil, view: nil, page_size: nil, page_token: nil)
|
163
|
+
# Pass arguments to `list_versions` via keyword arguments. Note that at
|
164
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
165
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
166
|
+
#
|
167
|
+
# @param parent [::String]
|
168
|
+
# Name of the parent Service resource. Example:
|
169
|
+
# `apps/myapp/services/default`.
|
170
|
+
# @param view [::Google::Cloud::AppEngine::V1::VersionView]
|
171
|
+
# Controls the set of fields returned in the `List` response.
|
172
|
+
# @param page_size [::Integer]
|
173
|
+
# Maximum results to return per page.
|
174
|
+
# @param page_token [::String]
|
175
|
+
# Continuation token for fetching the next page of results.
|
176
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
177
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>]
|
178
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
179
|
+
#
|
180
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>]
|
181
|
+
#
|
182
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
183
|
+
def list_versions request, options = nil
|
184
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
185
|
+
|
186
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::ListVersionsRequest
|
187
|
+
|
188
|
+
# Converts hash and nil to an options object
|
189
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
190
|
+
|
191
|
+
# Customize the options with defaults
|
192
|
+
call_metadata = @config.rpcs.list_versions.metadata.to_h
|
193
|
+
|
194
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
195
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
196
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
197
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
198
|
+
transports_version_send: [:rest]
|
199
|
+
|
200
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
201
|
+
|
202
|
+
options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
|
203
|
+
metadata: call_metadata,
|
204
|
+
retry_policy: @config.rpcs.list_versions.retry_policy
|
205
|
+
|
206
|
+
options.apply_defaults timeout: @config.timeout,
|
207
|
+
metadata: @config.metadata,
|
208
|
+
retry_policy: @config.retry_policy
|
209
|
+
|
210
|
+
@versions_stub.list_versions request, options do |result, operation|
|
211
|
+
result = ::Gapic::Rest::PagedEnumerable.new @versions_stub, :list_versions, "versions", request, result, options
|
212
|
+
yield result, operation if block_given?
|
213
|
+
return result
|
214
|
+
end
|
215
|
+
rescue ::Gapic::Rest::Error => e
|
216
|
+
raise ::Google::Cloud::Error.from_error(e)
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# Gets the specified Version resource.
|
221
|
+
# By default, only a `BASIC_VIEW` will be returned.
|
222
|
+
# Specify the `FULL_VIEW` parameter to get the full resource.
|
223
|
+
#
|
224
|
+
# @overload get_version(request, options = nil)
|
225
|
+
# Pass arguments to `get_version` via a request object, either of type
|
226
|
+
# {::Google::Cloud::AppEngine::V1::GetVersionRequest} or an equivalent Hash.
|
227
|
+
#
|
228
|
+
# @param request [::Google::Cloud::AppEngine::V1::GetVersionRequest, ::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 get_version(name: nil, view: nil)
|
235
|
+
# Pass arguments to `get_version` 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 resource requested. Example:
|
241
|
+
# `apps/myapp/services/default/versions/v1`.
|
242
|
+
# @param view [::Google::Cloud::AppEngine::V1::VersionView]
|
243
|
+
# Controls the set of fields returned in the `Get` response.
|
244
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
245
|
+
# @yieldparam result [::Google::Cloud::AppEngine::V1::Version]
|
246
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
247
|
+
#
|
248
|
+
# @return [::Google::Cloud::AppEngine::V1::Version]
|
249
|
+
#
|
250
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
251
|
+
def get_version 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::GetVersionRequest
|
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.get_version.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.get_version.timeout,
|
271
|
+
metadata: call_metadata,
|
272
|
+
retry_policy: @config.rpcs.get_version.retry_policy
|
273
|
+
|
274
|
+
options.apply_defaults timeout: @config.timeout,
|
275
|
+
metadata: @config.metadata,
|
276
|
+
retry_policy: @config.retry_policy
|
277
|
+
|
278
|
+
@versions_stub.get_version 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
|
+
# Deploys code and resource files to a new version.
|
288
|
+
#
|
289
|
+
# @overload create_version(request, options = nil)
|
290
|
+
# Pass arguments to `create_version` via a request object, either of type
|
291
|
+
# {::Google::Cloud::AppEngine::V1::CreateVersionRequest} or an equivalent Hash.
|
292
|
+
#
|
293
|
+
# @param request [::Google::Cloud::AppEngine::V1::CreateVersionRequest, ::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_version(parent: nil, version: nil)
|
300
|
+
# Pass arguments to `create_version` 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 resource to create this version under. Example:
|
306
|
+
# `apps/myapp/services/default`.
|
307
|
+
# @param version [::Google::Cloud::AppEngine::V1::Version, ::Hash]
|
308
|
+
# Application deployment configuration.
|
309
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
310
|
+
# @yieldparam result [::Gapic::Operation]
|
311
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
312
|
+
#
|
313
|
+
# @return [::Gapic::Operation]
|
314
|
+
#
|
315
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
316
|
+
def create_version request, options = nil
|
317
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
318
|
+
|
319
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::CreateVersionRequest
|
320
|
+
|
321
|
+
# Converts hash and nil to an options object
|
322
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
323
|
+
|
324
|
+
# Customize the options with defaults
|
325
|
+
call_metadata = @config.rpcs.create_version.metadata.to_h
|
326
|
+
|
327
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
328
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
329
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
330
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
331
|
+
transports_version_send: [:rest]
|
332
|
+
|
333
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
334
|
+
|
335
|
+
options.apply_defaults timeout: @config.rpcs.create_version.timeout,
|
336
|
+
metadata: call_metadata,
|
337
|
+
retry_policy: @config.rpcs.create_version.retry_policy
|
338
|
+
|
339
|
+
options.apply_defaults timeout: @config.timeout,
|
340
|
+
metadata: @config.metadata,
|
341
|
+
retry_policy: @config.retry_policy
|
342
|
+
|
343
|
+
@versions_stub.create_version request, options do |result, operation|
|
344
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
345
|
+
yield result, operation if block_given?
|
346
|
+
return result
|
347
|
+
end
|
348
|
+
rescue ::Gapic::Rest::Error => e
|
349
|
+
raise ::Google::Cloud::Error.from_error(e)
|
350
|
+
end
|
351
|
+
|
352
|
+
##
|
353
|
+
# Updates the specified Version resource.
|
354
|
+
# You can specify the following fields depending on the App Engine
|
355
|
+
# environment and type of scaling that the version resource uses:
|
356
|
+
#
|
357
|
+
# **Standard environment**
|
358
|
+
#
|
359
|
+
# * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class)
|
360
|
+
#
|
361
|
+
# *automatic scaling* in the standard environment:
|
362
|
+
#
|
363
|
+
# * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
|
364
|
+
# * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
|
365
|
+
# * [`automaticScaling.standard_scheduler_settings.max_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
|
366
|
+
# * [`automaticScaling.standard_scheduler_settings.min_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
|
367
|
+
# * [`automaticScaling.standard_scheduler_settings.target_cpu_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
|
368
|
+
# * [`automaticScaling.standard_scheduler_settings.target_throughput_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
|
369
|
+
#
|
370
|
+
# *basic scaling* or *manual scaling* in the standard environment:
|
371
|
+
#
|
372
|
+
# * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
|
373
|
+
# * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
|
374
|
+
#
|
375
|
+
# **Flexible environment**
|
376
|
+
#
|
377
|
+
# * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
|
378
|
+
#
|
379
|
+
# *automatic scaling* in the flexible environment:
|
380
|
+
#
|
381
|
+
# * [`automatic_scaling.min_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
|
382
|
+
# * [`automatic_scaling.max_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
|
383
|
+
# * [`automatic_scaling.cool_down_period_sec`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
|
384
|
+
# * [`automatic_scaling.cpu_utilization.target_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
|
385
|
+
#
|
386
|
+
# *manual scaling* in the flexible environment:
|
387
|
+
#
|
388
|
+
# * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
|
389
|
+
#
|
390
|
+
# @overload update_version(request, options = nil)
|
391
|
+
# Pass arguments to `update_version` via a request object, either of type
|
392
|
+
# {::Google::Cloud::AppEngine::V1::UpdateVersionRequest} or an equivalent Hash.
|
393
|
+
#
|
394
|
+
# @param request [::Google::Cloud::AppEngine::V1::UpdateVersionRequest, ::Hash]
|
395
|
+
# A request object representing the call parameters. Required. To specify no
|
396
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
397
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
398
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
399
|
+
#
|
400
|
+
# @overload update_version(name: nil, version: nil, update_mask: nil)
|
401
|
+
# Pass arguments to `update_version` via keyword arguments. Note that at
|
402
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
403
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
404
|
+
#
|
405
|
+
# @param name [::String]
|
406
|
+
# Name of the resource to update. Example:
|
407
|
+
# `apps/myapp/services/default/versions/1`.
|
408
|
+
# @param version [::Google::Cloud::AppEngine::V1::Version, ::Hash]
|
409
|
+
# A Version containing the updated resource. Only fields set in the field
|
410
|
+
# mask will be updated.
|
411
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
412
|
+
# Standard field mask for the set of fields to be updated.
|
413
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
414
|
+
# @yieldparam result [::Gapic::Operation]
|
415
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
416
|
+
#
|
417
|
+
# @return [::Gapic::Operation]
|
418
|
+
#
|
419
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
420
|
+
def update_version request, options = nil
|
421
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
422
|
+
|
423
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::UpdateVersionRequest
|
424
|
+
|
425
|
+
# Converts hash and nil to an options object
|
426
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
427
|
+
|
428
|
+
# Customize the options with defaults
|
429
|
+
call_metadata = @config.rpcs.update_version.metadata.to_h
|
430
|
+
|
431
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
432
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
433
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
434
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
435
|
+
transports_version_send: [:rest]
|
436
|
+
|
437
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
438
|
+
|
439
|
+
options.apply_defaults timeout: @config.rpcs.update_version.timeout,
|
440
|
+
metadata: call_metadata,
|
441
|
+
retry_policy: @config.rpcs.update_version.retry_policy
|
442
|
+
|
443
|
+
options.apply_defaults timeout: @config.timeout,
|
444
|
+
metadata: @config.metadata,
|
445
|
+
retry_policy: @config.retry_policy
|
446
|
+
|
447
|
+
@versions_stub.update_version request, options do |result, operation|
|
448
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
449
|
+
yield result, operation if block_given?
|
450
|
+
return result
|
451
|
+
end
|
452
|
+
rescue ::Gapic::Rest::Error => e
|
453
|
+
raise ::Google::Cloud::Error.from_error(e)
|
454
|
+
end
|
455
|
+
|
456
|
+
##
|
457
|
+
# Deletes an existing Version resource.
|
458
|
+
#
|
459
|
+
# @overload delete_version(request, options = nil)
|
460
|
+
# Pass arguments to `delete_version` via a request object, either of type
|
461
|
+
# {::Google::Cloud::AppEngine::V1::DeleteVersionRequest} or an equivalent Hash.
|
462
|
+
#
|
463
|
+
# @param request [::Google::Cloud::AppEngine::V1::DeleteVersionRequest, ::Hash]
|
464
|
+
# A request object representing the call parameters. Required. To specify no
|
465
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
466
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
467
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
468
|
+
#
|
469
|
+
# @overload delete_version(name: nil)
|
470
|
+
# Pass arguments to `delete_version` via keyword arguments. Note that at
|
471
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
472
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
473
|
+
#
|
474
|
+
# @param name [::String]
|
475
|
+
# Name of the resource requested. Example:
|
476
|
+
# `apps/myapp/services/default/versions/v1`.
|
477
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
478
|
+
# @yieldparam result [::Gapic::Operation]
|
479
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
480
|
+
#
|
481
|
+
# @return [::Gapic::Operation]
|
482
|
+
#
|
483
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
484
|
+
def delete_version request, options = nil
|
485
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
486
|
+
|
487
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AppEngine::V1::DeleteVersionRequest
|
488
|
+
|
489
|
+
# Converts hash and nil to an options object
|
490
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
491
|
+
|
492
|
+
# Customize the options with defaults
|
493
|
+
call_metadata = @config.rpcs.delete_version.metadata.to_h
|
494
|
+
|
495
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
496
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
497
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
498
|
+
gapic_version: ::Google::Cloud::AppEngine::V1::VERSION,
|
499
|
+
transports_version_send: [:rest]
|
500
|
+
|
501
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
502
|
+
|
503
|
+
options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
|
504
|
+
metadata: call_metadata,
|
505
|
+
retry_policy: @config.rpcs.delete_version.retry_policy
|
506
|
+
|
507
|
+
options.apply_defaults timeout: @config.timeout,
|
508
|
+
metadata: @config.metadata,
|
509
|
+
retry_policy: @config.retry_policy
|
510
|
+
|
511
|
+
@versions_stub.delete_version request, options do |result, operation|
|
512
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
513
|
+
yield result, operation if block_given?
|
514
|
+
return result
|
515
|
+
end
|
516
|
+
rescue ::Gapic::Rest::Error => e
|
517
|
+
raise ::Google::Cloud::Error.from_error(e)
|
518
|
+
end
|
519
|
+
|
520
|
+
##
|
521
|
+
# Configuration class for the Versions REST API.
|
522
|
+
#
|
523
|
+
# This class represents the configuration for Versions REST,
|
524
|
+
# providing control over timeouts, retry behavior, logging, transport
|
525
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
526
|
+
# applied individually to specific RPCs. See
|
527
|
+
# {::Google::Cloud::AppEngine::V1::Versions::Rest::Client::Configuration::Rpcs}
|
528
|
+
# for a list of RPCs that can be configured independently.
|
529
|
+
#
|
530
|
+
# Configuration can be applied globally to all clients, or to a single client
|
531
|
+
# on construction.
|
532
|
+
#
|
533
|
+
# @example
|
534
|
+
#
|
535
|
+
# # Modify the global config, setting the timeout for
|
536
|
+
# # list_versions to 20 seconds,
|
537
|
+
# # and all remaining timeouts to 10 seconds.
|
538
|
+
# ::Google::Cloud::AppEngine::V1::Versions::Rest::Client.configure do |config|
|
539
|
+
# config.timeout = 10.0
|
540
|
+
# config.rpcs.list_versions.timeout = 20.0
|
541
|
+
# end
|
542
|
+
#
|
543
|
+
# # Apply the above configuration only to a new client.
|
544
|
+
# client = ::Google::Cloud::AppEngine::V1::Versions::Rest::Client.new do |config|
|
545
|
+
# config.timeout = 10.0
|
546
|
+
# config.rpcs.list_versions.timeout = 20.0
|
547
|
+
# end
|
548
|
+
#
|
549
|
+
# @!attribute [rw] endpoint
|
550
|
+
# The hostname or hostname:port of the service endpoint.
|
551
|
+
# Defaults to `"appengine.googleapis.com"`.
|
552
|
+
# @return [::String]
|
553
|
+
# @!attribute [rw] credentials
|
554
|
+
# Credentials to send with calls. You may provide any of the following types:
|
555
|
+
# * (`String`) The path to a service account key file in JSON format
|
556
|
+
# * (`Hash`) A service account key as a Hash
|
557
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
558
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
559
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
560
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
561
|
+
# * (`nil`) indicating no credentials
|
562
|
+
# @return [::Object]
|
563
|
+
# @!attribute [rw] scope
|
564
|
+
# The OAuth scopes
|
565
|
+
# @return [::Array<::String>]
|
566
|
+
# @!attribute [rw] lib_name
|
567
|
+
# The library name as recorded in instrumentation and logging
|
568
|
+
# @return [::String]
|
569
|
+
# @!attribute [rw] lib_version
|
570
|
+
# The library version as recorded in instrumentation and logging
|
571
|
+
# @return [::String]
|
572
|
+
# @!attribute [rw] timeout
|
573
|
+
# The call timeout in seconds.
|
574
|
+
# @return [::Numeric]
|
575
|
+
# @!attribute [rw] metadata
|
576
|
+
# Additional headers to be sent with the call.
|
577
|
+
# @return [::Hash{::Symbol=>::String}]
|
578
|
+
# @!attribute [rw] retry_policy
|
579
|
+
# The retry policy. The value is a hash with the following keys:
|
580
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
581
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
582
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
583
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
584
|
+
# trigger a retry.
|
585
|
+
# @return [::Hash]
|
586
|
+
# @!attribute [rw] quota_project
|
587
|
+
# A separate project against which to charge quota.
|
588
|
+
# @return [::String]
|
589
|
+
#
|
590
|
+
class Configuration
|
591
|
+
extend ::Gapic::Config
|
592
|
+
|
593
|
+
config_attr :endpoint, "appengine.googleapis.com", ::String
|
594
|
+
config_attr :credentials, nil do |value|
|
595
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
596
|
+
allowed.any? { |klass| klass === value }
|
597
|
+
end
|
598
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
599
|
+
config_attr :lib_name, nil, ::String, nil
|
600
|
+
config_attr :lib_version, nil, ::String, nil
|
601
|
+
config_attr :timeout, nil, ::Numeric, nil
|
602
|
+
config_attr :metadata, nil, ::Hash, nil
|
603
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
604
|
+
config_attr :quota_project, nil, ::String, nil
|
605
|
+
|
606
|
+
# @private
|
607
|
+
def initialize parent_config = nil
|
608
|
+
@parent_config = parent_config unless parent_config.nil?
|
609
|
+
|
610
|
+
yield self if block_given?
|
611
|
+
end
|
612
|
+
|
613
|
+
##
|
614
|
+
# Configurations for individual RPCs
|
615
|
+
# @return [Rpcs]
|
616
|
+
#
|
617
|
+
def rpcs
|
618
|
+
@rpcs ||= begin
|
619
|
+
parent_rpcs = nil
|
620
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
621
|
+
Rpcs.new parent_rpcs
|
622
|
+
end
|
623
|
+
end
|
624
|
+
|
625
|
+
##
|
626
|
+
# Configuration RPC class for the Versions API.
|
627
|
+
#
|
628
|
+
# Includes fields providing the configuration for each RPC in this service.
|
629
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
630
|
+
# the following configuration fields:
|
631
|
+
#
|
632
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
633
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
634
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
635
|
+
# include the following keys:
|
636
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
637
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
638
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
639
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
640
|
+
# trigger a retry.
|
641
|
+
#
|
642
|
+
class Rpcs
|
643
|
+
##
|
644
|
+
# RPC-specific configuration for `list_versions`
|
645
|
+
# @return [::Gapic::Config::Method]
|
646
|
+
#
|
647
|
+
attr_reader :list_versions
|
648
|
+
##
|
649
|
+
# RPC-specific configuration for `get_version`
|
650
|
+
# @return [::Gapic::Config::Method]
|
651
|
+
#
|
652
|
+
attr_reader :get_version
|
653
|
+
##
|
654
|
+
# RPC-specific configuration for `create_version`
|
655
|
+
# @return [::Gapic::Config::Method]
|
656
|
+
#
|
657
|
+
attr_reader :create_version
|
658
|
+
##
|
659
|
+
# RPC-specific configuration for `update_version`
|
660
|
+
# @return [::Gapic::Config::Method]
|
661
|
+
#
|
662
|
+
attr_reader :update_version
|
663
|
+
##
|
664
|
+
# RPC-specific configuration for `delete_version`
|
665
|
+
# @return [::Gapic::Config::Method]
|
666
|
+
#
|
667
|
+
attr_reader :delete_version
|
668
|
+
|
669
|
+
# @private
|
670
|
+
def initialize parent_rpcs = nil
|
671
|
+
list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
|
672
|
+
@list_versions = ::Gapic::Config::Method.new list_versions_config
|
673
|
+
get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
|
674
|
+
@get_version = ::Gapic::Config::Method.new get_version_config
|
675
|
+
create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version
|
676
|
+
@create_version = ::Gapic::Config::Method.new create_version_config
|
677
|
+
update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version
|
678
|
+
@update_version = ::Gapic::Config::Method.new update_version_config
|
679
|
+
delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
|
680
|
+
@delete_version = ::Gapic::Config::Method.new delete_version_config
|
681
|
+
|
682
|
+
yield self if block_given?
|
683
|
+
end
|
684
|
+
end
|
685
|
+
end
|
686
|
+
end
|
687
|
+
end
|
688
|
+
end
|
689
|
+
end
|
690
|
+
end
|
691
|
+
end
|
692
|
+
end
|