first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import type { RmmProperties } from '../../Interfaces';
|
||||
|
||||
export const rmmMuteDescription: RmmProperties = [
|
||||
{
|
||||
displayName: 'RMM Alert ID',
|
||||
name: 'alertId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['rmm'],
|
||||
operation: ['mute'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Mute the RMM alert by ID',
|
||||
},
|
||||
{
|
||||
displayName: 'Mute Period',
|
||||
name: 'muteFor',
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['rmm'],
|
||||
operation: ['mute'],
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
|
||||
options: [
|
||||
{
|
||||
name: '1 Hour',
|
||||
value: '1-hour',
|
||||
},
|
||||
{
|
||||
name: '1 Day',
|
||||
value: '1-day',
|
||||
},
|
||||
{
|
||||
name: '2 Days',
|
||||
value: '2-days',
|
||||
},
|
||||
{
|
||||
name: '1 Week',
|
||||
value: '1-week',
|
||||
},
|
||||
{
|
||||
name: '2 Weeks',
|
||||
value: '2-weeks',
|
||||
},
|
||||
{
|
||||
name: '1 Month',
|
||||
value: '1-month',
|
||||
},
|
||||
{
|
||||
name: 'Forever',
|
||||
value: 'forever',
|
||||
},
|
||||
],
|
||||
default: '',
|
||||
description: 'Length of time to mute alert for',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,22 @@
|
||||
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
|
||||
|
||||
import { apiRequest } from '../../../transport';
|
||||
|
||||
export async function muteAlert(
|
||||
this: IExecuteFunctions,
|
||||
index: number,
|
||||
): Promise<INodeExecutionData[]> {
|
||||
const id = this.getNodeParameter('alertId', index) as string;
|
||||
const mute = this.getNodeParameter('muteFor', index) as string;
|
||||
|
||||
const qs = {} as IDataObject;
|
||||
const requestMethod = 'POST';
|
||||
const endpoint = `rmm_alerts/${id}/mute`;
|
||||
const body = {} as IDataObject;
|
||||
|
||||
body.id = id;
|
||||
body.mute_for = mute;
|
||||
|
||||
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
return this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { rmmMuteDescription as description } from './description';
|
||||
import { muteAlert as execute } from './execute';
|
||||
|
||||
export { description, execute };
|
||||
Reference in New Issue
Block a user