diff --git a/README.md b/README.md index 83dfd7e5d79..a3c723530eb 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ This client supports the following Google Cloud Platform services: * [Google Cloud Speech](#google-cloud-speech-beta) (Beta) * [Google Cloud Vision](#google-cloud-vision-beta) (Beta) * [Stackdriver Logging](#stackdriver-logging-beta) (Beta) +* [Stackdriver Monitoring](#stackdriver-monitoring-beta) (Beta) If you need support for other Google APIs, check out the [Google Node.js API Client library][googleapis]. @@ -1139,6 +1140,49 @@ loggingClient.getEntries(function(err, entries) { ``` +## Stackdriver Monitoring (Beta) + +> **This is a Beta release of Stackdriver Monitoring.** This API is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes. + +### :warning: 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][cloud-monitoring-protos] on GitHub. + +- [Official Documentation][cloud-monitoring-docs] + +#### Using the all-in-one module + +``` +$ npm install --save google-cloud +``` + +```js +var gcloud = require('google-cloud'); +var monitoring = gcloud.monitoring; +``` + +#### Using the Stackdriver Monitoring API module + +``` +$ npm install --save @google-cloud/monitoring +``` + +```js +var monitoring = require('@google-cloud/monitoring'); +``` + +#### Preview + +```js +var monitoringClient = monitoring.v3({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); +``` + + ## Contributing Contributions to this library are always welcome and highly encouraged. @@ -1196,6 +1240,9 @@ Apache 2.0 - See [COPYING](COPYING) for more information. [cloud-language-docs]: https://cloud.google.com/natural-language/docs +[cloud-monitoring-docs]: https://cloud.google.com/monitoring/docs +[cloud-monitoring-protos]: https://github.com/googleapis/googleapis/tree/master/google/monitoring/v3 + [cloud-logging-docs]: https://cloud.google.com/logging/docs [cloud-prediction-docs]: https://cloud.google.com/prediction/docs diff --git a/packages/google-cloud/package.json b/packages/google-cloud/package.json index 51ced245377..16c2609bff5 100644 --- a/packages/google-cloud/package.json +++ b/packages/google-cloud/package.json @@ -104,6 +104,7 @@ "@google-cloud/dns": "^0.3.0", "@google-cloud/language": "^0.5.0", "@google-cloud/logging": "^0.5.0", + "@google-cloud/monitoring": "^0.1.1", "@google-cloud/prediction": "^0.3.0", "@google-cloud/pubsub": "^0.5.0", "@google-cloud/resource": "^0.3.0", diff --git a/packages/google-cloud/src/index.js b/packages/google-cloud/src/index.js index b4a9e88779f..d5055b43594 100644 --- a/packages/google-cloud/src/index.js +++ b/packages/google-cloud/src/index.js @@ -175,6 +175,43 @@ var apis = { */ logging: require('@google-cloud/logging'), + /** + * [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs) 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 a Beta release of Stackdriver Monitoring.** This API is not + * covered by any SLA or deprecation policy and may be subject to + * backward-incompatible changes. + *

+ * + *

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](https://github.com/googleapis/googleapis/tree/master/google/monitoring/v3) + * on GitHub. + * + * @type {module:monitoring} + * + * @return {module:monitoring} + * + * @example + * var gcloud = require('google-cloud'); + * var monitoring = gcloud.monitoring.v3({ + * projectId: 'grape-spaceship-123', + * keyFilename: '/path/to/keyfile.json' + * }); + */ + monitoring: require('@google-cloud/monitoring'), + /** * The [Google Prediction API](https://cloud.google.com/prediction/docs/getting-started) * provides pattern-matching and machine learning capabilities. Given a set of diff --git a/packages/google-cloud/test/index.js b/packages/google-cloud/test/index.js index 865e7c3971f..f6c9fc0fcd6 100644 --- a/packages/google-cloud/test/index.js +++ b/packages/google-cloud/test/index.js @@ -39,6 +39,7 @@ var FakeDatastore = createFakeApi(); var FakeDNS = createFakeApi(); var FakeLanguage = createFakeApi(); var FakeLogging = createFakeApi(); +var FakeMonitoring = createFakeApi(); var FakePrediction = createFakeApi(); var FakePubSub = createFakeApi(); var FakeResource = createFakeApi(); @@ -59,6 +60,7 @@ describe('gcloud', function() { '@google-cloud/dns': FakeDNS, '@google-cloud/language': FakeLanguage, '@google-cloud/logging': FakeLogging, + '@google-cloud/monitoring': FakeMonitoring, '@google-cloud/prediction': FakePrediction, '@google-cloud/pubsub': FakePubSub, '@google-cloud/resource': FakeResource, @@ -101,6 +103,10 @@ describe('gcloud', function() { assert.strictEqual(gcloud.logging, FakeLogging); }); + it('should export static monitoring', function() { + assert.strictEqual(gcloud.monitoring, FakeMonitoring); + }); + it('should export static prediction', function() { assert.strictEqual(gcloud.prediction, FakePrediction); }); @@ -223,6 +229,15 @@ describe('gcloud', function() { }); }); + describe('monitoring', function() { + it('should create a new Monitoring', function() { + var monitoring = localGcloud.monitoring(options); + + assert(monitoring instanceof FakeMonitoring); + assert.strictEqual(monitoring.calledWith_[0], options); + }); + }); + describe('prediction', function() { it('should create a new Prediction', function() { var prediction = localGcloud.prediction(options);