Skip to content

Commit 2b6bbd7

Browse files
update readme
1 parent b4454fc commit 2b6bbd7

File tree

1 file changed

+71
-29
lines changed

1 file changed

+71
-29
lines changed

README.md

Lines changed: 71 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This client supports the following Google Cloud Platform services at a [Beta](#v
2323
* [Cloud Spanner](#cloud-spanner-beta) (Beta)
2424
* [Cloud Vision](#cloud-vision-beta) (Beta)
2525
* [Google BigQuery](#google-bigquery-beta) (Beta)
26+
* [Google Stackdriver Monitoring](#google-stackdriver-monitoring-beta) (Beta)
2627

2728
This client supports the following Google Cloud Platform services at an [Alpha](#versioning) quality level:
2829

@@ -36,7 +37,6 @@ This client supports the following Google Cloud Platform services at an [Alpha](
3637
* [Google Stackdriver Debugger](#google-stackdriver-debugger-alpha) (Alpha)
3738
* [Google Stackdriver Error Reporting](#google-stackdriver-error-reporting-alpha) (Alpha)
3839
* [Google Stackdriver Trace](#google-stackdriver-trace-alpha) (Alpha)
39-
* [Google Stackdriver Monitoring](#google-stackdriver-monitoring-alpha) (Alpha)
4040

4141
If you need support for other Google APIs, check out the [Google Node.js API Client library][googleapis].
4242

@@ -620,6 +620,75 @@ job.getQueryResults().on('data', function(row) {});
620620
```
621621

622622

623+
## Google Stackdriver Monitoring (Beta)
624+
625+
### :warning: This is an auto-generated API
626+
627+
It does not follow the conventions you're familiar with from other parts of our library. A handwritten layer is not yet available.
628+
629+
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.
630+
631+
- [API Documentation][gcloud-monitoring-docs]
632+
- [Official Documentation][cloud-monitoring-docs]
633+
634+
#### Using the Google Stackdriver Monitoring API module
635+
636+
```
637+
$ npm install --save @google-cloud/monitoring
638+
```
639+
640+
```js
641+
var monitoring = require('@google-cloud/monitoring');
642+
```
643+
644+
#### Preview
645+
646+
```js
647+
var client = monitoring.metric({
648+
// optional auth parameters.
649+
});
650+
651+
// Iterate over all elements.
652+
var formattedName = client.projectPath(projectId);
653+
654+
client.listMonitoredResourceDescriptors({name: formattedName}).then(function(responses) {
655+
var resources = responses[0];
656+
for (var i = 0; i < resources.length; ++i) {
657+
// doThingsWith(resources[i])
658+
}
659+
})
660+
.catch(function(err) {
661+
console.error(err);
662+
});
663+
664+
// Or obtain the paged response.
665+
var formattedName = client.projectPath(projectId);
666+
667+
668+
var options = {autoPaginate: false};
669+
function callback(responses) {
670+
// The actual resources in a response.
671+
var resources = responses[0];
672+
// The next request if the response shows there's more responses.
673+
var nextRequest = responses[1];
674+
// The actual response object, if necessary.
675+
// var rawResponse = responses[2];
676+
for (var i = 0; i < resources.length; ++i) {
677+
// doThingsWith(resources[i]);
678+
}
679+
if (nextRequest) {
680+
// Fetch the next page.
681+
return client.listMonitoredResourceDescriptors(nextRequest, options).then(callback);
682+
}
683+
}
684+
client.listMonitoredResourceDescriptors({name: formattedName}, options)
685+
.then(callback)
686+
.catch(function(err) {
687+
console.error(err);
688+
});
689+
```
690+
691+
623692
## Cloud Bigtable (Alpha)
624693

625694
- [API Documentation][gcloud-bigtable-docs]
@@ -1017,34 +1086,6 @@ errors.report(new Error('Something broke!'));
10171086

10181087
For more details on API usage, please see the [documentation][stackdriver-errors-module].
10191088

1020-
## Google Stackdriver Monitoring (Alpha)
1021-
1022-
### :warning: This is an auto-generated API
1023-
1024-
It does not follow the conventions you're familiar with from other parts of our library. A handwritten layer is not yet available.
1025-
1026-
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.
1027-
1028-
- [Official Documentation][cloud-monitoring-docs]
1029-
1030-
#### Using the Google Stackdriver Monitoring API module
1031-
1032-
```
1033-
$ npm install --save @google-cloud/monitoring
1034-
```
1035-
1036-
```js
1037-
var monitoring = require('@google-cloud/monitoring');
1038-
```
1039-
1040-
#### Preview
1041-
1042-
```js
1043-
var monitoringClient = monitoring.v3({
1044-
projectId: 'grape-spaceship-123',
1045-
keyFilename: '/path/to/keyfile.json'
1046-
});
1047-
```
10481089

10491090
## Google Stackdriver Trace (Alpha)
10501091

@@ -1104,6 +1145,7 @@ Apache 2.0 - See [COPYING][copying] for more information.
11041145
[gcloud-language-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/language
11051146
[gcloud-logging-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/logging
11061147
[gcloud-prediction-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/prediction
1148+
[gcloud-monitoring-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/monitoring
11071149
[gcloud-pubsub-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub
11081150
[gcloud-resource-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/resource
11091151
[gcloud-spanner-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/spanner

0 commit comments

Comments
 (0)