Class: Google::Apis::TaskqueueV1beta2::TaskqueueService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/taskqueue_v1beta2/service.rb

Overview

TaskQueue API

Accesses a Google App Engine Pull Task Queue over REST.

Examples:

require 'google/apis/taskqueue_v1beta2'

Taskqueue = Google::Apis::TaskqueueV1beta2 # Alias the module
service = Taskqueue::TaskqueueService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeTaskqueueService

Returns a new instance of TaskqueueService



51
52
53
54
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 51

def initialize
  super('https://www.googleapis.com/', 'taskqueue/v1beta2/projects/')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



38
39
40
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 38

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.



44
45
46
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



49
50
51
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 49

def user_ip
  @user_ip
end

Instance Method Details

#delete_task(project, taskqueue, task, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Delete a task from a TaskQueue.

Parameters:

  • project (String)

    The project under which the queue lies.

  • taskqueue (String)

    The taskqueue to delete a task from.

  • task (String)

    The id of the task to delete.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:



125
126
127
128
129
130
131
132
133
134
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 125

def delete_task(project, taskqueue, task, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{project}/taskqueues/{taskqueue}/tasks/{task}', options)
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.params['task'] = task unless task.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_task(project, taskqueue, task, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta2::Task

Get a particular task from a TaskQueue.

Parameters:

  • project (String)

    The project under which the queue lies.

  • taskqueue (String)

    The taskqueue in which the task belongs.

  • task (String)

    The task to get properties of.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



164
165
166
167
168
169
170
171
172
173
174
175
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 164

def get_task(project, taskqueue, task, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{project}/taskqueues/{taskqueue}/tasks/{task}', options)
  command.response_representation = Google::Apis::TaskqueueV1beta2::Task::Representation
  command.response_class = Google::Apis::TaskqueueV1beta2::Task
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.params['task'] = task unless task.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_taskqueue(project, taskqueue, get_stats: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta2::TaskQueue

Get detailed information about a TaskQueue.

Parameters:

  • project (String)

    The project under which the queue lies.

  • taskqueue (String)

    The id of the taskqueue to get the properties of.

  • get_stats (Boolean)

    Whether to get stats. Optional.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



84
85
86
87
88
89
90
91
92
93
94
95
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 84

def get_taskqueue(project, taskqueue, get_stats: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{project}/taskqueues/{taskqueue}', options)
  command.response_representation = Google::Apis::TaskqueueV1beta2::TaskQueue::Representation
  command.response_class = Google::Apis::TaskqueueV1beta2::TaskQueue
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.query['getStats'] = get_stats unless get_stats.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_task(project, taskqueue, task_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta2::Task

Insert a new task in a TaskQueue

Parameters:

  • project (String)

    The project under which the queue lies

  • taskqueue (String)

    The taskqueue to insert the task into

  • task_object (Google::Apis::TaskqueueV1beta2::Task) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 204

def insert_task(project, taskqueue, task_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{project}/taskqueues/{taskqueue}/tasks', options)
  command.request_representation = Google::Apis::TaskqueueV1beta2::Task::Representation
  command.request_object = task_object
  command.response_representation = Google::Apis::TaskqueueV1beta2::Task::Representation
  command.response_class = Google::Apis::TaskqueueV1beta2::Task
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#lease_task(project, taskqueue, num_tasks, lease_secs, group_by_tag: nil, tag: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta2::Tasks

Lease 1 or more tasks from a TaskQueue.

Parameters:

  • project (String)

    The project under which the queue lies.

  • taskqueue (String)

    The taskqueue to lease a task from.

  • num_tasks (Fixnum)

    The number of tasks to lease.

  • lease_secs (Fixnum)

    The lease in seconds.

  • group_by_tag (Boolean)

    When true, all returned tasks will have the same tag

  • tag (String)

    The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 254

def lease_task(project, taskqueue, num_tasks, lease_secs, group_by_tag: nil, tag: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{project}/taskqueues/{taskqueue}/tasks/lease', options)
  command.response_representation = Google::Apis::TaskqueueV1beta2::Tasks::Representation
  command.response_class = Google::Apis::TaskqueueV1beta2::Tasks
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.query['groupByTag'] = group_by_tag unless group_by_tag.nil?
  command.query['leaseSecs'] = lease_secs unless lease_secs.nil?
  command.query['numTasks'] = num_tasks unless num_tasks.nil?
  command.query['tag'] = tag unless tag.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_tasks(project, taskqueue, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta2::Tasks2

List Tasks in a TaskQueue

Parameters:

  • project (String)

    The project under which the queue lies.

  • taskqueue (String)

    The id of the taskqueue to list tasks from.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



296
297
298
299
300
301
302
303
304
305
306
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 296

def list_tasks(project, taskqueue, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{project}/taskqueues/{taskqueue}/tasks', options)
  command.response_representation = Google::Apis::TaskqueueV1beta2::Tasks2::Representation
  command.response_class = Google::Apis::TaskqueueV1beta2::Tasks2
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#patch_task(project, taskqueue, task, new_lease_seconds, task_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta2::Task

Update tasks that are leased out of a TaskQueue. This method supports patch semantics.

Parameters:

  • project (String)

    The project under which the queue lies.

  • taskqueue (String)
  • task (String)
  • new_lease_seconds (Fixnum)

    The new lease in seconds.

  • task_object (Google::Apis::TaskqueueV1beta2::Task) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 338

def patch_task(project, taskqueue, task, new_lease_seconds, task_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:patch, '{project}/taskqueues/{taskqueue}/tasks/{task}', options)
  command.request_representation = Google::Apis::TaskqueueV1beta2::Task::Representation
  command.request_object = task_object
  command.response_representation = Google::Apis::TaskqueueV1beta2::Task::Representation
  command.response_class = Google::Apis::TaskqueueV1beta2::Task
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.params['task'] = task unless task.nil?
  command.query['newLeaseSeconds'] = new_lease_seconds unless new_lease_seconds.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_task(project, taskqueue, task, new_lease_seconds, task_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta2::Task

Update tasks that are leased out of a TaskQueue.

Parameters:

  • project (String)

    The project under which the queue lies.

  • taskqueue (String)
  • task (String)
  • new_lease_seconds (Fixnum)

    The new lease in seconds.

  • task_object (Google::Apis::TaskqueueV1beta2::Task) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'generated/google/apis/taskqueue_v1beta2/service.rb', line 383

def update_task(project, taskqueue, task, new_lease_seconds, task_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{project}/taskqueues/{taskqueue}/tasks/{task}', options)
  command.request_representation = Google::Apis::TaskqueueV1beta2::Task::Representation
  command.request_object = task_object
  command.response_representation = Google::Apis::TaskqueueV1beta2::Task::Representation
  command.response_class = Google::Apis::TaskqueueV1beta2::Task
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.params['task'] = task unless task.nil?
  command.query['newLeaseSeconds'] = new_lease_seconds unless new_lease_seconds.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end