fix
This commit is contained in:
@@ -131,6 +131,8 @@ export interface HostMetricsSummary {
|
|||||||
timestamp?: string
|
timestamp?: string
|
||||||
has_data: boolean
|
has_data: boolean
|
||||||
memory?: HostMetricsUseStat
|
memory?: HostMetricsUseStat
|
||||||
|
/** Swap / 虚拟内存,与 dc-control /servers/metrics/summary 一致 */
|
||||||
|
swap?: HostMetricsUseStat
|
||||||
disk_root?: HostMetricsDiskMount
|
disk_root?: HostMetricsDiskMount
|
||||||
data_disks?: HostMetricsDiskMount[]
|
data_disks?: HostMetricsDiskMount[]
|
||||||
cpu?: HostMetricsCpuCard
|
cpu?: HostMetricsCpuCard
|
||||||
|
|||||||
@@ -170,6 +170,146 @@ export const fetchStorageMetricsLatest = (serviceIdentity: string) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 监控大屏:下拉列表(JWT,模糊 keyword) */
|
||||||
|
export interface StorageMonitorOptionItem {
|
||||||
|
service_identity: string
|
||||||
|
name: string
|
||||||
|
type: string
|
||||||
|
server_identity: string
|
||||||
|
status: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 监控大屏:汇总 current.host(与后端 storage_monitor 一致) */
|
||||||
|
export interface StorageMonitorSummaryHost {
|
||||||
|
has_data: boolean
|
||||||
|
cpu_usage_percent?: number | null
|
||||||
|
memory_usage_percent?: number | null
|
||||||
|
swap_usage_percent?: number | null
|
||||||
|
disk_root_used_percent?: number | null
|
||||||
|
disk_root_avail_percent?: number | null
|
||||||
|
host_server_identity?: string
|
||||||
|
host_summary_timestamp?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StorageMonitorSummaryCurrent {
|
||||||
|
service_identity: string
|
||||||
|
controller_status: string
|
||||||
|
server_identity: string
|
||||||
|
host?: StorageMonitorSummaryHost | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StorageMonitorSummaryPayload {
|
||||||
|
total_devices: number
|
||||||
|
online_count: number
|
||||||
|
offline_count: number
|
||||||
|
other_count: number
|
||||||
|
current?: StorageMonitorSummaryCurrent | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fetchStorageMonitorList = (params?: { keyword?: string; limit?: number }) => {
|
||||||
|
return request.get<{
|
||||||
|
code: number
|
||||||
|
details?: { data: StorageMonitorOptionItem[]; count: number }
|
||||||
|
message?: string
|
||||||
|
}>('/DC-Control/v1/storage/monitor/list', { params })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fetchStorageMonitorSummary = (serviceIdentity?: string) => {
|
||||||
|
return request.get<{
|
||||||
|
code: number
|
||||||
|
details?: StorageMonitorSummaryPayload
|
||||||
|
message?: string
|
||||||
|
}>('/DC-Control/v1/storage/monitor/summary', {
|
||||||
|
params: serviceIdentity ? { service_identity: serviceIdentity } : {},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 监控页:按存储设备 id 拉取最新一批中的指标名(趋势图下拉) */
|
||||||
|
export interface StorageMonitorCollectedMetricItem {
|
||||||
|
metric_name: string
|
||||||
|
metric_unit?: string
|
||||||
|
type?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StorageMonitorCollectedMetricsPayload {
|
||||||
|
service_identity: string
|
||||||
|
metrics: StorageMonitorCollectedMetricItem[]
|
||||||
|
count: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fetchStorageMonitorCollectedMetrics = (deviceId: number) => {
|
||||||
|
return request.get<{
|
||||||
|
code: number
|
||||||
|
details?: StorageMonitorCollectedMetricsPayload
|
||||||
|
message?: string
|
||||||
|
}>(`/DC-Control/v1/storage/monitor/metrics/collected/${deviceId}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 存储指标匿名聚合(告警/大屏用) */
|
||||||
|
export interface StorageMetricsAggregateParams {
|
||||||
|
service_identity: string
|
||||||
|
metric_name: string
|
||||||
|
start_time: string
|
||||||
|
end_time: string
|
||||||
|
aggregation: 'avg' | 'max' | 'min' | 'sum' | 'count'
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StorageMetricsAggregateDetails {
|
||||||
|
aggregation: string
|
||||||
|
value: number
|
||||||
|
service_identity: string
|
||||||
|
metric_name: string
|
||||||
|
category?: string
|
||||||
|
start_time: string
|
||||||
|
end_time: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 与 DC-Hardware GET /metrics/devices/:device_id 对齐:路径 service_identity,Query 可选 */
|
||||||
|
export interface StorageMetricsTimeseriesQuery {
|
||||||
|
start_time?: string
|
||||||
|
end_time?: string
|
||||||
|
metric_name?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 原始样本(control_storage_metrics_data) */
|
||||||
|
export interface StorageMetricsRawRow {
|
||||||
|
timestamp: string
|
||||||
|
service_identity: string
|
||||||
|
server_identity?: string
|
||||||
|
type: string
|
||||||
|
metric_name: string
|
||||||
|
metric_value: number
|
||||||
|
metric_unit?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fetchStorageMetricsAggregate = (params: StorageMetricsAggregateParams) => {
|
||||||
|
return request.get<{ code: number; details?: StorageMetricsAggregateDetails; message?: string }>(
|
||||||
|
'/DC-Control/v1/services/metrics/storage/aggregate',
|
||||||
|
{ params: { ...params, category: 'storage' } },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 存储指标时序原始点(JWT);路径为 service_identity,需 URL 编码 */
|
||||||
|
export const fetchStorageMetricsTimeseries = (
|
||||||
|
serviceIdentity: string,
|
||||||
|
params?: StorageMetricsTimeseriesQuery,
|
||||||
|
) => {
|
||||||
|
const path = encodeURIComponent(serviceIdentity)
|
||||||
|
return request.get<{
|
||||||
|
code: number
|
||||||
|
details?: {
|
||||||
|
service_identity: string
|
||||||
|
start_time: string
|
||||||
|
end_time: string
|
||||||
|
count: number
|
||||||
|
metrics: StorageMetricsRawRow[]
|
||||||
|
}
|
||||||
|
message?: string
|
||||||
|
}>(`/DC-Control/v1/storage/monitor/metrics/timeseries/${path}`, {
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/** 采集配置补丁 */
|
/** 采集配置补丁 */
|
||||||
export interface StoragePatchData {
|
export interface StoragePatchData {
|
||||||
collect_method?: 'api' | 'snmp'
|
collect_method?: 'api' | 'snmp'
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user