Skip to content

Commit 33bdc64

Browse files
add tests & docs
1 parent 43c12c6 commit 33bdc64

4 files changed

Lines changed: 91 additions & 1 deletion

File tree

packages/monitoring/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
- [Official Documentation][cloud-monitoring-docs]
77

8+
## This is an auto-generated API
9+
10+
It does not follow the conventions you're familiar with from other parts of our library. A handwritten layer is not yet available.
11+
12+
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.
13+
814

915
```sh
1016
$ npm install --save @google-cloud/monitoring
@@ -66,3 +72,4 @@ var monitoring = require('@google-cloud/monitoring')({
6672
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
6773
[dev-console]: https://console.developers.google.com/project
6874
[cloud-monitoring-docs]: https://cloud.google.com/monitoring/docs
75+
[cloud-monitoring-protos]: https://github.com/googleapis/googleapis/tree/master/google/monitoring/v3

packages/monitoring/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@
5656
"google-gax": "^0.7.0",
5757
"extend": "^3.0.0"
5858
},
59+
"devDependencies": {
60+
"mocha": "^3.1.2"
61+
},
5962
"scripts": {
60-
"publish-module": "node ../../scripts/publish.js logging"
63+
"publish-module": "node ../../scripts/publish.js monitoring",
64+
"test": "mocha test/*.js"
6165
},
6266
"license": "Apache-2.0",
6367
"engines": {

packages/monitoring/src/index.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,48 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
/*!
18+
* @module monitoring
19+
*/
20+
1621
'use strict';
1722

23+
/**
24+
* <p class="notice">
25+
* **This is a Beta release of Stackdriver Monitoring.** This API is not
26+
* covered by any SLA or deprecation policy and may be subject to
27+
* backward-incompatible changes.
28+
* </p>
29+
*
30+
* [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs) collects
31+
* metrics, events, and metadata from Google Cloud Platform, Amazon Web Services
32+
* (AWS), hosted uptime probes, application instrumentation, and a variety of
33+
* common application components including Cassandra, Nginx, Apache Web Server,
34+
* Elasticsearch and many others. Stackdriver ingests that data and generates
35+
* insights via dashboards, charts, and alerts.
36+
*
37+
* <h2>This is an auto-generated API</h2>
38+
*
39+
* It does not follow the conventions you're familiar with from other parts of
40+
* our library. A handwritten layer is not yet available.
41+
*
42+
* The example below shows you how to instantiate the generated client. For
43+
* further documentation, please browse the
44+
* [Monitoring .proto files](https://github.com/googleapis/googleapis/tree/master/google/monitoring/v3)
45+
* on GitHub.
46+
*
47+
* @constructor
48+
* @alias module:monitoring
49+
*/
50+
function Monitoring() {
51+
throw new Error([
52+
'Cloud Monitoring must be accessed through the auto-generated client.',
53+
'See',
54+
'https://googlecloudplatform.github.io/google-cloud-node/#/docs/monitoring',
55+
'for more information.'
56+
].join(' '));
57+
}
58+
59+
module.exports = Monitoring;
1860
module.exports.v3 = require('./v3');

packages/monitoring/test/index.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
'use strict';
18+
19+
var assert = require('assert');
20+
21+
var Monitoring = require('../src/index.js');
22+
23+
describe('Monitoring', function() {
24+
describe('instantiation', function() {
25+
it('should throw if invoked', function() {
26+
var expectedMessage = [
27+
'Cloud Monitoring must be accessed through the auto-generated client.',
28+
' See https://googlecloudplatform.github.io/google-cloud-node/#/docs/',
29+
'monitoring for more information.'
30+
].join('');
31+
32+
assert.throws(function() {
33+
new Monitoring();
34+
}, new RegExp(expectedMessage));
35+
});
36+
});
37+
});

0 commit comments

Comments
 (0)