n8n/packages/nodes-base/nodes/Splunk/v2/actions/alert/getMetrics.operation.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
691 B
TypeScript
Raw Normal View History

2024-07-04 06:07:17 -07:00
import type { INodeProperties, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import { updateDisplayOptions } from '../../../../../utils/utilities';
import { splunkApiJsonRequest } from '../../transport';
const properties: INodeProperties[] = [];
const displayOptions = {
show: {
resource: ['alert'],
operation: ['getMetrics'],
},
};
export const description = updateDisplayOptions(displayOptions, properties);
export async function execute(
this: IExecuteFunctions,
_i: number,
): Promise<IDataObject | IDataObject[]> {
const endpoint = '/services/alerts/metric_alerts';
const returnData = await splunkApiJsonRequest.call(this, 'GET', endpoint);
return returnData;
}