2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2022-07-26 05:43:36 -07:00
|
|
|
|
|
|
|
export const metricsOperations: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
noDataExpression: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['metrics'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a specific metric',
|
|
|
|
routing: {
|
|
|
|
request: {
|
|
|
|
method: 'GET',
|
|
|
|
url: '={{"/api/metric/" + $parameter.metricId}}',
|
|
|
|
returnFullResponse: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
action: 'Get a metric',
|
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2022-07-26 05:43:36 -07:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Get many metrics',
|
2022-07-26 05:43:36 -07:00
|
|
|
routing: {
|
|
|
|
request: {
|
|
|
|
method: 'GET',
|
|
|
|
url: '/api/metric/',
|
|
|
|
},
|
|
|
|
},
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many metrics',
|
2022-07-26 05:43:36 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const metricsFields: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Metric ID',
|
|
|
|
name: 'metricId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
placeholder: '0',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: ['metrics'],
|
|
|
|
operation: ['get'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|