Skip to main content

A stub emulator for the Google Cloud Tasks API

Project description

Local Emulator for Google Cloud Tasks

Google doesn't (yet) ship an emulator for the Cloud Tasks API like they do for Cloud Datastore.

This is a stub emulator so you can run your tests and do local development without having to connect to the production Tasks API.

THIS IS A WORK IN PROGRESS NOT ALL API CALLS ARE COMPLETE

Usage

Start the emulator with:

gcloud-tasks-emulator start --port=9090

Then from within your code, use the following (instead of your normal production client connection)

from google.cloud.tasks_v2 import CloudTasksClient
from google.cloud.tasks_v2.gapic.transports.cloud_tasks_grpc_transport import CloudTasksGrpcTransport
from google.api_core.client_options import ClientOptions

client = CloudTasksClient(
    transport=CloudTasksGrpcTransport(channel=grpc.insecure_channel("127.0.0.1:%s" % port)),
    client_options=ClientOptions(api_endpoint="127.0.0.1:%s" % port)
)

The 'default' queue

By default, the emulator won't create a 'default' queue, however you can enable this by passing the fully-qualified name of the queue:

gcloud-tasks-emulator start --default-queue=projects/[PROJECT]/locations/[LOCATION]/queues/default

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcloud-tasks-emulator-0.3.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

gcloud_tasks_emulator-0.3.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file gcloud-tasks-emulator-0.3.1.tar.gz.

File metadata

  • Download URL: gcloud-tasks-emulator-0.3.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for gcloud-tasks-emulator-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a3c1322196ba76c1019b96811e9820c1f8b809200e65e5be8811dabf4191a391
MD5 c214b66e7877a92d435850046d0781ed
BLAKE2b-256 835e3b11a76f45be1818f8a734ac90d4b4062c514cd943efacec9a0b6abc5bfa

See more details on using hashes here.

File details

Details for the file gcloud_tasks_emulator-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: gcloud_tasks_emulator-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for gcloud_tasks_emulator-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb01ee01052391bdfb1b20d7d23359d03c53718fcde80d8676f6f853c251b42
MD5 3cb0838311d5c7a4be89e3312349a0fa
BLAKE2b-256 5385100f69053e8b28098b12cc64bef0ed1c82c1b21fd501975262c4004661bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page