Skip to main content

No project description provided

Project description

wait-for-service

Waits for a dependency before continuing. It's meant to be used in startup scripts like Docker's entrypoint. This project is forked from http://github.com/wlatanowicz/wait-for-service

Installing

pip install wait-for-service

Usage

wait-for-service dependency-url-1 dependency-url-2 ... dependency-url-n

ie:

wait-for-service https://my-server/healthz/ psql://user@db-host/db-name

Available checks

HTTP(s)

HTTP and HTTPS are available by default. Follows redirects; only response with HTTP code 2XX is accepted as valid.

Accepted URL schemas

  • http://
  • https://

Example

wait-for-service https://my-server/healthz/ http://my-server/healthz/

PostgreSQL

RDBMS has to accept connection and allow to perform simple SELECT query.

Installation

pip install wait-for-service[postgres]

Accepted URL schemas

  • postgres://
  • postgresql://
  • psql://

Example

wait-for-service psql://admin:password@db-host/db_name

MySQL

RDBMS has to accept connection and allow to perform simple SELECT query.

Installation

pip install wait-for-service[mysql]

Accepted URL schemas

  • mysql://

Example

wait-for-service mysql://admin:password@db-host/db_name

Redis

Rdis has to accept connection to selected database (defaults to 0).

Installation

pip install wait-for-service[redis]

Accepted URL schemas

  • redis://

Example

wait-for-service redis://redis-host/5

Memcached

Memcached has to accept connection.

Installation

pip install wait-for-service[memcached]

Accepted URL schemas

  • memcached://

Example

wait-for-service memcached://memcached-host/

MongoDB

MongoDB has to accept connection.

Installation

pip install wait-for-service[mongodb]

Accepted URL schemas

  • mongodb://

Example

wait-for-service mongodb://admin:password@db-host/db_name

RabbitMQ

RabbitMQ has to accept connection to given vhost. You can use optional querystring params require_queue and require_exchange to additionaly check if particular queue or exchange exists (check will fail otherwise).

Installation

pip install wait-for-service[amqp]

Accepted URL schemas

  • amqp://

Example

wait-for-service amqp://admin:password@rabbit-host/vhost
wait-for-service amqp://admin:password@rabbit-host/vhost?require_queue=myqueue
wait-for-service amqp://admin:password@rabbit-host/vhost?require_exchange=myexchange
wait-for-service amqp://admin:password@rabbit-host/vhost?require_exchange=myexchange&require_exchange=mysecondexchange&require_queue=myqueue&require_queue=mysecondqueue

Apache Kafka

Kafka has to accept connection. In HA mode (node count > 1) only one node is required to accept the connection.

Installation

pip install wait-for-service[kafka]

Accepted URL schemas

  • kafka://

Example

wait-for-service kafka://kafka-host/
wait-for-service kafka://kafka-first-host/,kafka://kafka-second-host/

TCP

Plain TCP is available by default. Service port is required.

Accepted URL schemas

  • tcp://

Example

wait-for-service tcp://my-server:7624

Unix

Unix sockets are available by default.

Accepted URL schemas

  • unix://

Example

wait-for-service unix:///var/run/docker.sock

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

wait_for_service-1.2.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

wait_for_service-1.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file wait_for_service-1.2.0.tar.gz.

File metadata

  • Download URL: wait_for_service-1.2.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for wait_for_service-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d2dd2d18af6758e8c972cf3987e9b07c219aa5d82440b5bbc1ae7dac466e6be2
MD5 ec751412a62a2bc8c1c5f992571db317
BLAKE2b-256 0d19c2554f086fb8fc7c1ae2b45499fff6d5014df5b56cbc7040e3b210e35daf

See more details on using hashes here.

File details

Details for the file wait_for_service-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wait_for_service-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1af7e429273362aa80938d3616357a923225afb174065314420f4f6b07c2005f
MD5 b88d890dc5443e1135683779e168bf95
BLAKE2b-256 3b0d49a375369de835b3714326a8ffc8a8c13d985fbc5c2ff2cf53d014a316d2

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