taskqueue

This library implements various methods for working with the Google Taskqueue APIs.

Installation

$ pip install --upgrade gcloud-aio-taskqueue

Usage

We’re still working on documentation – for now, you can use the smoke tests as an example.

Emulators

For testing purposes, you may want to use gcloud-aio-taskqueue along with a local emulator. Setting the $CLOUDTASKS_EMULATOR_HOST environment variable to the address of your emulator should be enough to do the trick.

Submodules

Package Contents

Classes

PushQueue

Attributes

SCOPES

__version__

class taskqueue.PushQueue(project, taskqueue, location='us-central1', service_file=None, session=None, token=None, api_root=None)
Parameters:
  • project (str) –

  • taskqueue (str) –

  • location (str) –

  • service_file (Optional[Union[str, IO[AnyStr]]]) –

  • session (Optional[requests.Session]) –

  • token (Optional[gcloud.aio.auth.Token]) –

  • api_root (Optional[str]) –

_api_root: str
_api_is_dev: bool
_queue_path: str
async headers()
Return type:

Dict[str, str]

task_name(task_id)
Parameters:

task_id (str) –

Return type:

str

async create(task, session=None, timeout=10)
Parameters:
  • task (Dict[str, Any]) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

Return type:

Any

async delete(tname, session=None, timeout=10)
Parameters:
  • tname (str) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

Return type:

Any

async get(tname, full=False, session=None, timeout=10)
Parameters:
  • tname (str) –

  • full (bool) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

Return type:

Any

async list(full=False, page_size=1000, page_token='', session=None, timeout=10)
Parameters:
  • full (bool) –

  • page_size (int) –

  • page_token (str) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

Return type:

Any

async run(tname, full=False, session=None, timeout=10)
Parameters:
  • tname (str) –

  • full (bool) –

  • session (Optional[requests.Session]) –

  • timeout (int) –

Return type:

Any

async close()
Return type:

None

async __aenter__()
Return type:

PushQueue

async __aexit__(*args)
Parameters:

args (Any) –

Return type:

None

taskqueue.SCOPES = ['https://www.googleapis.com/auth/cloud-tasks']
taskqueue.__version__