mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-30 06:59:41 -08:00
25 lines
691 B
TypeScript
25 lines
691 B
TypeScript
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;
|
|
}
|