From f24e607f7e98b8d9c57a2659d9e09b7459fd0832 Mon Sep 17 00:00:00 2001 From: circle-ci Date: Tue, 11 Apr 2017 15:52:03 +0000 Subject: [PATCH] Update docs for v0.51.1 [ci skip] --- json/google-cloud/v0.51.1/authentication.md | 31 +++++++ .../v0.51.1/bigquery/dataset.json | 1 + json/google-cloud/v0.51.1/bigquery/index.json | 1 + json/google-cloud/v0.51.1/bigquery/job.json | 1 + json/google-cloud/v0.51.1/bigquery/table.json | 1 + .../v0.51.1/bigtable/cluster.json | 1 + .../google-cloud/v0.51.1/bigtable/family.json | 1 + .../google-cloud/v0.51.1/bigtable/filter.json | 1 + json/google-cloud/v0.51.1/bigtable/index.json | 1 + .../v0.51.1/bigtable/instance.json | 1 + json/google-cloud/v0.51.1/bigtable/row.json | 1 + json/google-cloud/v0.51.1/bigtable/table.json | 1 + .../google-cloud/v0.51.1/compute/address.json | 1 + .../v0.51.1/compute/autoscaler.json | 1 + json/google-cloud/v0.51.1/compute/disk.json | 1 + .../v0.51.1/compute/firewall.json | 1 + .../v0.51.1/compute/health-check.json | 1 + json/google-cloud/v0.51.1/compute/index.json | 1 + .../v0.51.1/compute/instance-group.json | 1 + .../v0.51.1/compute/machine-type.json | 1 + .../google-cloud/v0.51.1/compute/network.json | 1 + .../v0.51.1/compute/operation.json | 1 + json/google-cloud/v0.51.1/compute/region.json | 1 + json/google-cloud/v0.51.1/compute/rule.json | 1 + .../google-cloud/v0.51.1/compute/service.json | 1 + .../v0.51.1/compute/snapshot.json | 1 + .../v0.51.1/compute/subnetwork.json | 1 + json/google-cloud/v0.51.1/compute/vm.json | 1 + json/google-cloud/v0.51.1/compute/zone.json | 1 + .../google-cloud/v0.51.1/datastore/index.json | 1 + .../google-cloud/v0.51.1/datastore/query.json | 1 + .../v0.51.1/datastore/transaction.json | 1 + json/google-cloud/v0.51.1/dns/change.json | 1 + json/google-cloud/v0.51.1/dns/index.json | 1 + json/google-cloud/v0.51.1/dns/record.json | 1 + json/google-cloud/v0.51.1/dns/zone.json | 1 + json/google-cloud/v0.51.1/faq.md | 25 +++++ json/google-cloud/v0.51.1/index.json | 1 + .../v0.51.1/language/document.json | 1 + json/google-cloud/v0.51.1/language/index.json | 1 + json/google-cloud/v0.51.1/logging/entry.json | 1 + json/google-cloud/v0.51.1/logging/index.json | 1 + json/google-cloud/v0.51.1/logging/log.json | 1 + json/google-cloud/v0.51.1/logging/sink.json | 1 + .../v0.51.1/monitoring/index.json | 1 + .../v0.51.1/prediction/index.json | 1 + .../v0.51.1/prediction/model.json | 1 + json/google-cloud/v0.51.1/pubsub/index.json | 1 + .../v0.51.1/pubsub/subscription.json | 1 + json/google-cloud/v0.51.1/pubsub/topic.json | 1 + json/google-cloud/v0.51.1/resource/index.json | 1 + .../v0.51.1/resource/project.json | 1 + .../v0.51.1/spanner/database.json | 1 + json/google-cloud/v0.51.1/spanner/index.json | 1 + .../v0.51.1/spanner/instance.json | 1 + json/google-cloud/v0.51.1/spanner/table.json | 1 + .../v0.51.1/spanner/transaction.json | 1 + json/google-cloud/v0.51.1/speech/index.json | 1 + json/google-cloud/v0.51.1/storage/bucket.json | 1 + .../google-cloud/v0.51.1/storage/channel.json | 1 + json/google-cloud/v0.51.1/storage/file.json | 1 + json/google-cloud/v0.51.1/storage/index.json | 1 + json/google-cloud/v0.51.1/toc.json | 1 + .../google-cloud/v0.51.1/translate/index.json | 1 + json/google-cloud/v0.51.1/troubleshooting.md | 93 +++++++++++++++++++ json/google-cloud/v0.51.1/types.json | 1 + json/google-cloud/v0.51.1/vision/index.json | 1 + manifest.json | 3 + 68 files changed, 216 insertions(+) create mode 100644 json/google-cloud/v0.51.1/authentication.md create mode 100644 json/google-cloud/v0.51.1/bigquery/dataset.json create mode 100644 json/google-cloud/v0.51.1/bigquery/index.json create mode 100644 json/google-cloud/v0.51.1/bigquery/job.json create mode 100644 json/google-cloud/v0.51.1/bigquery/table.json create mode 100644 json/google-cloud/v0.51.1/bigtable/cluster.json create mode 100644 json/google-cloud/v0.51.1/bigtable/family.json create mode 100644 json/google-cloud/v0.51.1/bigtable/filter.json create mode 100644 json/google-cloud/v0.51.1/bigtable/index.json create mode 100644 json/google-cloud/v0.51.1/bigtable/instance.json create mode 100644 json/google-cloud/v0.51.1/bigtable/row.json create mode 100644 json/google-cloud/v0.51.1/bigtable/table.json create mode 100644 json/google-cloud/v0.51.1/compute/address.json create mode 100644 json/google-cloud/v0.51.1/compute/autoscaler.json create mode 100644 json/google-cloud/v0.51.1/compute/disk.json create mode 100644 json/google-cloud/v0.51.1/compute/firewall.json create mode 100644 json/google-cloud/v0.51.1/compute/health-check.json create mode 100644 json/google-cloud/v0.51.1/compute/index.json create mode 100644 json/google-cloud/v0.51.1/compute/instance-group.json create mode 100644 json/google-cloud/v0.51.1/compute/machine-type.json create mode 100644 json/google-cloud/v0.51.1/compute/network.json create mode 100644 json/google-cloud/v0.51.1/compute/operation.json create mode 100644 json/google-cloud/v0.51.1/compute/region.json create mode 100644 json/google-cloud/v0.51.1/compute/rule.json create mode 100644 json/google-cloud/v0.51.1/compute/service.json create mode 100644 json/google-cloud/v0.51.1/compute/snapshot.json create mode 100644 json/google-cloud/v0.51.1/compute/subnetwork.json create mode 100644 json/google-cloud/v0.51.1/compute/vm.json create mode 100644 json/google-cloud/v0.51.1/compute/zone.json create mode 100644 json/google-cloud/v0.51.1/datastore/index.json create mode 100644 json/google-cloud/v0.51.1/datastore/query.json create mode 100644 json/google-cloud/v0.51.1/datastore/transaction.json create mode 100644 json/google-cloud/v0.51.1/dns/change.json create mode 100644 json/google-cloud/v0.51.1/dns/index.json create mode 100644 json/google-cloud/v0.51.1/dns/record.json create mode 100644 json/google-cloud/v0.51.1/dns/zone.json create mode 100644 json/google-cloud/v0.51.1/faq.md create mode 100644 json/google-cloud/v0.51.1/index.json create mode 100644 json/google-cloud/v0.51.1/language/document.json create mode 100644 json/google-cloud/v0.51.1/language/index.json create mode 100644 json/google-cloud/v0.51.1/logging/entry.json create mode 100644 json/google-cloud/v0.51.1/logging/index.json create mode 100644 json/google-cloud/v0.51.1/logging/log.json create mode 100644 json/google-cloud/v0.51.1/logging/sink.json create mode 100644 json/google-cloud/v0.51.1/monitoring/index.json create mode 100644 json/google-cloud/v0.51.1/prediction/index.json create mode 100644 json/google-cloud/v0.51.1/prediction/model.json create mode 100644 json/google-cloud/v0.51.1/pubsub/index.json create mode 100644 json/google-cloud/v0.51.1/pubsub/subscription.json create mode 100644 json/google-cloud/v0.51.1/pubsub/topic.json create mode 100644 json/google-cloud/v0.51.1/resource/index.json create mode 100644 json/google-cloud/v0.51.1/resource/project.json create mode 100644 json/google-cloud/v0.51.1/spanner/database.json create mode 100644 json/google-cloud/v0.51.1/spanner/index.json create mode 100644 json/google-cloud/v0.51.1/spanner/instance.json create mode 100644 json/google-cloud/v0.51.1/spanner/table.json create mode 100644 json/google-cloud/v0.51.1/spanner/transaction.json create mode 100644 json/google-cloud/v0.51.1/speech/index.json create mode 100644 json/google-cloud/v0.51.1/storage/bucket.json create mode 100644 json/google-cloud/v0.51.1/storage/channel.json create mode 100644 json/google-cloud/v0.51.1/storage/file.json create mode 100644 json/google-cloud/v0.51.1/storage/index.json create mode 100644 json/google-cloud/v0.51.1/toc.json create mode 100644 json/google-cloud/v0.51.1/translate/index.json create mode 100644 json/google-cloud/v0.51.1/troubleshooting.md create mode 100644 json/google-cloud/v0.51.1/types.json create mode 100644 json/google-cloud/v0.51.1/vision/index.json diff --git a/json/google-cloud/v0.51.1/authentication.md b/json/google-cloud/v0.51.1/authentication.md new file mode 100644 index 00000000000..a17b748bcb6 --- /dev/null +++ b/json/google-cloud/v0.51.1/authentication.md @@ -0,0 +1,31 @@ +## Authenticating with this module + +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 Cloud services. + +```js +var config = { + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}; +``` + +### The `config` object + +A `config` object is not required if you are in an environment which supports [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). This could be your own development machine when using the [gcloud SDK](https://cloud.google.com/sdk) or within Google App Engine and Compute Engine. + +If this doesn't describe your environment, the `config` object expects the following properties: + +1. One of the following: + 1. `credentials` object containing `client_email` and `private_key` properties. + 2. `keyFilename` path to a .json, .pem, or .p12 key file. + 3. `GOOGLE_APPLICATION_CREDENTIALS` environment variable with a full path to your key file. + +2. `projectId` + + If you wish, you can set an environment variable (`GCLOUD_PROJECT`) in place of specifying this inline. Or, if you have provided a service account JSON key file as the `config.keyFilename` property explained above, your project ID will be detected automatically. + +**Note**: When using a .pem or .p12 key file, `config.email` is also required. + + +[dev-console]: https://console.developers.google.com/project +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using diff --git a/json/google-cloud/v0.51.1/bigquery/dataset.json b/json/google-cloud/v0.51.1/bigquery/dataset.json new file mode 100644 index 00000000000..62ca1ed9d6f --- /dev/null +++ b/json/google-cloud/v0.51.1/bigquery/dataset.json @@ -0,0 +1 @@ +{"id":"bigquery/dataset","type":"class","name":"Dataset","overview":"

\n This class allows you interact with BigQuery.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigquery.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigquery/src/dataset.js","parent":"bigquery","children":[],"methods":[{"id":"Dataset","name":"Dataset","type":"constructor","description":"

Interact with your BigQuery dataset. Create a Dataset instance with bigquery#createDataset or bigquery#dataset.

","source":"packages/bigquery/src/dataset.js#L49","resources":[],"examples":[{"code":"var dataset = bigquery.dataset('institutions');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a dataset.

","source":"packages/bigquery/src/dataset.js#L69","resources":[],"examples":[{"code":"dataset.create(function(err, dataset, apiResponse) {\n if (!err) {\n // The dataset was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.create().then(function(data) {\n var dataset = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the dataset exists.

","source":"packages/bigquery/src/dataset.js#L89","resources":[],"examples":[{"code":"dataset.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a dataset if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/bigquery/src/dataset.js#L118","resources":[],"examples":[{"code":"dataset.get(function(err, dataset, apiResponse) {\n if (!err) {\n // `dataset.metadata` has been populated.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.get().then(function(data) {\n var dataset = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata for the Dataset.

","source":"packages/bigquery/src/dataset.js#L142","resources":[{"title":"Datasets: get API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/datasets/get"}],"examples":[{"code":"dataset.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Sets the metadata of the Dataset object.

","source":"packages/bigquery/src/dataset.js#L169","resources":[{"title":"Datasets: patch API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/datasets/patch"}],"examples":[{"code":"var metadata = {\n description: 'Info for every institution in the 2013 IPEDS universe'\n};\n\ndataset.setMetadata(metadata, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createTable","name":"createTable","type":"instance","description":"

Create a table given a tableId or configuration object.

","source":"packages/bigquery/src/dataset.js#L244","resources":[{"title":"Tables: insert API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tables/insert"}],"examples":[{"code":"var tableId = 'institution_data';\n\nvar options = {\n // From the data.gov CSV dataset (http://goo.gl/kSE7z6):\n schema: 'UNITID,INSTNM,ADDR,CITY,STABBR,ZIP,FIPS,OBEREG,CHFNM,...'\n};\n\ndataset.createTable(tableId, options, function(err, table, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.createTable(tableId, options).then(function(data) {\n var table = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"id","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.schema","description":" ","types":["string","object"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.table","description":" ","types":["bigquery/table"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the dataset.

","source":"packages/bigquery/src/dataset.js#L327","resources":[{"title":"Datasets: delete API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/datasets/delete"}],"examples":[{"caption":"

Delete the dataset, only if it does not have any tables.

","code":"dataset.delete(function(err, apiResponse) {});"},{"caption":"

Delete the dataset and any tables it contains.

","code":"dataset.delete({ force: true }, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.force","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getTables","name":"getTables","type":"instance","description":"

Get a list of tables.

","source":"packages/bigquery/src/dataset.js#L389","resources":[{"title":"Tables: list API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tables/list"}],"examples":[{"code":"dataset.getTables(function(err, tables) {\n // tables is an array of `Table` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, tables, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n dataset.getTables(nextQuery, callback);\n }\n}\n\ndataset.getTables({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dataset.getTables().then(function(data) {\n var tables = data[0];\n});"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.tables","description":" ","types":["bigquery/table[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getTablesStream","name":"getTablesStream","type":"instance","description":"

List all or some of the bigquery/table objects in your project as a readable object stream.

","source":"packages/bigquery/src/dataset.js#L450","resources":[],"examples":[{"code":"dataset.getTablesStream()\n .on('error', console.error)\n .on('data', function(table) {})\n .on('end', function() {\n // All tables have been retrieved\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"dataset.getTablesStream()\n .on('data', function(table) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"table","name":"table","type":"instance","description":"

Create a Table object.

","source":"packages/bigquery/src/dataset.js#L482","resources":[],"examples":[{"code":"var institutions = dataset.table('institution_data');"}],"params":[{"name":"id","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["bigquery/table"],"description":""}]}],"path":"dataset.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigquery/index.json b/json/google-cloud/v0.51.1/bigquery/index.json new file mode 100644 index 00000000000..fc8fb27884b --- /dev/null +++ b/json/google-cloud/v0.51.1/bigquery/index.json @@ -0,0 +1 @@ +{"id":"bigquery","type":"class","name":"BigQuery","overview":"

\n This class allows you interact with BigQuery.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigquery.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigquery/src/index.js","parent":null,"children":["bigquery/dataset","bigquery/job","bigquery/table"],"methods":[{"id":"BigQuery","name":"BigQuery","type":"constructor","description":"

In the following examples from this page and the other modules (Dataset, Table, etc.), we are going to be using a dataset from data.gov of higher education institutions.

We will create a table with the correct schema, import the public CSV file into that table, and query it for data.

","source":"packages/bigquery/src/index.js#L62","resources":[{"title":"What is BigQuery?","link":"https://cloud.google.com/bigquery/what-is-bigquery"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"date","name":"date","type":"instance","description":"

The DATE type represents a logical calendar date, independent of time zone. It does not represent a specific 24-hour time period. Rather, a given DATE value represents a different 24-hour period when interpreted in different time zones, and may represent a shorter or longer day during Daylight Savings Time transitions.

","source":"packages/bigquery/src/index.js#L105","resources":[],"examples":[{"code":"var date = bigquery.date('2017-01-01');"},{"caption":"

Alternatively, provide an object.

","code":"var date = bigquery.date({\n year: 2017,\n month: 1,\n day: 1\n});"}],"params":[{"name":"value","description":" ","types":["object","string"],"optional":false,"nullable":false},{"name":"value.year","description":" ","types":["string","number"],"optional":false,"nullable":false},{"name":"value.month","description":" ","types":["string","number"],"optional":false,"nullable":false},{"name":"value.day","description":" ","types":["string","number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"datetime","name":"datetime","type":"instance","description":"

A DATETIME data type represents a point in time. Unlike a TIMESTAMP, this does not refer to an absolute instance in time. Instead, it is the civil time, or the time that a user would see on a watch or calendar.

","source":"packages/bigquery/src/index.js#L150","resources":[],"examples":[{"code":"var datetime = bigquery.datetime('2017-01-01 13:00:00');"},{"caption":"

Alternatively, provide an object.

","code":"var datetime = bigquery.datetime({\n year: 2017,\n month: 1,\n day: 1,\n hours: 14,\n minutes: 0,\n seconds: 0\n});"}],"params":[{"name":"value","description":" ","types":["object","string"],"optional":false,"nullable":false},{"name":"value.year","description":" ","types":["string","number"],"optional":false,"nullable":false},{"name":"value.month","description":" ","types":["string","number"],"optional":false,"nullable":false},{"name":"value.day","description":" ","types":["string","number"],"optional":false,"nullable":false},{"name":"value.hours","description":" ","types":["string","number"],"optional":true,"nullable":false},{"name":"value.minutes","description":" ","types":["string","number"],"optional":true,"nullable":false},{"name":"value.seconds","description":" ","types":["string","number"],"optional":true,"nullable":false},{"name":"value.fractional","description":" ","types":["string","number"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"time","name":"time","type":"instance","description":"

A TIME data type represents a time, independent of a specific date.

","source":"packages/bigquery/src/index.js#L200","resources":[],"examples":[{"code":"var time = bigquery.time('14:00:00'); // 2:00 PM"},{"caption":"

Alternatively, provide an object.

","code":"var time = bigquery.time({\n hours: 14,\n minutes: 0,\n seconds: 0\n});"}],"params":[{"name":"value","description":" ","types":["object","string"],"optional":false,"nullable":false},{"name":"value.hours","description":" ","types":["string","number"],"optional":true,"nullable":false},{"name":"value.minutes","description":" ","types":["string","number"],"optional":true,"nullable":false},{"name":"value.seconds","description":" ","types":["string","number"],"optional":true,"nullable":false},{"name":"value.fractional","description":" ","types":["string","number"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"timestamp","name":"timestamp","type":"instance","description":"

A timestamp represents an absolute point in time, independent of any time zone or convention such as Daylight Savings Time.

","source":"packages/bigquery/src/index.js#L227","resources":[],"examples":[{"code":"var timestamp = bigquery.timestamp(new Date());"}],"params":[{"name":"value","description":" ","types":["date"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createDataset","name":"createDataset","type":"instance","description":"

Create a dataset.

","source":"packages/bigquery/src/index.js#L369","resources":[{"title":"Datasets: insert API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/datasets/insert"}],"examples":[{"code":"bigquery.createDataset('my-dataset', function(err, dataset, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bigquery.createDataset('my-dataset').then(function(data) {\n var dataset = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"id","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.dataset","description":" ","types":["bigquery/dataset"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createQueryStream","name":"createQueryStream","type":"instance","description":"

Run a query scoped to your project as a readable object stream.

","source":"packages/bigquery/src/index.js#L426","resources":[],"examples":[{"code":"var query = 'SELECT url FROM [publicdata:samples.github_nested] LIMIT 100';\n\nbigquery.createQueryStream(query)\n .on('error', console.error)\n .on('data', function(row) {\n // row is a result from your query.\n })\n .on('end', function() {\n // All rows retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"bigquery.createQueryStream(query)\n .on('data', function(row) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"dataset","name":"dataset","type":"instance","description":"

Create a reference to a dataset.

","source":"packages/bigquery/src/index.js#L437","resources":[],"examples":[{"code":"var dataset = bigquery.dataset('higher_education');"}],"params":[{"name":"id","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["bigquery/dataset"],"description":""}]},{"id":"getDatasets","name":"getDatasets","type":"instance","description":"

List all or some of the datasets in your project.

","source":"packages/bigquery/src/index.js#L487","resources":[{"title":"Datasets: list API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/datasets/list"}],"examples":[{"code":"bigquery.getDatasets(function(err, datasets) {\n if (!err) {\n // datasets is an array of Dataset objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, datasets, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n bigquery.getDatasets(nextQuery, callback);\n }\n};\n\nbigquery.getDatasets({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bigquery.getDatasets().then(function(datasets) {});"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"query.all","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"query.autoPaginate","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.datasets","description":" ","types":["bigquery/dataset[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getDatasetsStream","name":"getDatasetsStream","type":"instance","description":"

List all or some of the bigquery/dataset objects in your project as a readable object stream.

","source":"packages/bigquery/src/index.js#L551","resources":[],"examples":[{"code":"bigquery.getDatasetsStream()\n .on('error', console.error)\n .on('data', function(dataset) {\n // dataset is a Dataset object.\n })\n .on('end', function() {\n // All datasets retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"bigquery.getDatasetsStream()\n .on('data', function(dataset) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getJobs","name":"getJobs","type":"instance","description":"

Get all of the jobs from your project.

","source":"packages/bigquery/src/index.js#L609","resources":[{"title":"Jobs: list API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/list"}],"examples":[{"code":"bigquery.getJobs(function(err, jobs) {\n if (!err) {\n // jobs is an array of Job objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, jobs, nextQuery, apiRespose) {\n if (nextQuery) {\n // More results exist.\n bigquery.getJobs(nextQuery, callback);\n }\n};\n\nbigquery.getJobs({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bigquery.getJobs().then(function(data) {\n var jobs = data[0];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.allUsers","description":" ","types":["boolean"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":" ","types":["number"],"optional":true,"nullable":false},{"name":"options.pageToken","description":" ","types":["string"],"optional":true,"nullable":false},{"name":"options.projection","description":" ","types":["string"],"optional":true,"nullable":false},{"name":"options.stateFilter","description":" ","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.jobs","description":" ","types":["bigquery/job[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getJobsStream","name":"getJobsStream","type":"instance","description":"

List all or some of the bigquery/job objects in your project as a readable object stream.

","source":"packages/bigquery/src/index.js#L674","resources":[],"examples":[{"code":"bigquery.getJobsStream()\n .on('error', console.error)\n .on('data', function(job) {\n // job is a Job object.\n })\n .on('end', function() {\n // All jobs retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"bigquery.getJobsStream()\n .on('data', function(job) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"job","name":"job","type":"instance","description":"

Create a reference to an existing job.

","source":"packages/bigquery/src/index.js#L685","resources":[],"examples":[{"code":"var myExistingJob = bigquery.job('job-id');"}],"params":[{"name":"id","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["bigquery/job"],"description":""}]},{"id":"query","name":"query","type":"instance","description":"

Run a query scoped to your project.

","source":"packages/bigquery/src/index.js#L785","resources":[{"title":"Jobs: query API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/query"}],"examples":[{"code":"var query = 'SELECT url FROM [publicdata:samples.github_nested] LIMIT 100';\n\nbigquery.query(query, function(err, rows) {\n if (!err) {\n // Handle results here.\n }\n});"},{"caption":"

Positional SQL parameters are supported.

","code":"bigquery.query({\n query: [\n 'SELECT url',\n 'FROM `publicdata.samples.github_nested`',\n 'WHERE repository.owner = ?'\n ].join(' '),\n\n params: [\n 'google'\n ]\n}, callback);"},{"caption":"

Or if you prefer to name them, that's also supported.

","code":"bigquery.query({\n query: [\n 'SELECT url',\n 'FROM `publicdata.samples.github_nested`',\n 'WHERE repository.owner = @owner'\n ].join(' '),\n\n params: {\n owner: 'google'\n }\n}, callback);"},{"caption":"

If you need to use a DATE, DATETIME, TIME, or TIMESTAMP type in \nyour query, see bigquery#date, bigquery#datetime, \nbigquery#time, and bigquery#timestamp.

"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, rows, nextQuery, apiResponse) {\n if (nextQuery) {\n bigquery.query(nextQuery, callback);\n }\n};\n\nbigquery.query({\n query: query,\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bigquery.query(query).then(function(data) {\n var rows = data[0];\n});"}],"params":[{"name":"options","description":" ","types":["string","object"],"optional":false,"nullable":false},{"name":"options.autoPaginate","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"options.params","description":" ","types":["object","*[]"],"optional":false,"nullable":false},{"name":"options.query","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.timeoutMs","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.rows","description":" ","types":["array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"startQuery","name":"startQuery","type":"instance","description":"

Run a query as a job. No results are immediately returned. Instead, your callback will be executed with a bigquery/job object that you must ping for the results. See the Job documentation for explanations of how to check on the status of the job.

","source":"packages/bigquery/src/index.js#L931","resources":[{"title":"Jobs: insert API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/insert"}],"examples":[{"code":"var query = 'SELECT url FROM [publicdata:samples.github_nested] LIMIT 100';"},{"caption":"

You may pass only a query string, having a new table created to store the \nresults of the query.

","code":"bigquery.startQuery(query, function(err, job) {});"},{"caption":"

You can also control the destination table by providing a \nbigquery/table object.

","code":"bigquery.startQuery({\n destination: bigquery.dataset('higher_education').table('institutions'),\n query: query\n}, function(err, job) {});"},{"caption":"

After you have run startQuery, your query will execute in a job. Your \ncallback is executed with a bigquery/job object so that you may \ncheck for the results.

","code":"bigquery.startQuery(query, function(err, job) {\n if (!err) {\n job.getQueryResults(function(err, rows, apiResponse) {});\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bigquery.startQuery(query).then(function(data) {\n var job = data[0];\n var apiResponse = data[1];\n\n return job.getQueryResults();\n});"}],"params":[{"name":"options","description":" ","types":["object","string"],"optional":false,"nullable":false},{"name":"options.destination","description":" ","types":["bigquery/table"],"optional":true,"nullable":false},{"name":"options.query","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.job","description":" ","types":["bigquery/job"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a query is not specified.

"},{"type":"Error","description":"

If a Table is not provided as a destination.

"}],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigquery/job.json b/json/google-cloud/v0.51.1/bigquery/job.json new file mode 100644 index 00000000000..5990defdbc2 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigquery/job.json @@ -0,0 +1 @@ +{"id":"bigquery/job","type":"class","name":"Job","overview":"

\n This class allows you interact with BigQuery.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigquery.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigquery/src/job.js","parent":"bigquery","children":[],"methods":[{"id":"Job","name":"Job","type":"constructor","description":"

Job objects are returned from various places in the BigQuery API:

They can be used to check the status of a running job or fetching the results of a previously-executed one.

","source":"packages/bigquery/src/job.js#L77","resources":[],"examples":[{"code":"var job = bigquery.job('job-id');"},{"caption":"

All jobs are event emitters. The status of each job is polled \ncontinuously, starting only after you register a \"complete\" listener.

","code":"job.on('complete', function(metadata) {\n // The job is complete.\n});"},{"caption":"

Be sure to register an error handler as well to catch any issues which \nimpeded the job.

","code":"job.on('error', function(err) {\n // An error occurred during the job.\n});"},{"caption":"

To force the Job object to stop polling for updates, simply remove any \n\"complete\" listeners you've registered. \nThe easiest way to do this is with removeAllListeners().

","code":"job.removeAllListeners();"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the job exists.

","source":"packages/bigquery/src/job.js#L97","resources":[],"examples":[{"code":"job.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"job.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a job if it exists.

","source":"packages/bigquery/src/job.js#L117","resources":[],"examples":[{"code":"job.get(function(err, job, apiResponse) {\n if (!err) {\n // `job.metadata` has been populated.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"job.get().then(function(data) {\n var job = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata of the job. This will mostly be useful for checking the status of a previously-run job.

","source":"packages/bigquery/src/job.js#L143","resources":[{"title":"Jobs: get API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/get"}],"examples":[{"code":"var job = bigquery.job('id');\njob.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"job.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"cancel","name":"cancel","type":"instance","description":"

Cancel a job. Use bigquery/job#getMetadata to see if the cancel completes successfully. See an example implementation below.

","source":"packages/bigquery/src/job.js#L194","resources":[{"title":"Jobs: get API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/cancel"}],"examples":[{"code":"job.cancel(function(err, apiResponse) {\n // Check to see if the job completes successfully.\n job.on('error', function(err) {});\n job.on('complete', function(metadata) {});\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"job.cancel().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getQueryResults","name":"getQueryResults","type":"instance","description":"

Get the results of a job.

","source":"packages/bigquery/src/job.js#L271","resources":[{"title":"Jobs: getQueryResults API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/getQueryResults"}],"examples":[{"caption":"

Get all of the results of a query.

","code":"job.getQueryResults(function(err, rows) {\n if (!err) {\n // rows is an array of results.\n }\n});"},{"caption":"

Customize the results you want to fetch.

","code":"job.getQueryResults({\n maxResults: 100\n}, function(err, rows) {});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, rows, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n job.getQueryResults(nextQuery, callback);\n }\n};\n\njob.getQueryResults({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"job.getQueryResults().then(function(data) {\n var rows = data[0];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.startIndex","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"options.timeoutMs","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.rows","description":" ","types":["array"],"optional":false,"nullable":false},{"name":"callback.nextQuery","description":" ","types":["object"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getQueryResultsStream","name":"getQueryResultsStream","type":"instance","description":"

Get the results of a job as a readable object stream.

","source":"packages/bigquery/src/job.js#L300","resources":[],"examples":[{"code":"var through2 = require('through2');\nvar fs = require('fs');\n\njob.getQueryResultsStream()\n .pipe(through2.obj(function (row, enc, next) {\n this.push(JSON.stringify(row) + '\\n');\n next();\n }))\n .pipe(fs.createWriteStream('./test/testdata/testfile.json'));"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]}],"path":"job.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigquery/table.json b/json/google-cloud/v0.51.1/bigquery/table.json new file mode 100644 index 00000000000..d5ebff7fef5 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigquery/table.json @@ -0,0 +1 @@ +{"id":"bigquery/table","type":"class","name":"Table","overview":"

\n This class allows you interact with BigQuery.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigquery.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigquery/src/table.js","parent":"bigquery","children":[],"methods":[{"id":"Table","name":"Table","type":"constructor","description":"

Table objects are returned by methods such as bigquery/dataset#table, bigquery/dataset#createTable, and bigquery/dataset#getTables.

","source":"packages/bigquery/src/table.js#L64","resources":[],"examples":[{"code":"var dataset = bigquery.dataset('my-dataset');\n\nvar table = dataset.table('my-table');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a table.

","source":"packages/bigquery/src/table.js#L86","resources":[],"examples":[{"code":"table.create(function(err, table, apiResponse) {\n if (!err) {\n // The table was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.create().then(function(data) {\n var table = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete a table and all its data.

","source":"packages/bigquery/src/table.js#L108","resources":[{"title":"Tables: delete API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tables/delete"}],"examples":[{"code":"table.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the table exists.

","source":"packages/bigquery/src/table.js#L128","resources":[],"examples":[{"code":"table.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a table if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/bigquery/src/table.js#L155","resources":[],"examples":[{"code":"table.get(function(err, table, apiResponse) {\n // `table.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.get().then(function(data) {\n var table = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Return the metadata associated with the Table.

","source":"packages/bigquery/src/table.js#L179","resources":[{"title":"Tables: get API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tables/get"}],"examples":[{"code":"table.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"copy","name":"copy","type":"instance","description":"

Copy data from one table to another, optionally creating that table.

","source":"packages/bigquery/src/table.js#L381","resources":[{"title":"Jobs: insert API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/insert"}],"examples":[{"code":"var yourTable = dataset.table('your-table');\ntable.copy(yourTable, function(err, job, apiResponse) {\n // `job` is a Job object that can be used to check the status of the\n // request.\n});"},{"caption":"

See the configuration.copy object for all \navailable options.

","code":"var metadata = {\n createDisposition: 'CREATE_NEVER',\n writeDisposition: 'WRITE_TRUNCATE'\n};\n\ntable.copy(yourTable, metadata, function(err, job, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.copy(yourTable, metadata).then(function(data) {\n var job = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"destination","description":" ","types":["bigquery/table"],"optional":false,"nullable":false},{"name":"metadata","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.job","description":" ","types":["bigquery/job"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a destination other than a Table object is provided.

"}],"returns":[]},{"id":"createReadStream","name":"createReadStream","type":"instance","description":"

Create a readable stream of the rows of data in your table. This method is simply a wrapper around bigquery/table#getRows.

","source":"packages/bigquery/src/table.js#L462","resources":[{"title":"Tabledata: list API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tabledata/list"}],"examples":[{"code":"table.createReadStream(options)\n .on('error', console.error)\n .on('data', function(row) {})\n .on('end', function() {\n // All rows have been retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"table.createReadStream()\n .on('data', function(row) {\n this.end();\n });"}],"params":[],"exceptions":[],"returns":[{"types":["ReadableStream"],"description":""}]},{"id":"createWriteStream","name":"createWriteStream","type":"instance","description":"

Load data into your table from a readable stream of JSON, CSV, or AVRO data.

","source":"packages/bigquery/src/table.js#L507","resources":[{"title":"Jobs: insert API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/insert"}],"examples":[{"caption":"

Load data from a CSV file.

","code":"var request = require('request');\n\nvar csvUrl = 'http://goo.gl/kSE7z6';\n\nvar metadata = {\n allowJaggedRows: true,\n skipLeadingRows: 1\n};\n\nrequest.get(csvUrl)\n .pipe(table.createWriteStream(metadata))\n .on('complete', function(job) {\n // `job` is a Job object that can be used to check the status of the\n // request.\n });"},{"caption":"

Load data from a JSON file.

","code":"var fs = require('fs');\n\nfs.createReadStream('./test/testdata/testfile.json')\n .pipe(table.createWriteStream('json'))\n .on('complete', function(job) {});"}],"params":[{"name":"metadata","description":" ","types":["string","object"],"optional":true,"nullable":false}],"exceptions":[{"type":"Error","description":"

If source format isn't recognized.

"}],"returns":[{"types":["WritableStream"],"description":""}]},{"id":"export","name":"export","type":"instance","description":"

Export table to Cloud Storage.

","source":"packages/bigquery/src/table.js#L630","resources":[{"title":"Jobs: insert API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/insert"}],"examples":[{"code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar exportedFile = gcs.bucket('institutions').file('2014.csv');"},{"caption":"

To use the default options, just pass a storage/file object. \nNote: The exported format type will be inferred by the file's extension. \nIf you wish to override this, or provide an array of destination files, \nyou must provide an options object.

","code":"table.export(exportedFile, function(err, job, apiResponse) {\n // `job` is a Job object that can be used to check the status of the\n // request.\n});"},{"caption":"

If you need more customization, pass an options object.

","code":"var options = {\n format: 'json',\n gzip: true\n};\n\ntable.export(exportedFile, options, function(err, job, apiResponse) {});"},{"caption":"

You can also specify multiple destination files.

","code":"table.export([\n gcs.bucket('institutions').file('2014.json'),\n gcs.bucket('institutions-copy').file('2014.json')\n], options, function(err, job, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.export(exportedFile, options).then(function(data) {\n var job = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"destination","description":" ","types":["storage/file"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.format","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.gzip","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.job","description":" ","types":["bigquery/job"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If destination isn't a File object.

"},{"type":"Error","description":"

If destination format isn't recongized.

"}],"returns":[]},{"id":"getRows","name":"getRows","type":"instance","description":"

Retrieves table data from a specified set of rows. The rows are returned to your callback as an array of objects matching your table's schema.

","source":"packages/bigquery/src/table.js#L745","resources":[{"title":"Tabledata: list API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tabledata/list"}],"examples":[{"code":"table.getRows(function(err, rows) {\n if (!err) {\n // Handle results here.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, rows, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n table.getRows(nextQuery, callback);\n }\n};\n\ntable.getRows({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.getRows().then(function(data) {\n var rows = data[0];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.rows","description":" ","types":["array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"import","name":"import","type":"instance","description":"

Load data from a local file or Storage file (storage/file).

By loading data this way, you create a load job that will run your data load asynchronously. If you would like instantaneous access to your data, insert it using bigquery/table#insert.

Note: The file type will be inferred by the given file's extension. If you wish to override this, you must provide metadata.format.

","source":"packages/bigquery/src/table.js#L875","resources":[{"title":"Jobs: insert API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/jobs/insert"}],"examples":[{"caption":"

Load data from a local file.

","code":"table.import('./institutions.csv', function(err, job, apiResponse) {\n // `job` is a Job object that can be used to check the status of the\n // request.\n});"},{"caption":"

You may also pass in metadata in the format of a Jobs resource. See \n(http://goo.gl/BVcXk4) for a full list of supported values.

","code":"var metadata = {\n encoding: 'ISO-8859-1',\n sourceFormat: 'NEWLINE_DELIMITED_JSON'\n};\n\ntable.import('./my-data.csv', metadata, function(err, job, apiResponse) {});"},{"caption":"

Load data from a file in your Cloud Storage bucket.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar data = gcs.bucket('institutions').file('data.csv');\ntable.import(data, function(err, job, apiResponse) {});"},{"caption":"

Load data from multiple files in your Cloud Storage bucket(s).

","code":"table.import([\n gcs.bucket('institutions').file('2011.csv'),\n gcs.bucket('institutions').file('2012.csv')\n], function(err, job, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.import(data).then(function(data) {\n var job = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"source","description":" ","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"metadata","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"metadata.format","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.job","description":" ","types":["bigquery/job"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If the source isn't a string file name or a File instance.

"}],"returns":[]},{"id":"insert","name":"insert","type":"instance","description":"

Stream data into BigQuery one record at a time without running a load job.

There are more strict quota limits using this method so it is highly recommended that you load data into BigQuery using bigquery/table#import instead.

","source":"packages/bigquery/src/table.js#L1071","resources":[{"title":"Tabledata: insertAll API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll"},{"title":"Troubleshooting Errors","link":"https://developers.google.com/bigquery/troubleshooting-errors"}],"examples":[{"caption":"

Insert a single row.

","code":"table.insert({\n INSTNM: 'Motion Picture Institute of Michigan',\n CITY: 'Troy',\n STABBR: 'MI'\n}, insertHandler);"},{"caption":"

Insert multiple rows at a time.

","code":"var rows = [\n {\n INSTNM: 'Motion Picture Institute of Michigan',\n CITY: 'Troy',\n STABBR: 'MI'\n },\n // ...\n];\n\ntable.insert(rows, insertHandler);"},{"caption":"

Insert a row as according to the \nspecification.

","code":"var row = {\n insertId: '1',\n json: {\n INSTNM: 'Motion Picture Institute of Michigan',\n CITY: 'Troy',\n STABBR: 'MI'\n }\n};\n\nvar options = {\n raw: true\n};\n\ntable.insert(row, options, insertHandler);"},{"caption":"

Handling the response. See \nTroubleshooting Errors for best practices on how to handle errors.

","code":"function insertHandler(err, apiResponse) {\n if (err) {\n // An API error or partial failure occurred.\n\n if (err.name === 'PartialFailureError') {\n // Some rows failed to insert, while others may have succeeded.\n\n // err.errors (object[]):\n // err.errors[].row (original row object passed to `insert`)\n // err.errors[].errors[].reason\n // err.errors[].errors[].message\n }\n }\n}"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.insert(rows)\n .then(function(data) {\n var apiResponse = data[0];\n })\n .catch(function(err) {\n // An API error or partial failure occurred.\n\n if (err.name === 'PartialFailureError') {\n // Some rows failed to insert, while others may have succeeded.\n\n // err.errors (object[]):\n // err.errors[].row (original row object passed to `insert`)\n // err.errors[].errors[].reason\n // err.errors[].errors[].message\n }\n });"}],"params":[{"name":"rows","description":" ","types":["object","object[]"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.ignoreUnknownValues","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"options.raw","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"options.skipInvalidRows","description":" ","types":["boolean"],"optional":false,"nullable":false},{"name":"options.templateSuffix","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.err.errors","description":" ","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the metadata on the table.

","source":"packages/bigquery/src/table.js#L1170","resources":[{"title":"Tables: update API Documentation","link":"https://cloud.google.com/bigquery/docs/reference/v2/tables/update"}],"examples":[{"code":"var metadata = {\n name: 'My recipes',\n description: 'A table for storing my recipes.',\n schema: 'name:string, servings:integer, cookingTime:float, quick:boolean'\n};\n\ntable.setMetadata(metadata, function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.setMetadata(metadata).then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"metadata.description","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"metadata.name","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"metadata.schema","description":" ","types":["string","object"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"table.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigtable/cluster.json b/json/google-cloud/v0.51.1/bigtable/cluster.json new file mode 100644 index 00000000000..673dfec21c2 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigtable/cluster.json @@ -0,0 +1 @@ +{"id":"bigtable/cluster","type":"class","name":"Cluster","overview":"

\n This class allows you interact with Cloud Bigtable.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigtable.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigtable/src/cluster.js","parent":"bigtable","children":[],"methods":[{"id":"Cluster","name":"Cluster","type":"constructor","description":"

Create a cluster object to interact with your cluster.

","source":"packages/bigtable/src/cluster.js#L41","resources":[],"examples":[{"code":"var instance = bigtable.instance('my-instance');\nvar cluster = instance.cluster('my-cluster');"}],"params":[{"name":"name","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a cluster.

","source":"packages/bigtable/src/cluster.js#L77","resources":[],"examples":[{"code":"cluster.create(function(err, cluster, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', console.error)\n .on('complete', function() {\n // The cluster was created successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"cluster.create().then(function(data) {\n var cluster = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the cluster.

","source":"packages/bigtable/src/cluster.js#L97","resources":[],"examples":[{"code":"cluster.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"cluster.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if a cluster exists.

","source":"packages/bigtable/src/cluster.js#L125","resources":[],"examples":[{"code":"cluster.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"cluster.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a cluster if it exists.

","source":"packages/bigtable/src/cluster.js#L143","resources":[],"examples":[{"code":"cluster.get(function(err, cluster, apiResponse) {\n // The `cluster` data has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"cluster.get().then(function(data) {\n var cluster = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the cluster metadata.

","source":"packages/bigtable/src/cluster.js#L165","resources":[],"examples":[{"code":"cluster.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"cluster.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the cluster metadata.

See bigtable/instance#createCluster for a detailed explanation of the arguments.

","source":"packages/bigtable/src/cluster.js#L285","resources":[],"examples":[{"code":"var callback = function(err, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', console.error)\n .on('complete', function() {\n // The cluster was updated successfully.\n });\n};\n\nvar metadata = {\n location: 'us-central1-b',\n nodes: 3,\n storage: 'ssd'\n};\n\ncluster.setMetadata(metadata, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"cluster.setMetadata(metadata).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"metadata.location","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"metadata.nodes","description":" ","types":["number"],"optional":false,"nullable":false},{"name":"metadata.storage","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":" ","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"cluster.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigtable/family.json b/json/google-cloud/v0.51.1/bigtable/family.json new file mode 100644 index 00000000000..88f0d818a12 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigtable/family.json @@ -0,0 +1 @@ +{"id":"bigtable/family","type":"class","name":"Family","overview":"

\n This class allows you interact with Cloud Bigtable.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigtable.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigtable/src/family.js","parent":"bigtable","children":[],"methods":[{"id":"Family","name":"Family","type":"constructor","description":"

Create a Family object to interact with your table column families.

","source":"packages/bigtable/src/family.js#L47","resources":[],"examples":[{"code":"var instance = bigtable.instance('my-instance');\nvar table = instance.table('prezzy');\nvar family = table.family('follows');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a column family.

","source":"packages/bigtable/src/family.js#L71","resources":[],"examples":[{"code":"family.create(function(err, family, apiResponse) {\n // The column family was created successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"family.create().then(function(data) {\n var family = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the column family.

","source":"packages/bigtable/src/family.js#L91","resources":[],"examples":[{"code":"family.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"family.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the column family exists.

","source":"packages/bigtable/src/family.js#L123","resources":[],"examples":[{"code":"family.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"family.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a column family if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/bigtable/src/family.js#L150","resources":[],"examples":[{"code":"family.get(function(err, family, apiResponse) {\n // `family.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"family.get().then(function(data) {\n var family = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":" ","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the column family's metadata.

","source":"packages/bigtable/src/family.js#L272","resources":[],"examples":[{"code":"family.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"family.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the column family's metadata.

See bigtable/table#createFamily for a detailed explanation of the arguments.

","source":"packages/bigtable/src/family.js#L326","resources":[{"title":"Garbage Collection Proto Docs","link":"https://github.com/googleapis/googleapis/blob/3592a7339da5a31a3565870989beb86e9235476e/google/bigtable/admin/table/v1/bigtable_table_data.proto#L59"}],"examples":[{"code":"var metadata = {\n rule: {\n versions: 2,\n union: true\n }\n};\n\nfamily.setMetadata(metadata, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"family.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"metadata.rule","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":" ","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"family.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigtable/filter.json b/json/google-cloud/v0.51.1/bigtable/filter.json new file mode 100644 index 00000000000..f578f22b762 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigtable/filter.json @@ -0,0 +1 @@ +{"id":"bigtable/filter","type":"class","name":"Filter","overview":"

\n This class allows you interact with Cloud Bigtable.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigtable.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigtable/src/filter.js","parent":"bigtable","children":[],"methods":[{"id":"Filter","name":"Filter","type":"constructor","description":"

A filter takes a row as input and produces an alternate view of the row based on specified rules. For example, a row filter might trim down a row to include just the cells from columns matching a given regular expression, or might return all the cells of a row but not their values. More complicated filters can be composed out of these components to express requests such as, "within every column of a particular family, give just the two most recent cells which are older than timestamp X."

There are two broad categories of filters (true filters and transformers), as well as two ways to compose simple filters into more complex ones (bigtable/filter#interleave). They work as follows:

True filters alter the input row by excluding some of its cells wholesale from the output row. An example of a true filter is the bigtable/filter#value filter, which excludes cells whose values don't match the specified pattern. All regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax) and are evaluated as full matches. An important point to keep in mind is that RE2(.) is equivalent by default to RE2([^\\n]), meaning that it does not match newlines. When attempting to match an arbitrary byte, you should therefore use the escape sequence '\\C', which may need to be further escaped as '\\C' in your client language.

Transformers alter the input row by changing the values of some of its cells in the output, without excluding them completely. Currently, the only supported transformer is the bigtable/filter#value strip filter, which replaces every cell's value with the empty string.

The total serialized size of a filter message must not exceed 4096 bytes, and filters may not be nested within each other to a depth of more than 20.

Use the following table for the various examples found throughout the filter documentation.

Row Key follows:gwashington follows:jadams follows:tjefferson
gwashington 1
tjefferson 1 1
jadams 1 1
","source":"packages/bigtable/src/filter.js#L86","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]},{"id":"all","name":"all","type":"instance","description":"","source":"packages/bigtable/src/filter.js#L246","resources":[],"examples":[{"caption":"

Matches all cells, regardless of input. Functionally equivalent to \nleaving filter unset, but included for completeness.

","code":"var filter = {\n all: true\n};"},{"caption":"

Does not match any cells, regardless of input. Useful for temporarily \ndisabling just part of a filter.

","code":"var filter = {\n all: false\n};"}],"params":[],"exceptions":[],"returns":[]},{"id":"column","name":"column","type":"instance","description":"

Matches only cells from columns whose qualifiers satisfy the given RE2 regex.

Note that, since column qualifiers can contain arbitrary bytes, the '\\C' escape sequence must be used if a true wildcard is desired. The '.' character will not match the new line character '\\n', which may be present in a binary qualifier.

","source":"packages/bigtable/src/filter.js#L369","resources":[],"examples":[{"caption":"

Using the following filter, we would retrieve the tjefferson and \ngwashington columns.

","code":"var filter = [\n {\n column: /[a-z]+on$/\n }\n];"},{"caption":"

You can also provide a string (optionally containing regexp characters) \nfor simple column filters.

","code":"var filter = [\n {\n column: 'gwashington'\n }\n];"},{"caption":"

Or you can provide an array of strings if you wish to match against \nmultiple columns.

","code":"var filter = [\n {\n column: [\n 'gwashington',\n 'tjefferson'\n ]\n }\n];"},{"caption":"

If you wish to use additional column filters, consider using the following \nsyntax.

","code":"var filter = [\n {\n column: {\n name: 'gwashington'\n }\n }\n];"},{"caption":"

Column Cell Limits

\nMatches only the most recent number of versions within each column. For \nexample, if the versions is set to 2, this filter would only match \ncolumns updated at the two most recent timestamps. \nIf duplicate cells are present, as is possible when using an \nbigtable/filter#interleave filter, each copy of the cell is \ncounted separately.

","code":"var filter = [\n {\n column: {\n cellLimit: 2\n }\n }\n];"},{"caption":"

Column Ranges

\nSpecifies a contiguous range of columns within a single column family. \nThe range spans from : to \n:, where both bounds can be either \ninclusive or exclusive. By default both are inclusive. \nWhen the start bound is omitted it is interpreted as an empty string. \nWhen the end bound is omitted it is interpreted as Infinity.

","code":"var filter = [\n {\n column: {\n family: 'follows',\n start: 'gwashington',\n end: 'tjefferson'\n }\n }\n];"},{"caption":"

By default, both the start and end bounds are inclusive. You can \noverride these by providing an object explicity stating whether or not it \nis inclusive.

","code":"var filter = [\n {\n column: {\n family: 'follows',\n start: {\n value: 'gwashington',\n inclusive: false\n },\n end: {\n value: 'jadams',\n inclusive: false\n }\n }\n }\n];"}],"params":[],"exceptions":[],"returns":[]},{"id":"condition","name":"condition","type":"instance","description":"

A filter which evaluates one of two possible filters, depending on whether or not a test filter outputs any cells from the input row.

IMPORTANT NOTE: The test filter does not execute atomically with the pass and fail filters, which may lead to inconsistent or unexpected results. Additionally, condition filters have poor performance, especially when filters are set for the fail condition.

","source":"packages/bigtable/src/filter.js#L445","resources":[],"examples":[{"caption":"

In the following example we're creating a filter that will check if \ngwashington follows tjefferson. If he does, we'll get all of the \ngwashington data. If he does not, we'll instead return all of the \ntjefferson data.

","code":"var filter = [\n {\n condition: {\n // If `test` outputs any cells, then `pass` will be evaluated on the\n // input row. Otherwise `fail` will be evaluated.\n test: [\n {\n row: 'gwashington'\n },\n {\n family: 'follows'\n },\n {\n column: 'tjefferson'\n }\n ],\n\n // If omitted, no results will be returned in the true case.\n pass: [\n {\n row: 'gwashington'\n }\n ],\n\n // If omitted, no results will be returned in the false case.\n fail: [\n {\n row: 'tjefferson'\n }\n ]\n }\n }\n];"}],"params":[],"exceptions":[],"returns":[]},{"id":"family","name":"family","type":"instance","description":"

Matches only cells from columns whose families satisfy the given RE2 regex. For technical reasons, the regex must not contain the ':' character, even if it is not being used as a literal. Note that, since column families cannot contain the new line character '\\n', it is sufficient to use '.' as a full wildcard when matching column family names.

","source":"packages/bigtable/src/filter.js#L468","resources":[],"examples":[{"code":"var filter = [\n {\n family: 'follows'\n }\n];"}],"params":[],"exceptions":[],"returns":[]},{"id":"interleave","name":"interleave","type":"instance","description":"

Applies several filters to the data in parallel and combines the results.

The elements of "filters" all process a copy of the input row, and the results are pooled, sorted, and combined into a single output row. If multiple cells are produced with the same column and timestamp, they will all appear in the output row in an unspecified mutual order. All interleaved filters are executed atomically.

","source":"packages/bigtable/src/filter.js#L511","resources":[],"examples":[{"caption":"

In the following example, we're creating a filter that will retrieve \nresults for entries that were either created between December 17th, 2015 \nand March 22nd, 2016 or entries that have data for follows:tjefferson.

","code":"var filter = [\n {\n interleave: [\n [\n {\n time: {\n start: new Date('December 17, 2015'),\n end: new Date('March 22, 2016')\n }\n }\n ],\n [\n {\n family: 'follows'\n },\n {\n column: 'tjefferson'\n }\n ]\n ]\n }\n];"}],"params":[],"exceptions":[],"returns":[]},{"id":"label","name":"label","type":"instance","description":"

Applies the given label to all cells in the output row. This allows the client to determine which results were produced from which part of the filter.

Values must be at most 15 characters in length, and match the RE2 pattern [a-z0-9\\-]+

Due to a technical limitation, it is not currently possible to apply multiple labels to a cell. As a result, a chain filter may have no more than one sub-filter which contains a apply label transformer. It is okay for an bigtable/filter#interleave to contain multiple apply label transformers, as they will be applied to separate copies of the input. This may be relaxed in the future.

","source":"packages/bigtable/src/filter.js#L537","resources":[],"examples":[{"code":"var filter = {\n label: 'my-label'\n};"}],"params":[],"exceptions":[],"returns":[]},{"id":"row","name":"row","type":"instance","description":"","source":"packages/bigtable/src/filter.js#L644","resources":[],"examples":[{"caption":"

Matches only cells from rows whose keys satisfy the given RE2 regex. In \nother words, passes through the entire row when the key matches, and \notherwise produces an empty row. \nNote that, since row keys can contain arbitrary bytes, the '\\C' escape \nsequence must be used if a true wildcard is desired. The '.' character \nwill not match the new line character '\\n', which may be present in a \nbinary key. \nIn the following example we'll use a regular expression to match all \nrow keys ending with the letters \"on\", which would then yield \ngwashington and tjefferson.

","code":"var filter = [\n {\n row: /[a-z]+on$/\n }\n];"},{"caption":"

You can also provide a string (optionally containing regexp characters) \nfor simple key filters.

","code":"var filter = [\n {\n row: 'gwashington'\n }\n];"},{"caption":"

Or you can provide an array of strings if you wish to match against \nmultiple keys.

","code":"var filter = [\n {\n row: [\n 'gwashington',\n 'tjefferson'\n ]\n }\n];"},{"caption":"

If you wish to use additional row filters, consider using the following \nsyntax.

","code":"var filter = [\n {\n row: {\n key: 'gwashington'\n }\n }\n];"},{"caption":"

Row Samples

\nMatches all cells from a row with probability p, and matches no cells \nfrom the row with probability 1-p.

","code":"var filter = [\n {\n row: {\n sample: 1\n }\n }\n];"},{"caption":"

Row Cell Offsets

\nSkips the first N cells of each row, matching all subsequent cells. \nIf duplicate cells are present, as is possible when using an \nbigtable/filter#interleave, each copy of the cell is counted \nseparately.

","code":"var filter = [\n {\n row: {\n cellOffset: 2\n }\n }\n];"},{"caption":"

Row Cell Limits

\nMatches only the first N cells of each row. \nIf duplicate cells are present, as is possible when using an \nbigtable/filter#interleave, each copy of the cell is counted \nseparately.

","code":"var filter = [\n {\n row: {\n cellLimit: 4\n }\n }\n];"}],"params":[],"exceptions":[],"returns":[]},{"id":"sink","name":"sink","type":"instance","description":"

This filter is meant for advanced use only. Hook for introspection into the filter. Outputs all cells directly to the output of the read rather than to any parent filter.

Despite being excluded by the qualifier filter, a copy of every cell that reaches the sink is present in the final result.

As with an bigtable/filter#interleave filter, duplicate cells are possible, and appear in an unspecified mutual order.

Cannot be used within bigtable/filter#condition filter.

","source":"packages/bigtable/src/filter.js#L740","resources":[],"examples":[{"caption":"

Using the following filter, a copy of every cell that reaches the sink is \npresent in the final result, despite being excluded by the qualifier \nfilter

","code":"var filter = [\n {\n family: 'follows'\n },\n {\n interleave: [\n [\n {\n all: true\n }\n ],\n [\n {\n label: 'prezzy'\n },\n {\n sink: true\n }\n ]\n ]\n },\n {\n column: 'gwashington'\n }\n];"},{"caption":"

As with an bigtable/filter#interleave filter, duplicate cells \nare possible, and appear in an unspecified mutual order. In this case we \nhave a duplicates with multiple gwashington columns because one copy \npassed through the bigtable/filter#all filter while the other was \npassed through the bigtable/filter#label and sink. Note that one \ncopy has label \"prezzy\" while the other does not.

"}],"params":[],"exceptions":[],"returns":[]},{"id":"time","name":"time","type":"instance","description":"

Matches only cells with timestamps within the given range.

","source":"packages/bigtable/src/filter.js#L757","resources":[],"examples":[{"code":"var filter = [\n {\n time: {\n start: new Date('December 17, 2006 03:24:00'),\n end: new Date()\n }\n }\n];"}],"params":[],"exceptions":[],"returns":[]},{"id":"value","name":"value","type":"instance","description":"

Matches only cells with values that satisfy the given regular expression. Note that, since cell values can contain arbitrary bytes, the '\\C' escape sequence must be used if a true wildcard is desired. The '.' character will not match the new line character '\\n', which may be present in a binary value.

","source":"packages/bigtable/src/filter.js#L867","resources":[],"examples":[{"code":"var filter = [\n {\n value: /[0-9]/\n }\n];"},{"caption":"

You can also provide a string (optionally containing regexp characters) \nfor value filters.

","code":"var filter = [\n {\n value: '1'\n }\n];"},{"caption":"

Or you can provide an array of strings if you wish to match against \nmultiple values.

","code":"var filter = [\n {\n value: ['1', '9']\n }\n];"},{"caption":"

Value Ranges

\nSpecifies a contigous range of values. \nWhen the start bound is omitted it is interpreted as an empty string. \nWhen the end bound is omitted it is interpreted as Infinity.

","code":"var filter = [\n {\n value: {\n start: '1',\n end: '9'\n }\n }\n];"},{"caption":"

By default, both the start and end bounds are inclusive. You can \noverride these by providing an object explicity stating whether or not it \nis inclusive.

","code":"var filter = [\n {\n value: {\n start: {\n value: '1',\n inclusive: false\n },\n end: {\n value: '9',\n inclusive: false\n }\n }\n }\n];"},{"caption":"

Strip Values

\nReplaces each cell's value with an emtpy string.

","code":"var filter = [\n {\n value: {\n strip: true\n }\n }\n];"}],"params":[],"exceptions":[],"returns":[]}],"path":"filter.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigtable/index.json b/json/google-cloud/v0.51.1/bigtable/index.json new file mode 100644 index 00000000000..19eed4c114d --- /dev/null +++ b/json/google-cloud/v0.51.1/bigtable/index.json @@ -0,0 +1 @@ +{"id":"bigtable","type":"class","name":"Bigtable","overview":"

\n This class allows you interact with Cloud Bigtable.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigtable.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigtable/src/index.js","parent":null,"children":["bigtable/cluster","bigtable/family","bigtable/filter","bigtable/instance","bigtable/mutation","bigtable/row","bigtable/table"],"methods":[{"id":"Bigtable","name":"Bigtable","type":"constructor","description":"","source":"packages/bigtable/src/index.js#L306","resources":[{"title":"Creating a Cloud Bigtable Cluster","link":"https://cloud.google.com/bigtable/docs/creating-compute-instance"},{"title":"Cloud Bigtable Concepts Overview","link":"https://cloud.google.com/bigtable/docs/concepts"}],"examples":[{"caption":"

The Bigtable Emulator

\nMake sure you have the \ngcloud SDK installed, then run: \n
 \n$ gcloud beta emulators bigtable start \n
\nBefore running your Node.js app, set the environment variables that this \nlibrary will look for to connect to the emulator: \n
 \n$ $(gcloud beta emulators bigtable env-init) \n

"},{"caption":"

Creating a Bigtable Instance and Cluster

\nBefore you create your table, you first need to create a Bigtable Instance \nand cluster for the table to be served from.

","code":"var callback = function(err, instance, operation) {\n operation\n .on('error', console.log)\n .on('complete', function() {\n // `instance` is your newly created Instance object.\n });\n};\n\nvar instance = bigtable.instance('my-instance');\n\ninstance.create({\n clusters: [\n {\n name: 'my-cluster',\n location: 'us-central1-b',\n nodes: 3\n }\n ]\n}, callback);"},{"caption":"

This can also be done from either the Google Cloud Platform Console or the \ngcloud cli tool. Please refer to the \n \nofficial Bigtable documentation for more information.

"},{"caption":"

Creating Tables

\nAfter creating your instance and enabling the Bigtable APIs, you are now \nready to create your table with bigtable/instance#createTable.

","code":"instance.createTable('prezzy', function(err, table) {\n // `table` is your newly created Table object.\n});"},{"caption":"

Creating Column Families

\nColumn families are used to group together various pieces of data within \nyour table. You can think of column families as a mechanism to categorize \nall of your data. \nWe can create a column family with bigtable/table#createFamily.

","code":"var table = instance.table('prezzy');\n\ntable.createFamily('follows', function(err, family) {\n // `family` is your newly created Family object.\n});"},{"caption":"

It is also possible to create your column families when creating a new \ntable.

","code":"var options = {\n families: ['follows']\n};\n\ninstance.createTable('prezzy', options, function(err, table) {});"},{"caption":"

Creating Rows

\nNew rows can be created within your table using \nbigtable/table#insert. You must provide a unique key for each row \nto be inserted, this key can then be used to retrieve your row at a later \ntime. \nWith Bigtable, all columns have a unique id composed of a column family \nand a column qualifier. In the example below follows is the column \nfamily and tjefferson is the column qualifier. Together they could be \nreferred to as follows:tjefferson.

","code":"var rows = [\n {\n key: 'wmckinley',\n data: {\n follows: {\n tjefferson: 1\n }\n }\n }\n];\n\ntable.insert(rows, function(err) {\n if (!err) {\n // Your rows were successfully inserted.\n }\n});"},{"caption":"

Retrieving Rows

\nIf you're anticipating a large number of rows to be returned, we suggest \nusing the bigtable/table#getRows streaming API.

","code":"table.createReadStream()\n .on('error', console.error)\n .on('data', function(row) {\n // `row` is a Row object.\n });"},{"caption":"

If you're not anticpating a large number of results, a callback mode \nis also available.

","code":"var callback = function(err, rows) {\n // `rows` is an array of Row objects.\n};\n\ntable.getRows(callback);"},{"caption":"

A range of rows can be retrieved by providing start and end row keys.

","code":"var options = {\n start: 'gwashington',\n end: 'wmckinley'\n};\n\ntable.getRows(options, callback);"},{"caption":"

Retrieve an individual row with bigtable/row#get.

","code":"var row = table.row('alincoln');\n\nrow.get(function(err) {\n // `row.data` is now populated.\n});"},{"caption":"

Accessing Row Data

\nWhen retrieving rows, upon success the row.data property will be \npopulated by an object. That object will contain additional objects \nfor each family in your table that the row has data for. \nBy default, when retrieving rows, each column qualifier will provide you \nwith all previous versions of the data. So your row.data object could \nresemble the following. \n{ \nfollows: { \nwmckinley: [ \n{ \nvalue: 1, \ntimestamp: 1466017315951 \n}, { \nvalue: 2, \ntimestamp: 1458619200000 \n} \n] \n} \n}

"},{"caption":"

The timestamp field can be used to order cells from newest to oldest. \nIf you only wish to retrieve the most recent version of the data, you \ncan specify the number of cells with a bigtable/filter object.

","code":"var filter = [\n {\n column: {\n cellLimit: 1\n }\n }\n];\n\ntable.getRows({\n filter: filter\n}, callback);"},{"caption":"

Deleting Row Data

\nWe can delete all of an individual row's cells using \nbigtable/row#delete.

","code":"var callback = function(err) {\n if (!err) {\n // All cells for this row were deleted successfully.\n }\n};\n\nrow.delete(callback);"},{"caption":"

To delete a specific set of cells, we can provide an array of \ncolumn families and qualifiers.

","code":"var cells = [\n 'follows:gwashington',\n 'traits'\n];\n\nrow.delete(cells, callback);"},{"caption":"

Deleting Rows

\nIf you wish to delete multiple rows entirely, we can do so with \nbigtable/table#deleteRows. You can provide this method with a \nrow key prefix.

","code":"var options = {\n prefix: 'gwash'\n};\n\ntable.deleteRows(options, function(err) {\n if (!err) {\n // Rows were deleted successfully.\n }\n});"},{"caption":"

If you omit the prefix, you can delete all rows in your table.

","code":"table.deleteRows(function(err) {\n if (!err) {\n // All rows were deleted successfully.\n }\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.apiEndpoint","description":"
  • Override the default API endpoint used to reach Bigtable. This is useful for connecting to your local Bigtable emulator.
","types":["string"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createInstance","name":"createInstance","type":"instance","description":"

Create a Compute instance.

","source":"packages/bigtable/src/index.js#L417","resources":[{"title":"Creating a Compute Instance","link":"https://cloud.google.com/bigtable/docs/creating-compute-instance"}],"examples":[{"code":"var callback = function(err, instance, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', console.log)\n .on('complete', function() {\n // The instance was created successfully.\n });\n};\n\nvar options = {\n displayName: 'my-sweet-instance',\n clusters: [\n {\n name: 'my-sweet-cluster',\n nodes: 3,\n location: 'us-central1-b',\n storage: 'ssd'\n }\n ]\n};\n\nbigtable.createInstance('my-instance', options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bigtable.createInstance('my-instance', options).then(function(data) {\n var instance = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • The unique name of the instance.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Instance creation options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.clusters","description":"
  • The clusters to be created within the instance.
","types":["object[]"],"optional":false,"nullable":false},{"name":"options.displayName","description":"
  • The descriptive name for this instance as it appears in UIs.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instance","description":"
  • The newly created instance.
","types":["bigtable/instance"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getInstances","name":"getInstances","type":"instance","description":"

Get Instance objects for all of your Compute instances.

","source":"packages/bigtable/src/index.js#L508","resources":[],"examples":[{"code":"bigtable.getInstances(function(err, instances) {\n if (!err) {\n // `instances` is an array of Instance objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, instances, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n bigtable.getInstances(nextQuery, calback);\n }\n};\n\nbigtable.getInstances({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bigtable.getInstances().then(function(data) {\n var instances = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":false,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Token returned from a previous call, to request the next page of results.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.error","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instances","description":"
  • List of all instances.
","types":["bigtable/instance[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getInstancesStream","name":"getInstancesStream","type":"instance","description":"

Get bigtable/instance objects for all of your Compute instances as a readable object stream.

","source":"packages/bigtable/src/index.js#L573","resources":[],"examples":[{"code":"bigtable.getInstancesStream()\n .on('error', console.error)\n .on('data', function(instance) {\n // `instance` is an Instance object.\n })\n .on('end', function() {\n // All instances retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"bigtable.getInstancesStream()\n .on('data', function(instance) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"instance","name":"instance","type":"instance","description":"

Get a reference to a Compute instance.

","source":"packages/bigtable/src/index.js#L582","resources":[],"examples":[],"params":[{"name":"name","description":"
  • The name of the instance.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["bigtable/instance"],"description":""}]},{"id":"operation","name":"operation","type":"instance","description":"

Get a reference to an Operation.

","source":"packages/bigtable/src/index.js#L592","resources":[],"examples":[],"params":[{"name":"name","description":"
  • The name of the instance.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["Operation"],"description":""}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigtable/instance.json b/json/google-cloud/v0.51.1/bigtable/instance.json new file mode 100644 index 00000000000..01040d6a7a5 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigtable/instance.json @@ -0,0 +1 @@ +{"id":"bigtable/instance","type":"class","name":"Instance","overview":"

\n This class allows you interact with Cloud Bigtable.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigtable.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigtable/src/instance.js","parent":"bigtable","children":[],"methods":[{"id":"Instance","name":"Instance","type":"constructor","description":"

Create an Instance object to interact with a Compute instance.

","source":"packages/bigtable/src/instance.js#L58","resources":[],"examples":[{"code":"var instance = bigtable.instance('my-instance');"}],"params":[{"name":"name","description":"
  • Name of the instance.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create an instance.

","source":"packages/bigtable/src/instance.js#L94","resources":[],"examples":[{"code":"instance.create(function(err, instance, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', console.error)\n .on('complete', function() {\n // The instance was created successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.create().then(function(data) {\n var instance = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the instance.

","source":"packages/bigtable/src/instance.js#L114","resources":[],"examples":[{"code":"instance.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if an instance exists.

","source":"packages/bigtable/src/instance.js#L142","resources":[],"examples":[{"code":"instance.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the instance exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get an instance if it exists.

","source":"packages/bigtable/src/instance.js#L160","resources":[],"examples":[{"code":"instance.get(function(err, instance, apiResponse) {\n // The `instance` data has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.get().then(function(data) {\n var instance = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the instance metadata.

","source":"packages/bigtable/src/instance.js#L182","resources":[],"examples":[{"code":"instance.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the instance metadata.

","source":"packages/bigtable/src/instance.js#L218","resources":[],"examples":[{"code":"var metadata = {\n displayName: 'updated-name'\n};\n\ninstance.setMetadata(metadata, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":"
  • Metadata object.
","types":["object"],"optional":false,"nullable":false},{"name":"metadata.displayName","description":"
  • The descriptive name for this instance as it appears in UIs. It can be changed at any time, but should be kept globally unique to avoid confusion.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createCluster","name":"createCluster","type":"instance","description":"

Create a cluster.

","source":"packages/bigtable/src/instance.js#L296","resources":[],"examples":[{"code":"var callback = function(err, cluster, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', console.log)\n .on('complete', function() {\n // The cluster was created successfully.\n });\n};\n\nvar options = {\n location: 'us-central1-b',\n nodes: 3,\n storage: 'ssd'\n};\n\ninstance.createCluster('my-cluster', options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.createCluster('my-cluster', options).then(function(data) {\n var cluster = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • The name to be used when referring to the new cluster within its instance.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Cluster creation options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.location","description":"
  • The location where this cluster's nodes and storage reside. For best performance clients should be located as as close as possible to this cluster. Currently only zones are supported.
","types":["string"],"optional":false,"nullable":false},{"name":"options.nodes","description":"
  • The number of nodes allocated to this cluster. More nodes enable higher throughput and more consistent performance.
","types":["number"],"optional":false,"nullable":false},{"name":"options.storage","description":"
  • The type of storage used by this cluster to serve its parent instance's tables. Options are 'hdd' or 'ssd'.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.cluster","description":"
  • The newly created cluster.
","types":["bigtable/cluster"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createTable","name":"createTable","type":"instance","description":"

Create a table on your Bigtable instance.

","source":"packages/bigtable/src/instance.js#L426","resources":[{"title":"Designing Your Schema","link":"https://cloud.google.com/bigtable/docs/schema-design"},{"title":"Splitting Keys","link":"https://cloud.google.com/bigtable/docs/managing-tables#splits"}],"examples":[{"code":"var callback = function(err, table, apiResponse) {\n // `table` is a Table object.\n};\n\ninstance.createTable('prezzy', callback);"},{"caption":"

Optionally specify column families to be created within the table.

","code":"var options = {\n families: ['follows']\n};\n\ninstance.createTable('prezzy', options, callback);"},{"caption":"

You can also specify garbage collection rules for your column families. \nSee bigtable/table#createFamily for more information about \ncolumn families and garbage collection rules.

","code":"var options = {\n families: [\n {\n name: 'follows',\n rule: {\n age: {\n seconds: 0,\n nanos: 5000\n },\n versions: 3,\n union: true\n }\n }\n ]\n};\n\ninstance.createTable('prezzy', options, callback);"},{"caption":"

Pre-split the table based on the row key to spread the load across \nmultiple Cloud Bigtable nodes.

","code":"var options = {\n splits: ['10', '20']\n};\n\ninstance.createTable('prezzy', options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.createTable('prezzy', options).then(function(data) {\n var table = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"name","description":"
  • The name of the table.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Table creation options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.families","description":"
  • Column families to be created within the table.
","types":["object","string[]"],"optional":false,"nullable":false},{"name":"options.splits","description":" ","types":["string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.table","description":"
  • The newly created table.
","types":["bigtable/table"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a name is not provided.

"}],"returns":[]},{"id":"cluster","name":"cluster","type":"instance","description":"

Get a reference to a Bigtable Cluster.

","source":"packages/bigtable/src/instance.js#L502","resources":[],"examples":[],"params":[{"name":"name","description":"
  • The name of the cluster.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["bigtable/cluster"],"description":""}]},{"id":"getClusters","name":"getClusters","type":"instance","description":"

Get Cluster objects for all of your clusters.

","source":"packages/bigtable/src/instance.js#L551","resources":[],"examples":[{"code":"instance.getClusters(function(err, clusters) {\n if (!err) {\n // `clusters` is an array of Cluster objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, clusters, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n instance.getClusters(nextQuery, calback);\n }\n};\n\ninstance.getClusters({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.getClusters().then(function(data) {\n var clusters = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Token returned from a previous call, to request the next page of results.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.error","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.clusters","description":"
  • List of all Clusters.
","types":["bigtable/cluster[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getClustersStream","name":"getClustersStream","type":"instance","description":"

Get bigtable/cluster objects for all of your clusters as a readable object stream.

","source":"packages/bigtable/src/instance.js#L619","resources":[],"examples":[{"code":"instance.getClustersStream()\n .on('error', console.error)\n .on('data', function(cluster) {\n // `cluster` is a Cluster object.\n })\n .on('end', function() {\n // All clusters retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"instance.getClustersStream()\n .on('data', function(cluster) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getTables","name":"getTables","type":"instance","description":"

Get Table objects for all the tables in your Compute instance.

","source":"packages/bigtable/src/instance.js#L668","resources":[],"examples":[{"code":"instance.getTables(function(err, tables) {\n if (!err) {\n // `tables` is an array of Table objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, tables, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n instance.getTables(nextQuery, calback);\n }\n};\n\ninstance.getTables({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.getTables().then(function(data) {\n var tables = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of items to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • A previously-returned page token representing part of a larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"query.view","description":"
  • View over the table's fields. Possible options are 'name', 'schema' or 'full'. Default: 'name'.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.tables","description":"
  • List of all Tables.
","types":["bigtable/table[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getTablesStream","name":"getTablesStream","type":"instance","description":"

Get bigtable/table objects for all the tables in your Compute instance as a readable object stream.

","source":"packages/bigtable/src/instance.js#L738","resources":[],"examples":[{"code":"instance.getTablesStream()\n .on('error', console.error)\n .on('data', function(table) {\n // table is a Table object.\n })\n .on('end', function() {\n // All tables retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"instance.getTablesStream()\n .on('data', function(table) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"table","name":"table","type":"instance","description":"

Get a reference to a Bigtable table.

","source":"packages/bigtable/src/instance.js#L749","resources":[],"examples":[{"code":"var table = instance.table('presidents');"}],"params":[{"name":"name","description":"
  • The name of the table.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["bigtable/table"],"description":""}]}],"path":"instance.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigtable/row.json b/json/google-cloud/v0.51.1/bigtable/row.json new file mode 100644 index 00000000000..30abaaca8f0 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigtable/row.json @@ -0,0 +1 @@ +{"id":"bigtable/row","type":"class","name":"Row","overview":"

\n This class allows you interact with Cloud Bigtable.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigtable.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigtable/src/row.js","parent":"bigtable","children":[],"methods":[{"id":"Row","name":"Row","type":"constructor","description":"

Create a Row object to interact with your table rows.

","source":"packages/bigtable/src/row.js#L68","resources":[],"examples":[{"code":"var instance = bigtable.instance('my-instance');\nvar table = instance.table('prezzy');\nvar row = table.row('gwashington');"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the table row exists.

","source":"packages/bigtable/src/row.js#L89","resources":[],"examples":[{"code":"row.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the row exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a new row in your table.

","source":"packages/bigtable/src/row.js#L292","resources":[],"examples":[{"code":"var callback = function(err, apiResponse) {\n if (!err) {\n // Row successfully created\n }\n};\n\nrow.create(callback);"},{"caption":"

Optionally, you can supply entry data.

","code":"row.create({\n follows: {\n alincoln: 1\n }\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.create().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"entry","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.row","description":"
  • The newly created row object.
","types":["bigtable/row"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createRules","name":"createRules","type":"instance","description":"

Update a row with rules specifying how the row's contents are to be transformed into writes. Rules are applied in order, meaning that earlier rules will affect the results of later ones.

","source":"packages/bigtable/src/row.js#L370","resources":[],"examples":[{"caption":"

Add an increment amount to an existing value, if the targeted cell is \nunset, it will be treated as containing a zero.

","code":"var callback = function(err, apiResponse) {\n if (!err) {\n // The rules have successfully been applied.\n }\n};\n\nvar rules = [\n {\n column: 'follows:gwashington',\n increment: 1\n }\n];\n\nrow.createRules(rules, callback);"},{"caption":"

You can also create a rule that will append data to an existing value. \nIf the targeted cell is unset, it will be treated as a containing an \nempty string.

","code":"var rules = [\n {\n column: 'follows:alincoln',\n append: ' Honest Abe!'\n }\n];\n\nrow.createRules(rules, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.createRules(rules).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"rules","description":"
  • The rules to apply to this row.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If no rules are provided.

"}],"returns":[]},{"id":"filter","name":"filter","type":"instance","description":"

Mutates a row atomically based on the output of a filter. Depending on whether or not any results are yielded, either the onMatch or onNoMatch callback will be executed.

","source":"packages/bigtable/src/row.js#L465","resources":[],"examples":[{"code":"var callback = function(err, matched) {\n if (!err) {\n // `matched` will let us know if a match was found or not.\n }\n};\n\nvar filter = [\n {\n family: 'follows'\n }, {\n column: 'alincoln',\n }, {\n value: 1\n }\n];\n\nvar entries = [\n {\n method: 'insert',\n data: {\n follows: {\n jadams: 1\n }\n }\n }\n];\n\nrow.filter(filter, entries, callback);"},{"caption":"

Optionally, you can pass in an array of entries to be ran in the event \nthat a match is not made.

","code":"row.filter(filter, null, entries, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.filter(filter, null, entries).then(function(data) {\n var matched = data[0];\n});"}],"params":[{"name":"filter","description":"
  • Filter ot be applied to the contents of the row.
","types":["bigtable/filter"],"optional":false,"nullable":false},{"name":"onMatch","description":"
  • A list of entries to be ran if a match is found.
","types":["object[]"],"optional":false,"nullable":true},{"name":"onNoMatch","description":"
  • A list of entries to be ran if no matches are found.
","types":["object[]"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.matched","description":"
  • Whether a match was found or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Deletes all cells in the row.

","source":"packages/bigtable/src/row.js#L520","resources":[],"examples":[{"code":"row.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"deleteCells","name":"deleteCells","type":"instance","description":"

Delete specified cells from the row. See bigtable/table#mutate.

","source":"packages/bigtable/src/row.js#L570","resources":[],"examples":[{"caption":"

Delete individual cells.

","code":"var callback = function(err, apiResponse) {\n if (!err) {\n // Cells were successfully deleted.\n }\n};\n\nvar cells = [\n 'follows:gwashington'\n];\n\nrow.deleteCells(cells, callback);"},{"caption":"

Delete all cells within a family.

","code":"var cells = [\n 'follows',\n];\n\nrow.deleteCells(cells, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.deleteCells(cells).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"columns","description":"
  • Column names for the cells to be deleted.
","types":["string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get the row data. See bigtable/table#getRows.

","source":"packages/bigtable/src/row.js#L622","resources":[],"examples":[{"caption":"

Use this method to grab an entire row

","code":"var callback = function(err, row, apiResponse) {\n if (!err) {\n // `row.cells` has been updated.\n }\n};\n\nrow.get(callback);"},{"caption":"

Or pass in an array of column names to populate specific cells. \nUnder the hood this will create an interleave filter.

","code":"row.get([\n 'follows:gwashington',\n 'follows:alincoln'\n], callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.get().then(function(data) {\n var row = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"columns","description":"
  • List of specific columns to retrieve.
","types":["string[]"],"optional":true,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.decode","description":"
  • If set to false it will not decode Buffer values returned from Bigtable. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.row","description":"
  • The updated Row object.
","types":["bigtable/row"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the row's metadata.

","source":"packages/bigtable/src/row.js#L713","resources":[],"examples":[{"code":"row.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.decode","description":"
  • If set to false it will not decode Buffer values returned from Bigtable. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The row's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"increment","name":"increment","type":"instance","description":"

Increment a specific column within the row. If the column does not exist, it is automatically initialized to 0 before being incremented.

","source":"packages/bigtable/src/row.js#L768","resources":[],"examples":[{"code":"var callback = function(err, value, apiResponse) {\n if (!err) {\n // `value` is the value of the updated column.\n }\n};\n\nrow.increment('follows:gwashington', callback);"},{"caption":"

Specify a custom amount to increment the column by.

","code":"row.increment('follows:gwashington', 2, callback);"},{"caption":"

To decrement a column, simply supply a negative value.

","code":"row.increment('follows:gwashington', -1, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.increment('follows:gwashington').then(function(data) {\n var value = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"column","description":"
  • The column we are incrementing a value in.
","types":["string"],"optional":false,"nullable":false},{"name":"value","description":"
  • The amount to increment by, defaults to 1.
","types":["number"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.value","description":"
  • The updated value of the column.
","types":["number"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"save","name":"save","type":"instance","description":"

Update the row cells.

","source":"packages/bigtable/src/row.js#L834","resources":[],"examples":[{"caption":"

Update a single cell.

","code":"var callback = function(err, apiResponse) {\n if (!err) {\n // The row has been successfully updated.\n }\n};\n\nrow.save('follows:jadams', 1, callback);"},{"caption":"

Or update several cells at once.

","code":"row.save({\n follows: {\n jadams: 1,\n wmckinley: 1\n }\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"row.save('follows:jadams', 1).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"key","description":" ","types":["string","object"],"optional":false,"nullable":false},{"name":"value","description":"
  • This can be omitted if using entry object.
","types":[],"optional":true,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"row.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/bigtable/table.json b/json/google-cloud/v0.51.1/bigtable/table.json new file mode 100644 index 00000000000..ffbfd2d2b10 --- /dev/null +++ b/json/google-cloud/v0.51.1/bigtable/table.json @@ -0,0 +1 @@ +{"id":"bigtable/table","type":"class","name":"Table","overview":"

\n This class allows you interact with Cloud Bigtable.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/bigtable.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/bigtable/src/table.js","parent":"bigtable","children":[],"methods":[{"id":"Table","name":"Table","type":"constructor","description":"

Create a Table object to interact with a Cloud Bigtable table.

","source":"packages/bigtable/src/table.js#L70","resources":[],"examples":[{"code":"var instance = bigtable.instance('my-instance');\nvar table = instance.table('prezzy');"}],"params":[{"name":"name","description":"
  • Name of the table.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a table.

","source":"packages/bigtable/src/table.js#L95","resources":[],"examples":[{"code":"table.create(function(err, table, apiResponse) {\n if (!err) {\n // The table was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.create().then(function(data) {\n var table = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the table.

","source":"packages/bigtable/src/table.js#L115","resources":[],"examples":[{"code":"table.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if a table exists.

","source":"packages/bigtable/src/table.js#L143","resources":[],"examples":[{"code":"table.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the table exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a table if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/bigtable/src/table.js#L172","resources":[],"examples":[{"code":"table.get(function(err, table, apiResponse) {\n // The `table` data has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.get().then(function(data) {\n var table = data[0];\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.view","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createFamily","name":"createFamily","type":"instance","description":"

Create a column family.

Optionally you can send garbage collection rules and when creating a family. Garbage collection executes opportunistically in the background, so it's possible for reads to return a cell even if it matches the active expression for its family.

","source":"packages/bigtable/src/table.js#L313","resources":[{"title":"Garbage Collection Proto Docs","link":"https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/table/v1/bigtable_table_data.proto#L59"}],"examples":[{"code":"var callback = function(err, family, apiResponse) {\n // `family` is a Family object\n};\n\nvar rule = {\n age: {\n seconds: 0,\n nanos: 5000\n },\n versions: 3,\n union: true\n};\n\ntable.createFamily('follows', rule, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.createFamily('follows').then(function(data) {\n var family = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"name","description":"
  • The name of column family.
","types":["string"],"optional":false,"nullable":false},{"name":"rule","description":"
  • Garbage collection rule.
","types":["object"],"optional":true,"nullable":false},{"name":"rule.age","description":"
  • Delete cells in a column older than the given age. Values must be at least 1 millisecond.
","types":["object"],"optional":false,"nullable":false},{"name":"rule.versions","description":"
  • Maximum number of versions to delete cells in a column, except for the most recent.
","types":["number"],"optional":false,"nullable":false},{"name":"rule.intersect","description":"
  • Cells to delete should match all rules.
","types":["boolean"],"optional":false,"nullable":false},{"name":"rule.union","description":"
  • Cells to delete should match any of the rules.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.family","description":"
  • The newly created Family.
","types":["bigtable/family"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a name is not provided.

"}],"returns":[]},{"id":"createReadStream","name":"createReadStream","type":"instance","description":"

Get bigtable/row objects for the rows currently in your table as a readable object stream.

","source":"packages/bigtable/src/table.js#L448","resources":[],"examples":[{"code":"table.createReadStream()\n .on('error', console.error)\n .on('data', function(row) {\n // `row` is a Row object.\n })\n .on('end', function() {\n // All rows retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing.

","code":"table.createReadStream()\n .on('data', function(row) {\n this.end();\n });"},{"caption":"

Specify arbitrary keys for a non-contiguous set of rows. \nThe total size of the keys must remain under 1MB, after encoding.

","code":"table.createReadStream({\n keys: [\n 'alincoln',\n 'gwashington'\n ]\n});"},{"caption":"

Scan for row keys that contain a specific prefix.

","code":"table.createReadStream({\n prefix: 'gwash'\n});"},{"caption":"

Specify a contiguous range of rows to read by supplying start and end \nkeys. \nIf the start key is omitted, it is interpreted as an empty string. \nIf the end key is omitted, it is interpreted as infinity.

","code":"table.createReadStream({\n start: 'alincoln',\n end: 'gwashington'\n});"},{"caption":"

Specify multiple ranges.

","code":"table.createReadStream({\n ranges: [{\n start: 'alincoln',\n end: 'gwashington'\n }, {\n start: 'tjefferson',\n end: 'jadams'\n }]\n});"},{"caption":"

Apply a bigtable/filter to the contents of the specified rows.

","code":"table.createReadStream({\n filter: [\n {\n column: 'gwashington'\n }, {\n value: 1\n }\n ]\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.decode","description":"
  • If set to false it will not decode Buffer values returned from Bigtable. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.end","description":"
  • End value for key range.
","types":["string"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Row filters allow you to both make advanced queries and format how the data is returned.
","types":["bigtable/filter"],"optional":false,"nullable":false},{"name":"options.keys","description":"
  • A list of row keys.
","types":["string[]"],"optional":false,"nullable":false},{"name":"options.limit","description":"
  • Maximum number of rows to be returned.
","types":["number"],"optional":false,"nullable":false},{"name":"options.prefix","description":"
  • Prefix that the row key must match.
","types":["string"],"optional":false,"nullable":false},{"name":"options.ranges","description":"
  • A list of key ranges.
","types":["object[]"],"optional":false,"nullable":false},{"name":"options.start","description":"
  • Start value for key range.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"deleteRows","name":"deleteRows","type":"instance","description":"

Delete all rows in the table, optionally corresponding to a particular prefix.

","source":"packages/bigtable/src/table.js#L554","resources":[],"examples":[{"caption":"

You can supply a prefix to delete all corresponding rows.

","code":"var callback = function(err, apiResponse) {\n if (!err) {\n // Rows successfully deleted.\n }\n};\n\ntable.deleteRows({\n prefix: 'alincoln'\n}, callback);"},{"caption":"

If you choose to omit the prefix, all rows in the table will be deleted.

","code":"table.deleteRows(callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.deleteRows().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.prefix","description":"
  • Row key prefix, when omitted all rows will be deleted.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"family","name":"family","type":"instance","description":"

Get a reference to a Table Family.

","source":"packages/bigtable/src/table.js#L589","resources":[],"examples":[{"code":"var family = table.family('my-family');"}],"params":[{"name":"name","description":"
  • The family name.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a name is not provided.

"}],"returns":[{"types":["bigtable/family"],"description":""}]},{"id":"getFamilies","name":"getFamilies","type":"instance","description":"

Get Family objects for all the column familes in your table.

","source":"packages/bigtable/src/table.js#L618","resources":[],"examples":[{"code":"table.getFamilies(function(err, families, apiResponse) {\n // `families` is an array of Family objects.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.getFamilies().then(function(data) {\n var families = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.families","description":"
  • The list of families.
","types":["bigtable/family[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the table's metadata.

","source":"packages/bigtable/src/table.js#L659","resources":[],"examples":[{"code":"table.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Table request options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.view","description":"
  • The view to be applied to the table fields.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The table's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getRows","name":"getRows","type":"instance","description":"

Get bigtable/row objects for the rows currently in your table.

This method is not recommended for large datasets as it will buffer all rows before returning the results. Instead we recommend using the streaming API via bigtable/table#createReadStream.

","source":"packages/bigtable/src/table.js#L715","resources":[],"examples":[{"code":"table.getRows(function(err, rows) {\n if (!err) {\n // `rows` is an array of Row objects.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.getRows().then(function(data) {\n var rows = data[0];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rows","description":"
  • List of Row objects.
","types":["bigtable/row[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"insert","name":"insert","type":"instance","description":"

Insert or update rows in your table. It should be noted that gRPC only allows you to send payloads that are less than or equal to 4MB. If you're inserting more than that you may need to send smaller individual requests.

","source":"packages/bigtable/src/table.js#L797","resources":[],"examples":[{"code":"var callback = function(err) {\n if (err) {\n // An API error or partial failure occurred.\n\n if (err.name === 'PartialFailureError') {\n // err.errors[].code = 'Response code'\n // err.errors[].message = 'Error message'\n // err.errors[].entry = The original entry\n }\n }\n};\n\nvar entries = [\n {\n key: 'alincoln',\n data: {\n follows: {\n gwashington: 1\n }\n }\n }\n];\n\ntable.insert(entries, callback);"},{"caption":"

By default whenever you insert new data, the server will capture a \ntimestamp of when your data was inserted. It's possible to provide a \ndate object to be used instead.

","code":"var entries = [\n {\n key: 'gwashington',\n data: {\n follows: {\n jadams: {\n value: 1,\n timestamp: new Date('March 22, 2016')\n }\n }\n }\n }\n];\n\ntable.insert(entries, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.insert(entries).then(function() {\n // All requested inserts have been processed.\n});\n//-"}],"params":[{"name":"entries","description":" ","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.err.errors","description":"
  • If present, these represent partial failures. It's possible for part of your request to be completed successfully, while the other part was not.
","types":["object[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"mutate","name":"mutate","type":"instance","description":"

Apply a set of changes to be atomically applied to the specified row(s). Mutations are applied in order, meaning that earlier mutations can be masked by later ones.

","source":"packages/bigtable/src/table.js#L904","resources":[],"examples":[{"caption":"

Insert entities. See bigtable/table#insert.

","code":"var callback = function(err) {\n if (err) {\n // An API error or partial failure occurred.\n\n if (err.name === 'PartialFailureError') {\n // err.errors[].code = 'Response code'\n // err.errors[].message = 'Error message'\n // err.errors[].entry = The original entry\n }\n }\n};\n\nvar entries = [\n {\n method: 'insert',\n key: 'gwashington',\n data: {\n follows: {\n jadams: 1\n }\n }\n }\n];\n\ntable.mutate(entries, callback);"},{"caption":"

Delete entities. See bigtable/row#deleteCells.

","code":"var entries = [\n {\n method: 'delete',\n key: 'gwashington'\n }\n];\n\ntable.mutate(entries, callback);"},{"caption":"

Delete specific columns within a row.

","code":"var entries = [\n {\n method: 'delete',\n key: 'gwashington',\n data: [\n 'follows:jadams'\n ]\n }\n];\n\ntable.mutate(entries, callback);"},{"caption":"

Mix and match mutations. This must contain at least one entry and at \nmost 100,000.

","code":"var entries = [\n {\n method: 'insert',\n key: 'alincoln',\n data: {\n follows: {\n gwashington: 1\n }\n }\n }, {\n method: 'delete',\n key: 'jadams',\n data: [\n 'follows:gwashington'\n ]\n }\n];\n\ntable.mutate(entries, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.mutate(entries).then(function() {\n // All requested mutations have been processed.\n});"}],"params":[{"name":"entries","description":"
  • List of entities to be inserted or deleted.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.err.errors","description":"
  • If present, these represent partial failures. It's possible for part of your request to be completed successfully, while the other part was not.
","types":["object[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"row","name":"row","type":"instance","description":"

Get a reference to a table row.

","source":"packages/bigtable/src/table.js#L959","resources":[],"examples":[{"code":"var row = table.row('lincoln');"}],"params":[{"name":"key","description":"
  • The row key.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a key is not provided.

"}],"returns":[{"types":["bigtable/row"],"description":""}]},{"id":"sampleRowKeys","name":"sampleRowKeys","type":"instance","description":"

Returns a sample of row keys in the table. The returned row keys will delimit contigous sections of the table of approximately equal size, which can be used to break up the data for distributed tasks like mapreduces.

","source":"packages/bigtable/src/table.js#L994","resources":[],"examples":[{"code":"table.sampleRowKeys(function(err, keys) {\n // keys = [\n // {\n // key: '',\n // offset: '805306368'\n // },\n // ...\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.sampleRowKeys().then(function(data) {\n var keys = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.keys","description":"
  • The list of keys.
","types":["object[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"sampleRowKeysStream","name":"sampleRowKeysStream","type":"instance","description":"

Returns a sample of row keys in the table as a readable object stream.

See bigtable/table#sampleRowKeys for more details.

","source":"packages/bigtable/src/table.js#L1025","resources":[],"examples":[{"code":"table.sampleRowKeysStream()\n .on('error', console.error)\n .on('data', function(key) {\n // Do something with the `key` object.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing.

","code":"table.sampleRowKeysStream()\n .on('data', function(key) {\n this.end();\n });"}],"params":[],"exceptions":[],"returns":[{"types":["stream"],"description":""}]}],"path":"table.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/address.json b/json/google-cloud/v0.51.1/compute/address.json new file mode 100644 index 00000000000..8d8e7552bb1 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/address.json @@ -0,0 +1 @@ +{"id":"compute/address","type":"class","name":"Address","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/address.js","parent":"compute","children":[],"methods":[{"id":"Address","name":"Address","type":"constructor","description":"

An Address object allows you to interact with a Google Compute Engine address.

","source":"packages/compute/src/address.js#L46","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"},{"title":"Address Resource","link":"https://cloud.google.com/compute/docs/reference/v1/addresses"}],"examples":[{"code":"var region = gce.region('region-name');\n\nvar address = region.address('address1');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create an address.

","source":"packages/compute/src/address.js#L70","resources":[],"examples":[{"code":"address.create(function(err, address, operation, apiResponse) {\n // `address` is an Address object.\n\n // `operation` is an Operation object that can be used to check the\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"address.create().then(function(data) {\n var address = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the address exists.

","source":"packages/compute/src/address.js#L90","resources":[],"examples":[{"code":"address.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"address.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the address exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get an address if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/address.js#L117","resources":[],"examples":[{"code":"address.get(function(err, address, apiResponse) {\n // `address` is an Address object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"address.get().then(function(data) {\n var address = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata of this address.

","source":"packages/compute/src/address.js#L142","resources":[{"title":"Address Resource","link":"https://cloud.google.com/compute/docs/reference/v1/addresses"},{"title":"Addresses: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/addresses/get"}],"examples":[{"code":"address.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"address.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The address's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the address.

","source":"packages/compute/src/address.js#L184","resources":[{"title":"Addresses: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/addresses/delete"}],"examples":[{"code":"address.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"address.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"address.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/autoscaler.json b/json/google-cloud/v0.51.1/compute/autoscaler.json new file mode 100644 index 00000000000..a1166b8f163 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/autoscaler.json @@ -0,0 +1 @@ +{"id":"compute/autoscaler","type":"class","name":"Autoscaler","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/autoscaler.js","parent":"compute","children":[],"methods":[{"id":"Autoscaler","name":"Autoscaler","type":"constructor","description":"

Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define.

","source":"packages/compute/src/autoscaler.js#L45","resources":[{"title":"Autoscaling Groups of Instances","link":"https://cloud.google.com/compute/docs/autoscaler"}],"examples":[{"code":"var zone = gce.zone('us-central1-a');\n\nvar autoscaler = zone.autoscaler('autoscaler-name');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create an autoscaler.

","source":"packages/compute/src/autoscaler.js#L80","resources":[],"examples":[{"code":"var config = {\n coolDown: 30,\n cpu: 80,\n loadBalance: 40,\n maxReplicas: 5,\n minReplicas: 0,\n target: 'instance-group-manager-1'\n};\n\nvar callback = function(err, autoscaler, operation, apiResponse) {\n // `autoscaler` is an Autoscaler object.\n\n // `operation` is an Operation object that can be used to check the\n // of the request.\n};\n\nautoscaler.create(config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"autoscaler.create(config).then(function(data) {\n var autoscaler = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the autoscaler exists.

","source":"packages/compute/src/autoscaler.js#L100","resources":[],"examples":[{"code":"autoscaler.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"autoscaler.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the autoscaler exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get an autoscaler if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/autoscaler.js#L127","resources":[],"examples":[{"code":"autoscaler.get(function(err, autoscaler, apiResponse) {\n // `autoscaler` is an Autoscaler object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"autoscaler.get().then(function(data) {\n var autoscaler = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata of this autoscaler.

","source":"packages/compute/src/autoscaler.js#L152","resources":[{"title":"Autoscaler Resource","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers"},{"title":"Autoscalers: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers/get"}],"examples":[{"code":"autoscaler.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"autoscaler.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The autoscaler's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the autoscaler.

","source":"packages/compute/src/autoscaler.js#L194","resources":[{"title":"Autoscalers: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers/delete"}],"examples":[{"code":"autoscaler.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"autoscaler.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the autoscaler's metadata.

","source":"packages/compute/src/autoscaler.js#L243","resources":[{"title":"Autoscaler Resource","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers"}],"examples":[{"code":"var metadata = {\n description: 'New description'\n};\n\nautoscaler.setMetadata(metadata, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"autoscaler.setMetadata(metadata).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"autoscaler.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/disk.json b/json/google-cloud/v0.51.1/compute/disk.json new file mode 100644 index 00000000000..fbacdd92af8 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/disk.json @@ -0,0 +1 @@ +{"id":"compute/disk","type":"class","name":"Disk","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/disk.js","parent":"compute","children":[],"methods":[{"id":"Disk","name":"Disk","type":"constructor","description":"

A Disk object allows you to interact with a Google Compute Engine disk.

","source":"packages/compute/src/disk.js#L54","resources":[{"title":"Disks Overview","link":"https://cloud.google.com/compute/docs/disks"},{"title":"Disk Resource","link":"https://cloud.google.com/compute/docs/reference/v1/disks"}],"examples":[{"code":"var zone = gce.zone('zone-name');\n\nvar disk = zone.disk('disk1');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a persistent disk.

","source":"packages/compute/src/disk.js#L82","resources":[],"examples":[{"code":"var config = {\n // ...\n};\n\ndisk.create(config, function(err, disk, operation, apiResponse) {\n // `disk` is a Disk object.\n\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"disk.create(config).then(function(data) {\n var disk = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the disk exists.

","source":"packages/compute/src/disk.js#L102","resources":[],"examples":[{"code":"disk.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"disk.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the disk exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a disk if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/disk.js#L129","resources":[],"examples":[{"code":"disk.get(function(err, disk, apiResponse) {\n // `disk` is a Disk object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"disk.get().then(function(data) {\n var disk = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the disk's metadata.

","source":"packages/compute/src/disk.js#L154","resources":[{"title":"Disk Resource","link":"https://cloud.google.com/compute/docs/reference/v1/disks"},{"title":"Disks: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/disks/get"}],"examples":[{"code":"disk.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"disk.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The disk's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createSnapshot","name":"createSnapshot","type":"instance","description":"

Create a snapshot of a disk.

","source":"packages/compute/src/disk.js#L227","resources":[{"title":"Snapshots Overview","link":"https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots"},{"title":"Disks: createSnapshot API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/disks/createSnapshot"}],"examples":[{"code":"function callback(err, snapshot, operation, apiResponse) {\n // `snapshot` is a Snapshot object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\ndisk.createSnapshot('new-snapshot-name', callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"disk.createSnapshot('new-snapshot-name').then(function(data) {\n var snapshot = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the snapshot.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.snapshot","description":"
  • The created Snapshot object.
","types":["compute/snapshot"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the disk.

","source":"packages/compute/src/disk.js#L282","resources":[{"title":"Disks: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/disks/delete"}],"examples":[{"code":"disk.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"disk.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"snapshot","name":"snapshot","type":"instance","description":"

Get a reference to a snapshot from this disk.

","source":"packages/compute/src/disk.js#L311","resources":[{"title":"Snapshots Overview","link":"https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots"}],"examples":[{"code":"var snapshot = disk.snapshot('snapshot-name');"}],"params":[{"name":"name","description":"
  • Name of the snapshot.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/snapshot"],"description":""}]}],"path":"disk.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/firewall.json b/json/google-cloud/v0.51.1/compute/firewall.json new file mode 100644 index 00000000000..6384ebd2863 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/firewall.json @@ -0,0 +1 @@ +{"id":"compute/firewall","type":"class","name":"Firewall","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/firewall.js","parent":"compute","children":[],"methods":[{"id":"Firewall","name":"Firewall","type":"constructor","description":"

A Firewall object allows you to interact with a Google Compute Engine firewall.

","source":"packages/compute/src/firewall.js#L44","resources":[{"title":"Firewalls Overview","link":"https://cloud.google.com/compute/docs/networking#firewalls"},{"title":"Firewall Resource","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls"}],"examples":[{"code":"var firewall = gce.firewall('tcp-3000');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a firewall.

","source":"packages/compute/src/firewall.js#L72","resources":[],"examples":[{"code":"var config = {\n // ...\n};\n\nfirewall.create(config, function(err, firewall, operation, apiResponse) {\n // `firewall` is a Firewall object.\n\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"firewall.create(config).then(function(data) {\n var firewall = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the firewall exists.

","source":"packages/compute/src/firewall.js#L92","resources":[],"examples":[{"code":"firewall.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"firewall.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the firewall exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a firewall if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/firewall.js#L119","resources":[],"examples":[{"code":"firewall.get(function(err, firewall, apiResponse) {\n // `firewall` is a Firewall object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"firewall.get().then(function(data) {\n var firewall = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the firewall's metadata.

","source":"packages/compute/src/firewall.js#L144","resources":[{"title":"Firewalls: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls/get"},{"title":"Firewall Resource","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls"}],"examples":[{"code":"firewall.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"firewall.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The firewall's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the firewall.

","source":"packages/compute/src/firewall.js#L187","resources":[{"title":"Firewalls: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls/delete"}],"examples":[{"code":"firewall.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"firewall.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the firewall's metadata.

","source":"packages/compute/src/firewall.js#L236","resources":[{"title":"Firewall Resource","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls"}],"examples":[{"code":"var metadata = {\n description: 'New description'\n};\n\nfirewall.setMetadata(metadata, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"firewall.setMetadata(metadata).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"firewall.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/health-check.json b/json/google-cloud/v0.51.1/compute/health-check.json new file mode 100644 index 00000000000..4cb83ab8210 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/health-check.json @@ -0,0 +1 @@ +{"id":"compute/health-check","type":"class","name":"HealthCheck","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/health-check.js","parent":"compute","children":[],"methods":[{"id":"HealthCheck","name":"HealthCheck","type":"constructor","description":"

Health checks ensure that Compute Engine forwards new connections only to instances that are up and ready to receive them. Compute Engine sends health check requests to each instance at the specified frequency; once an instance exceeds its allowed number of health check failures, it is no longer considered an eligible instance for receiving new traffic.

","source":"packages/compute/src/health-check.js#L52","resources":[{"title":"Health Checks Overview","link":"https://cloud.google.com/compute/docs/load-balancing/health-checks"}],"examples":[{"code":"var healthCheck = gce.healthCheck('health-check-name');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create an HTTP or HTTPS health check.

","source":"packages/compute/src/health-check.js#L76","resources":[],"examples":[{"code":"healthCheck.create(function(err, healthCheck, operation, apiResponse) {\n // `healthCheck` is a HealthCheck object.\n\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"healthCheck.create().then(function(data) {\n var healthCheck = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the health check exists.

","source":"packages/compute/src/health-check.js#L97","resources":[],"examples":[{"code":"healthCheck.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"healthCheck.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the health check exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get the health check if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/health-check.js#L124","resources":[],"examples":[{"code":"healthCheck.get(function(err, healthCheck, apiResponse) {\n // `healthCheck` is a HealthCheck object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"healthCheck.get().then(function(data) {\n var healthCheck = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the health check's metadata.

","source":"packages/compute/src/health-check.js#L151","resources":[{"title":"HttpHealthChecks: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/get"},{},{"title":"HttpsHealthChecks: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/get"},{}],"examples":[{"code":"healthCheck.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"healthCheck.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The health check's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the health check.

","source":"packages/compute/src/health-check.js#L205","resources":[{"title":"HttpHealthCheck: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/delete"},{"title":"HttpsHealthCheck: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/delete"}],"examples":[{"code":"healthCheck.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"healthCheck.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the health check's metadata.

","source":"packages/compute/src/health-check.js#L256","resources":[{"title":"HttpHealthCheck: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/insert"},{"title":"HttpsHealthCheck: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/insert"}],"examples":[{"code":"var metadata = {\n description: 'New description'\n};\n\nhealthCheck.setMetadata(metadata, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"healthCheck.setMetadata(metadata).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"health-check.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/index.json b/json/google-cloud/v0.51.1/compute/index.json new file mode 100644 index 00000000000..2e00af16b01 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/index.json @@ -0,0 +1 @@ +{"id":"compute","type":"class","name":"Compute","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/index.js","parent":null,"children":["compute/address","compute/autoscaler","compute/disk","compute/firewall","compute/health-check","compute/instance-group","compute/machine-type","compute/network","compute/operation","compute/region","compute/rule","compute/service","compute/snapshot","compute/subnetwork","compute/vm","compute/zone"],"methods":[{"id":"Compute","name":"Compute","type":"constructor","description":"","source":"packages/compute/src/index.js#L91","resources":[{"title":"What is Google Compute Engine?","link":"https://cloud.google.com/compute/docs"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createFirewall","name":"createFirewall","type":"instance","description":"

Create a firewall.

","source":"packages/compute/src/index.js#L166","resources":[{"title":"Firewalls Overview","link":"https://cloud.google.com/compute/docs/networking#firewalls"},{"title":"Firewalls: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls/insert"}],"examples":[{"code":"var config = {\n protocols: {\n tcp: [3000],\n udp: [] // An empty array means all ports are allowed.\n },\n\n ranges: ['0.0.0.0/0']\n};\n\nfunction callback(err, firewall, operation, apiResponse) {\n // `firewall` is a Firewall object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\ngce.createFirewall('new-firewall-name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.createFirewall('new-firewall-name', config).then(function(data) {\n var firewall = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the firewall.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.protocols","description":"
  • A map of protocol to port range. The keys of the object refer to a protocol (e.g. tcp, udp) and the value for the key are the ports/port-ranges that are allowed to make a connection. If a true value, that means all ports on that protocol will be opened. If false, all traffic on that protocol will be blocked.
","types":["object"],"optional":false,"nullable":false},{"name":"config.ranges","description":"
  • The IP address blocks that this rule applies to, expressed in CIDR format.
","types":["string[]"],"optional":false,"nullable":false},{"name":"config.tags","description":"
  • Instance tags which this rule applies to.
","types":["string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.firewall","description":"
  • The created Firewall object.
","types":["compute/firewall"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

if a name is not provided.

"},{"type":"Error","description":"

if a config object is not provided.

"}],"returns":[]},{"id":"createHealthCheck","name":"createHealthCheck","type":"instance","description":"

Create an HTTP or HTTPS health check.

","source":"packages/compute/src/index.js#L280","resources":[{"title":"Health Checks Overview","link":"https://cloud.google.com/compute/docs/load-balancing/health-checks"},{"title":"HttpHealthCheck: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/insert"},{"title":"HttpsHealthCheck: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/insert"}],"examples":[{"code":"function callback(err, healthCheck, operation, apiResponse) {\n // `healthCheck` is a HealthCheck object.\n\n // `operation` is an Operation object that can be used to check the status\n // of network creation.\n}\n\ngce.createHealthCheck('new-health-check-name', callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.createHealthCheck('new-health-check-name').then(function(data) {\n var healthCheck = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the HTTP or HTTPS health check to create.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.https","description":"
  • Create an HTTPs health check. Default: false.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.interval","description":"
  • How often (in seconds) to send a health check. The default value is 5 seconds. (Alias for options.checkIntervalSec)
","types":["number"],"optional":false,"nullable":false},{"name":"options.timeout","description":"
  • How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for this value to be greater than checkIntervalSec. (Alias for options.timeoutSec)
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.healthCheck","description":"
  • The created HealthCheck object.
","types":["compute/health-check"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createNetwork","name":"createNetwork","type":"instance","description":"

Create a network.

","source":"packages/compute/src/index.js#L376","resources":[{"title":"Networks Overview","link":"https://cloud.google.com/compute/docs/networking#networks"},{"title":"Networks: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/networks/insert"}],"examples":[{"code":"var config = {\n range: '10.240.0.0/16'\n};\n\nfunction callback(err, network, operation, apiResponse) {\n // `network` is a Network object.\n\n // `operation` is an Operation object that can be used to check the status\n // of network creation.\n}\n\ngce.createNetwork('new-network', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.createNetwork('new-network', config).then(function(data) {\n var network = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the network.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.gateway","description":"
  • A gateway address for default routing to other networks. (Alias for config.gatewayIPv4)
","types":["string"],"optional":false,"nullable":false},{"name":"config.range","description":"
  • CIDR range of addresses that are legal on this network. (Alias for config.IPv4Range)
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.network","description":"
  • The created Network object.
","types":["compute/network"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createRule","name":"createRule","type":"instance","description":"

Create a global forwarding rule.

","source":"packages/compute/src/index.js#L470","resources":[{"title":"GlobalForwardingRule Resource","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules#resource"},{"title":"GlobalForwardingRules: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/insert"}],"examples":[{"code":"var name = 'new-rule-name';\n\nvar config = {\n target: 'global/targetHttpProxies/my-proxy',\n range: '8080-8089'\n};\n\ngce.createRule(name, config, function (err, rule, operation, apiResponse) {\n // `rule` is a Rule object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.createRule(name, config).then(function(data) {\n var rule = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the rule.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.ip","description":"
  • The single IP address this forwarding rule will match against. All traffic that matches the IP address, protocol, and ports of this forwarding rule will be handled by this rule. If specified, the IP address must be a static external IP address. To create a new ephemeral external IP address for the forwarding rule, leave this field empty. (Alias for config.IPAddress)
","types":["string"],"optional":true,"nullable":false},{"name":"config.protocol","description":"
  • The type of protocol that this forwarding rule matches. Valid values are AH, ESP, SCTP, TCP, UDP. Default: TCP. (Alias for config.IPProtocol)
","types":["string"],"optional":true,"nullable":false},{"name":"config.range","description":"
  • A single port or single contiguous port range, ranging from low to high for which this forwarding rule matches. Packets of the specified protocol sent to these ports will be forwarded on to the appropriate target pool or target instance. If this field is left empty, then the forwarding matches traffic for all ports for the specified protocol. (Alias for config.portRange)
","types":["string"],"optional":true,"nullable":false},{"name":"config.target","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rule","description":"
  • The created Rule object.
","types":["compute/rule"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createService","name":"createService","type":"instance","description":"

Create a backend service.

","source":"packages/compute/src/index.js#L558","resources":[{"title":"Backend Services Overview","link":"https://cloud.google.com/compute/docs/load-balancing/http/backend-service"},{"title":"BackendServices: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/backendServices/insert"}],"examples":[{"code":"var config = {\n backends: [\n {\n group: 'URL of an Instance Group resource'\n }\n ],\n healthChecks: [\n 'URL of an HTTP/HTTPS health check resource'\n ]\n};\n\nfunction callback(err, service, operation, apiResponse) {\n // `service` is a Service object.\n\n // `operation` is an Operation object that can be used to check the status\n // of network creation.\n}\n\ngce.createService('new-service', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.createService('new-service', config).then(function(data) {\n var service = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the backend service.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.service","description":"
  • The created Service object.
","types":["compute/service"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"firewall","name":"firewall","type":"instance","description":"

Get a reference to a Google Compute Engine firewall.

See compute/network#firewall to get a Firewall object for a specific network.

","source":"packages/compute/src/index.js#L598","resources":[{"title":"Firewalls Overview","link":"https://cloud.google.com/compute/docs/networking#firewalls"}],"examples":[{"code":"var firewall = gce.firewall('firewall-name');"}],"params":[{"name":"name","description":"
  • Name of the firewall.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/firewall"],"description":""}]},{"id":"getAddresses","name":"getAddresses","type":"instance","description":"

Get a list of addresses. For a detailed description of method's options see API reference.

","source":"packages/compute/src/index.js#L656","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"},{"title":"Addresses: aggregatedList API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/addresses/aggregatedList"}],"examples":[{"code":"gce.getAddresses(function(err, addresses) {\n // addresses is an array of `Address` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, addresses, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getAddresses(nextQuery, callback);\n }\n}\n\ngce.getAddresses({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getAddresses().then(function(data) {\n var addresses = data[0];\n});"}],"params":[{"name":"options","description":"
  • Address search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of addresses to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.addresses","description":"
  • Address objects from your project.
","types":["compute/address[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getAddressesStream","name":"getAddressesStream","type":"instance","description":"

Get a list of compute/address objects as a readable object stream.

","source":"packages/compute/src/index.js#L728","resources":[],"examples":[{"code":"gce.getAddressesStream()\n .on('error', console.error)\n .on('data', function(address) {\n // `address` is an `Address` object.\n })\n .on('end', function() {\n // All addresses retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getAddressesStream()\n .on('data', function(address) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getAutoscalers","name":"getAutoscalers","type":"instance","description":"

Get a list of autoscalers. For a detailed description of this method's options, see the API reference.

","source":"packages/compute/src/index.js#L786","resources":[{"title":"Managing Autoscalers","link":"https://cloud.google.com/compute/docs/autoscaler/managing-autoscalers"},{"title":"Understanding Autoscaler Decisions","link":"https://cloud.google.com/compute/docs/autoscaler/understanding-autoscaler-decisions"},{"title":"Autoscalers: aggregatedList API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers/aggregatedList"}],"examples":[{"code":"gce.getAutoscalers(function(err, autoscalers) {\n // autoscalers is an array of `Autoscaler` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, autoscalers, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getAutoscalers(nextQuery, callback);\n }\n}\n\ngce.getAutoscalers({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getAutoscalers().then(function(data) {\n var autoscalers = data[0];\n});"}],"params":[{"name":"options","description":"
  • Address search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of addresses to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.autoscalers","description":"
  • Autoscaler objects from your project.
","types":["compute/autoscaler[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getAutoscalersStream","name":"getAutoscalersStream","type":"instance","description":"

Get a list of compute/autoscaler objects as a readable object stream.

","source":"packages/compute/src/index.js#L863","resources":[],"examples":[{"code":"gce.getAutoscalersStream()\n .on('error', console.error)\n .on('data', function(autoscaler) {\n // `autoscaler` is an `Autoscaler` object.\n })\n .on('end', function() {\n // All addresses retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getAutoscalersStream()\n .on('data', function(address) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getDisks","name":"getDisks","type":"instance","description":"

Get a list of disks.

","source":"packages/compute/src/index.js#L919","resources":[{"title":"Disks Overview","link":"https://cloud.google.com/compute/docs/disks"},{"title":"Disks: aggregatedList API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/disks/aggregatedList"}],"examples":[{"code":"gce.getDisks(function(err, disks) {\n // `disks` is an array of `Disk` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, disks, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getDisks(nextQuery, callback);\n }\n}\n\ngce.getDisks({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getDisks().then(function(data) {\n var disks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Disk search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of disks to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.disks","description":"
  • Disk objects from your project.
","types":["compute/disk[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getDisksStream","name":"getDisksStream","type":"instance","description":"

Get a list of compute/disk objects as a readable object stream.

","source":"packages/compute/src/index.js#L992","resources":[],"examples":[{"code":"gce.getDisksStream()\n .on('error', console.error)\n .on('data', function(disk) {\n // `disk` is a `Disk` object.\n })\n .on('end', function() {\n // All disks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getDisksStream()\n .on('data', function(disk) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getInstanceGroups","name":"getInstanceGroups","type":"instance","description":"

Get a list of instance groups.

","source":"packages/compute/src/index.js#L1048","resources":[{"title":"InstanceGroups Overview","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups"},{"title":"InstanceGroups: aggregatedList API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/aggregatedList"}],"examples":[{"code":"gce.getInstanceGroups(function(err, instanceGroups) {\n // `instanceGroups` is an array of `InstanceGroup` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, instanceGroups, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getInstanceGroups(nextQuery, callback);\n }\n}\n\ngce.getInstanceGroups({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getInstanceGroups().then(function(data) {\n var instanceGroups = data[0];\n});"}],"params":[{"name":"options","description":"
  • Instance group search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of instance groups to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instanceGroups","description":"
  • InstanceGroup objects from your project.
","types":["compute/instance-group[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getInstanceGroupsStream","name":"getInstanceGroupsStream","type":"instance","description":"

Get a list of compute/instanceGroup objects as a readable object stream.

","source":"packages/compute/src/index.js#L1122","resources":[],"examples":[{"code":"gce.getInstanceGroupsStream()\n .on('error', console.error)\n .on('data', function(instanceGroup) {\n // `instanceGroup` is an `InstanceGroup` object.\n })\n .on('end', function() {\n // All instance groups retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getInstanceGroupsStream()\n .on('data', function(instanceGroup) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getFirewalls","name":"getFirewalls","type":"instance","description":"

Get a list of firewalls.

","source":"packages/compute/src/index.js#L1175","resources":[{"title":"Firewalls Overview","link":"https://cloud.google.com/compute/docs/networking#firewalls"},{"title":"Firewalls: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls/list"}],"examples":[{"code":"gce.getFirewalls(function(err, firewalls) {\n // `firewalls` is an array of `Firewall` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, firewalls, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getFirewalls(nextQuery, callback);\n }\n}\n\ngce.getFirewalls({\n autoPaginate: false\n}, callback);\n\ngce.getFirewalls().then(function(data) {\n var firewalls = data[0];\n});"}],"params":[{"name":"options","description":"
  • Firewall search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of firewalls to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.firewalls","description":"
  • Firewall objects from your project.
","types":["compute/firewall[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getFirewallsStream","name":"getFirewallsStream","type":"instance","description":"

Get a list of compute/firewall objects as a readable object stream.

","source":"packages/compute/src/index.js#L1239","resources":[],"examples":[{"code":"gce.getFirewallsStream()\n .on('error', console.error)\n .on('data', function(firewall) {\n // `firewall` is a `Firewall` object.\n })\n .on('end', function() {\n // All firewalls retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getFirewallsStream()\n .on('data', function(firewall) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getHealthChecks","name":"getHealthChecks","type":"instance","description":"

Get a list of health checks.

","source":"packages/compute/src/index.js#L1295","resources":[{"title":"Health Checks Overview","link":"https://cloud.google.com/compute/docs/load-balancing/health-checks"},{"title":"HttpHealthCheck: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/list"},{"title":"HttpsHealthCheck: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/list"}],"examples":[{"code":"gce.getHealthChecks(function(err, healthChecks) {\n // `healthChecks` is an array of `HealthCheck` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, healthChecks, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getHealthChecks(nextQuery, callback);\n }\n}\n\ngce.getHealthChecks({\n autoPaginate: false\n}, callback);\n\ngce.getHealthChecks().then(function(data) {\n var healthChecks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Health check search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.https","description":"
  • List only HTTPs health checks. Default: false.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of networks to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.healthChecks","description":"
  • HealthCheck objects from your project.
","types":["compute/health-check[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getHealthChecksStream","name":"getHealthChecksStream","type":"instance","description":"

Get a list of compute/healthCheck objects as a readable object stream.

","source":"packages/compute/src/index.js#L1365","resources":[],"examples":[{"code":"gce.getHealthChecksStream()\n .on('error', console.error)\n .on('data', function(healthCheck) {\n // `healthCheck` is a `HealthCheck` object.\n })\n .on('end', function() {\n // All health checks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getHealthChecksStream()\n .on('data', function(healthCheck) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getMachineTypes","name":"getMachineTypes","type":"instance","description":"

Get a list of machine types in this project.

","source":"packages/compute/src/index.js#L1423","resources":[{"title":"MachineTypes: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes/aggregatedList"},{"title":"Machine Types Overview","link":"https://cloud.google.com/compute/docs/machine-types"},{"title":"MachineType Resource","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes"}],"examples":[{"code":"gce.getMachineTypes(function(err, machineTypes) {\n // `machineTypes` is an array of `MachineType` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, machineTypes, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getMachineTypes(nextQuery, callback);\n }\n}\n\ngce.getMachineTypes({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getMachineTypes().then(function(data) {\n var machineTypes = data[0];\n});"}],"params":[{"name":"options","description":"
  • Machine type search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of machineTypes to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.machineTypes","description":"
  • MachineType objects from your project.
","types":["compute/machine-type[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMachineTypesStream","name":"getMachineTypesStream","type":"instance","description":"

Get a list of compute/machineType objects in this project as a readable object stream.

","source":"packages/compute/src/index.js#L1496","resources":[],"examples":[{"code":"gce.getMachineTypesStream()\n .on('error', console.error)\n .on('data', function(machineType) {\n // `machineType` is a `MachineType` object.\n })\n .on('end', function() {\n // All machine types retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getMachineTypesStream()\n .on('data', function(machineType) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getNetworks","name":"getNetworks","type":"instance","description":"

Get a list of networks.

","source":"packages/compute/src/index.js#L1552","resources":[{"title":"Networks Overview","link":"https://cloud.google.com/compute/docs/networking#networks"},{"title":"Networks: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/networks/list"}],"examples":[{"code":"gce.getNetworks(function(err, networks) {\n // `networks` is an array of `Network` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, networks, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getNetworks(nextQuery, callback);\n }\n}\n\ngce.getNetworks({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getNetworks().then(function(data) {\n var networks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Network search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of networks to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.networks","description":"
  • Network objects from your project.
","types":["compute/network[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getNetworksStream","name":"getNetworksStream","type":"instance","description":"

Get a list of compute/network objects as a readable object stream.

","source":"packages/compute/src/index.js#L1615","resources":[],"examples":[{"code":"gce.getNetworksStream()\n .on('error', console.error)\n .on('data', function(network) {\n // `network` is a `Network` object.\n })\n .on('end', function() {\n // All networks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getNetworksStream()\n .on('data', function(network) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getOperations","name":"getOperations","type":"instance","description":"

Get a list of global operations.

","source":"packages/compute/src/index.js#L1670","resources":[{"title":"Global Operation Overview","link":"https://cloud.google.com/compute/docs/reference/v1/globalOperations"},{"title":"GlobalOperations: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalOperations/list"}],"examples":[{"code":"gce.getOperations(function(err, operations) {\n // `operations` is an array of `Operation` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, operations, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getOperations(nextQuery, callback);\n }\n}\n\ngce.getOperations({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getOperations().then(function(data) {\n var operations = data[0];\n});"}],"params":[{"name":"options","description":"
  • Operation search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of operations to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operations","description":"
  • Operation objects from your project.
","types":["compute/operation[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getOperationsStream","name":"getOperationsStream","type":"instance","description":"

Get a list of global compute/operation objects as a readable object stream.

","source":"packages/compute/src/index.js#L1734","resources":[],"examples":[{"code":"gce.getOperationsStream()\n .on('error', console.error)\n .on('data', function(operation) {\n // `operation` is a `Operation` object.\n })\n .on('end', function() {\n // All operations retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getOperationsStream()\n .on('data', function(operation) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getRegions","name":"getRegions","type":"instance","description":"

Return the regions available to your project.

","source":"packages/compute/src/index.js#L1790","resources":[{"title":"Regions & Zones Overview","link":"https://cloud.google.com/compute/docs/zones"},{"title":"Regions: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/regions/list"}],"examples":[{"code":"gce.getRegions(function(err, regions) {\n // `regions` is an array of `Region` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, regions, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getRegions(nextQuery, callback);\n }\n}\n\ngce.getRegions({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getRegions().then(function(data) {\n var regions = data[0];\n});"}],"params":[{"name":"options","description":"
  • Instance search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of instances to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.regions","description":"
  • Region objects that are available to your project.
","types":["compute/region[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getRegionsStream","name":"getRegionsStream","type":"instance","description":"

Return the compute/region objects available to your project as a readable object stream.

","source":"packages/compute/src/index.js#L1852","resources":[],"examples":[{"code":"gce.getRegionsStream()\n .on('error', console.error)\n .on('data', function(region) {\n // `region` is a `Region` object.\n })\n .on('end', function() {\n // All regions retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getRegionsStream()\n .on('data', function(region) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getRules","name":"getRules","type":"instance","description":"

Get a list of forwarding rules.

","source":"packages/compute/src/index.js#L1906","resources":[{"title":"GlobalForwardingRules: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/list"}],"examples":[{"code":"gce.getRules(function(err, rules) {\n // `rules` is an array of `Rule` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, rules, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getRules(nextQuery, callback);\n }\n}\n\ngce.getRules({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getRules().then(function(data) {\n var rules = data[0];\n});"}],"params":[{"name":"options","description":"
  • Rules search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of rules to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rules","description":"
  • Rule objects from your project.
","types":["compute/rule[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getRulesStream","name":"getRulesStream","type":"instance","description":"

Get a list of compute/rule objects as a readable object stream.

","source":"packages/compute/src/index.js#L1969","resources":[],"examples":[{"code":"gce.getRulesStream()\n .on('error', console.error)\n .on('data', function(rule) {\n // `rule` is a `Rule` object.\n })\n .on('end', function() {\n // All rules retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getRulesStream()\n .on('data', function(rule) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getServices","name":"getServices","type":"instance","description":"

Get a list of backend services.

","source":"packages/compute/src/index.js#L2024","resources":[{"title":"Backend Services Overview","link":"https://cloud.google.com/compute/docs/load-balancing/http/backend-service"},{"title":"BackendServices: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/backendServices/list"}],"examples":[{"code":"gce.getServices(function(err, services) {\n // `services` is an array of `Service` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, services, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getServices(nextQuery, callback);\n }\n}\n\ngce.getServices({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getServices().then(function(data) {\n var services = data[0];\n});"}],"params":[{"name":"options","description":"
  • BackendService search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of snapshots to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.services","description":"
  • Service objects from your project.
","types":["compute/service[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getServicesStream","name":"getServicesStream","type":"instance","description":"

Get a list of compute/service objects as a readable object stream.

","source":"packages/compute/src/index.js#L2087","resources":[],"examples":[{"code":"gce.getServicesStream()\n .on('error', console.error)\n .on('data', function(service) {\n // `service` is a `Service` object.\n })\n .on('end', function() {\n // All services retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getServicesStream()\n .on('data', function(service) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getSnapshots","name":"getSnapshots","type":"instance","description":"

Get a list of snapshots.

","source":"packages/compute/src/index.js#L2142","resources":[{"title":"Snapshots Overview","link":"https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots"},{"title":"Snapshots: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/snapshots/list"}],"examples":[{"code":"gce.getSnapshots(function(err, snapshots) {\n // `snapshots` is an array of `Snapshot` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, snapshots, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getSnapshots(nextQuery, callback);\n }\n}\n\ngce.getSnapshots({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getSnapshots().then(function(data) {\n var snapshots = data[0];\n});"}],"params":[{"name":"options","description":"
  • Snapshot search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of snapshots to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.snapshots","description":"
  • Snapshot objects from your project.
","types":["compute/snapshot[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSnapshotsStream","name":"getSnapshotsStream","type":"instance","description":"

Get a list of compute/snapshot objects as a readable object stream.

","source":"packages/compute/src/index.js#L2205","resources":[],"examples":[{"code":"gce.getSnapshotsStream()\n .on('error', console.error)\n .on('data', function(snapshot) {\n // `snapshot` is a `Snapshot` object.\n })\n .on('end', function() {\n // All snapshots retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getSnapshotsStream()\n .on('data', function(snapshot) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getSubnetworks","name":"getSubnetworks","type":"instance","description":"

Get a list of subnetworks in this project.

","source":"packages/compute/src/index.js#L2261","resources":[{"title":"Subnetworks Overview","link":"https://cloud.google.com/compute/docs/subnetworks"},{"title":"Subnetworks: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks"}],"examples":[{"code":"gce.getSubnetworks(function(err, subnetworks) {\n // `subnetworks` is an array of `Subnetworks` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, subnetworks, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getSubnetworks(nextQuery, callback);\n }\n}\n\ngce.getSubnetworks({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getSubnetworks().then(function(data) {\n var subnetworks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Subnetwork search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of subnetworks to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.subnetworks","description":"
  • Subnetwork objects from your project.
","types":["compute/subnetwork[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSubnetworksStream","name":"getSubnetworksStream","type":"instance","description":"

Get a list of compute/subnetwork objects in this project as a readable object stream.

","source":"packages/compute/src/index.js#L2334","resources":[],"examples":[{"code":"gce.getSubnetworksStream()\n .on('error', console.error)\n .on('data', function(subnetwork) {\n // `subnetwork` is a `Subnetwork` object.\n })\n .on('end', function() {\n // All subnetworks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getSubnetworksStream()\n .on('data', function(subnetwork) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getVMs","name":"getVMs","type":"instance","description":"

Get a list of virtual machine instances.

","source":"packages/compute/src/index.js#L2389","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"},{"title":"Instances: aggregatedList API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/aggregatedList"}],"examples":[{"code":"gce.getVMs(function(err, vms) {\n // `vms` is an array of `VM` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, vms, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getVMs(nextQuery, callback);\n }\n}\n\ngce.getVMs({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getVMs().then(function(data) {\n var vms = data[0];\n});"}],"params":[{"name":"options","description":"
  • Instance search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of instances to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.vms","description":"
  • VM objects from your project.
","types":["compute/vm[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getVMsStream","name":"getVMsStream","type":"instance","description":"

Get a list of compute/vm instances as a readable object stream.

","source":"packages/compute/src/index.js#L2461","resources":[],"examples":[{"code":"gce.getVMsStream()\n .on('error', console.error)\n .on('data', function(vm) {\n // `vm` is a `VM` object.\n })\n .on('end', function() {\n // All vms retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getVMsStream()\n .on('data', function(vm) {\n this.end();\n });"}],"params":[{"name":"options","description":"
  • Configuration object. See compute#getVMs for a complete list of options.
","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getZones","name":"getZones","type":"instance","description":"

Return the zones available to your project.

","source":"packages/compute/src/index.js#L2516","resources":[{"title":"Regions & Zones Overview","link":"https://cloud.google.com/compute/docs/zones"},{"title":"Zones: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/zones/list"}],"examples":[{"code":"gce.getZones(function(err, zones) {\n // `zones` is an array of `Zone` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, zones, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gce.getZones(nextQuery, callback);\n }\n}\n\ngce.getZones({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gce.getZones().then(function(data) {\n var zones = data[0];\n});"}],"params":[{"name":"options","description":"
  • Instance search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of instances to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.zones","description":"
  • Zone objects that are available to your project.
","types":["compute/zone[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getZonesStream","name":"getZonesStream","type":"instance","description":"

Return the compute/zone objects available to your project as a readable object stream.

","source":"packages/compute/src/index.js#L2578","resources":[],"examples":[{"code":"gce.getZonesStream()\n .on('error', console.error)\n .on('data', function(zone) {\n // `zone` is a `Zone` object.\n })\n .on('end', function() {\n // All zones retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gce.getZonesStream()\n .on('data', function(zone) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"healthCheck","name":"healthCheck","type":"instance","description":"

Get a reference to a Google Compute Engine health check.

","source":"packages/compute/src/index.js#L2601","resources":[{"title":"Health Checks Overview","link":"https://cloud.google.com/compute/docs/load-balancing/health-checks"}],"examples":[{"code":"var healthCheck = gce.healthCheck('http-health-check-name');"},{"caption":"

Access an HTTPS health check.

","code":"var httpsHealthCheck = gce.healthCheck('https-health-check-name', {\n https: true\n});"}],"params":[{"name":"name","description":"
  • Name of the health check.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.https","description":"
  • Specify if this is an HTTPS health check resource. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/health-check"],"description":""}]},{"id":"network","name":"network","type":"instance","description":"

Get a reference to a Google Compute Engine network.

","source":"packages/compute/src/index.js#L2616","resources":[{"title":"Networks Overview","link":"https://cloud.google.com/compute/docs/networking#networks"}],"examples":[{"code":"var network = gce.network('network-name');"}],"params":[{"name":"name","description":"
  • Name of the network.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/network"],"description":""}]},{"id":"operation","name":"operation","type":"instance","description":"

Get a reference to a global Google Compute Engine operation.

","source":"packages/compute/src/index.js#L2631","resources":[{"title":"Global Operation Overview","link":"https://cloud.google.com/compute/docs/reference/v1/globalOperations"}],"examples":[{"code":"var operation = gce.operation('operation-name');"}],"params":[{"name":"name","description":"
  • Name of the existing operation.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/operation"],"description":""}]},{"id":"region","name":"region","type":"instance","description":"

Get a reference to a Google Compute Engine region.

","source":"packages/compute/src/index.js#L2646","resources":[{"title":"Regions & Zones Overview","link":"https://cloud.google.com/compute/docs/zones"}],"examples":[{"code":"var region = gce.region('region-name');"}],"params":[{"name":"name","description":"
  • Name of the region.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/region"],"description":""}]},{"id":"rule","name":"rule","type":"instance","description":"

Get a reference to a Google Compute Engine forwading rule.

","source":"packages/compute/src/index.js#L2659","resources":[],"examples":[{"code":"var rule = gce.rule('rule-name');"}],"params":[{"name":"name","description":"
  • Name of the rule.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/rule"],"description":""}]},{"id":"service","name":"service","type":"instance","description":"

Get a reference to a Google Compute Engine backend service.

","source":"packages/compute/src/index.js#L2674","resources":[{"title":"Backend Services Overview","link":"https://cloud.google.com/compute/docs/load-balancing/http/backend-service"}],"examples":[{"code":"var service = gce.service('service-name');"}],"params":[{"name":"name","description":"
  • Name of the existing service.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/service"],"description":""}]},{"id":"snapshot","name":"snapshot","type":"instance","description":"

Get a reference to a Google Compute Engine snapshot.

","source":"packages/compute/src/index.js#L2689","resources":[{"title":"Snapshots Overview","link":"https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots"}],"examples":[{"code":"var snapshot = gce.snapshot('snapshot-name');"}],"params":[{"name":"name","description":"
  • Name of the existing snapshot.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/snapshot"],"description":""}]},{"id":"zone","name":"zone","type":"instance","description":"

Get a reference to a Google Compute Engine zone.

","source":"packages/compute/src/index.js#L2704","resources":[{"title":"Regions & Zones Overview","link":"https://cloud.google.com/compute/docs/zones"}],"examples":[{"code":"var zone = gce.zone('zone-name');"}],"params":[{"name":"name","description":"
  • Name of the zone.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/zone"],"description":""}]},{"id":"execAfterOperation_","name":"execAfterOperation_","type":"instance","description":"

Register a single callback that will wait for an operation to finish before being executed.

","source":"packages/compute/src/index.js#L2716","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[{"types":["function"],"description":"

callback - The callback function.

"},{"types":["error"],"description":"

callback.err - An error returned from the operation.

"},{"types":["object"],"description":"

callback.apiResponse - The operation's final API response.

"}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/instance-group.json b/json/google-cloud/v0.51.1/compute/instance-group.json new file mode 100644 index 00000000000..51d46d17266 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/instance-group.json @@ -0,0 +1 @@ +{"id":"compute/instance-group","type":"class","name":"InstanceGroup","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/instance-group.js","parent":"compute","children":[],"methods":[{"id":"InstanceGroup","name":"InstanceGroup","type":"constructor","description":"

You can create and manage groups of virtual machine instances so that you don't have to individually control each instance in your project.

","source":"packages/compute/src/instance-group.js#L50","resources":[{"title":"Creating Groups of Instances","link":"https://cloud.google.com/compute/docs/instance-groups"},{"title":"Unmanaged Instance Groups","link":"https://cloud.google.com/compute/docs/instance-groups/unmanaged-groups"}],"examples":[{"code":"var zone = gce.zone('us-central1-a');\n\nvar instanceGroup = zone.instanceGroup('web-servers');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create an instance group.

","source":"packages/compute/src/instance-group.js#L76","resources":[],"examples":[{"code":"function onCreated(err, instanceGroup, operation, apiResponse) {\n // `instanceGroup` is an InstanceGroup object.\n\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n}\n\ninstanceGroup.create(onCreated);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.create().then(function(data) {\n var instanceGroup = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the instance group exists.

","source":"packages/compute/src/instance-group.js#L97","resources":[],"examples":[{"code":"instanceGroup.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the instance group exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get an instance group if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/instance-group.js#L124","resources":[],"examples":[{"code":"instanceGroup.get(function(err, instanceGroup, apiResponse) {\n // `instanceGroup` is an InstanceGroup object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.get().then(function(data) {\n var instanceGroup = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the instance group's metadata.

","source":"packages/compute/src/instance-group.js#L149","resources":[{"title":"InstanceGroups: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/get"},{"title":"InstanceGroups Resource","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups"}],"examples":[{"code":"instanceGroup.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The instance group's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"add","name":"add","type":"instance","description":"

Add one or more VMs to this instance group.

","source":"packages/compute/src/instance-group.js#L216","resources":[{"title":"InstanceGroups: addInstances API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/addInstances"}],"examples":[{"code":"var vms = [\n gce.zone('us-central1-a').vm('http-server'),\n gce.zone('us-central1-a').vm('https-server')\n];\n\ninstanceGroup.add(vms, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.add(vms).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"vms","description":"
  • VM instances to add to this instance group.
","types":["compute/vm","compute/vm[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the instance group.

","source":"packages/compute/src/instance-group.js#L267","resources":[{"title":"InstanceGroups: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/delete"}],"examples":[{"code":"instanceGroup.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getVMs","name":"getVMs","type":"instance","description":"

Get a list of VM instances in this instance group.

","source":"packages/compute/src/instance-group.js#L338","resources":[{"title":"InstaceGroups: listInstances API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/listInstances"}],"examples":[{"code":"instanceGroup.getVMs(function(err, vms) {\n // `vms` is an array of `VM` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, vms, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n instanceGroup.getVMs(nextQuery, callback);\n }\n}\n\ninstanceGroup.getVMs({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.getVMs().then(function(data) {\n var vms = data[0];\n});"}],"params":[{"name":"options","description":"
  • Instance search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of VMs to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"options.running","description":"
  • Only return instances which are running.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.vms","description":"
  • VM objects from this isntance group.
","types":["compute/vm[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getVMsStream","name":"getVMsStream","type":"instance","description":"

Get a list of compute/vm instances in this instance group as a readable object stream.

","source":"packages/compute/src/instance-group.js#L412","resources":[],"examples":[{"code":"instanceGroup.getVMsStream()\n .on('error', console.error)\n .on('data', function(vm) {\n // `vm` is a `VM` object.\n })\n .on('end', function() {\n // All instances retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"instanceGroup.getVMsStream()\n .on('data', function(vm) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"remove","name":"remove","type":"instance","description":"

Remove one or more VMs from this instance group.

","source":"packages/compute/src/instance-group.js#L446","resources":[{"title":"InstanceGroups: removeInstances API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/removeInstances"}],"examples":[{"code":"var vms = [\n gce.zone('us-central1-a').vm('http-server'),\n gce.zone('us-central1-a').vm('https-server')\n];\n\ninstanceGroup.remove(vms, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.remove(vms).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"vms","description":"
  • VM instances to remove from this instance group.
","types":["compute/vm","compute/vm[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setPorts","name":"setPorts","type":"instance","description":"

Set the named ports for this instance group.

","source":"packages/compute/src/instance-group.js#L504","resources":[{"title":"InstanceGroups: setNamedPorts API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/setNamedPorts"}],"examples":[{"code":"var ports = {\n http: 80,\n https: 443\n};\n\ninstanceGroup.setPorts(ports, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instanceGroup.setPorts(ports).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"ports","description":"
  • A map of names to ports. The key should be the name, and the value the port number.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"instance-group.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/machine-type.json b/json/google-cloud/v0.51.1/compute/machine-type.json new file mode 100644 index 00000000000..2196c2a342c --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/machine-type.json @@ -0,0 +1 @@ +{"id":"compute/machine-type","type":"class","name":"MachineType","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/machine-type.js","parent":"compute","children":[],"methods":[{"id":"MachineType","name":"MachineType","type":"constructor","description":"

A MachineType object allows you to interact with a Google Compute Engine machine type.

","source":"packages/compute/src/machine-type.js#L46","resources":[{"title":"Machine Types Overview","link":"https://cloud.google.com/compute/docs/machine-types"},{"title":"MachineType Resource","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes"}],"examples":[{"code":"var zone = gce.zone('us-central1-b');\n\nvar machineType = zone.machineType('g1-small');"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the machine type exists.

","source":"packages/compute/src/machine-type.js#L67","resources":[],"examples":[{"code":"machineType.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"machineType.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the machine type exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a machine type if it exists.

","source":"packages/compute/src/machine-type.js#L85","resources":[],"examples":[{"code":"machineType.get(function(err, machineType, apiResponse) {\n // `machineType` is a MachineType object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"machineType.get().then(function(data) {\n var machineType = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the machine type's metadata.

","source":"packages/compute/src/machine-type.js#L110","resources":[{"title":"MachineTypes: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes/get"},{"title":"MachineType Resource","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes"}],"examples":[{"code":"machineType.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"machineType.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The machine type's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"machine-type.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/network.json b/json/google-cloud/v0.51.1/compute/network.json new file mode 100644 index 00000000000..d54ffb244d8 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/network.json @@ -0,0 +1 @@ +{"id":"compute/network","type":"class","name":"Network","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/network.js","parent":"compute","children":[],"methods":[{"id":"Network","name":"Network","type":"constructor","description":"

A Network object allows you to interact with a Google Compute Engine network.

","source":"packages/compute/src/network.js#L46","resources":[{"title":"Networks Overview","link":"https://cloud.google.com/compute/docs/networking#networks"},{"title":"Network Resource","link":"https://cloud.google.com/compute/docs/reference/v1/networks"}],"examples":[{"code":"var network = gce.network('network-name');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a network.

","source":"packages/compute/src/network.js#L75","resources":[],"examples":[{"code":"var config = {\n // ...\n};\n\nnetwork.create(config, function(err, network, operation, apiResponse) {\n // `network` is a Network object.\n\n // `operation` is an Operation object that can be used to check the\n // status of network creation.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.create(config).then(function(data) {\n var network = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the network exists.

","source":"packages/compute/src/network.js#L95","resources":[],"examples":[{"code":"network.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the network exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a network if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/network.js#L122","resources":[],"examples":[{"code":"network.get(function(err, network, apiResponse) {\n // `network` is a Network object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.get().then(function(data) {\n var network = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the network's metadata.

","source":"packages/compute/src/network.js#L147","resources":[{"title":"Network Resource","link":"https://cloud.google.com/compute/docs/reference/v1/networks"},{"title":"Networks: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/networks/delete"}],"examples":[{"code":"network.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The network's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createFirewall","name":"createFirewall","type":"instance","description":"

Create a firewall for this network.

","source":"packages/compute/src/network.js#L233","resources":[{"title":"Firewalls Overview","link":"https://cloud.google.com/compute/docs/networking#firewalls"},{"title":"Firewalls: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls/insert"}],"examples":[{"code":"var config = {\n protocols: {\n tcp: [3000],\n udp: [] // An empty array means all ports are allowed.\n },\n\n ranges: ['0.0.0.0/0']\n};\n\nfunction callback(err, firewall, operation, apiResponse) {\n // `firewall` is a Firewall object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nnetwork.createFirewall('new-firewall-name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.createFirewall('new-firewall-name', config).then(function(data) {\n var firewall = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the firewall.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.protocols","description":"
  • A map of protocol to port range. The keys of the object refer to a protocol (e.g. tcp, udp) and the value for the key are the ports/port-ranges that are allowed to make a connection.
","types":["object"],"optional":false,"nullable":false},{"name":"config.ranges","description":"
  • The IP address blocks that this rule applies to, expressed in CIDR format.
","types":["string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.firewall","description":"
  • The created Firewall object.
","types":["compute/firewall"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createSubnetwork","name":"createSubnetwork","type":"instance","description":"

Create a subnetwork in this network.

","source":"packages/compute/src/network.js#L291","resources":[{"title":"Subnetwork Resource","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks#resource"},{"title":"Subnetwork: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks/insert"}],"examples":[{"code":"var region = gce.region('us-east1');\n\nvar config = {\n region: region,\n range: '10.0.1.0/24'\n};\n\nfunction callback(err, subnetwork, operation, apiResponse) {\n // `subnetwork` is a Subnetwork object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nnetwork.createSubnetwork('new-subnetwork-name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.createSubnetwork('new-subnetwork-name', config).then(function(data) {\n var subnetwork = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the subnetwork.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.region","description":"
  • The region where the Subnetwork resides.
","types":["compute/region","string"],"optional":false,"nullable":false},{"name":"config.range","description":"
  • The range of internal addresses that are owned by this subnetwork. CIDR range of addresses that are legal on this network. (Alias for config.ipCidrRange)
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.subnetwork","description":"
  • The created Subnetwork object.
","types":["compute/subnetwork"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSubnetworks","name":"getSubnetworks","type":"instance","description":"

Get a list of subnetworks in this network.

","source":"packages/compute/src/network.js#L360","resources":[{"title":"Subnetworks Overview","link":"https://cloud.google.com/compute/docs/subnetworks"},{"title":"Subnetworks: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks"}],"examples":[{"code":"network.getSubnetworks(function(err, subnetworks) {\n // `subnetworks` is an array of `Subnetworks` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, subnetworks, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n network.getSubnetworks(nextQuery, callback);\n }\n}\n\nnetwork.getSubnetworks({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.getSubnetworks().then(function(data) {\n var subnetworks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Subnetwork search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of subnetworks to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.subnetworks","description":"
  • Subnetwork objects from this network.
","types":["compute/subnetwork[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSubnetworksStream","name":"getSubnetworksStream","type":"instance","description":"

Get a compute/subnetwork list within this network as a readable object stream.

","source":"packages/compute/src/network.js#L400","resources":[],"examples":[{"code":"network.getSubnetworksStream()\n .on('error', console.error)\n .on('data', function(subnetwork) {\n // `subnetwork` is a `Subnetwork` object.\n })\n .on('end', function() {\n // All subnetworks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"network.getSubnetworksStream()\n .on('data', function(subnetwork) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the network.

","source":"packages/compute/src/network.js#L433","resources":[{"title":"Networks: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/networks/delete"}],"examples":[{"code":"network.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"firewall","name":"firewall","type":"instance","description":"

Get a reference to a Google Compute Engine firewall in this network.

","source":"packages/compute/src/network.js#L461","resources":[{"title":"Firewalls Overview","link":"https://cloud.google.com/compute/docs/networking#firewalls"}],"examples":[{"code":"var firewall = network.firewall('firewall-name');"}],"params":[{"name":"name","description":"
  • Name of the firewall.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getFirewalls","name":"getFirewalls","type":"instance","description":"

Get a list of firewalls for this network.

","source":"packages/compute/src/network.js#L517","resources":[{"title":"Firewalls Overview","link":"https://cloud.google.com/compute/docs/networking#firewalls"},{"title":"Firewalls: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/firewalls/list"}],"examples":[{"code":"network.getFirewalls(function(err, firewalls) {\n // `firewalls` is an array of `Firewall` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, firewalls, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n network.getFirewalls(nextQuery, callback);\n }\n}\n\nnetwork.getFirewalls({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"network.getFirewalls().then(function(data) {\n var firewalls = data[0];\n});"}],"params":[{"name":"options","description":"
  • Firewall search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of firewalls to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.firewalls","description":"
  • Firewall objects from this network.
","types":["compute/firewall[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getFirewallsStream","name":"getFirewallsStream","type":"instance","description":"

Get a list of compute/firewall objects for this network as a readable object stream.

","source":"packages/compute/src/network.js#L557","resources":[],"examples":[{"code":"network.getFirewallsStream()\n .on('error', console.error)\n .on('data', function(firewall) {\n // `firewall` is a `Firewall` object.\n })\n .on('end', function() {\n // All firewalls retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"network.getFirewallsStream()\n .on('data', function(firewall) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]}],"path":"network.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/operation.json b/json/google-cloud/v0.51.1/compute/operation.json new file mode 100644 index 00000000000..e39bc55977c --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/operation.json @@ -0,0 +1 @@ +{"id":"compute/operation","type":"class","name":"Operation","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/operation.js","parent":"compute","children":[],"methods":[{"id":"Operation","name":"Operation","type":"constructor","description":"

An Operation object allows you to interact with a Google Compute Engine operation.

An operation can be a GlobalOperation, RegionOperation, or ZoneOperation.

","source":"packages/compute/src/operation.js#L94","resources":[],"examples":[{"caption":"

Reference a global operation.

","code":"var operation = gce.operation('operation-id');"},{"caption":"

Reference a region operation.

","code":"var region = gce.region('us-central1');\nvar operation = region.operation('operation-id');"},{"caption":"

Reference a zone operation.

","code":"var zone = gce.zone('us-central1-a');\nvar operation = zone.operation('operation-id');"},{"caption":"

All operations are event emitters. The status of each operation is polled \ncontinuously, starting only after you register a \"complete\" listener.

","code":"operation.on('complete', function(metadata) {\n // The operation is complete.\n});"},{"caption":"

You can register a listener to monitor when the operation begins running.

","code":"operation.on('running', function(metadata) {\n // The operation is running.\n});"},{"caption":"

Be sure to register an error handler as well to catch any issues which \nimpeded the operation.

","code":"operation.on('error', function(err) {\n // An error occurred during the operation.\n});"},{"caption":"

To force the Operation object to stop polling for updates, simply remove \nany \"complete\" listeners you've registered. \nThe easiest way to do this is with removeAllListeners().

","code":"operation.removeAllListeners();"}],"params":[],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the operation.

","source":"packages/compute/src/operation.js#L120","resources":[{"title":"GlobalOperations: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalOperations/delete"},{"title":"RegionOperations: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/regionOperations/delete"},{"title":"ZoneOperations: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/zoneOperations/delete"}],"examples":[{"code":"operation.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"operation.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the operation exists.

","source":"packages/compute/src/operation.js#L140","resources":[],"examples":[{"code":"operation.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"operation.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the operation exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get an operation if it exists.

","source":"packages/compute/src/operation.js#L158","resources":[],"examples":[{"code":"operation.get(function(err, operation, apiResponse) {\n // `operation` is an Operation object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"operation.get().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the operation's metadata. For a detailed description of metadata see Operation resource.

","source":"packages/compute/src/operation.js#L200","resources":[{"title":"GlobalOperations: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalOperations/get"},{"title":"RegionOperations: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/regionOperations/get"},{"title":"ZoneOperations: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/zoneOperations/get"}],"examples":[{"code":"operation.getMetadata(function(err, metadata, apiResponse) {\n // `metadata.error`: Contains errors if the operation failed.\n // `metadata.warnings`: Contains warnings.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"operation.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The disk's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"operation.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/region.json b/json/google-cloud/v0.51.1/compute/region.json new file mode 100644 index 00000000000..0f5a404b38e --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/region.json @@ -0,0 +1 @@ +{"id":"compute/region","type":"class","name":"Region","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/region.js","parent":"compute","children":[],"methods":[{"id":"Region","name":"Region","type":"constructor","description":"

A Region object allows you to interact with a Google Compute Engine region.

","source":"packages/compute/src/region.js#L75","resources":[{"title":"Regions & Zones Overview","link":"https://cloud.google.com/compute/docs/zones"},{"title":"Region Resource","link":"https://cloud.google.com/compute/docs/reference/v1/regions"}],"examples":[{"code":"var region = gce.region('us-central1');"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the region exists.

","source":"packages/compute/src/region.js#L95","resources":[],"examples":[{"code":"region.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the region exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a region.

","source":"packages/compute/src/region.js#L113","resources":[],"examples":[{"code":"region.get(function(err, region, apiResponse) {\n // `region` is a Region object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.get().then(function(data) {\n var region = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the region's metadata.

","source":"packages/compute/src/region.js#L138","resources":[{"title":"Region Resource","link":"https://cloud.google.com/compute/docs/reference/v1/regions"},{"title":"Regions: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/regions/get"}],"examples":[{"code":"region.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The region's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"address","name":"address","type":"instance","description":"

Get a reference to a Google Compute Engine address in this region.

","source":"packages/compute/src/region.js#L173","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"}],"examples":[{"code":"var address = region.address('address-name');"}],"params":[{"name":"name","description":"
  • Name of the address.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/address"],"description":""}]},{"id":"createAddress","name":"createAddress","type":"instance","description":"

Create an address in this region.

","source":"packages/compute/src/region.js#L214","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"},{"title":"Address Resource","link":"https://cloud.google.com/compute/docs/reference/v1/addresses"},{"title":"Addresses: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/addresses/insert"}],"examples":[{"code":"function callback(err, address, operation, apiResponse) {\n // `address` is an Address object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nregion.createAddress('new-address', callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.createAddress('new-address').then(function(data) {\n var address = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the address.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.address","description":"
  • The created Address object.
","types":["compute/address"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createSubnetwork","name":"createSubnetwork","type":"instance","description":"

Create a subnetwork in this region.

","source":"packages/compute/src/region.js#L291","resources":[{"title":"Subnetwork Resource","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks#resource"},{"title":"Subnetwork: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks/insert"}],"examples":[{"code":"var config = {\n network: 'network1',\n range: '10.0.1.0/24'\n};\n\nfunction callback(err, subnetwork, operation, apiResponse) {\n // `subnetwork` is a Subnetwork object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nregion.createSubnetwork('new-subnetwork-name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.createSubnetwork('new-subnetwork-name', config).then(function(data) {\n var subnetwork = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the subnetwork.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.network","description":"
  • The network to which this subnetwork belongs. Only networks that are in the distributed mode can have subnetworks.
","types":["compute/network","string"],"optional":false,"nullable":false},{"name":"config.range","description":"
  • The range of internal addresses that are owned by this subnetwork. CIDR range of addresses that are legal on this network. (Alias for config.ipCidrRange)
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.subnetwork","description":"
  • The created Subnetwork object.
","types":["compute/subnetwork"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createRule","name":"createRule","type":"instance","description":"

Create a forwarding rule in this region.

","source":"packages/compute/src/region.js#L383","resources":[{"title":"ForwardingRule Resource","link":"https://cloud.google.com/compute/docs/reference/v1/forwardingRules#resource"},{"title":"ForwardingRules: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/forwardingRules/insert"}],"examples":[{"code":"var name = 'new-rule-name';\n\nvar cfg = {\n target: 'zones/us-central1-a/targetInstances/my-target-instance',\n range: '8080-8089'\n};\n\nregion.createRule(name, cfg, function (err, rule, operation, apiResponse) {\n // `rule` is a Rule object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.createRule(name, cfg).then(function(data) {\n var rule = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the rule.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.ip","description":"
  • The single IP address this forwarding rule will match against. All traffic that matches the IP address, protocol, and ports of this forwarding rule will be handled by this rule. If specified, the IP address must be a static external IP address. To create a new ephemeral external IP address for the forwarding rule, leave this field empty. (Alias for config.IPAddress)
","types":["string"],"optional":true,"nullable":false},{"name":"config.protocol","description":"
  • The type of protocol that this forwarding rule matches. Valid values are AH, ESP, SCTP, TCP, UDP. Default: TCP. (Alias for config.IPProtocol)
","types":["string"],"optional":true,"nullable":false},{"name":"config.range","description":"
  • A single port or single contiguous port range, ranging from low to high for which this forwarding rule matches. Packets of the specified protocol sent to these ports will be forwarded on to the appropriate target pool or target instance. If this field is left empty, then the forwarding matches traffic for all ports for the specified protocol. (Alias for config.portRange)
","types":["string"],"optional":true,"nullable":false},{"name":"config.target","description":"
  • The full or valid partial URL of the target resource to receive the matched traffic.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rule","description":"
  • The created Rule object.
","types":["compute/rule"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getAddresses","name":"getAddresses","type":"instance","description":"

Get a list of addresses in this region.

","source":"packages/compute/src/region.js#L440","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"},{"title":"Addresses: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/addresses/list"}],"examples":[{"code":"region.getAddresses(function(err, addresses) {\n // `addresses` is an array of `Address` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, addresses, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n region.getAddresses(nextQuery, callback);\n }\n}\n\nregion.getAddresses({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.getAddresses().then(function(data) {\n var addresses = data[0];\n});"}],"params":[{"name":"options","description":"
  • Address search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of addresses to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.addresses","description":"
  • Address objects from this region.
","types":["compute/address[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getAddressesStream","name":"getAddressesStream","type":"instance","description":"

Get a list of compute/address objects in this region as a readable object stream.

","source":"packages/compute/src/region.js#L504","resources":[],"examples":[{"code":"region.getAddressesStream()\n .on('error', console.error)\n .on('data', function(address) {\n // `address` is an `Address` object.\n })\n .on('end', function() {\n // All addresses retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"region.getAddressesStream()\n .on('data', function(address) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getOperations","name":"getOperations","type":"instance","description":"

Get a list of operations for this region.

","source":"packages/compute/src/region.js#L560","resources":[{"title":"Region Operation Overview","link":"https://cloud.google.com/compute/docs/reference/v1/regionOperations"},{"title":"RegionOperations: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/regionOperations/list"}],"examples":[{"code":"region.getOperations(function(err, operations) {\n // `operations` is an array of `Operation` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, operations, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n region.getOperations(nextQuery, callback);\n }\n}\n\nregion.getOperations({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.getOperations().then(function(data) {\n var operations = data[0];\n});"}],"params":[{"name":"options","description":"
  • Operation search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of operations to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operations","description":"
  • Operation objects from this region.
","types":["compute/operation[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getOperationsStream","name":"getOperationsStream","type":"instance","description":"

Get a list of compute/operation objects for this region as a readable object stream.

","source":"packages/compute/src/region.js#L624","resources":[],"examples":[{"code":"region.getOperationsStream()\n .on('error', console.error)\n .on('data', function(operation) {\n // `operation` is an `Operation` object.\n })\n .on('end', function() {\n // All operations retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"region.getOperationsStream()\n .on('data', function(operation) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getRules","name":"getRules","type":"instance","description":"

Get a list of forwading rules in this region.

","source":"packages/compute/src/region.js#L679","resources":[{"title":"ForwardingRules: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/forwardingRules/list"}],"examples":[{"code":"region.getRules(function(err, rules) {\n // `rules` is an array of `Rule` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, rules, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n region.getRules(nextQuery, callback);\n }\n}\n\nregion.getRules({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.getRules().then(function(data) {\n var rules = data[0];\n});"}],"params":[{"name":"options","description":"
  • Rules search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of rules to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rules","description":"
  • Rule objects from this region.
","types":["compute/rule[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getRulesStream","name":"getRulesStream","type":"instance","description":"

Get a list of compute/rule objects in this region as a readable object stream.

","source":"packages/compute/src/region.js#L743","resources":[],"examples":[{"code":"region.getRulesStream()\n .on('error', console.error)\n .on('data', function(rule) {\n // `rule` is a `Rule` object.\n })\n .on('end', function() {\n // All rules retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"region.getRulesStream()\n .on('data', function(rule) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getSubnetworks","name":"getSubnetworks","type":"instance","description":"

Get a list of subnetworks in this region.

","source":"packages/compute/src/region.js#L798","resources":[{"title":"Subnetworks Overview","link":"https://cloud.google.com/compute/docs/subnetworks"},{"title":"Subnetworks: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks"}],"examples":[{"code":"region.getSubnetworks(function(err, subnetworks) {\n // `subnetworks` is an array of `Subnetwork` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, subnetworks, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n region.getSubnetworks(nextQuery, callback);\n }\n}\n\nregion.getSubnetworks({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"region.getSubnetworks().then(function(data) {\n var subnetworks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Subnetwork search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of subnetworks to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.subnetworks","description":"
  • Subnetwork objects from this region.
","types":["compute/subnetwork[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSubnetworksStream","name":"getSubnetworksStream","type":"instance","description":"

Get a list of compute/subnetwork objects in this region as a readable object stream.

","source":"packages/compute/src/region.js#L862","resources":[],"examples":[{"code":"region.getSubnetworksStream()\n .on('error', console.error)\n .on('data', function(subnetwork) {\n // `subnetwork` is a `Subnetwork` object.\n })\n .on('end', function() {\n // All subnetworks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"region.getSubnetworksStream()\n .on('data', function(subnetwork) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"operation","name":"operation","type":"instance","description":"

Get a reference to a Google Compute Engine region operation.

","source":"packages/compute/src/region.js#L876","resources":[{"title":"Region Operation Overview","link":"https://cloud.google.com/compute/docs/reference/v1/regionOperations"}],"examples":[{"code":"var operation = region.operation('operation-name');"}],"params":[{"name":"name","description":"
  • Name of the existing operation.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/operation"],"description":""}]},{"id":"rule","name":"rule","type":"instance","description":"

Get a reference to a Google Compute Engine forwarding rule in this region.

","source":"packages/compute/src/region.js#L889","resources":[],"examples":[{"code":"var rule = region.rule('rule-name');"}],"params":[{"name":"name","description":"
  • Name of the rule.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/rule"],"description":""}]},{"id":"subnetwork","name":"subnetwork","type":"instance","description":"

Get a reference to a Google Compute Engine subnetwork in this region.

","source":"packages/compute/src/region.js#L904","resources":[{"title":"Subnetworks Overview","link":"https://cloud.google.com/compute/docs/subnetworks"}],"examples":[{"code":"var subnetwork = region.subnetwork('subnetwork-name');"}],"params":[{"name":"name","description":"
  • Name of the subnetwork.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/subnetwork"],"description":""}]}],"path":"region.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/rule.json b/json/google-cloud/v0.51.1/compute/rule.json new file mode 100644 index 00000000000..aa2cbff3cad --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/rule.json @@ -0,0 +1 @@ +{"id":"compute/rule","type":"class","name":"Rule","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/rule.js","parent":"compute","children":[],"methods":[{"id":"Rule","name":"Rule","type":"constructor","description":"

Forwarding rules work in conjunction with target pools and target instances to support load balancing and protocol forwarding features. To use load balancing and protocol forwarding, you must create a forwarding rule that directs traffic to specific target pools (for load balancing) or target instances (for protocol forwarding).

","source":"packages/compute/src/rule.js#L56","resources":[{"title":"Forwarding rules","link":"https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules"}],"examples":[{"caption":"

Reference a global rule.

","code":"var rule = gce.rule('rule-name');"},{"caption":"

Reference a region rule.

","code":"var region = gce.region('us-central1');\nvar rule = region.rule('rule-name');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a forwarding rule.

","source":"packages/compute/src/rule.js#L91","resources":[],"examples":[{"code":"var config = {\n // `target` will be different depending of this is a Regional or Global\n // forwarding rule\n target: 'global/targetHttpProxies/my-proxy',\n portRange: '8080-8089'\n};\n\nrule.create(config, function(err, rule, operation, apiResponse) {\n // `rule` is a Rule object.\n\n // `operation` is an Operation object that can be used to check the\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"rule.create(config).then(function(data) {\n var rule = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the forwarding rule exists.

","source":"packages/compute/src/rule.js#L111","resources":[],"examples":[{"code":"rule.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"rule.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the rule exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a forwarding rule if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/rule.js#L138","resources":[],"examples":[{"code":"rule.get(function(err, rule, apiResponse) {\n // `rule` is a Rule object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"rule.get().then(function(data) {\n var rule = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata of this rule.

","source":"packages/compute/src/rule.js#L165","resources":[{"title":"GlobalForwardingRule Resource","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules#resource"},{"title":"ForwardingRule Resource","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules#resource"},{"title":"GlobalForwardingRules: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/get"},{"title":"ForwardingRules: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/forwardingRules/get"}],"examples":[{"code":"rule.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"rule.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The rule's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the rule.

","source":"packages/compute/src/rule.js#L207","resources":[{"title":"GlobalForwardingRules: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/delete"},{"title":"ForwardingRules: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/forwardingRules/delete"}],"examples":[{"code":"rule.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"rule.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setTarget","name":"setTarget","type":"instance","description":"

Set the target for this forwarding rule.

","source":"packages/compute/src/rule.js#L254","resources":[{"title":"GlobalForwardingRules: setTarget API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/setTarget"},{"title":"ForwardingRules: setTarget API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/forwardingRules/setTarget"}],"examples":[{"code":"rule.setTarget('new-target', function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"rule.setTarget('new-target').then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"target","description":"
  • The full or valid partial URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy resource.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"rule.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/service.json b/json/google-cloud/v0.51.1/compute/service.json new file mode 100644 index 00000000000..528bd47676b --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/service.json @@ -0,0 +1 @@ +{"id":"compute/service","type":"class","name":"Service","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/service.js","parent":"compute","children":[],"methods":[{"id":"Service","name":"Service","type":"constructor","description":"

An HTTP(S) load balancing backend service is a centralized service for managing backends, which in turn manage instances that handle user requests. You configure your load balancing service to route requests to your backend service. The backend service in turn knows which instances it can use, how much traffic they can handle, and how much traffic they are currently handling. In addition, the backend service monitors health checking and does not send traffic to unhealthy instances.

","source":"packages/compute/src/service.js#L52","resources":[{"title":"Backend Services Overview","link":"https://cloud.google.com/compute/docs/load-balancing/http/backend-service"}],"examples":[{"code":"var service = gce.service('service-name');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a backend service.

","source":"packages/compute/src/service.js#L87","resources":[],"examples":[{"code":"var config = {\n backends: [\n {\n group: 'URL of an Instance Group resource'\n }\n ],\n healthChecks: [\n 'URL of an HTTP/HTTPS health check resource'\n ]\n};\n\nservice.create(config, function(err, service, operation, apiResponse) {\n // `service` is a Service object.\n\n // `operation` is an Operation object that can be used to check the\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"service.create(config).then(function(data) {\n var service = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the backend service exists.

","source":"packages/compute/src/service.js#L108","resources":[],"examples":[{"code":"service.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"service.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the backend service exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a Service object if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/service.js#L135","resources":[],"examples":[{"code":"service.get(function(err, service, apiResponse) {\n // `service` is a Service object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"service.get().then(function(data) {\n var service = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata of this backend service.

","source":"packages/compute/src/service.js#L160","resources":[{"title":"BackendService Resource","link":"https://cloud.google.com/compute/docs/reference/v1/backendServices#resource"},{"title":"BackendService: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/backendServices/get"}],"examples":[{"code":"service.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"service.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The service's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the backend service.

","source":"packages/compute/src/service.js#L202","resources":[{"title":"BackendServices: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/backendServices/delete"}],"examples":[{"code":"service.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"service.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getHealth","name":"getHealth","type":"instance","description":"

Get the most recent health check results.

","source":"packages/compute/src/service.js#L263","resources":[{"title":"BackendServices: getHealth API Documentation","link":"https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth"}],"examples":[{"code":"var group = {\n name: 'instance-group-name',\n zone: 'us-central1-a'\n};\n\nservice.getHealth(group, function(err, status, apiResponse) {\n if (!err) {\n // status = [\n // {\n // ipAddress: '...',\n // instance: '...',\n // healthState: '...',\n // port: '...'\n // }\n // ]\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"service.getHealth(group).then(function(data) {\n var status = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"group","description":"
  • The fully-qualified URL of an Instance Group resource.
","types":["string","object"],"optional":false,"nullable":false},{"name":"group.name","description":"
  • The name of the Instance Group resource.
","types":["string"],"optional":false,"nullable":false},{"name":"group.zone","description":"
  • The name of the zone or a Zone object.
","types":["compute/zone","string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.status","description":"
  • A list of health checks and their corresponding status.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the backend service's metadata.

","source":"packages/compute/src/service.js#L320","resources":[{"title":"BackendService Resource","link":"https://cloud.google.com/compute/docs/reference/v1/backendServices#resource"}],"examples":[{"code":"var metadata = {\n description: 'New description'\n};\n\nservice.setMetadata(metadata, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"service.setMetadata(metadata).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"service.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/snapshot.json b/json/google-cloud/v0.51.1/compute/snapshot.json new file mode 100644 index 00000000000..087e77206ef --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/snapshot.json @@ -0,0 +1 @@ +{"id":"compute/snapshot","type":"class","name":"Snapshot","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/snapshot.js","parent":"compute","children":[],"methods":[{"id":"Snapshot","name":"Snapshot","type":"constructor","description":"

A Snapshot object allows you to interact with a Google Compute Engine snapshot.

","source":"packages/compute/src/snapshot.js#L51","resources":[{"title":"Snapshots Overview","link":"https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots"},{"title":"Snapshot Resource","link":"https://cloud.google.com/compute/docs/reference/v1/snapshots"}],"examples":[{"code":"var snapshot = gce.snapshot('snapshot-name');"},{"caption":"

Or, access through a disk.

","code":"var disk = gce.zone('us-central1-a').disk('disk-name');\nvar snapshot = disk.snapshot('disk-snapshot-name');"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the snapshot exists.

","source":"packages/compute/src/snapshot.js#L66","resources":[],"examples":[{"code":"snapshot.exists(function(err, exists) {});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the snapshot exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a snapshot if it exists.

If you access this snapshot through a Disk object, this can be used as a "get or create" method. Pass an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/snapshot.js#L93","resources":[],"examples":[{"code":"snapshot.get(function(err, snapshot, apiResponse) {\n // `snapshot` is a Snapshot object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"snapshot.get().then(function(data) {\n var snapshot = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the snapshot's metadata.

","source":"packages/compute/src/snapshot.js#L118","resources":[{"title":"Snapshot Resource","link":"https://cloud.google.com/compute/docs/reference/v1/snapshots"},{"title":"Snapshots: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/snapshots/get"}],"examples":[{"code":"snapshot.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"snapshot.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The snapshot's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a snapshot.

This is only available if you accessed this object through compute/disk#snapshot.

","source":"packages/compute/src/snapshot.js#L157","resources":[],"examples":[{"code":"snapshot.create(function(err, snapshot, operation, apiResponse) {\n // `snapshot` is a Snapshot object.\n\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"snapshot.create().then(function(data) {\n var snapshot = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the snapshot.

","source":"packages/compute/src/snapshot.js#L193","resources":[{"title":"Snapshots: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/snapshots/delete"}],"examples":[{"code":"snapshot.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"snapshot.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"snapshot.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/subnetwork.json b/json/google-cloud/v0.51.1/compute/subnetwork.json new file mode 100644 index 00000000000..41033554f00 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/subnetwork.json @@ -0,0 +1 @@ +{"id":"compute/subnetwork","type":"class","name":"Subnetwork","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/subnetwork.js","parent":"compute","children":[],"methods":[{"id":"Subnetwork","name":"Subnetwork","type":"constructor","description":"

An Subnetwork object allows you to interact with a Google Compute Engine subnetwork.

","source":"packages/compute/src/subnetwork.js#L46","resources":[{"title":"Subnetworks Overview","link":"https://cloud.google.com/compute/docs/subnetworks"},{"title":"Subnetwork Resource","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks"}],"examples":[{"code":"var region = gce.region('region-name');\n\nvar subnetwork = region.subnetwork('subnetwork1');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a subnetwork.

","source":"packages/compute/src/subnetwork.js#L79","resources":[],"examples":[{"code":"var config = {\n // ...\n};\n\nfunction callback(err, subnetwork, operation, apiResponse) {\n // `subnetwork` is a Subnetwork object.\n\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n}\n\nsubnetwork.create(config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subnetwork.create(config).then(function(data) {\n var subnetwork = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the subnetwork exists.

","source":"packages/compute/src/subnetwork.js#L99","resources":[],"examples":[{"code":"subnetwork.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subnetwork.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the subnetwork exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a subnetwork if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/subnetwork.js#L126","resources":[],"examples":[{"code":"subnetwork.get(function(err, subnetwork, apiResponse) {\n // `subnetwork` is a Subnetwork object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subnetwork.get().then(function(data) {\n var subnetwork = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata of this subnetwork.

","source":"packages/compute/src/subnetwork.js#L151","resources":[{"title":"Subnetwork Resource","link":"https://cloud.google.com/compute/docs/reference/v1/subnetwork"},{"title":"Subnetwork: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/subnetwork/get"}],"examples":[{"code":"subnetwork.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subnetwork.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The subnetwork's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the subnetwork.

","source":"packages/compute/src/subnetwork.js#L190","resources":[{"title":"Subnetworks: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/subnetworks/delete"}],"examples":[{"code":"subnetwork.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subnetwork.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"subnetwork.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/vm.json b/json/google-cloud/v0.51.1/compute/vm.json new file mode 100644 index 00000000000..bb494376d1e --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/vm.json @@ -0,0 +1 @@ +{"id":"compute/vm","type":"class","name":"VM","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/vm.js","parent":"compute","children":[],"methods":[{"id":"VM","name":"VM","type":"constructor","description":"

An Instance object allows you to interact with a Google Compute Engine instance.

","source":"packages/compute/src/vm.js#L99","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"},{"title":"Instance Resource","link":"https://cloud.google.com/compute/docs/reference/v1/instances"}],"examples":[{"code":"var zone = gce.zone('zone-name');\n\nvar vm = zone.vm('vm-name');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a virtual machine.

","source":"packages/compute/src/vm.js#L140","resources":[],"examples":[{"code":"var config = {\n // ...\n};\n\nvm.create(config, function(err, vm, operation, apiResponse) {\n // `vm` is a VM object.\n\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.create(config).then(function(data) {\n var vm = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the vm exists.

","source":"packages/compute/src/vm.js#L160","resources":[],"examples":[{"code":"vm.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the vm exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a virtual machine if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/compute/src/vm.js#L187","resources":[],"examples":[{"code":"vm.get(function(err, vm, apiResponse) {\n // `vm` is a VM object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.get().then(function(data) {\n var vm = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the instance's metadata.

","source":"packages/compute/src/vm.js#L212","resources":[{"title":"Instance Resource","link":"https://cloud.google.com/compute/docs/reference/v1/instances"},{"title":"Instance: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/get"}],"examples":[{"code":"vm.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The instance's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"attachDisk","name":"attachDisk","type":"instance","description":"

Attach a disk to the instance.

","source":"packages/compute/src/vm.js#L275","resources":[{"title":"Disks Overview","link":"https://cloud.google.com/compute/docs/disks"},{"title":"Disk Resource","link":"https://cloud.google.com/compute/docs/reference/v1/disks"},{"title":"Instance: attachDisk API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/attachDisk"}],"examples":[{"code":"var disk = zone.disk('my-disk');\n\nfunction callback(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nvm.attachDisk(disk, callback);"},{"caption":"

Provide an options object to customize the request.

","code":"var options = {\n autoDelete: true,\n readOnly: true\n};\n\nvm.attachDisk(disk, options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.attachDisk(disk, options).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"disk","description":"
  • The disk to attach.
","types":["compute/disk"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.readOnly","description":"
  • Attach the disk in read-only mode. (Alias for options.mode = READ_ONLY)
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

if a compute/disk is not provided.

"}],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the instance.

","source":"packages/compute/src/vm.js#L329","resources":[{"title":"Instance: delete API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/delete"}],"examples":[{"code":"vm.delete(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.delete().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detachDisk","name":"detachDisk","type":"instance","description":"

Detach a disk from the instance.

","source":"packages/compute/src/vm.js#L366","resources":[{"title":"Instance: detachDisk API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/detachDisk"}],"examples":[{"code":"var disk = zone.disk('my-disk');\n\nvm.detachDisk(disk, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.detachDisk(disk).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"deviceName","description":"
  • The device name of the disk to detach. If a Disk object is provided, we try to find the device name automatically by searching through the attached disks on the instance.
","types":["compute/disk","string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSerialPortOutput","name":"getSerialPortOutput","type":"instance","description":"

Returns the serial port output for the instance.

","source":"packages/compute/src/vm.js#L437","resources":[{"title":"Instances: getSerialPortOutput API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/getSerialPortOutput"}],"examples":[{"code":"vm.getSerialPortOutput(function(err, output, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.getSerialPortOutput().then(function(data) {\n var output = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"port","description":"
  • The port from which the output is retrieved (1-4). Default: 1.
","types":["number"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.output","description":"
  • The output from the port.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getTags","name":"getTags","type":"instance","description":"

Get the instance's tags and their fingerprint.

This method wraps compute/vm#getMetadata, returning only the tags property.

","source":"packages/compute/src/vm.js#L486","resources":[],"examples":[{"code":"vm.getTags(function(err, tags, fingerprint, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.getTags().then(function(data) {\n var tags = data[0];\n var fingerprint = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.tags","description":"
  • Tag objects from this VM.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.fingerprint","description":"
  • The current tag fingerprint.
","types":["string"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"reset","name":"reset","type":"instance","description":"

Reset the instance.

","source":"packages/compute/src/vm.js#L522","resources":[{"title":"Instances: reset API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/reset"}],"examples":[{"code":"vm.reset(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.reset().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"resize","name":"resize","type":"instance","description":"

Set the machine type for this instance, stopping and restarting the VM as necessary.

For a list of the standard, high-memory, and high-CPU machines you may choose from, see Predefined machine types\">https://cloud.google.com/compute/docs/machine-types#predefined_machine_types}.

In order to change the machine type, the VM must not be running. This method will automatically stop the VM if it is running before changing the machine type. After it is sucessfully changed, the VM will be started.

","source":"packages/compute/src/vm.js#L583","resources":[{"title":"Instances: setMachineType API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/setMachineType"},{"title":"Predefined machine types","link":"https://cloud.google.com/compute/docs/machine-types#predefined_machine_types"}],"examples":[{"code":"vm.resize('n1-standard-1', function(err, apiResponse) {\n if (!err) {\n // The VM is running and its machine type was changed successfully.\n }\n});"},{"caption":"

By default, calling resize will start your server after updating its \nmachine type. If you want to leave it stopped, set options.start to \nfalse.

","code":"var options = {\n start: false\n};\n\nvm.resize('ns-standard-1', options, function(err, apiResponse) {\n if (!err) {\n // The VM is stopped and its machine type was changed successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.resize('ns-standard-1', options).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"machineType","description":"
  • Full or partial machine type. See a list of predefined machine types here.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.start","description":"
  • Start the VM after successfully updating the machine type. Default: false.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the metadata for this instance.

","source":"packages/compute/src/vm.js#L667","resources":[{"title":"Instances: setMetadata API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/setMetadata"}],"examples":[{"code":"var metadata = {\n 'startup-script': '...'\n};\n\nvm.setMetadata(metadata, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.setMetadata(metadata).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":"
  • New metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setTags","name":"setTags","type":"instance","description":"

Set the instance's tags.

","source":"packages/compute/src/vm.js#L739","resources":[{"title":"Instances: setTags API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/setTags"}],"examples":[{"code":"vm.getTags(function(err, tags, fingerprint) {\n tags.push('new-tag');\n\n vm.setTags(tags, fingerprint, function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the\n // status of the request.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.getTags().then(function(data) {\n var tags = data[0];\n var fingerprint = data[1];\n\n tags.push('new-tag');\n\n return vm.setTags(tags, fingerprint);\n}).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"tags","description":"
  • The new tags for the instance.
","types":["string[]"],"optional":false,"nullable":false},{"name":"fingerprint","description":"
  • The current tags fingerprint. An up-to-date fingerprint must be provided.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"start","name":"start","type":"instance","description":"

Start the instance.

","source":"packages/compute/src/vm.js#L777","resources":[{"title":"Instances: start API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/start"}],"examples":[{"code":"vm.start(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.start().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"stop","name":"stop","type":"instance","description":"

Stop the instance.

","source":"packages/compute/src/vm.js#L809","resources":[{"title":"Instances: stop API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/stop"}],"examples":[{"code":"vm.stop(function(err, operation, apiResponse) {\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.stop().then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"waitFor","name":"waitFor","type":"instance","description":"

This function will callback when the VM is in the specified state.

Will time out after the specified time (default: 300 seconds).

","source":"packages/compute/src/vm.js#L867","resources":[],"examples":[{"code":"vm.waitFor('RUNNING', function(err, metadata) {\n if (!err) {\n // The VM is running.\n }\n});"},{"caption":"

By default, waitFor will timeout after 300 seconds while waiting for the \ndesired state to occur. This can be changed to any number between 0 and \n600. If the timeout is set to 0, it will poll once for status and then \ntimeout if the desired state is not reached.

","code":"var options = {\n timeout: 600\n};\n\nvm.waitFor('TERMINATED', options, function(err, metadata) {\n if (!err) {\n // The VM is terminated.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vm.waitFor('RUNNING', options).then(function(data) {\n var metadata = data[0];\n});"}],"params":[{"name":"status","description":"
  • The status to wait for. This can be: - "PROVISIONING"
    • "STAGING"
    • "RUNNING"
    • "STOPPING"
    • "SUSPENDING"
    • "SUSPENDED"
    • "TERMINATED"
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.timeout","description":"
  • The number of seconds to wait until timing out, between 0 and 600. Default: 300
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while waiting for the status.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The instance's metadata.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"vm.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/compute/zone.json b/json/google-cloud/v0.51.1/compute/zone.json new file mode 100644 index 00000000000..4b650a61775 --- /dev/null +++ b/json/google-cloud/v0.51.1/compute/zone.json @@ -0,0 +1 @@ +{"id":"compute/zone","type":"class","name":"Zone","overview":"

\n This class allows you interact with Compute Engine.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/compute.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/compute/src/zone.js","parent":"compute","children":[],"methods":[{"id":"Zone","name":"Zone","type":"constructor","description":"

A Zone object allows you to interact with a Google Compute Engine zone.

","source":"packages/compute/src/zone.js#L85","resources":[{"title":"Regions & Zones Overview","link":"https://cloud.google.com/compute/docs/zones"},{"title":"Zone Resource","link":"https://cloud.google.com/compute/docs/reference/v1/zones"}],"examples":[{"code":"var zone = gce.zone('us-central1-a');"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the zone exists.

","source":"packages/compute/src/zone.js#L105","resources":[],"examples":[{"code":"zone.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the zone exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a zone.

","source":"packages/compute/src/zone.js#L123","resources":[],"examples":[{"code":"zone.get(function(err, zone, apiResponse) {\n // `zone` is a Zone object.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.get().then(function(data) {\n var zone = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the zone's metadata.

","source":"packages/compute/src/zone.js#L148","resources":[{"title":"Zone Resource","link":"https://cloud.google.com/compute/docs/reference/v1/zones"},{"title":"Zones: get API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/zones/get"}],"examples":[{"code":"zone.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The zone's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"autoscaler","name":"autoscaler","type":"instance","description":"

Get a reference to a Google Compute Engine autoscaler in this zone.

","source":"packages/compute/src/zone.js#L177","resources":[],"examples":[{"code":"var autoscaler = zone.autoscaler('autoscaler-name');"}],"params":[{"name":"name","description":"
  • Name of the autoscaler.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/autoscaler"],"description":""}]},{"id":"createAutoscaler","name":"createAutoscaler","type":"instance","description":"

Create an autoscaler in this zone.

","source":"packages/compute/src/zone.js#L246","resources":[{"title":"Load Balancing and Scaling","link":"https://cloud.google.com/compute/docs/load-balancing-and-autoscaling"},{"title":"Autoscaler Resource","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers"},{"title":"Autoscalers: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers/insert"}],"examples":[{"code":"var config = {\n coolDown: 30,\n cpu: 80,\n loadBalance: 40,\n maxReplicas: 5,\n minReplicas: 0,\n target: 'instance-group-manager-1'\n};\n\nfunction callback(err, autoscaler, operation, apiResponse) {\n // `autoscaler` is an Autoscaler object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nzone.createAutoscaler('name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.createAutoscaler('name', config).then(function(data) {\n var autoscaler = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the autoscaler.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.coolDown","description":"
  • The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. Alias for config.autoscalingPolicy.coolDownPeriodSec.
","types":["number"],"optional":false,"nullable":false},{"name":"config.cpu","description":"
  • The target CPU utilization that the autoscaler should maintain, between 1 - 100. Alias for config.autoscalingPolicy.cpuUtilization.utilizationTarget.
","types":["number"],"optional":false,"nullable":false},{"name":"config.loadBalance","description":"
  • Backend capacity utilization that autoscaler should maintain, between 1 - 100. Alias for config.autoscalingPolicy.loadBalancingUtilization.utilizationTarget.
","types":["number"],"optional":false,"nullable":false},{"name":"config.maxReplicas","description":"
  • The maximum number of instances that the autoscaler can scale up to. Alias for config.autoscalingPolicy.maxNumReplicas.
","types":["number"],"optional":false,"nullable":false},{"name":"config.minReplicas","description":"
  • The minimum number of replicas that the autoscaler can scale down to. Alias for config.autoscalingPolicy.minNumReplicas.
","types":["number"],"optional":false,"nullable":false},{"name":"config.target","description":"
  • The name of the managed instance group that this autoscaler will scale.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.autoscaler","description":"
  • The created Autoscaler object.
","types":["compute/autoscaler"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If config.target is not provided.

"}],"returns":[]},{"id":"createDisk","name":"createDisk","type":"instance","description":"

Create a persistent disk in this zone.

","source":"packages/compute/src/zone.js#L371","resources":[{"title":"Disk Resource","link":"https://cloud.google.com/compute/docs/reference/v1/disks"},{"title":"Disks: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/disks/insert"}],"examples":[{"caption":"

Create a persistent disk using the latest Ubuntu version \nas the source image.

","code":"var config = {\n os: 'ubuntu',\n sizeGb: 10\n};"},{"caption":"

Create a persistent disk using the latest Ubuntu version from your project \nas the source image.

","code":"var config = {\n os: 'your-project-id-or-name/ubuntu',\n sizeGb: 10\n};\n\nzone.createDisk('name', config, function(err, disk, operation, apiResponse) {\n // `disk` is a Disk object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.createDisk('name', config).then(function(data) {\n var disk = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the disk.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.os","description":" ","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.disk","description":"
  • The created Disk object.
","types":["compute/disk"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createInstanceGroup","name":"createInstanceGroup","type":"instance","description":"

Create an instance group in this zone.

","source":"packages/compute/src/zone.js#L457","resources":[{"title":"InstanceGroup Resource","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups#resource"},{"title":"InstanceGroups: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/insert"}],"examples":[{"code":"function onCreated(err, instanceGroup, operation, apiResponse) {\n // `instanceGroup` is an InstanceGroup object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nzone.createInstanceGroup('instance-group-name', onCreated);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.createInstanceGroup('instance-group-name', config).then(function(data) {\n var instanceGroup = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the instance group.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"options.ports","description":"
  • A map of names to ports. The key should be the name, and the value the port number. Maps to options.namedPorts.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instanceGroup","description":"
  • The created InstanceGroup object.
","types":["compute/instance-group"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createVM","name":"createVM","type":"instance","description":"

Create a virtual machine in this zone.

","source":"packages/compute/src/zone.js#L595","resources":[{"title":"Instance Resource","link":"https://cloud.google.com/compute/docs/reference/v1/instances"},{"title":"Instances: insert API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/insert"}],"examples":[{"caption":"

Create a new instance using the latest Debian version from your project \nas the source image for a new boot disk.

","code":"var config = {\n os: 'your-project-id-or-name/debian',\n http: true,\n tags: ['debian-server']\n};"},{"caption":"

Create a new instance using the latest Debian version as the source image \nfor a new boot disk.

","code":"var config = {\n os: 'debian',\n http: true,\n tags: ['debian-server']\n};"},{"caption":"

The above object will auto-expand behind the scenes to something like the \nfollowing. The Debian version may be different when you run the command.

","code":"var config = {\n machineType: 'n1-standard-1',\n disks: [\n {\n boot: true,\n initializeParams: {\n sourceImage:\n 'https://www.googleapis.com/compute/v1/projects' +\n '/debian-cloud/global/images/debian-7-wheezy-v20150710'\n }\n }\n ],\n networkInterfaces: [\n {\n network: 'global/networks/default'\n }\n ],\n tags: [\n {\n items: [\n 'debian-server',\n 'http-server'\n ]\n }\n ]\n};\n\nfunction callback(err, vm, operation, apiResponse) {\n // `vm` is a VM object.\n\n // `operation` is an Operation object that can be used to check the status\n // of the request.\n}\n\nzone.createVM('new-vm-name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.createVM('new-vm-name', config).then(function(data) {\n var vm = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n});"}],"params":[{"name":"name","description":"
  • Name of the instance.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.disks","description":" ","types":["object[]"],"optional":true,"nullable":false},{"name":"config.http","description":"
  • Allow HTTP traffic. Default: false
","types":["boolean"],"optional":true,"nullable":false},{"name":"config.https","description":"
  • Allow HTTPS traffic. Default: false
","types":["boolean"],"optional":true,"nullable":false},{"name":"config.networkInterfaces","description":"
  • An array of configurations for this interface. This specifies how this interface should interact with other network services, such as connecting to the internet. Default: [ { network: 'global/networks/default' } ]
","types":["object[]"],"optional":true,"nullable":false},{"name":"config.machineType","description":"
  • The machine type resource to use. Provide only the name of the machine, e.g. n1-standard-16. Refer to Available Machine Types. Default: n1-standard-1
","types":["string"],"optional":true,"nullable":false},{"name":"config.os","description":" ","types":["string"],"optional":true,"nullable":false},{"name":"config.tags","description":"
  • An array of tags.
","types":["string[]"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.vm","description":"
  • The created VM object.
","types":["compute/vm"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"disk","name":"disk","type":"instance","description":"

Get a reference to a Google Compute Engine disk in this zone.

","source":"packages/compute/src/zone.js#L723","resources":[{"title":"Disks Overview","link":"https://cloud.google.com/compute/docs/disks"}],"examples":[{"code":"var disk = zone.disk('disk1');"}],"params":[{"name":"name","description":"
  • Name of the disk.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/disk"],"description":""}]},{"id":"getAutoscalers","name":"getAutoscalers","type":"instance","description":"

Get a list of autoscalers from this zone.

","source":"packages/compute/src/zone.js#L781","resources":[{"title":"Managing Autoscalers","link":"https://cloud.google.com/compute/docs/autoscaler/managing-autoscalers"},{"title":"Understanding Autoscaler Decisions","link":"https://cloud.google.com/compute/docs/autoscaler/understanding-autoscaler-decisions"},{"title":"Autoscalers: aggregatedList API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/autoscalers/list"}],"examples":[{"code":"zone.getAutoscalers(function(err, autoscalers) {\n // autoscalers is an array of `Autoscaler` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, autoscalers, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n zone.getAutoscalers(nextQuery, callback);\n }\n}\n\nzone.getAutoscalers({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getAutoscalers().then(function(data) {\n var autoscalers = data[0];\n});"}],"params":[{"name":"options","description":"
  • Autoscaler search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of autoscalers to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.autoscalers","description":"
  • Autoscaler objects from your project.
","types":["compute/autoscaler[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getAutoscalersStream","name":"getAutoscalersStream","type":"instance","description":"

Get a list of compute/autoscaler objects from this zone as a readable object stream.

","source":"packages/compute/src/zone.js#L846","resources":[],"examples":[{"code":"zone.getAutoscalersStream()\n .on('error', console.error)\n .on('data', function(autoscaler) {\n // `autoscaler` is an `Autoscaler` object.\n })\n .on('end', function() {\n // All autoscalers retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getAutoscalersStream()\n .on('data', function(autoscaler) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getDisks","name":"getDisks","type":"instance","description":"

Get a list of disks in this zone.

","source":"packages/compute/src/zone.js#L901","resources":[{"title":"Disks Overview","link":"https://cloud.google.com/compute/docs/disks"},{"title":"Disks: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/disks/list"}],"examples":[{"code":"zone.getDisks(function(err, disks) {\n // `disks` is an array of `Disk` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, disks, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n zone.getDisks(nextQuery, callback);\n }\n}\n\nzone.getDisks({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getDisks().then(function(data) {\n var disks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Disk search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of disks to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.disks","description":"
  • Disk objects from this zone.
","types":["compute/disk[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getDisksStream","name":"getDisksStream","type":"instance","description":"

Get a list of compute/disk objects in this zone as a readable object stream.

","source":"packages/compute/src/zone.js#L965","resources":[],"examples":[{"code":"zone.getDisksStream()\n .on('error', console.error)\n .on('data', function(disk) {\n // `disk` is a `Disk` object.\n })\n .on('end', function() {\n // All disks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getDisksStream()\n .on('data', function(disk) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getInstanceGroups","name":"getInstanceGroups","type":"instance","description":"

Get a list of instance groups for this zone.

","source":"packages/compute/src/zone.js#L1021","resources":[{"title":"InstanceGroups Overview","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups"},{"title":"InstanceGroups: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups/list"}],"examples":[{"code":"zone.getInstanceGroups(function(err, instanceGroups) {\n // `instanceGroups` is an array of `InstanceGroup` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, instanceGroups, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n zone.getInstanceGroups(nextQuery, callback);\n }\n}\n\nzone.getInstanceGroups({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getInstanceGroups().then(function(data) {\n var instanceGroups = data[0];\n});"}],"params":[{"name":"options","description":"
  • Instance group search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of instance groups to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instanceGroups","description":"
  • InstanceGroup objects from this zone.
","types":["compute/instance-group[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getInstanceGroupsStream","name":"getInstanceGroupsStream","type":"instance","description":"

Get a list of compute/instanceGroup objects for this zone as a readable object stream.

","source":"packages/compute/src/zone.js#L1085","resources":[],"examples":[{"code":"zone.getInstanceGroupsStream()\n .on('error', console.error)\n .on('data', function(instanceGroup) {\n // `instanceGroup` is an `InstanceGroup` object.\n })\n .on('end', function() {\n // All instance groups retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getInstanceGroupsStream()\n .on('data', function(instanceGroup) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getMachineTypes","name":"getMachineTypes","type":"instance","description":"

Get a list of machine types for this zone.

","source":"packages/compute/src/zone.js#L1136","resources":[{"title":"MachineTypes: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes/list"},{"title":"Machine Types Overview","link":"https://cloud.google.com/compute/docs/machine-types"},{"title":"MachineType Resource","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes"}],"examples":[{"code":"zone.getMachineTypes(function(err, machineTypes) {\n // `machineTypes` is an array of `MachineType` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, machineTypes, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n zone.getMachineTypes(nextQuery, callback);\n }\n}\n\nzone.getMachineTypes({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getMachineTypes().then(function(data) {\n var machineTypes = data[0];\n});"}],"params":[{"name":"options","description":"
  • Machine type search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of machineTypes to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.machineTypes","description":"
  • MachineType objects from this zone.
","types":["compute/machine-type[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMachineTypesStream","name":"getMachineTypesStream","type":"instance","description":"

Get a list of compute/machineType objects for this zone as a readable object stream.

","source":"packages/compute/src/zone.js#L1176","resources":[],"examples":[{"code":"zone.getMachineTypesStream()\n .on('error', console.error)\n .on('data', function(machineType) {\n // `machineType` is a `MachineType` object.\n })\n .on('end', function() {\n // All machine types retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getMachineTypesStream()\n .on('data', function(machineType) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getOperations","name":"getOperations","type":"instance","description":"

Get a list of operations for this zone.

","source":"packages/compute/src/zone.js#L1232","resources":[{"title":"Zone Operation Overview","link":"https://cloud.google.com/compute/docs/reference/v1/zoneOperations"},{"title":"ZoneOperations: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/zoneOperations/list"}],"examples":[{"code":"zone.getOperations(function(err, operations) {\n // `operations` is an array of `Operation` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, operations, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n zone.getOperations(nextQuery, callback);\n }\n}\n\nzone.getOperations({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getOperations().then(function(data) {\n var operations = data[0];\n});"}],"params":[{"name":"options","description":"
  • Operation search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of operations to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operations","description":"
  • Operation objects from this zone.
","types":["compute/operation[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getOperationsStream","name":"getOperationsStream","type":"instance","description":"

Get a list of compute/operation objects for this zone as a readable object stream.

","source":"packages/compute/src/zone.js#L1296","resources":[],"examples":[{"code":"zone.getOperationsStream()\n .on('error', console.error)\n .on('data', function(operation) {\n // `operation` is an `Operation` object.\n })\n .on('end', function() {\n // All operations retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getOperationsStream()\n .on('data', function(operation) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getVMs","name":"getVMs","type":"instance","description":"

Get a list of VM instances in this zone.

","source":"packages/compute/src/zone.js#L1349","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"},{"title":"Instances: list API Documentation","link":"https://cloud.google.com/compute/docs/reference/v1/instances/list"}],"examples":[{"code":"zone.getVMs(function(err, vms) {\n // `vms` is an array of `VM` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, vms, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n zone.getVMs(nextQuery, callback);\n }\n}\n\nzone.getVMs({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getVMs().then(function(data) {\n var vms = data[0];\n});"}],"params":[{"name":"options","description":"
  • Instance search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • Search filter in the format of {name} {comparison} {filterString}.
    • name: the name of the field to compare
    • comparison: the comparison operator, eq (equal) or ne (not equal)
    • filterString: the string to filter to. For string fields, this can be a regular expression.
","types":["string"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.vms","description":"
  • VM objects from this zone.
","types":["compute/vm[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getVMsStream","name":"getVMsStream","type":"instance","description":"

Get a list of compute/vm instances in this zone as a readable object stream.

","source":"packages/compute/src/zone.js#L1413","resources":[],"examples":[{"code":"zone.getVMsStream()\n .on('error', console.error)\n .on('data', function(vm) {\n // `vm` is a `VM` object.\n })\n .on('end', function() {\n // All instances retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getVMsStream()\n .on('data', function(vm) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"instanceGroup","name":"instanceGroup","type":"instance","description":"

Get a reference to a Google Compute Engine instance group.

","source":"packages/compute/src/zone.js#L1426","resources":[{"title":"InstanceGroups Overview","link":"https://cloud.google.com/compute/docs/reference/v1/instanceGroups"}],"examples":[{"code":"var instanceGroup = zone.instanceGroup('my-instance-group');"}],"params":[{"name":"name","description":"
  • Name of the existing instance group.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/instance-group"],"description":""}]},{"id":"machineType","name":"machineType","type":"instance","description":"

Get a reference to a Google Compute Engine machine type.

","source":"packages/compute/src/zone.js#L1442","resources":[{"title":"Machine Types Overview","link":"https://cloud.google.com/compute/docs/machine-types"},{"title":"MachineType Resource","link":"https://cloud.google.com/compute/docs/reference/v1/machineTypes"}],"examples":[{"code":"var machienType = zone.machineType('g1-small');"}],"params":[{"name":"name","description":"
  • Name of the existing machine type.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/machine-type"],"description":""}]},{"id":"operation","name":"operation","type":"instance","description":"

Get a reference to a Google Compute Engine zone operation.

","source":"packages/compute/src/zone.js#L1457","resources":[{"title":"Zone Operation Overview","link":"https://cloud.google.com/compute/docs/reference/v1/zoneOperations"}],"examples":[{"code":"var operation = zone.operation('operation-1445532685163-8b137d2a-1822afe7');"}],"params":[{"name":"name","description":"
  • Name of the existing operation.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/operation"],"description":""}]},{"id":"vm","name":"vm","type":"instance","description":"

Get a reference to a Google Compute Engine virtual machine instance.

","source":"packages/compute/src/zone.js#L1472","resources":[{"title":"Instances and Networks","link":"https://cloud.google.com/compute/docs/instances-and-network"}],"examples":[{"code":"var vm = zone.vm('vm-name');"}],"params":[{"name":"name","description":"
  • Name of the virtual machine.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["compute/vm"],"description":""}]}],"path":"zone.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/datastore/index.json b/json/google-cloud/v0.51.1/datastore/index.json new file mode 100644 index 00000000000..938d5449304 --- /dev/null +++ b/json/google-cloud/v0.51.1/datastore/index.json @@ -0,0 +1 @@ +{"id":"datastore","type":"class","name":"Datastore","overview":"

\n This class allows you interact with Cloud Datastore.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/datastore.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar datastore = gcloud.datastore();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar datastore = gcloud.datastore({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/datastore/src/index.js","parent":null,"children":["datastore/entity","datastore/query","datastore/request","datastore/transaction","datastore/v1"],"methods":[{"id":"Datastore","name":"Datastore","type":"constructor","description":"","source":"packages/datastore/src/index.js#L295","resources":[{"title":"Cloud Datastore Concepts Overview","link":"https://cloud.google.com/datastore/docs/concepts/overview"}],"examples":[{"caption":"

The Datastore Emulator

\nMake sure you have the \ngcloud SDK installed, then run: \n
 \n$ gcloud beta emulators datastore start --no-legacy \n
\nYou will see the following printed: \n
 \n[datastore] API endpoint: http://localhost:8005 \n[datastore] If you are using a library that supports the \nDATASTORE_EMULATOR_HOST environment variable, run: \n[datastore] \n[datastore] export DATASTORE_EMULATOR_HOST=localhost:8005 \n[datastore] \n[datastore] Dev App Server is now running. \n
\nSet that environment variable and your localhost Datastore will \nautomatically be used. You can also pass this address in manually with \napiEndpoint. \nAdditionally, DATASTORE_PROJECT_ID is recognized. If you have this set, \nyou don't need to provide a projectId.

"},{"caption":"

Retrieving Records

\nRecords, called \"entities\" in Datastore, are retrieved by using a key. The \nkey is more than a numeric identifier, it is a complex data structure that \ncan be used to model relationships. The simplest key has a string kind \nvalue, and either a numeric id value, or a string name value. \nA single record can be retrieved with datastore#key and \ndatastore#get.

","code":"var key = datastore.key(['Company', 'Google']);\n\ndatastore.get(key, function(err, entity) {\n // entity = The record.\n // entity[datastore.KEY] = The key for this entity.\n});"},{"caption":"

Querying Records

\nCreate a query with datastore#createQuery.

","code":"var query = datastore.createQuery('Company');"},{"caption":"

Multiple records can be found that match criteria with \ndatastore/query#filter.

","code":"query.filter('location', 'CA');"},{"caption":"

Records can also be ordered with datastore/query#order.

","code":"query.order('name');"},{"caption":"

The number of records returned can be specified with \ndatastore/query#limit.

","code":"query.limit(5);"},{"caption":"

Records' key structures can also be queried with \ndatastore/query#hasAncestor.

","code":"var ancestorKey = datastore.key(['ParentCompany', 'Alphabet']);\n\nquery.hasAncestor(ancestorKey);"},{"caption":"

Run the query with datastore#runQuery.

","code":"datastore.runQuery(query, function(err, entities) {\n // entities = An array of records.\n\n // Access the Key object for an entity.\n var firstEntityKey = entities[0][datastore.KEY];\n});"},{"caption":"

Paginating Records

\nImagine building a website that allows a user to sift through hundreds of \ntheir contacts. You'll likely want to only display a subset of these at \nonce, so you set a limit.

","code":"var express = require('express');\nvar app = express();\n\nvar NUM_RESULTS_PER_PAGE = 15;\n\napp.get('/contacts', function(req, res) {\n var query = datastore.createQuery('Contacts')\n .limit(NUM_RESULTS_PER_PAGE);\n\n if (req.query.nextPageCursor) {\n query.start(req.query.nextPageCursor);\n }\n\n datastore.runQuery(query, function(err, entities, info) {\n if (err) {\n // Error handling omitted.\n return;\n }\n\n // Respond to the front end with the contacts and the cursoring token\n // from the query we just ran.\n var frontEndResponse = {\n contacts: entities\n };\n\n // Check if more results may exist.\n if (info.moreResults !== datastore.NO_MORE_RESULTS) {\n frontEndResponse.nextPageCursor = info.endCursor;\n }\n\n res.render('contacts', frontEndResponse);\n });\n});"},{"caption":"

Creating Records

\nNew entities can be created and persisted with datastore#save. \nThe entitiy must have a key to be saved. If you don't specify an \nidentifier for the key, one is generated for you. \nWe will create a key with a name identifier, \"Google\".

","code":"var key = datastore.key(['Company', 'Google']);\n\nvar data = {\n name: 'Google',\n location: 'CA'\n};\n\ndatastore.save({\n key: key,\n data: data\n}, function(err) {\n if (!err) {\n // Record saved successfully.\n }\n});"},{"caption":"

We can verify the data was saved by using datastore#get.

","code":"datastore.get(key, function(err, entity) {\n // entity = {\n // name: 'Google',\n // location: 'CA'\n // }\n});"},{"caption":"

If we want to update this record, we can modify the data object and re- \nsave it.

","code":"data.symbol = 'GOOG';\n\ndatastore.save({\n key: key, // defined above (datastore.key(['Company', 'Google']))\n data: data\n}, function(err, entity) {\n if (!err) {\n // Record updated successfully.\n }\n});"},{"caption":"

Deleting Records

\nEntities can be removed from Datastore by passing the entity's key object \nto datastore#delete.

","code":"var key = datastore.key(['Company', 'Google']);\n\ndatastore.delete(key, function(err) {\n if (!err) {\n // Record deleted successfully.\n }\n});"},{"caption":"

Transactions

\nComplex logic can be wrapped in a transaction with \ndatastore#transaction. All queries and updates run within \nthe transaction will be applied when the done function is called.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n var key = datastore.key(['Company', 'Google']);\n\n transaction.get(key, function(err, entity) {\n if (err) {\n // Error handling omitted.\n }\n\n entity.symbol = 'GOOG';\n\n transaction.save(entity);\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.apiEndpoint","description":"
  • Override the default API endpoint used to reach Datastore. This is useful for connecting to your local Datastore server (usually "http://localhost:8080").
","types":["string"],"optional":true,"nullable":false},{"name":"options.namespace","description":"
  • Namespace to isolate transactions to.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"double","name":"double","type":"instance","description":"

Helper function to get a Datastore Double object.

","source":"packages/datastore/src/index.js#L336","resources":[],"examples":[{"code":"var threeDouble = datastore.double(3.0);"}],"params":[{"name":"value","description":"
  • The double value.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"geoPoint","name":"geoPoint","type":"instance","description":"

Helper function to get a Datastore Geo Point object.

","source":"packages/datastore/src/index.js#L356","resources":[],"examples":[{"code":"var coordinates = {\n latitude: 40.6894,\n longitude: -74.0447\n};\n\nvar geoPoint = datastore.geoPoint(coordinates);"}],"params":[{"name":"coordinates","description":"
  • Coordinate value.
","types":["object"],"optional":false,"nullable":false},{"name":"coordinates.latitude","description":"
  • Latitudinal value.
","types":["number"],"optional":false,"nullable":false},{"name":"coordinates.longitude","description":"
  • Longitudinal value.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"int","name":"int","type":"instance","description":"

Helper function to get a Datastore Integer object.

This is also useful when using an ID outside the bounds of a JavaScript Number object.

","source":"packages/datastore/src/index.js#L380","resources":[],"examples":[{"code":"var sevenInteger = datastore.int(7);"},{"caption":"

Create an Int to support long Key IDs.

","code":"var key = datastore.key([\n 'Kind',\n datastore.int('100000000000001234')\n]);"}],"params":[{"name":"value","description":"
  • The integer value.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"KEY","name":"KEY","type":"instance","description":"

Access the Key from an Entity object.

","source":"packages/datastore/src/index.js#L389","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]},{"id":"MORE_RESULTS_AFTER_CURSOR","name":"MORE_RESULTS_AFTER_CURSOR","type":"instance","description":"

This is one of three values which may be returned from datastore#runQuery, transaction#runQuery, and datastore/query#run as info.moreResults.

There may be more results after the specified end cursor.

","source":"packages/datastore/src/index.js#L400","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]},{"id":"MORE_RESULTS_AFTER_LIMIT","name":"MORE_RESULTS_AFTER_LIMIT","type":"instance","description":"

This is one of three values which may be returned from datastore#runQuery, transaction#runQuery, and datastore/query#run as info.moreResults.

There may be more results after the specified limit.

","source":"packages/datastore/src/index.js#L412","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]},{"id":"NO_MORE_RESULTS","name":"NO_MORE_RESULTS","type":"instance","description":"

This is one of three values which may be returned from datastore#runQuery, transaction#runQuery, and datastore/query#run as info.moreResults.

There are no more results left to query for.

","source":"packages/datastore/src/index.js#L424","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]},{"id":"createQuery","name":"createQuery","type":"instance","description":"

Create a query for the specified kind. See datastore/query for all of the available methods.

","source":"packages/datastore/src/index.js#L442","resources":[{"title":"Datastore Queries","link":"https://cloud.google.com/datastore/docs/concepts/queries"}],"examples":[{"code":"var query = datastore.createQuery('Company');"}],"params":[{"name":"namespace","description":"
  • Namespace.
","types":["string"],"optional":true,"nullable":false},{"name":"kind","description":"
  • The kind to query.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"key","name":"key","type":"instance","description":"

Helper to create a Key object, scoped to the instance's namespace by default.

You may also specify a configuration object to define a namespace and path.

","source":"packages/datastore/src/index.js#L497","resources":[],"examples":[{"caption":"

Create an incomplete key with a kind value of Company.

","code":"var key = datastore.key('Company');"},{"caption":"

Create a complete key with a kind value of Company and id 123.

","code":"var key = datastore.key(['Company', 123]);"},{"caption":"

If the ID integer is outside the bounds of a JavaScript Number object, \ncreate an Int.

","code":"var key = datastore.key([\n 'Company',\n datastore.int('100000000000001234')\n]);"},{"caption":"

Create a complete key with a kind value of Company and name Google. \nNote: id is used for numeric identifiers and name is used otherwise.

","code":"var key = datastore.key(['Company', 'Google']);"},{"caption":"

Create a complete key from a provided namespace and path.

","code":"var key = datastore.key({\n namespace: 'My-NS',\n path: ['Company', 123]\n});"}],"params":[{"name":"options","description":"
  • Key path. To specify or override a namespace, you must use an object here to explicitly state it.
","types":[],"optional":true,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.path","description":"
  • Key path.
","types":[],"optional":true,"nullable":false},{"name":"options.namespace","description":"
  • Optional namespace.
","types":["string"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["Key"],"description":"

A newly created Key from the options given.

"}]},{"id":"allocateIds","name":"allocateIds","type":"instance","description":"

Generate IDs without creating entities.

","source":"packages/datastore/src/request.js#L171","resources":[],"examples":[{"code":"var incompleteKey = datastore.key(['Company']);"},{"caption":"

The following call will create 100 new IDs from the Company kind, which \nexists under the default namespace.

","code":"datastore.allocateIds(incompleteKey, 100, function(err, keys) {});"},{"caption":"

Or, if you're using a transaction object.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.allocateIds(incompleteKey, 100, function(err, keys) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"},{"caption":"

You may prefer to create IDs from a non-default namespace by providing an \nincomplete key with a namespace. Similar to the previous example, the call \nbelow will create 100 new IDs, but from the Company kind that exists under \nthe \"ns-test\" namespace.

","code":"var incompleteKey = datastore.key({\n namespace: 'ns-test',\n path: ['Company']\n});\n\nfunction callback(err, keys, apiResponse) {}\n\ndatastore.allocateIds(incompleteKey, 100, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.allocateIds(incompleteKey, 100).then(function(data) {\n var keys = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"incompleteKey","description":"
  • The key object to complete.
","types":["Key"],"optional":false,"nullable":false},{"name":"n","description":"
  • How many IDs to generate.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.keys","description":"
  • The generated IDs
","types":["array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createReadStream","name":"createReadStream","type":"instance","description":"

Retrieve the entities as a readable object stream.

","source":"packages/datastore/src/request.js#L226","resources":[],"examples":[{"code":"var keys = [\n datastore.key(['Company', 123]),\n datastore.key(['Product', 'Computer'])\n];\n\ndatastore.createReadStream(keys)\n .on('error', function(err) {})\n .on('data', function(entity) {\n // entity is an entity object.\n })\n .on('end', function() {\n // All entities retrieved.\n });"}],"params":[{"name":"keys","description":"
  • Datastore key object(s).
","types":["Key","Key[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration. See datastore#get for a complete list of options.
","types":["object"],"optional":true,"nullable":false}],"exceptions":[{"type":"Error","description":"

If at least one Key object is not provided.

"}],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete all entities identified with the specified key(s).

","source":"packages/datastore/src/request.js#L337","resources":[],"examples":[{"code":"var key = datastore.key(['Company', 123]);\ndatastore.delete(key, function(err, apiResp) {});"},{"caption":"

Or, if you're using a transaction object.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.delete(key);\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n});"},{"caption":"

Delete multiple entities at once.

","code":"datastore.delete([\n datastore.key(['Company', 123]),\n datastore.key(['Product', 'Computer'])\n], function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"key","description":"
  • Datastore key object(s).
","types":["Key","Key[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Retrieve the entities identified with the specified key(s) in the current transaction. Get operations require a valid key to retrieve the key-identified entity from Datastore.

","source":"packages/datastore/src/request.js#L445","resources":[],"examples":[{"caption":"

Get a single entity.

","code":"var key = datastore.key(['Company', 123]);\n\ndatastore.get(key, function(err, entity) {});"},{"caption":"

Or, if you're using a transaction object.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.get(key, function(err, entity) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"},{"caption":"

Get multiple entities at once with a callback.

","code":"var keys = [\n datastore.key(['Company', 123]),\n datastore.key(['Product', 'Computer'])\n];\n\ndatastore.get(keys, function(err, entities) {});"},{"caption":"

Here's how you would update the value of an entity with the help of the \nsave method.

","code":"datastore.get(key, function(err, entity) {\n if (err) {\n // Error handling omitted.\n }\n\n entity.newValue = true;\n\n datastore.save({\n key: key,\n data: entity\n }, function(err) {});\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.get(keys).then(function(data) {\n var entities = data[0];\n});"}],"params":[{"name":"keys","description":"
  • Datastore key object(s).
","types":["Key","Key[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration.
","types":["object"],"optional":true,"nullable":false},{"name":"options.consistency","description":"
  • Specify either strong or eventual. If not specified, default values are chosen by Datastore for the operation. Learn more about strong and eventual consistency here.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entity","description":"
  • The entity object(s) which match the provided keys.
","types":["object","object[]"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If at least one Key object is not provided.

"}],"returns":[]},{"id":"runQuery","name":"runQuery","type":"instance","description":"

Datastore allows you to query entities by kind, filter them by property filters, and sort them by a property name. Projection and pagination are also supported.

The query is run, and the results are returned as the second argument to your callback. A third argument may also exist, which is a query object that uses the end cursor from the previous query as the starting cursor for the next query. You can pass that object back to this method to see if more results exist.

","source":"packages/datastore/src/request.js#L561","resources":[],"examples":[{"caption":"

Where you see transaction, assume this is the context that's relevant to \nyour use, whether that be a Datastore or a Transaction object.

","code":"var query = datastore.createQuery('Lion');\n\ndatastore.runQuery(query, function(err, entities, info) {\n // entities = An array of records.\n\n // Access the Key object for an entity.\n var firstEntityKey = entities[0][datastore.KEY];\n});"},{"caption":"

Or, if you're using a transaction object.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.runQuery(query, function(err, entities) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"},{"caption":"

A keys-only query returns just the keys of the result entities instead of \nthe entities themselves, at lower latency and cost.

","code":"var keysOnlyQuery = datastore.createQuery('Lion').select('__key__');\n\ndatastore.runQuery(keysOnlyQuery, function(err, entities) {\n var keys = entities.map(function(entity) {\n return entity[datastore.KEY];\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.runQuery(query).then(function(data) {\n var entities = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["datastore/query"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration.
","types":["object"],"optional":true,"nullable":false},{"name":"options.consistency","description":"
  • Specify either strong or eventual. If not specified, default values are chosen by Datastore for the operation. Learn more about strong and eventual consistency here.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function. If omitted, a readable stream instance is returned.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entities","description":"
  • A list of entities.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.info","description":"
  • An object useful for pagination.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.info.endCursor","description":"
  • Use this in a follow-up query to begin from where these results ended.
","types":["string"],"optional":false,"nullable":true},{"name":"callback.info.moreResults","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"runQueryStream","name":"runQueryStream","type":"instance","description":"

Get a list of entities as a readable object stream.

See datastore#runQuery for a list of all available options.

","source":"packages/datastore/src/request.js#L610","resources":[],"examples":[{"code":"datastore.runQueryStream(query)\n .on('error', console.error)\n .on('data', function(entity) {\n // Access the Key object for this entity.\n var key = entity[datastore.KEY];\n })\n .on('info', function(info) {})\n .on('end', function() {\n // All entities retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"datastore.runQueryStream(query)\n .on('data', function(entity) {\n this.end();\n });"}],"params":[{"name":"query","description":"
  • Query object.
","types":["datastore/query"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration.
","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"save","name":"save","type":"instance","description":"

Insert or update the specified object(s). If a key is incomplete, its associated object is inserted and the original Key object is updated to contain the generated ID.

This method will determine the correct Datastore method to execute (upsert, insert, or update) by using the key(s) provided. For example, if you provide an incomplete key (one without an ID), the request will create a new entity and have its ID automatically assigned. If you provide a complete key, the entity will be updated with the data specified.

By default, all properties are indexed. To prevent a property from being included in all indexes, you must supply an entity's data property as an array. See below for an example.

","source":"packages/datastore/src/request.js#L892","resources":[],"examples":[{"caption":"

Save a single entity. \nNotice that we are providing an incomplete key. After saving, the original \nKey object used to save will be updated to contain the path with its \ngenerated ID.

","code":"var key = datastore.key('Company');\nvar entity = {\n key: key,\n data: {\n rating: '10'\n }\n};\n\ndatastore.save(entity, function(err) {\n console.log(key.path); // [ 'Company', 5669468231434240 ]\n console.log(key.namespace); // undefined\n});"},{"caption":"

Save a single entity using a provided name instead of auto-generated ID. \nHere we are providing a key with name instead of an ID. After saving, the \noriginal Key object used to save will be updated to contain the path with \nthe name instead of a generated ID.

","code":"var key = datastore.key(['Company', 'donutshack']);\nvar entity = {\n key: key,\n data: {\n name: 'DonutShack',\n rating: 8\n }\n};\n\ndatastore.save(entity, function(err) {\n console.log(key.path); // ['Company', 'donutshack']\n console.log(key.namespace); // undefined\n});"},{"caption":"

Save a single entity with a provided namespace. Namespaces allow for \nmultitenancy. To read more about this, see \n[the Datastore docs on key concepts](https://goo.gl/M1LUAu). \nHere we are providing a key with namespace.

","code":"var key = datastore.key({\n namespace: 'my-namespace',\n path: ['Company', 'donutshack']\n});\n\nvar entity = {\n key: key,\n data: {\n name: 'DonutShack',\n rating: 8\n }\n};\n\ndatastore.save(entity, function(err) {\n console.log(key.path); // ['Company', 'donutshack']\n console.log(key.namespace); // 'my-namespace'\n});"},{"caption":"

Save different types of data, including ints, doubles, dates, booleans, \nblobs, and lists. \nNotice that we are providing an incomplete key. After saving, the original \nKey object used to save will be updated to contain the path with its \ngenerated ID.

","code":"var key = datastore.key('Company');\nvar entity = {\n key: key,\n data: {\n name: 'DonutShack',\n rating: datastore.int(10),\n worth: datastore.double(123456.78),\n location: datastore.geoPoint({\n latitude: 40.6894,\n longitude: -74.0447\n }),\n numDonutsServed: 45,\n founded: new Date('Tue May 12 2015 15:30:00 GMT-0400 (EDT)'),\n isStartup: true,\n donutEmoji: new Buffer('\\uD83C\\uDF69'),\n keywords: [\n 'donut',\n 'coffee',\n 'yum'\n ]\n }\n};\n\ndatastore.save(entity, function(err, apiResponse) {});"},{"caption":"

To specify an excludeFromIndexes value for a Datastore entity, pass in \nan array for the key's data.

","code":"var entity = {\n key: datastore.key('Company'),\n data: [\n {\n name: 'rating',\n value: 10,\n excludeFromIndexes: true\n }\n ]\n};\n\ndatastore.save(entity, function(err, apiResponse) {});"},{"caption":"

Save multiple entities at once.

","code":"var companyKey = datastore.key(['Company', 123]);\nvar productKey = datastore.key(['Product', 'Computer']);\nvar entities = [\n {\n key: companyKey,\n data: {\n HQ: 'Dallas, TX'\n }\n },\n {\n key: productKey,\n data: {\n vendor: 'Dell'\n }\n }\n];\n\ndatastore.save(entities, function(err, apiResponse) {});"},{"caption":"

Explicitly attempt to 'insert' a specific entity.

","code":"var userKey = datastore.key(['User', 'chilts']);\nvar entity = {\n key: userKey,\n method: 'insert',\n data: {\n fullName: 'Andrew Chilton'\n }\n};\n\ndatastore.save(entity, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.save(entity).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"entities","description":"
  • Datastore key object(s).
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"entities.key","description":"
  • Datastore key object.
","types":["Key"],"optional":false,"nullable":false},{"name":"entities.method","description":"
  • Explicit method to use, either 'insert', 'update', or 'upsert'.
","types":["string"],"optional":true,"nullable":false},{"name":"entities.data","description":"
  • Data to save with the provided key. If you provide an array of objects, you must use the explicit syntax: name for the name of the property and value for its value. You may also specify an excludeFromIndexes property, set to true or false.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If an unrecognized method is provided.

"}],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/datastore/query.json b/json/google-cloud/v0.51.1/datastore/query.json new file mode 100644 index 00000000000..2dc7099b19b --- /dev/null +++ b/json/google-cloud/v0.51.1/datastore/query.json @@ -0,0 +1 @@ +{"id":"datastore/query","type":"class","name":"Query","overview":"

\n This class allows you interact with Cloud Datastore.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/datastore.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar datastore = gcloud.datastore();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar datastore = gcloud.datastore({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/datastore/src/query.js","parent":"datastore","children":[],"methods":[{"id":"Query","name":"Query","type":"constructor","description":"

Build a Query object.

Queries are built with datastore#createQuery and transaction#createQuery.

","source":"packages/datastore/src/query.js#L47","resources":[{"title":"Datastore Queries","link":"http://goo.gl/Cag0r6"}],"examples":[{"code":"var query = datastore.createQuery('AnimalNamespace', 'Lion');"}],"params":[{"name":"namespace","description":"
  • Namespace to query entities from.
","types":["string"],"optional":true,"nullable":false},{"name":"kind","description":"
  • Kind to query.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"filter","name":"filter","type":"instance","description":"

Datastore allows querying on properties. Supported comparison operators are =, <, >, <=, and >=. "Not equal" and IN operators are currently not supported.

To filter by ancestors, see datastore/query#hasAncestor.

","source":"packages/datastore/src/query.js#L104","resources":[{"title":"Datastore Filters","link":"https://cloud.google.com/datastore/docs/concepts/queries#datastore-property-filter-nodejs"}],"examples":[{"caption":"

List all companies that are located in California.

","code":"var caliQuery = query.filter('state', 'CA');"},{"caption":"

List all companies named Google that have less than 400 employees.

","code":"var companyQuery = query\n .filter('name', 'Google')\n .filter('size', '<', 400);"},{"caption":"

To filter by key, use __key__ for the property name. Filter on keys \nstored as properties is not currently supported.

","code":"var key = datastore.key(['Company', 'Google']);\nvar keyQuery = query.filter('__key__', key);"}],"params":[{"name":"property","description":"
  • The field name.
","types":["string"],"optional":false,"nullable":false},{"name":"operator","description":"
  • Operator (=, <, >, <=, >=). Default: =
","types":["string"],"optional":true,"nullable":false},{"name":"value","description":"
  • Value to compare property to.
","types":[],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"hasAncestor","name":"hasAncestor","type":"instance","description":"

Filter a query by ancestors.

","source":"packages/datastore/src/query.js#L130","resources":[{"title":"Datastore Ancestor Filters","link":"https://cloud.google.com/datastore/docs/concepts/queries#datastore-ancestor-query-nodejs"}],"examples":[{"code":"var ancestoryQuery = query.hasAncestor(datastore.key(['Parent', 123]));"}],"params":[{"name":"key","description":"
  • Key object to filter by.
","types":["Key"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"order","name":"order","type":"instance","description":"

Sort the results by a property name in ascending or descending order. By default, an ascending sort order will be used.

","source":"packages/datastore/src/query.js#L156","resources":[{"title":"Datastore Sort Orders","link":"https://cloud.google.com/datastore/docs/concepts/queries#datastore-ascending-sort-nodejs"}],"examples":[{"code":"// Sort by size ascendingly.\nvar companiesAscending = companyQuery.order('size');\n\n// Sort by size descendingly.\nvar companiesDescending = companyQuery.order('size', {\n descending: true\n});"}],"params":[{"name":"property","description":"
  • The property to order by.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Options object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.descending","description":"
  • Sort the results by a property name in descending order. Default: false.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"groupBy","name":"groupBy","type":"instance","description":"

Group query results by a list of properties.

","source":"packages/datastore/src/query.js#L172","resources":[],"examples":[{"code":"var groupedQuery = companyQuery.groupBy(['name', 'size']);"}],"params":[{"name":"properties","description":"
  • Properties to group by.
","types":["array"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"select","name":"select","type":"instance","description":"

Retrieve only select properties from the matched entities.

Queries that select a subset of properties are called Projection Queries.

","source":"packages/datastore/src/query.js#L195","resources":[{"title":"Projection Queries","link":"https://cloud.google.com/datastore/docs/concepts/projectionqueries"}],"examples":[{"code":"// Only retrieve the name property.\nvar selectQuery = companyQuery.select('name');\n\n// Only retrieve the name and size properties.\nvar selectQuery = companyQuery.select(['name', 'size']);"}],"params":[{"name":"fieldNames","description":"
  • Properties to return from the matched entities.
","types":["string","string[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"start","name":"start","type":"instance","description":"

Set a starting cursor to a query.

","source":"packages/datastore/src/query.js#L214","resources":[{"title":"Query Cursors","link":"https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets"}],"examples":[{"code":"var cursorToken = 'X';\n\n// Retrieve results starting from cursorToken.\nvar startQuery = companyQuery.start(cursorToken);"}],"params":[{"name":"cursorToken","description":"
  • The starting cursor token.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"end","name":"end","type":"instance","description":"

Set an ending cursor to a query.

","source":"packages/datastore/src/query.js#L233","resources":[{"title":"Query Cursors","link":"https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Query_cursors"}],"examples":[{"code":"var cursorToken = 'X';\n\n// Retrieve results limited to the extent of cursorToken.\nvar endQuery = companyQuery.end(cursorToken);"}],"params":[{"name":"cursorToken","description":"
  • The ending cursor token.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"limit","name":"limit","type":"instance","description":"

Set a limit on a query.

","source":"packages/datastore/src/query.js#L250","resources":[{"title":"Query Limits","link":"https://cloud.google.com/datastore/docs/concepts/queries#datastore-limit-nodejs"}],"examples":[{"code":"// Limit the results to 10 entities.\nvar limitQuery = companyQuery.limit(10);"}],"params":[{"name":"n","description":"
  • The number of results to limit the query to.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"offset","name":"offset","type":"instance","description":"

Set an offset on a query.

","source":"packages/datastore/src/query.js#L267","resources":[{"title":"Query Offsets","link":"https://cloud.google.com/datastore/docs/concepts/queries#datastore-limit-nodejs"}],"examples":[{"code":"// Start from the 101st result.\nvar offsetQuery = companyQuery.offset(100);"}],"params":[{"name":"n","description":"
  • The offset to start from after the start cursor.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"run","name":"run","type":"instance","description":"

Run the query.

","source":"packages/datastore/src/query.js#L322","resources":[],"examples":[{"code":"query.run(function(err, entities, info) {\n // entities = An array of records.\n\n // Access the Key object for an entity.\n var firstEntityKey = entities[0][datastore.KEY];\n});"},{"caption":"

A keys-only query returns just the keys of the result entities instead of \nthe entities themselves, at lower latency and cost.

","code":"query.select('__key__');\n\nquery.run(function(err, entities) {\n var keys = entities.map(function(entity) {\n return entity[datastore.KEY];\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"query.run().then(function(data) {\n var entities = data[0];\n});"}],"params":[{"name":"options","description":"
  • Optional configuration.
","types":["object"],"optional":true,"nullable":false},{"name":"options.consistency","description":"
  • Specify either strong or eventual. If not specified, default values are chosen by Datastore for the operation. Learn more about strong and eventual consistency here.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function. If omitted, a readable stream instance is returned.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entities","description":"
  • A list of entities.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.info","description":"
  • An object useful for pagination.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.info.endCursor","description":"
  • Use this in a follow-up query to begin from where these results ended.
","types":["string"],"optional":false,"nullable":true},{"name":"callback.info.moreResults","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"runStream","name":"runStream","type":"instance","description":"

Run the query as a readable object stream.

","source":"packages/datastore/src/query.js#L357","resources":[],"examples":[{"code":"query.runStream()\n .on('error', console.error)\n .on('data', function (entity) {\n // Access the Key object for this entity.\n var key = entity[datastore.KEY];\n })\n .on('info', function(info) {})\n .on('end', function() {\n // All entities retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"query.runStream()\n .on('data', function (entity) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]}],"path":"query.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/datastore/transaction.json b/json/google-cloud/v0.51.1/datastore/transaction.json new file mode 100644 index 00000000000..7a36c88910d --- /dev/null +++ b/json/google-cloud/v0.51.1/datastore/transaction.json @@ -0,0 +1 @@ +{"id":"datastore/transaction","type":"class","name":"Transaction","overview":"

\n This class allows you interact with Cloud Datastore.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/datastore.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar datastore = gcloud.datastore();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar datastore = gcloud.datastore({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/datastore/src/transaction.js","parent":"datastore","children":[],"methods":[{"id":"Transaction","name":"Transaction","type":"constructor","description":"

A transaction is a set of Datastore operations on one or more entities. Each transaction is guaranteed to be atomic, which means that transactions are never partially applied. Either all of the operations in the transaction are applied, or none of them are applied.

","source":"packages/datastore/src/transaction.js#L54","resources":[{"title":"Transactions Reference","link":"https://cloud.google.com/datastore/docs/concepts/transactions"}],"examples":[{"code":"var transaction = datastore.transaction();"}],"params":[],"exceptions":[],"returns":[]},{"id":"commit","name":"commit","type":"instance","description":"

Commit the remote transaction and finalize the current transaction instance.

If the commit request fails, we will automatically rollback the transaction.

","source":"packages/datastore/src/transaction.js#L108","resources":[],"examples":[{"code":"transaction.commit(function(err, apiResponse) {\n if (err) {\n // Transaction could not be committed.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"transaction.commit().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request. If the commit fails, we automatically try to rollback the transaction (see datastore/transaction#rollback).
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createQuery","name":"createQuery","type":"instance","description":"

Create a query for the specified kind. See datastore/query for all of the available methods.

","source":"packages/datastore/src/transaction.js#L245","resources":[{"title":"Datastore Queries","link":"https://cloud.google.com/datastore/docs/concepts/queries"}],"examples":[{"code":"// Run the query inside the transaction.\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n var query = transaction.createQuery('Company');\n\n query.run(function(err, entities) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"}],"params":[{"name":"namespace","description":"
  • Namespace.
","types":["string"],"optional":true,"nullable":false},{"name":"kind","description":"
  • The kind to query.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["datastore/query"],"description":""}]},{"id":"delete","name":"delete","type":"instance","description":"

Delete all entities identified with the specified key(s) in the current transaction.

","source":"packages/datastore/src/transaction.js#L277","resources":[],"examples":[{"code":"transaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n // Delete a single entity.\n transaction.delete(datastore.key(['Company', 123]));\n\n // Delete multiple entities at once.\n transaction.delete([\n datastore.key(['Company', 123]),\n datastore.key(['Product', 'Computer'])\n ]);\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n});"}],"params":[{"name":"key","description":"
  • Datastore key object(s).
","types":["Key","Key[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"rollback","name":"rollback","type":"instance","description":"

Reverse a transaction remotely and finalize the current transaction instance.

","source":"packages/datastore/src/transaction.js#L318","resources":[],"examples":[{"code":"transaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.rollback(function(err) {\n if (!err) {\n // Transaction rolled back successfully.\n }\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"transaction.rollback().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"run","name":"run","type":"instance","description":"

Begin a remote transaction. In the callback provided, run your transactional commands.

","source":"packages/datastore/src/transaction.js#L375","resources":[],"examples":[{"code":"transaction.run(function(err, transaction) {\n // Perform Datastore transactional operations.\n var key = datastore.key(['Company', 123]);\n\n transaction.get(key, function(err, entity) {\n entity.name = 'Google';\n\n transaction.save({\n key: key,\n data: entity\n });\n\n transaction.commit(function(err) {\n if (!err) {\n // Data saved successfully.\n }\n });\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"transaction.run().then(function(data) {\n var transaction = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The function to execute within the context of a transaction.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.transaction","description":"
  • This transaction instance.
","types":["datastore/transaction"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"save","name":"save","type":"instance","description":"

Insert or update the specified object(s) in the current transaction. If a key is incomplete, its associated object is inserted and the original Key object is updated to contain the generated ID.

This method will determine the correct Datastore method to execute (upsert, insert, or update) by using the key(s) provided. For example, if you provide an incomplete key (one without an ID), the request will create a new entity and have its ID automatically assigned. If you provide a complete key, the entity will be updated with the data specified.

By default, all properties are indexed. To prevent a property from being included in all indexes, you must supply an entity's data property as an array. See below for an example.

","source":"packages/datastore/src/transaction.js#L508","resources":[],"examples":[{"caption":"

Save a single entity. \nNotice that we are providing an incomplete key. After the transaction is \ncommitted, the Key object held by the key variable will be populated \nwith a path containing its generated ID.

","code":"var key = datastore.key('Company');\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.save({\n key: key,\n data: {\n rating: '10'\n }\n });\n\n transaction.commit(function(err) {\n if (!err) {\n // Data saved successfully.\n }\n });\n});"},{"caption":"

To specify an excludeFromIndexes value for a Datastore entity, pass in \nan array for the key's data. The above example would then look like:

","code":"transaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.save({\n key: key,\n data: [\n {\n name: 'rating',\n value: '10',\n excludeFromIndexes: false\n }\n ]\n });\n\n transaction.commit(function(err) {\n if (!err) {\n // Data saved successfully.\n }\n });\n});"},{"caption":"

Save multiple entities at once.

","code":"var companyKey = datastore.key(['Company', 123]);\nvar productKey = datastore.key(['Product', 'Computer']);\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.save([\n {\n key: companyKey,\n data: {\n HQ: 'Dallas, TX'\n }\n },\n {\n key: productKey,\n data: {\n vendor: 'Dell'\n }\n }\n ]);\n\n transaction.commit(function(err) {\n if (!err) {\n // Data saved successfully.\n }\n });\n});"}],"params":[{"name":"entities","description":"
  • Datastore key object(s).
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"entities.key","description":"
  • Datastore key object.
","types":["Key"],"optional":false,"nullable":false},{"name":"entities.data","description":"
  • Data to save with the provided key. If you provide an array of objects, you must use the explicit syntax: name for the name of the property and value for its value. You may also specify an excludeFromIndexes property, set to true or false.
","types":["object","object[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"allocateIds","name":"allocateIds","type":"instance","description":"

Generate IDs without creating entities.

","source":"packages/datastore/src/request.js#L171","resources":[],"examples":[{"code":"var incompleteKey = datastore.key(['Company']);"},{"caption":"

The following call will create 100 new IDs from the Company kind, which \nexists under the default namespace.

","code":"datastore.allocateIds(incompleteKey, 100, function(err, keys) {});"},{"caption":"

Or, if you're using a transaction object.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.allocateIds(incompleteKey, 100, function(err, keys) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"},{"caption":"

You may prefer to create IDs from a non-default namespace by providing an \nincomplete key with a namespace. Similar to the previous example, the call \nbelow will create 100 new IDs, but from the Company kind that exists under \nthe \"ns-test\" namespace.

","code":"var incompleteKey = datastore.key({\n namespace: 'ns-test',\n path: ['Company']\n});\n\nfunction callback(err, keys, apiResponse) {}\n\ndatastore.allocateIds(incompleteKey, 100, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.allocateIds(incompleteKey, 100).then(function(data) {\n var keys = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"incompleteKey","description":"
  • The key object to complete.
","types":["Key"],"optional":false,"nullable":false},{"name":"n","description":"
  • How many IDs to generate.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.keys","description":"
  • The generated IDs
","types":["array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createReadStream","name":"createReadStream","type":"instance","description":"

Retrieve the entities as a readable object stream.

","source":"packages/datastore/src/request.js#L226","resources":[],"examples":[{"code":"var keys = [\n datastore.key(['Company', 123]),\n datastore.key(['Product', 'Computer'])\n];\n\ndatastore.createReadStream(keys)\n .on('error', function(err) {})\n .on('data', function(entity) {\n // entity is an entity object.\n })\n .on('end', function() {\n // All entities retrieved.\n });"}],"params":[{"name":"keys","description":"
  • Datastore key object(s).
","types":["Key","Key[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration. See datastore#get for a complete list of options.
","types":["object"],"optional":true,"nullable":false}],"exceptions":[{"type":"Error","description":"

If at least one Key object is not provided.

"}],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Retrieve the entities identified with the specified key(s) in the current transaction. Get operations require a valid key to retrieve the key-identified entity from Datastore.

","source":"packages/datastore/src/request.js#L445","resources":[],"examples":[{"caption":"

Get a single entity.

","code":"var key = datastore.key(['Company', 123]);\n\ndatastore.get(key, function(err, entity) {});"},{"caption":"

Or, if you're using a transaction object.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.get(key, function(err, entity) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"},{"caption":"

Get multiple entities at once with a callback.

","code":"var keys = [\n datastore.key(['Company', 123]),\n datastore.key(['Product', 'Computer'])\n];\n\ndatastore.get(keys, function(err, entities) {});"},{"caption":"

Here's how you would update the value of an entity with the help of the \nsave method.

","code":"datastore.get(key, function(err, entity) {\n if (err) {\n // Error handling omitted.\n }\n\n entity.newValue = true;\n\n datastore.save({\n key: key,\n data: entity\n }, function(err) {});\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.get(keys).then(function(data) {\n var entities = data[0];\n});"}],"params":[{"name":"keys","description":"
  • Datastore key object(s).
","types":["Key","Key[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration.
","types":["object"],"optional":true,"nullable":false},{"name":"options.consistency","description":"
  • Specify either strong or eventual. If not specified, default values are chosen by Datastore for the operation. Learn more about strong and eventual consistency here.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entity","description":"
  • The entity object(s) which match the provided keys.
","types":["object","object[]"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If at least one Key object is not provided.

"}],"returns":[]},{"id":"runQuery","name":"runQuery","type":"instance","description":"

Datastore allows you to query entities by kind, filter them by property filters, and sort them by a property name. Projection and pagination are also supported.

The query is run, and the results are returned as the second argument to your callback. A third argument may also exist, which is a query object that uses the end cursor from the previous query as the starting cursor for the next query. You can pass that object back to this method to see if more results exist.

","source":"packages/datastore/src/request.js#L561","resources":[],"examples":[{"caption":"

Where you see transaction, assume this is the context that's relevant to \nyour use, whether that be a Datastore or a Transaction object.

","code":"var query = datastore.createQuery('Lion');\n\ndatastore.runQuery(query, function(err, entities, info) {\n // entities = An array of records.\n\n // Access the Key object for an entity.\n var firstEntityKey = entities[0][datastore.KEY];\n});"},{"caption":"

Or, if you're using a transaction object.

","code":"var transaction = datastore.transaction();\n\ntransaction.run(function(err) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.runQuery(query, function(err, entities) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"},{"caption":"

A keys-only query returns just the keys of the result entities instead of \nthe entities themselves, at lower latency and cost.

","code":"var keysOnlyQuery = datastore.createQuery('Lion').select('__key__');\n\ndatastore.runQuery(keysOnlyQuery, function(err, entities) {\n var keys = entities.map(function(entity) {\n return entity[datastore.KEY];\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"datastore.runQuery(query).then(function(data) {\n var entities = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["datastore/query"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration.
","types":["object"],"optional":true,"nullable":false},{"name":"options.consistency","description":"
  • Specify either strong or eventual. If not specified, default values are chosen by Datastore for the operation. Learn more about strong and eventual consistency here.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function. If omitted, a readable stream instance is returned.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entities","description":"
  • A list of entities.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.info","description":"
  • An object useful for pagination.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.info.endCursor","description":"
  • Use this in a follow-up query to begin from where these results ended.
","types":["string"],"optional":false,"nullable":true},{"name":"callback.info.moreResults","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"runQueryStream","name":"runQueryStream","type":"instance","description":"

Get a list of entities as a readable object stream.

See datastore#runQuery for a list of all available options.

","source":"packages/datastore/src/request.js#L610","resources":[],"examples":[{"code":"datastore.runQueryStream(query)\n .on('error', console.error)\n .on('data', function(entity) {\n // Access the Key object for this entity.\n var key = entity[datastore.KEY];\n })\n .on('info', function(info) {})\n .on('end', function() {\n // All entities retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"datastore.runQueryStream(query)\n .on('data', function(entity) {\n this.end();\n });"}],"params":[{"name":"query","description":"
  • Query object.
","types":["datastore/query"],"optional":false,"nullable":false},{"name":"options","description":"
  • Optional configuration.
","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]}],"path":"transaction.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/dns/change.json b/json/google-cloud/v0.51.1/dns/change.json new file mode 100644 index 00000000000..cd0758c42df --- /dev/null +++ b/json/google-cloud/v0.51.1/dns/change.json @@ -0,0 +1 @@ +{"id":"dns/change","type":"class","name":"Change","overview":"

\n This class allows you interact with Cloud DNS.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/dns.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/dns/src/change.js","parent":"dns","children":[],"methods":[{"id":"Change","name":"Change","type":"constructor","description":"","source":"packages/dns/src/change.js#L37","resources":[],"examples":[{"code":"var zone = dns.zone('zone-id');\nvar change = zone.change('change-id');"}],"params":[{"name":"zone","description":"
  • The parent zone object.
","types":["dns/zone"],"optional":false,"nullable":false},{"name":"id","description":"
  • ID of the change.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the change exists.

","source":"packages/dns/src/change.js#L57","resources":[],"examples":[{"code":"change.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"change.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the change exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a change if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/dns/src/change.js#L84","resources":[],"examples":[{"code":"change.get(function(err, change, apiResponse) {\n // `change.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"change.get().then(function(data) {\n var change = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata for the change in the zone.

","source":"packages/dns/src/change.js#L119","resources":[{"title":"Changes: get API Documentation","link":"https://cloud.google.com/dns/api/v1/changes/get"}],"examples":[{"code":"change.getMetadata(function(err, metadata, apiResponse) {\n if (!err) {\n // metadata = {\n // kind: 'dns#change',\n // additions: [{...}],\n // deletions: [{...}],\n // startTime: '2015-07-21T14:40:06.056Z',\n // id: '1',\n // status: 'done'\n // }\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"change.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • Metadata of the change from the API.
","types":["object"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a change.

","source":"packages/dns/src/change.js#L159","resources":[],"examples":[{"code":"var config = {\n add: {\n // ...\n }\n};\n\nchange.create(config, function(err, change, apiResponse) {\n if (!err) {\n // The change was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"change.create(config).then(function(data) {\n var change = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"change.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/dns/index.json b/json/google-cloud/v0.51.1/dns/index.json new file mode 100644 index 00000000000..1fcf31b8c22 --- /dev/null +++ b/json/google-cloud/v0.51.1/dns/index.json @@ -0,0 +1 @@ +{"id":"dns","type":"class","name":"DNS","overview":"

\n This class allows you interact with Cloud DNS.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/dns.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/dns/src/index.js","parent":null,"children":["dns/change","dns/record","dns/zone"],"methods":[{"id":"DNS","name":"DNS","type":"constructor","description":"

Cloud DNS is a high- performance, resilient, global DNS service that provides a cost-effective way to make your applications and services available to your users. This programmable, authoritative DNS service can be used to easily publish and manage DNS records using the same infrastructure relied upon by Google.

","source":"packages/dns/src/index.js#L49","resources":[{"title":"What is Cloud DNS?","link":"https://cloud.google.com/dns/what-is-cloud-dns"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createZone","name":"createZone","type":"instance","description":"

Create a managed zone.

","source":"packages/dns/src/index.js#L106","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[{"code":"var config = {\n dnsName: 'example.com.', // note the period at the end of the domain.\n description: 'This zone is awesome!'\n};\n\ndns.createZone('my-awesome-zone', config, function(err, zone, apiResponse) {\n if (!err) {\n // The zone was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dns.createZone('my-awesome-zone', config).then(function(data) {\n var zone = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"name","description":"
  • Unique name for the zone. E.g. "my-zone"
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"config.dnsName","description":"
  • DNS name for the zone. E.g. "example.com."
","types":["string"],"optional":false,"nullable":false},{"name":"config.description","description":"
  • Description text for the zone.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.zone","description":" ","types":["dns/zone"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a zone name is not provided.

"},{"type":"error","description":"

If a zone dnsName is not provided.

"}],"returns":[]},{"id":"getZones","name":"getZones","type":"instance","description":"

Gets a list of managed zones for the project.

","source":"packages/dns/src/index.js#L166","resources":[{"title":"ManagedZones: list API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/list"}],"examples":[{"code":"dns.getZones(function(err, zones, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"dns.getZones().then(function(data) {\n var zones = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Page token.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.zones","description":" ","types":["dns/zone[]"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getZonesStream","name":"getZonesStream","type":"instance","description":"

Gets a list of dns/zone objects for the project as a readable object stream.

","source":"packages/dns/src/index.js#L228","resources":[],"examples":[{"code":"dns.getZonesStream()\n .on('error', console.error)\n .on('data', function(zone) {\n // zone is a Zone object.\n })\n .on('end', function() {\n // All zones retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"dns.getZonesStream()\n .on('data', function(zone) {\n this.end();\n });"}],"params":[{"name":"query","description":"
  • Configuration object. See dns#getZones for a complete list of options.
","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"zone","name":"zone","type":"instance","description":"

Create a zone object representing a managed zone.

","source":"packages/dns/src/index.js#L241","resources":[],"examples":[{"code":"var zone = dns.zone('my-zone');"}],"params":[{"name":"name","description":"
  • The unique name of the zone.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a zone name is not provided.

"}],"returns":[{"types":["dns/zone"],"description":""}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/dns/record.json b/json/google-cloud/v0.51.1/dns/record.json new file mode 100644 index 00000000000..c8c6c07bf1c --- /dev/null +++ b/json/google-cloud/v0.51.1/dns/record.json @@ -0,0 +1 @@ +{"id":"dns/record","type":"class","name":"Record","overview":"

\n This class allows you interact with Cloud DNS.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/dns.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/dns/src/record.js","parent":"dns","children":[],"methods":[{"id":"Record","name":"Record","type":"constructor","description":"

Create a Resource Record object.

","source":"packages/dns/src/record.js#L53","resources":[],"examples":[{"code":"var zone = dns.zone('my-awesome-zone');\n\nvar record = zone.record('a', {\n name: 'example.com.',\n ttl: 86400,\n data: '1.2.3.4'\n});"}],"params":[{"name":"type","description":"
  • The record type, e.g. A, AAAA, MX.
","types":["object"],"optional":false,"nullable":false},{"name":"metadata","description":"
  • The metadata of this record.
","types":["object"],"optional":false,"nullable":false},{"name":"metadata.name","description":"
  • The name of the record, e.g. www.example.com..
","types":["string"],"optional":false,"nullable":false},{"name":"metadata.data","description":" ","types":["string[]"],"optional":false,"nullable":false},{"name":"metadata.ttl","description":"
  • Seconds that the resource is cached by resolvers.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete this record by creating a change on your zone. This is a convenience method for:

zone.createChange({ delete: record }, function(err, change, apiResponse) {}); 
","source":"packages/dns/src/record.js#L130","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[{"code":"record.delete(function(err, change, apiResponse) {\n if (!err) {\n // Delete change modification was created.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"record.delete().then(function(data) {\n var change = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.change","description":" ","types":["dns/change"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"record.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/dns/zone.json b/json/google-cloud/v0.51.1/dns/zone.json new file mode 100644 index 00000000000..e92aa42471c --- /dev/null +++ b/json/google-cloud/v0.51.1/dns/zone.json @@ -0,0 +1 @@ +{"id":"dns/zone","type":"class","name":"Zone","overview":"

\n This class allows you interact with Cloud DNS.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/dns.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar dns = gcloud.dns({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/dns/src/zone.js","parent":"dns","children":[],"methods":[{"id":"Zone","name":"Zone","type":"constructor","description":"

A Zone object is used to interact with your project's managed zone. It will help you add or delete records, delete your zone, and many other convenience methods.

","source":"packages/dns/src/zone.js#L55","resources":[],"examples":[{"code":"var zone = dns.zone('zone-id');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a zone.

","source":"packages/dns/src/zone.js#L82","resources":[],"examples":[{"code":"var config = {\n dnsName: 'example.com.',\n // ...\n};\n\nzone.create(config, function(err, zone, apiResponse) {\n if (!err) {\n // The zone was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.create(config).then(function(data) {\n var zone = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the zone exists.

","source":"packages/dns/src/zone.js#L102","resources":[],"examples":[{"code":"zone.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the zone exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a zone if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/dns/src/zone.js#L129","resources":[],"examples":[{"code":"zone.get(function(err, zone, apiResponse) {\n // `zone.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.get().then(function(data) {\n var zone = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata for the zone.

","source":"packages/dns/src/zone.js#L152","resources":[{"title":"ManagedZones: get API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/get"}],"examples":[{"code":"zone.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • Metadata of the zone from the API.
","types":["object"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"addRecords","name":"addRecords","type":"instance","description":"

Add records to this zone. This is a convenience wrapper around dns/zone#createChange.

","source":"packages/dns/src/zone.js#L180","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[],"params":[{"name":"record","description":"
  • The record objects to add.
","types":["dns/record","dns/record[]"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.change","description":" ","types":["dns/change"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"change","name":"change","type":"instance","description":"

Create a reference to a change object in this zone.

","source":"packages/dns/src/zone.js#L195","resources":[],"examples":[{"code":"var change = zone.change('change-id');"}],"params":[{"name":"id","description":"
  • The change id.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["dns/change"],"description":""}]},{"id":"createChange","name":"createChange","type":"instance","description":"

Create a change of resource record sets for the zone.

","source":"packages/dns/src/zone.js#L247","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[{"code":"var oldARecord = zone.record('a', {\n name: 'example.com.',\n data: '1.2.3.4',\n ttl: 86400\n});\n\nvar newARecord = zone.record('a', {\n name: 'example.com.',\n data: '5.6.7.8',\n ttl: 86400\n});\n\nvar config = {\n add: newARecord,\n delete: oldARecord\n};\n\nzone.createChange(config, function(err, change, apiResponse) {\n if (!err) {\n // The change was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.createChange(config).then(function(data) {\n var change = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"config","description":"
  • The configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"config.add","description":"
  • Record objects to add to this zone.
","types":["dns/record","dns/record[]"],"optional":false,"nullable":false},{"name":"config.delete","description":"
  • Record objects to delete from this zone. Be aware that the resource records here must match exactly to be deleted.
","types":["dns/record","dns/record[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.change","description":" ","types":["dns/change"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the zone.

Only empty zones can be deleted. Set options.force to true to call dns/zone#empty before deleting the zone. Two API calls will then be made (one to empty, another to delete), which means this is not an atomic request.

","source":"packages/dns/src/zone.js#L320","resources":[{"title":"ManagedZones: delete API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/delete"}],"examples":[{"code":"zone.delete(function(err, apiResponse) {\n if (!err) {\n // The zone is now deleted.\n }\n});"},{"caption":"

Use force to first empty the zone before deleting it.

","code":"zone.delete({\n force: true\n}, function(err, apiResponse) {\n if (!err) {\n // The zone is now deleted.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.force","description":"
  • Empty the zone before deleting.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"deleteRecords","name":"deleteRecords","type":"instance","description":"

Delete records from this zone. This is a convenience wrapper around dns/zone#createChange.

This method accepts dns/record objects or string record types in its place. This means that you can delete all A records or NS records, etc. If used this way, two API requests are made (one to get, then another to delete), which means the operation is not atomic and could result in unexpected changes.

","source":"packages/dns/src/zone.js#L408","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[{"code":"var oldARecord = zone.record('a', {\n name: 'example.com.',\n data: '1.2.3.4',\n ttl: 86400\n});\n\nvar callback = function(err, change, apiResponse) {\n if (!err) {\n // Delete change modification was created.\n }\n};\n\nzone.deleteRecords(oldARecord, callback);"},{"caption":"

Delete multiple records at once.

","code":"var oldNs1Record = zone.record('ns', {\n name: 'example.com.',\n data: 'ns-cloud1.googledomains.com.',\n ttl: 86400\n});\n\nvar oldNs2Record = zone.record('ns', {\n name: 'example.com.',\n data: 'ns-cloud2.googledomains.com.',\n ttl: 86400\n});\n\nzone.deleteRecords([\n oldNs1Record,\n oldNs2Record\n], callback);"},{"caption":"

Possibly a simpler way to perform the above change is deleting records by \ntype.

","code":"zone.deleteRecords('ns', callback);"},{"caption":"

You can also delete records of multiple types.

","code":"zone.deleteRecords(['ns', 'a'], callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.deleteRecords(oldARecord).then(function(data) {\n var change = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"record","description":"
  • If given a string, it is interpreted as a record type. All records that match that type will be retrieved and then deleted. You can also provide a dns/record object or array of objects.
","types":["dns/record","dns/record[]","string"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.change","description":" ","types":["dns/change"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"empty","name":"empty","type":"instance","description":"

Emptying your zone means leaving only 'NS' and 'SOA' records. This method will first fetch the non-NS and non-SOA records from your zone using dns/zone#getRecords, then use dns/zone#createChange to create a deletion change.

","source":"packages/dns/src/zone.js#L434","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.change","description":" ","types":["dns/change"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"export","name":"export","type":"instance","description":"

Provide a path to a zone file to copy records into the zone.

","source":"packages/dns/src/zone.js#L478","resources":[{"title":"ResourceRecordSets: list API Documentation","link":"https://cloud.google.com/dns/api/v1/resourceRecordSets/list"}],"examples":[{"code":"var zoneFilename = '/Users/stephen/zonefile.zone';\n\nzone.export(zoneFilename, function(err) {\n if (!err) {\n // The zone file was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.export(zoneFilename).then(function() {});"}],"params":[{"name":"localPath","description":"
  • The fully qualified path to the zone file.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API or file system error.
","types":["error"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]},{"id":"getChanges","name":"getChanges","type":"instance","description":"

Get the list of changes associated with this zone. A change is an atomic update to a collection of records.

","source":"packages/dns/src/zone.js#L538","resources":[{"title":"Changes: get API Documentation","link":"https://cloud.google.com/dns/api/v1/changes/get"}],"examples":[{"code":"var callback = function(err, changes, nextQuery, apiResponse) {\n // The `metadata` property is populated for you with the metadata at the\n // time of fetching.\n changes[0].metadata;\n\n // However, in cases where you are concerned the metadata could have\n // changed, use the `getMetadata` method.\n changes[0].getMetadata(function(err, metadata) {});\n\n if (nextQuery) {\n // nextQuery will be non-null if there are more results.\n zone.getChanges(nextQuery, callback);\n }\n};\n\nzone.getChanges(callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getChanges().then(function(data) {\n var changes = data[0];\n});"}],"params":[{"name":"query","description":"
  • The query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • The page token.
","types":["string"],"optional":false,"nullable":false},{"name":"query.sort","description":"
  • Set to 'asc' for ascending, and 'desc' for descending or omit for no sorting.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.changes","description":" ","types":["dns/change[]"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getChangesStream","name":"getChangesStream","type":"instance","description":"

Get the list of dns/change objects associated with this zone as a readable object stream.

","source":"packages/dns/src/zone.js#L604","resources":[],"examples":[{"code":"zone.getChangesStream()\n .on('error', console.error)\n .on('data', function(change) {\n // change is a Change object.\n })\n .on('end', function() {\n // All changes retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getChangesStream()\n .on('data', function(change) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getRecords","name":"getRecords","type":"instance","description":"

Get the list of records for this zone.

","source":"packages/dns/src/zone.js#L678","resources":[{"title":"ResourceRecordSets: list API Documentation","link":"https://cloud.google.com/dns/api/v1/resourceRecordSets/list"}],"examples":[{"code":"var callback = function(err, records, nextQuery, apiResponse) {\n if (!err) {\n // records is an array of Record objects.\n }\n\n if (nextQuery) {\n zone.getRecords(nextQuery, callback);\n }\n};\n\nzone.getRecords(callback);"},{"caption":"

Provide a query for further customization.

","code":"// Get the namespace records for example.com.\nvar query = {\n name: 'example.com.',\n type: 'NS'\n};\n\nzone.getRecords(query, callback);"},{"caption":"

If you only want records of a specific type or types, provide them in \nplace of the query object.

","code":"zone.getRecords('ns', function(err, records) {\n if (!err) {\n // records is an array of NS Record objects in your zone.\n }\n});"},{"caption":"

You can also specify multiple record types.

","code":"zone.getRecords(['ns', 'a', 'cname'], function(err, records) {\n if (!err) {\n // records is an array of NS, A, and CNAME records in your zone.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.getRecords(query).then(function(data) {\n var records = data[0];\n});"}],"params":[{"name":"query","description":"
  • The query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of results to be returned.
","types":["number"],"optional":false,"nullable":false},{"name":"query.name","description":"
  • Restricts the list to return only records with this fully qualified domain name.
","types":["string"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • The page token.
","types":["string"],"optional":false,"nullable":false},{"name":"query.type","description":"
  • Restricts the list to return only records of this type. If present, the "name" parameter must also be present.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.records","description":" ","types":["dns/record[]"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getRecordsStream","name":"getRecordsStream","type":"instance","description":"

Get the list of dns/record objects for this zone as a readable object stream.

","source":"packages/dns/src/zone.js#L759","resources":[],"examples":[{"code":"zone.getRecordsStream()\n .on('error', console.error)\n .on('data', function(record) {\n // record is a Record object.\n })\n .on('end', function() {\n // All records retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"zone.getRecordsStream()\n .on('data', function(change) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"import","name":"import","type":"instance","description":"

Copy the records from a zone file into this zone.

","source":"packages/dns/src/zone.js#L789","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[{"code":"var zoneFilename = '/Users/dave/zonefile.zone';\n\nzone.import(zoneFilename, function(err, change, apiResponse) {\n if (!err) {\n // The change was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.import(zoneFilename).then(function(data) {\n var change = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"localPath","description":"
  • The fully qualified path to the zone file.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API or file system error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.change","description":" ","types":["dns/change"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]},{"id":"record","name":"record","type":"instance","description":"

A dns/record object can be used to construct a record you want to add to your zone, or to refer to an existing one.

Note that using this method will not itself make any API requests. You will use the object returned in other API calls, for example to add a record to your zone or to delete an existing one.

","source":"packages/dns/src/zone.js#L861","resources":[],"examples":[{"caption":"

Reference an existing record to delete from your zone.

","code":"var oldARecord = zone.record('a', {\n name: 'example.com.',\n data: '1.2.3.4',\n ttl: 86400\n});"},{"caption":"

Construct a record to add to your zone.

","code":"var newARecord = zone.record('a', {\n name: 'example.com.',\n data: '5.6.7.8',\n ttl: 86400\n});"},{"caption":"

Use these records together to create a change.

","code":"zone.createChange({\n add: newARecord,\n delete: oldARecord\n}, function(err, change, apiResponse) {});"}],"params":[{"name":"type","description":"
  • The type of record to construct or the type of record you are referencing.
","types":["string"],"optional":false,"nullable":false},{"name":"metadata","description":"
  • The metadata of this record.
","types":["object"],"optional":false,"nullable":false},{"name":"metadata.name","description":"
  • The name of the record, e.g. www.example.com..
","types":["string"],"optional":false,"nullable":false},{"name":"metadata.data","description":" ","types":["string[]"],"optional":false,"nullable":false},{"name":"metadata.ttl","description":"
  • Seconds that the resource is cached by resolvers.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["dns/record"],"description":""}]},{"id":"replaceRecords","name":"replaceRecords","type":"instance","description":"

Provide a record type that should be deleted and replaced with other records.

This is not an atomic request. Two API requests are made (one to get records of the type that you've requested, then another to replace them), which means the operation is not atomic and could result in unexpected changes.

","source":"packages/dns/src/zone.js#L915","resources":[{"title":"ManagedZones: create API Documentation","link":"https://cloud.google.com/dns/api/v1/managedZones/create"}],"examples":[{"code":"var newNs1Record = zone.record('ns', {\n name: 'example.com.',\n data: 'ns-cloud1.googledomains.com.',\n ttl: 86400\n});\n\nvar newNs2Record = zone.record('ns', {\n name: 'example.com.',\n data: 'ns-cloud2.googledomains.com.',\n ttl: 86400\n});\n\nvar newNsRecords = [\n newNs1Record,\n newNs2Record\n];\n\nzone.replaceRecords('ns', newNsRecords, function(err, change, apiResponse) {\n if (!err) {\n // The change was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"zone.replaceRecords('ns', newNsRecords).then(function(data) {\n var change = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"recordTypes","description":"
  • Type(s) of records to replace.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"newRecords","description":"
  • The record objects to add.
","types":["dns/record","dns/record[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.change","description":" ","types":["dns/change"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]}],"path":"zone.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/faq.md b/json/google-cloud/v0.51.1/faq.md new file mode 100644 index 00000000000..2d1f51d4b28 --- /dev/null +++ b/json/google-cloud/v0.51.1/faq.md @@ -0,0 +1,25 @@ +## How do I use this module with Google Compute Engine? + +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. + + +## I'm not using Compute Engine. What do I need to do? + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account, please see our [Authentication][auth-guide] guide. + + +## How do I use this module with AWS Lambda? + +Our library uses some native libraries, which must be recompiled against the platform running your application. For AWS Lambda, we recommend using [lambda-packager](https://github.com/tomdale/lambda-packager) prior to deploying your code. + +Reference Issues: [#1287](https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1287), [#1297](https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1297) + + +## Does this replace [Cloud Node.js Client][googleapis]? + +Cloud Node.js Client is a client library for using the broad set of Google APIs. This module is built specifically for the Google Cloud Platform and is the recommended way to integrate Cloud APIs into your Node.js applications. If your application requires both Google Cloud Platform and other Google APIs, the 2 libraries may be used together. + +[dev-console]: https://console.developers.google.com/project +[gce-how-to]: https://developers.google.com/compute/docs/authentication#using +[googleapis]: https://github.com/google/google-api-nodejs-client +[auth-guide]: #/authentication diff --git a/json/google-cloud/v0.51.1/index.json b/json/google-cloud/v0.51.1/index.json new file mode 100644 index 00000000000..44972ca6544 --- /dev/null +++ b/json/google-cloud/v0.51.1/index.json @@ -0,0 +1 @@ +{"id":"google-cloud","type":"class","name":"gcloud","overview":"

\n This class allows you interact with Google Cloud.\n

\n\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud')();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud')({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/google-cloud/src/index.js","parent":null,"children":[],"methods":[{"id":"bigquery","name":"bigquery","type":"instance","description":"

Analyze Big Data in the cloud with Google BigQuery. Run fast, SQL-like queries against multi-terabyte datasets in seconds. Scalable and easy to use, BigQuery gives you real-time insights about your data.

","source":"packages/google-cloud/src/index.js#L49","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar bigquery = gcloud.bigquery({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["bigquery"],"description":""}]},{"id":"bigtable","name":"bigtable","type":"instance","description":"

Cloud Bigtable is Google's NoSQL Big Data database service. It's the same database that powers many core Google services, including Search, Analytics, Maps, and Gmail.

","source":"packages/google-cloud/src/index.js#L69","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar bigtable = gcloud.bigtable({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json',\n zone: 'us-central1-b',\n cluster: 'google-cloud-node'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["bigtable"],"description":""}]},{"id":"compute","name":"compute","type":"instance","description":"

With Compute Engine, you can run large-scale workloads on virtual machines hosted on Google's infrastructure. Choose a VM that fits your needs and gain the performance of Google’s worldwide fiber network.

","source":"packages/google-cloud/src/index.js#L88","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar gce = gcloud.compute({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["compute"],"description":""}]},{"id":"datastore","name":"datastore","type":"instance","description":"

Cloud Datastore is a fully managed, schemaless database for storing non-relational data. Use this object to create a Dataset to interact with your data, an "Int", and a "Double" representation.

","source":"packages/google-cloud/src/index.js#L107","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar datastore = gcloud.datastore({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["datastore"],"description":""}]},{"id":"dns","name":"dns","type":"instance","description":"

Cloud DNS is a high-performance, resilient, global DNS service that provides a cost- effective way to make your applications and services available to your users. This programmable, authoritative DNS service can be used to easily publish and manage DNS records using the same infrastructure relied upon by Google.

","source":"packages/google-cloud/src/index.js#L128","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar dns = gcloud.dns({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["dns"],"description":""}]},{"id":"language","name":"language","type":"instance","description":"

The Cloud Natural Language API provides natural language understanding technologies to developers, including sentiment analysis, entity recognition, and syntax analysis.

","source":"packages/google-cloud/src/index.js#L146","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar language = gcloud.language({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["language"],"description":""}]},{"id":"logging","name":"logging","type":"instance","description":"

Stackdriver Logging allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services (AWS).

","source":"packages/google-cloud/src/index.js#L164","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar logging = gcloud.logging({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["logging"],"description":""}]},{"id":"monitoring","name":"monitoring","type":"instance","description":"

Stackdriver Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Stackdriver ingests that data and generates insights via dashboards, charts, and alerts.

This is an auto-generated API

It does not follow the conventions you're familiar with from other parts of our library. A handwritten layer is not yet available.

The example below shows you how to instantiate the generated client. For further documentation, please browse the Monitoring .proto files on GitHub.

","source":"packages/google-cloud/src/index.js#L195","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar monitoring = gcloud.monitoring.v3({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["monitoring"],"description":""}]},{"id":"prediction","name":"prediction","type":"instance","description":"

The Google Prediction API provides pattern-matching and machine learning capabilities. Given a set of data examples to train against, you can create applications that can perform the following tasks:

  • Given a user's past viewing habits, predict what other movies or products a user might like.
  • Categorize emails as spam or non-spam.
  • Analyze posted comments about your product to determine whether they have a positive or negative tone.
  • Guess how much a user might spend on a given day, given his spending history.
","source":"packages/google-cloud/src/index.js#L222","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar prediction = gcloud.prediction({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["prediction"],"description":""}]},{"id":"pubsub","name":"pubsub","type":"instance","description":"

Cloud Pub/Sub is a reliable, many-to-many, asynchronous messaging service from Cloud Platform.

","source":"packages/google-cloud/src/index.js#L240","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar pubsub = gcloud.pubsub({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["pubsub"],"description":""}]},{"id":"resource","name":"resource","type":"instance","description":"

The Cloud Resource Manager provides methods that you can use to programmatically manage your projects in the Google Cloud Platform. With this API, you can do the following:

  • Get a list of all projects associated with an account.
  • Create new projects.
  • Update existing projects.
  • Delete projects.
  • Recover projects.
","source":"packages/google-cloud/src/index.js#L264","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar resource = gcloud.resource({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["resource"],"description":""}]},{"id":"spanner","name":"spanner","type":"instance","description":"

Cloud Spanner is a highly scalable, transactional, managed, NewSQL database service. Cloud Spanner solves the need for a horizontally-scaling database with consistent global transaction and SQL semantics. With Cloud Spanner you don't need to choose between consistency and horizontal scaling — you get both.

","source":"packages/google-cloud/src/index.js#L284","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar spanner = gcloud.spanner({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["spanner"],"description":""}]},{"id":"speech","name":"speech","type":"instance","description":"

The Cloud Speech API enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Cloud Speech API service.

","source":"packages/google-cloud/src/index.js#L303","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar speech = gcloud.speech({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["speech"],"description":""}]},{"id":"storage","name":"storage","type":"instance","description":"

Cloud Storage allows you to store data on Google infrastructure. Read Cloud Storage API docs for more information.

","source":"packages/google-cloud/src/index.js#L321","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar gcs = gcloud.storage({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["storage"],"description":""}]},{"id":"translate","name":"translate","type":"instance","description":"

With Cloud Translation, you can dynamically translate text between thousands of language pairs.

This API lets websites and programs integrate with Cloud Translation API programmatically.

","source":"packages/google-cloud/src/index.js#L340","resources":[],"examples":[{"code":"var gcloud = require('google-cloud');\nvar translate = gcloud.translate({\n key: 'API Key'\n});"}],"params":[],"exceptions":[],"returns":[{"types":["translate"],"description":""}]},{"id":"vision","name":"vision","type":"instance","description":"

The Cloud Vision API allows easy integration of vision detection features, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.

To learn more about the Vision API, see the Getting Started guide.

","source":"packages/google-cloud/src/index.js#L361","resources":[],"examples":[{"code":"var gcloud = require('google-cloud')({\n keyFilename: '/path/to/keyfile.json',\n projectId: 'grape-spaceship-123'\n});\n\nvar vision = gcloud.vision();"}],"params":[],"exceptions":[],"returns":[]},{"id":"gcloud","name":"gcloud","type":"constructor","description":"

There are two key ways to use the gcloud module.

  1. Provide connection & configuration details up-front.

  2. Provide them at the time of instantiation of sub-modules, e.g. a Datastore dataset, a Cloud Storage bucket, etc.

Advanced Usage

Interceptors

All of the returned modules hold a special interceptors array you can use to have control over the flow of the internal operations of this library. As of now, we support a request interceptor, allowing you to tweak all of the API request options before the HTTP request is sent.

Note: If you are using the maxApiCalls option with a method, your request interceptor will still be called, even if the maxApiCalls limit was reached. The request to the API will still be prevented.

See the example below for more.

","source":"packages/google-cloud/src/index.js#L509","resources":[],"examples":[{"code":"var gcloud = require('google-cloud')({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});"},{"caption":"

From the same authentication credentials, you may now access your Google \nCloud Storage buckets, for example.

","code":"var gcs = gcloud.storage();\nvar bucket = gcs.bucket('photos');"},{"caption":"

However, if you need to override the global credentials, you may provide \nnew ones.

","code":"var otherGcs = gcloud.storage({\n keyFilename: '/path/to/other/keyfile.json'\n});\nvar otherBucket = otherGcs.bucket('other-photos');"},{"caption":"

gcs and otherGcs will use their respective credentials for all future \nAPI requests. \n

Interceptors

\nUse a request interceptor to set a custom HTTP header on your requests.

","code":"gcloud.interceptors.push({\n request: function(requestOptions) {\n requestOptions.headers = requestOptions.headers || {};\n requestOptions.headers['X-Cloud-Trace-Context'] = 'I will be overridden';\n return requestOptions;\n }\n});"},{"caption":"

You can also set an interceptor on the service level, like a Storage \nobject.

","code":"gcs.interceptors.push({\n request: function(requestOptions) {\n requestOptions.headers = requestOptions.headers || {};\n requestOptions.headers['X-Cloud-Trace-Context'] = 'I will be overridden';\n return requestOptions;\n }\n});"},{"caption":"

Additionally, set one on the service object level, such as a Bucket.

","code":"bucket.interceptors.push({\n request: function(requestOptions) {\n requestOptions.headers = requestOptions.headers || {};\n requestOptions.headers['X-Cloud-Trace-Context'] = 'I win!';\n return requestOptions;\n }\n});"},{"caption":"

The following request will combine all of the headers, executed in the \norder from when they were assigned, respecting the hierarchy: \nglobal before service before service object.

","code":"bucket.getMetadata(function() {\n // This HTTP request was sent with the 'I win!' header specified above.\n});"},{"caption":"

By default any methods that return a Promise object will use the native \nPromise constructor. If you wish to use a third-party library such as \nBluebird, you can specify this via the promise option.

","code":"var gcloud = require('google-cloud')({\n promise: require('bluebird')\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.projectId","description":"
  • The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.
","types":["string"],"optional":false,"nullable":false},{"name":"options.keyFilename","description":"
  • Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option above is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.
","types":["string"],"optional":false,"nullable":false},{"name":"options.email","description":"
  • Account email address. Required when using a .pem or .p12 keyFilename.
","types":["string"],"optional":false,"nullable":false},{"name":"options.credentials","description":"
  • Credentials object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.credentials.client_email","description":"","types":["string"],"optional":false,"nullable":false},{"name":"options.credentials.private_key","description":"","types":["string"],"optional":false,"nullable":false},{"name":"options.autoRetry","description":"
  • Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default. (default: true)
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxRetries","description":"
  • Maximum number of automatic retries attempted before returning the error. (default: 3)
","types":["number"],"optional":false,"nullable":false},{"name":"options.promise","description":"
  • Custom promise module to use instead of native Promises.
","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/language/document.json b/json/google-cloud/v0.51.1/language/document.json new file mode 100644 index 00000000000..9f4bc4ce5c1 --- /dev/null +++ b/json/google-cloud/v0.51.1/language/document.json @@ -0,0 +1 @@ +{"id":"language/document","type":"class","name":"Document","overview":"

\n This class allows you interact with Cloud Natural Language.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/language.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar language = gcloud.language();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar language = gcloud.language({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/language/src/document.js","parent":"language","children":[],"methods":[{"id":"Document","name":"Document","type":"constructor","description":"

Create a Natural Language Document object. From this object, you will be able to run multiple detections.

","source":"packages/language/src/document.js#L63","resources":[],"examples":[{"code":"var textToAnalyze = [\n 'Google is an American multinational technology company specializing in',\n 'Internet-related services and products.'\n].join(' ');\n\nvar document = language.document(textToAnalyze);"},{"caption":"

Create a Document object with pre-defined configuration, such as its \nlanguage.

","code":"var spanishDocument = language.document('¿Dónde está la sede de Google?', {\n language: 'es'\n});"}],"params":[{"name":"config","description":"
  • Configuration object, the inline content of the document, or a Storage File object.
","types":["object","string","storage/file"],"optional":false,"nullable":false},{"name":"options.content","description":"
  • If using config as an object to specify the language of the document, use this property to pass the inline content of the document or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["language/document"],"description":""}]},{"id":"annotate","name":"annotate","type":"instance","description":"

Run an annotation of the text from the document.

By default, all annotation types are requested:

  • The sentiment of the document (positive or negative)
  • The entities of the document (people, places, things, etc.)
  • The syntax of the document (adjectives, nouns, verbs, etc.)

See the examples below for how to request a subset of those types.

If you only need one type of annotation, you may appreciate one of these other methods from our API:

","source":"packages/language/src/document.js#L389","resources":[{"title":"documents.annotateText API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/annotateText"}],"examples":[{"code":"document.annotate(function(err, annotation) {\n if (err) {\n // Error handling omitted.\n }\n\n // annotation = {\n // language: 'en',\n // sentiment: {\n // magnitude: 0.5,\n // score: 0.5\n // },\n // entities: [\n // {\n // name: 'Google',\n // type: 'ORGANIZATION',\n // metadata: {\n // mid: '/m/045c7b',\n // wikipedia_url: 'http://en.wikipedia.org/wiki/Google'\n // },\n // salience: 0.7532734870910645,\n // mentions: [\n // {\n // text: {\n // content: 'Google',\n // beginOffset: -1\n // },\n // type: 'PROPER'\n // },\n // // ...\n // }\n // }\n // ],\n // sentences: [\n // {\n // text: {\n // content: 'Google is an American multinational technology...',\n // beginOffset: -1\n // },\n // sentiment: {\n // magnitude: 0.5,\n // score: 0.5\n // }\n // }\n // ],\n // tokens: [\n // {\n // text: {\n // content: 'Google',\n // beginOffset: -1\n // },\n // partOfSpeech: {\n // tag: 'NOUN',\n // aspect: 'ASPECT_UNKNOWN',\n // case: 'CASE_UNKNOWN',\n // form: 'FORM_UNKNOWN',\n // gender: 'GENDER_UNKNOWN',\n // mood: 'MOOD_UNKNOWN',\n // number: 'SINGULAR',\n // person: 'PERSON_UNKNOWN',\n // proper: 'PROPER',\n // reciprocity: 'RECIPROCITY_UNKNOWN',\n // tense: 'TENSE_UNKNOWN',\n // voice: 'VOICE_UNKNOWN'\n // },\n // dependencyEdge: {\n // headTokenIndex: 1,\n // label: 'NSUBJ'\n // },\n // lemma: 'Google'\n // },\n // // ...\n // ]\n // }\n});"},{"caption":"

To request only certain annotation types, provide an options object.

","code":"var options = {\n entities: true,\n sentiment: true\n};\n\ndocument.annotate(function(err, annotation) {\n if (err) {\n // Error handling omitted.\n }\n\n // annotation = {\n // language: 'en',\n // sentiment: {\n // magnitude: 0.5,\n // score: 0.5\n // },\n // entities: [\n // {\n // name: 'Google',\n // type: 'ORGANIZATION',\n // metadata: {\n // mid: '/m/045c7b',\n // wikipedia_url: 'http://en.wikipedia.org/wiki/Google'\n // },\n // salience: 0.7532734870910645,\n // mentions: [\n // {\n // text: {\n // content: 'Google',\n // beginOffset: -1\n // },\n // type: 'PROPER'\n // },\n // // ...\n // }\n // }\n // ]\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"document.annotate().then(function(data) {\n var annotation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"options.entities","description":"
  • Detect the entities from this document. By default, all features (entities, sentiment, and syntax) are enabled. By overriding any of these values, all defaults are switched to false. (Alias for options.extractEntities)
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.sentiment","description":"
  • Detect the sentiment from this document. By default, all features (entities, sentiment, and syntax) are enabled. By overriding any of these values, all defaults are switched to false. (Alias for options.extractSentiment)
","types":["number"],"optional":false,"nullable":false},{"name":"options.syntax","description":"
  • Detect the syntax from this document. By default, all features (entities, sentiment, and syntax) are enabled. By overriding any of these values, all defaults are switched to false. (Alias for options.extractDocumentSyntax)
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error occurred while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.annotation","description":"
  • The formatted API response.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.annotation.language","description":"
  • The language detected from the text.
","types":["string"],"optional":false,"nullable":false},{"name":"callback.annotation.sentiment","description":"
  • An object representing the overall sentiment of the text.
","types":["number"],"optional":false,"nullable":false},{"name":"callback.annotation.entities","description":"
  • The recognized entities from the text, grouped by the type of entity.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.annotation.sentences","description":"
  • Sentences detected from the text.
","types":["string[]"],"optional":false,"nullable":false},{"name":"callback.annotation.tokens","description":"
  • Parts of speech that were detected from the text.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectEntities","name":"detectEntities","type":"instance","description":"

Detect entities from the document.

","source":"packages/language/src/document.js#L514","resources":[{"title":"documents.analyzeEntities API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeEntities"}],"examples":[{"code":"document.detectEntities(function(err, entities) {\n if (err) {\n // Error handling omitted.\n }\n\n // entities = [\n // {\n // name: 'Google',\n // type: 'ORGANIZATION',\n // metadata: {\n // mid: '/m/045c7b',\n // wikipedia_url: 'http://en.wikipedia.org/wiki/Google'\n // },\n // salience: 0.7532734870910645,\n // mentions: [\n // {\n // text: {\n // content: 'Google',\n // beginOffset: -1\n // },\n // type: 'PROPER'\n // },\n // // ...\n // }\n // },\n // // ...\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"document.detectEntities().then(function(data) {\n var entities = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"options.verbose","description":"
  • Enable verbose mode for more detailed results. Default: false
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error occurred while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entities","description":"
  • The recognized entities from the text, grouped by the type of entity.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectSentiment","name":"detectSentiment","type":"instance","description":"

Detect the sentiment of the text in this document.

","source":"packages/language/src/document.js#L570","resources":[{"title":"documents.analyzeSentiment API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeSentiment"}],"examples":[{"code":"document.detectSentiment(function(err, sentiment) {\n if (err) {\n // Error handling omitted.\n }\n\n // sentiment = {\n // magnitude: 0.5,\n // score: 0.5\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"document.detectSentiment().then(function(data) {\n var sentiment = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error occurred while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.sentiment","description":"
  • An object representing the overall sentiment of the text.
","types":["number"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectSyntax","name":"detectSyntax","type":"instance","description":"

Detect syntax from the document.

","source":"packages/language/src/document.js#L649","resources":[{"title":"documents.analyzeSyntax API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeSyntax"}],"examples":[{"code":"document.detectSyntax(function(err, syntax) {\n if (err) {\n // Error handling omitted.\n }\n\n // syntax = [\n // {\n // text: {\n // content: 'Google',\n // beginOffset: -1\n // },\n // partOfSpeech: {\n // tag: 'NOUN',\n // aspect: 'ASPECT_UNKNOWN',\n // case: 'CASE_UNKNOWN',\n // form: 'FORM_UNKNOWN',\n // gender: 'GENDER_UNKNOWN',\n // mood: 'MOOD_UNKNOWN',\n // number: 'SINGULAR',\n // person: 'PERSON_UNKNOWN',\n // proper: 'PROPER',\n // reciprocity: 'RECIPROCITY_UNKNOWN',\n // tense: 'TENSE_UNKNOWN',\n // voice: 'VOICE_UNKNOWN'\n // },\n // dependencyEdge: {\n // headTokenIndex: 1,\n // label: 'NSUBJ'\n // },\n // lemma: 'Google'\n // },\n // // ...\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"document.detectSyntax().then(function(data) {\n var syntax = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error occurred while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.syntax","description":"
  • The syntax recognized from the text.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectEncodingType_","name":"detectEncodingType_","type":"instance","description":"

Check if the user provided an encodingType, and map it to its API value.

","source":"packages/language/src/document.js#L678","resources":[],"examples":[],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["string"],"description":"
  • The encodingType, as understood by the API.
"}]}],"path":"document.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/language/index.json b/json/google-cloud/v0.51.1/language/index.json new file mode 100644 index 00000000000..413a43f7e02 --- /dev/null +++ b/json/google-cloud/v0.51.1/language/index.json @@ -0,0 +1 @@ +{"id":"language","type":"class","name":"Language","overview":"

\n This class allows you interact with Cloud Natural Language.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/language.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar language = gcloud.language();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar language = gcloud.language({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/language/src/index.js","parent":null,"children":["language/document","language/v1","language/v1beta2"],"methods":[{"id":"Language","name":"Language","type":"constructor","description":"

The Cloud Natural Language API provides natural language understanding technologies to developers, including sentiment analysis, entity recognition, and syntax analysis. This API is part of the larger Cloud Machine Learning API.

The Cloud Natural Language API currently supports English, Spanish, and Japanese for sentiment analysis, entity analysis and syntax analysis.

","source":"packages/language/src/index.js#L64","resources":[{"title":"Cloud Natural Language API Documentation","link":"https://cloud.google.com/natural-language/docs"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"options.apiVersion","description":"
  • Either v1 or v1beta2. v1beta2 is a newer release than v1, and still in beta. By choosing it, you are opting into new, back-end behavior which is not officially supported by the design of this API. (Default: v1)
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"annotate","name":"annotate","type":"instance","description":"

Run an annotation of a block of text.

NOTE: This is a convenience method which doesn't require creating a language/document object. If you are only running a single detection, this may be more convenient. However, if you plan to run multiple detections, it's easier to create a language/document object.

","source":"packages/language/src/index.js#L157","resources":[{"title":"documents.annotate API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/annotateText"}],"examples":[{"caption":"

See language/document#annotate for a detailed breakdown of \nthe arguments your callback will be executed with.

","code":"function callback(err, entities, apiResponse) {}\n\nlanguage.annotate('Hello!', callback);"},{"caption":"

Or, provide a reference to a file hosted on Cloud Storage.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-file');\n\nlanguage.annotate(file, callback);"},{"caption":"

Specify HTML content.

","code":"var options = {\n type: 'html'\n};\n\nlanguage.annotate('Hello!', options, callback);"},{"caption":"

Specify the language the text is written in.

","code":"var options = {\n language: 'es',\n entities: true\n};\n\nlanguage.annotate('¿Dónde está la sede de Google?', options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"language.annotate('Hello!').then(function(data) {\n var entities = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"content","description":"
  • Inline content or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false},{"name":"options.type","description":"
  • The type of document, either html or text.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectEntities","name":"detectEntities","type":"instance","description":"

Detect the entities from a block of text.

NOTE: This is a convenience method which doesn't require creating a language/document object. If you are only running a single detection, this may be more convenient. However, if you plan to run multiple detections, it's easier to create a language/document object.

","source":"packages/language/src/index.js#L239","resources":[{"title":"documents.analyzeEntities API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeEntities"}],"examples":[{"caption":"

See language/document#detectEntities for a detailed breakdown of \nthe arguments your callback will be executed with.

","code":"function callback(err, entities, apiResponse) {}\n\nlanguage.detectEntities('Axel Foley is from Detroit', callback);"},{"caption":"

Or, provide a reference to a file hosted on Cloud Storage.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-file');\n\nlanguage.detectEntities(file, callback);"},{"caption":"

Specify HTML content.

","code":"var options = {\n type: 'html'\n};\n\nlanguage.detectEntities('Axel Foley is from Detroit', options, callback);"},{"caption":"

Specify the language the text is written in.

","code":"var options = {\n language: 'es'\n};\n\nlanguage.detectEntities('Axel Foley es de Detroit', options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"language.detectEntities('Axel Foley is from Detroit').then(function(data) {\n var entities = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"content","description":"
  • Inline content or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false},{"name":"options.type","description":"
  • The type of document, either html or text.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectSentiment","name":"detectSentiment","type":"instance","description":"

Detect the sentiment of a block of text.

NOTE: This is a convenience method which doesn't require creating a language/document object. If you are only running a single detection, this may be more convenient. However, if you plan to run multiple detections, it's easier to create a language/document object.

","source":"packages/language/src/index.js#L312","resources":[{"title":"documents.analyzeSentiment API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeSentiment"}],"examples":[{"caption":"

See language/document#detectSentiment for a detailed breakdown of \nthe arguments your callback will be executed with.

","code":"function callback(err, sentiment, apiResponse) {}\n\nlanguage.detectSentiment('Hello!', callback);"},{"caption":"

Or, provide a reference to a file hosted on Cloud Storage.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-file');\n\nlanguage.detectSentiment(file, callback);"},{"caption":"

Specify HTML content.

","code":"var options = {\n type: 'html'\n};\n\nlanguage.detectSentiment('<h1>Document Title</h1>', options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"language.detectSentiment('Hello!').then(function(data) {\n var sentiment = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"content","description":"
  • Inline content or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false},{"name":"options.type","description":"
  • The type of document, either html or text.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectSyntax","name":"detectSyntax","type":"instance","description":"

Detect the syntax of a block of text.

NOTE: This is a convenience method which doesn't require creating a language/document object. If you are only running a single detection, this may be more convenient. However, if you plan to run multiple detections, it's easier to create a language/document object.

","source":"packages/language/src/index.js#L394","resources":[{"title":"documents.analyzeSyntax API Documentation","link":"https://cloud.google.com/natural-language/reference/rest/v1/documents/analyzeSyntax"}],"examples":[{"caption":"

See language/document#detectSyntax for a detailed breakdown of \nthe arguments your callback will be executed with.

","code":"function callback(err, syntax, apiResponse) {}\n\nlanguage.detectSyntax('Axel Foley is from Detroit', callback);"},{"caption":"

Or, provide a reference to a file hosted on Cloud Storage.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-file');\n\nlanguage.detectSyntax(file, callback);"},{"caption":"

Specify HTML content.

","code":"var options = {\n type: 'html'\n};\n\nlanguage.detectSyntax('Axel Foley is from Detroit', options, callback);"},{"caption":"

Specify the language the text is written in.

","code":"var options = {\n language: 'es'\n};\n\nlanguage.detectSyntax('Axel Foley es de Detroit', options, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"language.detectSyntax('Axel Foley is from Detroit').then(function(data) {\n var syntax = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"content","description":"
  • Inline content or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • UTF8 (also, buffer), UTF16 (also string), or UTF32. (Alias for options.encodingType). Default: 'UTF8' if a Buffer, otherwise 'UTF16'. See EncodingType
","types":["string"],"optional":false,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false},{"name":"options.type","description":"
  • The type of document, either html or text.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":" ","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"document","name":"document","type":"instance","description":"

Create a Document object for an unknown type. If you know the type, use the appropriate method below:

","source":"packages/language/src/index.js#L453","resources":[],"examples":[{"code":"var document = language.document('Inline content of an unknown type.');"},{"caption":"

Or, provide a reference to a file hosted on Cloud Storage.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-file');\n\nvar document = language.document(file);"},{"caption":"

Create a Document object with pre-defined configuration, such as its \nlanguage.

","code":"var document = language.document('¿Dónde está la sede de Google?', {\n language: 'es'\n});"},{"caption":"

You can now run detections on the document. \nSee language/document for a complete list of methods available.

","code":"document.detectEntities(function(err, entities) {});"}],"params":[{"name":"config","description":"
  • Configuration object, the inline content of the document, or a Storage File object.
","types":["object","string","storage/file"],"optional":false,"nullable":false},{"name":"options.content","description":"
  • If using config as an object to specify the encoding and/or language of the document, use this property to pass the inline content of the document or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["language/document"],"description":""}]},{"id":"html","name":"html","type":"instance","description":"

Create a Document object from an HTML document. You may provide either inline HTML content or a Storage File object (see storage/file).

","source":"packages/language/src/index.js#L496","resources":[],"examples":[{"code":"var document = language.html('<h1>Document Title</h1>');"},{"caption":"

Or, provide a reference to a file hosted on Cloud Storage.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-file.html');\n\nvar document = language.html(file);"},{"caption":"

Create a Document object with pre-defined configuration, such as its \nlanguage.

","code":"var document = language.html('<h1>Titulo del documento</h1>', {\n language: 'es'\n});"},{"caption":"

You can now run detections on the document. \nSee language/document for a complete list of methods available.

","code":"document.detectEntities(function(err, entities) {});"}],"params":[{"name":"content","description":"
  • Inline HTML content or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["language/document"],"description":""}]},{"id":"text","name":"text","type":"instance","description":"

Create a Document object from a text-based document. You may provide either inline text content or a Storage File object (see storage/file).

","source":"packages/language/src/index.js#L544","resources":[],"examples":[{"code":"var document = language.text('This is using inline text content.');"},{"caption":"

Or, provide a reference to a file hosted on Cloud Storage.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-file.txt');\n\nvar document = language.text(file);"},{"caption":"

Create a Document object with pre-defined configuration, such as its \nlanguage.

","code":"var document = language.text('¿Dónde está la sede de Google?', {\n language: 'es'\n});"},{"caption":"

You can now run detections on the document. \nSee language/document for a complete list of methods available.

","code":"document.detectEntities(function(err, entities) {});"}],"params":[{"name":"content","description":"
  • Inline text content or a Storage File object.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.language","description":"
  • The language of the text.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["language/document"],"description":""}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/logging/entry.json b/json/google-cloud/v0.51.1/logging/entry.json new file mode 100644 index 00000000000..4c05b1537b1 --- /dev/null +++ b/json/google-cloud/v0.51.1/logging/entry.json @@ -0,0 +1 @@ +{"id":"logging/entry","type":"class","name":"Entry","overview":"

\n This class allows you interact with Cloud Logging.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/logging.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/logging/src/entry.js","parent":"logging","children":[],"methods":[{"id":"Entry","name":"Entry","type":"constructor","description":"

Create an entry object to define new data to insert into a log.

","source":"packages/logging/src/entry.js#L87","resources":[{"title":"LogEntry JSON representation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry"}],"examples":[{"code":"var syslog = logging.log('syslog');\n\nvar metadata = {\n resource: {\n type: 'gce_instance',\n labels: {\n zone: 'global',\n instance_id: '3'\n }\n }\n};\n\nvar entry = syslog.entry(metadata, {\n delegate: 'my_username'\n});\n\nsyslog.alert(entry, function(err, apiResponse) {\n if (!error) {\n // Log entry inserted successfully.\n }\n});"},{"caption":"

You will also receive Entry objects when using \nlogging#getEntries and logging/log#getEntries.

","code":"logging.getEntries(function(err, entries) {\n if (!err) {\n // entries[0].data = The data value from the log entry.\n }\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"data","description":"
  • The data to use as the value for this log entry.

    If providing an object, these value types are supported:

    • String
    • Number
    • Boolean
    • Buffer
    • Object
    • Array

      Any other types are stringified with String(value).

","types":["object","string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["logging/entry"],"description":""}]}],"path":"entry.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/logging/index.json b/json/google-cloud/v0.51.1/logging/index.json new file mode 100644 index 00000000000..df1ff847b4e --- /dev/null +++ b/json/google-cloud/v0.51.1/logging/index.json @@ -0,0 +1 @@ +{"id":"logging","type":"class","name":"Logging","overview":"

\n This class allows you interact with Cloud Logging.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/logging.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/logging/src/index.js","parent":null,"children":["logging/entry","logging/log","logging/metadata","logging/sink","logging/v2"],"methods":[{"id":"Logging","name":"Logging","type":"constructor","description":"

Stackdriver Logging allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services (AWS).

","source":"packages/logging/src/index.js#L66","resources":[{"title":"What is Stackdriver Logging?","link":"https://cloud.google.com/logging/docs"},{"title":"Introduction to the Stackdriver Logging API","link":"https://cloud.google.com/logging/docs/api"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createSink","name":"createSink","type":"instance","description":"

Create a sink.

","source":"packages/logging/src/index.js#L132","resources":[{"title":"Sink Overview","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks"},{"title":"Advanced Logs Filters","link":"https://cloud.google.com/logging/docs/view/advanced_filters"},{"title":"projects.sinks.create API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create"}],"examples":[{"code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\n\nvar config = {\n destination: gcs.bucket('logging-bucket'),\n filter: 'severity = ALERT'\n};\n\nfunction callback(err, sink, apiResponse) {\n // `sink` is a Sink object.\n}\n\nlogging.createSink('new-sink-name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"logging.createSink('new-sink-name', config).then(function(data) {\n var sink = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"name","description":"
  • Name of the sink.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.gaxOptions","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.destination","description":"
  • The destination. The proper ACL scopes will be granted to the provided destination.
","types":["storage/bucket","bigquery/dataset","pubsub/topic"],"optional":false,"nullable":false},{"name":"config.filter","description":"
  • An advanced logs filter. Only log entries matching the filter are written.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.sink","description":"
  • The created Sink object.
","types":["logging/sink"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

if a name is not provided.

"},{"type":"Error","description":"

if a config object is not provided.

"}],"returns":[]},{"id":"entry","name":"entry","type":"instance","description":"

Create an entry object.

Note that using this method will not itself make any API requests. You will use the object returned in other API calls, such as logging/log#write.

","source":"packages/logging/src/index.js#L226","resources":[{"title":"LogEntry JSON representation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry"}],"examples":[{"code":"var resource = {\n type: 'gce_instance',\n labels: {\n zone: 'global',\n instance_id: '3'\n }\n};\n\nvar entry = logging.entry(resource, {\n delegate: 'my_username'\n});\n\nentry.toJSON();\n// {\n// resource: {\n// type: 'gce_instance',\n// labels: {\n// zone: 'global',\n// instance_id: '3'\n// }\n// },\n// jsonPayload: {\n// delegate: 'my_username'\n// }\n// }"}],"params":[{"name":"resource","description":" ","types":["object","string"],"optional":true,"nullable":false},{"name":"data","description":"
  • The data to use as the value for this log entry.
","types":["object","string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["logging/entry"],"description":""}]},{"id":"getEntries","name":"getEntries","type":"instance","description":"

List the entries in your logs.

","source":"packages/logging/src/index.js#L282","resources":[{"title":"entries.list API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list"}],"examples":[{"code":"logging.getEntries(function(err, entries) {\n // `entries` is an array of Stackdriver Logging entry objects.\n // See the `data` property to read the data from the entry.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, entries, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n logging.getEntries(nextQuery, callback);\n }\n}\n\nlogging.getEntries({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"logging.getEntries().then(function(data) {\n var entries = data[0];\n});"}],"params":[{"name":"options","description":"
  • Filtering options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.gaxOptions","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"options.orderBy","description":"
  • How the results should be sorted, timestamp (oldest first) and timestamp desc (newest first, default).
","types":["string"],"optional":false,"nullable":false},{"name":"options.pageSize","description":"
  • Maximum number of logs to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entries","description":"
  • Entries from your logs.
","types":["logging/entry[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getEntriesStream","name":"getEntriesStream","type":"instance","description":"

List the logging/entry objects in your logs as a readable object stream.

","source":"packages/logging/src/index.js#L346","resources":[],"examples":[{"code":"logging.getEntriesStream()\n .on('error', console.error)\n .on('data', function(entry) {\n // `entry` is a Stackdriver Logging entry object.\n // See the `data` property to read the data from the entry.\n })\n .on('end', function() {\n // All entries retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"logging.getEntriesStream()\n .on('data', function(entry) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getSinks","name":"getSinks","type":"instance","description":"

Get the sinks associated with this project.

","source":"packages/logging/src/index.js#L419","resources":[{"title":"projects.sinks.list API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/list"}],"examples":[{"code":"logging.getSinks(function(err, sinks) {\n // sinks is an array of Sink objects.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"logging.getSinks().then(function(data) {\n var sinks = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.gaxOptions","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.sinks","description":"
  • Sink objects.
","types":["logging/sink[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSinksStream","name":"getSinksStream","type":"instance","description":"

Get the logging/sink objects associated with this project as a readable object stream.

","source":"packages/logging/src/index.js#L485","resources":[],"examples":[{"code":"logging.getSinksStream()\n .on('error', console.error)\n .on('data', function(sink) {\n // `sink` is a Sink object.\n })\n .on('end', function() {\n // All sinks retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"logging.getSinksStream()\n .on('data', function(sink) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"log","name":"log","type":"instance","description":"

Get a reference to a Stackdriver Logging log.

","source":"packages/logging/src/index.js#L543","resources":[{"title":"Log Overview","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs"}],"examples":[{"code":"var log = logging.log('my-log');"}],"params":[{"name":"name","description":"
  • Name of the existing log.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.removeCircular","description":"
  • Replace circular references in logged objects with a string value, [Circular]. (Default: false)
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["logging/log"],"description":""}]},{"id":"sink","name":"sink","type":"instance","description":"

Get a reference to a Stackdriver Logging sink.

","source":"packages/logging/src/index.js#L558","resources":[{"title":"Sink Overview","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks"}],"examples":[{"code":"var sink = logging.sink('my-sink');"}],"params":[{"name":"name","description":"
  • Name of the existing sink.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["logging/sink"],"description":""}]},{"id":"request","name":"request","type":"instance","description":"

Funnel all API requests through this method, to be sure we have a project ID.

","source":"packages/logging/src/index.js#L571","resources":[],"examples":[],"params":[{"name":"config","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"config.gaxOpts","description":"
  • GAX options.
","types":["object"],"optional":false,"nullable":false},{"name":"config.method","description":"
  • The gax method to call.
","types":["function"],"optional":false,"nullable":false},{"name":"config.reqOpts","description":"
  • Request options.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/logging/log.json b/json/google-cloud/v0.51.1/logging/log.json new file mode 100644 index 00000000000..ac9f08061d3 --- /dev/null +++ b/json/google-cloud/v0.51.1/logging/log.json @@ -0,0 +1 @@ +{"id":"logging/log","type":"class","name":"Log","overview":"

\n This class allows you interact with Cloud Logging.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/logging.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/logging/src/log.js","parent":"logging","children":[],"methods":[{"id":"Log","name":"Log","type":"constructor","description":"

A log is a named collection of entries, each entry representing a timestamped event. Logs can be produced by Google Cloud Platform services, by third-party services, or by your applications. For example, the log apache-access is produced by the Apache Web Server, but the log compute.googleapis.com/activity_log is produced by Google Compute Engine.

","source":"packages/logging/src/log.js#L65","resources":[{"title":"Introduction to Logs","link":"https://cloud.google.com/logging/docs/basic-concepts#logs"}],"examples":[{"code":"var log = logging.log('syslog');"}],"params":[{"name":"name","description":"
  • Name of the log.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.removeCircular","description":"
  • Replace circular references in logged objects with a string value, [Circular]. (Default: false)
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"alert","name":"alert","type":"instance","description":"

Write a log entry with a severity of "ALERT".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L136","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.alert(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.alert(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"critical","name":"critical","type":"instance","description":"

Write a log entry with a severity of "CRITICAL".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L160","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.critical(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.critical(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"debug","name":"debug","type":"instance","description":"

Write a log entry with a severity of "DEBUG".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L185","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.debug(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.debug(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the log.

","source":"packages/logging/src/log.js#L215","resources":[{"title":"projects.logs.delete API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs/delete"}],"examples":[{"code":"log.delete(function(err, apiResponse) {\n if (!err) {\n // The log was deleted.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"gaxOptions","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"emergency","name":"emergency","type":"instance","description":"

Write a log entry with a severity of "EMERGENCY".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L253","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.emergency(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.emergency(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"entry","name":"entry","type":"instance","description":"

Create an entry object for this log.

Note that using this method will not itself make any API requests. You will use the object returned in other API calls, such as logging/log#write.

","source":"packages/logging/src/log.js#L303","resources":[{"title":"LogEntry JSON representation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry"}],"examples":[{"code":"var metadata = {\n resource: {\n type: 'gce_instance',\n labels: {\n zone: 'global',\n instance_id: '3'\n }\n }\n};\n\nvar entry = log.entry(metadata, {\n delegate: 'my_username'\n});\n\nentry.toJSON();\n// {\n// logName: 'projects/grape-spaceship-123/logs/syslog',\n// resource: {\n// type: 'gce_instance',\n// labels: {\n// zone: 'global',\n// instance_id: '3'\n// }\n// },\n// jsonPayload: {\n// delegate: 'my_username'\n// }\n// }"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"data","description":"
  • The data to use as the value for this log entry.
","types":["object","string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["logging/entry"],"description":""}]},{"id":"error","name":"error","type":"instance","description":"

Write a log entry with a severity of "ERROR".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L336","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.error(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.error(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getEntries","name":"getEntries","type":"instance","description":"

This method is a wrapper around logging#getEntries, but with a filter specified to only return entries from this log.

","source":"packages/logging/src/log.js#L393","resources":[{"title":"entries.list API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/list"}],"examples":[{"code":"log.getEntries(function(err, entries) {\n // `entries` is an array of Stackdriver Logging entry objects.\n // See the `data` property to read the data from the entry.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, entries, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n log.getEntries(nextQuery, callback);\n }\n}\n\nlog.getEntries({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.getEntries().then(function(data) {\n var entries = data[0];\n});"}],"params":[{"name":"options","description":"
  • Filtering options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.orderBy","description":"
  • How the results should be sorted, timestamp (oldest first) and timestamp desc (newest first, default).
","types":["string"],"optional":false,"nullable":false},{"name":"options.pageSize","description":"
  • Maximum number of logs to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.entries","description":"
  • Entries from this log.
","types":["logging/entry[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getEntriesStream","name":"getEntriesStream","type":"instance","description":"

This method is a wrapper around logging#getEntriesStream, but with a filter specified to only return logging/entry objects from this log.

","source":"packages/logging/src/log.js#L434","resources":[],"examples":[{"code":"log.getEntriesStream()\n .on('error', console.error)\n .on('data', function(entry) {\n // `entry` is a Stackdriver Logging entry object.\n // See the `data` property to read the data from the entry.\n })\n .on('end', function() {\n // All entries retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"log.getEntriesStream()\n .on('data', function(entry) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"info","name":"info","type":"instance","description":"

Write a log entry with a severity of "INFO".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L462","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.info(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.info(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"notice","name":"notice","type":"instance","description":"

Write a log entry with a severity of "NOTICE".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L486","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.notice(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.notice(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"warning","name":"warning","type":"instance","description":"

Write a log entry with a severity of "WARNING".

This is a simple wrapper around logging/log#write. All arguments are the same as documented there.

","source":"packages/logging/src/log.js#L510","resources":[],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.warning(entry, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.warning(entry).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"write","name":"write","type":"instance","description":"

Write log entries to Stackdriver Logging.

While you may write a single entry at a time, batching multiple entries together is preferred to avoid reaching the queries per second limit.

","source":"packages/logging/src/log.js#L588","resources":[{"title":"entries.write API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write"}],"examples":[{"code":"var entry = log.entry('gce_instance', {\n instance: 'my_instance'\n});\n\nlog.write(entry, function(err, apiResponse) {\n if (!err) {\n // The log entry was written.\n }\n});"},{"caption":"

You may also pass multiple log entries to write.

","code":"var secondEntry = log.entry('compute.googleapis.com', {\n user: 'my_username'\n});\n\nlog.write([\n entry,\n secondEntry\n], function(err, apiResponse) {\n if (!err) {\n // The log entries were written.\n }\n});"},{"caption":"

To save some steps, you can also pass in plain values as your entries. \nNote, however, that you must provide a configuration object to specify the \nresource.

","code":"var entries = [\n {\n user: 'my_username'\n },\n {\n home: process.env.HOME\n }\n];\n\nvar options = {\n resource: 'compute.googleapis.com'\n};\n\nlog.write(entries, options, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"log.write(entries).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"entry","description":"
  • A log entry, or array of entries, to write.
","types":["logging/entry","logging/entry[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.gaxOptions","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"options.labels","description":"
  • Labels to set on the log.
","types":["object[]"],"optional":false,"nullable":false},{"name":"options.resource","description":"
  • A default monitored resource for entries where one isn't specified.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"log.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/logging/sink.json b/json/google-cloud/v0.51.1/logging/sink.json new file mode 100644 index 00000000000..fceac4a73d6 --- /dev/null +++ b/json/google-cloud/v0.51.1/logging/sink.json @@ -0,0 +1 @@ +{"id":"logging/sink","type":"class","name":"Sink","overview":"

\n This class allows you interact with Cloud Logging.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/logging.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar logging = gcloud.logging({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/logging/src/sink.js","parent":"logging","children":[],"methods":[{"id":"Sink","name":"Sink","type":"constructor","description":"

A sink is an object that lets you to specify a set of log entries to export to a particular destination. Stackdriver Logging lets you export log entries to destinations including Cloud Storage buckets (for long term log storage), Google BigQuery datasets (for log analysis), Google Pub/Sub (for streaming to other applications).

","source":"packages/logging/src/sink.js#L48","resources":[{"title":"Introduction to Sinks","link":"https://cloud.google.com/logging/docs/basic-concepts#sinks"}],"examples":[{"code":"var sink = logging.sink('my-sink');"}],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a sink.

","source":"packages/logging/src/sink.js#L80","resources":[],"examples":[{"code":"var config = {\n destination: {\n // ...\n }\n};\n\nsink.create(config, function(err, sink, apiResponse) {\n if (!err) {\n // The sink was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"sink.create(config).then(function(data) {\n var sink = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the sink.

","source":"packages/logging/src/sink.js#L110","resources":[{"title":"projects.sink.delete API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/delete"}],"examples":[{"code":"sink.delete(function(err, apiResponse) {\n if (!err) {\n // The log was deleted.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"sink.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"gaxOptions","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the sink's metadata.

","source":"packages/logging/src/sink.js#L153","resources":[{"title":"Sink Resource","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks#LogSink"},{"title":"projects.sink.get API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/get"}],"examples":[{"code":"sink.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"sink.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"gaxOptions","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The sink's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setFilter","name":"setFilter","type":"instance","description":"

Set the sink's filter.

This will override any filter that was previously set.

","source":"packages/logging/src/sink.js#L204","resources":[{"title":"Advanced Logs Filters","link":"https://cloud.google.com/logging/docs/view/advanced_filters"}],"examples":[{"code":"var filter = 'metadata.severity = ALERT';\n\nsink.setFilter(filter, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"sink.setFilter(filter).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"filter","description":"
  • The new filter.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the sink's metadata.

","source":"packages/logging/src/sink.js#L239","resources":[{"title":"Sink Resource","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks#LogSink"},{"title":"projects.sink.update API Documentation","link":"https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update"}],"examples":[{"code":"var metadata = {\n filter: 'metadata.severity = ALERT'\n};\n\nsink.setMetadata(metadata, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"sink.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"metadata.gaxOptions","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"sink.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/monitoring/index.json b/json/google-cloud/v0.51.1/monitoring/index.json new file mode 100644 index 00000000000..d2f8676104c --- /dev/null +++ b/json/google-cloud/v0.51.1/monitoring/index.json @@ -0,0 +1 @@ +{"id":"monitoring","type":"class","name":"Monitoring","overview":"

\n This class allows you interact with Cloud Monitoring.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/monitoring.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar monitoring = gcloud.monitoring();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar monitoring = gcloud.monitoring({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/monitoring/src/index.js","parent":null,"children":["monitoring/v3"],"methods":[{"id":"Monitoring","name":"Monitoring","type":"constructor","description":"

Stackdriver Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Stackdriver ingests that data and generates insights via dashboards, charts, and alerts.

This is an auto-generated API

It does not follow the conventions you're familiar with from other parts of our library. A handwritten layer is not yet available.

The example below shows you how to instantiate the generated client. For further documentation, please browse the Monitoring .proto files on GitHub.

","source":"packages/monitoring/src/index.js#L44","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/prediction/index.json b/json/google-cloud/v0.51.1/prediction/index.json new file mode 100644 index 00000000000..3b993a4fd7b --- /dev/null +++ b/json/google-cloud/v0.51.1/prediction/index.json @@ -0,0 +1 @@ +{"id":"prediction","type":"class","name":"Prediction","overview":"

\n This class allows you interact with Prediction API.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/prediction.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar prediction = gcloud.prediction();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar prediction = gcloud.prediction({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/prediction/src/index.js","parent":null,"children":["prediction/model"],"methods":[{"id":"Prediction","name":"Prediction","type":"constructor","description":"

The Google Prediction API provides pattern-matching and machine learning capabilities. Given a set of data examples to train against, you can create applications that can perform the following tasks:

  • Given a user's past viewing habits, predict what other movies or products a user might like.
  • Categorize emails as spam or non-spam.
  • Analyze posted comments about your product to determine whether they have a positive or negative tone.
  • Guess how much a user might spend on a given day, given his spending history.
","source":"packages/prediction/src/index.js#L59","resources":[{"title":"Hello Prediction! Example","link":"https://cloud.google.com/prediction/docs/hello_world"},{"title":"What is the Google Prediction API?","link":"https://cloud.google.com/prediction/docs/getting-started"},{"title":"Developers Guide","link":"https://cloud.google.com/prediction/docs/developer-guide"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createModel","name":"createModel","type":"instance","description":"

Create a trained model.

You may optionally provide a storage/file as a data source to train the new model. If you have a CSV file, but haven't put it in a bucket yet, you will need to reference a bucket with storage/bucket, a file with storage/file, and upload it with storage/file#upload.

","source":"packages/prediction/src/index.js#L133","resources":[{"title":"Trainedmodels: insert API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/insert"}],"examples":[{"code":"prediction.createModel('my-model', function(err, model, apiResponse) {\n // `model` is a Model object.\n});"},{"caption":"

Create a model, using an existing CSV file in a Cloud Storage \nbucket as training data.

","code":"var gcs = require('@google-cloud/storage')({\n projectId: 'grape-spaceship-123'\n});\nvar bucket = gcs.bucket('my-bucket');\nvar modelDataCsv = bucket.file('my-model.csv');\n\nprediction.createModel('my-model', {\n data: modelDataCsv\n}, function(err, model, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"prediction.createModel('my-model').then(function(data) {\n var model = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"id","description":"
  • Unique name for the model. E.g. "my-model"
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.data","description":"
  • A CSV file to use as training data.
","types":["storage/file"],"optional":false,"nullable":false},{"name":"options.type","description":"
  • The type of model, classification (categorical, text labels) or regression (numeric labels). Learn more about these options in the Developers Guide.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.model","description":" ","types":["prediction/model"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a model ID is not provided.

"}],"returns":[]},{"id":"getModels","name":"getModels","type":"instance","description":"

Gets a list of trained models for the project.

","source":"packages/prediction/src/index.js#L236","resources":[{"title":"Trainedmodels: list API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/list"}],"examples":[{"code":"prediction.getModels(function(err, models) {\n if (!err) {\n // models is an array of Model objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, models, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n prediction.getModels(nextQuery, callback);\n }\n\n // The `metadata` property is populated for you with the metadata at the\n // time of fetching.\n models[0].metadata;\n\n // However, in cases where you are concerned the metadata could have\n // changed, use the `getMetadata` method.\n models[0].getMetadata(function(err, metadata) {});\n};\n\nprediction.getModels({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"prediction.getModels().then(function(data) {\n var models = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Page token.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.models","description":"
  • The trained models from your project.
","types":["prediction/model[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getModelsStream","name":"getModelsStream","type":"instance","description":"

Gets a list of prediction/model objects for the project as a readable object stream.

","source":"packages/prediction/src/index.js#L298","resources":[],"examples":[{"code":"prediction.getModelsStream()\n .on('error', console.error)\n .on('data', function(model) {\n // model is a Model object.\n })\n .on('end', function() {\n // All models retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"prediction.getModelsStream()\n .on('data', function(model) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"model","name":"model","type":"instance","description":"

Create a model object representing a trained model.

","source":"packages/prediction/src/index.js#L311","resources":[],"examples":[{"code":"var model = prediction.model('my-model');"}],"params":[{"name":"id","description":"
  • The unique ID of the trained model.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"error","description":"

If a model ID is not provided.

"}],"returns":[{"types":["prediction/model"],"description":""}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/prediction/model.json b/json/google-cloud/v0.51.1/prediction/model.json new file mode 100644 index 00000000000..c8df736ec01 --- /dev/null +++ b/json/google-cloud/v0.51.1/prediction/model.json @@ -0,0 +1 @@ +{"id":"prediction/model","type":"class","name":"Model","overview":"

\n This class allows you interact with Prediction API.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/prediction.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar prediction = gcloud.prediction();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar prediction = gcloud.prediction({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/prediction/src/model.js","parent":"prediction","children":[],"methods":[{"id":"Model","name":"Model","type":"constructor","description":"

A Model object represents a trained model. You can train it by using prediction/model#train or ask for predictions with prediction/model#query.

","source":"packages/prediction/src/model.js#L50","resources":[{"title":"Developer's Guide: Training Your Model","link":"https://cloud.google.com/prediction/docs/developer-guide#trainingtheapi"},{"title":"Model Resource","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels"}],"examples":[{"code":"var model = prediction.model('my-model');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a trained model.

","source":"packages/prediction/src/model.js#L72","resources":[],"examples":[{"code":"model.create(function(err, model, apiResponse) {\n if (!err) {\n // The model was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.create().then(function(data) {\n var model = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the model.

","source":"packages/prediction/src/model.js#L94","resources":[{"title":"Trainedmodels: delete API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/delete"}],"examples":[{"code":"model.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the model exists.

","source":"packages/prediction/src/model.js#L114","resources":[],"examples":[{"code":"model.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the model exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a model if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/prediction/src/model.js#L141","resources":[],"examples":[{"code":"model.get(function(err, model, apiResponse) {\n // `model.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.get().then(function(data) {\n var model = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata for the model.

","source":"packages/prediction/src/model.js#L164","resources":[{"title":"Trainedmodels: get API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/get"}],"examples":[{"code":"model.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • Metadata of the model from the API.
","types":["object"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Sets the metadata of the Model object.

NOTE: What you probably want is prediction/model#train, which wraps this method.

","source":"packages/prediction/src/model.js#L197","resources":[{"title":"Trainedmodels: update API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/update"}],"examples":[{"code":"var metadata = {\n output: 'english',\n csvInstance: [\n 'Hello, this is an English sentence!'\n ]\n};\n\nmodel.setMetadata(metadata, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":"
  • Metadata to save on the Model.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"analyze","name":"analyze","type":"instance","description":"

Get an analysis of the model and the data it was trained on.

","source":"packages/prediction/src/model.js#L245","resources":[{"title":"Trainedmodels: analyze API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/analyze"}],"examples":[{"code":"model.analyze(function(err, analysis, apiResponse) {\n if (!err) {\n // `analysis.data` == {...}\n // `analysis.model` == {...}\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.analyze().then(function(data) {\n var analysis = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.analysis","description":" ","types":["object"],"optional":false,"nullable":true},{"name":"callback.analysis.data","description":"
  • Analysis of the data stored in this model.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.analysis.model","description":"
  • Analysis of the model.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createWriteStream","name":"createWriteStream","type":"instance","description":"

Create a writable stream to train the model with new data.

This is a wrapper around prediction/model#train.

","source":"packages/prediction/src/model.js#L287","resources":[],"examples":[{"code":"var stream = model.createWriteStream('english');\n\nstream\n .on('error', function(err) {\n // Uh oh, an error occurred!\n })\n .on('finish', function() {\n // The model will now be processing the new data.\n });\n\nstream.write('Hello, this is an English sentence!');\nstream.write('...yeah, I assumed that when I was able to read it.');\nstream.end();"}],"params":[{"name":"label","description":"
  • The output value, either a regression or class label.
","types":["string","number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["WritableStream"],"description":""}]},{"id":"query","name":"query","type":"instance","description":"

Query the stored data in your model.

","source":"packages/prediction/src/model.js#L377","resources":[{"title":"Trainedmodels:predict API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/predict"}],"examples":[{"caption":"

Assuming this is a model used to return a language name that matches any \ngiven input, this will ask for the prediction results of an english \nsentence.

","code":"model.query('Hello', function(err, results) {\n if (!err) {\n // `results.winner` == 'english'\n // `results.scores` == [\n // {\n // label: 'english',\n // score: 1\n // },\n // ...other results and their scores are listed here.\n // ]\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.query('Hello').then(function(data) {\n var results = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"input","description":"
  • Input feature(s) to query on the model.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.results","description":"
  • An organized set of results from the prediction.
","types":["object"],"optional":false,"nullable":true},{"name":"callback.results.winner","description":"
  • The matching result's label.
","types":["string"],"optional":false,"nullable":false},{"name":"callback.results.scores","description":"
  • Sorted from highest-to-lowest, all of the results that matched the query. This will not be present if
     querying a regression model. 
","types":["object[]"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"train","name":"train","type":"instance","description":"

Update the stored data with new input.

","source":"packages/prediction/src/model.js#L437","resources":[{"title":"Trainedmodels: update API Documentation","link":"https://cloud.google.com/prediction/docs/reference/v1.6/trainedmodels/update"}],"examples":[{"code":"model.train('english', 'Hello from Stephen!', function(err, apiResponse) {\n if (!err) {\n // New data was inserted successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"model.train('english', 'Hello from Stephen!').then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"label","description":"
  • The output value, either a regression or class label.
","types":["string","number"],"optional":false,"nullable":false},{"name":"input","description":"
  • The input features for this data entry.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"model.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/pubsub/index.json b/json/google-cloud/v0.51.1/pubsub/index.json new file mode 100644 index 00000000000..1b96ac4ab57 --- /dev/null +++ b/json/google-cloud/v0.51.1/pubsub/index.json @@ -0,0 +1 @@ +{"id":"pubsub","type":"class","name":"PubSub","overview":"

\n This class allows you interact with Cloud Pub/Sub.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/pubsub.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar pubsub = gcloud.pubsub();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar pubsub = gcloud.pubsub({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/pubsub/src/index.js","parent":null,"children":["pubsub/iam","pubsub/subscription","pubsub/topic","pubsub/v1"],"methods":[{"id":"PubSub","name":"PubSub","type":"constructor","description":"

Cloud Pub/Sub is a reliable, many-to-many, asynchronous messaging service from Cloud Platform.

The PUBSUB_EMULATOR_HOST environment variable from the gcloud SDK is honored, otherwise the actual API endpoint will be used.

","source":"packages/pubsub/src/index.js#L57","resources":[{"title":"Cloud Pub/Sub overview","link":"https://developers.google.com/pubsub/overview"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createTopic","name":"createTopic","type":"instance","description":"

Create a topic with the given name.

","source":"packages/pubsub/src/index.js#L112","resources":[{"title":"Topics: create API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/create"}],"examples":[{"code":"pubsub.createTopic('my-new-topic', function(err, topic, apiResponse) {\n if (!err) {\n // The topic was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"pubsub.createTopic('my-new-topic').then(function(data) {\n var topic = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"name","description":"
  • Name of the topic.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error from the API call, may be null.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.topic","description":"
  • The newly created topic.
","types":["pubsub/topic"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response from the service.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSubscriptions","name":"getSubscriptions","type":"instance","description":"

Get a list of the subscriptions registered to all of your project's topics. You may optionally provide a query object as the first argument to customize the response.

Your provided callback will be invoked with an error object if an API error occurred or an array of pubsub/subscription objects.

To get subscriptions for a topic, see pubsub/topic.

","source":"packages/pubsub/src/index.js#L196","resources":[{"title":"Subscriptions: list API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/list"}],"examples":[{"code":"pubsub.getSubscriptions(function(err, subscriptions) {\n if (!err) {\n // subscriptions is an array of Subscription objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, subscriptions, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n pubsub.getSubscriptions(nextQuery, callback);\n }\n};\n\npubsub.getSubscriptions({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"pubsub.getSubscriptions().then(function(data) {\n var subscriptions = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageSize","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • Page token.
","types":["string"],"optional":false,"nullable":false},{"name":"options.topic","description":"
  • The name of the topic to list subscriptions from.
","types":["string","pubsub/topic"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error from the API call, may be null.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.subscriptions","description":"
  • The list of subscriptions in your project.
","types":["pubsub/subscription[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response from the service.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSubscriptionsStream","name":"getSubscriptionsStream","type":"instance","description":"

Get a list of the pubsub/subscription objects registered to all of your project's topics as a readable object stream.

","source":"packages/pubsub/src/index.js#L284","resources":[],"examples":[{"code":"pubsub.getSubscriptionsStream()\n .on('error', console.error)\n .on('data', function(subscription) {\n // subscription is a Subscription object.\n })\n .on('end', function() {\n // All subscriptions retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"pubsub.getSubscriptionsStream()\n .on('data', function(topic) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getTopics","name":"getTopics","type":"instance","description":"

Get a list of the topics registered to your project. You may optionally provide a query object as the first argument to customize the response.

","source":"packages/pubsub/src/index.js#L342","resources":[{"title":"Topics: list API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/list"}],"examples":[{"code":"pubsub.getTopics(function(err, topics) {\n if (!err) {\n // topics is an array of Topic objects.\n }\n});"},{"caption":"

Customize the query.

","code":"pubsub.getTopics({\n pageSize: 3\n}, function(err, topics) {});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, rows, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n pubsub.getTopics(nextQuery, callback);\n }\n};\n\npubsub.getTopics({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"pubsub.getTopics().then(function(data) {\n var topics = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageSize","description":"
  • Max number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Page token.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error from the API call, may be null.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.topics","description":"
  • The list of topics returned.
","types":["pubsub/topic[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response from the service.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getTopicsStream","name":"getTopicsStream","type":"instance","description":"

Get a list of the pubsub/topic objects registered to your project as a readable object stream.

","source":"packages/pubsub/src/index.js#L408","resources":[],"examples":[{"code":"pubsub.getTopicsStream()\n .on('error', console.error)\n .on('data', function(topic) {\n // topic is a Topic object.\n })\n .on('end', function() {\n // All topics retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"pubsub.getTopicsStream()\n .on('data', function(topic) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"subscribe","name":"subscribe","type":"instance","description":"

Create a subscription to a topic.

All generated subscription names share a common prefix, autogenerated-.

","source":"packages/pubsub/src/index.js#L480","resources":[{"title":"Subscriptions: create API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create"}],"examples":[{"caption":"

Subscribe to a topic. (Also see pubsub/topic#subscribe).

","code":"var topic = 'messageCenter';\nvar name = 'newMessages';\n\npubsub.subscribe(topic, name, function(err, subscription, apiResponse) {});"},{"caption":"

Omit the name to have one generated automatically. All generated names \nshare a common prefix, autogenerated-.

","code":"pubsub.subscribe(topic, function(err, subscription, apiResponse) {\n // subscription.name = The generated name.\n});"},{"caption":"

Customize the subscription.

","code":"pubsub.subscribe(topic, name, {\n ackDeadlineSeconds: 90,\n autoAck: true,\n interval: 30\n}, function(err, subscription, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"pubsub.subscribe(topic, name).then(function(data) {\n var subscription = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"topic","description":"
  • The Topic to create a subscription to.
","types":["pubsub/topic","string"],"optional":false,"nullable":false},{"name":"subName","description":"
  • The name of the subscription. If a name is not provided, a random subscription name will be generated and created.
","types":["string"],"optional":true,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.ackDeadlineSeconds","description":"
  • The maximum time after receiving a message that you must ack a message before it is redelivered.
","types":["number"],"optional":false,"nullable":false},{"name":"options.autoAck","description":"
  • Automatically acknowledge the message once it's pulled. (default: false)
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.encoding","description":"
  • When pulling for messages, this type is used when converting a message's data to a string. (default: 'utf-8')
","types":["string"],"optional":false,"nullable":false},{"name":"options.interval","description":"
  • Interval in milliseconds to check for new messages. (default: 10)
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxInProgress","description":"
  • Maximum messages to consume simultaneously.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pushEndpoint","description":"
  • A URL to a custom endpoint that messages should be pushed to.
","types":["string"],"optional":false,"nullable":false},{"name":"options.timeout","description":"
  • Set a maximum amount of time in milliseconds on an HTTP request to pull new messages to wait for a response before the connection is broken.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.subscription","description":"
  • The subscription.
","types":["pubsub/subscription"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a Topic instance or topic name is not provided.

"},{"type":"Error","description":"

If a subName is not provided.

"}],"returns":[]},{"id":"subscription","name":"subscription","type":"instance","description":"

Create a Subscription object. This command by itself will not run any API requests. You will receive a pubsub/subscription object, which will allow you to interact with a subscription.

All generated names share a common prefix, autogenerated-.

","source":"packages/pubsub/src/index.js#L579","resources":[],"examples":[{"code":"var subscription = pubsub.subscription('my-subscription');\n\n// Register a listener for `message` events.\nsubscription.on('message', function(message) {\n // Called every time a message is received.\n // message.id = ID of the message.\n // message.ackId = ID used to acknowledge the message receival.\n // message.data = Contents of the message.\n // message.attributes = Attributes of the message.\n // message.timestamp = Timestamp when Pub/Sub received the message.\n});"}],"params":[{"name":"name","description":"
  • The name of the subscription. If a name is not provided, a random subscription name will be generated.
","types":["string"],"optional":true,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoAck","description":"
  • Automatically acknowledge the message once it's pulled. (default: false)
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.encoding","description":"
  • When pulling for messages, this type is used when converting a message's data to a string. (default: 'utf-8')
","types":["string"],"optional":false,"nullable":false},{"name":"options.interval","description":"
  • Interval in milliseconds to check for new messages. (default: 10)
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxInProgress","description":"
  • Maximum messages to consume simultaneously.
","types":["number"],"optional":false,"nullable":false},{"name":"options.timeout","description":"
  • Set a maximum amount of time in milliseconds on an HTTP request to pull new messages to wait for a response before the connection is broken.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["pubsub/subscription"],"description":""}]},{"id":"topic","name":"topic","type":"instance","description":"

Create a Topic object. See pubsub/createTopic to create a topic.

","source":"packages/pubsub/src/index.js#L606","resources":[],"examples":[{"code":"var topic = pubsub.topic('my-topic');\n\ntopic.publish({\n data: 'New message!'\n}, function(err) {});"}],"params":[{"name":"name","description":"
  • The name of the topic.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[{"types":["pubsub/topic"],"description":""}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/pubsub/subscription.json b/json/google-cloud/v0.51.1/pubsub/subscription.json new file mode 100644 index 00000000000..eef0dc81657 --- /dev/null +++ b/json/google-cloud/v0.51.1/pubsub/subscription.json @@ -0,0 +1 @@ +{"id":"pubsub/subscription","type":"class","name":"Subscription","overview":"

\n This class allows you interact with Cloud Pub/Sub.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/pubsub.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar pubsub = gcloud.pubsub();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar pubsub = gcloud.pubsub({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/pubsub/src/subscription.js","parent":"pubsub","children":[],"methods":[{"id":"Subscription","name":"Subscription","type":"constructor","description":"

A Subscription object will give you access to your Cloud Pub/Sub subscription.

Subscriptions are sometimes retrieved when using various methods:

Subscription objects may be created directly with:

All Subscription objects are instances of an EventEmitter. The subscription will pull for messages automatically as long as there is at least one listener assigned for the message event.

","source":"packages/pubsub/src/subscription.js#L146","resources":[],"examples":[{"caption":"

From pubsub#getSubscriptions:

","code":"pubsub.getSubscriptions(function(err, subscriptions) {\n // `subscriptions` is an array of Subscription objects.\n});"},{"caption":"

From pubsub/topic#getSubscriptions:

","code":"var topic = pubsub.topic('my-topic');\ntopic.getSubscriptions(function(err, subscriptions) {\n // `subscriptions` is an array of Subscription objects.\n});"},{"caption":"

From pubsub/topic#subscribe:

","code":"var topic = pubsub.topic('my-topic');\ntopic.subscribe('new-subscription', function(err, subscription) {\n // `subscription` is a Subscription object.\n});"},{"caption":"

From pubsub/topic#subscription:

","code":"var topic = pubsub.topic('my-topic');\nvar subscription = topic.subscription('my-subscription');\n// `subscription` is a Subscription object."},{"caption":"

Once you have obtained a subscription object, you may begin to register \nlisteners. This will automatically trigger pulling for messages.

","code":"// Register an error handler.\nsubscription.on('error', function(err) {});\n\n// Register a listener for `message` events.\nfunction onMessage(message) {\n // Called every time a message is received.\n\n // message.id = ID of the message.\n // message.ackId = ID used to acknowledge the message receival.\n // message.data = Contents of the message.\n // message.attributes = Attributes of the message.\n // message.timestamp = Timestamp when Pub/Sub received the message.\n\n // Ack the message:\n // message.ack(callback);\n\n // Skip the message. This is useful with `maxInProgress` option when\n // creating your subscription. This doesn't ack the message, but allows\n // more messages to be retrieved if your limit was hit.\n // message.skip();\n}\nsubscription.on('message', onMessage);\n\n// Remove the listener from receiving `message` events.\nsubscription.removeListener('message', onMessage);"}],"params":[],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the subscription exists.

","source":"packages/pubsub/src/subscription.js#L171","resources":[],"examples":[{"code":"subscription.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the subscription exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a subscription if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

autoCreate is only available if you accessed this object through pubsub/topic#subscription.

","source":"packages/pubsub/src/subscription.js#L201","resources":[],"examples":[{"code":"subscription.get(function(err, subscription, apiResponse) {\n // `subscription.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.get().then(function(data) {\n var subscription = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata for the subscription.

","source":"packages/pubsub/src/subscription.js#L226","resources":[{"title":"Subscriptions: get API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/get"}],"examples":[{"code":"subscription.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • Metadata of the subscription from the API.
","types":["object"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a subscription.

This is only available if you accessed this object through pubsub/topic#subscription.

","source":"packages/pubsub/src/subscription.js#L271","resources":[],"examples":[{"code":"subscription.create(function(err, subscription, apiResponse) {\n if (!err) {\n // The subscription was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.create().then(function(data) {\n var subscription = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"iam","name":"iam","type":"instance","description":"

IAM (Identity and Access Management) allows you to set permissions on individual resources and offers a wider range of roles: editor, owner, publisher, subscriber, and viewer. This gives you greater flexibility and allows you to set more fine-grained access control.

The IAM access control features described in this document are Beta, including the API methods to get and set IAM policies, and to test IAM permissions. Cloud Pub/Sub's use of IAM features is not covered by any SLA or deprecation policy, and may be subject to backward-incompatible changes.

","source":"packages/pubsub/src/subscription.js#L330","resources":[{"title":"Access Control Overview","link":"https://cloud.google.com/pubsub/access_control"},{"title":"What is Cloud IAM?","link":"https://cloud.google.com/iam/"}],"examples":[{"caption":"

Get the IAM policy for your subscription.

","code":"subscription.iam.getPolicy(function(err, policy) {\n console.log(policy);\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.iam.getPolicy().then(function(data) {\n var policy = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"ack","name":"ack","type":"instance","description":"

Acknowledge to the backend that the message was retrieved. You must provide either a single ackId or an array of ackIds.

","source":"packages/pubsub/src/subscription.js#L429","resources":[{"title":"Subscriptions: acknowledge API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/acknowledge"}],"examples":[{"code":"var ackId = 'ePHEESyhuE8e...';\n\nsubscription.ack(ackId, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.ack(ackId).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"ackIds","description":"
  • An ackId or array of ackIds.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.timeout","description":"
  • Set a maximum amount of time in milliseconds before giving up if no response is received.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false}],"exceptions":[{"type":"Error","description":"

If at least one ackId is not provided.

"}],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the subscription. Pull requests from the current subscription will be errored once unsubscription is complete.

","source":"packages/pubsub/src/subscription.js#L526","resources":[{"title":"Subscriptions: delete API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/delete"}],"examples":[{"code":"subscription.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"pull","name":"pull","type":"instance","description":"

Pull messages from the subscribed topic. If messages were found, your callback is executed with an array of message objects.

Note that messages are pulled automatically once you register your first event listener to the subscription, thus the call to pull is handled for you. If you don't want to start pulling, simply don't register a subscription.on('message', function() {}) event handler.

","source":"packages/pubsub/src/subscription.js#L610","resources":[{"title":"Subscriptions: pull API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/pull"}],"examples":[{"caption":"

Pull all available messages.

","code":"subscription.pull(function(err, messages) {\n // messages = [\n // {\n // ackId: '', // ID used to acknowledge its receival.\n // id: '', // Unique message ID.\n // data: '', // Contents of the message.\n // attributes: {} // Attributes of the message.\n //\n // Helper functions:\n // ack(callback): // Ack the message.\n // skip(): // Free up 1 slot on the sub's maxInProgress value.\n // },\n // // ...\n // ]\n});"},{"caption":"

Pull a single message.

","code":"var opts = {\n maxResults: 1\n};\n\nsubscription.pull(opts, function(err, messages, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.pull(opts).then(function(data) {\n var messages = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.maxResults","description":"
  • Limit the amount of messages pulled.
","types":["number"],"optional":false,"nullable":false},{"name":"options.returnImmediately","description":"
  • If set, the system will respond immediately. Otherwise, wait until new messages are available. Returns if timeout is reached.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setAckDeadline","name":"setAckDeadline","type":"instance","description":"

Modify the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.

","source":"packages/pubsub/src/subscription.js#L699","resources":[{"title":"Subscriptions: modifyAckDeadline API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/modifyAckDeadline"}],"examples":[{"code":"var options = {\n ackIds: ['abc'],\n seconds: 10 // Expire in 10 seconds from call.\n};\n\nsubscription.setAckDeadline(options, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"subscription.setAckDeadline(options).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • The configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.ackIds","description":"
  • The ack id(s) to change.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"options.seconds","description":"
  • Number of seconds after call is made to set the deadline of the ack.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["Function"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"iam.getPolicy","name":"iam.getPolicy","type":"instance","description":"

Get the IAM policy

","source":"packages/pubsub/src/iam.js#L112","resources":[{"title":"Topics: getIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/getIamPolicy"},{"title":"Subscriptions: getIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/getIamPolicy"}],"examples":[{"code":"topic.iam.getPolicy(function(err, policy, apiResponse) {});\n\nsubscription.iam.getPolicy(function(err, policy, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.iam.getPolicy().then(function(data) {\n var policy = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.policy","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"iam.setPolicy","name":"iam.setPolicy","type":"instance","description":"

Set the IAM policy

","source":"packages/pubsub/src/iam.js#L165","resources":[{"title":"Topics: setIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/setIamPolicy"},{"title":"Subscriptions: setIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/setIamPolicy"},{"title":"Policy","link":"https://cloud.google.com/pubsub/docs/reference/rest/Shared.Types/Policy"}],"examples":[{"code":"var myPolicy = {\n bindings: [\n {\n role: 'roles/pubsub.subscriber',\n members: ['serviceAccount:myotherproject@appspot.gserviceaccount.com']\n }\n ]\n};\n\ntopic.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {});\n\nsubscription.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.iam.setPolicy(myPolicy).then(function(data) {\n var policy = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"policy","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"policy.bindings","description":"
  • Bindings associate members with roles.
","types":["array"],"optional":true,"nullable":false},{"name":"policy.rules","description":"
  • Rules to be applied to the policy.
","types":["object[]"],"optional":true,"nullable":false},{"name":"policy.etag","description":"
  • Etags are used to perform a read-modify-write.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.policy","description":"
  • The updated policy.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If no policy is provided.

"}],"returns":[]},{"id":"iam.testPermissions","name":"iam.testPermissions","type":"instance","description":"

Test a set of permissions for a resource.

Permissions with wildcards such as * or storage.* are not allowed.

","source":"packages/pubsub/src/iam.js#L238","resources":[{"title":"Topics: testIamPermissions API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/testIamPermissions"},{"title":"Subscriptions: testIamPermissions API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/testIamPermissions"},{"title":"Permissions Reference","link":"https://cloud.google.com/pubsub/access_control#permissions"}],"examples":[{"caption":"

Test a single permission.

","code":"var test = 'pubsub.topics.update';\n\ntopic.iam.testPermissions(test, function(err, permissions, apiResponse) {\n console.log(permissions);\n // {\n // \"pubsub.topics.update\": true\n // }\n});"},{"caption":"

Test several permissions at once.

","code":"var tests = [\n 'pubsub.subscriptions.consume',\n 'pubsub.subscriptions.update'\n];\n\nsubscription.iam.testPermissions(tests, function(err, permissions) {\n console.log(permissions);\n // {\n // \"pubsub.subscriptions.consume\": true,\n // \"pubsub.subscriptions.update\": false\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.iam.testPermissions(test).then(function(data) {\n var permissions = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"permissions","description":"
  • The permission(s) to test for.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.permissions","description":"
  • A subset of permissions that the caller is allowed
","types":["array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If permissions are not provided.

"}],"returns":[]}],"path":"subscription.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/pubsub/topic.json b/json/google-cloud/v0.51.1/pubsub/topic.json new file mode 100644 index 00000000000..3ca40b3c422 --- /dev/null +++ b/json/google-cloud/v0.51.1/pubsub/topic.json @@ -0,0 +1 @@ +{"id":"pubsub/topic","type":"class","name":"Topic","overview":"

\n This class allows you interact with Cloud Pub/Sub.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/pubsub.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar pubsub = gcloud.pubsub();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar pubsub = gcloud.pubsub({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/pubsub/src/topic.js","parent":"pubsub","children":[],"methods":[{"id":"Topic","name":"Topic","type":"constructor","description":"

A Topic object allows you to interact with a Cloud Pub/Sub topic.

","source":"packages/pubsub/src/topic.js#L50","resources":[],"examples":[{"code":"var topic = pubsub.topic('my-topic');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a topic.

","source":"packages/pubsub/src/topic.js#L75","resources":[],"examples":[{"code":"topic.create(function(err, topic, apiResponse) {\n if (!err) {\n // The topic was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.create().then(function(data) {\n var topic = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the topic. This will not delete subscriptions to this topic.

","source":"packages/pubsub/src/topic.js#L94","resources":[{"title":"Topics: delete API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/delete"}],"examples":[{"code":"topic.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the topic exists.

","source":"packages/pubsub/src/topic.js#L122","resources":[],"examples":[{"code":"topic.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the topic exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a topic if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/pubsub/src/topic.js#L149","resources":[],"examples":[{"code":"topic.get(function(err, topic, apiResponse) {\n // `topic.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.get().then(function(data) {\n var topic = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the official representation of this topic from the API.

","source":"packages/pubsub/src/topic.js#L173","resources":[{"title":"Topics: get API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/get"}],"examples":[{"code":"topic.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The metadata of the Topic.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"iam","name":"iam","type":"instance","description":"

IAM (Identity and Access Management) allows you to set permissions on individual resources and offers a wider range of roles: editor, owner, publisher, subscriber, and viewer. This gives you greater flexibility and allows you to set more fine-grained access control.

The IAM access control features described in this document are Beta, including the API methods to get and set IAM policies, and to test IAM permissions. Cloud Pub/Sub's use of IAM features is not covered by any SLA or deprecation policy, and may be subject to backward-incompatible changes.

","source":"packages/pubsub/src/topic.js#L225","resources":[{"title":"Access Control Overview","link":"https://cloud.google.com/pubsub/access_control"},{"title":"What is Cloud IAM?","link":"https://cloud.google.com/iam/"}],"examples":[{"caption":"

Get the IAM policy for your topic.

","code":"topic.iam.getPolicy(function(err, policy) {\n console.log(policy);\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.iam.getPolicy().then(function(data) {\n var policy = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getSubscriptions","name":"getSubscriptions","type":"instance","description":"

Get a list of the subscriptions registered to this topic. You may optionally provide a query object as the first argument to customize the response.

Your provided callback will be invoked with an error object if an API error occurred or an array of pubsub/subscription objects.

","source":"packages/pubsub/src/topic.js#L313","resources":[{"title":"Subscriptions: list API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics.subscriptions/list"}],"examples":[{"code":"topic.getSubscriptions(function(err, subscriptions) {\n // subscriptions is an array of `Subscription` objects.\n});\n\n// Customize the query.\ntopic.getSubscriptions({\n pageSize: 3\n}, callback);"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, subscriptions, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n topic.getSubscriptions(nextQuery, callback);\n }\n}\n\ntopic.getSubscriptions({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.getSubscriptions().then(function(data) {\n var subscriptions = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageSize","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • Page token.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSubscriptionsStream","name":"getSubscriptionsStream","type":"instance","description":"

Get a list of the pubsub/subscription objects registered to this topic as a readable object stream.

","source":"packages/pubsub/src/topic.js#L352","resources":[],"examples":[{"code":"topic.getSubscriptionsStream()\n .on('error', console.error)\n .on('data', function(subscription) {\n // subscription is a Subscription object.\n })\n .on('end', function() {\n // All subscriptions retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"topic.getSubscriptionsStream()\n .on('data', function(subscription) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"publish","name":"publish","type":"instance","description":"

Publish the provided message or array of messages. On success, an array of messageIds is returned in the response.

","source":"packages/pubsub/src/topic.js#L436","resources":[{"title":"Topics: publish API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/publish"}],"examples":[{"code":"topic.publish('Hello, world!', function(err, messageIds, apiResponse) {});"},{"caption":"

You can also publish a JSON object.

","code":"var registerMessage = {\n userId: 3,\n name: 'Stephen',\n event: 'new user'\n};\n\ntopic.publish(registerMessage, function(err, messageIds, apiResponse) {});"},{"caption":"

You can publish a batch of messages at once by supplying an array.

","code":"var purchaseMessage = {\n data: {\n userId: 3,\n product: 'computer',\n event: 'purchase'\n }\n};\n\ntopic.publish([\n registerMessage,\n purchaseMessage\n], function(err, messageIds, apiResponse) {});"},{"caption":"

Set attributes with your message.

","code":"var message = {\n data: {\n userId: 3,\n product: 'book',\n event: 'rent'\n },\n attributes: {\n key: 'value',\n hello: 'world'\n }\n};\n\nvar options = {\n raw: true\n};\n\ntopic.publish(message, options, function(err, messageIds, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.publish(message).then(function(data) {\n var messageIds = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"message","description":"
  • The message(s) to publish. If you need to provide attributes for the message, you must enable options.raw, then box your message in to an object with a data and attributes property. data will be the raw message value you want to publish, and attributes is a key/value pair of attributes to apply to the message.
","types":["*[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.raw","description":"
  • Enable if you require setting attributes on your messages.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false}],"exceptions":[{"type":"Error","description":"

If no message is provided.

"}],"returns":[]},{"id":"subscribe","name":"subscribe","type":"instance","description":"

Create a subscription to this topic.

All generated subscription names share a common prefix, autogenerated-.

","source":"packages/pubsub/src/topic.js#L533","resources":[{"title":"Subscriptions: create API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create"}],"examples":[{"code":"// Without specifying any options.\ntopic.subscribe('newMessages', function(err, subscription, apiResponse) {});"},{"caption":"

Omit the name to have one generated automatically. All generated names \nshare a common prefix, autogenerated-.

","code":"topic.subscribe(function(err, subscription, apiResponse) {\n // subscription.name = The generated name.\n});\n\n// With options.\ntopic.subscribe('newMessages', {\n ackDeadlineSeconds: 90,\n autoAck: true,\n interval: 30\n}, function(err, subscription, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.subscribe('newMessages').then(function(data) {\n var subscription = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"subName","description":"
  • The name of the subscription. If a name is not provided, a random subscription name will be generated and created.
","types":["string"],"optional":true,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.ackDeadlineSeconds","description":"
  • The maximum time after receiving a message that you must ack a message before it is redelivered.
","types":["number"],"optional":false,"nullable":false},{"name":"options.autoAck","description":"
  • Automatically acknowledge the message once it's pulled. (default: false)
","types":["boolean"],"optional":true,"nullable":false},{"name":"options.encoding","description":"
  • When pulling for messages, this type is used when converting a message's data to a string. (default: 'utf-8')
","types":["string"],"optional":false,"nullable":false},{"name":"options.interval","description":"
  • Interval in milliseconds to check for new messages. (default: 10)
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxInProgress","description":"
  • Maximum messages to consume simultaneously.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pushEndpoint","description":"
  • A URL to a custom endpoint that messages should be pushed to.
","types":["string"],"optional":false,"nullable":false},{"name":"options.timeout","description":"
  • Set a maximum amount of time in milliseconds on an HTTP request to pull new messages to wait for a response before the connection is broken.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"subscription","name":"subscription","type":"instance","description":"

Create a Subscription object. This command by itself will not run any API requests. You will receive a pubsub/subscription object, which will allow you to interact with a subscription.

","source":"packages/pubsub/src/topic.js#L563","resources":[],"examples":[{"code":"var subscription = topic.subscription('my-subscription');\n\n// Register a listener for `message` events.\nsubscription.on('message', function(message) {\n // Called every time a message is received.\n // message.id = ID of the message.\n // message.ackId = ID used to acknowledge the message receival.\n // message.data = Contents of the message.\n // message.attributes = Attributes of the message.\n // message.timestamp = Timestamp when Pub/Sub received the message.\n});"}],"params":[{"name":"name","description":"
  • Name of the subscription.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoAck","description":"
  • Automatically acknowledge the message once it's pulled.
","types":["boolean"],"optional":true,"nullable":false},{"name":"options.interval","description":"
  • Interval in milliseconds to check for new messages.
","types":["number"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["pubsub/subscription"],"description":""}]},{"id":"iam.getPolicy","name":"iam.getPolicy","type":"instance","description":"

Get the IAM policy

","source":"packages/pubsub/src/iam.js#L112","resources":[{"title":"Topics: getIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/getIamPolicy"},{"title":"Subscriptions: getIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/getIamPolicy"}],"examples":[{"code":"topic.iam.getPolicy(function(err, policy, apiResponse) {});\n\nsubscription.iam.getPolicy(function(err, policy, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.iam.getPolicy().then(function(data) {\n var policy = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.policy","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"iam.setPolicy","name":"iam.setPolicy","type":"instance","description":"

Set the IAM policy

","source":"packages/pubsub/src/iam.js#L165","resources":[{"title":"Topics: setIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/setIamPolicy"},{"title":"Subscriptions: setIamPolicy API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/setIamPolicy"},{"title":"Policy","link":"https://cloud.google.com/pubsub/docs/reference/rest/Shared.Types/Policy"}],"examples":[{"code":"var myPolicy = {\n bindings: [\n {\n role: 'roles/pubsub.subscriber',\n members: ['serviceAccount:myotherproject@appspot.gserviceaccount.com']\n }\n ]\n};\n\ntopic.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {});\n\nsubscription.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.iam.setPolicy(myPolicy).then(function(data) {\n var policy = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"policy","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"policy.bindings","description":"
  • Bindings associate members with roles.
","types":["array"],"optional":true,"nullable":false},{"name":"policy.rules","description":"
  • Rules to be applied to the policy.
","types":["object[]"],"optional":true,"nullable":false},{"name":"policy.etag","description":"
  • Etags are used to perform a read-modify-write.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.policy","description":"
  • The updated policy.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If no policy is provided.

"}],"returns":[]},{"id":"iam.testPermissions","name":"iam.testPermissions","type":"instance","description":"

Test a set of permissions for a resource.

Permissions with wildcards such as * or storage.* are not allowed.

","source":"packages/pubsub/src/iam.js#L238","resources":[{"title":"Topics: testIamPermissions API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/testIamPermissions"},{"title":"Subscriptions: testIamPermissions API Documentation","link":"https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/testIamPermissions"},{"title":"Permissions Reference","link":"https://cloud.google.com/pubsub/access_control#permissions"}],"examples":[{"caption":"

Test a single permission.

","code":"var test = 'pubsub.topics.update';\n\ntopic.iam.testPermissions(test, function(err, permissions, apiResponse) {\n console.log(permissions);\n // {\n // \"pubsub.topics.update\": true\n // }\n});"},{"caption":"

Test several permissions at once.

","code":"var tests = [\n 'pubsub.subscriptions.consume',\n 'pubsub.subscriptions.update'\n];\n\nsubscription.iam.testPermissions(tests, function(err, permissions) {\n console.log(permissions);\n // {\n // \"pubsub.subscriptions.consume\": true,\n // \"pubsub.subscriptions.update\": false\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"topic.iam.testPermissions(test).then(function(data) {\n var permissions = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"permissions","description":"
  • The permission(s) to test for.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.permissions","description":"
  • A subset of permissions that the caller is allowed
","types":["array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If permissions are not provided.

"}],"returns":[]}],"path":"topic.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/resource/index.json b/json/google-cloud/v0.51.1/resource/index.json new file mode 100644 index 00000000000..4105c2a63fa --- /dev/null +++ b/json/google-cloud/v0.51.1/resource/index.json @@ -0,0 +1 @@ +{"id":"resource","type":"class","name":"Resource","overview":"

\n This class allows you interact with Cloud Resource Manager.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/resource.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar resource = gcloud.resource();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar resource = gcloud.resource({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/resource/src/index.js","parent":null,"children":["resource/project"],"methods":[{"id":"Resource","name":"Resource","type":"constructor","description":"

* The Cloud Resource Manager provides methods that you can use to programmatically manage your projects in the Google Cloud Platform. With this API, you can do the following:

  • Get a list of all projects associated with an account.
  • Create new projects.
  • Update existing projects.
  • Delete projects.
  • Recover projects.
","source":"packages/resource/src/index.js#L52","resources":[{"title":"What is the Cloud Resource Manager?","link":"https://cloud.google.com/resource-manager"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createProject","name":"createProject","type":"instance","description":"

Create a project.

This method only works if you are authenticated as yourself, e.g. using the gcloud SDK.

","source":"packages/resource/src/index.js#L125","resources":[{"title":"Projects Overview","link":"https://cloud.google.com/compute/docs/networking#networks"},{"title":"projects: create API Documentation","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects/create"}],"examples":[{"code":"var id = 'new-project-id';\n\nresource.createProject(id, function(err, project, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // `project` is a new Project instance.\n // `operation` will emit `error` or `complete` when the status updates.\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Project was created successfully!\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"resource.createProject(id)\n .then(function(data) {\n var project = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n\n return operation.promise();\n })\n .then(function(data) {\n var operationMetadata = data[0];\n\n // Project created successfully!\n });"}],"params":[{"name":"id","description":"
  • ID of the project.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.project","description":"
  • The created Project object.
","types":["resource/project"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getProjects","name":"getProjects","type":"instance","description":"

Get a list of projects.

","source":"packages/resource/src/index.js#L202","resources":[{"title":"Projects Overview","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects"},{"title":"projects: list API Documentation","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects/list"}],"examples":[{"code":"resource.getProjects(function(err, projects) {\n // `projects` is an array of `Project` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, projects, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n resource.getProjects(nextQuery, callback);\n }\n}\n\nresource.getProjects({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"resource.getProjects().then(function(data) {\n var projects = data[0];\n});"}],"params":[{"name":"options","description":"
  • Operation search options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.filter","description":"
  • An expression for filtering the results.
","types":["string"],"optional":false,"nullable":false},{"name":"options.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxResults","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageSize","description":"
  • Maximum number of projects to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operations","description":"
  • Project objects from your account.
","types":["resource/project[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getProjectsStream","name":"getProjectsStream","type":"instance","description":"

Get a list of resource/project objects as a readable object stream.

","source":"packages/resource/src/index.js#L265","resources":[],"examples":[{"code":"resource.getProjectsStream()\n .on('error', console.error)\n .on('data', function(project) {\n // `project` is a `Project` object.\n })\n .on('end', function() {\n // All projects retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"resource.getProjectsStream()\n .on('data', function(project) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"operation","name":"operation","type":"instance","description":"

Get a reference to an existing operation.

","source":"packages/resource/src/index.js#L282","resources":[],"examples":[{"code":"var operation = resource.operation('68850831366825');"}],"params":[{"name":"name","description":"
  • The name of the operation.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[]},{"id":"project","name":"project","type":"instance","description":"

Create a Project object. See resoucemanager/createProject to create a project.

","source":"packages/resource/src/index.js#L305","resources":[],"examples":[{"code":"var project = resource.project('grape-spaceship-123');"}],"params":[{"name":"id","description":"
  • The ID of the project (eg: grape-spaceship-123).
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If an ID is not provided.

"}],"returns":[{"types":["resource/project"],"description":""}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/resource/project.json b/json/google-cloud/v0.51.1/resource/project.json new file mode 100644 index 00000000000..ed1d73da17c --- /dev/null +++ b/json/google-cloud/v0.51.1/resource/project.json @@ -0,0 +1 @@ +{"id":"resource/project","type":"class","name":"Project","overview":"

\n This class allows you interact with Cloud Resource Manager.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/resource.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar resource = gcloud.resource();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar resource = gcloud.resource({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/resource/src/project.js","parent":"resource","children":[],"methods":[{"id":"Project","name":"Project","type":"constructor","description":"

A Project object allows you to interact with a Google Cloud Platform project.

","source":"packages/resource/src/project.js#L43","resources":[{"title":"Projects Overview","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects"},{"title":"Project Resource","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project"}],"examples":[{"code":"var project = resource.project('grape-spaceship-123');"}],"params":[],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a project.

","source":"packages/resource/src/project.js#L82","resources":[],"examples":[{"code":"project.create(function(err, project, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // `operation` will emit `error` or `complete` when the status updates.\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Project was created successfully!\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"project.create()\n .then(function(data) {\n var project = data[0];\n var operation = data[1];\n var apiResponse = data[2];\n\n return operation.promise();\n })\n .then(function(data) {\n var operationMetadata = data[0];\n\n // Project created successfully!\n });"}],"params":[{"name":"config","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the project.

This method only works if you are authenticated as yourself, e.g. using the gcloud SDK.

","source":"packages/resource/src/project.js#L111","resources":[{"title":"projects: delete API Documentation","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects/delete"}],"examples":[{"code":"project.delete(function(err, apiResponse) {\n if (!err) {\n // The project was deleted!\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"project.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the project exists.

","source":"packages/resource/src/project.js#L131","resources":[],"examples":[{"code":"project.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"project.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the project exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a project if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/resource/src/project.js#L158","resources":[],"examples":[{"code":"project.get(function(err, project, apiResponse) {\n // `project.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"project.get().then(function(data) {\n var project = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the metadata for the project.

","source":"packages/resource/src/project.js#L183","resources":[{"title":"projects: get API Documentation","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects/get"}],"examples":[{"code":"project.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"project.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • Metadata of the project from the API.
","types":["object"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the project's metadata.

This method only works if you are authenticated as yourself, e.g. using the gcloud SDK.

","source":"packages/resource/src/project.js#L219","resources":[{"title":"projects: update API Documentation","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects/update"},{"title":"Project Resource","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects#Project"}],"examples":[{"code":"var metadata = {\n name: 'New name'\n};\n\nproject.setMetadata(metadata, function(err, apiResponse) {\n if (!err) {\n // The project has been successfully updated.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"project.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"restore","name":"restore","type":"instance","description":"

Restore a project.

This method only works if you are authenticated as yourself, e.g. using the gcloud SDK.

","source":"packages/resource/src/project.js#L263","resources":[{"title":"projects: undelete API Documentation","link":"https://cloud.google.com/resource-manager/reference/rest/v1/projects/undelete"}],"examples":[{"code":"project.restore(function(err, apiResponse) {\n if (!err) {\n // Project restored.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"project.restore().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"project.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/spanner/database.json b/json/google-cloud/v0.51.1/spanner/database.json new file mode 100644 index 00000000000..0ea1fcc2ef8 --- /dev/null +++ b/json/google-cloud/v0.51.1/spanner/database.json @@ -0,0 +1 @@ +{"id":"spanner/database","type":"class","name":"Database","overview":"

\n This class allows you interact with Cloud Spanner.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/spanner.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/spanner/src/database.js","parent":"spanner","children":[],"methods":[{"id":"Database","name":"Database","type":"constructor","description":"

Create a Database object to interact with a Cloud Spanner database.

","source":"packages/spanner/src/database.js#L94","resources":[],"examples":[{"code":"var instance = spanner.instance('my-instance');\nvar database = instance.database('my-database');"}],"params":[{"name":"name","description":"
  • Name of the database.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Session pool configuration options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.acquireTimeout","description":"
  • Time in milliseconds before giving up trying to acquire a session. If the specified value is 0, a timeout will not occur. (Default: 0)
","types":["number"],"optional":false,"nullable":false},{"name":"options.fail","description":"
  • If set to true, an error will be thrown when there are no available sessions for a request. (Default: false)
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.max","description":"
  • Maximum number of resources to create at any given time. (Default: Number.MAX_SAFE_INTEGER)
","types":["number"],"optional":false,"nullable":false},{"name":"options.maxIdle","description":"
  • Maximum number of idle resources to keep in the pool at any given time.
","types":["number"],"optional":false,"nullable":false},{"name":"options.min","description":"
  • Minimum number of resources to keep in the pool at any given time. (Default: 0)
","types":["number"],"optional":false,"nullable":false},{"name":"options.keepAlive","description":"
  • How often to ping idle sessions, in minutes. Must be less than 1 hour.
","types":["number"],"optional":false,"nullable":false},{"name":"options.writes","description":"
  • Pre-allocate transactions for the number of sessions specified.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a database.

","source":"packages/spanner/src/database.js#L134","resources":[],"examples":[{"code":"database.create(function(err, database, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Database created successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.create()\n .then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n\n return operation.promise();\n })\n .then(function() {\n // Database created successfully.\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if a database exists.

","source":"packages/spanner/src/database.js#L154","resources":[],"examples":[{"code":"database.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the database exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a database if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/spanner/src/database.js#L181","resources":[],"examples":[{"code":"database.get(function(err, database, apiResponse) {\n // `database.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.get().then(function(data) {\n var database = data[0];\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"close","name":"close","type":"instance","description":"

Close the database connection and destroy all sessions associated with it.

","source":"packages/spanner/src/database.js#L234","resources":[],"examples":[{"code":"database.close(function(err) {\n if (err) {\n // Error handling omitted.\n }\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]},{"id":"createTable","name":"createTable","type":"instance","description":"

Create a table.

","source":"packages/spanner/src/database.js#L288","resources":[],"examples":[{"code":"var schema =\n 'CREATE TABLE Singers (' +\n ' SingerId INT64 NOT NULL,' +\n ' FirstName STRING(1024),' +\n ' LastName STRING(1024),' +\n ' SingerInfo BYTES(MAX),' +\n ') PRIMARY KEY(SingerId)';\n\ndatabase.createTable(schema, function(err, table, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Table created successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.createTable(schema)\n .then(function(data) {\n var table = data[0];\n var operation = data[1];\n\n return operation.promise();\n })\n .then(function() {\n // Table created successfully.\n });"}],"params":[{"name":"schema","description":"
  • A DDL CREATE statement describing the table.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.table","description":"
  • The Table object.
","types":["spanner/table"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the database.

","source":"packages/spanner/src/database.js#L329","resources":[{}],"examples":[{"code":"database.delete(function(err, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // Database was deleted successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the database's metadata.

","source":"packages/spanner/src/database.js#L362","resources":[{}],"examples":[{"code":"database.getMetadata(function(err, metadata, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // Database was deleted successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The database's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getSchema","name":"getSchema","type":"instance","description":"

Get this database's schema as a list of formatted DDL statements.

","source":"packages/spanner/src/database.js#L390","resources":[{},{}],"examples":[{"code":"database.getSchema(function(err, statements, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.getSchema().then(function(data) {\n var statements = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.statements","description":"
  • An array of database DDL statements.
","types":["string[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"run","name":"run","type":"instance","description":"

Execute a SQL statement on this database.

","source":"packages/spanner/src/database.js#L485","resources":[{},{}],"examples":[{"code":"var query = 'SELECT * FROM Singers';\n\ndatabase.run(query, function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n var row1 = rows[0];\n\n // row1 = [\n // {\n // name: 'SingerId',\n // value: '1'\n // },\n // {\n // name: 'Name',\n // value: 'Eddie Wilson'\n // }\n // ]\n});"},{"caption":"

Rows are returned as an array of object arrays. Each object has a name \nand value property. To get a serialized object, call toJSON().

","code":"database.run(query, function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n var row1 = rows[0];\n\n // row1.toJSON() = {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n});"},{"caption":"

The SQL query string can contain parameter placeholders. A parameter \nplaceholder consists of '@' followed by the parameter name.

","code":"var query = {\n sql: 'SELECT * FROM Singers WHERE name = @name',\n params: {\n name: 'Eddie Wilson'\n }\n};\n\ndatabase.run(query, function(err, rows) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.run(query).then(function(data) {\n var rows = data[0];\n});"}],"params":[{"name":"query","description":" ","types":["string","object"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.exactStaleness","description":"
  • Executes all reads at the timestamp that is exactStaleness old.
","types":["number"],"optional":false,"nullable":false},{"name":"options.readTimestamp","description":"
  • Execute all reads at the given timestamp.
","types":["date"],"optional":false,"nullable":false},{"name":"options.returnTimestamp","description":"
  • If true, returns the read timestamp.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.strong","description":"
  • Read at the timestamp where all previously committed transactions are visible.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rows","description":"
  • Rows are returned as an array of objects. Each object has a name and value property. To get a serialized object, call toJSON().
","types":["array[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"runStream","name":"runStream","type":"instance","description":"

Create a readable object stream to receive resulting rows from a SQL statement.

","source":"packages/spanner/src/database.js#L588","resources":[{},{}],"examples":[{"code":"var query = 'SELECT * FROM Singers';\n\ndatabase.runStream(query)\n .on('error', function(err) {})\n .on('data', function(row) {\n // row = [\n // {\n // name: 'SingerId',\n // value: '1'\n // },\n // {\n // name: 'Name',\n // value: 'Eddie Wilson'\n // }\n // ]\n // ]\n })\n .on('end', function() {\n // All results retrieved.\n });"},{"caption":"

Rows are returned as an array of objects. Each object has a name and \nvalue property. To get a serialized object, call toJSON().

","code":"database.runStream(query)\n .on('error', function(err) {})\n .on('data', function(row) {\n // row.toJSON() = {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n })\n .on('end', function() {\n // All results retrieved.\n });"},{"caption":"

The SQL query string can contain parameter placeholders. A parameter \nplaceholder consists of '@' followed by the parameter name.

","code":"var query = {\n sql: 'SELECT * FROM Singers WHERE name = @name',\n params: {\n name: 'Eddie Wilson'\n }\n};\n\ndatabase.runStream(query)\n .on('error', function(err) {})\n .on('data', function(row) {})\n .on('end', function() {});"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"database.runStream(query)\n .on('data', function(row) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["string","object"],"optional":false,"nullable":false},{"name":"query.params","description":"
  • A map of parameter name to values.
","types":["object"],"optional":true,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.exactStaleness","description":"
  • Executes all reads at the timestamp that is exactStaleness old.
","types":["number"],"optional":false,"nullable":false},{"name":"options.readTimestamp","description":"
  • Execute all reads at the given timestamp.
","types":["date"],"optional":false,"nullable":false},{"name":"options.returnTimestamp","description":"
  • If true, returns the read timestamp.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.strong","description":"
  • Read at the timestamp where all previously committed transactions are visible.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["Stream"],"description":""}]},{"id":"runTransaction","name":"runTransaction","type":"instance","description":"

A transaction in Cloud Spanner is a set of reads and writes that execute atomically at a single logical point in time across columns, rows, and tables in a database.

The callback you provide to this function will become the "run function". It will be executed with either an error or a spanner/transaction object. The Transaction object will let you run queries and queue mutations until you are ready to spanner/transaction#commit.

For a more complete listing of functionality available to a Transaction, see the spanner/transaction API documentation. For a general overview of transactions within Cloud Spanner, see Transactions from the official Cloud Spanner documentation.

","source":"packages/spanner/src/database.js#L718","resources":[{},{}],"examples":[{"code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Run a transactional query.\n transaction.run('SELECT * FROM Singers', function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue a mutation (note that there is no callback passed to `insert`).\n transaction.insert('Singers', {\n SingerId: 'Id3b',\n Name: 'Joe West'\n });\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // Transaction committed successfully.\n }\n });\n });\n});"},{"caption":"

For read-only transactions, use the transaction.end() function to \nrelease the transaction.

","code":"var options = {\n readOnly: true,\n strong: true\n};\n\ndatabase.runTransaction(options, function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.run('SELECT * FROM Singers', function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n // End the transaction. Note that no callback is provided.\n transaction.end();\n });\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.readOnly","description":"
  • Specifies if the transaction is read-only.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.exactStaleness","description":"
  • Executes all reads at the timestamp that is exactStaleness old.
","types":["number"],"optional":false,"nullable":false},{"name":"options.readTimestamp","description":"
  • Execute all reads at the given timestamp.
","types":["date"],"optional":false,"nullable":false},{"name":"options.returnTimestamp","description":"
  • If true, returns the read timestamp.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.strong","description":"
  • Read at the timestamp where all previously committed transactions are visible.
","types":["boolean"],"optional":false,"nullable":false},{"name":"runFn","description":"
  • A function to execute in the context of a transaction.
","types":["function"],"optional":false,"nullable":false},{"name":"runFn.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"runFn.transaction","description":"
  • The Transaction object. The transaction has already been created, and is ready to be queried and committed against.
","types":["spanner/transaction"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"table","name":"table","type":"instance","description":"

Get a reference to a Table object.

","source":"packages/spanner/src/database.js#L747","resources":[],"examples":[{"code":"var table = database.table('Singers');"}],"params":[{"name":"name","description":"
  • The name of the table.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[{"types":["spanner/table"],"description":"
  • A Table object.
"}]},{"id":"updateSchema","name":"updateSchema","type":"instance","description":"

Update the schema of the database by creating/altering/dropping tables, columns, indexes, etc.

This method immediately responds with an Operation object. Register event handlers for the "error" and "complete" events to see how the operation finishes. Follow along with the examples below.

","source":"packages/spanner/src/database.js#L810","resources":[{},{},{}],"examples":[{"code":"var statements = [\n 'CREATE TABLE Singers (' +\n ' SingerId INT64 NOT NULL,' +\n ' FirstName STRING(1024),' +\n ' LastName STRING(1024),' +\n ' SingerInfo BYTES(MAX),' +\n ') PRIMARY KEY(SingerId)'\n];\n\ndatabase.updateSchema(statements, function(err, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Database schema updated successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"database.updateSchema(statements)\n .then(function(data) {\n var operation = data[0];\n return operation.promise();\n })\n .then(function() {\n // Database schema updated successfully.\n });"}],"params":[{"name":"statements","description":" ","types":["string","string[]","object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"database.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/spanner/index.json b/json/google-cloud/v0.51.1/spanner/index.json new file mode 100644 index 00000000000..e4e58eb160f --- /dev/null +++ b/json/google-cloud/v0.51.1/spanner/index.json @@ -0,0 +1 @@ +{"id":"spanner","type":"class","name":"Spanner","overview":"

\n This class allows you interact with Cloud Spanner.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/spanner.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/spanner/src/index.js","parent":null,"children":["spanner/admin","spanner/codec","spanner/database","spanner/instance","spanner/partial-result-stream","spanner/row-builder","spanner/session-pool","spanner/session","spanner/table","spanner/transaction-request","spanner/transaction","spanner/v1"],"methods":[{"id":"Spanner","name":"Spanner","type":"constructor","description":"

Cloud Spanner is a highly scalable, transactional, managed, NewSQL database service. Cloud Spanner solves the need for a horizontally-scaling database with consistent global transaction and SQL semantics. With Cloud Spanner you don't need to choose between consistency and horizontal scaling — you get both.

","source":"packages/spanner/src/index.js#L61","resources":[{},{}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"date","name":"date","type":"instance","description":"

Helper function to get a Cloud Spanner Date object.

","source":"packages/spanner/src/index.js#L107","resources":[],"examples":[{"code":"var date = spanner.date('08-20-1969');"}],"params":[{"name":"value","description":"
  • The date as a string or Date object.
","types":["string","date"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"float","name":"float","type":"instance","description":"

Helper function to get a Cloud Spanner Float64 object.

","source":"packages/spanner/src/index.js#L120","resources":[],"examples":[{"code":"var date = spanner.float(10);"}],"params":[{"name":"value","description":"
  • The float as a number or string.
","types":["string","number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"int","name":"int","type":"instance","description":"

Helper function to get a Cloud Spanner Int64 object.

","source":"packages/spanner/src/index.js#L133","resources":[],"examples":[{"code":"var date = spanner.int(10);"}],"params":[{"name":"value","description":"
  • The int as a number or string.
","types":["string","number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"createInstance","name":"createInstance","type":"instance","description":"

Create an instance.

","source":"packages/spanner/src/index.js#L191","resources":[{}],"examples":[{"code":"var config = {\n config: 'regional-us-central1',\n nodes: 1\n};\n\nfunction callback(err, instance, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Instance created successfully.\n });\n}\n\nspanner.createInstance('new-instance-name', config, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"spanner.createInstance('new-instance-name', config)\n .then(function(data) {\n var instance = data[0];\n var operation = data[1];\n return operation.promise();\n })\n .then(function() {\n // Instance created successfully.\n });"}],"params":[{"name":"name","description":"
  • The name of the instance to be created.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"config.config","description":"
  • The name of the instance's configuration.
","types":["string"],"optional":false,"nullable":false},{"name":"config.nodes","description":"
  • The number of nodes allocated to this instance.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instance","description":"
  • The newly created instance.
","types":["spanner/instance"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"},{"type":"Error","description":"

If a configuration object is not provided.

"}],"returns":[]},{"id":"getInstances","name":"getInstances","type":"instance","description":"

Get a list of instances.

","source":"packages/spanner/src/index.js#L299","resources":[{}],"examples":[{"code":"spanner.getInstances(function(err, instances) {\n // `instances` is an array of `Instance` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, instances, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n spanner.getInstances(nextQuery, callback);\n }\n}\n\nspanner.getInstances({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"spanner.getInstances().then(function(data) {\n var instances = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.filter","description":"
  • An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are:

    • name
    • display_name
    • labels.key where key is the name of a label

      Some examples of using filters are:

    • name:* The instance has a name.
    • name:Howl The instance's name is howl.
    • labels.env:* The instance has the label env.
    • labels.env:dev The instance's label env has the value dev.
    • name:howl labels.env:dev The instance's name is howl and it has the label env with value dev.
","types":["string"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageSize","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Token returned from a previous call, to request the next page of results.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instances","description":"
  • List of all instances.
","types":["spanner/instance[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getInstancesStream","name":"getInstancesStream","type":"instance","description":"

Get a list of spanner/instance objects as a readable object stream.

","source":"packages/spanner/src/index.js#L352","resources":[{}],"examples":[{"code":"spanner.getInstancesStream()\n .on('error', console.error)\n .on('data', function(instance) {\n // `instance` is an `Instance` object.\n })\n .on('end', function() {\n // All instances retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"spanner.getInstancesStream()\n .on('data', function(instance) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getInstanceConfigs","name":"getInstanceConfigs","type":"instance","description":"

Get a list of instance configs.

","source":"packages/spanner/src/index.js#L404","resources":[{}],"examples":[{"code":"spanner.getInstanceConfigs(function(err, instanceConfigs) {\n // `instanceConfigs` is an array of instance configuration descriptors.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, instanceConfigs, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n spanner.getInstanceConfigs(nextQuery, callback);\n }\n}\n\nspanner.getInstanceConfigs({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"spanner.getInstanceConfigs().then(function(data) {\n var instanceConfigs = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageSize","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Token returned from a previous call, to request the next page of results.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instanceConfigs","description":"
  • List of all available instance configs.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.instanceConfigs.name","description":"
  • The unique identifier for the instance config.
","types":["string"],"optional":false,"nullable":false},{"name":"callback.instanceConfigs.displayName","description":"
  • The name of the instance config as it appears in UIs.
","types":["string"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getInstanceConfigsStream","name":"getInstanceConfigsStream","type":"instance","description":"

Get a list of instance configs as a readable object stream.

","source":"packages/spanner/src/index.js#L443","resources":[{}],"examples":[{"code":"spanner.getInstanceConfigsStream()\n .on('error', console.error)\n .on('data', function(instanceConfig) {})\n .on('end', function() {\n // All instances retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"spanner.getInstanceConfigsStream()\n .on('data', function(instanceConfig) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"instance","name":"instance","type":"instance","description":"

Get a reference to an Instance object.

","source":"packages/spanner/src/index.js#L462","resources":[],"examples":[{"code":"var instance = spanner.instance('my-instance');"}],"params":[{"name":"name","description":"
  • The name of the instance.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[{"types":["spanner/instance"],"description":"
  • An Instance object.
"}]},{"id":"operation","name":"operation","type":"instance","description":"

Get a reference to an Operation object.

","source":"packages/spanner/src/index.js#L481","resources":[],"examples":[{"code":"var operation = spanner.operation('operation-name');"}],"params":[{"name":"name","description":"
  • The name of the operation.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[{"types":["Operation"],"description":"
  • An Operation object.
"}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/spanner/instance.json b/json/google-cloud/v0.51.1/spanner/instance.json new file mode 100644 index 00000000000..7a82b75cd8b --- /dev/null +++ b/json/google-cloud/v0.51.1/spanner/instance.json @@ -0,0 +1 @@ +{"id":"spanner/instance","type":"class","name":"Instance","overview":"

\n This class allows you interact with Cloud Spanner.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/spanner.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/spanner/src/instance.js","parent":"spanner","children":[],"methods":[{"id":"Instance","name":"Instance","type":"constructor","description":"

Create an Instance object to interact with a Cloud Spanner instance.

","source":"packages/spanner/src/instance.js#L48","resources":[],"examples":[{"code":"var instance = spanner.instance('my-instance');"}],"params":[{"name":"name","description":"
  • Name of the instance.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create an instance.

","source":"packages/spanner/src/instance.js#L87","resources":[],"examples":[{"code":"instance.create(function(err, instance, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Instance created successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.create()\n .then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n\n return operation.promise();\n })\n .then(function() {\n // Instance created successfully.\n });"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if an instance exists.

","source":"packages/spanner/src/instance.js#L107","resources":[],"examples":[{"code":"instance.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the instance exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get an instance if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/spanner/src/instance.js#L134","resources":[],"examples":[{"code":"instance.get(function(err, instance, apiResponse) {\n // `instance.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.get().then(function(data) {\n var instance = data[0];\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createDatabase","name":"createDatabase","type":"instance","description":"

Create a database in this instance.

","source":"packages/spanner/src/instance.js#L229","resources":[{}],"examples":[{"code":"function callback(err, database, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Database created successfully.\n });\n}\n\ninstance.createDatabase('new-database-name', callback);"},{"caption":"

Set the schema for the database.

","code":"instance.createDatabase('new-database-name', {\n schema:\n 'CREATE TABLE Singers (' +\n ' SingerId STRING(1024) NOT NULL,' +\n ' Name STRING(1024),' +\n ') PRIMARY KEY(SingerId)'\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.createDatabase('new-database-name')\n .then(function(data) {\n var database = data[0];\n var operation = data[1];\n return operation.promise();\n })\n .then(function() {\n // Database created successfully.\n });"}],"params":[{"name":"name","description":"
  • The name of the database to create.
","types":["name"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.poolOptions","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.database","description":"
  • The newly created database.
","types":["spanner/database"],"optional":false,"nullable":false},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[]},{"id":"database","name":"database","type":"instance","description":"

Get a reference to a Database object.

","source":"packages/spanner/src/instance.js#L281","resources":[],"examples":[{"code":"var database = instance.database('my-database');"}],"params":[{"name":"name","description":"
  • The name of the instance.
","types":["string"],"optional":false,"nullable":false},{"name":"poolOptions","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[{"types":["spanner/database"],"description":"
  • A Database object.
"}]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the instance.

","source":"packages/spanner/src/instance.js#L314","resources":[{}],"examples":[{"code":"instance.delete(function(err, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // Instance was deleted successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getDatabases","name":"getDatabases","type":"instance","description":"

Get a list of databases.

","source":"packages/spanner/src/instance.js#L365","resources":[{}],"examples":[{"code":"instance.getDatabases(function(err, databases) {\n // `databases` is an array of `Database` objects.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"function callback(err, databases, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n instance.getDatabases(nextQuery, callback);\n }\n}\n\ninstance.getDatabases({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.getDatabases().then(function(data) {\n var databases = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageSize","description":"
  • Maximum number of results to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • Token returned from a previous call, to request the next page of results.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.instances","description":"
  • List of all instances.
","types":["spanner/instance[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getDatabasesStream","name":"getDatabasesStream","type":"instance","description":"

Get a list of databases as a readable object stream.

","source":"packages/spanner/src/instance.js#L418","resources":[{}],"examples":[{"code":"instance.getDatabasesStream()\n .on('error', console.error)\n .on('data', function(database) {\n // `database` is a `Database` object.\n })\n .on('end', function() {\n // All databases retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"instance.getDatabasesStream()\n .on('data', function(database) {\n this.end();\n });"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the instance's metadata.

","source":"packages/spanner/src/instance.js#L442","resources":[{}],"examples":[{"code":"instance.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The instance's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Update the metadata for this instance. Note that this method follows PATCH semantics, so previously-configured settings will persist.

","source":"packages/spanner/src/instance.js#L486","resources":[{}],"examples":[{"code":"var metadata = {\n displayName: 'My Instance'\n};\n\ninstance.setMetadata(metadata, function(err, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Metadata updated successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"instance.setMetadata(metadata).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"metadata","description":"
  • New metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["compute/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"instance.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/spanner/table.json b/json/google-cloud/v0.51.1/spanner/table.json new file mode 100644 index 00000000000..7fd32b77340 --- /dev/null +++ b/json/google-cloud/v0.51.1/spanner/table.json @@ -0,0 +1 @@ +{"id":"spanner/table","type":"class","name":"Table","overview":"

\n This class allows you interact with Cloud Spanner.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/spanner.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/spanner/src/table.js","parent":"spanner","children":[],"methods":[{"id":"Table","name":"Table","type":"constructor","description":"

Create a Table object to interact with a table in a Cloud Spanner database.

","source":"packages/spanner/src/table.js#L47","resources":[],"examples":[{"code":"var instance = spanner.instance('my-instance');\nvar database = instance.database('my-database');\nvar table = database.table('my-table');"}],"params":[{"name":"name","description":"
  • Name of the table.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a table.

","source":"packages/spanner/src/table.js#L101","resources":[],"examples":[{"code":"var schema =\n 'CREATE TABLE Singers (' +\n ' SingerId INT64 NOT NULL,' +\n ' FirstName STRING(1024),' +\n ' LastName STRING(1024),' +\n ' SingerInfo BYTES(MAX),' +\n ') PRIMARY KEY(SingerId)';\n\ntable.create(schema, function(err, table, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Table created successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.create(schema)\n .then(function(data) {\n var table = data[0];\n var operation = data[1];\n\n return operation.promise();\n })\n .then(function() {\n // Table created successfully.\n });"}],"params":[{"name":"schema","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createReadStream","name":"createReadStream","type":"instance","description":"

Create a readable object stream to receive rows from the database using key lookups and scans.

","source":"packages/spanner/src/table.js#L182","resources":[{},{}],"examples":[{"code":"table.createReadStream({\n keys: ['1'],\n columns: ['SingerId', 'name']\n })\n .on('error', function(err) {})\n .on('data', function(row) {\n // row = {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n })\n .on('end', function() {\n // All results retrieved.\n });"},{"caption":"

Provide an array for query.keys to read with a composite key.

","code":"var query = {\n keys: [\n [\n 'Id1',\n 'Name1'\n ],\n [\n 'Id2',\n 'Name2'\n ]\n ],\n // ...\n};"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"table.createReadStream({\n keys: ['1'],\n columns: ['SingerId', 'name']\n })\n .on('data', function(row) {\n this.end();\n });"}],"params":[{"name":"table","description":"
  • The table to read from.
","types":["string"],"optional":false,"nullable":false},{"name":"query","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"query.columns","description":"
  • The columns of the table to be returned for each row matching this query.
","types":["string[]"],"optional":false,"nullable":false},{"name":"query.keys","description":"
  • The primary keys of the rows in this table to be yielded. If using a composite key, provide an array within this array. See the example below.
","types":["*[]","Array.<*>[]"],"optional":false,"nullable":false},{"name":"query.index","description":"
  • The name of an index on the table.
","types":["string"],"optional":true,"nullable":false},{"name":"query.limit","description":"
  • The number of rows to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.exactStaleness","description":"
  • Executes all reads at the timestamp that is exactStaleness old.
","types":["number"],"optional":false,"nullable":false},{"name":"options.minReadTimestamp","description":"
  • Executes all reads at a timestamp greater than or equal to this.
","types":["date"],"optional":false,"nullable":false},{"name":"options.maxStaleness","description":"
  • Read data at a timestamp that is greater than or equal to this.
","types":["number"],"optional":false,"nullable":false},{"name":"options.readTimestamp","description":"
  • Execute all reads at the given timestamp.
","types":["date"],"optional":false,"nullable":false},{"name":"options.returnReadTimestamp","description":"
  • If true, returns the read timestamp.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.strong","description":"
  • Read at the timestamp where all previously committed transactions are visible.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["Stream"],"description":""}]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the table.

","source":"packages/spanner/src/table.js#L233","resources":[],"examples":[{"code":"table.delete(function(err, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function() {\n // Table deleted successfully.\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.delete()\n .then(function(data) {\n var operation = data[0];\n return operation.promise();\n })\n .then(function() {\n // Table deleted successfully.\n });"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["Operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"deleteRows","name":"deleteRows","type":"instance","description":"

Delete rows from this table.

","source":"packages/spanner/src/table.js#L275","resources":[{}],"examples":[{"code":"var keys = ['Id1', 'Id2', 'Id3'];\n\ntable.deleteRows(keys, function(err, apiResponse) {});"},{"caption":"

Provide an array for keys to delete rows with a composite key.

","code":"var keys = [\n [\n 'Id1',\n 'Name1'\n ],\n [\n 'Id2',\n 'Name2'\n ]\n];"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.deleteRows(keys)\n .then(function(data) {\n var apiResponse = data[0];\n });"}],"params":[{"name":"keys","description":"
  • The keys for the rows to delete. If using a composite key, provide an array within this array. See the example below.
","types":["*[]","Array.<*>[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"insert","name":"insert","type":"instance","description":"

Insert rows of data into this table.

","source":"packages/spanner/src/table.js#L327","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Eddie Wilson'\n};\n\ntable.insert(row, function(err, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // Rows inserted successfully.\n});"},{"caption":"

Multiple rows can be inserted at once.

","code":"var row2 = {\n SingerId: 'Id3b',\n Name: 'Joe West'\n};\n\ntable.insert([\n row,\n row2\n], function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.insert(row)\n .then(function(data) {\n var apiResponse = data[0];\n });"}],"params":[{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"read","name":"read","type":"instance","description":"

Receive rows from the database using key lookups and scans.

Performance Considerations

This method wraps the streaming method, spanner/table#createReadStream for your convenience. All rows will be stored in memory before being released to your callback. If you intend on receiving a lot of results from your query, consider using the streaming method, so you can free each result from memory after consuming it.

","source":"packages/spanner/src/table.js#L438","resources":[],"examples":[{"code":"var query = {\n keys: ['1'],\n columns: ['SingerId', 'name']\n};\n\ntable.read(query, function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n var row1 = rows[0];\n\n // row1 = [\n // {\n // name: 'SingerId',\n // value: '1'\n // },\n // {\n // name: 'Name',\n // value: 'Eddie Wilson'\n // }\n // ]\n});"},{"caption":"

Provide an array for query.keys to read with a composite key.

","code":"var query = {\n keys: [\n [\n 'Id1',\n 'Name1'\n ],\n [\n 'Id2',\n 'Name2'\n ]\n ],\n // ...\n};"},{"caption":"

Rows are returned as an array of object arrays. Each object has a name \nand value property. To get a serialized object, call toJSON().

","code":"table.read(query, function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n var row1 = rows[0];\n\n // rows1.toJSON() = {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.read(query)\n .then(function(data) {\n var apiResponse = data[0];\n });"}],"params":[{"name":"query","description":"
  • Configuration object, describing what to read from the table.
","types":["object"],"optional":false,"nullable":false},{"name":"query.columns","description":"
  • The columns of the table to be returned for each row matching this query.
","types":["string[]"],"optional":false,"nullable":false},{"name":"query.keys","description":"
  • The primary keys of the rows in this table to be yielded. If using a composite key, provide an array within this array. See the example below.
","types":["*[]","Array.<*>[]"],"optional":false,"nullable":false},{"name":"query.index","description":"
  • The name of an index on the table.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"query.limit","description":"
  • The number of rows to return.
","types":["number"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.exactStaleness","description":"
  • Executes all reads at the timestamp that is exactStaleness old.
","types":["number"],"optional":false,"nullable":false},{"name":"options.minReadTimestamp","description":"
  • Executes all reads at a timestamp greater than or equal to this.
","types":["date"],"optional":false,"nullable":false},{"name":"options.maxStaleness","description":"
  • Read data at a timestamp that is greater than or equal to this.
","types":["number"],"optional":false,"nullable":false},{"name":"options.readTimestamp","description":"
  • Execute all reads at the given timestamp.
","types":["date"],"optional":false,"nullable":false},{"name":"options.returnReadTimestamp","description":"
  • If true, returns the read timestamp.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.strong","description":"
  • Read at the timestamp where all previously committed transactions are visible.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback.rows","description":"
  • Rows are returned as an array of object arrays. Each object has a name and value property. To get a serialized object, call toJSON().
","types":["array[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"replace","name":"replace","type":"instance","description":"

Replace rows of data within this table.

","source":"packages/spanner/src/table.js#L490","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Joe West'\n};\n\ntable.replace(row, function(err, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // Row replaced successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.replace(row)\n .then(function(data) {\n var apiResponse = data[0];\n });"}],"params":[{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"update","name":"update","type":"instance","description":"

Update rows of data within this table.

","source":"packages/spanner/src/table.js#L528","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Joe West'\n};\n\ntable.update(row, function(err, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // Row updated successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.update(row)\n .then(function(data) {\n var apiResponse = data[0];\n });"}],"params":[{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"upsert","name":"upsert","type":"instance","description":"

Insert or update rows of data within this table.

","source":"packages/spanner/src/table.js#L566","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Joe West'\n};\n\ntable.update(row, function(err, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // Row inserted or updated successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"table.update(row)\n .then(function(data) {\n var apiResponse = data[0];\n });"}],"params":[{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"table.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/spanner/transaction.json b/json/google-cloud/v0.51.1/spanner/transaction.json new file mode 100644 index 00000000000..839e0bbb0d7 --- /dev/null +++ b/json/google-cloud/v0.51.1/spanner/transaction.json @@ -0,0 +1 @@ +{"id":"spanner/transaction","type":"class","name":"Transaction","overview":"

\n This class allows you interact with Cloud Spanner.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/spanner.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar spanner = gcloud.spanner({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/spanner/src/transaction.js","parent":"spanner","children":[],"methods":[{"id":"Transaction","name":"Transaction","type":"constructor","description":"

Use a Transaction object to read and write against inside of your Cloud Spanner database.

This object is created and returned from database/runTransaction.

","source":"packages/spanner/src/transaction.js#L92","resources":[],"examples":[{"code":"var instance = spanner.instance('my-instance');\nvar database = instance.database('my-database');\n\ndatabase.runTransaction(function(err, transaction) {\n // The `transaction` object is ready for use.\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.exactStaleness","description":"
  • Executes all reads at the timestamp that is exactStaleness old.
","types":["number"],"optional":false,"nullable":false},{"name":"options.minReadTimestamp","description":"
  • Executes all reads at a timestamp greater than or equal to this. This option can only be used for single-use transactions.
","types":["date"],"optional":false,"nullable":false},{"name":"options.maxStaleness","description":"
  • Read data at a timestamp that is greater than or equal to this. This option can only be used for single-use transactions.
","types":["number"],"optional":false,"nullable":false},{"name":"options.readTimestamp","description":"
  • Execute all reads at the given timestamp.
","types":["date"],"optional":false,"nullable":false},{"name":"options.returnReadTimestamp","description":"
  • If true, returns the read timestamp.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.strong","description":"
  • Read at the timestamp where all previously committed transactions are visible.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"commit","name":"commit","type":"instance","description":"

Commit the transaction.

","source":"packages/spanner/src/transaction.js#L225","resources":[{}],"examples":[{"code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue a mutation (note that there is no callback passed to `insert`).\n transaction.insert('Singers', {\n SingerId: 'Id3b',\n Name: 'Joe West'\n });\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // Mutations were committed successfully.\n }\n });\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"rollback","name":"rollback","type":"instance","description":"

Roll back a transaction, releasing any locks it holds. It is a good idea to call this for any transaction that includes one or more queries that you decide not to commit.

","source":"packages/spanner/src/transaction.js#L325","resources":[{}],"examples":[{"code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.rollback(function(err) {\n if (!err) {\n // Transaction rolled back successfully.\n }\n });\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"run","name":"run","type":"instance","description":"

Execute a SQL statement on this database inside of a transaction.

Performance Considerations

This method wraps the streaming method, spanner/transaction#run for your convenience. All rows will be stored in memory before being released to your callback. If you intend on receiving a lot of results from your query, consider using the streaming method, so you can free each result from memory after consuming it.

","source":"packages/spanner/src/transaction.js#L410","resources":[{},{}],"examples":[{"code":"var query = 'SELECT * FROM Singers';\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.run(query, function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n // rows = [\n // {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n // ]\n });\n});"},{"caption":"

The SQL query string can contain parameter placeholders. A parameter \nplaceholder consists of '@' followed by the parameter name.

","code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n var query = {\n sql: 'SELECT * FROM Singers WHERE name = @name',\n params: {\n name: 'Eddie Wilson'\n }\n };\n\n transaction.run(query, function(err, rows) {});\n});"}],"params":[{"name":"query","description":" ","types":["string","object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rows","description":"
  • The results from the SQL query.
","types":["object[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"runStream","name":"runStream","type":"instance","description":"

Create a readable object stream to receive resulting rows from a SQL statement.

","source":"packages/spanner/src/transaction.js#L494","resources":[{},{}],"examples":[{"code":"var query = 'SELECT * FROM Singers';\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.runStream(query)\n .on('error', function(err) {})\n .on('data', function(row) {\n // row = {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n })\n .on('end', function() {\n // All results retrieved.\n });\n});"},{"caption":"

The SQL query string can contain parameter placeholders. A parameter \nplaceholder consists of '@' followed by the parameter name.

","code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n var query = {\n sql: 'SELECT * FROM Singers WHERE name = @name',\n params: {\n name: 'Eddie Wilson'\n }\n };\n\n transaction.runStream(query)\n .on('error', function(err) {})\n .on('data', function(row) {})\n .on('end', function() {});\n});"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.runStream(query)\n .on('data', function(row) {\n this.end();\n })\n .on('end', function() {});\n});"}],"params":[{"name":"query","description":" ","types":["string","object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["Stream"],"description":""}]},{"id":"end","name":"end","type":"instance","description":"

Let the client know you're done with a particular transaction. This should only be called for read-only transactions.

","source":"packages/spanner/src/transaction.js#L579","resources":[],"examples":[{"code":"var options = {\n readOnly: true\n};\n\ndatabase.runTransaction(options, function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.run('SELECT * FROM Singers', function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n // End the transaction. Note that no callback is provided.\n transaction.end();\n });\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"createReadStream","name":"createReadStream","type":"instance","description":"

Create a readable object stream to receive rows from the database using key lookups and scans.

","source":"packages/spanner/src/transaction-request.js#L209","resources":[{},{}],"examples":[{"code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.createReadStream('Singers', {\n keys: ['1'],\n columns: ['SingerId', 'name']\n })\n .on('error', function(err) {})\n .on('data', function(row) {\n // row = [\n // {\n // name: 'SingerId',\n // value: '1'\n // },\n // {\n // name: 'Name',\n // value: 'Eddie Wilson'\n // }\n // ]\n })\n .on('end', function() {\n // All results retrieved.\n });\n});"},{"caption":"

Provide an array for query.keys to read with a composite key.

","code":"var query = {\n keys: [\n [\n 'Id1',\n 'Name1'\n ],\n [\n 'Id2',\n 'Name2'\n ]\n ],\n // ...\n};"},{"caption":"

Rows are returned as an array of object arrays. Each object has a name \nand value property. To get a serialized object, call toJSON().

","code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.createReadStream('Singers', {\n keys: ['1'],\n columns: ['SingerId', 'name']\n })\n .on('error', function(err) {})\n .on('data', function(row) {\n // row.toJSON() = {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n })\n .on('end', function() {\n // All results retrieved.\n });\n});"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.createReadStream('Singers', {\n keys: ['1'],\n columns: ['SingerId', 'name']\n })\n .on('data', function(row) {\n this.end();\n });\n});"}],"params":[{"name":"table","description":"
  • The table to read from.
","types":["string"],"optional":false,"nullable":false},{"name":"query","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"query.columns","description":"
  • The columns of the table to be returned for each row matching this query.
","types":["string[]"],"optional":false,"nullable":false},{"name":"query.keys","description":"
  • The primary keys of the rows in this table to be yielded. If using a composite key, provide an array within this array. See the example below.
","types":["*[]","Array.<*>[]"],"optional":false,"nullable":false},{"name":"query.index","description":"
  • The name of an index on the table.
","types":["string"],"optional":true,"nullable":false},{"name":"query.limit","description":"
  • The number of rows to yield.
","types":["number"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["Stream"],"description":""}]},{"id":"deleteRows","name":"deleteRows","type":"instance","description":"

Delete rows from a table.

","source":"packages/spanner/src/transaction-request.js#L295","resources":[{}],"examples":[{"code":"var keys = ['Id1', 'Id2', 'Id3'];\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue this mutation until later calling `commit`.\n // Note that a callback is not passed to `deleteRows`.\n transaction.deleteRows('Singers', keys);\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // The rows were deleted successfully.\n }\n });\n});"},{"caption":"

Provide an array for keys to delete rows with a composite key.

","code":"var keys = [\n [\n 'Id1',\n 'Name1'\n ],\n [\n 'Id2',\n 'Name2'\n ]\n];"}],"params":[{"name":"table","description":"
  • The name of the table.
","types":["string"],"optional":false,"nullable":false},{"name":"keys","description":"
  • The keys for the rows to delete. If using a composite key, provide an array within this array. See the example below.
","types":["*[]","Array.<*>[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"insert","name":"insert","type":"instance","description":"

Insert rows of data into this table.

","source":"packages/spanner/src/transaction-request.js#L387","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Eddie Wilson'\n};\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue this mutation until later calling `commit`.\n // Note that a callback is not passed to `insert`.\n transaction.insert('Singers', row);\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // The row was inserted successfully.\n }\n });\n});"},{"caption":"

Multiple rows can be inserted at once.

","code":"var row2 = {\n SingerId: 'Id3b',\n Name: 'Joe West'\n};\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue multiple mutations until later calling `commit`.\n // Note that a callback is not passed to `insert`.\n transaction.insert('Singers', [\n row,\n row2\n ]);\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // The rows were inserted successfully.\n }\n });\n});"}],"params":[{"name":"table","description":"
  • The name of the table.
","types":["string"],"optional":false,"nullable":false},{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"read","name":"read","type":"instance","description":"

Performs a read request against the specified Table.

","source":"packages/spanner/src/transaction-request.js#L487","resources":[],"examples":[{"code":"var query = {\n keys: ['1'],\n columns: ['SingerId', 'name']\n};\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.read('Singers', query, function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n var row1 = rows[0];\n\n // row1 = [\n // {\n // name: 'SingerId',\n // value: '1'\n // },\n // {\n // name: 'Name',\n // value: 'Eddie Wilson'\n // }\n // ]\n\n // End the transaction. Note that no callback is provided.\n transaction.end();\n });\n});"},{"caption":"

Provide an array for query.keys to read with a composite key.

","code":"var query = {\n keys: [\n [\n 'Id1',\n 'Name1'\n ],\n [\n 'Id2',\n 'Name2'\n ]\n ],\n // ...\n};"},{"caption":"

Rows are returned as an array of object arrays. Each object has a name \nand value property. To get a serialized object, call toJSON().

","code":"database.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n transaction.read('Singers', query, function(err, rows) {\n if (err) {\n // Error handling omitted.\n }\n\n var row1 = rows[0];\n\n // row1.toJSON() = {\n // SingerId: '1',\n // Name: 'Eddie Wilson'\n // }\n\n // End the transaction. Note that no callback is provided.\n transaction.end();\n });\n});"}],"params":[{"name":"table","description":"
  • The table to read from.
","types":["string"],"optional":false,"nullable":false},{"name":"query","description":"
  • Configuration object, describing what to read from the table.
","types":["object"],"optional":false,"nullable":false},{"name":"query.columns","description":"
  • The columns of the table to be returned for each row matching this query.
","types":["string[]"],"optional":false,"nullable":false},{"name":"query.keys","description":"
  • The primary keys of the rows in this table to be yielded. If using a composite key, provide an array within this array. See the example below.
","types":["*[]","Array.<*>[]"],"optional":false,"nullable":false},{"name":"query.index","description":"
  • The name of an index on the table.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.rows","description":"
  • Rows are returned as an array of object arrays. Each object has a name and value property. To get a serialized object, call toJSON().
","types":["array[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"replace","name":"replace","type":"instance","description":"

Replace rows of data within a table.

","source":"packages/spanner/src/transaction-request.js#L536","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Joe West'\n};\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue this mutation until later calling `commit`.\n // Note that a callback is not passed to `replace`.\n transaction.replace('Singers', row);\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // The row was replaced successfully.\n }\n });\n});"}],"params":[{"name":"table","description":"
  • The table to read from.
","types":["string"],"optional":false,"nullable":false},{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"update","name":"update","type":"instance","description":"

Update rows of data within a table.

","source":"packages/spanner/src/transaction-request.js#L594","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Joe West'\n};\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue this mutation until later calling `commit`.\n // Note that a callback is not passed to `update`.\n transaction.update('Singers', row);\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // The row was updated successfully.\n }\n });\n});"}],"params":[{"name":"table","description":"
  • The table to read from.
","types":["string"],"optional":false,"nullable":false},{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"upsert","name":"upsert","type":"instance","description":"

Insert or update rows of data within a table.

","source":"packages/spanner/src/transaction-request.js#L634","resources":[{}],"examples":[{"code":"var row = {\n SingerId: 'Id3',\n Name: 'Joe West'\n};\n\ndatabase.runTransaction(function(err, transaction) {\n if (err) {\n // Error handling omitted.\n }\n\n // Queue this mutation until later calling `commit`.\n // Note that a callback is not passed to `upsert`.\n transaction.upsert('Singers', row);\n\n // Commit the transaction.\n transaction.commit(function(err) {\n if (!err) {\n // The row was updated or inserted successfully.\n }\n });\n});"}],"params":[{"name":"table","description":"
  • The table to read from.
","types":["string"],"optional":false,"nullable":false},{"name":"keyVals","description":"
  • A map of names to values of data to insert into this table.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"transaction.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/speech/index.json b/json/google-cloud/v0.51.1/speech/index.json new file mode 100644 index 00000000000..376d216e938 --- /dev/null +++ b/json/google-cloud/v0.51.1/speech/index.json @@ -0,0 +1 @@ +{"id":"speech","type":"class","name":"Speech","overview":"

\n This class allows you interact with Cloud Speech API.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/speech.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar speech = gcloud.speech();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar speech = gcloud.speech({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"

To learn more about the Speech API, see the Getting Started guide.

","source":"packages/speech/src/index.js","parent":null,"children":["speech/v1"],"methods":[{"id":"Speech","name":"Speech","type":"constructor","description":"

The Cloud Speech API enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Cloud Speech API service.

","source":"packages/speech/src/index.js#L58","resources":[{"title":"Getting Started","link":"https://cloud.google.com/speech/docs/getting-started"},{"title":"Speech Best Practices","link":"https://cloud.google.com/speech/docs/best-practices"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"eventTypes","name":"eventTypes","type":"instance","description":"

The event types that the Speech API will return while processing a speech#createRecognizeStream request. You can track the progress of audio recognition by comparing the data.eventType property with these values.

  • Speech.eventTypes.ENDPOINTER_EVENT_UNSPECIFIED: No event specified.
  • Speech.eventTypes.END_OF_SINGLE_UTTERANCE: This event is only sent when config.singleUtterance passed to speech#createRecognizeStream is true. It indicates that the server has detected the end of the user's speech utterance and expects no additional speech. Therefore, the server will not process additional audio. The client should stop sending additional audio data.
","source":"packages/speech/src/index.js#L110","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]},{"id":"createRecognizeStream","name":"createRecognizeStream","type":"instance","description":"

Perform bidirectional streaming speech-recognition: receive results while sending audio.

Each emitted data event is a StreamingRecognizeResponse object, containing these properties:

  • eventType See speech#eventTypes.
  • results By default, a combined string of transcripts. When config.verbose is enabled, this is an object including a transcript property, a confidence score from 0 - 100, and an alternatives array consisting of other transcription possibilities.

Cloud Speech sets the limits for the audio duration. For more information, see Content Limits\">https://cloud.google.com/speech/limits#content}.

","source":"packages/speech/src/index.js#L439","resources":[{"title":"StreamingRecognize API Reference","link":"https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.Speech.StreamingRecognize"},{"title":"StreamingRecognizeRequest API Reference","link":"https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.StreamingRecognizeRequest"},{"title":"Content Limits","link":"https://cloud.google.com/speech/limits#content"}],"examples":[{"code":"var fs = require('fs');"},{"caption":"

See \nStreamingRecognizeRequest for all of the available configuration \noptions.

","code":"var request = {\n config: {\n encoding: 'LINEAR16',\n languageCode: 'en-US',\n sampleRateHertz: 16000\n },\n singleUtterance: false,\n interimResults: false\n};\n\nfs.createReadStream('./bridge.raw')\n .on('error', console.error)\n .pipe(speech.createRecognizeStream(request))\n .on('error', console.error)\n .on('data', function(data) {\n // data.results = \"how old is the Brooklyn Bridge\"\n });"},{"caption":"

Enable verbose mode for more detailed results.

","code":"var request = {\n config: {\n encoding: 'LINEAR16',\n languageCode: 'en-US',\n sampleRateHertz: 16000\n },\n singleUtterance: false,\n interimResults: false,\n verbose: true\n};\n\nfs.createReadStream('./system-test/data/bridge.raw')\n .on('error', console.error)\n .pipe(speech.createRecognizeStream(request))\n .on('error', console.error)\n .on('data', function(data) {\n // data.results = \"how old is the Brooklyn Bridge\"\n });"}],"params":[{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.languageCode","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"config.timeout","description":"
  • In seconds, the amount of time before the underlying API request times out. The default value, 190, is sufficient for audio input of 60 seconds or less. If your input is longer, consider using a higher timeout value.
","types":["number"],"optional":true,"nullable":false},{"name":"config.verbose","description":"
  • Enable verbose mode for a more detailed response. See the examples below. Default: false.
","types":["boolean"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"operation","name":"operation","type":"instance","description":"

Get a reference to an existing operation.

","source":"packages/speech/src/index.js#L523","resources":[],"examples":[{"code":"var operation = speech.operation('68850831366825');"}],"params":[{"name":"name","description":"
  • The name of the operation.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[]},{"id":"recognize","name":"recognize","type":"instance","description":"

Perform synchronous speech recognition and receive results after all audio has been sent and processed. This is ideal for files 1 MB or below. For larger files, you will need to use speech#startRecognition or speech#createRecognizeStream.

","source":"packages/speech/src/index.js#L640","resources":[{"title":"Recognize API Reference","link":"https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.Speech.Recognize"},{"title":"RecognizeRequest API Reference","link":"https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.RecognizeRequest"}],"examples":[{"code":"var config = {\n encoding: 'LINEAR16',\n languageCode: 'en-US',\n sampleRateHertz: 16000\n};\n\nfunction callback(err, transcript, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // transcript = \"how old is the Brooklyn Bridge\"\n}"},{"caption":"

Run speech detection over a local file.

","code":"speech.recognize('./bridge.raw', config, callback);"},{"caption":"

Run speech recognition over a file in Cloud Storage.

","code":"speech.recognize('gs://your-bucket-name/bridge.raw', config, callback);"},{"caption":"

Run speech recognition over raw file contents.

","code":"speech.recognize({\n content: fs.readFileSync('./bridge.raw')\n}, config, callback);"},{"caption":"

Run speech recognition over a remote file. \nNote: This is not an officially supported feature of the Speech API. \nThis library will make a request to the URL given and send the file \ncontents to the upstream API.

","code":"speech.recognize('https://example.com/files/bridge.raw', config, callback);"},{"caption":"

Enable verbose mode for more detailed results.

","code":"var config = {\n encoding: 'LINEAR16',\n languageCode: 'en-US',\n sampleRateHertz: 16000,\n verbose: true\n};\n\nspeech.recognize('./bridge.raw', config, function(err, results) {\n if (err) {\n // Error handling omitted.\n }\n\n // results = [\n // {\n // transcript: \"how old is the Brooklyn Bridge\",\n // confidence: 88.15,\n // alternatives: [\n // {\n // transcript: \"how old is the Brooklyn brim\",\n // confidence: 22.39\n // }\n // ]\n // }\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"speech.recognize('./bridge.raw', config).then(function(data) {\n var results = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"file","description":"
  • The source file to run the detection on. It can be either a local file path, a remote file URL, a Cloud Storage URI, a Cloud Storage File object, or a RecognitionAudio object.
","types":["string","object","storage/file"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.languageCode","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"config.verbose","description":"
  • Enable verbose mode for a more detailed response. See the examples below. Default: false.
","types":["boolean"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.results","description":"
  • By default, this will be a string comprised of all of the transcriptions recognized from the audio. If config.verbose is enabled, this is an object including a transcript property, a confidence score from 0 - 100, and an alternatives array consisting of other transcription possibilities. See the examples below for more.
","types":["string","object[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"startRecognition","name":"startRecognition","type":"instance","description":"

Perform asynchronous speech recognition.

This method sends audio to the Speech API, which immediately responds with an Operation object. Register event handlers for the "error" and "complete" events to see how the operation finishes. Follow along with the examples below.

","source":"packages/speech/src/index.js#L796","resources":[{"title":"LongRunningRecognize API Reference","link":"https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1.Speech.LongRunningRecognize"},{"title":"LongRunningRecognize API Reference","link":"https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1.LongRunningRecognizeRequest"},{"title":"LongRunningRecognize API Reference","link":"https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1.LongRunningRecognizeResponse"}],"examples":[{"code":"var config = {\n encoding: 'LINEAR16',\n languageCode: 'en-US',\n sampleRateHertz: 16000\n};\n\nfunction callback(err, operation, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function(transcript) {\n // transcript = \"how old is the Brooklyn Bridge\"\n });\n}"},{"caption":"

Run speech detection over a local file.

","code":"speech.startRecognition('./bridge.raw', config, callback);"},{"caption":"

Run speech detection over a file in Cloud Storage.

","code":"var file = 'gs://your-bucket-name/bridge.raw';\nspeech.startRecognition(file, config, callback);"},{"caption":"

Run speech detection over raw file contents.

","code":"speech.startRecognition({\n content: fs.readFileSync('./bridge.raw')\n}, config, callback);"},{"caption":"

Run speech detection over a remote file. \nNote: This is not an officially supported feature of the Speech API. \nThis library will make a request to the URL given and send the file \ncontents to the upstream API.

","code":"var file = 'https://example.com/files/bridge.raw';\n\nspeech.startRecognition(file, config, callback);"},{"caption":"

Enable verbose mode for more detailed results.

","code":"var config = {\n encoding: 'LINEAR16',\n languageCode: 'en-US',\n sampleRateHertz: 16000,\n verbose: true\n};\n\nspeech.startRecognition('./bridge.raw', config, function(err, operation) {\n if (err) {\n // Error handling omitted.\n }\n\n operation\n .on('error', function(err) {})\n .on('complete', function(results) {\n // results = [\n // {\n // transcript: \"how old is the Brooklyn Bridge\",\n // confidence: 88.15\n // }\n // ]\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"speech.startRecognition('./bridge.raw', config).then(function(data) {\n var operation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"file","description":"
  • The source file to run the detection on. It can be either a local file path, a remote file URL, a Cloud Storage URI, a Cloud Storage File object, or a RecognitionAudio object.
","types":["string","object","storage/file"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.verbose","description":"
  • Enable verbose mode for a more detailed response. See the examples below. Default: false.
","types":["boolean"],"optional":true,"nullable":false},{"name":"config.languageCode","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.operation","description":"
  • An operation object that can be used to check the status of the request.
","types":["speech/operation"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/storage/bucket.json b/json/google-cloud/v0.51.1/storage/bucket.json new file mode 100644 index 00000000000..64049297d6d --- /dev/null +++ b/json/google-cloud/v0.51.1/storage/bucket.json @@ -0,0 +1 @@ +{"id":"storage/bucket","type":"class","name":"Bucket","overview":"

\n This class allows you interact with Cloud Storage.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/storage.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/storage/src/bucket.js","parent":"storage","children":[],"methods":[{"id":"Bucket","name":"Bucket","type":"constructor","description":"

Create a Bucket object to interact with a Cloud Storage bucket.

","source":"packages/storage/src/bucket.js#L71","resources":[],"examples":[{"code":"var bucket = gcs.bucket('albums');"}],"params":[{"name":"options","description":"
  • Configuration options.
","types":["object"],"optional":false,"nullable":false},{"name":"options.bucketName","description":"
  • Name of the bucket.
","types":["string"],"optional":false,"nullable":false},{"name":"options.keyFilename","description":"
  • Full path to the JSON key downloaded from the Google Developers Console. Alternatively, you may provide a credentials object.
","types":["string"],"optional":true,"nullable":false},{"name":"options.credentials","description":"
  • Credentials object, used in place of a keyFilename.
","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"create","name":"create","type":"instance","description":"

Create a bucket.

","source":"packages/storage/src/bucket.js#L93","resources":[],"examples":[{"code":"bucket.create(function(err, zone, apiResponse) {\n if (!err) {\n // The zone was created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.create().then(function(data) {\n var zone = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"config","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the bucket.

","source":"packages/storage/src/bucket.js#L115","resources":[{"title":"Buckets: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/buckets/delete"}],"examples":[{"code":"bucket.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the bucket exists.

","source":"packages/storage/src/bucket.js#L135","resources":[],"examples":[{"code":"bucket.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the bucket exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a bucket if it exists.

You may optionally use this to "get or create" an object by providing an object with autoCreate set to true. Any extra configuration that is normally required for the create method must be contained within this object as well.

","source":"packages/storage/src/bucket.js#L162","resources":[],"examples":[{"code":"bucket.get(function(err, bucket, apiResponse) {\n // `bucket.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.get().then(function(data) {\n var bucket = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["options"],"optional":true,"nullable":false},{"name":"options.autoCreate","description":"
  • Automatically create the object if it does not exist. Default: false
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the bucket's metadata.

To set metadata, see storage/bucket#setMetadata.

","source":"packages/storage/src/bucket.js#L188","resources":[{"title":"Buckets: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/buckets/get"}],"examples":[{"code":"bucket.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The bucket's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Set the bucket's metadata.

","source":"packages/storage/src/bucket.js#L230","resources":[{"title":"Buckets: patch API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/buckets/patch"}],"examples":[{"caption":"

Set website metadata field on the bucket.

","code":"var metadata = {\n website: {\n mainPageSuffix: 'http://example.com',\n notFoundPage: 'http://example.com/404.html'\n }\n};\n\nbucket.setMetadata(metadata, function(err, apiResponse) {});"},{"caption":"

Enable versioning for your bucket.

","code":"bucket.setMetadata({\n versioning: {\n enabled: true\n }\n}, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":"
  • The metadata you wish to set.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl","name":"acl","type":"instance","description":"

Cloud Storage uses access control lists (ACLs) to manage object and bucket access. ACLs are the mechanism you use to share objects with other users and allow other users to access your buckets and objects.

An ACL consists of one or more entries, where each entry grants permissions to an entity. Permissions define the actions that can be performed against an object or bucket (for example, READ or WRITE); the entity defines who the permission applies to (for example, a specific user or group of users).

The acl object on a Bucket instance provides methods to get you a list of the ACLs defined on your bucket, as well as set, update, and delete them.

Buckets also have default ACLs for all created files. Default ACLs specify permissions that all new objects added to the bucket will inherit by default. You can add, delete, get, and update entities and permissions for these as well with storage/bucket#acl.default.

","source":"packages/storage/src/bucket.js#L291","resources":[{"title":"About Access Control Lists","link":"http://goo.gl/6qBBPO"},{"title":"Default ACLs","link":"https://cloud.google.com/storage/docs/access-control/lists#default"}],"examples":[{"caption":"

Make a bucket's contents publicly readable.

","code":"var myBucket = gcs.bucket('my-bucket');\n\nvar options = {\n entity: 'allUsers',\n role: gcs.acl.READER_ROLE\n};\n\nmyBucket.acl.add(options, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myBucket.acl.add(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"acl.default","name":"acl.default","type":"instance","description":"

Cloud Storage Buckets have default ACLs for all created files. You can add, delete, get, and update entities and permissions for these as well. The method signatures and examples are all the same, after only prefixing the method call with default.

","source":"packages/storage/src/bucket.js#L305","resources":[],"examples":[],"params":[],"exceptions":[],"returns":[]},{"id":"combine","name":"combine","type":"instance","description":"

Combine multiple files into one new file.

","source":"packages/storage/src/bucket.js#L354","resources":[{"title":"Objects: compose API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/compose"}],"examples":[{"code":"var logBucket = gcs.bucket('log-bucket');\n\nvar sources = [\n logBucket.file('2013-logs.txt'),\n logBucket.file('2014-logs.txt')\n];\n\nvar allLogs = logBucket.file('all-logs.txt');\n\nlogBucket.combine(sources, allLogs, function(err, newFile, apiResponse) {\n // newFile === allLogs\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"logBucket.combine(sources, allLogs).then(function(data) {\n var newFile = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"sources","description":"
  • The source files that will be combined.
","types":["string[]","storage/file"],"optional":false,"nullable":false},{"name":"destination","description":"
  • The file you would like the source files combined into.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.newFile","description":"
  • The combined file.
","types":["storage/file"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

if a non-array is provided as sources argument.

"},{"type":"Error","description":"

if less than two sources are provided.

"},{"type":"Error","description":"

if no destination is provided.

"},{"type":"Error","description":"

if content type can't be determined for the destination file.

"}],"returns":[]},{"id":"createChannel","name":"createChannel","type":"instance","description":"

Create a channel that will be notified when objects in this bucket changes.

","source":"packages/storage/src/bucket.js#L458","resources":[{"title":"Objects: watchAll API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/watchAll"}],"examples":[{"code":"var id = 'new-channel-id';\n\nvar config = {\n address: 'https://...'\n};\n\nbucket.createChannel(id, config, function(err, channel, apiResponse) {\n if (!err) {\n // Channel created successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.createChannel(id, config).then(function(data) {\n var channel = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"id","description":"
  • The ID of the channel to create.
","types":["string"],"optional":false,"nullable":false},{"name":"config","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"config.address","description":"
  • The address where notifications are delivered for this channel.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.channel","description":"
  • The created Channel object.
","types":["storage/channel"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If an ID is not provided.

"},{"type":"Error","description":"

If an address is not provided.

"}],"returns":[]},{"id":"deleteFiles","name":"deleteFiles","type":"instance","description":"

Iterate over the bucket's files, calling file.delete() on each.

This is not an atomic request. A delete attempt will be made for each file individually. Any one can fail, in which case only a portion of the files you intended to be deleted would have.

Operations are performed in parallel, up to 10 at once. The first error breaks the loop and will execute the provided callback with it. Specify { force: true } to suppress the errors until all files have had a chance to be processed.

The query object passed as the first argument will also be passed to storage/bucket#getFiles.

","source":"packages/storage/src/bucket.js#L551","resources":[{"title":"Objects: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/delete"}],"examples":[{"caption":"

Delete all of the files in the bucket.

","code":"bucket.deleteFiles(function(err) {});"},{"caption":"

By default, if a file cannot be deleted, this method will stop deleting \nfiles from your bucket. You can override this setting with force: true.

","code":"bucket.deleteFiles({\n force: true\n}, function(errors) {\n // `errors`:\n // Array of errors if any occurred, otherwise null.\n});"},{"caption":"

The first argument to this method acts as a query to \nstorage/bucket#getFiles. As an example, you can delete files \nwhich match a prefix.

","code":"bucket.deleteFiles({\n prefix: 'images/'\n}, function(err) {\n if (!err) {\n // All files in the `images` directory have been deleted.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.deleteFiles().then(function() {});"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"query.force","description":"
  • Suppress errors until all files have been processed.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An API error or array of errors from files that were not able to be deleted.
","types":["error","error[]"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]},{"id":"file","name":"file","type":"instance","description":"

Create a File object. See storage/file to see how to handle the different use cases you may have.

","source":"packages/storage/src/bucket.js#L612","resources":[],"examples":[{"code":"var file = bucket.file('my-existing-file.png');"}],"params":[{"name":"name","description":"
  • The name of the file in this bucket.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.generation","description":"
  • Only use a specific revision of this file.
","types":["string","number"],"optional":false,"nullable":false},{"name":"options.key","description":" ","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["storage/file"],"description":""}]},{"id":"getFiles","name":"getFiles","type":"instance","description":"

Get File objects for the files currently in the bucket.

","source":"packages/storage/src/bucket.js#L694","resources":[{"title":"Objects: list API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/list"}],"examples":[{"code":"bucket.getFiles(function(err, files) {\n if (!err) {\n // files is an array of File objects.\n }\n});"},{"caption":"

If your bucket has versioning enabled, you can get all of your files \nscoped to their generation.

","code":"bucket.getFiles({\n versions: true\n}, function(err, files) {\n // Each file is scoped to its generation.\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, files, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n bucket.getFiles(nextQuery, callback);\n }\n\n // The `metadata` property is populated for you with the metadata at the\n // time of fetching.\n files[0].metadata;\n\n // However, in cases where you are concerned the metadata could have\n // changed, use the `getMetadata` method.\n files[0].getMetadata(function(err, metadata) {});\n};\n\nbucket.getFiles({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.getFiles().then(function(data) {\n var files = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.delimiter","description":"
  • Results will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name truncated after the delimiter, returned in apiResponse.prefixes. Duplicate prefixes are omitted.
","types":["string"],"optional":false,"nullable":false},{"name":"query.prefix","description":"
  • Filter results to objects whose names begin with this prefix.
","types":["string"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of items plus prefixes to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"query.versions","description":"
  • If true, returns File objects scoped to their versions.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.files","description":"
  • List of files.
","types":["storage/file[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getFilesStream","name":"getFilesStream","type":"instance","description":"

Get storage/file objects for the files currently in the bucket as a readable object stream.

","source":"packages/storage/src/bucket.js#L762","resources":[],"examples":[{"code":"bucket.getFilesStream()\n .on('error', console.error)\n .on('data', function(file) {\n // file is a File object.\n })\n .on('end', function() {\n // All files retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"bucket.getFilesStream()\n .on('data', function(file) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]},{"id":"makePrivate","name":"makePrivate","type":"instance","description":"

Make the bucket listing private.

You may also choose to make the contents of the bucket private by specifying includeFiles: true. This will automatically run storage/file#makePrivate for every file in the bucket.

When specifying includeFiles: true, use force: true to delay execution of your callback until all files have been processed. By default, the callback is executed after the first error. Use force to queue such errors until all files have been processed, after which they will be returned as an array as the first argument to your callback.

NOTE: This may cause the process to be long-running and use a high number of requests. Use with caution.

","source":"packages/storage/src/bucket.js#L836","resources":[{"title":"Buckets: patch API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/buckets/patch"}],"examples":[{"caption":"

Make the bucket private.

","code":"bucket.makePrivate(function(err) {});"},{"caption":"

Make the bucket and its contents private.

","code":"var opts = {\n includeFiles: true\n};\n\nbucket.makePrivate(opts, function(err, files) {\n // `err`:\n // The first error to occur, otherwise null.\n //\n // `files`:\n // Array of files successfully made private in the bucket.\n});"},{"caption":"

Make the bucket and its contents private, using force to suppress errors \nuntil all files have been processed.

","code":"var opts = {\n includeFiles: true,\n force: true\n};\n\nbucket.makePrivate(opts, function(errors, files) {\n // `errors`:\n // Array of errors if any occurred, otherwise null.\n //\n // `files`:\n // Array of files successfully made private in the bucket.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.makePrivate(opts).then(function(data) {\n var files = data[0];\n});"}],"params":[{"name":"options","description":"
  • The configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.includeFiles","description":"
  • Make each file in the bucket private. Default: false.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.force","description":"
  • Queue errors occurred while making files private until all files have been processed.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.files","description":"
  • List of files made private.
","types":["storage/file[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"makePublic","name":"makePublic","type":"instance","description":"

Make the bucket publicly readable.

You may also choose to make the contents of the bucket publicly readable by specifying includeFiles: true. This will automatically run storage/file#makePublic for every file in the bucket.

When specifying includeFiles: true, use force: true to delay execution of your callback until all files have been processed. By default, the callback is executed after the first error. Use force to queue such errors until all files have been processed, after which they will be returned as an array as the first argument to your callback.

NOTE: This may cause the process to be long-running and use a high number of requests. Use with caution.

","source":"packages/storage/src/bucket.js#L959","resources":[{"title":"Buckets: patch API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/buckets/patch"}],"examples":[{"caption":"

Make the bucket publicly readable.

","code":"bucket.makePublic(function(err) {});"},{"caption":"

Make the bucket and its contents publicly readable.

","code":"var opts = {\n includeFiles: true\n};\n\nbucket.makePublic(opts, function(err, files) {\n // `err`:\n // The first error to occur, otherwise null.\n //\n // `files`:\n // Array of files successfully made public in the bucket.\n});"},{"caption":"

Make the bucket and its contents publicly readable, using force to \nsuppress errors until all files have been processed.

","code":"var opts = {\n includeFiles: true,\n force: true\n};\n\nbucket.makePublic(opts, function(errors, files) {\n // `errors`:\n // Array of errors if any occurred, otherwise null.\n //\n // `files`:\n // Array of files successfully made public in the bucket.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.makePublic(opts).then(function(data) {\n var files = data[0];\n});"}],"params":[{"name":"options","description":"
  • The configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.includeFiles","description":"
  • Make each file in the bucket publicly readable. Default: false.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.force","description":"
  • Queue errors occurred while making files public until all files have been processed.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.files","description":"
  • List of files made public.
","types":["storage/file[]"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"upload","name":"upload","type":"instance","description":"

Upload a file to the bucket. This is a convenience method that wraps storage/file#createWriteStream.

You can specify whether or not an upload is resumable by setting options.resumable. Resumable uploads are enabled by default if your input file is larger than 5 MB.

For faster crc32c computation, you must manually install fast-crc32c:

$ npm install --save fast-crc32c 
","source":"packages/storage/src/bucket.js#L1169","resources":[{"title":"Upload Options (Simple or Resumable)","link":"https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#uploads"},{"title":"Objects: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/insert"}],"examples":[{"caption":"

The easiest way to upload a file.

","code":"bucket.upload('/local/path/image.png', function(err, file, apiResponse) {\n // Your bucket now contains:\n // - \"image.png\" (with the contents of `/local/path/image.png')\n\n // `file` is an instance of a File object that refers to your new file.\n});"},{"caption":"

It's not always that easy. You will likely want to specify the filename \nused when your new file lands in your bucket. \nYou may also want to set metadata or customize other options.

","code":"var options = {\n destination: 'new-image.png',\n resumable: true,\n validation: 'crc32c',\n metadata: {\n metadata: {\n event: 'Fall trip to the zoo'\n }\n }\n};\n\nbucket.upload('local-image.png', options, function(err, file) {\n // Your bucket now contains:\n // - \"new-image.png\" (with the contents of `local-image.png')\n\n // `file` is an instance of a File object that refers to your new file.\n});"},{"caption":"

You can also have a file gzip'd on the fly.

","code":"bucket.upload('index.html', { gzip: true }, function(err, file) {\n // Your bucket now contains:\n // - \"index.html\" (automatically compressed with gzip)\n\n // Downloading the file with `file.download` will automatically decode the\n // file.\n});"},{"caption":"

You may also re-use a File object, storage/file, that references \nthe file you wish to create or overwrite.

","code":"var options = {\n destination: bucket.file('existing-file.png'),\n resumable: false\n};\n\nbucket.upload('local-img.png', options, function(err, newFile) {\n // Your bucket now contains:\n // - \"existing-file.png\" (with the contents of `local-img.png')\n\n // Note:\n // The `newFile` parameter is equal to `file`.\n});"},{"caption":"

To use \n \nCustomer-supplied Encryption Keys, provide the encryptionKey option.

","code":"var crypto = require('crypto');\nvar encryptionKey = crypto.randomBytes(32);\n\nbucket.upload('img.png', {\n encryptionKey: encryptionKey\n}, function(err, newFile) {\n // `img.png` was uploaded with your custom encryption key.\n\n // `newFile` is already configured to use the encryption key when making\n // operations on the remote object.\n\n // However, to use your encryption key later, you must create a `File`\n // instance with the `key` supplied:\n var file = bucket.file('img.png', {\n encryptionKey: encryptionKey\n });\n\n // Or with `file#setEncryptionKey`:\n var file = bucket.file('img.png');\n file.setEncryptionKey(encryptionKey);\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"bucket.upload('local-image.png').then(function(data) {\n var file = data[0];\n});"}],"params":[{"name":"localPath","description":"
  • The fully qualified path to the file you wish to upload to your bucket.
","types":["string"],"optional":false,"nullable":false},{"name":"options","description":"
  • Configuration options.
","types":["object"],"optional":true,"nullable":false},{"name":"options.destination","description":"
  • The place to save your file. If given a string, the file will be uploaded to the bucket using the string as a filename. When given a File object, your local file will be uploaded to the File object's bucket and under the File object's name. Lastly, when this argument is omitted, the file is uploaded to your bucket using the name of the local file.
","types":["string","storage/file"],"optional":false,"nullable":false},{"name":"options.encryptionKey","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.gzip","description":"
  • Automatically gzip the file. This will set options.metadata.contentEncoding to gzip.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.metadata","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"options.offset","description":"
  • The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.
","types":["string"],"optional":false,"nullable":false},{"name":"options.predefinedAcl","description":"
  • Apply a predefined set of access controls to this object.

    Acceptable values are:

    • authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.

    • bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.

    • bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.

    • private - Object owner gets OWNER access.

    • projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.

    • publicRead - Object owner gets OWNER access, and allUsers get READER access.

","types":["string"],"optional":false,"nullable":false},{"name":"options.private","description":"
  • Make the uploaded file private. (Alias for options.predefinedAcl = 'private')
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.public","description":"
  • Make the uploaded file public. (Alias for options.predefinedAcl = 'publicRead')
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.resumable","description":"
  • Force a resumable upload. (default: true for files larger than 5 MB).
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.uri","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.validation","description":"
  • Possible values: "md5", "crc32c", or false. By default, data integrity is validated with an MD5 checksum for maximum reliability. CRC32c will provide better performance with less reliability. You may also choose to skip validation completely, however this is not recommended.
","types":["string","boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.file","description":"
  • The uploaded File.
","types":["storage/file"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.owners","name":"acl.owners","type":"instance","description":"

An object of convenience methods to add or delete owner ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.owners.addAllAuthenticatedUsers
  • myFile.acl.owners.deleteAllAuthenticatedUsers
  • myFile.acl.owners.addAllUsers
  • myFile.acl.owners.deleteAllUsers
  • myFile.acl.owners.addDomain
  • myFile.acl.owners.deleteDomain
  • myFile.acl.owners.addGroup
  • myFile.acl.owners.deleteGroup
  • myFile.acl.owners.addProject
  • myFile.acl.owners.deleteProject
  • myFile.acl.owners.addUser
  • myFile.acl.owners.deleteUser
","source":"packages/storage/src/acl.js#L120","resources":[],"examples":[{"caption":"

Add a user as an owner of a file.

","code":"var myBucket = gcs.bucket('my-bucket');\nvar myFile = myBucket.file('my-file');\nmyFile.acl.owners.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.OWNER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.owners.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.readers","name":"acl.readers","type":"instance","description":"

An object of convenience methods to add or delete reader ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.readers.addAllAuthenticatedUsers
  • myFile.acl.readers.deleteAllAuthenticatedUsers
  • myFile.acl.readers.addAllUsers
  • myFile.acl.readers.deleteAllUsers
  • myFile.acl.readers.addDomain
  • myFile.acl.readers.deleteDomain
  • myFile.acl.readers.addGroup
  • myFile.acl.readers.deleteGroup
  • myFile.acl.readers.addProject
  • myFile.acl.readers.deleteProject
  • myFile.acl.readers.addUser
  • myFile.acl.readers.deleteUser
","source":"packages/storage/src/acl.js#L165","resources":[],"examples":[{"caption":"

Add a user as a reader of a file.

","code":"myFile.acl.readers.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.READER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.readers.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.writers","name":"acl.writers","type":"instance","description":"

An object of convenience methods to add or delete writer ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.writers.addAllAuthenticatedUsers
  • myFile.acl.writers.deleteAllAuthenticatedUsers
  • myFile.acl.writers.addAllUsers
  • myFile.acl.writers.deleteAllUsers
  • myFile.acl.writers.addDomain
  • myFile.acl.writers.deleteDomain
  • myFile.acl.writers.addGroup
  • myFile.acl.writers.deleteGroup
  • myFile.acl.writers.addProject
  • myFile.acl.writers.deleteProject
  • myFile.acl.writers.addUser
  • myFile.acl.writers.deleteUser
","source":"packages/storage/src/acl.js#L210","resources":[],"examples":[{"caption":"

Add a user as a writer of a file.

","code":"myFile.acl.writers.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.WRITER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.writers.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.add","name":"acl.add","type":"instance","description":"

Add access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L258","resources":[{"title":"BucketAccessControls: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/insert"},{"title":"ObjectAccessControls: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/insert"}],"examples":[{"code":"var options = {\n entity: 'user-useremail@example.com',\n role: gcs.acl.OWNER_ROLE\n};\n\nmyBucket.acl.add(options, function(err, aclObject, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property. \nHere is how you would grant ownership permissions to a user on a specific \nrevision of a file.

","code":"myFile.acl.add({\n entity: 'user-useremail@example.com',\n role: gcs.acl.OWNER_ROLE,\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myBucket.acl.add(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be added.
","types":["string"],"optional":false,"nullable":false},{"name":"options.role","description":"
  • Permissions allowed for the defined entity. See storage#acl.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • The Acl Object.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.delete","name":"acl.delete","type":"instance","description":"

Delete access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L319","resources":[{"title":"BucketAccessControls: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/delete"},{"title":"ObjectAccessControls: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/delete"}],"examples":[{"code":"myBucket.acl.delete({\n entity: 'user-useremail@example.com'\n}, function(err, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.delete({\n entity: 'user-useremail@example.com',\n generation: 1\n}, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be revoked.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.get","name":"acl.get","type":"instance","description":"

Get access controls on a storage/bucket or storage/file. If an entity is omitted, you will receive an array of all applicable access controls.

","source":"packages/storage/src/acl.js#L387","resources":[{"title":"BucketAccessControls: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/get"},{"title":"ObjectAccessControls: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/get"}],"examples":[{"code":"myBucket.acl.get({\n entity: 'user-useremail@example.com'\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

Get all access controls.

","code":"myBucket.acl.get(function(err, aclObjects, apiResponse) {\n // aclObjects = [\n // {\n // entity: 'user-useremail@example.com',\n // role: 'owner'\n // }\n // ]\n});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.get({\n entity: 'user-useremail@example.com',\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myBucket.acl.get().then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object. If you want to receive a list of all access controls, pass the callback function as the only argument.
","types":["object","function"],"optional":false,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be fetched.
","types":["string"],"optional":true,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • Single or Array of Acl Objects.
","types":["object","array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.update","name":"acl.update","type":"instance","description":"

Update access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L466","resources":[{"title":"BucketAccessControls: update API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/update"},{"title":"ObjectAccessControls: update API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/update"}],"examples":[{"code":"var options = {\n entity: 'user-useremail@example.com',\n role: gcs.acl.WRITER_ROLE\n};\n\nmyBucket.acl.update(options, function(err, aclObject, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.update({\n entity: 'user-useremail@example.com',\n role: gcs.acl.WRITER_ROLE,\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.update(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be updated.
","types":["string"],"optional":false,"nullable":false},{"name":"options.role","description":"
  • Permissions allowed for the defined entity. See storage#acl.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • The updated Acl Object.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.default.owners","name":"acl.default.owners","type":"instance","description":"

An object of convenience methods to add or delete owner ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.owners.addAllAuthenticatedUsers
  • myFile.acl.owners.deleteAllAuthenticatedUsers
  • myFile.acl.owners.addAllUsers
  • myFile.acl.owners.deleteAllUsers
  • myFile.acl.owners.addDomain
  • myFile.acl.owners.deleteDomain
  • myFile.acl.owners.addGroup
  • myFile.acl.owners.deleteGroup
  • myFile.acl.owners.addProject
  • myFile.acl.owners.deleteProject
  • myFile.acl.owners.addUser
  • myFile.acl.owners.deleteUser
","source":"packages/storage/src/acl.js#L120","resources":[],"examples":[{"caption":"

Add a user as an owner of a file.

","code":"var myBucket = gcs.bucket('my-bucket');\nvar myFile = myBucket.file('my-file');\nmyFile.acl.owners.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.OWNER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.owners.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.default.readers","name":"acl.default.readers","type":"instance","description":"

An object of convenience methods to add or delete reader ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.readers.addAllAuthenticatedUsers
  • myFile.acl.readers.deleteAllAuthenticatedUsers
  • myFile.acl.readers.addAllUsers
  • myFile.acl.readers.deleteAllUsers
  • myFile.acl.readers.addDomain
  • myFile.acl.readers.deleteDomain
  • myFile.acl.readers.addGroup
  • myFile.acl.readers.deleteGroup
  • myFile.acl.readers.addProject
  • myFile.acl.readers.deleteProject
  • myFile.acl.readers.addUser
  • myFile.acl.readers.deleteUser
","source":"packages/storage/src/acl.js#L165","resources":[],"examples":[{"caption":"

Add a user as a reader of a file.

","code":"myFile.acl.readers.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.READER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.readers.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.default.writers","name":"acl.default.writers","type":"instance","description":"

An object of convenience methods to add or delete writer ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.writers.addAllAuthenticatedUsers
  • myFile.acl.writers.deleteAllAuthenticatedUsers
  • myFile.acl.writers.addAllUsers
  • myFile.acl.writers.deleteAllUsers
  • myFile.acl.writers.addDomain
  • myFile.acl.writers.deleteDomain
  • myFile.acl.writers.addGroup
  • myFile.acl.writers.deleteGroup
  • myFile.acl.writers.addProject
  • myFile.acl.writers.deleteProject
  • myFile.acl.writers.addUser
  • myFile.acl.writers.deleteUser
","source":"packages/storage/src/acl.js#L210","resources":[],"examples":[{"caption":"

Add a user as a writer of a file.

","code":"myFile.acl.writers.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.WRITER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.writers.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.default.add","name":"acl.default.add","type":"instance","description":"

Add access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L258","resources":[{"title":"BucketAccessControls: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/insert"},{"title":"ObjectAccessControls: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/insert"}],"examples":[{"code":"var options = {\n entity: 'user-useremail@example.com',\n role: gcs.acl.OWNER_ROLE\n};\n\nmyBucket.acl.add(options, function(err, aclObject, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property. \nHere is how you would grant ownership permissions to a user on a specific \nrevision of a file.

","code":"myFile.acl.add({\n entity: 'user-useremail@example.com',\n role: gcs.acl.OWNER_ROLE,\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myBucket.acl.add(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be added.
","types":["string"],"optional":false,"nullable":false},{"name":"options.role","description":"
  • Permissions allowed for the defined entity. See storage#acl.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • The Acl Object.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.default.delete","name":"acl.default.delete","type":"instance","description":"

Delete access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L319","resources":[{"title":"BucketAccessControls: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/delete"},{"title":"ObjectAccessControls: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/delete"}],"examples":[{"code":"myBucket.acl.delete({\n entity: 'user-useremail@example.com'\n}, function(err, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.delete({\n entity: 'user-useremail@example.com',\n generation: 1\n}, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be revoked.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.default.get","name":"acl.default.get","type":"instance","description":"

Get access controls on a storage/bucket or storage/file. If an entity is omitted, you will receive an array of all applicable access controls.

","source":"packages/storage/src/acl.js#L387","resources":[{"title":"BucketAccessControls: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/get"},{"title":"ObjectAccessControls: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/get"}],"examples":[{"code":"myBucket.acl.get({\n entity: 'user-useremail@example.com'\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

Get all access controls.

","code":"myBucket.acl.get(function(err, aclObjects, apiResponse) {\n // aclObjects = [\n // {\n // entity: 'user-useremail@example.com',\n // role: 'owner'\n // }\n // ]\n});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.get({\n entity: 'user-useremail@example.com',\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myBucket.acl.get().then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object. If you want to receive a list of all access controls, pass the callback function as the only argument.
","types":["object","function"],"optional":false,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be fetched.
","types":["string"],"optional":true,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • Single or Array of Acl Objects.
","types":["object","array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.default.update","name":"acl.default.update","type":"instance","description":"

Update access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L466","resources":[{"title":"BucketAccessControls: update API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/update"},{"title":"ObjectAccessControls: update API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/update"}],"examples":[{"code":"var options = {\n entity: 'user-useremail@example.com',\n role: gcs.acl.WRITER_ROLE\n};\n\nmyBucket.acl.update(options, function(err, aclObject, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.update({\n entity: 'user-useremail@example.com',\n role: gcs.acl.WRITER_ROLE,\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.update(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be updated.
","types":["string"],"optional":false,"nullable":false},{"name":"options.role","description":"
  • Permissions allowed for the defined entity. See storage#acl.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • The updated Acl Object.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"bucket.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/storage/channel.json b/json/google-cloud/v0.51.1/storage/channel.json new file mode 100644 index 00000000000..5caa7cb22d4 --- /dev/null +++ b/json/google-cloud/v0.51.1/storage/channel.json @@ -0,0 +1 @@ +{"id":"storage/channel","type":"class","name":"Channel","overview":"

\n This class allows you interact with Cloud Storage.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/storage.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/storage/src/channel.js","parent":"storage","children":[],"methods":[{"id":"Channel","name":"Channel","type":"constructor","description":"

Create a channel object to interact with a Cloud Storage channel.

","source":"packages/storage/src/channel.js#L44","resources":[{"title":"Object Change Notification","link":"https://cloud.google.com/storage/docs/object-change-notification"}],"examples":[{"code":"var channel = gcs.channel('id', 'resource-id');"}],"params":[{"name":"id","description":"
  • The ID of the channel.
","types":["string"],"optional":false,"nullable":false},{"name":"resourceId","description":"
  • The resource ID of the channel.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"stop","name":"stop","type":"instance","description":"

Stop this channel.

","source":"packages/storage/src/channel.js#L87","resources":[],"examples":[{"code":"channel.stop(function(err, apiResponse) {\n if (!err) {\n // Channel stopped successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"channel.stop().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"channel.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/storage/file.json b/json/google-cloud/v0.51.1/storage/file.json new file mode 100644 index 00000000000..c00d8bf4eaa --- /dev/null +++ b/json/google-cloud/v0.51.1/storage/file.json @@ -0,0 +1 @@ +{"id":"storage/file","type":"class","name":"File","overview":"

\n This class allows you interact with Cloud Storage.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/storage.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/storage/src/file.js","parent":"storage","children":[],"methods":[{"id":"File","name":"File","type":"constructor","description":"

A File object is created from your Bucket object using storage/bucket#file.

","source":"packages/storage/src/file.js#L98","resources":[],"examples":[{"code":"var myBucket = gcs.bucket('my-bucket');\n\nvar file = myBucket.file('my-file');"}],"params":[],"exceptions":[],"returns":[]},{"id":"delete","name":"delete","type":"instance","description":"

Delete the file.

","source":"packages/storage/src/file.js#L138","resources":[{"title":"Objects: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/delete"}],"examples":[{"code":"file.delete(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"exists","name":"exists","type":"instance","description":"

Check if the file exists.

","source":"packages/storage/src/file.js#L162","resources":[],"examples":[{"code":"file.exists(function(err, exists) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.exists().then(function(data) {\n var exists = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.exists","description":"
  • Whether the file exists or not.
","types":["boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"get","name":"get","type":"instance","description":"

Get a file object and its metadata if it exists.

","source":"packages/storage/src/file.js#L180","resources":[],"examples":[{"code":"file.get(function(err, file, apiResponse) {\n // file.metadata` has been populated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.get().then(function(data) {\n var file = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"getMetadata","name":"getMetadata","type":"instance","description":"

Get the file's metadata.

","source":"packages/storage/src/file.js#L204","resources":[{"title":"Objects: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/get"}],"examples":[{"code":"file.getMetadata(function(err, metadata, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.getMetadata().then(function(data) {\n var metadata = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.metadata","description":"
  • The File's metadata.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setMetadata","name":"setMetadata","type":"instance","description":"

Merge the given metadata with the current remote file's metadata. This will set metadata if it was previously unset or update previously set metadata. To unset previously set metadata, set its value to null.

You can set custom key/value pairs in the metadata key of the given object, however the other properties outside of this object must adhere to the official API documentation.

See the examples below for more information.

","source":"packages/storage/src/file.js#L258","resources":[{"title":"Objects: patch API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/patch"}],"examples":[{"code":"var metadata = {\n contentType: 'application/x-font-ttf',\n metadata: {\n my: 'custom',\n properties: 'go here'\n }\n};\n\nfile.setMetadata(metadata, function(err, apiResponse) {});\n\n// Assuming current metadata = { hello: 'world', unsetMe: 'will do' }\nfile.setMetadata({\n metadata: {\n abc: '123', // will be set.\n unsetMe: null, // will be unset (deleted).\n hello: 'goodbye' // will be updated from 'hello' to 'goodbye'.\n }\n}, function(err, apiResponse) {\n // metadata should now be { abc: '123', hello: 'goodbye' }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.setMetadata(metadata).then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"metadata","description":"
  • The metadata you wish to update.
","types":["object"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl","name":"acl","type":"instance","description":"

Cloud Storage uses access control lists (ACLs) to manage object and bucket access. ACLs are the mechanism you use to share objects with other users and allow other users to access your buckets and objects.

An ACL consists of one or more entries, where each entry grants permissions to an entity. Permissions define the actions that can be performed against an object or bucket (for example, READ or WRITE); the entity defines who the permission applies to (for example, a specific user or group of users).

The acl object on a File instance provides methods to get you a list of the ACLs defined on your bucket, as well as set, update, and delete them.

","source":"packages/storage/src/file.js#L313","resources":[{"title":"About Access Control lists","link":"http://goo.gl/6qBBPO"}],"examples":[{"caption":"

Make a file publicly readable.

","code":"var options = {\n entity: 'allUsers',\n role: gcs.acl.READER_ROLE\n};\n\nfile.acl.add(options, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.acl.add(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"copy","name":"copy","type":"instance","description":"

Copy this file to another file. By default, this will copy the file to the same bucket, but you can choose to copy it to another Bucket by providing a Bucket or File object or a URL starting with "gs://".

","source":"packages/storage/src/file.js#L424","resources":[{"title":"Objects: copy API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/copy"}],"examples":[{"caption":"

You can pass in a variety of types for the destination. \nFor all of the below examples, assume we are working with the following \nBucket and File objects.

","code":"var bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-image.png');"},{"caption":"

If you pass in a string for the destination, the file is copied to its \ncurrent bucket, under the new name provided.

","code":"file.copy('my-image-copy.png', function(err, copiedFile, apiResponse) {\n // `my-bucket` now contains:\n // - \"my-image.png\"\n // - \"my-image-copy.png\"\n\n // `copiedFile` is an instance of a File object that refers to your new\n // file.\n});"},{"caption":"

If you pass in a string starting with \"gs:\n\" for the destination, the \nfile is copied to the other bucket and under the new name provided.

","code":"var newLocation = 'gs://another-bucket/my-image-copy.png';\nfile.copy(newLocation, function(err, copiedFile, apiResponse) {\n // `my-bucket` still contains:\n // - \"my-image.png\"\n //\n // `another-bucket` now contains:\n // - \"my-image-copy.png\"\n\n // `copiedFile` is an instance of a File object that refers to your new\n // file.\n});"},{"caption":"

If you pass in a Bucket object, the file will be copied to that bucket \nusing the same name.

","code":"var anotherBucket = gcs.bucket('another-bucket');\nfile.copy(anotherBucket, function(err, copiedFile, apiResponse) {\n // `my-bucket` still contains:\n // - \"my-image.png\"\n //\n // `another-bucket` now contains:\n // - \"my-image.png\"\n\n // `copiedFile` is an instance of a File object that refers to your new\n // file.\n});"},{"caption":"

If you pass in a File object, you have complete control over the new \nbucket and filename.

","code":"var anotherFile = anotherBucket.file('my-awesome-image.png');\nfile.copy(anotherFile, function(err, copiedFile, apiResponse) {\n // `my-bucket` still contains:\n // - \"my-image.png\"\n //\n // `another-bucket` now contains:\n // - \"my-awesome-image.png\"\n\n // Note:\n // The `copiedFile` parameter is equal to `anotherFile`.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.copy(newLocation).then(function(data) {\n var newFile = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"destination","description":"
  • Destination file.
","types":["string","storage/bucket","storage/file"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.copiedFile","description":"
  • The copied File.
","types":["storage/file"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If the destination file is not provided.

"}],"returns":[]},{"id":"createReadStream","name":"createReadStream","type":"instance","description":"

Create a readable stream to read the contents of the remote file. It can be piped to a writable stream or listened to for 'data' events to read a file's contents.

In the unlikely event there is a mismatch between what you downloaded and the version in your Bucket, your error handler will receive an error with code "CONTENT_DOWNLOAD_MISMATCH". If you receive this error, the best recourse is to try downloading the file again.

For faster crc32c computation, you must manually install fast-crc32c:

$ npm install --save fast-crc32c 

NOTE: Readable streams will emit the end event when the file is fully downloaded.

","source":"packages/storage/src/file.js#L579","resources":[],"examples":[{"caption":"

Downloading a File

\nThe example below demonstrates how we can reference a remote file, then \npipe its contents to a local file. This is effectively creating a local \nbackup of your remote data.

","code":"var fs = require('fs');\nvar remoteFile = bucket.file('image.png');\nvar localFilename = '/Users/stephen/Photos/image.png';\n\nremoteFile.createReadStream()\n .on('error', function(err) {})\n .on('response', function(response) {\n // Server connected and responded with the specified status and headers.\n })\n .on('end', function() {\n // The file is fully downloaded.\n })\n .pipe(fs.createWriteStream(localFilename));"},{"caption":"

To limit the downloaded data to only a byte range, pass an options object.

","code":"var logFile = myBucket.file('access_log');\nlogFile.createReadStream({\n start: 10000,\n end: 20000\n })\n .on('error', function(err) {})\n .pipe(fs.createWriteStream('/Users/stephen/logfile.txt'));"},{"caption":"

To read a tail byte range, specify only options.end as a negative \nnumber.

","code":"var logFile = myBucket.file('access_log');\nlogFile.createReadStream({\n end: -100\n })\n .on('error', function(err) {})\n .pipe(fs.createWriteStream('/Users/stephen/logfile.txt'));"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.validation","description":"
  • Possible values: "md5", "crc32c", or false. By default, data integrity is validated with a CRC32c checksum. You may use MD5 if preferred, but that hash is not supported for composite objects. An error will be raised if MD5 is specified but is not available. You may also choose to skip validation completely, however this is not recommended.
","types":["string","boolean"],"optional":false,"nullable":false},{"name":"options.start","description":"
  • A byte offset to begin the file's download from. Default is 0. NOTE: Byte ranges are inclusive; that is, options.start = 0 and options.end = 999 represent the first 1000 bytes in a file or object. NOTE: when specifying a byte range, data integrity is not available.
","types":["number"],"optional":false,"nullable":false},{"name":"options.end","description":"
  • A byte offset to stop reading the file at. NOTE: Byte ranges are inclusive; that is, options.start = 0 and options.end = 999 represent the first 1000 bytes in a file or object. NOTE: when specifying a byte range, data integrity is not available.
","types":["number"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["ReadableStream"],"description":""}]},{"id":"createResumableUpload","name":"createResumableUpload","type":"instance","description":"

Create a unique resumable upload session URI. This is the first step when performing a resumable upload.

See the Resumable upload guide for more on how the entire process works.

Note

If you are just looking to perform a resumable upload without worrying about any of the details, see storage/createWriteStream. Resumable uploads are performed by default.

","source":"packages/storage/src/file.js#L803","resources":[{"title":"Resumable upload guide","link":"https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload"}],"examples":[{"code":"file.createResumableUpload(function(err, uri) {\n if (!err) {\n // `uri` can be used to PUT data to.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.createResumableUpload().then(function(data) {\n var uri = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.metadata","description":"
  • Metadata to set on the file.
","types":["object"],"optional":false,"nullable":false},{"name":"options.origin","description":"
  • Origin header to set for the upload.
","types":["string"],"optional":false,"nullable":false},{"name":"options.predefinedAcl","description":"
  • Apply a predefined set of access controls to this object.

    Acceptable values are:

    • authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.

    • bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.

    • bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.

    • private - Object owner gets OWNER access.

    • projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.

    • publicRead - Object owner gets OWNER access, and allUsers get READER access.

","types":["string"],"optional":false,"nullable":false},{"name":"options.private","description":"
  • Make the uploaded file private. (Alias for options.predefinedAcl = 'private')
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.public","description":"
  • Make the uploaded file public. (Alias for options.predefinedAcl = 'publicRead')
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.uri","description":"
  • The resumable upload's unique session URI.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"createWriteStream","name":"createWriteStream","type":"instance","description":"

Create a writable stream to overwrite the contents of the file in your bucket.

A File object can also be used to create files for the first time.

Resumable uploads are automatically enabled and must be shut off explicitly by setting options.resumable to false.

There is some overhead when using a resumable upload that can cause noticeable performance degradation while uploading a series of small files. When uploading files less than 10MB, it is recommended that the resumable feature is disabled.

For faster crc32c computation, you must manually install fast-crc32c:

$ npm install --save fast-crc32c 

NOTE: Writable streams will emit the finish event when the file is fully uploaded.

","source":"packages/storage/src/file.js#L949","resources":[{"title":"Upload Options (Simple or Resumable)","link":"https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload"},{"title":"Objects: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/insert"}],"examples":[{"code":"var fs = require('fs');"},{"caption":"

Uploading a File

\nNow, consider a case where we want to upload a file to your bucket. You \nhave the option of using storage/bucket#upload, but that is just \na convenience method which will do the following.

","code":"fs.createReadStream('/Users/stephen/Photos/birthday-at-the-zoo/panda.jpg')\n .pipe(file.createWriteStream())\n .on('error', function(err) {})\n .on('finish', function() {\n // The file upload is complete.\n });"},{"caption":"

Uploading a File with gzip compression

","code":"fs.createReadStream('/Users/stephen/site/index.html')\n .pipe(file.createWriteStream({ gzip: true }))\n .on('error', function(err) {})\n .on('finish', function() {\n // The file upload is complete.\n });"},{"caption":"

Downloading the file with createReadStream will automatically decode the \nfile.

"},{"caption":"

Uploading a File with Metadata

\nOne last case you may run into is when you want to upload a file to your \nbucket and set its metadata at the same time. Like above, you can use \nstorage/bucket#upload to do this, which is just a wrapper around \nthe following.

","code":"fs.createReadStream('/Users/stephen/Photos/birthday-at-the-zoo/panda.jpg')\n .pipe(file.createWriteStream({\n metadata: {\n contentType: 'image/jpeg',\n metadata: {\n custom: 'metadata'\n }\n }\n }))\n .on('error', function(err) {})\n .on('finish', function() {\n // The file upload is complete.\n });"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.gzip","description":"
  • Automatically gzip the file. This will set options.metadata.contentEncoding to gzip.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.metadata","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.offset","description":"
  • The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.
","types":["string"],"optional":false,"nullable":false},{"name":"options.predefinedAcl","description":"
  • Apply a predefined set of access controls to this object.

    Acceptable values are:

    • authenticatedRead - Object owner gets OWNER access, and allAuthenticatedUsers get READER access.

    • bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access.

    • bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access.

    • private - Object owner gets OWNER access.

    • projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles.

    • publicRead - Object owner gets OWNER access, and allUsers get READER access.

","types":["string"],"optional":false,"nullable":false},{"name":"options.private","description":"
  • Make the uploaded file private. (Alias for options.predefinedAcl = 'private')
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.public","description":"
  • Make the uploaded file public. (Alias for options.predefinedAcl = 'publicRead')
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.resumable","description":"
  • Force a resumable upload. NOTE: When working with streams, the file format and size is unknown until it's completely consumed. Because of this, it's best for you to be explicit for what makes sense given your input.
","types":["boolean"],"optional":false,"nullable":false},{"name":"options.uri","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"options.validation","description":"
  • Possible values: "md5", "crc32c", or false. By default, data integrity is validated with a CRC32c checksum. You may use MD5 if preferred, but that hash is not supported for composite objects. An error will be raised if MD5 is specified but is not available. You may also choose to skip validation completely, however this is not recommended.
","types":["string","boolean"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["WritableStream"],"description":""}]},{"id":"download","name":"download","type":"instance","description":"

Convenience method to download a file into memory or to a local destination.

","source":"packages/storage/src/file.js#L1106","resources":[],"examples":[{"caption":"

Download a file into memory. The contents will be available as the second \nargument in the demonstration below, contents.

","code":"file.download(function(err, contents) {});"},{"caption":"

Download a file to a local destination.

","code":"file.download({\n destination: '/Users/me/Desktop/file-backup.txt'\n}, function(err) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.download().then(function(data) {\n var contents = data[0];\n});"}],"params":[{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.destination","description":"
  • Local file path to write the file's contents to.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.contents","description":"
  • The contents of a File.
","types":["buffer"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"setEncryptionKey","name":"setEncryptionKey","type":"instance","description":"

The Storage API allows you to use a custom key for server-side encryption.

","source":"packages/storage/src/file.js#L1163","resources":[{"title":"Customer-supplied Encryption Keys","link":"https://cloud.google.com/storage/docs/encryption#customer-supplied"}],"examples":[{"code":"var crypto = require('crypto');\nvar encryptionKey = crypto.randomBytes(32);\n\nvar fileWithCustomEncryption = myBucket.file('my-file');\nfileWithCustomEncryption.setEncryptionKey(encryptionKey);\n\nvar fileWithoutCustomEncryption = myBucket.file('my-file');\n\nfileWithCustomEncryption.save('data', function(err) {\n // Try to download with the File object that hasn't had\n // `setEncryptionKey()` called:\n fileWithoutCustomEncryption.download(function(err) {\n // We will receive an error:\n // err.message === 'Bad Request'\n\n // Try again with the File object we called `setEncryptionKey()` on:\n fileWithCustomEncryption.download(function(err, contents) {\n // contents.toString() === 'data'\n });\n });\n});"}],"params":[{"name":"encryptionKey","description":"
  • An AES-256 encryption key.
","types":["string","buffer"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["storage/file"],"description":""}]},{"id":"getSignedPolicy","name":"getSignedPolicy","type":"instance","description":"

Get a signed policy document to allow a user to upload data with a POST request.

","source":"packages/storage/src/file.js#L1247","resources":[{"title":"Policy Document Reference","link":"https://cloud.google.com/storage/docs/xml-api/post-object#policydocument"}],"examples":[{"code":"var options = {\n equals: ['$Content-Type', 'image/jpeg'],\n expires: '10-25-2022',\n contentLengthRange: {\n min: 0,\n max: 1024\n }\n};\n\nfile.getSignedPolicy(options, function(err, policy) {\n // policy.string: the policy document in plain text.\n // policy.base64: the policy document in base64.\n // policy.signature: the policy signature in base64.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.getSignedPolicy(options).then(function(data) {\n var policy = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.equals","description":"
  • Array of request parameters and their expected value (e.g. [['$', '']]). Values are translated into equality constraints in the conditions field of the policy document (e.g. ['eq', '$', '']). If only one equality condition is to be specified, options.equals can be a one- dimensional array (e.g. ['$', '']).
","types":["array","array[]"],"optional":true,"nullable":false},{"name":"options.expires","description":"
  • A timestamp when this policy will expire. Any value given is passed to new Date().
","types":[],"optional":false,"nullable":false},{"name":"options.startsWith","description":"
  • Array of request parameters and their expected prefixes (e.g. [['$', '']). Values are translated into starts-with constraints in the conditions field of the policy document (e.g. ['starts-with', '$', '']). If only one prefix condition is to be specified, options.startsWith can be a one- dimensional array (e.g. ['$', '']).
","types":["array","array[]"],"optional":true,"nullable":false},{"name":"options.acl","description":"
  • ACL for the object from possibly predefined ACLs.
","types":["string"],"optional":true,"nullable":false},{"name":"options.successRedirect","description":"
  • The URL to which the user client is redirected if the upload is successful.
","types":["string"],"optional":true,"nullable":false},{"name":"options.successStatus","description":"
  • The status of the Google Storage response if the upload is successful (must be string).
","types":["string"],"optional":true,"nullable":false},{"name":"options.contentLengthRange","description":"","types":["object"],"optional":true,"nullable":false},{"name":"options.contentLengthRange.min","description":"
  • Minimum value for the request's content length.
","types":["number"],"optional":false,"nullable":false},{"name":"options.contentLengthRange.max","description":"
  • Maximum value for the request's content length.
","types":["number"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.policy","description":"
  • The document policy.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If an expiration timestamp from the past is given.

"},{"type":"Error","description":"

If options.equals has an array with less or more than two members.

"},{"type":"Error","description":"

If options.startsWith has an array with less or more than two members.

"}],"returns":[]},{"id":"getSignedUrl","name":"getSignedUrl","type":"instance","description":"

Get a signed URL to allow limited time access to the file.

","source":"packages/storage/src/file.js#L1440","resources":[{"title":"Signed URLs Reference","link":"https://cloud.google.com/storage/docs/access-control/signed-urls"}],"examples":[{"caption":"

Generate a URL that allows temporary access to download your file.

","code":"var request = require('request');\n\nvar config = {\n action: 'read',\n expires: '03-17-2025'\n};\n\nfile.getSignedUrl(config, function(err, url) {\n if (err) {\n console.error(err);\n return;\n }\n\n // The file is now available to read from this URL.\n request(url, function(err, resp) {\n // resp.statusCode = 200\n });\n});"},{"caption":"

Generate a URL to allow write permissions. This means anyone with this URL \ncan send a POST request with new data that will overwrite the file.

","code":"file.getSignedUrl({\n action: 'write',\n expires: '03-17-2025'\n}, function(err, url) {\n if (err) {\n console.error(err);\n return;\n }\n\n // The file is now available to be written to.\n var writeStream = request.put(url);\n writeStream.end('New data');\n\n writeStream.on('complete', function(resp) {\n // Confirm the new content was saved.\n file.download(function(err, fileContents) {\n console.log('Contents:', fileContents.toString());\n // Contents: New data\n });\n });\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.getSignedUrl(config).then(function(data) {\n var url = data[0];\n});"}],"params":[{"name":"config","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"config.action","description":"
  • "read" (HTTP: GET), "write" (HTTP: PUT), or "delete" (HTTP: DELETE).
","types":["string"],"optional":false,"nullable":false},{"name":"config.cname","description":" ","types":["string"],"optional":true,"nullable":false},{"name":"config.contentMd5","description":"
  • The MD5 digest value in base64. If you provide this, the client must provide this HTTP header with this same value in its request.
","types":["string"],"optional":true,"nullable":false},{"name":"config.contentType","description":"
  • If you provide this value, the client must provide this HTTP header set to the same value.
","types":["string"],"optional":true,"nullable":false},{"name":"config.expires","description":"
  • A timestamp when this link will expire. Any value given is passed to new Date().
","types":[],"optional":false,"nullable":false},{"name":"config.extensionHeaders","description":"
  • If these headers are used, the server will check to make sure that the client provides matching values.
","types":["object"],"optional":true,"nullable":false},{"name":"config.promptSaveAs","description":"
  • The filename to prompt the user to save the file as when the signed url is accessed. This is ignored if config.responseDisposition is set.
","types":["string"],"optional":true,"nullable":false},{"name":"config.responseDisposition","description":" ","types":["string"],"optional":true,"nullable":false},{"name":"config.responseType","description":"
  • The response-content-type parameter of the signed url.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.url","description":"
  • The signed URL.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

if an expiration timestamp from the past is given.

"}],"returns":[]},{"id":"makePrivate","name":"makePrivate","type":"instance","description":"

Make a file private to the project and remove all other permissions. Set options.strict to true to make the file private to only the owner.

","source":"packages/storage/src/file.js#L1562","resources":[{"title":"Objects: patch API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/patch"}],"examples":[{"caption":"

Set the file private so only project maintainers can see and modify it.

","code":"file.makePrivate(function(err) {});"},{"caption":"

Set the file private so only the owner can see and modify it.

","code":"file.makePrivate({ strict: true }, function(err) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.makePrivate().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • The configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.strict","description":"
  • If true, set the file to be private to only the owner user. Otherwise, it will be private to the project.
","types":["boolean"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]},{"id":"makePublic","name":"makePublic","type":"instance","description":"

Set a file to be publicly readable and maintain all previous permissions.

","source":"packages/storage/src/file.js#L1618","resources":[{"title":"ObjectAccessControls: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/insert"}],"examples":[{"code":"file.makePublic(function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.makePublic().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"move","name":"move","type":"instance","description":"

Move this file to another location. By default, this will move the file to the same bucket, but you can choose to move it to another Bucket by providing a Bucket or File object or a URL beginning with "gs://".

Warning: There is currently no atomic move method in the Cloud Storage API, so this method is a composition of storage/file#copy (to the new location) and storage/file#delete (from the old location). While unlikely, it is possible that an error returned to your callback could be triggered from either one of these API calls failing, which could leave a duplicate file lingering.

","source":"packages/storage/src/file.js#L1737","resources":[{"title":"Objects: copy API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objects/copy"}],"examples":[{"caption":"

You can pass in a variety of types for the destination. \nFor all of the below examples, assume we are working with the following \nBucket and File objects.

","code":"var bucket = gcs.bucket('my-bucket');\nvar file = bucket.file('my-image.png');"},{"caption":"

If you pass in a string for the destination, the file is moved to its \ncurrent bucket, under the new name provided.

","code":"file.move('my-image-new.png', function(err, destinationFile, apiResponse) {\n // `my-bucket` no longer contains:\n // - \"my-image.png\"\n // but contains instead:\n // - \"my-image-new.png\"\n\n // `destinationFile` is an instance of a File object that refers to your\n // new file.\n});"},{"caption":"

If you pass in a string starting with \"gs:\n\" for the destination, the \nfile is copied to the other bucket and under the new name provided.

","code":"var newLocation = 'gs://another-bucket/my-image-new.png';\nfile.move(newLocation, function(err, destinationFile, apiResponse) {\n // `my-bucket` no longer contains:\n // - \"my-image.png\"\n //\n // `another-bucket` now contains:\n // - \"my-image-new.png\"\n\n // `destinationFile` is an instance of a File object that refers to your\n // new file.\n});"},{"caption":"

If you pass in a Bucket object, the file will be moved to that bucket \nusing the same name.

","code":"var anotherBucket = gcs.bucket('another-bucket');\n\nfile.move(anotherBucket, function(err, destinationFile, apiResponse) {\n // `my-bucket` no longer contains:\n // - \"my-image.png\"\n //\n // `another-bucket` now contains:\n // - \"my-image.png\"\n\n // `destinationFile` is an instance of a File object that refers to your\n // new file.\n});"},{"caption":"

If you pass in a File object, you have complete control over the new \nbucket and filename.

","code":"var anotherFile = anotherBucket.file('my-awesome-image.png');\n\nfile.move(anotherFile, function(err, destinationFile, apiResponse) {\n // `my-bucket` no longer contains:\n // - \"my-image.png\"\n //\n // `another-bucket` now contains:\n // - \"my-awesome-image.png\"\n\n // Note:\n // The `destinationFile` parameter is equal to `anotherFile`.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.move('my-image-new.png').then(function(data) {\n var destinationFile = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"destination","description":"
  • Destination file.
","types":["string","storage/bucket","storage/file"],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":true,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.destinationFile","description":"
  • The destination File.
","types":["storage/file"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If the destination file is not provided.

"}],"returns":[]},{"id":"save","name":"save","type":"instance","description":"

Write arbitrary data to a file.

This is a convenience method which wraps storage/file#createWriteStream.

","source":"packages/storage/src/file.js#L1785","resources":[],"examples":[{"code":"var contents = 'This is the contents of the file.';\n\nfile.save(contents, function(err) {\n if (!err) {\n // File written successfully.\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.save(contents).then(function() {});"}],"params":[{"name":"data","description":"
  • The data to write to a file.
","types":[],"optional":false,"nullable":false},{"name":"options","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]},{"id":"setStorageClass","name":"setStorageClass","type":"instance","description":"

Set the storage class for this file.

","source":"packages/storage/src/file.js#L1822","resources":[{"title":"Per-Object Storage Class","link":"https://cloud.google.com/storage/docs/per-object-storage-class"},{"title":"Storage Classes","link":"https://cloud.google.com/storage/docs/storage-classes"}],"examples":[{"code":"file.setStorageClass('regional', function(err, apiResponse) {\n if (err) {\n // Error handling omitted.\n }\n\n // The storage class was updated successfully.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"file.setStorageClass('regional').then(function() {});"}],"params":[{"name":"storageClass","description":"
  • The new storage class. (multi_regional, regional, nearline, coldline)
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true}],"exceptions":[],"returns":[]},{"id":"acl.owners","name":"acl.owners","type":"instance","description":"

An object of convenience methods to add or delete owner ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.owners.addAllAuthenticatedUsers
  • myFile.acl.owners.deleteAllAuthenticatedUsers
  • myFile.acl.owners.addAllUsers
  • myFile.acl.owners.deleteAllUsers
  • myFile.acl.owners.addDomain
  • myFile.acl.owners.deleteDomain
  • myFile.acl.owners.addGroup
  • myFile.acl.owners.deleteGroup
  • myFile.acl.owners.addProject
  • myFile.acl.owners.deleteProject
  • myFile.acl.owners.addUser
  • myFile.acl.owners.deleteUser
","source":"packages/storage/src/acl.js#L120","resources":[],"examples":[{"caption":"

Add a user as an owner of a file.

","code":"var myBucket = gcs.bucket('my-bucket');\nvar myFile = myBucket.file('my-file');\nmyFile.acl.owners.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.OWNER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.owners.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.readers","name":"acl.readers","type":"instance","description":"

An object of convenience methods to add or delete reader ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.readers.addAllAuthenticatedUsers
  • myFile.acl.readers.deleteAllAuthenticatedUsers
  • myFile.acl.readers.addAllUsers
  • myFile.acl.readers.deleteAllUsers
  • myFile.acl.readers.addDomain
  • myFile.acl.readers.deleteDomain
  • myFile.acl.readers.addGroup
  • myFile.acl.readers.deleteGroup
  • myFile.acl.readers.addProject
  • myFile.acl.readers.deleteProject
  • myFile.acl.readers.addUser
  • myFile.acl.readers.deleteUser
","source":"packages/storage/src/acl.js#L165","resources":[],"examples":[{"caption":"

Add a user as a reader of a file.

","code":"myFile.acl.readers.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.READER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.readers.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.writers","name":"acl.writers","type":"instance","description":"

An object of convenience methods to add or delete writer ACL permissions for a given entity.

The supported methods include:

  • myFile.acl.writers.addAllAuthenticatedUsers
  • myFile.acl.writers.deleteAllAuthenticatedUsers
  • myFile.acl.writers.addAllUsers
  • myFile.acl.writers.deleteAllUsers
  • myFile.acl.writers.addDomain
  • myFile.acl.writers.deleteDomain
  • myFile.acl.writers.addGroup
  • myFile.acl.writers.deleteGroup
  • myFile.acl.writers.addProject
  • myFile.acl.writers.deleteProject
  • myFile.acl.writers.addUser
  • myFile.acl.writers.deleteUser
","source":"packages/storage/src/acl.js#L210","resources":[],"examples":[{"caption":"

Add a user as a writer of a file.

","code":"myFile.acl.writers.addUser('email@example.com', function(err, aclObject) {});"},{"caption":"

For reference, the above command is the same as running the following.

","code":"myFile.acl.add({\n entity: 'user-email@example.com',\n role: gcs.acl.WRITER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.writers.addUser('email@example.com').then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[{"types":["object"],"description":""}]},{"id":"acl.add","name":"acl.add","type":"instance","description":"

Add access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L258","resources":[{"title":"BucketAccessControls: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/insert"},{"title":"ObjectAccessControls: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/insert"}],"examples":[{"code":"var options = {\n entity: 'user-useremail@example.com',\n role: gcs.acl.OWNER_ROLE\n};\n\nmyBucket.acl.add(options, function(err, aclObject, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property. \nHere is how you would grant ownership permissions to a user on a specific \nrevision of a file.

","code":"myFile.acl.add({\n entity: 'user-useremail@example.com',\n role: gcs.acl.OWNER_ROLE,\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myBucket.acl.add(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":false,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be added.
","types":["string"],"optional":false,"nullable":false},{"name":"options.role","description":"
  • Permissions allowed for the defined entity. See storage#acl.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • The Acl Object.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.delete","name":"acl.delete","type":"instance","description":"

Delete access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L319","resources":[{"title":"BucketAccessControls: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/delete"},{"title":"ObjectAccessControls: delete API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/delete"}],"examples":[{"code":"myBucket.acl.delete({\n entity: 'user-useremail@example.com'\n}, function(err, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.delete({\n entity: 'user-useremail@example.com',\n generation: 1\n}, function(err, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.delete().then(function(data) {\n var apiResponse = data[0];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be revoked.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.get","name":"acl.get","type":"instance","description":"

Get access controls on a storage/bucket or storage/file. If an entity is omitted, you will receive an array of all applicable access controls.

","source":"packages/storage/src/acl.js#L387","resources":[{"title":"BucketAccessControls: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/get"},{"title":"ObjectAccessControls: get API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/get"}],"examples":[{"code":"myBucket.acl.get({\n entity: 'user-useremail@example.com'\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

Get all access controls.

","code":"myBucket.acl.get(function(err, aclObjects, apiResponse) {\n // aclObjects = [\n // {\n // entity: 'user-useremail@example.com',\n // role: 'owner'\n // }\n // ]\n});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.get({\n entity: 'user-useremail@example.com',\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myBucket.acl.get().then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object. If you want to receive a list of all access controls, pass the callback function as the only argument.
","types":["object","function"],"optional":false,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be fetched.
","types":["string"],"optional":true,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • Single or Array of Acl Objects.
","types":["object","array"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl.update","name":"acl.update","type":"instance","description":"

Update access controls on a storage/bucket or storage/file.

","source":"packages/storage/src/acl.js#L466","resources":[{"title":"BucketAccessControls: update API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/update"},{"title":"ObjectAccessControls: update API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/update"}],"examples":[{"code":"var options = {\n entity: 'user-useremail@example.com',\n role: gcs.acl.WRITER_ROLE\n};\n\nmyBucket.acl.update(options, function(err, aclObject, apiResponse) {});"},{"caption":"

For file ACL operations, you can also specify a generation property.

","code":"myFile.acl.update({\n entity: 'user-useremail@example.com',\n role: gcs.acl.WRITER_ROLE,\n generation: 1\n}, function(err, aclObject, apiResponse) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"myFile.acl.update(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"options","description":"
  • Configuration object.
","types":["object"],"optional":true,"nullable":false},{"name":"options.entity","description":"
  • Whose permissions will be updated.
","types":["string"],"optional":false,"nullable":false},{"name":"options.role","description":"
  • Permissions allowed for the defined entity. See storage#acl.
","types":["string"],"optional":false,"nullable":false},{"name":"options.generation","description":"
  • File Objects Only Select a specific revision of this file (as opposed to the latest version, the default).
","types":["int"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.aclObject","description":"
  • The updated Acl Object.
","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]}],"path":"file.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/storage/index.json b/json/google-cloud/v0.51.1/storage/index.json new file mode 100644 index 00000000000..009a1b59261 --- /dev/null +++ b/json/google-cloud/v0.51.1/storage/index.json @@ -0,0 +1 @@ +{"id":"storage","type":"class","name":"Storage","overview":"

\n This class allows you interact with Cloud Storage.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/storage.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar gcs = gcloud.storage({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/storage/src/index.js","parent":null,"children":["storage/acl","storage/bucket","storage/channel","storage/file"],"methods":[{"id":"Storage","name":"Storage","type":"constructor","description":"

ACLs

Cloud Storage uses access control lists (ACLs) to manage object and bucket access. ACLs are the mechanism you use to share files with other users and allow other users to access your buckets and files.

To learn more about ACLs, read this overview on Access Control.

","source":"packages/storage/src/index.js#L72","resources":[{"title":"Cloud Storage overview","link":"https://cloud.google.com/storage/docs/overview"},{"title":"Access Control","link":"https://cloud.google.com/storage/docs/access-control"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"acl","name":"acl","type":"instance","description":"

Cloud Storage uses access control lists (ACLs) to manage object and bucket access. ACLs are the mechanism you use to share objects with other users and allow other users to access your buckets and objects.

This object provides constants to refer to the three permission levels that can be granted to an entity:

  • gcs.acl.OWNER_ROLE - ("OWNER")
  • gcs.acl.READER_ROLE - ("READER")
  • gcs.acl.WRITER_ROLE - ("WRITER")
","source":"packages/storage/src/index.js#L142","resources":[{"title":"About Access Control Lists","link":"https://cloud.google.com/storage/docs/access-control/lists"}],"examples":[{"code":"var albums = gcs.bucket('albums');"},{"caption":"

Make all of the files currently in a bucket publicly readable.

","code":"var options = {\n entity: 'allUsers',\n role: gcs.acl.READER_ROLE\n};\n\nalbums.acl.add(options, function(err, aclObject) {});"},{"caption":"

Make any new objects added to a bucket publicly readable.

","code":"albums.acl.default.add(options, function(err, aclObject) {});"},{"caption":"

Grant a user ownership permissions to a bucket.

","code":"albums.acl.add({\n entity: 'user-useremail@example.com',\n role: gcs.acl.OWNER_ROLE\n}, function(err, aclObject) {});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"albums.acl.add(options).then(function(data) {\n var aclObject = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"bucket","name":"bucket","type":"instance","description":"

Get a reference to a Cloud Storage bucket.

","source":"packages/storage/src/index.js#L160","resources":[],"examples":[{"code":"var albums = gcs.bucket('albums');\nvar photos = gcs.bucket('photos');"}],"params":[{"name":"name","description":"
  • Name of the bucket.
","types":["object","string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["storage/bucket"],"description":""}]},{"id":"channel","name":"channel","type":"instance","description":"

Reference a channel to receive notifications about changes to your bucket.

","source":"packages/storage/src/index.js#L178","resources":[],"examples":[{"code":"var channel = gcs.channel('id', 'resource-id');"}],"params":[{"name":"id","description":"
  • The ID of the channel.
","types":["string"],"optional":false,"nullable":false},{"name":"resourceId","description":"
  • The resource ID of the channel.
","types":["string"],"optional":false,"nullable":false}],"exceptions":[],"returns":[{"types":["storage/channel"],"description":""}]},{"id":"createBucket","name":"createBucket","type":"instance","description":"

Create a bucket.

Cloud Storage uses a flat namespace, so you can't create a bucket with a name that is already in use. For more information, see Bucket Naming Guidelines.

","source":"packages/storage/src/index.js#L247","resources":[{"title":"Buckets: insert API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/buckets/insert"},{"title":"Storage Classes","link":"https://cloud.google.com/storage/docs/storage-classes"}],"examples":[{"code":"var callback = function(err, bucket, apiResponse) {\n // `bucket` is a Bucket object.\n};\n\ngcs.createBucket('new-bucket', callback);"},{"caption":"

Create a bucket in a specific location and region. See the \nOfficial JSON API docs for complete details on the location option. \n

","code":"var metadata = {\n location: 'US-CENTRAL1',\n regional: true\n};\n\ngcs.createBucket('new-bucket', metadata, callback);"},{"caption":"

Enable versioning on a new bucket.

","code":"var metadata = {\n versioning: {\n enabled: true\n }\n};\n\ngcs.createBucket('new-bucket', metadata, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gcs.createBucket('new-bucket').then(function(data) {\n var bucket = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"name","description":"
  • Name of the bucket to create.
","types":["string"],"optional":false,"nullable":false},{"name":"metadata","description":"
  • Metadata to set for the bucket.
","types":["object"],"optional":true,"nullable":false},{"name":"metadata.coldline","description":"
  • Specify the storage class as Coldline.
","types":["boolean"],"optional":false,"nullable":false},{"name":"metadata.dra","description":"
  • Specify the storage class as Durable Reduced Availability.
","types":["boolean"],"optional":false,"nullable":false},{"name":"metadata.multiRegional","description":"
  • Specify the storage class as Multi-Regional.
","types":["boolean"],"optional":false,"nullable":false},{"name":"metadata.nearline","description":"
  • Specify the storage class as Nearline.
","types":["boolean"],"optional":false,"nullable":false},{"name":"metadata.regional","description":"
  • Specify the storage class as Regional.
","types":["boolean"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.bucket","description":"
  • The newly created Bucket.
","types":["storage/bucket"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If a name is not provided.

"}],"returns":[]},{"id":"getBuckets","name":"getBuckets","type":"instance","description":"

Get Bucket objects for all of the buckets in your project.

","source":"packages/storage/src/index.js#L354","resources":[{"title":"Buckets: list API Documentation","link":"https://cloud.google.com/storage/docs/json_api/v1/buckets/list"}],"examples":[{"code":"gcs.getBuckets(function(err, buckets) {\n if (!err) {\n // buckets is an array of Bucket objects.\n }\n});"},{"caption":"

To control how many API requests are made and page through the results \nmanually, set autoPaginate to false.

","code":"var callback = function(err, buckets, nextQuery, apiResponse) {\n if (nextQuery) {\n // More results exist.\n gcs.getBuckets(nextQuery, callback);\n }\n\n // The `metadata` property is populated for you with the metadata at the\n // time of fetching.\n buckets[0].metadata;\n\n // However, in cases where you are concerned the metadata could have\n // changed, use the `getMetadata` method.\n buckets[0].getMetadata(function(err, metadata, apiResponse) {});\n};\n\ngcs.getBuckets({\n autoPaginate: false\n}, callback);"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"gcs.getBuckets().then(function(data) {\n var buckets = data[0];\n});"}],"params":[{"name":"query","description":"
  • Query object.
","types":["object"],"optional":true,"nullable":false},{"name":"query.autoPaginate","description":"
  • Have pagination handled automatically. Default: true.
","types":["boolean"],"optional":false,"nullable":false},{"name":"query.maxApiCalls","description":"
  • Maximum number of API calls to make.
","types":["number"],"optional":false,"nullable":false},{"name":"query.maxResults","description":"
  • Maximum number of items plus prefixes to return.
","types":["number"],"optional":false,"nullable":false},{"name":"query.pageToken","description":"
  • A previously-returned page token representing part of the larger set of results to view.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request
","types":["error"],"optional":false,"nullable":true},{"name":"callback.buckets","description":"
  • List of all buckets from your project.
","types":["storage/bucket[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • The full API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getBucketsStream","name":"getBucketsStream","type":"instance","description":"

Get storage/bucket objects for all of the buckets in your project as a readable object stream.

","source":"packages/storage/src/index.js#L415","resources":[],"examples":[{"code":"gcs.getBucketsStream()\n .on('error', console.error)\n .on('data', function(bucket) {\n // bucket is a Bucket object.\n })\n .on('end', function() {\n // All buckets retrieved.\n });"},{"caption":"

If you anticipate many results, you can end a stream early to prevent \nunnecessary processing and API requests.

","code":"gcs.getBucketsStream()\n .on('data', function(bucket) {\n this.end();\n });"}],"params":[{"name":"query","description":" ","types":["object"],"optional":true,"nullable":false}],"exceptions":[],"returns":[{"types":["stream"],"description":""}]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/toc.json b/json/google-cloud/v0.51.1/toc.json new file mode 100644 index 00000000000..4ac4b170e20 --- /dev/null +++ b/json/google-cloud/v0.51.1/toc.json @@ -0,0 +1 @@ +{"guides":[{"title":"Authentication","id":"authentication","edit":"https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/authentication/readme.md","contents":["https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/readme.md","authentication.md"]},{"title":"FAQ","id":"faq","edit":"https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/faq/readme.md","contents":["https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/faq/readme.md","faq.md"]},{"title":"Troubleshooting","id":"troubleshooting","edit":"https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/troubleshooting/readme.md","contents":["https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/troubleshooting/readme.md","troubleshooting.md"]},{"title":"Contributing","id":"contributing","edit":"https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/contributing/readme.md","contents":"https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/contributing/readme.md"}],"services":[{"type":"google-cloud","title":"Google Cloud"},{"type":"bigquery","title":"BigQuery","nav":[{"type":"bigquery/dataset","title":"Dataset"},{"type":"bigquery/job","title":"Job"},{"type":"bigquery/table","title":"Table"}]},{"type":"bigtable","title":"Bigtable","nav":[{"type":"bigtable/cluster","title":"Cluster"},{"type":"bigtable/family","title":"Family"},{"type":"bigtable/filter","title":"Filter"},{"type":"bigtable/instance","title":"Instance"},{"type":"bigtable/row","title":"Row"},{"type":"bigtable/table","title":"Table"}]},{"type":"compute","title":"Compute","nav":[{"type":"compute/address","title":"Address"},{"type":"compute/autoscaler","title":"Autoscaler"},{"type":"compute/disk","title":"Disk"},{"type":"compute/firewall","title":"Firewall"},{"type":"compute/health-check","title":"HealthCheck"},{"type":"compute/instance-group","title":"InstanceGroup"},{"type":"compute/machine-type","title":"MachineType"},{"type":"compute/network","title":"Network"},{"type":"compute/operation","title":"Operation"},{"type":"compute/region","title":"Region"},{"type":"compute/rule","title":"Rule"},{"type":"compute/service","title":"Service"},{"type":"compute/snapshot","title":"Snapshot"},{"type":"compute/subnetwork","title":"Subnetwork"},{"type":"compute/vm","title":"VM"},{"type":"compute/zone","title":"Zone"}]},{"type":"datastore","title":"Datastore","nav":[{"type":"datastore/query","title":"Query"},{"type":"datastore/transaction","title":"Transaction"}]},{"type":"dns","title":"DNS","nav":[{"type":"dns/change","title":"Change"},{"type":"dns/record","title":"Record"},{"type":"dns/zone","title":"Zone"}]},{"type":"language","title":"Language","nav":[{"type":"language/document","title":"Document"}]},{"type":"logging","title":"Logging","nav":[{"type":"logging/entry","title":"Entry"},{"type":"logging/log","title":"Log"},{"type":"logging/sink","title":"Sink"}]},{"type":"monitoring","title":"Monitoring"},{"type":"prediction","title":"Prediction","nav":[{"type":"prediction/model","title":"Model"}]},{"type":"pubsub","title":"PubSub","nav":[{"type":"pubsub/subscription","title":"Subscription"},{"type":"pubsub/topic","title":"Topic"}]},{"type":"resource","title":"Resource","nav":[{"type":"resource/project","title":"Project"}]},{"type":"spanner","title":"Spanner","nav":[{"type":"spanner/database","title":"Database"},{"type":"spanner/instance","title":"Instance"},{"type":"spanner/table","title":"Table"},{"type":"spanner/transaction","title":"Transaction"}]},{"type":"speech","title":"Speech"},{"type":"storage","title":"Storage","nav":[{"type":"storage/bucket","title":"Bucket"},{"type":"storage/channel","title":"Channel"},{"type":"storage/file","title":"File"}]},{"type":"translate","title":"Translate"},{"type":"vision","title":"Vision"}],"tagName":"v0.51.1"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/translate/index.json b/json/google-cloud/v0.51.1/translate/index.json new file mode 100644 index 00000000000..2abf2ef80b7 --- /dev/null +++ b/json/google-cloud/v0.51.1/translate/index.json @@ -0,0 +1 @@ +{"id":"translate","type":"class","name":"Translate","overview":"

\n This class allows you interact with Cloud Translation API.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/translate.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar translate = gcloud.translate();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar translate = gcloud.translate({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/translate/src/index.js","parent":null,"children":[],"methods":[{"id":"Translate","name":"Translate","type":"constructor","description":"

With Google Translate, you can dynamically translate text between thousands of language pairs.

The Google Translate API lets websites and programs integrate with Google Translate programmatically.

","source":"packages/translate/src/index.js#L57","resources":[{"title":"Getting Started","link":"https://cloud.google.com/translate/v2/getting_started"},{"title":"Identifying your application to Google","link":"https://cloud.google.com/translate/v2/using_rest#auth"}],"examples":[{"caption":"

Custom Translate API

\nThe environment variable, GOOGLE_CLOUD_TRANSLATE_ENDPOINT, is honored as \na custom backend which our library will send requests to.

"}],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"options.key","description":"
  • An API key.
","types":["string"],"optional":true,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detect","name":"detect","type":"instance","description":"

Detect the language used in a string or multiple strings.

","source":"packages/translate/src/index.js#L153","resources":[{"title":"Detect Language","link":"https://cloud.google.com/translate/v2/using_rest#detect-language"}],"examples":[{"caption":"

Detect the language from a single string input.

","code":"translate.detect('Hello', function(err, results) {\n if (!err) {\n // results = {\n // language: 'en',\n // confidence: 1,\n // input: 'Hello'\n // }\n }\n});"},{"caption":"

Detect the languages used in multiple strings. Note that the results are \nnow provied as an array.

","code":"translate.detect([\n 'Hello',\n 'Hola'\n], function(err, results) {\n if (!err) {\n // results = [\n // {\n // language: 'en',\n // confidence: 1,\n // input: 'Hello'\n // },\n // {\n // language: 'es',\n // confidence: 1,\n // input: 'Hola'\n // }\n // ]\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"translate.detect('Hello').then(function(data) {\n var results = data[0];\n var apiResponse = data[2];\n});"}],"params":[{"name":"input","description":"
  • The source string input.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.results","description":"
  • If a single string input was given, a single result object is given. Otherwise, it is an array of result objects.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback.results[].language","description":"
  • The language code matched from the input.
","types":["string"],"optional":false,"nullable":false},{"name":"callback.results[].confidence","description":"
  • A float 0 - 1. The higher the number, the higher the confidence in language detection. Note, this is not always returned from the API.
","types":["number"],"optional":true,"nullable":false},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"getLanguages","name":"getLanguages","type":"instance","description":"

Get an array of all supported languages.

","source":"packages/translate/src/index.js#L256","resources":[{"title":"Discovering Supported Languages","link":"https://cloud.google.com/translate/v2/discovering-supported-languages-with-rest"}],"examples":[{"code":"translate.getLanguages(function(err, languages) {\n if (!err) {\n // languages = [\n // {\n // code: 'af',\n // name: 'Afrikaans'\n // },\n // {\n // code: 'ar',\n // name: 'Arabic'\n // },\n // {\n // code: 'az',\n // name: 'Azerbaijani'\n // },\n // ...\n // ]\n }\n});"},{"caption":"

Get the language names in a language other than English.

","code":"translate.getLanguages('es', function(err, languages) {\n if (!err) {\n // languages = [\n // {\n // code: 'af',\n // name: 'afrikáans'\n // },\n // {\n // code: 'ar',\n // name: 'árabe'\n // },\n // {\n // code: 'az',\n // name: 'azerí'\n // },\n // ...\n // ]\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"translate.getLanguages().then(function(data) {\n var languages = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"target","description":"
  • Get the language names in a language other than English.
","types":["string"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.languages","description":"
  • The languages supported by the API.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.languages[].code","description":" ","types":["string"],"optional":false,"nullable":false},{"name":"callback.languages[].name","description":"
  • The language name. This can be translated into your preferred language with the target option described above.
","types":["string"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"translate","name":"translate","type":"instance","description":"

Translate a string or multiple strings into another language.

","source":"packages/translate/src/index.js#L370","resources":[{}],"examples":[{"caption":"

Pass a string and a language code to get the translation.

","code":"translate.translate('Hello', 'es', function(err, translation) {\n if (!err) {\n // translation = 'Hola'\n }\n});"},{"caption":"

The source language is auto-detected by default. To manually set it, \nprovide an object.

","code":"var options = {\n from: 'en',\n to: 'es'\n};\n\ntranslate.translate('Hello', options, function(err, translation) {\n if (!err) {\n // translation = 'Hola'\n }\n});"},{"caption":"

Translate multiple strings of input. Note that the results are \nnow provied as an array.

","code":"var input = [\n 'Hello',\n 'How are you today?'\n];\n\ntranslate.translate(input, 'es', function(err, translations) {\n if (!err) {\n // translations = [\n // 'Hola',\n // 'Como estas hoy?'\n // ]\n }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"translate.translate('Hello', 'es').then(function(data) {\n var translation = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"input","description":"
  • The source string input.
","types":["string","string[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • If a string, it is interpreted as the target ISO 639-1 language code to translate the source input to. (e.g. en for English). If an object, you may also specify the source language.
","types":["string","object"],"optional":true,"nullable":false},{"name":"options.format","description":"
  • Set the text's format as html or text. If not provided, we will try to auto-detect if the text given is HTML. If not, we set the format as text.
","types":["string"],"optional":false,"nullable":false},{"name":"options.from","description":"
  • The ISO 639-1 language code the source input is written in.
","types":["string"],"optional":false,"nullable":false},{"name":"options.model","description":"
  • Note: Users must be whitelisted to use this parameter. Set the model type requested for this translation. Please refer to the upstream documentation for possible values.
","types":["string"],"optional":false,"nullable":false},{"name":"options.to","description":"
  • The ISO 639-1 language code to translate the input to.
","types":["string"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.translations","description":"
  • If a single string input was given, a single translation is given. Otherwise, it is an array of translations.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[{"type":"Error","description":"

If options is provided as an object without a to property.

"}],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/troubleshooting.md b/json/google-cloud/v0.51.1/troubleshooting.md new file mode 100644 index 00000000000..533ad48c440 --- /dev/null +++ b/json/google-cloud/v0.51.1/troubleshooting.md @@ -0,0 +1,93 @@ +## I'm using a key from the Developer's Console, but getting: `Your private key is in an unexpected format and cannot be used. Please try again with another private key.` + +There are many types of keys that can be created through the Developer's Console. The one google-cloud-node expects is one for a "Service account". + +See "I'm not using Compute Engine. What do I need to do?" from the [FAQ](https://googlecloudplatform.github.io/google-cloud-node/#/faq) for detailed steps on how to create and obtain a JSON key. + +Reference Issue: [#261](https://github.com/GoogleCloudPlatform/google-cloud-node/issues/261) + + +## The app crashes with an error: "The system cannot find the path specified" + +Windows users may face this issue when using npm modules such as `google-cloud-node`, see ["Node's nested node_modules approach is basically incompatible with Windows"](https://github.com/nodejs/node-v0.x-archive/issues/6960#issuecomment-46704998). There are 3 solutions you should try: + + 1. Install npm version 3 or greater, which [dedupes](https://docs.npmjs.com/cli/dedupe) by default + 1. Manually run `npm dedupe` from inside your project directory + 1. Move your project to the `C:\` directory + +Reference Issue: [#1162](https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1162) + + +## Is the `google-cloud` module on npm *really* 800 MB? + +Old versions of npm won't automatically run [dedupe](https://docs.npmjs.com/cli/dedupe) for you. This is a command which finds compatible ranges of dependencies between your dependencies, and removes them from disk. Since npm version 3, dedupe is run before downloading any dependencies, so no extra disk space or download time is wasted. + +For example, on npm 3, `npm install google-cloud` results in a ~45MB download. With npm 2, you get the larger download size, upwards of 700 MB. If you run `npm dedupe` from the command line, you should end up around the npm 3 size. + +For best results, + + 1. Upgrade npm to version 3.x + 1. If that's not possible, run `npm dedupe` after installing + +As of this writing, Google App Engine's Node.js flexible environment runs Node.js v4.x with npm v2.x installed by default. To override this, specify an [`engines`](https://docs.npmjs.com/files/package.json#engines) field in your package.json: + +```json +{ + "name": "your-app", + "version": "...", + "dependencies": {}, + "engines": { + "npm": "^3.0.0" + } +} +``` + +Reference Issue: [#1535](https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1535) +Reference Tweet: [@mluggy's Tweet on 8/29/16](https://twitter.com/mluggy/status/770221258533380096) + + +## My requests are returning errors instructing me to retry the request. + +If you ever see an error like this, you might be pinging the API too rapidly, hitting a rate limit: + +```sh +ApiError: The service was unable to fulfill your request. Please try again. +``` + +Each API call might have its own requirements for what constitutes reaching the rate limit. We solve this across most of the requests we make by using an exponential backoff retry strategy. However, if you make several requests at once, you will inevitably reach that limit. + +As an example, if you need to delete multiple Pub/Sub subscriptions at a time, you might do something like: + +```js +subscriptions.forEach(function(subscription) { + subscription.delete(); +}); +``` + +Assuming you had 50 subscriptions, this would make 50 simultaneous requests to the API. That's likely to cause the rate limit to be reached. + +Instead, consider using a library like [async](http://gitnpm.com/async) to throttle your requests: + +```js +var async = require('async'); +var PARALLEL_LIMIT = 10; + +function deleteSubscription(subscription, callback) { + subscription.delete(callback); +} + +async.eachLimit(subscriptions, PARALLEL_LIMIT, deleteSubscription, function(err) { + if (!err) { + // Subscriptions deleted. + } +}); +``` + +This will only allow 10 at a time to go through, making it easier on the API to keep up with your requests. + +Reference Issue: [#1101](https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1101) + + +## gRPC received a message exceeding the max size. + +If you're seeing an error message saying that your gRPC request is exceeding the max size, you may need to send smaller individual requests. Request bodies should not exceed 4MB. diff --git a/json/google-cloud/v0.51.1/types.json b/json/google-cloud/v0.51.1/types.json new file mode 100644 index 00000000000..42791f00933 --- /dev/null +++ b/json/google-cloud/v0.51.1/types.json @@ -0,0 +1 @@ +[{"id":"google-cloud","title":["Google Cloud"],"contents":"index.json"},{"id":"bigquery/dataset","title":["BigQuery","Dataset"],"contents":"bigquery/dataset.json"},{"id":"bigquery","title":["BigQuery"],"contents":"bigquery/index.json"},{"id":"bigquery/job","title":["BigQuery","Job"],"contents":"bigquery/job.json"},{"id":"bigquery/table","title":["BigQuery","Table"],"contents":"bigquery/table.json"},{"id":"bigtable/cluster","title":["Bigtable","Cluster"],"contents":"bigtable/cluster.json"},{"id":"bigtable/family","title":["Bigtable","Family"],"contents":"bigtable/family.json"},{"id":"bigtable/filter","title":["Bigtable","Filter"],"contents":"bigtable/filter.json"},{"id":"bigtable","title":["Bigtable"],"contents":"bigtable/index.json"},{"id":"bigtable/instance","title":["Bigtable","Instance"],"contents":"bigtable/instance.json"},{"id":"bigtable/row","title":["Bigtable","Row"],"contents":"bigtable/row.json"},{"id":"bigtable/table","title":["Bigtable","Table"],"contents":"bigtable/table.json"},{"id":"compute/address","title":["Compute","Address"],"contents":"compute/address.json"},{"id":"compute/autoscaler","title":["Compute","Autoscaler"],"contents":"compute/autoscaler.json"},{"id":"compute/disk","title":["Compute","Disk"],"contents":"compute/disk.json"},{"id":"compute/firewall","title":["Compute","Firewall"],"contents":"compute/firewall.json"},{"id":"compute/health-check","title":["Compute","HealthCheck"],"contents":"compute/health-check.json"},{"id":"compute","title":["Compute"],"contents":"compute/index.json"},{"id":"compute/instance-group","title":["Compute","InstanceGroup"],"contents":"compute/instance-group.json"},{"id":"compute/machine-type","title":["Compute","MachineType"],"contents":"compute/machine-type.json"},{"id":"compute/network","title":["Compute","Network"],"contents":"compute/network.json"},{"id":"compute/operation","title":["Compute","Operation"],"contents":"compute/operation.json"},{"id":"compute/region","title":["Compute","Region"],"contents":"compute/region.json"},{"id":"compute/rule","title":["Compute","Rule"],"contents":"compute/rule.json"},{"id":"compute/service","title":["Compute","Service"],"contents":"compute/service.json"},{"id":"compute/snapshot","title":["Compute","Snapshot"],"contents":"compute/snapshot.json"},{"id":"compute/subnetwork","title":["Compute","Subnetwork"],"contents":"compute/subnetwork.json"},{"id":"compute/vm","title":["Compute","VM"],"contents":"compute/vm.json"},{"id":"compute/zone","title":["Compute","Zone"],"contents":"compute/zone.json"},{"id":"datastore","title":["Datastore"],"contents":"datastore/index.json"},{"id":"datastore/query","title":["Datastore","Query"],"contents":"datastore/query.json"},{"id":"datastore/transaction","title":["Datastore","Transaction"],"contents":"datastore/transaction.json"},{"id":"dns/change","title":["DNS","Change"],"contents":"dns/change.json"},{"id":"dns","title":["DNS"],"contents":"dns/index.json"},{"id":"dns/record","title":["DNS","Record"],"contents":"dns/record.json"},{"id":"dns/zone","title":["DNS","Zone"],"contents":"dns/zone.json"},{"id":"language/document","title":["Language","Document"],"contents":"language/document.json"},{"id":"language","title":["Language"],"contents":"language/index.json"},{"id":"logging/entry","title":["Logging","Entry"],"contents":"logging/entry.json"},{"id":"logging","title":["Logging"],"contents":"logging/index.json"},{"id":"logging/log","title":["Logging","Log"],"contents":"logging/log.json"},{"id":"logging/sink","title":["Logging","Sink"],"contents":"logging/sink.json"},{"id":"monitoring","title":["Monitoring"],"contents":"monitoring/index.json"},{"id":"prediction","title":["Prediction"],"contents":"prediction/index.json"},{"id":"prediction/model","title":["Prediction","Model"],"contents":"prediction/model.json"},{"id":"pubsub","title":["PubSub"],"contents":"pubsub/index.json"},{"id":"pubsub/subscription","title":["PubSub","Subscription"],"contents":"pubsub/subscription.json"},{"id":"pubsub/topic","title":["PubSub","Topic"],"contents":"pubsub/topic.json"},{"id":"resource","title":["Resource"],"contents":"resource/index.json"},{"id":"resource/project","title":["Resource","Project"],"contents":"resource/project.json"},{"id":"spanner/database","title":["Spanner","Database"],"contents":"spanner/database.json"},{"id":"spanner","title":["Spanner"],"contents":"spanner/index.json"},{"id":"spanner/instance","title":["Spanner","Instance"],"contents":"spanner/instance.json"},{"id":"spanner/table","title":["Spanner","Table"],"contents":"spanner/table.json"},{"id":"spanner/transaction","title":["Spanner","Transaction"],"contents":"spanner/transaction.json"},{"id":"speech","title":["Speech"],"contents":"speech/index.json"},{"id":"storage/bucket","title":["Storage","Bucket"],"contents":"storage/bucket.json"},{"id":"storage/channel","title":["Storage","Channel"],"contents":"storage/channel.json"},{"id":"storage/file","title":["Storage","File"],"contents":"storage/file.json"},{"id":"storage","title":["Storage"],"contents":"storage/index.json"},{"id":"translate","title":["Translate"],"contents":"translate/index.json"},{"id":"vision","title":["Vision"],"contents":"vision/index.json"}] \ No newline at end of file diff --git a/json/google-cloud/v0.51.1/vision/index.json b/json/google-cloud/v0.51.1/vision/index.json new file mode 100644 index 00000000000..ad934419814 --- /dev/null +++ b/json/google-cloud/v0.51.1/vision/index.json @@ -0,0 +1 @@ +{"id":"vision","type":"class","name":"Vision","overview":"

\n This class allows you interact with Cloud Vision.\n

\n\n\n
\n google-cloud is deprecated\n

\n Due to the scope of our API rapidly increasing, you may notice a decrease in performance if you continue to use the bundled module, google-cloud.\n

\n

\n Going forward, please install only the individual service modules that you need, such as @google-cloud/vision.\n

\n

\n The instructions below are here for reference, however, we will soon stop releasing updates to the bundled package.\n

\n
\n\n\n

\n First, install google-cloud with npm:\n

\n\n
$ npm install --save google-cloud
\n\n

\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to google-cloud— we figure that out for you.\n

\n\n

\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n

\n\n

Google Cloud Platform

\n
\nvar gcloud = require('google-cloud');\nvar vision = gcloud.vision();\n
\n\n

Elsewhere

\n
\nvar gcloud = require('google-cloud');\nvar vision = gcloud.vision({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n
\n\n

\n The full set of options which can be passed to google-cloud are outlined in our Authentication guide.\n

\n","description":"","source":"packages/vision/src/index.js","parent":null,"children":["vision/v1"],"methods":[{"id":"Vision","name":"Vision","type":"constructor","description":"

The Cloud Vision API allows easy integration of vision detection features, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content.

","source":"packages/vision/src/index.js#L57","resources":[{"title":"Getting Started","link":"https://cloud.google.com/vision/docs/getting-started"},{"title":"Image Best Practices","link":"https://cloud.google.com/vision/docs/image-best-practices"}],"examples":[],"params":[{"name":"options","description":" ","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"annotate","name":"annotate","type":"instance","description":"

Run image detection and annotation for an image or batch of images.

This is an advanced API method that requires raw AnnotateImageRequest objects to be provided. If that doesn't sound like what you're looking for, you'll probably appreciate vision#detect.

","source":"packages/vision/src/index.js#L112","resources":[{"title":"images.annotate API Reference","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate"}],"examples":[{"code":"var annotateImageReq = {\n // See the link in the parameters for `AnnotateImageRequest`.\n};\n\nvision.annotate(annotateImageReq, function(err, annotations, apiResponse) {\n // annotations = apiResponse.responses\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.annotate(annotateImageReq).then(function(data) {\n var annotations = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"requests","description":" ","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.annotations","description":" ","types":["object"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detect","name":"detect","type":"instance","description":"

Detect properties from an image (or images) of one or more types.

API simplifications

The raw API response will return some values in a range from VERY_UNLIKELY to VERY_LIKELY. For simplification, any value less than LIKELY is converted to false.

  • False
  • VERY_UNLIKELY
  • UNLIKELY
  • POSSIBLE
  • True
  • LIKELY
  • VERY_LIKELY

The API will also return many values represented in a [0,1] range. We convert these to a [0,100] value. E.g, 0.4 is represented as 40.

For the response in the original format, review the apiResponse argument your callback receives.

","source":"packages/vision/src/index.js#L293","resources":[],"examples":[{"code":"var types = [\n 'face',\n 'label'\n];\n\nvision.detect('image.jpg', types, function(err, detections, apiResponse) {\n // detections = {\n // faces: [...],\n // labels: [...]\n // }\n});"},{"caption":"

Run feature detection over a remote image.

","code":"var img = 'https://upload.wikimedia.org/wikipedia/commons/5/51/Google.png';\n\nvision.detect(img, types, function(err, detection, apiResponse) {});"},{"caption":"

Run feature detection over a Buffer.

","code":"var level = require('level');\nvar db = level('./users-database');\n\ndb.get('user-image', { encoding: 'binary' }, function(err, image) {\n if (err) {\n // Error handling omitted.\n }\n\n vision.detect(image, types, function(err, detection, apiResponse) {});\n});"},{"caption":"

If you have a base64 string, provide it in a Buffer.

","code":"var myBase64ImageRepresentation = '...';\n\nvar image = new Buffer(myBase64ImageRepresentation, 'base64');\n\nvision.detect(image, types, function(err, detection, apiResponse) {});"},{"caption":"

Supply multiple images for feature detection.

","code":"var images = [\n 'image.jpg',\n 'image-two.jpg'\n];\n\nvar types = [\n 'face',\n 'label'\n];\n\nvision.detect(images, types, function(err, detections, apiResponse) {\n // detections = [\n // // Detections for image.jpg:\n // {\n // faces: [...],\n // labels: [...]\n // },\n //\n // // Detections for image-two.jpg:\n // {\n // faces: [...],\n // labels: [...]\n // }\n // ]\n});"},{"caption":"

It's possible for part of your request to be completed successfully, while \na single feature request was not successful.

","code":"vision.detect('malformed-image.jpg', types, function(err, detections) {\n if (err) {\n // An API error or partial failure occurred.\n\n if (err.name === 'PartialFailureError') {\n // err.errors = [\n // {\n // image: 'malformed-image.jpg',\n // errors: [\n // {\n // code: 400,\n // message: 'Bad image data',\n // type: 'faces'\n // },\n // {\n // code: 400,\n // message: 'Bad image data',\n // type: 'labels'\n // }\n // ]\n // }\n // ]\n }\n }\n\n // `detections` will still be populated with all of the results that could\n // be annotated.\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detect('image.jpg', types).then(function(data) {\n var detections = data[0];\n var apiResponse = data[1];\n});"}],"params":[{"name":"images","description":"
  • The source image(s) to run the detection on. It can be either a local image path, a remote image URL, a Buffer, or a @google-cloud/storage File object.
","types":["string","string[]","buffer","buffer[]","storage/file","storage/file[]"],"optional":false,"nullable":false},{"name":"options","description":"
  • An array of types or a configuration object.
","types":["string[]","object"],"optional":true,"nullable":false},{"name":"options.imageContext","description":" ","types":["object"],"optional":true,"nullable":false},{"name":"options.maxResults","description":"
  • The maximum number of results, per type, to return in the response.
","types":["number"],"optional":false,"nullable":false},{"name":"options.types","description":"
  • An array of feature types to detect from the provided images. Acceptable values: crops, document, faces, landmarks, labels, logos, properties, safeSearch, similar, text.
","types":["string[]"],"optional":false,"nullable":false},{"name":"options.verbose","description":"
  • Use verbose mode, which returns a less- simplistic representation of the annotation (default: false).
","types":["boolean"],"optional":true,"nullable":false},{"name":"callback","description":"
  • The callback function.
","types":["function"],"optional":false,"nullable":false},{"name":"callback.err","description":"
  • An error returned while making this request.
","types":["error"],"optional":false,"nullable":true},{"name":"callback.err.errors","description":"
  • If present, these represent partial failures. It's possible for part of your request to be completed successfully, while a single feature request was not successful.
","types":["object[]"],"optional":false,"nullable":false},{"name":"callback.detections","description":"
  • If a single detection type was asked for, it will be returned in its raw form; either an object or array of objects. If multiple detection types were requested, you will receive an object with keys for each detection type (listed above in config.types). Additionally, if multiple images were provided, you will receive an array of detection objects, each representing an image. See the examples below for more information.
","types":["object","object[]"],"optional":false,"nullable":false},{"name":"callback.apiResponse","description":"
  • Raw API response.
","types":["object"],"optional":false,"nullable":false}],"exceptions":[],"returns":[]},{"id":"detectCrops","name":"detectCrops","type":"instance","description":"

Detect the crop hints within an image.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L707","resources":[{"title":"CropHintsAnnotation JSON respresentation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#CropHintsAnnotation"}],"examples":[{"code":"vision.detectCrops('image.jpg', function(err, crops, apiResponse) {\n // crops = [\n // [\n // {\n // x: 1\n // },\n // {\n // x: 295\n // },\n // {\n // x: 295,\n // y: 301\n // },\n // {\n // x: 1,\n // y: 301\n // }\n // ],\n // // ...\n // ]\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var options = {\n verbose: true\n};\n\nvision.detectCrops('image.jpg', options, function(err, crops, apiResponse) {\n // crops = [\n // {\n // bounds: [\n // {\n // x: 1\n // },\n // {\n // x: 295\n // },\n // {\n // x: 295,\n // y: 301\n // },\n // {\n // x: 1,\n // y: 301\n // }\n // ],\n // confidence: 0.799999995\n // },\n // // ...\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectCrops('image.jpg').then(function(data) {\n var crops = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectFaces","name":"detectFaces","type":"instance","description":"

Run face detection against an image.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1070","resources":[{"title":"FaceAnnotation JSON respresentation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#FaceAnnotation"}],"examples":[{"code":"vision.detectFaces('image.jpg', function(err, faces, apiResponse) {\n // faces = [\n // {\n // angles: {\n // pan: -8.1090336,\n // roll: -5.0002542,\n // tilt: 18.012161\n // },\n // bounds: {\n // head: [\n // {\n // x: 1\n // },\n // {\n // x: 295\n // },\n // {\n // x: 295,\n // y: 301\n // },\n // {\n // x: 1,\n // y: 301\n // }\n // ],\n // face: [\n // {\n // x: 28,\n // y: 40\n // },\n // {\n // x: 250,\n // y: 40\n // },\n // {\n // x: 250,\n // y: 262\n // },\n // {\n // x: 28,\n // y: 262\n // }\n // ]\n // },\n // features: {\n // confidence: 34.489909,\n // chin: {\n // center: {\n // x: 143.34183,\n // y: 262.22998,\n // z: -57.388493\n // },\n // left: {\n // x: 63.102425,\n // y: 248.99081,\n // z: 44.207638\n // },\n // right: {\n // x: 241.72728,\n // y: 225.53488,\n // z: 19.758242\n // }\n // },\n // ears: {\n // left: {\n // x: 54.872219,\n // y: 207.23712,\n // z: 97.030685\n // },\n // right: {\n // x: 252.67567,\n // y: 180.43124,\n // z: 70.15992\n // }\n // },\n // eyebrows: {\n // left: {\n // left: {\n // x: 58.790176,\n // y: 113.28249,\n // z: 17.89735\n // },\n // right: {\n // x: 106.14151,\n // y: 98.593758,\n // z: -13.116687\n // },\n // top: {\n // x: 80.248711,\n // y: 94.04303,\n // z: 0.21131183\n // }\n // },\n // right: {\n // left: {\n // x: 148.61565,\n // y: 92.294594,\n // z: -18.804882\n // },\n // right: {\n // x: 204.40808,\n // y: 94.300117,\n // z: -2.0009689\n // },\n // top: {\n // x: 174.70135,\n // y: 81.580917,\n // z: -12.702137\n // }\n // }\n // },\n // eyes: {\n // left: {\n // bottom: {\n // x: 84.883934,\n // y: 134.59479,\n // z: -2.8677137\n // },\n // center: {\n // x: 83.707092,\n // y: 128.34,\n // z: -0.00013388535\n // },\n // left: {\n // x: 72.213913,\n // y: 132.04138,\n // z: 9.6985674\n // },\n // pupil: {\n // x: 86.531624,\n // y: 126.49807,\n // z: -2.2496929\n // },\n // right: {\n // x: 105.28892,\n // y: 125.57655,\n // z: -2.51554\n // },\n // top: {\n // x: 86.706947,\n // y: 119.47144,\n // z: -4.1606765\n // }\n // },\n // right: {\n // bottom: {\n // x: 179.30353,\n // y: 121.03307,\n // z: -14.843414\n // },\n // center: {\n // x: 181.17694,\n // y: 115.16437,\n // z: -12.82961\n // },\n // left: {\n // x: 158.2863,\n // y: 118.491,\n // z: -9.723031\n // },\n // pupil: {\n // x: 175.99976,\n // y: 114.64407,\n // z: -14.53744\n // },\n // right: {\n // x: 194.59413,\n // y: 115.91954,\n // z: -6.952745\n // },\n // top: {\n // x: 173.99446,\n // y: 107.94287,\n // z: -16.050705\n // }\n // }\n // },\n // forehead: {\n // x: 126.53813,\n // y: 93.812057,\n // z: -18.863352\n // },\n // lips: {\n // bottom: {\n // x: 137.28528,\n // y: 219.23564,\n // z: -56.663128\n // },\n // top: {\n // x: 134.74164,\n // y: 192.50438,\n // z: -53.876408\n // }\n // },\n // mouth: {\n // center: {\n // x: 136.43481,\n // y: 204.37952,\n // z: -51.620205\n // },\n // left: {\n // x: 104.53558,\n // y: 214.05037,\n // z: -30.056231\n // },\n // right: {\n // x: 173.79134,\n // y: 204.99333,\n // z: -39.725758\n // }\n // },\n // nose: {\n // bottom: {\n // center: {\n // x: 133.81947,\n // y: 173.16437,\n // z: -48.287724\n // },\n // left: {\n // x: 110.98372,\n // y: 173.61331,\n // z: -29.7784\n // },\n // right: {\n // x: 161.31354,\n // y: 168.24527,\n // z: -36.1628\n // }\n // },\n // tip: {\n // x: 128.14919,\n // y: 153.68129,\n // z: -63.198204\n // },\n // top: {\n // x: 127.83745,\n // y: 110.17557,\n // z: -22.650913\n // }\n // }\n // },\n // confidence: 56.748849,\n // anger: false,\n // angerLikelihood: 1,\n // blurred: false,\n // blurredLikelihood: 1,\n // headwear: false,\n // headwearLikelihood: 1,\n // joy: false,\n // joyLikelihood: 1,\n // sorrow: false,\n // sorrowLikelihood: 1,\n // surprise: false,\n // surpriseLikelihood: 1,\n // underExposed: false,\n // underExposedLikelihood: 1\n // }\n // ]\n});"},{"caption":"

Our library simplifies the response from the API. Use the map below to see \neach response name's original name.

","code":"var shortNameToLongNameMap = {\n chin: {\n center: 'CHIN_GNATHION',\n left: 'CHIN_LEFT_GONION',\n right: 'CHIN_RIGHT_GONION'\n },\n\n ears: {\n left: 'LEFT_EAR_TRAGION',\n right: 'RIGHT_EAR_TRAGION'\n },\n\n eyebrows: {\n left: {\n left: 'LEFT_OF_LEFT_EYEBROW',\n right: 'RIGHT_OF_LEFT_EYEBROW',\n top: 'LEFT_EYEBROW_UPPER_MIDPOINT'\n },\n right: {\n left: 'LEFT_OF_RIGHT_EYEBROW',\n right: 'RIGHT_OF_RIGHT_EYEBROW',\n top: 'RIGHT_EYEBROW_UPPER_MIDPOINT'\n }\n },\n\n eyes: {\n left: {\n bottom: 'LEFT_EYE_BOTTOM_BOUNDARY',\n center: 'LEFT_EYE',\n left: 'LEFT_EYE_LEFT_CORNER',\n pupil: 'LEFT_EYE_PUPIL',\n right: 'LEFT_EYE_RIGHT_CORNER',\n top: 'LEFT_EYE_TOP_BOUNDARY'\n },\n right: {\n bottom: 'RIGHT_EYE_BOTTOM_BOUNDARY',\n center: 'RIGHT_EYE',\n left: 'RIGHT_EYE_LEFT_CORNER',\n pupil: 'RIGHT_EYE_PUPIL',\n right: 'RIGHT_EYE_RIGHT_CORNER',\n top: 'RIGHT_EYE_TOP_BOUNDARY'\n }\n },\n\n forehead: 'FOREHEAD_GLABELLA',\n\n lips: {\n bottom: 'LOWER_LIP',\n top: 'UPPER_LIP'\n },\n\n mouth: {\n center: 'MOUTH_CENTER',\n left: 'MOUTH_LEFT',\n right: 'MOUTH_RIGHT'\n },\n\n nose: {\n bottom: {\n center: 'NOSE_BOTTOM_CENTER',\n left: 'NOSE_BOTTOM_LEFT',\n right: 'NOSE_BOTTOM_RIGHT'\n },\n tip: 'NOSE_TIP',\n top: 'MIDPOINT_BETWEEN_EYES'\n }\n};"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectFaces('image.jpg').then(function(data) {\n var faces = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectLabels","name":"detectLabels","type":"instance","description":"

Annotate an image with descriptive labels.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1134","resources":[{"title":"EntityAnnotation JSON representation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#EntityAnnotation"}],"examples":[{"code":"vision.detectLabels('image.jpg', function(err, labels, apiResponse) {\n // labels = [\n // 'classical sculpture',\n // 'statue',\n // 'landmark',\n // 'ancient history',\n // 'artwork'\n // ]\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var opts = {\n verbose: true\n};\n\nvision.detectLabels('image.jpg', opts, function(err, labels, apiResponse) {\n // labels = [\n // {\n // desc: 'classical sculpture',\n // id: '/m/095yjj',\n // score: 98.092282\n // },\n // {\n // desc: 'statue',\n // id: '/m/013_1c',\n // score: 90.66112\n // },\n // // ...\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectLabels('image.jpg').then(function(data) {\n var labels = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectLandmarks","name":"detectLandmarks","type":"instance","description":"

Detect the landmarks from an image.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1214","resources":[{"title":"EntityAnnotation JSON representation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#EntityAnnotation"}],"examples":[{"code":"vision.detectLandmarks('image.jpg', function(err, landmarks, apiResponse) {\n // landmarks = [\n // 'Mount Rushmore'\n // ]\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var image = 'image.jpg';\n\nvar opts = {\n verbose: true\n};\n\nvision.detectLandmarks(image, opts, function(err, landmarks, apiResponse) {\n // landmarks = [\n // {\n // desc: 'Mount Rushmore',\n // id: '/m/019dvv',\n // score: 28.651705,\n // bounds: [\n // {\n // x: 79,\n // y: 130\n // },\n // {\n // x: 284,\n // y: 130\n // },\n // {\n // x: 284,\n // y: 226\n // },\n // {\n // x: 79,\n // y: 226\n // }\n // ],\n // locations: [\n // {\n // latitude: 43.878264,\n // longitude: -103.45700740814209\n // }\n // ]\n // }\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectLandmarks('image.jpg').then(function(data) {\n var landmarks = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectLogos","name":"detectLogos","type":"instance","description":"

Detect the logos from an image.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1286","resources":[{"title":"EntityAnnotation JSON representation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#EntityAnnotation"}],"examples":[{"code":"vision.detectLogos('image.jpg', function(err, logos, apiResponse) {\n // logos = [\n // 'Google'\n // ]\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var options = {\n verbose: true\n};\n\nvision.detectLogos('image.jpg', options, function(err, logos, apiResponse) {\n // logos = [\n // {\n // desc: 'Google',\n // id: '/m/045c7b',\n // score: 64.35439,\n // bounds: [\n // {\n // x: 11,\n // y: 11\n // },\n // {\n // x: 330,\n // y: 11\n // },\n // {\n // x: 330,\n // y: 72\n // },\n // {\n // x: 11,\n // y: 72\n // }\n // ]\n // }\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectLogos('image.jpg').then(function(data) {\n var logos = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectProperties","name":"detectProperties","type":"instance","description":"

Get a set of properties about an image, such as its dominant colors.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1367","resources":[{"title":"ImageProperties JSON representation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#ImageProperties"}],"examples":[{"code":"vision.detectProperties('image.jpg', function(err, props, apiResponse) {\n // props = {\n // colors: [\n // '3b3027',\n // '727d81',\n // '3f2f22',\n // '838e92',\n // '482a16',\n // '5f4f3c',\n // '261b14',\n // 'b39b7f',\n // '51473f',\n // '2c1e12'\n // ]\n // }\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var image = 'image.jpg';\n\nvar options = {\n verbose: true\n};\n\nvision.detectProperties(image, options, function(err, props, apiResponse) {\n // props = {\n // colors: [\n // {\n // red: 59,\n // green: 48,\n // blue: 39,\n // score: 26.618013,\n // coverage: 15.948276,\n // hex: '3b3027'\n // },\n // {\n // red: 114,\n // green: 125,\n // blue: 129,\n // score: 10.319714,\n // coverage: 8.3977409,\n // hex: '727d81'\n // },\n // // ...\n // ]\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectProperties('image.jpg').then(function(data) {\n var props = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectSafeSearch","name":"detectSafeSearch","type":"instance","description":"

Detect the SafeSearch flags from an image.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1407","resources":[{"title":"SafeSearch JSON representation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#SafeSearchAnnotation"}],"examples":[{"code":"vision.detectSafeSearch('image.jpg', function(err, safeSearch, apiResponse) {\n // safeSearch = {\n // adult: false,\n // medical: false,\n // spoof: false,\n // violence: true\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectSafeSearch('image.jpg').then(function(data) {\n var safeSearch = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectSimilar","name":"detectSimilar","type":"instance","description":"

Detect similar images from the internet.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1477","resources":[{"title":"WebAnnotation JSON representation","link":"https://cloud.google.com/vision/docs/reference/rest/v1/images/annotate#WebAnnotation"}],"examples":[{"code":"vision.detectSimilar('image.jpg', function(err, images, apiResponse) {\n // images = [\n // 'http://www.example.com/most-similar-image',\n // // ...\n // 'http://www.example.com/least-similar-image'\n // ]\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var opts = {\n verbose: true\n};\n\nvision.detectSimilar('image.jpg', opts, function(err, similar, apiResponse) {\n // similar = {\n // entities: [\n // 'Logo',\n // // ...\n // ],\n // fullMatches: [\n // 'http://www.example.com/most-similar-image',\n // // ...\n // 'http://www.example.com/least-similar-image'\n // ],\n // partialMatches: [\n // 'http://www.example.com/most-similar-image',\n // // ...\n // 'http://www.example.com/least-similar-image'\n // ],\n // pages: [\n // 'http://www.example.com/page-with-most-similar-image',\n // // ...\n // 'http://www.example.com/page-with-least-similar-image'\n // ]\n // }\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectSimilar('image.jpg').then(function(data) {\n var images = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"detectText","name":"detectText","type":"instance","description":"

Detect the text within an image.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1545","resources":[],"examples":[{"code":"vision.detectText('image.jpg', function(err, text, apiResponse) {\n // text = [\n // 'This was text found in the image'\n // ]\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var options = {\n verbose: true\n};\n\nvision.detectText('image.jpg', options, function(err, text, apiResponse) {\n // text = [\n // {\n // desc: 'This was text found in the image',\n // bounds: [\n // {\n // x: 4,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 89\n // },\n // {\n // x: 4,\n // y: 89\n // }\n // ]\n // }\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.detectText('image.jpg').then(function(data) {\n var text = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]},{"id":"readDocument","name":"readDocument","type":"instance","description":"

Annotate a document.

Parameters

See vision#detect.

","source":"packages/vision/src/index.js#L1693","resources":[{"title":"FullTextAnnotation JSON representation","link":"https://cloud.google.com/vision/reference/rest/v1/images/annotate#FullTextAnnotation"}],"examples":[{"code":"vision.readDocument('image.jpg', function(err, text, apiResponse) {\n // text = 'This paragraph was extracted from image.jpg';\n});"},{"caption":"

Activate verbose mode for a more detailed response.

","code":"var opts = {\n verbose: true\n};\n\nvision.readDocument('image.jpg', opts, function(err, pages, apiResponse) {\n // pages = [\n // {\n // languages: [\n // 'en'\n // ],\n // width: 688,\n // height: 1096,\n // blocks: [\n // {\n // type: 'TEXT',\n // bounds: [\n // {\n // x: 4,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 89\n // },\n // {\n // x: 4,\n // y: 89\n // }\n // ],\n // paragraphs: [\n // {\n // bounds: [\n // {\n // x: 4,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 89\n // },\n // {\n // x: 4,\n // y: 89\n // }\n // ],\n // words: [\n // {\n // bounds: [\n // {\n // x: 4,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 89\n // },\n // {\n // x: 4,\n // y: 89\n // }\n // ],\n // symbols: [\n // {\n // bounds: [\n // {\n // x: 4,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 5\n // },\n // {\n // x: 493,\n // y: 89\n // },\n // {\n // x: 4,\n // y: 89\n // }\n // ],\n // text: 'T'\n // },\n // // ...\n // ]\n // },\n // // ...\n // ]\n // },\n // // ...\n // ]\n // },\n // // ...\n // ]\n // }\n // ]\n});"},{"caption":"

If the callback is omitted, we'll return a Promise.

","code":"vision.readDocument('image.jpg').then(function(data) {\n var pages = data[0];\n var apiResponse = data[1];\n});"}],"params":[],"exceptions":[],"returns":[]}],"path":"index.json"} \ No newline at end of file diff --git a/manifest.json b/manifest.json index 4a746901096..598bca772cf 100644 --- a/manifest.json +++ b/manifest.json @@ -13,6 +13,8 @@ "name": "google-cloud", "defaultService": "google-cloud", "versions": [ + "v0.51.1", + "v0.51.0", "0.50.0", "0.49.0", "0.48.0", @@ -287,6 +289,7 @@ "name": "@google-cloud/speech", "defaultService": "speech", "versions": [ + "0.9.0", "0.8.0", "0.7.0", "0.6.0",