Socket
Socket
Sign inDemoInstall

@google-cloud/monitoring

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/monitoring - npm Package Compare versions

Comparing version 1.2.3 to 1.3.0

protos/protos.json

14

CHANGELOG.md

@@ -7,2 +7,16 @@ # Changelog

## [1.3.0](https://www.github.com/googleapis/nodejs-monitoring/compare/v1.2.3...v1.3.0) (2019-09-16)
### Bug Fixes
* **deps:** update dependency yargs to v14 ([68a0867](https://www.github.com/googleapis/nodejs-monitoring/commit/68a0867))
* include the correct version of node in a header ([#286](https://www.github.com/googleapis/nodejs-monitoring/issues/286)) ([0c758f9](https://www.github.com/googleapis/nodejs-monitoring/commit/0c758f9))
### Features
* load protos from JSON, grpc-fallback support ([435c5d0](https://www.github.com/googleapis/nodejs-monitoring/commit/435c5d0))
* **GroupServiceClient:** support recursive option when deleting group ([#294](https://www.github.com/googleapis/nodejs-monitoring/issues/294)) ([f7749af](https://www.github.com/googleapis/nodejs-monitoring/commit/f7749af))
### [1.2.3](https://www.github.com/googleapis/nodejs-monitoring/compare/v1.2.2...v1.2.3) (2019-08-03)

@@ -9,0 +23,0 @@

4

package.json
{
"name": "@google-cloud/monitoring",
"description": "Stackdriver Monitoring API client for Node.js",
"version": "1.2.3",
"version": "1.3.0",
"license": "Apache-2.0",

@@ -52,3 +52,3 @@ "author": "Google Inc",

"eslint-config-prettier": "^6.0.0",
"eslint-plugin-node": "^9.0.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.0.0",

@@ -55,0 +55,0 @@ "jsdoc-fresh": "^1.0.1",

@@ -160,3 +160,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

[client-docs]: https://googleapis.dev/nodejs/monitoring/latest#reference
[client-docs]: https://googleapis.dev/nodejs/monitoring/latest
[product-docs]: https://cloud.google.com/monitoring/docs

@@ -168,3 +168,1 @@ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png

[auth]: https://cloud.google.com/docs/authentication/getting-started
<a name="reference"></a>

@@ -69,2 +69,12 @@ // Copyright 2019 Google LLC

if (global.isBrowser) {
// If we're in browser, we use gRPC fallback.
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax;
const servicePath =

@@ -86,3 +96,3 @@ opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

opts.scopes = this.constructor.scopes;
const gaxGrpc = new gax.GrpcClient(opts);
const gaxGrpc = new gaxModule.GrpcClient(opts);

@@ -93,8 +103,14 @@ // Save the auth object to the client, for use by other methods.

// Determine the client header string.
const clientHeader = [
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
`gapic/${VERSION}`,
];
const clientHeader = [];
if (typeof process !== 'undefined' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
}
clientHeader.push(`gax/${gaxModule.version}`);
if (opts.fallback) {
clientHeader.push(`gl-web/${gaxModule.version}`);
} else {
clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`);
}
clientHeader.push(`gapic/${VERSION}`);
if (opts.libName && opts.libVersion) {

@@ -105,5 +121,14 @@ clientHeader.push(`${opts.libName}/${opts.libVersion}`);

// Load the applicable protos.
// For Node.js, pass the path to JSON proto file.
// For browsers, pass the JSON content.
const nodejsProtoPath = path.join(
__dirname,
'..',
'..',
'protos',
'protos.json'
);
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/monitoring/v3/alert_service.proto']
opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath
);

@@ -115,9 +140,9 @@

this._pathTemplates = {
alertPolicyPathTemplate: new gax.PathTemplate(
alertPolicyPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/alertPolicies/{alert_policy}'
),
alertPolicyConditionPathTemplate: new gax.PathTemplate(
alertPolicyConditionPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}'
),
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'),
};

@@ -129,3 +154,3 @@

this._descriptors.page = {
listAlertPolicies: new gax.PageDescriptor(
listAlertPolicies: new gaxModule.PageDescriptor(
'pageToken',

@@ -153,3 +178,5 @@ 'nextPageToken',

const alertPolicyServiceStub = gaxGrpc.createStub(
protos.google.monitoring.v3.AlertPolicyService,
opts.fallback
? protos.lookupService('google.monitoring.v3.AlertPolicyService')
: protos.google.monitoring.v3.AlertPolicyService,
opts

@@ -168,14 +195,12 @@ );

for (const methodName of alertPolicyServiceStubMethods) {
this._innerApiCalls[methodName] = gax.createApiCall(
alertPolicyServiceStub.then(
stub =>
function() {
const args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
},
err =>
function() {
throw err;
}
),
const innerCallPromise = alertPolicyServiceStub.then(
stub => (...args) => {
return stub[methodName].apply(stub, args);
},
err => () => {
throw err;
}
);
this._innerApiCalls[methodName] = gaxModule.createApiCall(
innerCallPromise,
defaults[methodName],

@@ -182,0 +207,0 @@ this._descriptors.page[methodName]

@@ -83,2 +83,8 @@ // Copyright 2019 Google LLC

*
* @property {Object} validity
* Read-only description of how the alert policy is invalid. OK if the alert
* policy is valid. If not OK, the alert policy will not generate incidents.
*
* This object should have the same structure as [Status]{@link google.rpc.Status}
*
* @property {string[]} notificationChannels

@@ -85,0 +91,0 @@ * Identifies the notification channels to which notifications should be sent

@@ -49,6 +49,20 @@ // Copyright 2019 Google LLC

/**
* A time interval extending just after a start time through an end time.
* If the start time is the same as the end time, then the interval
* represents a single point in time.
* A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. In no case can the end time be earlier than the start time.
*
* * For a `GAUGE` metric, the `startTime` value is technically optional; if
* no value is specified, the start time defaults to the value of the
* end time, and the interval represents a single point in time. Such an
* interval is valid only for `GAUGE` metrics, which are point-in-time
* measurements.
*
* * For `DELTA` and `CUMULATIVE` metrics, the start time must be earlier
* than the end time.
*
* * In all cases, the start time of the next interval must be
* at least a microsecond after the end time of the previous interval.
* Because the interval is closed, if the start time of a new interval
* is the same as the end time of the previous interval, data written
* at the new start time could overwrite data written at the previous
* end time.
*
* @property {Object} endTime

@@ -55,0 +69,0 @@ * Required. The end of the time interval.

@@ -140,3 +140,4 @@ // Copyright 2019 Google LLC

/**
* The `DeleteGroup` request. You can only delete a group if it has no children.
* The `DeleteGroup` request. The default behavior is to be able to delete a
* single group without any descendants.
*

@@ -147,2 +148,7 @@ * @property {string} name

*
* @property {boolean} recursive
* If this field is true, then the request means to delete a group with all
* its descendants. Otherwise, the request means to delete a group only when
* it has no descendants. The default value is false.
*
* @typedef DeleteGroupRequest

@@ -149,0 +155,0 @@ * @memberof google.monitoring.v3

@@ -213,3 +213,3 @@ // Copyright 2019 Google LLC

* metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND
* metric.label.instance_name = "my-instance-name"
* metric.labels.instance_name = "my-instance-name"
*

@@ -321,2 +321,4 @@ * @property {Object} interval

*
* The maximum number of `TimeSeries` objects per `Create` request is 200.
*
* This object should have the same structure as [TimeSeries]{@link google.monitoring.v3.TimeSeries}

@@ -323,0 +325,0 @@ *

@@ -73,5 +73,3 @@ // Copyright 2019 Google LLC

* The type of the notification channel. This field matches the
* value of the
* NotificationChannelDescriptor.type
* field.
* value of the NotificationChannelDescriptor.type field.
*

@@ -94,3 +92,3 @@ * @property {string} name

* description may provide additional details, beyond the display
* name, for the channel. This may not exceeed 1024 Unicode characters.
* name, for the channel. This may not exceed 1024 Unicode characters.
*

@@ -100,4 +98,4 @@ * @property {Object.<string, string>} labels

* permissible and required labels are specified in the
* NotificationChannelDescriptor.labels
* of the `NotificationChannelDescriptor` corresponding to the `type` field.
* NotificationChannelDescriptor.labels of the
* `NotificationChannelDescriptor` corresponding to the `type` field.
*

@@ -104,0 +102,0 @@ * @property {Object.<string, string>} userLabels

@@ -25,3 +25,2 @@ // Copyright 2019 Google LLC

*
*
* `projects/[PROJECT_ID]/internalCheckers/[INTERNAL_CHECKER_ID]`.

@@ -49,2 +48,7 @@ *

*
* @property {number} state
* The current operational state of the internal checker.
*
* The number should be among the values of [State]{@link google.monitoring.v3.State}
*
* @typedef InternalChecker

@@ -56,2 +60,32 @@ * @memberof google.monitoring.v3

// This is for documentation. Actual contents will be loaded by gRPC.
/**
* Operational states for an internal checker.
*
* @enum {number}
* @memberof google.monitoring.v3
*/
State: {
/**
* An internal checker should never be in the unspecified state.
*/
UNSPECIFIED: 0,
/**
* The checker is being created, provisioned, and configured. A checker in
* this state can be returned by ListInternalCheckers or GetInternalChecker,
* as well as by examining the longrunning.Operation that created it.
*/
CREATING: 1,
/**
* The checker is running and available for use. A checker in this state
* can be returned by ListInternalCheckers or GetInternalChecker as well
* as by examining the longrunning.Operation that created it.
* If a checker is being torn down, it is neither visible nor usable, so
* there is no "deleting" or "down" state.
*/
RUNNING: 2
}
};

@@ -110,3 +144,3 @@

* (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional,
* defaults to `300s`.
* defaults to `60s`.
*

@@ -140,8 +174,2 @@ * This object should have the same structure as [Duration]{@link google.protobuf.Duration}

*
* @property {boolean} isInternal
* If this is true, then checks are made only from the 'internal_checkers'.
* If it is false, then checks are made only from the 'selected_regions'.
* It is an error to provide 'selected_regions' when is_internal is true,
* or to provide 'internal_checkers' when is_internal is false.
*
* @property {Object[]} internalCheckers

@@ -191,3 +219,4 @@ * The internal checkers that this check will egress from. If `is_internal` is

* host (specified within the MonitoredResource) and port to construct the
* full URL. Optional (defaults to "/").
* full URL. Optional (defaults to "/"). If the provided path does not
* begin with "/", it will be prepended automatically.
*

@@ -223,2 +252,7 @@ * @property {number} port

*
* @property {boolean} validateSsl
* Boolean specifying whether to validate SSL certificates.
* Only applies to uptime_url checks. If use_ssl is false, setting this to
* true has no effect.
*
* @typedef HttpCheck

@@ -274,2 +308,9 @@ * @memberof google.monitoring.v3

*
* @property {number} matcher
* The matcher representing content match options which the check will run
* with. If the field is not specified (in previous versions), the option is
* set to be CONTAINS_STRING which performs content substring matching.
*
* The number should be among the values of [ContentMatcherOption]{@link google.monitoring.v3.ContentMatcherOption}
*
* @typedef ContentMatcher

@@ -281,2 +322,38 @@ * @memberof google.monitoring.v3

// This is for documentation. Actual contents will be loaded by gRPC.
/**
* Options to perform content matching.
*
* @enum {number}
* @memberof google.monitoring.v3
*/
ContentMatcherOption: {
/**
* No content macher option specified. Treated as CONTAINS_STRING.
*/
CONTENT_MATCHER_OPTION_UNSPECIFIED: 0,
/**
* Allows checking substring matching.
* Default value for previous versions without option.
*/
CONTAINS_STRING: 1,
/**
* Allows checking negation of substring matching (doesn't contain the
* substring).
*/
NOT_CONTAINS_STRING: 2,
/**
* Allows checking regular expression matching.
*/
MATCHES_REGEX: 3,
/**
* Allows checking negation of regular expression matching.
*/
NOT_MATCHES_REGEX: 4
}
}

@@ -283,0 +360,0 @@ };

@@ -92,7 +92,9 @@ // Copyright 2019 Google LLC

* In JavaScript, one can convert a Date object to this format using the
* standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
* standard
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
* method. In Python, a standard `datetime.datetime` object can be converted
* to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
* with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
* can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format.
* to this format using
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format.
*

@@ -99,0 +101,0 @@ * @property {number} seconds

@@ -72,2 +72,12 @@ // Copyright 2019 Google LLC

if (global.isBrowser) {
// If we're in browser, we use gRPC fallback.
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax;
const servicePath =

@@ -89,3 +99,3 @@ opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

opts.scopes = this.constructor.scopes;
const gaxGrpc = new gax.GrpcClient(opts);
const gaxGrpc = new gaxModule.GrpcClient(opts);

@@ -96,8 +106,14 @@ // Save the auth object to the client, for use by other methods.

// Determine the client header string.
const clientHeader = [
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
`gapic/${VERSION}`,
];
const clientHeader = [];
if (typeof process !== 'undefined' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
}
clientHeader.push(`gax/${gaxModule.version}`);
if (opts.fallback) {
clientHeader.push(`gl-web/${gaxModule.version}`);
} else {
clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`);
}
clientHeader.push(`gapic/${VERSION}`);
if (opts.libName && opts.libVersion) {

@@ -108,5 +124,14 @@ clientHeader.push(`${opts.libName}/${opts.libVersion}`);

// Load the applicable protos.
// For Node.js, pass the path to JSON proto file.
// For browsers, pass the JSON content.
const nodejsProtoPath = path.join(
__dirname,
'..',
'..',
'protos',
'protos.json'
);
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/monitoring/v3/group_service.proto']
opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath
);

@@ -118,6 +143,6 @@

this._pathTemplates = {
groupPathTemplate: new gax.PathTemplate(
groupPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/groups/{group}'
),
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'),
};

@@ -129,6 +154,10 @@

this._descriptors.page = {
listGroups: new gax.PageDescriptor('pageToken', 'nextPageToken', 'group'),
listGroupMembers: new gax.PageDescriptor(
listGroups: new gaxModule.PageDescriptor(
'pageToken',
'nextPageToken',
'group'
),
listGroupMembers: new gaxModule.PageDescriptor(
'pageToken',
'nextPageToken',
'members'

@@ -154,3 +183,5 @@ ),

const groupServiceStub = gaxGrpc.createStub(
protos.google.monitoring.v3.GroupService,
opts.fallback
? protos.lookupService('google.monitoring.v3.GroupService')
: protos.google.monitoring.v3.GroupService,
opts

@@ -170,14 +201,12 @@ );

for (const methodName of groupServiceStubMethods) {
this._innerApiCalls[methodName] = gax.createApiCall(
groupServiceStub.then(
stub =>
function() {
const args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
},
err =>
function() {
throw err;
}
),
const innerCallPromise = groupServiceStub.then(
stub => (...args) => {
return stub[methodName].apply(stub, args);
},
err => () => {
throw err;
}
);
this._innerApiCalls[methodName] = gaxModule.createApiCall(
innerCallPromise,
defaults[methodName],

@@ -616,2 +645,6 @@ this._descriptors.page[methodName]

* `"projects/{project_id_or_number}/groups/{group_id}"`.
* @param {boolean} [request.recursive]
* If this field is true, then the request means to delete a group with all
* its descendants. Otherwise, the request means to delete a group only when
* it has no descendants. The default value is false.
* @param {Object} [options]

@@ -618,0 +651,0 @@ * Optional parameters. You can override the default settings for this call, e.g, timeout,

@@ -62,2 +62,12 @@ // Copyright 2019 Google LLC

if (global.isBrowser) {
// If we're in browser, we use gRPC fallback.
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax;
const servicePath =

@@ -79,3 +89,3 @@ opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

opts.scopes = this.constructor.scopes;
const gaxGrpc = new gax.GrpcClient(opts);
const gaxGrpc = new gaxModule.GrpcClient(opts);

@@ -86,8 +96,14 @@ // Save the auth object to the client, for use by other methods.

// Determine the client header string.
const clientHeader = [
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
`gapic/${VERSION}`,
];
const clientHeader = [];
if (typeof process !== 'undefined' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
}
clientHeader.push(`gax/${gaxModule.version}`);
if (opts.fallback) {
clientHeader.push(`gl-web/${gaxModule.version}`);
} else {
clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`);
}
clientHeader.push(`gapic/${VERSION}`);
if (opts.libName && opts.libVersion) {

@@ -98,5 +114,14 @@ clientHeader.push(`${opts.libName}/${opts.libVersion}`);

// Load the applicable protos.
// For Node.js, pass the path to JSON proto file.
// For browsers, pass the JSON content.
const nodejsProtoPath = path.join(
__dirname,
'..',
'..',
'protos',
'protos.json'
);
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/monitoring/v3/metric_service.proto']
opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath
);

@@ -108,9 +133,9 @@

this._pathTemplates = {
metricDescriptorPathTemplate: new gax.PathTemplate(
metricDescriptorPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/metricDescriptors/{metric_descriptor=**}'
),
monitoredResourceDescriptorPathTemplate: new gax.PathTemplate(
monitoredResourceDescriptorPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}'
),
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'),
};

@@ -122,3 +147,3 @@

this._descriptors.page = {
listMonitoredResourceDescriptors: new gax.PageDescriptor(
listMonitoredResourceDescriptors: new gaxModule.PageDescriptor(
'pageToken',

@@ -128,3 +153,3 @@ 'nextPageToken',

),
listMetricDescriptors: new gax.PageDescriptor(
listMetricDescriptors: new gaxModule.PageDescriptor(
'pageToken',

@@ -134,3 +159,3 @@ 'nextPageToken',

),
listTimeSeries: new gax.PageDescriptor(
listTimeSeries: new gaxModule.PageDescriptor(
'pageToken',

@@ -158,3 +183,5 @@ 'nextPageToken',

const metricServiceStub = gaxGrpc.createStub(
protos.google.monitoring.v3.MetricService,
opts.fallback
? protos.lookupService('google.monitoring.v3.MetricService')
: protos.google.monitoring.v3.MetricService,
opts

@@ -176,14 +203,12 @@ );

for (const methodName of metricServiceStubMethods) {
this._innerApiCalls[methodName] = gax.createApiCall(
metricServiceStub.then(
stub =>
function() {
const args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
},
err =>
function() {
throw err;
}
),
const innerCallPromise = metricServiceStub.then(
stub => (...args) => {
return stub[methodName].apply(stub, args);
},
err => () => {
throw err;
}
);
this._innerApiCalls[methodName] = gaxModule.createApiCall(
innerCallPromise,
defaults[methodName],

@@ -244,4 +269,3 @@ this._descriptors.page[methodName]

/**
* Lists monitored resource descriptors that match a filter. This method does
* not require a Stackdriver account.
* Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
*

@@ -425,4 +449,3 @@ * @param {Object} request

/**
* Gets a single monitored resource descriptor. This method does not require a
* Stackdriver account.
* Gets a single monitored resource descriptor. This method does not require a Stackdriver account.
*

@@ -488,4 +511,3 @@ * @param {Object} request

/**
* Lists metric descriptors that match a filter. This method does not require
* a Stackdriver account.
* Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
*

@@ -671,4 +693,3 @@ * @param {Object} request

/**
* Gets a single metric descriptor. This method does not require a Stackdriver
* account.
* Gets a single metric descriptor. This method does not require a Stackdriver account.
*

@@ -855,4 +876,3 @@ * @param {Object} request

/**
* Lists time series that match a filter. This method does not require a
* Stackdriver account.
* Lists time series that match a filter. This method does not require a Stackdriver account.
*

@@ -871,3 +891,3 @@ * @param {Object} request

* metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND
* metric.label.instance_name = "my-instance-name"
* metric.labels.instance_name = "my-instance-name"
* @param {Object} request.interval

@@ -1030,3 +1050,3 @@ * The time interval for which results should be returned. Only time series

* metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND
* metric.label.instance_name = "my-instance-name"
* metric.labels.instance_name = "my-instance-name"
* @param {Object} request.interval

@@ -1116,2 +1136,4 @@ * The time interval for which results should be returned. Only time series

*
* The maximum number of `TimeSeries` objects per `Create` request is 200.
*
* This object should have the same structure as [TimeSeries]{@link google.monitoring.v3.TimeSeries}

@@ -1118,0 +1140,0 @@ * @param {Object} [options]

@@ -62,2 +62,12 @@ // Copyright 2019 Google LLC

if (global.isBrowser) {
// If we're in browser, we use gRPC fallback.
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax;
const servicePath =

@@ -79,3 +89,3 @@ opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

opts.scopes = this.constructor.scopes;
const gaxGrpc = new gax.GrpcClient(opts);
const gaxGrpc = new gaxModule.GrpcClient(opts);

@@ -86,8 +96,14 @@ // Save the auth object to the client, for use by other methods.

// Determine the client header string.
const clientHeader = [
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
`gapic/${VERSION}`,
];
const clientHeader = [];
if (typeof process !== 'undefined' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
}
clientHeader.push(`gax/${gaxModule.version}`);
if (opts.fallback) {
clientHeader.push(`gl-web/${gaxModule.version}`);
} else {
clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`);
}
clientHeader.push(`gapic/${VERSION}`);
if (opts.libName && opts.libVersion) {

@@ -98,5 +114,14 @@ clientHeader.push(`${opts.libName}/${opts.libVersion}`);

// Load the applicable protos.
// For Node.js, pass the path to JSON proto file.
// For browsers, pass the JSON content.
const nodejsProtoPath = path.join(
__dirname,
'..',
'..',
'protos',
'protos.json'
);
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/monitoring/v3/notification_service.proto']
opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath
);

@@ -108,9 +133,9 @@

this._pathTemplates = {
notificationChannelPathTemplate: new gax.PathTemplate(
notificationChannelPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/notificationChannels/{notification_channel}'
),
notificationChannelDescriptorPathTemplate: new gax.PathTemplate(
notificationChannelDescriptorPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/notificationChannelDescriptors/{channel_descriptor}'
),
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'),
};

@@ -122,3 +147,3 @@

this._descriptors.page = {
listNotificationChannelDescriptors: new gax.PageDescriptor(
listNotificationChannelDescriptors: new gaxModule.PageDescriptor(
'pageToken',

@@ -128,3 +153,3 @@ 'nextPageToken',

),
listNotificationChannels: new gax.PageDescriptor(
listNotificationChannels: new gaxModule.PageDescriptor(
'pageToken',

@@ -152,3 +177,7 @@ 'nextPageToken',

const notificationChannelServiceStub = gaxGrpc.createStub(
protos.google.monitoring.v3.NotificationChannelService,
opts.fallback
? protos.lookupService(
'google.monitoring.v3.NotificationChannelService'
)
: protos.google.monitoring.v3.NotificationChannelService,
opts

@@ -172,14 +201,12 @@ );

for (const methodName of notificationChannelServiceStubMethods) {
this._innerApiCalls[methodName] = gax.createApiCall(
notificationChannelServiceStub.then(
stub =>
function() {
const args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
},
err =>
function() {
throw err;
}
),
const innerCallPromise = notificationChannelServiceStub.then(
stub => (...args) => {
return stub[methodName].apply(stub, args);
},
err => () => {
throw err;
}
);
this._innerApiCalls[methodName] = gaxModule.createApiCall(
innerCallPromise,
defaults[methodName],

@@ -186,0 +213,0 @@ this._descriptors.page[methodName]

@@ -68,2 +68,12 @@ // Copyright 2019 Google LLC

if (global.isBrowser) {
// If we're in browser, we use gRPC fallback.
opts.fallback = true;
}
// If we are in browser, we are already using fallback because of the
// "browser" field in package.json.
// But if we were explicitly requested to use fallback, let's do it now.
const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax;
const servicePath =

@@ -85,3 +95,3 @@ opts.servicePath || opts.apiEndpoint || this.constructor.servicePath;

opts.scopes = this.constructor.scopes;
const gaxGrpc = new gax.GrpcClient(opts);
const gaxGrpc = new gaxModule.GrpcClient(opts);

@@ -92,8 +102,14 @@ // Save the auth object to the client, for use by other methods.

// Determine the client header string.
const clientHeader = [
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
`gapic/${VERSION}`,
];
const clientHeader = [];
if (typeof process !== 'undefined' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
}
clientHeader.push(`gax/${gaxModule.version}`);
if (opts.fallback) {
clientHeader.push(`gl-web/${gaxModule.version}`);
} else {
clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`);
}
clientHeader.push(`gapic/${VERSION}`);
if (opts.libName && opts.libVersion) {

@@ -104,5 +120,14 @@ clientHeader.push(`${opts.libName}/${opts.libVersion}`);

// Load the applicable protos.
// For Node.js, pass the path to JSON proto file.
// For browsers, pass the JSON content.
const nodejsProtoPath = path.join(
__dirname,
'..',
'..',
'protos',
'protos.json'
);
const protos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'protos'),
['google/monitoring/v3/uptime_service.proto']
opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath
);

@@ -114,4 +139,4 @@

this._pathTemplates = {
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
uptimeCheckConfigPathTemplate: new gax.PathTemplate(
projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'),
uptimeCheckConfigPathTemplate: new gaxModule.PathTemplate(
'projects/{project}/uptimeCheckConfigs/{uptime_check_config}'

@@ -125,3 +150,3 @@ ),

this._descriptors.page = {
listUptimeCheckConfigs: new gax.PageDescriptor(
listUptimeCheckConfigs: new gaxModule.PageDescriptor(
'pageToken',

@@ -131,3 +156,3 @@ 'nextPageToken',

),
listUptimeCheckIps: new gax.PageDescriptor(
listUptimeCheckIps: new gaxModule.PageDescriptor(
'pageToken',

@@ -155,3 +180,5 @@ 'nextPageToken',

const uptimeCheckServiceStub = gaxGrpc.createStub(
protos.google.monitoring.v3.UptimeCheckService,
opts.fallback
? protos.lookupService('google.monitoring.v3.UptimeCheckService')
: protos.google.monitoring.v3.UptimeCheckService,
opts

@@ -171,14 +198,12 @@ );

for (const methodName of uptimeCheckServiceStubMethods) {
this._innerApiCalls[methodName] = gax.createApiCall(
uptimeCheckServiceStub.then(
stub =>
function() {
const args = Array.prototype.slice.call(arguments, 0);
return stub[methodName].apply(stub, args);
},
err =>
function() {
throw err;
}
),
const innerCallPromise = uptimeCheckServiceStub.then(
stub => (...args) => {
return stub[methodName].apply(stub, args);
},
err => () => {
throw err;
}
);
this._innerApiCalls[methodName] = gaxModule.createApiCall(
innerCallPromise,
defaults[methodName],

@@ -185,0 +210,0 @@ this._descriptors.page[methodName]

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc