Skip to content

Commit

Permalink
feat(monitoring): update the API
Browse files Browse the repository at this point in the history
#### monitoring:v3

The following keys were added:
- resources.projects.resources.timeSeries.methods.createService.description
- resources.projects.resources.timeSeries.methods.createService.flatPath
- resources.projects.resources.timeSeries.methods.createService.httpMethod
- resources.projects.resources.timeSeries.methods.createService.id
- resources.projects.resources.timeSeries.methods.createService.parameterOrder
- resources.projects.resources.timeSeries.methods.createService.parameters.name.description
- resources.projects.resources.timeSeries.methods.createService.parameters.name.location
- resources.projects.resources.timeSeries.methods.createService.parameters.name.pattern
- resources.projects.resources.timeSeries.methods.createService.parameters.name.required
- resources.projects.resources.timeSeries.methods.createService.parameters.name.type
- resources.projects.resources.timeSeries.methods.createService.path
- resources.projects.resources.timeSeries.methods.createService.request.$ref
- resources.projects.resources.timeSeries.methods.createService.response.$ref
- resources.projects.resources.timeSeries.methods.createService.scopes

The following keys were changed:
- schemas.AlertStrategy.properties.autoClose.description
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Oct 2, 2021
1 parent 733a33b commit 7509670
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 3 deletions.
34 changes: 32 additions & 2 deletions discovery/monitoring-v3.json
Expand Up @@ -1679,6 +1679,36 @@
"https://www.googleapis.com/auth/monitoring.write"
]
},
"createService": {
"description": "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 projects.timeSeries.create instead.",
"flatPath": "v3/projects/{projectsId}/timeSeries:createService",
"httpMethod": "POST",
"id": "monitoring.projects.timeSeries.createService",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "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] ",
"location": "path",
"pattern": "^projects/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v3/{+name}/timeSeries:createService",
"request": {
"$ref": "CreateTimeSeriesRequest"
},
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/monitoring.write"
]
},
"list": {
"description": "Lists time series that match a filter. This method does not require a Workspace.",
"flatPath": "v3/projects/{projectsId}/timeSeries",
Expand Down Expand Up @@ -2541,7 +2571,7 @@
}
}
},
"revision": "20210830",
"revision": "20210926",
"rootUrl": "https://monitoring.googleapis.com/",
"schemas": {
"Aggregation": {
Expand Down Expand Up @@ -2726,7 +2756,7 @@
"id": "AlertStrategy",
"properties": {
"autoClose": {
"description": "If an alert policy that was active has no data for this log, any open incidents will close",
"description": "If an alert policy that was active has no data for this long, any open incidents will close",
"format": "google-duration",
"type": "string"
},
Expand Down
153 changes: 152 additions & 1 deletion src/apis/monitoring/v3.ts
Expand Up @@ -212,7 +212,7 @@ export namespace monitoring_v3 {
*/
export interface Schema$AlertStrategy {
/**
* If an alert policy that was active has no data for this log, any open incidents will close
* If an alert policy that was active has no data for this long, any open incidents will close
*/
autoClose?: string | null;
/**
Expand Down Expand Up @@ -7229,6 +7229,145 @@ export namespace monitoring_v3 {
}
}

/**
* 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 projects.timeSeries.create instead.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/monitoring.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const monitoring = google.monitoring('v3');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [
* 'https://www.googleapis.com/auth/cloud-platform',
* 'https://www.googleapis.com/auth/monitoring',
* 'https://www.googleapis.com/auth/monitoring.write',
* ],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await monitoring.projects.timeSeries.createService({
* // 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]
* name: 'projects/my-project',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "timeSeries": []
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
createService(
params: Params$Resource$Projects$Timeseries$Createservice,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
createService(
params?: Params$Resource$Projects$Timeseries$Createservice,
options?: MethodOptions
): GaxiosPromise<Schema$Empty>;
createService(
params: Params$Resource$Projects$Timeseries$Createservice,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
createService(
params: Params$Resource$Projects$Timeseries$Createservice,
options: MethodOptions | BodyResponseCallback<Schema$Empty>,
callback: BodyResponseCallback<Schema$Empty>
): void;
createService(
params: Params$Resource$Projects$Timeseries$Createservice,
callback: BodyResponseCallback<Schema$Empty>
): void;
createService(callback: BodyResponseCallback<Schema$Empty>): void;
createService(
paramsOrCallback?:
| Params$Resource$Projects$Timeseries$Createservice
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Timeseries$Createservice;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Projects$Timeseries$Createservice;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v3/{+name}/timeSeries:createService').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Empty>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Empty>(parameters);
}
}

/**
* Lists time series that match a filter. This method does not require a Workspace.
* @example
Expand Down Expand Up @@ -7564,6 +7703,18 @@ export namespace monitoring_v3 {
*/
requestBody?: Schema$CreateTimeSeriesRequest;
}
export interface Params$Resource$Projects$Timeseries$Createservice
extends StandardParameters {
/**
* 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]
*/
name?: string;

/**
* Request body metadata
*/
requestBody?: Schema$CreateTimeSeriesRequest;
}
export interface Params$Resource$Projects$Timeseries$List
extends StandardParameters {
/**
Expand Down

0 comments on commit 7509670

Please sign in to comment.