UNPKG

@google-cloud/monitoring

Version:
780 lines 90.8 kB
import type * as gax from 'google-gax'; import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; import { Transform } from 'stream'; import * as protos from '../../protos/protos'; /** * Manages metric descriptors, monitored resource descriptors, and * time series data. * @class * @memberof v3 */ export declare class MetricServiceClient { private _terminated; private _opts; private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; private _universeDomain; private _servicePath; private _log; auth: gax.GoogleAuth; descriptors: Descriptors; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; pathTemplates: { [name: string]: gax.PathTemplate; }; metricServiceStub?: Promise<{ [name: string]: Function; }>; /** * Construct an instance of MetricServiceClient. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - 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 below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - 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 * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you * need to avoid loading the default gRPC version and want to use the fallback * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC * const client = new MetricServiceClient({fallback: true}, gax); * ``` */ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize(): Promise<{ [name: string]: Function; }>; /** * The DNS address for this API service. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get servicePath(): string; /** * The DNS address for this API service - same as servicePath. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get apiEndpoint(): string; /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ get apiEndpoint(): string; get universeDomain(): string; /** * The port for this API service. * @returns {number} The default port for this service. */ static get port(): number; /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes(): string[]; getProjectId(): Promise<string>; getProjectId(callback: Callback<string, undefined, undefined>): void; /** * Gets a single monitored resource descriptor. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The monitored resource descriptor to get. The format is: * * projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] * * The `[RESOURCE_TYPE]` is a predefined type, such as * `cloudsql_database`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.api.MonitoredResourceDescriptor|MonitoredResourceDescriptor}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.get_monitored_resource_descriptor.js</caption> * region_tag:monitoring_v3_generated_MetricService_GetMonitoredResourceDescriptor_async */ getMonitoredResourceDescriptor(request?: protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, options?: CallOptions): Promise<[ protos.google.api.IMonitoredResourceDescriptor, protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest | undefined, {} | undefined ]>; getMonitoredResourceDescriptor(request: protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, options: CallOptions, callback: Callback<protos.google.api.IMonitoredResourceDescriptor, protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest | null | undefined, {} | null | undefined>): void; getMonitoredResourceDescriptor(request: protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, callback: Callback<protos.google.api.IMonitoredResourceDescriptor, protos.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest | null | undefined, {} | null | undefined>): void; /** * Gets a single metric descriptor. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The metric descriptor on which to execute the request. The format * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * * An example value of `[METRIC_ID]` is * `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.api.MetricDescriptor|MetricDescriptor}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.get_metric_descriptor.js</caption> * region_tag:monitoring_v3_generated_MetricService_GetMetricDescriptor_async */ getMetricDescriptor(request?: protos.google.monitoring.v3.IGetMetricDescriptorRequest, options?: CallOptions): Promise<[ protos.google.api.IMetricDescriptor, protos.google.monitoring.v3.IGetMetricDescriptorRequest | undefined, {} | undefined ]>; getMetricDescriptor(request: protos.google.monitoring.v3.IGetMetricDescriptorRequest, options: CallOptions, callback: Callback<protos.google.api.IMetricDescriptor, protos.google.monitoring.v3.IGetMetricDescriptorRequest | null | undefined, {} | null | undefined>): void; getMetricDescriptor(request: protos.google.monitoring.v3.IGetMetricDescriptorRequest, callback: Callback<protos.google.api.IMetricDescriptor, protos.google.monitoring.v3.IGetMetricDescriptorRequest | null | undefined, {} | null | undefined>): void; /** * Creates a new metric descriptor. * The creation is executed asynchronously. * User-created metric descriptors define * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). * The metric descriptor is updated if it already exists, * except that metric labels are never removed. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * 4 * projects/[PROJECT_ID_OR_NUMBER] * @param {google.api.MetricDescriptor} request.metricDescriptor * Required. The new [custom * metric](https://cloud.google.com/monitoring/custom-metrics) descriptor. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.api.MetricDescriptor|MetricDescriptor}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.create_metric_descriptor.js</caption> * region_tag:monitoring_v3_generated_MetricService_CreateMetricDescriptor_async */ createMetricDescriptor(request?: protos.google.monitoring.v3.ICreateMetricDescriptorRequest, options?: CallOptions): Promise<[ protos.google.api.IMetricDescriptor, protos.google.monitoring.v3.ICreateMetricDescriptorRequest | undefined, {} | undefined ]>; createMetricDescriptor(request: protos.google.monitoring.v3.ICreateMetricDescriptorRequest, options: CallOptions, callback: Callback<protos.google.api.IMetricDescriptor, protos.google.monitoring.v3.ICreateMetricDescriptorRequest | null | undefined, {} | null | undefined>): void; createMetricDescriptor(request: protos.google.monitoring.v3.ICreateMetricDescriptorRequest, callback: Callback<protos.google.api.IMetricDescriptor, protos.google.monitoring.v3.ICreateMetricDescriptorRequest | null | undefined, {} | null | undefined>): void; /** * Deletes a metric descriptor. Only user-created * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be * deleted. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The metric descriptor on which to execute the request. The format * is: * * projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] * * An example of `[METRIC_ID]` is: * `"custom.googleapis.com/my_test_metric"`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.delete_metric_descriptor.js</caption> * region_tag:monitoring_v3_generated_MetricService_DeleteMetricDescriptor_async */ deleteMetricDescriptor(request?: protos.google.monitoring.v3.IDeleteMetricDescriptorRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteMetricDescriptorRequest | undefined, {} | undefined ]>; deleteMetricDescriptor(request: protos.google.monitoring.v3.IDeleteMetricDescriptorRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteMetricDescriptorRequest | null | undefined, {} | null | undefined>): void; deleteMetricDescriptor(request: protos.google.monitoring.v3.IDeleteMetricDescriptorRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteMetricDescriptorRequest | null | undefined, {} | null | undefined>): void; /** * Creates or adds data to one or more time series. * The response is empty if all time series in the request were written. * If any time series could not be written, a corresponding failure message is * included in the error response. * This method does not support * [resource locations constraint of an organization * policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {number[]} request.timeSeries * Required. The new data to be added to a list of time series. * Adds at most one data point to each of several time series. The new data * point must be more recent than any other point in its time series. Each * `TimeSeries` value must fully specify a unique time series by supplying * all label values for the metric and the monitored resource. * * The maximum number of `TimeSeries` objects per `Create` request is 200. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.create_time_series.js</caption> * region_tag:monitoring_v3_generated_MetricService_CreateTimeSeries_async */ createTimeSeries(request?: protos.google.monitoring.v3.ICreateTimeSeriesRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ICreateTimeSeriesRequest | undefined, {} | undefined ]>; createTimeSeries(request: protos.google.monitoring.v3.ICreateTimeSeriesRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ICreateTimeSeriesRequest | null | undefined, {} | null | undefined>): void; createTimeSeries(request: protos.google.monitoring.v3.ICreateTimeSeriesRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ICreateTimeSeriesRequest | null | undefined, {} | null | undefined>): void; /** * Creates or adds data to one or more service time series. A service time * series is a time series for a metric from a Google Cloud service. The * response is empty if all time series in the request were written. If any * time series could not be written, a corresponding failure message is * included in the error response. This endpoint rejects writes to * user-defined metrics. * This method is only for use by Google Cloud services. Use * {@link protos.google.monitoring.v3.MetricService.CreateTimeSeries|projects.timeSeries.create} * instead. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {number[]} request.timeSeries * Required. The new data to be added to a list of time series. * Adds at most one data point to each of several time series. The new data * point must be more recent than any other point in its time series. Each * `TimeSeries` value must fully specify a unique time series by supplying * all label values for the metric and the monitored resource. * * The maximum number of `TimeSeries` objects per `Create` request is 200. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.create_service_time_series.js</caption> * region_tag:monitoring_v3_generated_MetricService_CreateServiceTimeSeries_async */ createServiceTimeSeries(request?: protos.google.monitoring.v3.ICreateTimeSeriesRequest, options?: CallOptions): Promise<[ protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ICreateTimeSeriesRequest | undefined, {} | undefined ]>; createServiceTimeSeries(request: protos.google.monitoring.v3.ICreateTimeSeriesRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ICreateTimeSeriesRequest | null | undefined, {} | null | undefined>): void; createServiceTimeSeries(request: protos.google.monitoring.v3.ICreateTimeSeriesRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ICreateTimeSeriesRequest | null | undefined, {} | null | undefined>): void; /** * Lists monitored resource descriptors that match a filter. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {string} request.filter * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) * describing the descriptors to be returned. The filter can reference the * descriptor's type and labels. For example, the following filter returns * only Google Compute Engine descriptors that have an `id` label: * * resource.type = starts_with("gce_") AND resource.label:id * @param {number} request.pageSize * A positive number that is the maximum number of results to return. * @param {string} request.pageToken * If this field is not empty then it must contain the `nextPageToken` value * returned by a previous call to this method. Using this field causes the * method to return additional results from the previous method call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of {@link protos.google.api.MonitoredResourceDescriptor|MonitoredResourceDescriptor}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. * We recommend using `listMonitoredResourceDescriptorsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listMonitoredResourceDescriptors(request?: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, options?: CallOptions): Promise<[ protos.google.api.IMonitoredResourceDescriptor[], protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest | null, protos.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse ]>; listMonitoredResourceDescriptors(request: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, options: CallOptions, callback: PaginationCallback<protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, protos.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse | null | undefined, protos.google.api.IMonitoredResourceDescriptor>): void; listMonitoredResourceDescriptors(request: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, callback: PaginationCallback<protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, protos.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse | null | undefined, protos.google.api.IMonitoredResourceDescriptor>): void; /** * Equivalent to `listMonitoredResourceDescriptors`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {string} request.filter * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) * describing the descriptors to be returned. The filter can reference the * descriptor's type and labels. For example, the following filter returns * only Google Compute Engine descriptors that have an `id` label: * * resource.type = starts_with("gce_") AND resource.label:id * @param {number} request.pageSize * A positive number that is the maximum number of results to return. * @param {string} request.pageToken * If this field is not empty then it must contain the `nextPageToken` value * returned by a previous call to this method. Using this field causes the * method to return additional results from the previous method call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing {@link protos.google.api.MonitoredResourceDescriptor|MonitoredResourceDescriptor} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listMonitoredResourceDescriptorsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listMonitoredResourceDescriptorsStream(request?: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, options?: CallOptions): Transform; /** * Equivalent to `listMonitoredResourceDescriptors`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {string} request.filter * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) * describing the descriptors to be returned. The filter can reference the * descriptor's type and labels. For example, the following filter returns * only Google Compute Engine descriptors that have an `id` label: * * resource.type = starts_with("gce_") AND resource.label:id * @param {number} request.pageSize * A positive number that is the maximum number of results to return. * @param {string} request.pageToken * If this field is not empty then it must contain the `nextPageToken` value * returned by a previous call to this method. Using this field causes the * method to return additional results from the previous method call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing * {@link protos.google.api.MonitoredResourceDescriptor|MonitoredResourceDescriptor}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.list_monitored_resource_descriptors.js</caption> * region_tag:monitoring_v3_generated_MetricService_ListMonitoredResourceDescriptors_async */ listMonitoredResourceDescriptorsAsync(request?: protos.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, options?: CallOptions): AsyncIterable<protos.google.api.IMonitoredResourceDescriptor>; /** * Lists metric descriptors that match a filter. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {string} [request.filter] * Optional. If this field is empty, all custom and * system-defined metric descriptors are returned. * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) * specifies which metric descriptors are to be * returned. For example, the following filter matches all * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): * * metric.type = starts_with("custom.googleapis.com/") * @param {number} [request.pageSize] * Optional. A positive number that is the maximum number of results to * return. The default and maximum value is 10,000. If a page_size <= 0 or > * 10,000 is submitted, will instead return a maximum of 10,000 results. * @param {string} [request.pageToken] * Optional. If this field is not empty then it must contain the * `nextPageToken` value returned by a previous call to this method. Using * this field causes the method to return additional results from the previous * method call. * @param {boolean} [request.activeOnly] * Optional. If true, only metrics and monitored resource types that have * recent data (within roughly 25 hours) will be included in the response. * - If a metric descriptor enumerates monitored resource types, only the * monitored resource types for which the metric type has recent data will * be included in the returned metric descriptor, and if none of them have * recent data, the metric descriptor will not be returned. * - If a metric descriptor does not enumerate the compatible monitored * resource types, it will be returned only if the metric type has recent * data for some monitored resource type. The returned descriptor will not * enumerate any monitored resource types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of {@link protos.google.api.MetricDescriptor|MetricDescriptor}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. * We recommend using `listMetricDescriptorsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listMetricDescriptors(request?: protos.google.monitoring.v3.IListMetricDescriptorsRequest, options?: CallOptions): Promise<[ protos.google.api.IMetricDescriptor[], protos.google.monitoring.v3.IListMetricDescriptorsRequest | null, protos.google.monitoring.v3.IListMetricDescriptorsResponse ]>; listMetricDescriptors(request: protos.google.monitoring.v3.IListMetricDescriptorsRequest, options: CallOptions, callback: PaginationCallback<protos.google.monitoring.v3.IListMetricDescriptorsRequest, protos.google.monitoring.v3.IListMetricDescriptorsResponse | null | undefined, protos.google.api.IMetricDescriptor>): void; listMetricDescriptors(request: protos.google.monitoring.v3.IListMetricDescriptorsRequest, callback: PaginationCallback<protos.google.monitoring.v3.IListMetricDescriptorsRequest, protos.google.monitoring.v3.IListMetricDescriptorsResponse | null | undefined, protos.google.api.IMetricDescriptor>): void; /** * Equivalent to `listMetricDescriptors`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {string} [request.filter] * Optional. If this field is empty, all custom and * system-defined metric descriptors are returned. * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) * specifies which metric descriptors are to be * returned. For example, the following filter matches all * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): * * metric.type = starts_with("custom.googleapis.com/") * @param {number} [request.pageSize] * Optional. A positive number that is the maximum number of results to * return. The default and maximum value is 10,000. If a page_size <= 0 or > * 10,000 is submitted, will instead return a maximum of 10,000 results. * @param {string} [request.pageToken] * Optional. If this field is not empty then it must contain the * `nextPageToken` value returned by a previous call to this method. Using * this field causes the method to return additional results from the previous * method call. * @param {boolean} [request.activeOnly] * Optional. If true, only metrics and monitored resource types that have * recent data (within roughly 25 hours) will be included in the response. * - If a metric descriptor enumerates monitored resource types, only the * monitored resource types for which the metric type has recent data will * be included in the returned metric descriptor, and if none of them have * recent data, the metric descriptor will not be returned. * - If a metric descriptor does not enumerate the compatible monitored * resource types, it will be returned only if the metric type has recent * data for some monitored resource type. The returned descriptor will not * enumerate any monitored resource types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing {@link protos.google.api.MetricDescriptor|MetricDescriptor} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listMetricDescriptorsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listMetricDescriptorsStream(request?: protos.google.monitoring.v3.IListMetricDescriptorsRequest, options?: CallOptions): Transform; /** * Equivalent to `listMetricDescriptors`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name) on which * to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * @param {string} [request.filter] * Optional. If this field is empty, all custom and * system-defined metric descriptors are returned. * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) * specifies which metric descriptors are to be * returned. For example, the following filter matches all * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): * * metric.type = starts_with("custom.googleapis.com/") * @param {number} [request.pageSize] * Optional. A positive number that is the maximum number of results to * return. The default and maximum value is 10,000. If a page_size <= 0 or > * 10,000 is submitted, will instead return a maximum of 10,000 results. * @param {string} [request.pageToken] * Optional. If this field is not empty then it must contain the * `nextPageToken` value returned by a previous call to this method. Using * this field causes the method to return additional results from the previous * method call. * @param {boolean} [request.activeOnly] * Optional. If true, only metrics and monitored resource types that have * recent data (within roughly 25 hours) will be included in the response. * - If a metric descriptor enumerates monitored resource types, only the * monitored resource types for which the metric type has recent data will * be included in the returned metric descriptor, and if none of them have * recent data, the metric descriptor will not be returned. * - If a metric descriptor does not enumerate the compatible monitored * resource types, it will be returned only if the metric type has recent * data for some monitored resource type. The returned descriptor will not * enumerate any monitored resource types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing * {@link protos.google.api.MetricDescriptor|MetricDescriptor}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. * @example <caption>include:samples/generated/v3/metric_service.list_metric_descriptors.js</caption> * region_tag:monitoring_v3_generated_MetricService_ListMetricDescriptors_async */ listMetricDescriptorsAsync(request?: protos.google.monitoring.v3.IListMetricDescriptorsRequest, options?: CallOptions): AsyncIterable<protos.google.api.IMetricDescriptor>; /** * Lists time series that match a filter. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name), * organization or folder on which to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * organizations/[ORGANIZATION_ID] * folders/[FOLDER_ID] * @param {string} request.filter * Required. A [monitoring * filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies * which time series should be returned. The filter must specify a single * metric type, and can additionally specify metric labels and other * information. For example: * * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND * metric.labels.instance_name = "my-instance-name" * @param {google.monitoring.v3.TimeInterval} request.interval * Required. The time interval for which results should be returned. Only time * series that contain data points in the specified interval are included in * the response. * @param {google.monitoring.v3.Aggregation} request.aggregation * Specifies the alignment of data points in individual time series as * well as how to combine the retrieved time series across specified labels. * * By default (if no `aggregation` is explicitly specified), the raw time * series data is returned. * @param {google.monitoring.v3.Aggregation} request.secondaryAggregation * Apply a second aggregation after `aggregation` is applied. May only be * specified if `aggregation` is specified. * @param {string} request.orderBy * Unsupported: must be left blank. The points in each time series are * currently returned in reverse time order (most recent to oldest). * @param {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView} request.view * Required. Specifies which information is returned about the time series. * @param {number} request.pageSize * A positive number that is the maximum number of results to return. If * `page_size` is empty or more than 100,000 results, the effective * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is * the maximum number of `TimeSeries` returned. * @param {string} request.pageToken * If this field is not empty then it must contain the `nextPageToken` value * returned by a previous call to this method. Using this field causes the * method to return additional results from the previous method call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of {@link protos.google.monitoring.v3.TimeSeries|TimeSeries}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. * We recommend using `listTimeSeriesAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listTimeSeries(request?: protos.google.monitoring.v3.IListTimeSeriesRequest, options?: CallOptions): Promise<[ protos.google.monitoring.v3.ITimeSeries[], protos.google.monitoring.v3.IListTimeSeriesRequest | null, protos.google.monitoring.v3.IListTimeSeriesResponse ]>; listTimeSeries(request: protos.google.monitoring.v3.IListTimeSeriesRequest, options: CallOptions, callback: PaginationCallback<protos.google.monitoring.v3.IListTimeSeriesRequest, protos.google.monitoring.v3.IListTimeSeriesResponse | null | undefined, protos.google.monitoring.v3.ITimeSeries>): void; listTimeSeries(request: protos.google.monitoring.v3.IListTimeSeriesRequest, callback: PaginationCallback<protos.google.monitoring.v3.IListTimeSeriesRequest, protos.google.monitoring.v3.IListTimeSeriesResponse | null | undefined, protos.google.monitoring.v3.ITimeSeries>): void; /** * Equivalent to `listTimeSeries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name), * organization or folder on which to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * organizations/[ORGANIZATION_ID] * folders/[FOLDER_ID] * @param {string} request.filter * Required. A [monitoring * filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies * which time series should be returned. The filter must specify a single * metric type, and can additionally specify metric labels and other * information. For example: * * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND * metric.labels.instance_name = "my-instance-name" * @param {google.monitoring.v3.TimeInterval} request.interval * Required. The time interval for which results should be returned. Only time * series that contain data points in the specified interval are included in * the response. * @param {google.monitoring.v3.Aggregation} request.aggregation * Specifies the alignment of data points in individual time series as * well as how to combine the retrieved time series across specified labels. * * By default (if no `aggregation` is explicitly specified), the raw time * series data is returned. * @param {google.monitoring.v3.Aggregation} request.secondaryAggregation * Apply a second aggregation after `aggregation` is applied. May only be * specified if `aggregation` is specified. * @param {string} request.orderBy * Unsupported: must be left blank. The points in each time series are * currently returned in reverse time order (most recent to oldest). * @param {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView} request.view * Required. Specifies which information is returned about the time series. * @param {number} request.pageSize * A positive number that is the maximum number of results to return. If * `page_size` is empty or more than 100,000 results, the effective * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is * the maximum number of `TimeSeries` returned. * @param {string} request.pageToken * If this field is not empty then it must contain the `nextPageToken` value * returned by a previous call to this method. Using this field causes the * method to return additional results from the previous method call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing {@link protos.google.monitoring.v3.TimeSeries|TimeSeries} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listTimeSeriesAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listTimeSeriesStream(request?: protos.google.monitoring.v3.IListTimeSeriesRequest, options?: CallOptions): Transform; /** * Equivalent to `listTimeSeries`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The * [project](https://cloud.google.com/monitoring/api/v3#project_name), * organization or folder on which to execute the request. The format is: * * projects/[PROJECT_ID_OR_NUMBER] * organizations/[ORGANIZATION_ID] * folders/[FOLDER_ID] * @param {string} request.filter * Required. A [monitoring * filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies * which time series should be returned. The filter must specify a single * metric type, and can additionally specify metric labels and other * information. For example: * * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND * metric.labels.instance_name = "my-instance-name" * @param {google.monitoring.v3.TimeInterval} request.interval * Required. The time interval for which results should be returned. Only time * series that contain data points in the specified interval are included in * the response. * @param {google.monitoring.v3.Aggregation} request.aggregation * Specifies the alignment of data points in individual time series as * well as how to combine the retrieved time series across specified labels. * * By default (if no `aggregation` is explicitly specified), the raw time * series data is returned. * @param {google.monitoring.v3.Aggregation} request.secondaryAggregation * Apply a second aggregation after `aggregation` is applied. May only be * specified if `aggregation` is specified. * @param {string} request.orderBy * Unsupported: must be left blank. The points in each time series are * currently returned in reverse time order (most recent to oldest). * @param {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView} request.view * Required. Specifies which information is returned about the time series. * @param {number} request.pageSize * A positive number that is the maximum number of results to return. If * `page_size` is empty or more than 100,000 results, the effective * `page_size` is 100,000 results. If `view` is set to `FULL`, this i