pubsub.publisher_client

Attributes

SCOPES

log

Classes

PublisherClient

Functions

init_api_root(api_root)

Module Contents

pubsub.publisher_client.SCOPES = ['https://www.googleapis.com/auth/pubsub']
pubsub.publisher_client.log
pubsub.publisher_client.init_api_root(api_root)
Parameters:

api_root (Optional[str])

Return type:

Tuple[bool, str]

class pubsub.publisher_client.PublisherClient(*, service_file=None, session=None, token=None, api_root=None)
Parameters:
  • 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
session
token
static project_path(project)
Parameters:

project (str)

Return type:

str

classmethod subscription_path(project, subscription)
Parameters:
  • project (str)

  • subscription (str)

Return type:

str

classmethod topic_path(project, topic)
Parameters:
  • project (str)

  • topic (str)

Return type:

str

async _headers()
Return type:

Dict[str, str]

async list_topics(project, query_params=None, *, session=None, timeout=10)

List topics

Parameters:
  • project (str)

  • query_params (Optional[Dict[str, str]])

  • session (Optional[requests.Session])

  • timeout (int)

Return type:

Dict[str, Any]

async create_topic(topic, body=None, *, session=None, timeout=10)

Create topic.

Parameters:
  • topic (str)

  • body (Optional[Dict[str, Any]])

  • session (Optional[requests.Session])

  • timeout (int)

Return type:

Dict[str, Any]

async delete_topic(topic, *, session=None, timeout=10)

Delete topic.

Parameters:
  • topic (str)

  • session (Optional[requests.Session])

  • timeout (int)

Return type:

None

async publish(topic, messages, session=None, timeout=10)
Parameters:
Return type:

Dict[str, Any]

async close()
Return type:

None

async __aenter__()
Return type:

PublisherClient

async __aexit__(*args)
Parameters:

args (Any)

Return type:

None