@takashito/linode-mcp-server
Version:
MCP server for Linode API
161 lines (160 loc) • 5.48 kB
TypeScript
import { AxiosInstance } from 'axios';
import { PaginatedResponse, PaginationParams } from './common';
/**
* Interface for a Notification Channel
*/
export interface NotificationChannel {
id: number;
label: string;
type: string;
channel_data: Record<string, any>;
created: string;
updated: string;
}
/**
* Interface for creating a Notification Channel
*/
export interface CreateNotificationChannelRequest {
label: string;
type: string;
channel_data: Record<string, any>;
}
/**
* Interface for updating a Notification Channel
*/
export interface UpdateNotificationChannelRequest {
label?: string;
type?: string;
channel_data?: Record<string, any>;
}
/**
* Interface for an Alert Definition
*/
export interface AlertDefinition {
id: number;
label: string;
description: string;
service_type: string;
severity: number;
trigger_conditions: Record<string, any>;
channel_ids: number[];
entity_ids: string[];
created: string;
updated: string;
enabled: boolean;
}
/**
* Interface for creating an Alert Definition
*/
export interface CreateAlertDefinitionRequest {
label: string;
description?: string;
severity?: number;
trigger_conditions: Record<string, any>;
channel_ids?: number[];
entity_ids?: string[];
enabled?: boolean;
}
/**
* Interface for updating an Alert Definition
*/
export interface UpdateAlertDefinitionRequest {
label?: string;
description?: string;
severity?: number;
trigger_conditions?: Record<string, any>;
channel_ids?: number[];
entity_ids?: string[];
enabled?: boolean;
}
/**
* Client for Linode Monitor Alerts API
*/
export interface MonitorAlertsClient {
/**
* List all notification channels
* @param params - Pagination parameters
* @returns A paginated list of notification channels
*/
getNotificationChannels(params?: PaginationParams): Promise<PaginatedResponse<NotificationChannel>>;
/**
* Get a specific notification channel
* @param channelId - The ID of the notification channel
* @returns The notification channel object
*/
getNotificationChannel(channelId: number): Promise<NotificationChannel>;
/**
* Create a new notification channel
* @param data - The data for the new notification channel
* @returns The newly created notification channel
*/
createNotificationChannel(data: CreateNotificationChannelRequest): Promise<NotificationChannel>;
/**
* Update a notification channel
* @param channelId - The ID of the notification channel
* @param data - The data to update
* @returns The updated notification channel
*/
updateNotificationChannel(channelId: number, data: UpdateNotificationChannelRequest): Promise<NotificationChannel>;
/**
* Delete a notification channel
* @param channelId - The ID of the notification channel
* @returns Empty response on success
*/
deleteNotificationChannel(channelId: number): Promise<{}>;
/**
* List alerts for a notification channel
* @param channelId - The ID of the notification channel
* @param params - Pagination parameters
* @returns A paginated list of alerts for the channel
*/
getChannelAlerts(channelId: number, params?: PaginationParams): Promise<PaginatedResponse<AlertDefinition>>;
/**
* List all alert definitions
* @param params - Pagination parameters
* @returns A paginated list of alert definitions
*/
getAlertDefinitions(params?: PaginationParams): Promise<PaginatedResponse<AlertDefinition>>;
/**
* List alert definitions for a specific service type
* @param serviceType - The service type
* @param params - Pagination parameters
* @returns A paginated list of alert definitions for the service type
*/
getServiceAlertDefinitions(serviceType: string, params?: PaginationParams): Promise<PaginatedResponse<AlertDefinition>>;
/**
* Get a specific alert definition
* @param serviceType - The service type
* @param alertId - The ID of the alert definition
* @returns The alert definition object
*/
getAlertDefinition(serviceType: string, alertId: number): Promise<AlertDefinition>;
/**
* Create a new alert definition
* @param serviceType - The service type
* @param data - The data for the new alert definition
* @returns The newly created alert definition
*/
createAlertDefinition(serviceType: string, data: CreateAlertDefinitionRequest): Promise<AlertDefinition>;
/**
* Update an alert definition
* @param serviceType - The service type
* @param alertId - The ID of the alert definition
* @param data - The data to update
* @returns The updated alert definition
*/
updateAlertDefinition(serviceType: string, alertId: number, data: UpdateAlertDefinitionRequest): Promise<AlertDefinition>;
/**
* Delete an alert definition
* @param serviceType - The service type
* @param alertId - The ID of the alert definition
* @returns Empty response on success
*/
deleteAlertDefinition(serviceType: string, alertId: number): Promise<{}>;
}
/**
* Create a new Monitor Alerts client
* @param axios - The Axios instance for API calls
* @returns A new Monitor Alerts client
*/
export declare function createMonitorAlertsClient(axios: AxiosInstance): MonitorAlertsClient;