Skip to content

Commit

Permalink
updated cluster links and option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
callmehiphop committed Jul 12, 2016
1 parent 96eb260 commit 2b31d15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ job.getQueryResults().on('data', function(row) {});
- [API Documentation][gcloud-bigtable-docs]
- [Official Documentation][cloud-bigtable-docs]

*You may need to [create a cluster][gcloud-bigtable-cluster] to use the Google Cloud Bigtable API with your project.*
*You may need to [create a cluster][cloud-bigtable-cluster] to use the Google Cloud Bigtable API with your project.*

#### Preview

Expand Down Expand Up @@ -740,7 +740,7 @@ Apache 2.0 - See [COPYING](COPYING) for more information.
[cloud-bigquery-docs]: https://cloud.google.com/bigquery/what-is-bigquery

[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs/
[cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-cluster
[cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-compute-instance

[cloud-compute-docs]: https://cloud.google.com/compute/docs

Expand Down
13 changes: 6 additions & 7 deletions lib/bigtable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var googleProtoFiles = require('google-proto-files');
var is = require('is');
var nodeutil = require('util');
var format = require('string-format-obj');
var extend = require('extend');

/**
* @type {module:bigtable/table}
Expand Down Expand Up @@ -56,7 +57,7 @@ var util = require('../common/util.js');
* To learn more about Bigtable, read the
* [Google Cloud Bigtable Concepts Overview](https://cloud.google.com/bigtable/docs/concepts)
*
* @resource [Creating a Cloud Bigtable Cluster]{@link https://cloud.google.com/bigtable/docs/creating-cluster}
* @resource [Creating a Cloud Bigtable Cluster]{@link https://cloud.google.com/bigtable/docs/creating-compute-instance}
*
* @param {object=} options - [Configuration object](#/docs).
* @param {string} options.cluster - The cluster name that hosts your tables.
Expand All @@ -80,7 +81,7 @@ var util = require('../common/util.js');
* // Before you create your table, you first need to create a Bigtable Cluster
* // for the table to be served from. This can be done from either the
* // Google Cloud Platform Console or the `gcloud` cli tool. Please refer to
* // the <a href="https://cloud.google.com/bigtable/docs/creating-cluster">
* // the <a href="https://cloud.google.com/bigtable/docs/creating-compute-instance">
* // official Bigtable documentation</a> for more information.
* //-
*
Expand Down Expand Up @@ -280,11 +281,9 @@ function Bigtable(options) {
return new Bigtable(options);
}

options = {
projectId: options.projectId,
zone: options.zone.name || options.zone,
cluster: options.cluster
};
options = extend({}, options, {
zone: options.zone.name || options.zone
});

this.clusterName = format(
'projects/{projectId}/zones/{zone}/clusters/{cluster}',
Expand Down

0 comments on commit 2b31d15

Please sign in to comment.