diff --git a/docs/logging-usage.rst b/docs/logging-usage.rst index 3dd2a6efab19..e39027c5406f 100644 --- a/docs/logging-usage.rst +++ b/docs/logging-usage.rst @@ -13,6 +13,12 @@ Authentication and Configuration to interact with. If you are Google App Engine or Google Compute Engine this will be detected automatically. +- The library now enables the ``gRPC`` transport for the logging API by + default, assuming that the required dependencies are installed and + importable. To *disable* this transport, set the + :envvar:`GCLOUD_DISABLE_GAX` environment variable to a non-empty string, + e.g.: ``$ export GCLOUD_DISABLE_GAX=1``. + - After configuring your environment, create a :class:`Client ` diff --git a/docs/pubsub-usage.rst b/docs/pubsub-usage.rst index 9a7f7e7acf27..b530fc37672d 100644 --- a/docs/pubsub-usage.rst +++ b/docs/pubsub-usage.rst @@ -7,6 +7,17 @@ Authentication / Configuration - Use :class:`Client ` objects to configure your applications. +- In addition to any authentication configuration, you should also set the + :envvar:`GCLOUD_PROJECT` environment variable for the project you'd like + to interact with. If you are Google App Engine or Google Compute Engine + this will be detected automatically. + +- The library now enables the ``gRPC`` transport for the pubsub API by + default, assuming that the required dependencies are installed and + importable. To *disable* this transport, set the + :envvar:`GCLOUD_DISABLE_GAX` environment variable to a non-empty string, + e.g.: ``$ export GCLOUD_DISABLE_GAX=1``. + - :class:`Client ` objects hold both a ``project`` and an authenticated connection to the PubSub service. diff --git a/gcloud/logging/client.py b/gcloud/logging/client.py index 9bee2668849e..c51f502ac075 100644 --- a/gcloud/logging/client.py +++ b/gcloud/logging/client.py @@ -47,7 +47,8 @@ from gcloud.logging.sink import Sink -_USE_GAX = _HAVE_GAX and (os.environ.get('GCLOUD_ENABLE_GAX') is not None) +_DISABLE_GAX = os.getenv('GCLOUD_DISABLE_GAX', False) +_USE_GAX = _HAVE_GAX and not _DISABLE_GAX class Client(JSONClient): diff --git a/gcloud/pubsub/client.py b/gcloud/pubsub/client.py index e5f88ab36cb5..eb6e808872f0 100644 --- a/gcloud/pubsub/client.py +++ b/gcloud/pubsub/client.py @@ -41,7 +41,8 @@ # pylint: enable=ungrouped-imports -_USE_GAX = _HAVE_GAX and (os.environ.get('GCLOUD_ENABLE_GAX') is not None) +_DISABLE_GAX = os.getenv('GCLOUD_DISABLE_GAX', False) +_USE_GAX = _HAVE_GAX and not _DISABLE_GAX class Client(JSONClient):