@takashito/linode-mcp-server
Version:
MCP server for Linode API
111 lines (110 loc) • 3.41 kB
TypeScript
import { AxiosInstance } from 'axios';
import { PaginatedResponse, PaginationParams } from './common';
/**
* Interface for a Monitor Dashboard
*/
export interface MonitorDashboard {
id: number;
label: string;
service_type: string;
type: string;
widgets: Record<string, any>[];
created: string;
updated: string;
}
/**
* Interface for a Monitor Service
*/
export interface MonitorService {
service_type: string;
label: string;
}
/**
* Interface for a Metric Definition
*/
export interface MetricDefinition {
metric: string;
label: string;
metric_type: string;
unit: string;
scrape_interval: string;
is_alertable: boolean;
dimensions: Record<string, any>[];
available_aggregate_functions: string[];
}
/**
* Interface for requesting service metrics
*/
export interface GetServiceMetricsRequest {
entity_ids: number[];
start_time: string;
end_time: string;
time_granularity?: Record<string, any>;
}
/**
* Interface for a service token response
*/
export interface ServiceToken {
token: string;
}
/**
* Client for Linode Monitor Metrics API
*/
export interface MonitorMetricsClient {
/**
* List all monitor dashboards
* @param params - Pagination parameters
* @returns A paginated list of dashboards
*/
listDashboards(params?: PaginationParams): Promise<PaginatedResponse<MonitorDashboard>>;
/**
* Get a specific dashboard
* @param dashboardId - The ID of the dashboard
* @returns The dashboard object
*/
getDashboard(dashboardId: number): Promise<MonitorDashboard>;
/**
* List supported service types
* @param params - Pagination parameters
* @returns A paginated list of service types
*/
listServices(params?: PaginationParams): Promise<PaginatedResponse<MonitorService>>;
/**
* Get details for a supported service type
* @param serviceType - The service type
* @returns The service type details
*/
getService(serviceType: string): Promise<MonitorService>;
/**
* List dashboards for a service type
* @param serviceType - The service type
* @param params - Pagination parameters
* @returns A paginated list of dashboards for the service type
*/
listServiceDashboards(serviceType: string, params?: PaginationParams): Promise<PaginatedResponse<MonitorDashboard>>;
/**
* List metric definitions for a service type
* @param serviceType - The service type
* @returns A paginated list of metric definitions
*/
listServiceMetricDefinitions(serviceType: string): Promise<PaginatedResponse<MetricDefinition>>;
/**
* Get metrics for entities of a service type
* @param serviceType - The service type
* @param data - The metrics request body
* @returns The metrics data
*/
getServiceMetrics(serviceType: string, data: GetServiceMetricsRequest): Promise<Record<string, any>>;
/**
* Create a token for a service type
* @param serviceType - The service type
* @returns The service token
*/
createServiceToken(serviceType: string): Promise<ServiceToken>;
}
/**
* Create a new Monitor Metrics client
* @param axios - The Axios instance for API calls
* @returns A new Monitor Metrics client
*/
export declare function createMonitorMetricsClient(axios: AxiosInstance): MonitorMetricsClient;