Class: Google::Apis::TaskqueueV1beta1::TaskqueueService

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

Overview

TaskQueue API

Accesses a Google App Engine Pull Task Queue over REST.

Examples:

require 'google/apis/taskqueue_v1beta1'

Taskqueue = Google::Apis::TaskqueueV1beta1 # 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_v1beta1/service.rb', line 51

def initialize
  super('https://www.googleapis.com/', 'taskqueue/v1beta1/projects/')
  @batch_path = 'batch/taskqueue/v1beta1'
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_v1beta1/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_v1beta1/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_v1beta1/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_v1beta1/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::TaskqueueV1beta1::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_v1beta1/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::TaskqueueV1beta1::Task::Representation
  command.response_class = Google::Apis::TaskqueueV1beta1::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::TaskqueueV1beta1::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_v1beta1/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::TaskqueueV1beta1::TaskQueue::Representation
  command.response_class = Google::Apis::TaskqueueV1beta1::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

#lease_task(project, taskqueue, num_tasks, lease_secs, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::TaskqueueV1beta1::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.

  • 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:



207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'generated/google/apis/taskqueue_v1beta1/service.rb', line 207

def lease_task(project, taskqueue, num_tasks, lease_secs, 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::TaskqueueV1beta1::Tasks::Representation
  command.response_class = Google::Apis::TaskqueueV1beta1::Tasks
  command.params['project'] = project unless project.nil?
  command.params['taskqueue'] = taskqueue unless taskqueue.nil?
  command.query['leaseSecs'] = lease_secs unless lease_secs.nil?
  command.query['numTasks'] = num_tasks unless num_tasks.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::TaskqueueV1beta1::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:



247
248
249
250
251
252
253
254
255
256
257
# File 'generated/google/apis/taskqueue_v1beta1/service.rb', line 247

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::TaskqueueV1beta1::Tasks2::Representation
  command.response_class = Google::Apis::TaskqueueV1beta1::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