google-cloud-tasks-v2beta3 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/tasks/v2beta3/bindings_override.rb +102 -0
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb +265 -109
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb +523 -114
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb +61 -0
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb +1 -0
- data/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb +5 -1
- data/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb +49 -30
- data/lib/google/cloud/tasks/v2beta3/queue_pb.rb +1 -1
- data/lib/google/cloud/tasks/v2beta3/rest.rb +1 -0
- data/lib/google/cloud/tasks/v2beta3/target_pb.rb +9 -1
- data/lib/google/cloud/tasks/v2beta3/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/api/httpbody.rb +80 -0
- data/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb +155 -99
- data/proto_docs/google/cloud/tasks/v2beta3/queue.rb +5 -2
- data/proto_docs/google/cloud/tasks/v2beta3/target.rb +199 -0
- data/proto_docs/google/cloud/tasks/v2beta3/task.rb +1 -1
- data/proto_docs/google/iam/v1/policy.rb +8 -4
- metadata +27 -5
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/tasks/v2beta3/cloudtasks_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -121,6 +122,8 @@ module Google
|
|
121
122
|
|
122
123
|
default_config.rpcs.run_task.timeout = 20.0
|
123
124
|
|
125
|
+
default_config.rpcs.buffer_task.timeout = 20.0
|
126
|
+
|
124
127
|
default_config
|
125
128
|
end
|
126
129
|
yield @configure if block_given?
|
@@ -190,15 +193,29 @@ module Google
|
|
190
193
|
@quota_project_id = @config.quota_project
|
191
194
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
192
195
|
|
196
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
197
|
+
config.credentials = credentials
|
198
|
+
config.quota_project = @quota_project_id
|
199
|
+
config.endpoint = @config.endpoint
|
200
|
+
end
|
201
|
+
|
193
202
|
@cloud_tasks_stub = ::Gapic::ServiceStub.new(
|
194
203
|
::Google::Cloud::Tasks::V2beta3::CloudTasks::Stub,
|
195
204
|
credentials: credentials,
|
196
205
|
endpoint: @config.endpoint,
|
197
206
|
channel_args: @config.channel_args,
|
198
|
-
interceptors: @config.interceptors
|
207
|
+
interceptors: @config.interceptors,
|
208
|
+
channel_pool_config: @config.channel_pool
|
199
209
|
)
|
200
210
|
end
|
201
211
|
|
212
|
+
##
|
213
|
+
# Get the associated client for mix-in of the Locations.
|
214
|
+
#
|
215
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
216
|
+
#
|
217
|
+
attr_reader :location_client
|
218
|
+
|
202
219
|
# Service calls
|
203
220
|
|
204
221
|
##
|
@@ -225,11 +242,10 @@ module Google
|
|
225
242
|
# Required. The location name.
|
226
243
|
# For example: `projects/PROJECT_ID/locations/LOCATION_ID`
|
227
244
|
# @param filter [::String]
|
228
|
-
# `filter` can be used to specify a subset of queues. Any
|
229
|
-
# field can be used as a filter and
|
230
|
-
# For example: `<=, <, >=, >, !=, =, :`. The
|
231
|
-
# described in
|
232
|
-
# [Stackdriver's Advanced Logs
|
245
|
+
# `filter` can be used to specify a subset of queues. Any
|
246
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and
|
247
|
+
# several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
|
248
|
+
# filter syntax is the same as described in [Stackdriver's Advanced Logs
|
233
249
|
# Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
|
234
250
|
#
|
235
251
|
# Sample filter "state: PAUSED".
|
@@ -242,20 +258,22 @@ module Google
|
|
242
258
|
# The maximum page size is 9800. If unspecified, the page size will
|
243
259
|
# be the maximum. Fewer queues than requested might be returned,
|
244
260
|
# even if more queues exist; use the
|
245
|
-
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
246
|
-
# response to determine if more queues exist.
|
261
|
+
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
262
|
+
# in the response to determine if more queues exist.
|
247
263
|
# @param page_token [::String]
|
248
264
|
# A token identifying the page of results to return.
|
249
265
|
#
|
250
266
|
# To request the first page results, page_token must be empty. To
|
251
267
|
# request the next page of results, page_token must be the value of
|
252
|
-
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
253
|
-
# from the previous call to
|
254
|
-
# method. It
|
255
|
-
#
|
268
|
+
# {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token}
|
269
|
+
# returned from the previous call to
|
270
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} method. It
|
271
|
+
# is an error to switch the value of the
|
272
|
+
# {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while
|
273
|
+
# iterating through pages.
|
256
274
|
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
257
|
-
# Optional. Read mask is used for a more granular control over what the API
|
258
|
-
# If the mask is not present all fields will be returned except
|
275
|
+
# Optional. Read mask is used for a more granular control over what the API
|
276
|
+
# returns. If the mask is not present all fields will be returned except
|
259
277
|
# [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
|
260
278
|
# specified in the mask.
|
261
279
|
#
|
@@ -350,8 +368,8 @@ module Google
|
|
350
368
|
# Required. The resource name of the queue. For example:
|
351
369
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
352
370
|
# @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
|
353
|
-
# Optional. Read mask is used for a more granular control over what the API
|
354
|
-
# If the mask is not present all fields will be returned except
|
371
|
+
# Optional. Read mask is used for a more granular control over what the API
|
372
|
+
# returns. If the mask is not present all fields will be returned except
|
355
373
|
# [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
|
356
374
|
# specified in the mask.
|
357
375
|
#
|
@@ -423,8 +441,8 @@ module Google
|
|
423
441
|
# Creates a queue.
|
424
442
|
#
|
425
443
|
# Queues created with this method allow tasks to live for a maximum of 31
|
426
|
-
# days. After a task is 31 days old, the task will be deleted regardless of
|
427
|
-
# it was dispatched or not.
|
444
|
+
# days. After a task is 31 days old, the task will be deleted regardless of
|
445
|
+
# whether it was dispatched or not.
|
428
446
|
#
|
429
447
|
# WARNING: Using this method may have unintended side effects if you are
|
430
448
|
# using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
|
@@ -454,11 +472,12 @@ module Google
|
|
454
472
|
#
|
455
473
|
# The list of allowed locations can be obtained by calling Cloud
|
456
474
|
# Tasks' implementation of
|
457
|
-
#
|
475
|
+
# `::Google::Cloud::Location::Locations::Client#list_locations`.
|
458
476
|
# @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash]
|
459
477
|
# Required. The queue to create.
|
460
478
|
#
|
461
|
-
# [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as
|
479
|
+
# [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as
|
480
|
+
# an existing queue.
|
462
481
|
#
|
463
482
|
# @yield [response, operation] Access the result along with the RPC operation
|
464
483
|
# @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue]
|
@@ -531,8 +550,8 @@ module Google
|
|
531
550
|
# the queue if it does exist.
|
532
551
|
#
|
533
552
|
# Queues created with this method allow tasks to live for a maximum of 31
|
534
|
-
# days. After a task is 31 days old, the task will be deleted regardless of
|
535
|
-
# it was dispatched or not.
|
553
|
+
# days. After a task is 31 days old, the task will be deleted regardless of
|
554
|
+
# whether it was dispatched or not.
|
536
555
|
#
|
537
556
|
# WARNING: Using this method may have unintended side effects if you are
|
538
557
|
# using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
|
@@ -559,11 +578,13 @@ module Google
|
|
559
578
|
# @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash]
|
560
579
|
# Required. The queue to create or update.
|
561
580
|
#
|
562
|
-
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be
|
581
|
+
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be
|
582
|
+
# specified.
|
563
583
|
#
|
564
584
|
# Output only fields cannot be modified using UpdateQueue.
|
565
585
|
# Any value specified for an output only field will be ignored.
|
566
|
-
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be
|
586
|
+
# The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be
|
587
|
+
# changed.
|
567
588
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
568
589
|
# A mask used to specify which fields of the queue are being updated.
|
569
590
|
#
|
@@ -827,9 +848,10 @@ module Google
|
|
827
848
|
#
|
828
849
|
# If a queue is paused then the system will stop dispatching tasks
|
829
850
|
# until the queue is resumed via
|
830
|
-
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can
|
831
|
-
# when the queue is paused. A queue is paused if its
|
832
|
-
# {::Google::Cloud::Tasks::V2beta3::Queue#state state} is
|
851
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can
|
852
|
+
# still be added when the queue is paused. A queue is paused if its
|
853
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue#state state} is
|
854
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
|
833
855
|
#
|
834
856
|
# @overload pause_queue(request, options = nil)
|
835
857
|
# Pass arguments to `pause_queue` via a request object, either of type
|
@@ -919,9 +941,11 @@ module Google
|
|
919
941
|
#
|
920
942
|
# This method resumes a queue after it has been
|
921
943
|
# {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED} or
|
922
|
-
# {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a
|
923
|
-
# in the queue's
|
924
|
-
#
|
944
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a
|
945
|
+
# queue is stored in the queue's
|
946
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method
|
947
|
+
# it will be set to
|
948
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}.
|
925
949
|
#
|
926
950
|
# WARNING: Resuming many high-QPS queues at the same time can
|
927
951
|
# lead to target overloading. If you are resuming high-QPS
|
@@ -1013,9 +1037,9 @@ module Google
|
|
1013
1037
|
end
|
1014
1038
|
|
1015
1039
|
##
|
1016
|
-
# Gets the access control policy for a
|
1017
|
-
# Returns an empty policy if the
|
1018
|
-
# set.
|
1040
|
+
# Gets the access control policy for a
|
1041
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Returns an empty policy if the
|
1042
|
+
# resource exists and does not have a policy set.
|
1019
1043
|
#
|
1020
1044
|
# Authorization requires the following
|
1021
1045
|
# [Google IAM](https://cloud.google.com/iam) permission on the specified
|
@@ -1110,8 +1134,8 @@ module Google
|
|
1110
1134
|
end
|
1111
1135
|
|
1112
1136
|
##
|
1113
|
-
# Sets the access control policy for a
|
1114
|
-
# policy.
|
1137
|
+
# Sets the access control policy for a
|
1138
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing policy.
|
1115
1139
|
#
|
1116
1140
|
# Note: The Cloud Console does not check queue-level IAM permissions yet.
|
1117
1141
|
# Project-level permissions are required to use the Cloud Console.
|
@@ -1217,9 +1241,10 @@ module Google
|
|
1217
1241
|
end
|
1218
1242
|
|
1219
1243
|
##
|
1220
|
-
# Returns permissions that a caller has on a
|
1221
|
-
# If the resource does not exist,
|
1222
|
-
# permissions, not a
|
1244
|
+
# Returns permissions that a caller has on a
|
1245
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue Queue}. If the resource does not exist,
|
1246
|
+
# this will return an empty set of permissions, not a
|
1247
|
+
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.
|
1223
1248
|
#
|
1224
1249
|
# Note: This operation is designed to be used for building permission-aware
|
1225
1250
|
# UIs and command-line tools, not for authorization checking. This operation
|
@@ -1316,10 +1341,10 @@ module Google
|
|
1316
1341
|
##
|
1317
1342
|
# Lists the tasks in a queue.
|
1318
1343
|
#
|
1319
|
-
# By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}
|
1320
|
-
# due to performance considerations;
|
1321
|
-
# {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view}
|
1322
|
-
# subset of information which is returned.
|
1344
|
+
# By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}
|
1345
|
+
# view is retrieved due to performance considerations;
|
1346
|
+
# {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view}
|
1347
|
+
# controls the subset of information which is returned.
|
1323
1348
|
#
|
1324
1349
|
# The tasks may be returned in any order. The ordering may change at any
|
1325
1350
|
# time.
|
@@ -1343,24 +1368,25 @@ module Google
|
|
1343
1368
|
# Required. The queue name. For example:
|
1344
1369
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
1345
1370
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1346
|
-
# The response_view specifies which subset of the
|
1347
|
-
# returned.
|
1348
|
-
#
|
1349
|
-
# By default response_view is
|
1350
|
-
#
|
1351
|
-
#
|
1352
|
-
#
|
1353
|
-
# contains.
|
1354
|
-
#
|
1355
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1356
|
-
# `cloudtasks.tasks.fullView` [Google
|
1357
|
-
# permission on the
|
1371
|
+
# The response_view specifies which subset of the
|
1372
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1373
|
+
#
|
1374
|
+
# By default response_view is
|
1375
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1376
|
+
# retrieved by default because some data, such as payloads, might be
|
1377
|
+
# desirable to return only when needed because of its large size or because
|
1378
|
+
# of the sensitivity of data that it contains.
|
1379
|
+
#
|
1380
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1381
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1382
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1383
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1358
1384
|
# @param page_size [::Integer]
|
1359
1385
|
# Maximum page size.
|
1360
1386
|
#
|
1361
1387
|
# Fewer tasks than requested might be returned, even if more tasks exist; use
|
1362
|
-
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1363
|
-
# determine if more tasks exist.
|
1388
|
+
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1389
|
+
# in the response to determine if more tasks exist.
|
1364
1390
|
#
|
1365
1391
|
# The maximum page size is 1000. If unspecified, the page size will be the
|
1366
1392
|
# maximum.
|
@@ -1369,9 +1395,9 @@ module Google
|
|
1369
1395
|
#
|
1370
1396
|
# To request the first page results, page_token must be empty. To
|
1371
1397
|
# request the next page of results, page_token must be the value of
|
1372
|
-
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1373
|
-
# from the previous call to
|
1374
|
-
# method.
|
1398
|
+
# {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token}
|
1399
|
+
# returned from the previous call to
|
1400
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} method.
|
1375
1401
|
#
|
1376
1402
|
# The page token is valid for only 2 hours.
|
1377
1403
|
#
|
@@ -1466,18 +1492,19 @@ module Google
|
|
1466
1492
|
# Required. The task name. For example:
|
1467
1493
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
|
1468
1494
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1469
|
-
# The response_view specifies which subset of the
|
1470
|
-
# returned.
|
1495
|
+
# The response_view specifies which subset of the
|
1496
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1471
1497
|
#
|
1472
|
-
# By default response_view is
|
1473
|
-
#
|
1474
|
-
#
|
1475
|
-
#
|
1476
|
-
# contains.
|
1498
|
+
# By default response_view is
|
1499
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1500
|
+
# retrieved by default because some data, such as payloads, might be
|
1501
|
+
# desirable to return only when needed because of its large size or because
|
1502
|
+
# of the sensitivity of data that it contains.
|
1477
1503
|
#
|
1478
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1479
|
-
# `cloudtasks.tasks.fullView` [Google
|
1480
|
-
# permission on the
|
1504
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1505
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1506
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1507
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1481
1508
|
#
|
1482
1509
|
# @yield [response, operation] Access the result along with the RPC operation
|
1483
1510
|
# @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task]
|
@@ -1575,13 +1602,13 @@ module Google
|
|
1575
1602
|
#
|
1576
1603
|
# Task names have the following format:
|
1577
1604
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
|
1578
|
-
# The user can optionally specify a task
|
1579
|
-
# name
|
1580
|
-
# unique task id, which will be set in
|
1581
|
-
# {::Google::Cloud::Tasks::V2beta3::Task#name response}.
|
1605
|
+
# The user can optionally specify a task
|
1606
|
+
# {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified
|
1607
|
+
# then the system will generate a random unique task id, which will be set in
|
1608
|
+
# the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}.
|
1582
1609
|
#
|
1583
|
-
# If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not
|
1584
|
-
# past then Cloud Tasks will set it to the current time.
|
1610
|
+
# If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not
|
1611
|
+
# set or is in the past then Cloud Tasks will set it to the current time.
|
1585
1612
|
#
|
1586
1613
|
# Task De-duplication:
|
1587
1614
|
#
|
@@ -1590,33 +1617,34 @@ module Google
|
|
1590
1617
|
# that was deleted or executed recently then the call will fail
|
1591
1618
|
# with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
|
1592
1619
|
# If the task's queue was created using Cloud Tasks, then another task with
|
1593
|
-
# the same name can't be created for ~
|
1620
|
+
# the same name can't be created for ~1 hour after the original task was
|
1594
1621
|
# deleted or executed. If the task's queue was created using queue.yaml or
|
1595
1622
|
# queue.xml, then another task with the same name can't be created
|
1596
|
-
# for ~
|
1623
|
+
# for ~9 days after the original task was deleted or executed.
|
1597
1624
|
#
|
1598
1625
|
# Because there is an extra lookup cost to identify duplicate task
|
1599
|
-
# names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}
|
1600
|
-
# increased latency. Using hashed strings for the
|
1601
|
-
# the prefix of the task id is recommended. Choosing task ids
|
1602
|
-
# are sequential or have sequential prefixes, for example using a
|
1626
|
+
# names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}
|
1627
|
+
# calls have significantly increased latency. Using hashed strings for the
|
1628
|
+
# task id or for the prefix of the task id is recommended. Choosing task ids
|
1629
|
+
# that are sequential or have sequential prefixes, for example using a
|
1603
1630
|
# timestamp, causes an increase in latency and error rates in all
|
1604
1631
|
# task commands. The infrastructure relies on an approximately
|
1605
1632
|
# uniform distribution of task ids to store and serve tasks
|
1606
1633
|
# efficiently.
|
1607
1634
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1608
|
-
# The response_view specifies which subset of the
|
1609
|
-
# returned.
|
1635
|
+
# The response_view specifies which subset of the
|
1636
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1610
1637
|
#
|
1611
|
-
# By default response_view is
|
1612
|
-
#
|
1613
|
-
#
|
1614
|
-
#
|
1615
|
-
# contains.
|
1638
|
+
# By default response_view is
|
1639
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1640
|
+
# retrieved by default because some data, such as payloads, might be
|
1641
|
+
# desirable to return only when needed because of its large size or because
|
1642
|
+
# of the sensitivity of data that it contains.
|
1616
1643
|
#
|
1617
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1618
|
-
# `cloudtasks.tasks.fullView` [Google
|
1619
|
-
# permission on the
|
1644
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1645
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1646
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1647
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1620
1648
|
#
|
1621
1649
|
# @yield [response, operation] Access the result along with the RPC operation
|
1622
1650
|
# @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task]
|
@@ -1776,13 +1804,14 @@ module Google
|
|
1776
1804
|
# Forces a task to run now.
|
1777
1805
|
#
|
1778
1806
|
# When this method is called, Cloud Tasks will dispatch the task, even if
|
1779
|
-
# the task is already running, the queue has reached its
|
1780
|
-
#
|
1807
|
+
# the task is already running, the queue has reached its
|
1808
|
+
# {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or is
|
1809
|
+
# {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}.
|
1781
1810
|
#
|
1782
1811
|
# This command is meant to be used for manual debugging. For
|
1783
|
-
# example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} can be
|
1784
|
-
# task after a fix has been made or to manually force
|
1785
|
-
# dispatched now.
|
1812
|
+
# example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} can be
|
1813
|
+
# used to retry a failed task after a fix has been made or to manually force
|
1814
|
+
# a task to be dispatched now.
|
1786
1815
|
#
|
1787
1816
|
# The dispatched task is returned. That is, the task that is returned
|
1788
1817
|
# contains the [status][Task.status] after the task is dispatched but
|
@@ -1790,9 +1819,11 @@ module Google
|
|
1790
1819
|
#
|
1791
1820
|
# If Cloud Tasks receives a successful response from the task's
|
1792
1821
|
# target, then the task will be deleted; otherwise the task's
|
1793
|
-
# {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be
|
1794
|
-
#
|
1795
|
-
#
|
1822
|
+
# {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be
|
1823
|
+
# reset to the time that
|
1824
|
+
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} was called plus
|
1825
|
+
# the retry delay specified in the queue's
|
1826
|
+
# {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}.
|
1796
1827
|
#
|
1797
1828
|
# {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} returns
|
1798
1829
|
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a
|
@@ -1817,18 +1848,19 @@ module Google
|
|
1817
1848
|
# Required. The task name. For example:
|
1818
1849
|
# `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
|
1819
1850
|
# @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View]
|
1820
|
-
# The response_view specifies which subset of the
|
1821
|
-
# returned.
|
1851
|
+
# The response_view specifies which subset of the
|
1852
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned.
|
1822
1853
|
#
|
1823
|
-
# By default response_view is
|
1824
|
-
#
|
1825
|
-
#
|
1826
|
-
#
|
1827
|
-
# contains.
|
1854
|
+
# By default response_view is
|
1855
|
+
# {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is
|
1856
|
+
# retrieved by default because some data, such as payloads, might be
|
1857
|
+
# desirable to return only when needed because of its large size or because
|
1858
|
+
# of the sensitivity of data that it contains.
|
1828
1859
|
#
|
1829
|
-
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1830
|
-
# `cloudtasks.tasks.fullView` [Google
|
1831
|
-
# permission on the
|
1860
|
+
# Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL}
|
1861
|
+
# requires `cloudtasks.tasks.fullView` [Google
|
1862
|
+
# IAM](https://cloud.google.com/iam/) permission on the
|
1863
|
+
# {::Google::Cloud::Tasks::V2beta3::Task Task} resource.
|
1832
1864
|
#
|
1833
1865
|
# @yield [response, operation] Access the result along with the RPC operation
|
1834
1866
|
# @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task]
|
@@ -1894,6 +1926,115 @@ module Google
|
|
1894
1926
|
raise ::Google::Cloud::Error.from_error(e)
|
1895
1927
|
end
|
1896
1928
|
|
1929
|
+
##
|
1930
|
+
# Creates and buffers a new task without the need to explicitly define a Task
|
1931
|
+
# message. The queue must have [HTTP
|
1932
|
+
# target][google.cloud.tasks.v2beta3.HttpTarget]. To create the task with a
|
1933
|
+
# custom ID, use the following format and set TASK_ID to your desired ID:
|
1934
|
+
# projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer
|
1935
|
+
# To create the task with an automatically generated ID, use the following
|
1936
|
+
# format:
|
1937
|
+
# projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
|
1938
|
+
# Note: This feature is in its experimental stage. You must request access to
|
1939
|
+
# the API through the [Cloud Tasks BufferTask Experiment Signup
|
1940
|
+
# form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
|
1941
|
+
#
|
1942
|
+
# @overload buffer_task(request, options = nil)
|
1943
|
+
# Pass arguments to `buffer_task` via a request object, either of type
|
1944
|
+
# {::Google::Cloud::Tasks::V2beta3::BufferTaskRequest} or an equivalent Hash.
|
1945
|
+
#
|
1946
|
+
# @param request [::Google::Cloud::Tasks::V2beta3::BufferTaskRequest, ::Hash]
|
1947
|
+
# A request object representing the call parameters. Required. To specify no
|
1948
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1949
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1950
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1951
|
+
#
|
1952
|
+
# @overload buffer_task(queue: nil, task_id: nil, body: nil)
|
1953
|
+
# Pass arguments to `buffer_task` via keyword arguments. Note that at
|
1954
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1955
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1956
|
+
#
|
1957
|
+
# @param queue [::String]
|
1958
|
+
# Required. The parent queue name. For example:
|
1959
|
+
# projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
|
1960
|
+
#
|
1961
|
+
# The queue must already exist.
|
1962
|
+
# @param task_id [::String]
|
1963
|
+
# Optional. Task ID for the task being created. If not provided, a random
|
1964
|
+
# task ID is assigned to the task.
|
1965
|
+
# @param body [::Google::Api::HttpBody, ::Hash]
|
1966
|
+
# Optional. Body of the HTTP request.
|
1967
|
+
#
|
1968
|
+
# The body can take any generic value. The value is written to the
|
1969
|
+
# [HttpRequest][payload] of the [Task].
|
1970
|
+
#
|
1971
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1972
|
+
# @yieldparam response [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse]
|
1973
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1974
|
+
#
|
1975
|
+
# @return [::Google::Cloud::Tasks::V2beta3::BufferTaskResponse]
|
1976
|
+
#
|
1977
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1978
|
+
#
|
1979
|
+
# @example Basic example
|
1980
|
+
# require "google/cloud/tasks/v2beta3"
|
1981
|
+
#
|
1982
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1983
|
+
# client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new
|
1984
|
+
#
|
1985
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1986
|
+
# request = Google::Cloud::Tasks::V2beta3::BufferTaskRequest.new
|
1987
|
+
#
|
1988
|
+
# # Call the buffer_task method.
|
1989
|
+
# result = client.buffer_task request
|
1990
|
+
#
|
1991
|
+
# # The returned object is of type Google::Cloud::Tasks::V2beta3::BufferTaskResponse.
|
1992
|
+
# p result
|
1993
|
+
#
|
1994
|
+
def buffer_task request, options = nil
|
1995
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1996
|
+
|
1997
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::BufferTaskRequest
|
1998
|
+
|
1999
|
+
# Converts hash and nil to an options object
|
2000
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2001
|
+
|
2002
|
+
# Customize the options with defaults
|
2003
|
+
metadata = @config.rpcs.buffer_task.metadata.to_h
|
2004
|
+
|
2005
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2006
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2007
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2008
|
+
gapic_version: ::Google::Cloud::Tasks::V2beta3::VERSION
|
2009
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2010
|
+
|
2011
|
+
header_params = {}
|
2012
|
+
if request.queue
|
2013
|
+
header_params["queue"] = request.queue
|
2014
|
+
end
|
2015
|
+
if request.task_id
|
2016
|
+
header_params["task_id"] = request.task_id
|
2017
|
+
end
|
2018
|
+
|
2019
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2020
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2021
|
+
|
2022
|
+
options.apply_defaults timeout: @config.rpcs.buffer_task.timeout,
|
2023
|
+
metadata: metadata,
|
2024
|
+
retry_policy: @config.rpcs.buffer_task.retry_policy
|
2025
|
+
|
2026
|
+
options.apply_defaults timeout: @config.timeout,
|
2027
|
+
metadata: @config.metadata,
|
2028
|
+
retry_policy: @config.retry_policy
|
2029
|
+
|
2030
|
+
@cloud_tasks_stub.call_rpc :buffer_task, request, options: options do |response, operation|
|
2031
|
+
yield response, operation if block_given?
|
2032
|
+
return response
|
2033
|
+
end
|
2034
|
+
rescue ::GRPC::BadStatus => e
|
2035
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2036
|
+
end
|
2037
|
+
|
1897
2038
|
##
|
1898
2039
|
# Configuration class for the CloudTasks API.
|
1899
2040
|
#
|
@@ -2013,6 +2154,14 @@ module Google
|
|
2013
2154
|
end
|
2014
2155
|
end
|
2015
2156
|
|
2157
|
+
##
|
2158
|
+
# Configuration for the channel pool
|
2159
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
2160
|
+
#
|
2161
|
+
def channel_pool
|
2162
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
2163
|
+
end
|
2164
|
+
|
2016
2165
|
##
|
2017
2166
|
# Configuration RPC class for the CloudTasks API.
|
2018
2167
|
#
|
@@ -2111,6 +2260,11 @@ module Google
|
|
2111
2260
|
# @return [::Gapic::Config::Method]
|
2112
2261
|
#
|
2113
2262
|
attr_reader :run_task
|
2263
|
+
##
|
2264
|
+
# RPC-specific configuration for `buffer_task`
|
2265
|
+
# @return [::Gapic::Config::Method]
|
2266
|
+
#
|
2267
|
+
attr_reader :buffer_task
|
2114
2268
|
|
2115
2269
|
# @private
|
2116
2270
|
def initialize parent_rpcs = nil
|
@@ -2146,6 +2300,8 @@ module Google
|
|
2146
2300
|
@delete_task = ::Gapic::Config::Method.new delete_task_config
|
2147
2301
|
run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task
|
2148
2302
|
@run_task = ::Gapic::Config::Method.new run_task_config
|
2303
|
+
buffer_task_config = parent_rpcs.buffer_task if parent_rpcs.respond_to? :buffer_task
|
2304
|
+
@buffer_task = ::Gapic::Config::Method.new buffer_task_config
|
2149
2305
|
|
2150
2306
|
yield self if block_given?
|
2151
2307
|
end
|