Cloud Tasks V2beta3 API - Class Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client (v0.17.1)
Stay organized with collections
Save and categorize content based on your preferences.
Reference documentation and code samples for the Cloud Tasks V2beta3 API class Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.
REST client for the CloudTasks service.
Cloud Tasks allows developers to manage the execution of background work in their applications.
Inherits
- Object
Methods
.configure
defself.configure(){|config|...}->Client::ConfigurationConfigure the CloudTasks Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CloudTasks clients ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.configuredo|config| config.timeout=10.0 end
#configure
defconfigure(){|config|...}->Client::ConfigurationConfigure the CloudTasks Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure .
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_queue
defcreate_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queue
defcreate_queue(parent:nil,queue:nil)->::Google::Cloud::Tasks::V2beta3::QueueCreates a queue.
Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.
WARNING: Using this method may have unintended side effects if you are
using an App Engine queue.yaml or queue.xml file to manage your queues.
Read
Overview of Queue Management and
queue.yaml before using
this method.
defcreate_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queuecreate_queue via a request object, either of type
Google::Cloud::Tasks::V2beta3::CreateQueueRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defcreate_queue(parent:nil,queue:nil)->::Google::Cloud::Tasks::V2beta3::Queuecreate_queue via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The location name in which the queue will be created.
For example:
projects/PROJECT_ID/locations/LOCATION_IDThe list of allowed locations can be obtained by calling Cloud Tasks' implementation of [ListLocations][google.cloud.location.Locations.ListLocations].
-
queue (::Google::Cloud::Tasks::V2beta3::Queue, ::Hash) — Required. The queue to create.
[Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as an existing queue.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Queue)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new # Call the create_queue method. result=client.create_queuerequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. presult
#create_task
defcreate_task(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Task
defcreate_task(parent:nil,task:nil,response_view:nil)->::Google::Cloud::Tasks::V2beta3::TaskCreates a task and adds it to a queue.
Tasks cannot be updated after creation; there is no UpdateTask command.
- The maximum task size is 100KB.
defcreate_task(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Taskcreate_task via a request object, either of type
Google::Cloud::Tasks::V2beta3::CreateTaskRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defcreate_task(parent:nil,task:nil,response_view:nil)->::Google::Cloud::Tasks::V2beta3::Taskcreate_task via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The queue name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_IDThe queue must already exist.
-
task (::Google::Cloud::Tasks::V2beta3::Task, ::Hash) — Required. The task to add.
Task names have the following format:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID. The user can optionally specify a task name . If a name is not specified then the system will generate a random unique task id, which will be set in the task returned in the response .If schedule_time is not set or is in the past then Cloud Tasks will set it to the current time.
Task De-duplication:
Explicitly specifying a task ID enables task de-duplication. If a task's ID is identical to that of an existing task or a task that was deleted or executed recently then the call will fail with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1 hour after the original task was deleted or executed. If the task's queue was created using queue.yaml or queue.xml, then another task with the same name can't be created for ~9 days after the original task was deleted or executed.
Because there is an extra lookup cost to identify duplicate task names, these CreateTask calls have significantly increased latency. Using hashed strings for the task id or for the prefix of the task id is recommended. Choosing task ids that are sequential or have sequential prefixes, for example using a timestamp, causes an increase in latency and error rates in all task commands. The infrastructure relies on an approximately uniform distribution of task ids to store and serve tasks efficiently.
-
response_view (::Google::Cloud::Tasks::V2beta3::Task::View) — The response_view specifies which subset of the
Task will be returned.
By default response_view is BASIC ; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains.
Authorization for FULL requires
cloudtasks.tasks.fullViewGoogle IAM permission on the Task resource.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Task)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new # Call the create_task method. result=client.create_taskrequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. presult
#delete_queue
defdelete_queue(request,options=nil)->::Google::Protobuf::Empty
defdelete_queue(name:nil)->::Google::Protobuf::EmptyDeletes a queue.
This command will delete the queue even if it has tasks in it.
Note: If you delete a queue, a queue with the same name can't be created for 7 days.
WARNING: Using this method may have unintended side effects if you are
using an App Engine queue.yaml or queue.xml file to manage your queues.
Read
Overview of Queue Management and
queue.yaml before using
this method.
defdelete_queue(request,options=nil)->::Google::Protobuf::Emptydelete_queue via a request object, either of type
DeleteQueueRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defdelete_queue(name:nil)->::Google::Protobuf::Emptydelete_queue via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The queue name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new # Call the delete_queue method. result=client.delete_queuerequest # The returned object is of type Google::Protobuf::Empty. presult
#delete_task
defdelete_task(request,options=nil)->::Google::Protobuf::Empty
defdelete_task(name:nil)->::Google::Protobuf::EmptyDeletes a task.
A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.
defdelete_task(request,options=nil)->::Google::Protobuf::Emptydelete_task via a request object, either of type
DeleteTaskRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defdelete_task(name:nil)->::Google::Protobuf::Emptydelete_task via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The task name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new # Call the delete_task method. result=client.delete_taskrequest # The returned object is of type Google::Protobuf::Empty. presult
#get_iam_policy
defget_iam_policy(request,options=nil)->::Google::Iam::V1::Policy
defget_iam_policy(resource:nil,options:nil)->::Google::Iam::V1::PolicyGets the access control policy for a Queue . Returns an empty policy if the resource exists and does not have a policy set.
Authorization requires the following Google IAM permission on the specified resource parent:
cloudtasks.queues.getIamPolicy
defget_iam_policy(request,options=nil)->::Google::Iam::V1::Policyget_iam_policy via a request object, either of type
Iam::V1::GetIamPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defget_iam_policy(resource:nil,options:nil)->::Google::Iam::V1::Policyget_iam_policy via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- resource (::String) — REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
-
options (::Google::Iam::V1::GetPolicyOptions, ::Hash) — OPTIONAL: A
GetPolicyOptionsobject for specifying options toGetIamPolicy.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Iam::V1::Policy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Iam::V1::GetIamPolicyRequest.new # Call the get_iam_policy method. result=client.get_iam_policyrequest # The returned object is of type Google::Iam::V1::Policy. presult
#get_queue
defget_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queue
defget_queue(name:nil,read_mask:nil)->::Google::Cloud::Tasks::V2beta3::QueueGets a queue.
defget_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queueget_queue via a request object, either of type
GetQueueRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::GetQueueRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defget_queue(name:nil,read_mask:nil)->::Google::Cloud::Tasks::V2beta3::Queueget_queue via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the queue. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID - read_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Read mask is used for a more granular control over what the API returns. If the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats] will be returned only if it was explicitly specified in the mask.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Queue)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::GetQueueRequest.new # Call the get_queue method. result=client.get_queuerequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. presult
#get_task
defget_task(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Task
defget_task(name:nil,response_view:nil)->::Google::Cloud::Tasks::V2beta3::TaskGets a task.
defget_task(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Taskget_task via a request object, either of type
GetTaskRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::GetTaskRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defget_task(name:nil,response_view:nil)->::Google::Cloud::Tasks::V2beta3::Taskget_task via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The task name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID -
response_view (::Google::Cloud::Tasks::V2beta3::Task::View) — The response_view specifies which subset of the
Task will be returned.
By default response_view is BASIC ; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains.
Authorization for FULL requires
cloudtasks.tasks.fullViewGoogle IAM permission on the Task resource.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Task)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::GetTaskRequest.new # Call the get_task method. result=client.get_taskrequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. presult
#initialize
definitialize(){|config|...}->ClientCreate a new CloudTasks REST client object.
- (config) — Configure the CloudTasks client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client=::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a client using a custom configuration client=::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.newdo|config| config.timeout=10.0 end
#list_queues
deflist_queues(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>
deflist_queues(parent:nil,filter:nil,page_size:nil,page_token:nil,read_mask:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>Lists queues.
Queues are returned in lexicographical order.
deflist_queues(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>list_queues via a request object, either of type
ListQueuesRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
deflist_queues(parent:nil,filter:nil,page_size:nil,page_token:nil,read_mask:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>list_queues via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The location name.
For example:
projects/PROJECT_ID/locations/LOCATION_ID -
filter (::String) —
filtercan be used to specify a subset of queues. Any Queue field can be used as a filter and several operators as supported. For example:<=, <, >=, >, !=, =, :. The filter syntax is the same as described in Stackdriver's Advanced Logs Filters.Sample filter "state: PAUSED".
Note that using filters might cause fewer queues than the requested page_size to be returned.
-
page_size (::Integer) — Requested page size.
The maximum page size is 9800. If unspecified, the page size will be the maximum. Fewer queues than requested might be returned, even if more queues exist; use the next_page_token in the response to determine if more queues exist.
-
page_token (::String) — A token identifying the page of results to return.
To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListQueues method. It is an error to switch the value of the filter while iterating through pages.
- read_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Read mask is used for a more granular control over what the API returns. If the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats] will be returned only if it was explicitly specified in the mask.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new # Call the list_queues method. result=client.list_queuesrequest # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.eachdo|item| # Each element is of type ::Google::Cloud::Tasks::V2beta3::Queue. pitem end
#list_tasks
deflist_tasks(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>
deflist_tasks(parent:nil,response_view:nil,page_size:nil,page_token:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>Lists the tasks in a queue.
By default, only the BASIC view is retrieved due to performance considerations; response_view controls the subset of information which is returned.
The tasks may be returned in any order. The ordering may change at any time.
deflist_tasks(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>list_tasks via a request object, either of type
ListTasksRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::ListTasksRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
deflist_tasks(parent:nil,response_view:nil,page_size:nil,page_token:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>list_tasks via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The queue name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID -
response_view (::Google::Cloud::Tasks::V2beta3::Task::View) — The response_view specifies which subset of the
Task will be returned.
By default response_view is BASIC ; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains.
Authorization for FULL requires
cloudtasks.tasks.fullViewGoogle IAM permission on the Task resource. -
page_size (::Integer) — Maximum page size.
Fewer tasks than requested might be returned, even if more tasks exist; use next_page_token in the response to determine if more tasks exist.
The maximum page size is 1000. If unspecified, the page size will be the maximum.
-
page_token (::String) — A token identifying the page of results to return.
To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListTasks method.
The page token is valid for only 2 hours.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::ListTasksRequest.new # Call the list_tasks method. result=client.list_tasksrequest # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.eachdo|item| # Each element is of type ::Google::Cloud::Tasks::V2beta3::Task. pitem end
#location_client
deflocation_client()->Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
deflogger()->LoggerThe logger used for request/response debug logging.
- (Logger)
#pause_queue
defpause_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queue
defpause_queue(name:nil)->::Google::Cloud::Tasks::V2beta3::QueuePauses the queue.
If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue . Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED .
defpause_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queuepause_queue via a request object, either of type
PauseQueueRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defpause_queue(name:nil)->::Google::Cloud::Tasks::V2beta3::Queuepause_queue via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The queue name. For example:
projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Queue)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new # Call the pause_queue method. result=client.pause_queuerequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. presult
#purge_queue
defpurge_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queue
defpurge_queue(name:nil)->::Google::Cloud::Tasks::V2beta3::QueuePurges a queue by deleting all of its tasks.
All tasks created before this method is called are permanently deleted.
Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.
defpurge_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queuepurge_queue via a request object, either of type
PurgeQueueRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defpurge_queue(name:nil)->::Google::Cloud::Tasks::V2beta3::Queuepurge_queue via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The queue name. For example:
projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Queue)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new # Call the purge_queue method. result=client.purge_queuerequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. presult
#resume_queue
defresume_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queue
defresume_queue(name:nil)->::Google::Cloud::Tasks::V2beta3::QueueResume a queue.
This method resumes a queue after it has been PAUSED or DISABLED . The state of a queue is stored in the queue's state ; after calling this method it will be set to RUNNING .
WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks.
defresume_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queueresume_queue via a request object, either of type
ResumeQueueRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defresume_queue(name:nil)->::Google::Cloud::Tasks::V2beta3::Queueresume_queue via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The queue name. For example:
projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Queue)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new # Call the resume_queue method. result=client.resume_queuerequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. presult
#run_task
defrun_task(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Task
defrun_task(name:nil,response_view:nil)->::Google::Cloud::Tasks::V2beta3::TaskForces a task to run now.
When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits or is PAUSED .
This command is meant to be used for manual debugging. For example, RunTask can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.
The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.
If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's schedule_time will be reset to the time that RunTask was called plus the retry delay specified in the queue's RetryConfig .
RunTask returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.
defrun_task(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Taskrun_task via a request object, either of type
RunTaskRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::RunTaskRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defrun_task(name:nil,response_view:nil)->::Google::Cloud::Tasks::V2beta3::Taskrun_task via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The task name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID -
response_view (::Google::Cloud::Tasks::V2beta3::Task::View) — The response_view specifies which subset of the
Task will be returned.
By default response_view is BASIC ; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains.
Authorization for FULL requires
cloudtasks.tasks.fullViewGoogle IAM permission on the Task resource.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Task)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::RunTaskRequest.new # Call the run_task method. result=client.run_taskrequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. presult
#set_iam_policy
defset_iam_policy(request,options=nil)->::Google::Iam::V1::Policy
defset_iam_policy(resource:nil,policy:nil,update_mask:nil)->::Google::Iam::V1::PolicySets the access control policy for a Queue . Replaces any existing policy.
Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console.
Authorization requires the following Google IAM permission on the specified resource parent:
cloudtasks.queues.setIamPolicy
defset_iam_policy(request,options=nil)->::Google::Iam::V1::Policyset_iam_policy via a request object, either of type
Iam::V1::SetIamPolicyRequest or an equivalent Hash.
- request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defset_iam_policy(resource:nil,policy:nil,update_mask:nil)->::Google::Iam::V1::Policyset_iam_policy via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- resource (::String) — REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
-
policy (::Google::Iam::V1::Policy, ::Hash) — REQUIRED: The complete policy to be applied to the
resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. -
update_mask (::Google::Protobuf::FieldMask, ::Hash) — OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
the fields in the mask will be modified. If no mask is provided, the
following default mask is used:
paths: "bindings, etag"
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Iam::V1::Policy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Iam::V1::SetIamPolicyRequest.new # Call the set_iam_policy method. result=client.set_iam_policyrequest # The returned object is of type Google::Iam::V1::Policy. presult
#test_iam_permissions
deftest_iam_permissions(request,options=nil)->::Google::Iam::V1::TestIamPermissionsResponse
deftest_iam_permissions(resource:nil,permissions:nil)->::Google::Iam::V1::TestIamPermissionsResponseReturns permissions that a caller has on a Queue . If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
deftest_iam_permissions(request,options=nil)->::Google::Iam::V1::TestIamPermissionsResponsetest_iam_permissions via a request object, either of type
Iam::V1::TestIamPermissionsRequest or an equivalent Hash.
- request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
deftest_iam_permissions(resource:nil,permissions:nil)->::Google::Iam::V1::TestIamPermissionsResponsetest_iam_permissions via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- resource (::String) — REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
-
permissions (::Array<::String>) — The set of permissions to check for the
resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Iam::V1::TestIamPermissionsResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Iam::V1::TestIamPermissionsRequest.new # Call the test_iam_permissions method. result=client.test_iam_permissionsrequest # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. presult
#universe_domain
defuniverse_domain()->StringThe effective universe domain
- (String)
#update_queue
defupdate_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queue
defupdate_queue(queue:nil,update_mask:nil)->::Google::Cloud::Tasks::V2beta3::QueueUpdates a queue.
This method creates the queue if it does not exist and updates the queue if it does exist.
Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.
WARNING: Using this method may have unintended side effects if you are
using an App Engine queue.yaml or queue.xml file to manage your queues.
Read
Overview of Queue Management and
queue.yaml before using
this method.
defupdate_queue(request,options=nil)->::Google::Cloud::Tasks::V2beta3::Queueupdate_queue via a request object, either of type
UpdateQueueRequest or an equivalent Hash.
- request (::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
defupdate_queue(queue:nil,update_mask:nil)->::Google::Cloud::Tasks::V2beta3::Queueupdate_queue via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
queue (::Google::Cloud::Tasks::V2beta3::Queue, ::Hash) — Required. The queue to create or update.
The queue's name must be specified.
Output only fields cannot be modified using UpdateQueue. Any value specified for an output only field will be ignored. The queue's name cannot be changed.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — A mask used to specify which fields of the queue are being updated.
If empty, then all fields will be updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Tasks::V2beta3::Queue)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/tasks/v2beta3" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new # Call the update_queue method. result=client.update_queuerequest # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. presult