Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions gcloud/logging/_gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, gax_api):
self._gax_api = gax_api

def list_entries(self, projects, filter_='', order_by='',
page_size=0, page_token=INITIAL_PAGE):
page_size=0, page_token=None):
"""Return a page of log entry resources.

:type projects: list of strings
Expand Down Expand Up @@ -73,6 +73,8 @@ def list_entries(self, projects, filter_='', order_by='',
if not None, indicates that more entries can be retrieved
with another call (pass that value as ``page_token``).
"""
if page_token is None:
page_token = INITIAL_PAGE

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

options = CallOptions(page_token=page_token)
page_iter = self._gax_api.list_log_entries(
projects, filter_, order_by, page_size, options)
Expand Down Expand Up @@ -135,7 +137,7 @@ class _SinksAPI(object):
def __init__(self, gax_api):
self._gax_api = gax_api

def list_sinks(self, project, page_size=0, page_token=INITIAL_PAGE):
def list_sinks(self, project, page_size=0, page_token=None):
"""List sinks for the project associated with this client.

:type project: string
Expand All @@ -155,6 +157,8 @@ def list_sinks(self, project, page_size=0, page_token=INITIAL_PAGE):
if not None, indicates that more sinks can be retrieved
with another call (pass that value as ``page_token``).
"""
if page_token is None:
page_token = INITIAL_PAGE
options = CallOptions(page_token=page_token)
path = 'projects/%s' % (project,)
page_iter = self._gax_api.list_sinks(path, page_size, options)
Expand Down Expand Up @@ -279,7 +283,7 @@ class _MetricsAPI(object):
def __init__(self, gax_api):
self._gax_api = gax_api

def list_metrics(self, project, page_size=0, page_token=INITIAL_PAGE):
def list_metrics(self, project, page_size=0, page_token=None):
"""List metrics for the project associated with this client.

:type project: string
Expand All @@ -299,6 +303,8 @@ def list_metrics(self, project, page_size=0, page_token=INITIAL_PAGE):
if not None, indicates that more metrics can be retrieved
with another call (pass that value as ``page_token``).
"""
if page_token is None:
page_token = INITIAL_PAGE
options = CallOptions(page_token=page_token)
path = 'projects/%s' % (project,)
page_iter = self._gax_api.list_log_metrics(path, page_size, options)
Expand Down
13 changes: 9 additions & 4 deletions gcloud/pubsub/_gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _PublisherAPI(object):
def __init__(self, gax_api):
self._gax_api = gax_api

def list_topics(self, project, page_size=0, page_token=INITIAL_PAGE):
def list_topics(self, project, page_size=0, page_token=None):
"""List topics for the project associated with this API.

See:
Expand All @@ -60,6 +60,8 @@ def list_topics(self, project, page_size=0, page_token=INITIAL_PAGE):
more topics can be retrieved with another call (pass that
value as ``page_token``).
"""
if page_token is None:
page_token = INITIAL_PAGE
options = CallOptions(page_token=page_token)
path = 'projects/%s' % (project,)
page_iter = self._gax_api.list_topics(
Expand Down Expand Up @@ -162,7 +164,7 @@ def topic_publish(self, topic_path, messages):
return result.message_ids

def topic_list_subscriptions(self, topic_path, page_size=0,
page_token=INITIAL_PAGE):
page_token=None):
"""API call: list subscriptions bound to a topic

See:
Expand All @@ -187,6 +189,8 @@ def topic_list_subscriptions(self, topic_path, page_size=0,
:raises: :exc:`gcloud.exceptions.NotFound` if the topic does not
exist
"""
if page_token is None:
page_token = INITIAL_PAGE
options = CallOptions(page_token=page_token)
try:
page_iter = self._gax_api.list_topic_subscriptions(
Expand All @@ -209,8 +213,7 @@ class _SubscriberAPI(object):
def __init__(self, gax_api):
self._gax_api = gax_api

def list_subscriptions(self, project, page_size=0,
page_token=INITIAL_PAGE):
def list_subscriptions(self, project, page_size=0, page_token=None):
"""List subscriptions for the project associated with this API.

See:
Expand All @@ -234,6 +237,8 @@ def list_subscriptions(self, project, page_size=0,
more topics can be retrieved with another call (pass that
value as ``page_token``).
"""
if page_token is None:
page_token = INITIAL_PAGE
options = CallOptions(page_token=page_token)
path = 'projects/%s' % (project,)
page_iter = self._gax_api.list_subscriptions(
Expand Down