def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue, args.location) duration = parsers.FormatLeaseDuration(args.lease_duration) filter_string = parsers.ParseTasksLeaseFilterFlags(args) return tasks_client.Lease(queue_ref, duration, filter_string=filter_string, max_tasks=args.limit).tasks
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue) task_ref = parsers.ParseTask(args.id, queue_ref) if args.id else None task_config = parsers.ParseCreateTaskArgs( args, constants.APP_ENGINE_QUEUE, tasks_client.api.messages) create_response = tasks_client.Create( queue_ref, task_ref, schedule_time=task_config.scheduleTime, app_engine_http_request=task_config.appEngineHttpRequest) log.CreatedResource(create_response.name, 'task') return create_response
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue, args.location) task_ref = parsers.ParseTask(args.id, queue_ref) if args.id else None task_config = parsers.ParseCreateTaskArgs(args, constants.PULL_QUEUE, tasks_client.api.messages) create_response = tasks_client.Create( queue_ref, task_ref, schedule_time=task_config.scheduleTime, pull_message=task_config.pullMessage) log.CreatedResource(create_response.name, 'task') return create_response
def __init__(self): super(GaApiAdapter, self).__init__(GA_API_VERSION) self.queues = queues.Queues(self.client.MESSAGES_MODULE, self.client.projects_locations_queues) self.tasks = tasks.Tasks(self.client.MESSAGES_MODULE, self.client.projects_locations_queues_tasks)
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue, args.location) task_ref = parsers.ParseTask(args.task, queue_ref) return tasks_client.Acknowledge(task_ref, args.schedule_time)
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue) task_ref = parsers.ParseTask(args.task, queue_ref) return tasks_client.CancelLease(task_ref, args.schedule_time)
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue, args.location) task_ref = parsers.ParseTask(args.task, queue_ref) return tasks_client.Run(task_ref)
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue, args.location) task_ref = parsers.ParseTask(args.task, queue_ref) duration = parsers.FormatLeaseDuration(args.lease_duration) return tasks_client.RenewLease(task_ref, args.schedule_time, duration)
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue, args.location) return tasks_client.List(queue_ref, args.limit, args.page_size)
def Run(self, args): tasks_client = tasks.Tasks() queue_ref = parsers.ParseQueue(args.queue, args.location) task_ref = parsers.ParseTask(args.task, queue_ref) tasks_client.Delete(task_ref) log.DeletedResource(task_ref.Name(), kind='task')
def Run(self, args): tasks_client = tasks.Tasks() task_ref = parsers.ParseTask(args.task, args.queue) return tasks_client.Run(task_ref)