Skip to content

Commit

Permalink
Adding Bigtable Cluster location on create() request. (googleapis#3646)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes authored and landrito committed Aug 21, 2017
1 parent c1eb49d commit 7ee1d88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions bigtable/google/cloud/bigtable/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def _prepare_create_request(cluster):
parent=cluster._instance.name,
cluster_id=cluster.cluster_id,
cluster=data_v2_pb2.Cluster(
location=cluster.location,
serve_nodes=cluster.serve_nodes,
),
)
Expand Down
2 changes: 2 additions & 0 deletions bigtable/tests/unit/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,14 @@ def test_it(self):
instance = _Instance(INSTANCE_ID, client)
cluster = Cluster(CLUSTER_ID, instance,
serve_nodes=SERVE_NODES)
cluster.location = u'projects/prahj-ekt/locations/zona-tres'

request_pb = self._call_fut(cluster)

self.assertEqual(request_pb.cluster_id, CLUSTER_ID)
self.assertEqual(request_pb.parent, instance.name)
self.assertEqual(request_pb.cluster.serve_nodes, SERVE_NODES)
self.assertEqual(request_pb.cluster.location, cluster.location)


def _ClusterPB(*args, **kw):
Expand Down

0 comments on commit 7ee1d88

Please sign in to comment.