Skip to content

Commit 137efae

Browse files
stephenpluspluscallmehiphop
authored andcommitted
add readmes for all packages (#1495)
* add bigquery readme * add all readmes * copy readme as part of release script * gcloud-node -> google-cloud-node * fix youre good to gos * add resource manager scope * exclude unecessary files
1 parent e6e78fc commit 137efae

19 files changed

Lines changed: 1355 additions & 4 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
packages/google-cloud/README.md
2+
packages/*/AUTHORS
3+
packages/*/CONTRIBUTORS
4+
packages/*/COPYING
15
**/node_modules
26
**/coverage/*
37
docs/json/**/*.json

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,22 @@ If you are not running this client on Google Compute Engine, you need a Google D
8282
1. Visit the [Google Developers Console][dev-console].
8383
2. Create a new project or click on an existing project.
8484
3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services):
85+
* BigQuery API
86+
* Cloud Bigtable API
87+
* Cloud Bigtable Admin API
88+
* Cloud Bigtable Table Admin API
8589
* Google Cloud Datastore API
90+
* Google Cloud DNS API
91+
* Google Cloud Logging API
92+
* Google Cloud Natural Language API
93+
* Google Cloud Pub/Sub API
94+
* Google Cloud Resource Manager API
8695
* Google Cloud Storage
8796
* Google Cloud Storage JSON API
97+
* Google Cloud Vision API
98+
* Google Compute Engine API
99+
* Google Translate API
100+
* Prediction API
88101
4. Navigate to **APIs & auth** > **Credentials** and then:
89102
* If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests.
90103
* If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file.
@@ -463,6 +476,7 @@ var storage = require('@google-cloud/storage');
463476

