Skip to content

Commit

Permalink
Merge pull request #2453 from dhermes/upgrade-gapic-deps
Browse files Browse the repository at this point in the history
Upgrading versions of GAPIC and gRPC generated libraries.
  • Loading branch information
dhermes authored Sep 28, 2016
2 parents fdbd094 + 2c743e5 commit c6145c7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
32 changes: 18 additions & 14 deletions logging/google/cloud/logging/_gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def list_entries(self, projects, filter_='', order_by='',
page_token = INITIAL_PAGE
options = CallOptions(page_token=page_token)
page_iter = self._gax_api.list_log_entries(
projects, filter_, order_by, page_size, options)
projects, filter_=filter_, order_by=order_by,
page_size=page_size, options=options)
entries = [_log_entry_pb_to_mapping(entry_pb)
for entry_pb in page_iter.next()]
token = page_iter.page_token or None
Expand Down Expand Up @@ -107,8 +108,9 @@ def write_entries(self, entries, logger_name=None, resource=None,
options = None
partial_success = False
entry_pbs = [_log_entry_mapping_to_pb(entry) for entry in entries]
self._gax_api.write_log_entries(entry_pbs, logger_name, resource,
labels, partial_success, options)
self._gax_api.write_log_entries(
entry_pbs, log_name=logger_name, resource=resource, labels=labels,
partial_success=partial_success, options=options)

def logger_delete(self, project, logger_name):
"""API call: delete all entries in a logger via a DELETE request
Expand All @@ -122,7 +124,7 @@ def logger_delete(self, project, logger_name):
options = None
path = 'projects/%s/logs/%s' % (project, logger_name)
try:
self._gax_api.delete_log(path, options)
self._gax_api.delete_log(path, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(path)
Expand Down Expand Up @@ -163,7 +165,8 @@ def list_sinks(self, project, page_size=0, page_token=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)
page_iter = self._gax_api.list_sinks(path, page_size=page_size,
options=options)
sinks = [_log_sink_pb_to_mapping(log_sink_pb)
for log_sink_pb in page_iter.next()]
token = page_iter.page_token or None
Expand Down Expand Up @@ -194,7 +197,7 @@ def sink_create(self, project, sink_name, filter_, destination):
sink_pb = LogSink(name=sink_name, filter=filter_,
destination=destination)
try:
self._gax_api.create_sink(parent, sink_pb, options)
self._gax_api.create_sink(parent, sink_pb, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.FAILED_PRECONDITION:
path = 'projects/%s/sinks/%s' % (project, sink_name)
Expand All @@ -217,7 +220,7 @@ def sink_get(self, project, sink_name):
options = None
path = 'projects/%s/sinks/%s' % (project, sink_name)
try:
sink_pb = self._gax_api.get_sink(path, options)
sink_pb = self._gax_api.get_sink(path, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(path)
Expand Down Expand Up @@ -249,7 +252,7 @@ def sink_update(self, project, sink_name, filter_, destination):
path = 'projects/%s/sinks/%s' % (project, sink_name)
sink_pb = LogSink(name=path, filter=filter_, destination=destination)
try:
self._gax_api.update_sink(path, sink_pb, options)
self._gax_api.update_sink(path, sink_pb, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(path)
Expand All @@ -268,7 +271,7 @@ def sink_delete(self, project, sink_name):
options = None
path = 'projects/%s/sinks/%s' % (project, sink_name)
try:
self._gax_api.delete_sink(path, options)
self._gax_api.delete_sink(path, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(path)
Expand Down Expand Up @@ -309,7 +312,8 @@ def list_metrics(self, project, page_size=0, page_token=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)
page_iter = self._gax_api.list_log_metrics(
path, page_size=page_size, options=options)
metrics = [_log_metric_pb_to_mapping(log_metric_pb)
for log_metric_pb in page_iter.next()]
token = page_iter.page_token or None
Expand Down Expand Up @@ -339,7 +343,7 @@ def metric_create(self, project, metric_name, filter_, description):
metric_pb = LogMetric(name=metric_name, filter=filter_,
description=description)
try:
self._gax_api.create_log_metric(parent, metric_pb, options)
self._gax_api.create_log_metric(parent, metric_pb, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.FAILED_PRECONDITION:
path = 'projects/%s/metrics/%s' % (project, metric_name)
Expand All @@ -362,7 +366,7 @@ def metric_get(self, project, metric_name):
options = None
path = 'projects/%s/metrics/%s' % (project, metric_name)
try:
metric_pb = self._gax_api.get_log_metric(path, options)
metric_pb = self._gax_api.get_log_metric(path, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(path)
Expand Down Expand Up @@ -394,7 +398,7 @@ def metric_update(self, project, metric_name, filter_, description):
metric_pb = LogMetric(name=path, filter=filter_,
description=description)
try:
self._gax_api.update_log_metric(path, metric_pb, options)
self._gax_api.update_log_metric(path, metric_pb, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(path)
Expand All @@ -413,7 +417,7 @@ def metric_delete(self, project, metric_name):
options = None
path = 'projects/%s/metrics/%s' % (project, metric_name)
try:
self._gax_api.delete_log_metric(path, options)
self._gax_api.delete_log_metric(path, options=options)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(path)
Expand Down
4 changes: 2 additions & 2 deletions logging/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
'google-cloud-core >= 0.20.0',
'grpcio >= 1.0.0, < 2.0dev',
'google-gax >= 0.14.1, < 0.15dev',
'gapic-google-logging-v2 >= 0.9.0, < 0.10dev',
'grpc-google-logging-v2 >= 0.9.0, < 0.10dev',
'gapic-google-logging-v2 >= 0.10.1, < 0.11dev',
'grpc-google-logging-v2 >= 0.10.1, < 0.11dev',
]

setup(
Expand Down
6 changes: 4 additions & 2 deletions pubsub/google/cloud/pubsub/_gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ def subscription_create(self, subscription_path, topic_path,

try:
sub_pb = self._gax_api.create_subscription(
subscription_path, topic_path, push_config, ack_deadline)
subscription_path, topic_path,
push_config=push_config, ack_deadline_seconds=ack_deadline)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.FAILED_PRECONDITION:
raise Conflict(topic_path)
Expand Down Expand Up @@ -391,7 +392,8 @@ def subscription_pull(self, subscription_path, return_immediately=False,
"""
try:
response_pb = self._gax_api.pull(
subscription_path, max_messages, return_immediately)
subscription_path, max_messages,
return_immediately=return_immediately)
except GaxError as exc:
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND:
raise NotFound(subscription_path)
Expand Down
4 changes: 2 additions & 2 deletions pubsub/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
'google-cloud-core >= 0.20.0',
'grpcio >= 1.0.0, < 2.0dev',
'google-gax >= 0.14.1, < 0.15dev',
'gapic-google-pubsub-v1 >= 0.9.0, < 0.10dev',
'grpc-google-pubsub-v1 >= 0.9.0, < 0.10dev',
'gapic-google-pubsub-v1 >= 0.10.1, < 0.11dev',
'grpc-google-pubsub-v1 >= 0.10.1, < 0.11dev',
]

setup(
Expand Down

0 comments on commit c6145c7

Please sign in to comment.