Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Bigtable Cluster location on create() request. #3646

Merged
merged 1 commit into from
Jul 20, 2017
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
Adding Bigtable Cluster location on create() request.
  • Loading branch information
dhermes committed Jul 20, 2017
commit 7f04cbc3662efbaf8943f66424d56f41a0d45dc0
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