464477
```js
465478
var fs = require('fs');
479+
466480
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
467481
// global basis (see Authentication section above).
468482

@@ -1082,7 +1096,7 @@ Apache 2.0 - See [COPYING](COPYING) for more information.
10821096

10831097
[cloud-bigquery-docs]: https://cloud.google.com/bigquery/what-is-bigquery
10841098

1085-
[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs/
1099+
[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs
10861100
[cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-compute-instance
10871101

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

packages/bigquery/README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# @google-cloud/bigquery
2+
> Google BigQuery Client Library for Node.js
3+
4+
*Looking for more Google APIs than just BigQuery? You might want to check out [`google-cloud`][google-cloud].*
5+
6+
- [API Documentation][gcloud-bigquery-docs]
7+
- [Official Documentation][cloud-bigquery-docs]
8+
9+
10+
```sh
11+
$ npm install --save @google-cloud/bigquery
12+
```
13+
```js
14+
var bigquery = require('@google-cloud/bigquery')({
15+
projectId: 'grape-spaceship-123',
16+
keyFilename: '/path/to/keyfile.json'
17+
});
18+
19+
// Access an existing dataset and table.
20+
var schoolsDataset = bigquery.dataset('schools');
21+
var schoolsTable = schoolsDataset.table('schoolsData');
22+
23+
// Import data into a table.
24+
schoolsTable.import('/local/file.json', function(err, job) {});
25+
26+
// Get results from a query job.
27+
var job = bigquery.job('job-id');
28+
29+
// Use a callback.
30+
job.getQueryResults(function(err, rows) {});
31+
32+
// Or get the same results as a readable stream.
33+
job.getQueryResults().on('data', function(row) {});
34+
```
35+
36+
37+
## Authentication
38+
39+
It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.
40+
41+
### On Google Compute Engine
42+
43+
If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.
44+
45+
``` js
46+
// Authenticating on a global basis.
47+
var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123'
48+
49+
var bigQuery = require('@google-cloud/bigquery')({
50+
projectId: projectId
51+
});
52+
53+
// ...you're good to go!
54+
```
55+
56+
### Elsewhere
57+
58+
If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account:
59+
60+
1. Visit the [Google Developers Console][dev-console].
61+
2. Create a new project or click on an existing project.
62+
3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services):
63+
* BigQuery API
64+
4. Navigate to **APIs & auth** > **Credentials** and then:
65+
* If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests.
66+
* If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file.
67+
68+
``` js
69+
var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123'
70+
71+
var bigQuery = require('@google-cloud/bigquery')({
72+
projectId: projectId,
73+
74+
// The path to your key file:
75+
keyFilename: '/path/to/keyfile.json'
76+
77+
// Or the contents of the key file:
78+
credentials: require('./path/to/keyfile.json')
79+
});
80+
81+
// ...you're good to go!
82+
```
83+
84+
85+
[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node
86+
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
87+
[dev-console]: https://console.developers.google.com/project
88+
[gcloud-bigquery-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery
89+
[cloud-bigquery-docs]: https://cloud.google.com/bigquery/what-is-bigquery

packages/bigtable/README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# @google-cloud/bigtable
2+
> Google Cloud Bigtable Client Library for Node.js
3+
4+
*Looking for more Google APIs than just Bigtable? You might want to check out [`google-cloud`][google-cloud].*
5+
6+
- [API Documentation][gcloud-bigtable-docs]
7+
- [Official Documentation][cloud-bigtable-docs]
8+
9+
*You may need to [create a cluster][cloud-bigtable-cluster] to use the Google Cloud Bigtable API with your project.*
10+
11+
12+
```sh
13+
$ npm install --save @google-cloud/bigtable
14+
```
15+
```js
16+
var bigtable = require('@google-cloud/bigtable')({
17+
projectId: 'grape-spaceship-123',
18+
keyFilename: '/path/to/keyfile.json',
19+
zone: 'my-zone',
20+
cluster: 'my-cluster'
21+
});
22+
23+
var table = bigtable.table('prezzy');
24+
25+
table.getRows(function(err, rows) {});
26+
27+
// Update a row in your table.
28+
var row = table.row('alincoln');
29+
30+
row.save('follows:gwashington', 1, function(err) {
31+
if (err) {
32+
// Error handling omitted.
33+
}
34+
35+
row.get('follows:gwashington', function(err, data) {
36+
if (err) {
37+
// Error handling omitted.
38+
}
39+
40+
// data = {
41+
// follows: {
42+
// gwashington: [
43+
// {
44+
// value: 1
45+
// }
46+
// ]
47+
// }
48+
// }
49+
});
50+
});
51+
```
52+
53+
54+
## Authentication
55+
56+
It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.
57+
58+
### On Google Compute Engine
59+
60+
If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.
61+
62+
``` js
63+
// Authenticating on a global basis.
64+
var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123'
65+
66+
var bigtable = require('@google-cloud/bigtable')({
67+
projectId: projectId
68+
});
69+
70+
// ...you're good to go!
71+
```
72+
73+
### Elsewhere
74+
75+
If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account:
76+
77+
1. Visit the [Google Developers Console][dev-console].
78+
2. Create a new project or click on an existing project.
79+
3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services):
80+
* Cloud Bigtable API
81+
* Cloud Bigtable Admin API
82+
* Cloud Bigtable Table Admin API
83+
4. Navigate to **APIs & auth** > **Credentials** and then:
84+
* If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests.
85+
* If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file.
86+
87+
``` js
88+
var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123'
89+
90+
var bigtable = require('@google-cloud/bigtable')({
91+
projectId: projectId,
92+
93+
// The path to your key file:
94+
keyFilename: '/path/to/keyfile.json'
95+
96+
// Or the contents of the key file:
97+
credentials: require('./path/to/keyfile.json')
98+
});
99+
100+
// ...you're good to go!
101+
```
102+
103+
104+
[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node
105+
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
106+
[dev-console]: https://console.developers.google.com/project
107+
[gcloud-bigtable-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigtable
108+
[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs
109+
[cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-compute-instance

packages/compute/README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# @google-cloud/compute
2+
> Google Compute Engine Client Library for Node.js
3+
4+
*Looking for more Google APIs than just Compute Engine? You might want to check out [`google-cloud`][google-cloud].*
5+
6+
- [API Documentation][gcloud-compute-docs]
7+
- [Official Documentation][cloud-compute-docs]
8+
9+
10+
```sh
11+
$ npm install --save @google-cloud/compute
12+
```
13+
```js
14+
var gce = require('@google-cloud/compute')({
15+
projectId: 'grape-spaceship-123',
16+
keyFilename: '/path/to/keyfile.json'
17+
});
18+
19+
// Create a new VM using the latest OS image of your choice.
20+
var zone = gce.zone('us-central1-a');
21+
var name = 'ubuntu-http';
22+
23+
zone.createVM(name, { os: 'ubuntu' }, function(err, vm, operation) {
24+
// `operation` lets you check the status of long-running tasks.
25+
26+
operation
27+
.on('error', function(err) {})
28+
.on('running', function(metadata) {})
29+
.on('complete', function() {
30+
// Virtual machine created!
31+
});
32+
});
33+
```
34+
35+
36+
## Authentication
37+
38+
It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.
39+
40+
### On Google Compute Engine
41+
42+
If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.
43+
44+
``` js
45+
// Authenticating on a global basis.
46+
var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123'
47+
48+
var gce = require('@google-cloud/compute')({
49+
projectId: projectId
50+
});
51+
52+
// ...you're good to go!
53+
```
54+
55+
### Elsewhere
56+
57+
If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account:
58+
59+
1. Visit the [Google Developers Console][dev-console].
60+
2. Create a new project or click on an existing project.
61+
3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services):
62+
* Google Compute Engine API
63+
4. Navigate to **APIs & auth** > **Credentials** and then:
64+
* If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests.
65+
* If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file.
66+
67+
``` js
68+
var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123'
69+
70+
var gce = require('@google-cloud/compute')({
71+
projectId: projectId,
72+
73+
// The path to your key file:
74+
keyFilename: '/path/to/keyfile.json'
75+
76+
// Or the contents of the key file:
77+
credentials: require('./path/to/keyfile.json')
78+
});
79+
80+
// ...you're good to go!
81+
```
82+
83+
84+
[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node
85+
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
86+
[dev-console]: https://console.developers.google.com/project
87+
[gcloud-compute-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/compute
88+
[cloud-compute-docs]: https://cloud.google.com/compute/docs

0 commit comments

Comments
 (0)