Refactor network element state management - Removed the NE state endpoint and related service logic from the network_data module. - Introduced a new NEStateController to handle network element state records. - Implemented NEState service and repository for managing state records in the database. - Updated NEInfo and NeLicense controllers to utilize the new NEState service for fetching and saving state information. - Enhanced state handling in the websocket processor to reflect the latest state of network elements. - Added caching logic for network element states using Redis. - Improved error handling and response formatting for state queries.
30 lines
1.7 KiB
SQL
30 lines
1.7 KiB
SQL
--
|
|
-- Table structure for table `ne_state`
|
|
--
|
|
DROP TABLE IF EXISTS `ne_state`;
|
|
CREATE TABLE `ne_state` (
|
|
`id` int NOT NULL AUTO_INCREMENT,
|
|
`ne_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元类型',
|
|
`ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元ID',
|
|
`ne_version` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元版本',
|
|
`standby` int DEFAULT '0' COMMENT '主备状态 0-主 1-备',
|
|
`nb_number` int DEFAULT '0' COMMENT '基站容量',
|
|
`ue_number` int DEFAULT '0' COMMENT '用户容量',
|
|
`serial_num` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '序列号',
|
|
`expiry_date` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '许可证到期日期',
|
|
`hostname` varchar(32) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '主机名 hostname',
|
|
`os` varchar(196) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '操作系统 uname',
|
|
`sys_cpu_usage` float DEFAULT '0' COMMENT 'cpu使用率-sys',
|
|
`sys_mem_usage` float DEFAULT '0' COMMENT '内存使用率-sys',
|
|
`sys_disk_usage` float DEFAULT '0' COMMENT '磁盘使用率-sys',
|
|
`nf_cpu_usage` float DEFAULT '0' COMMENT 'cpu使用率-nf',
|
|
`nf_mem_used` bigint DEFAULT '0' COMMENT '内存使用KB-nf',
|
|
`refresh_time` bigint DEFAULT '0' COMMENT '刷新时间',
|
|
PRIMARY KEY (`id`) USING BTREE,
|
|
KEY `idx_type_id_time` (`ne_type`,`ne_id`,`refresh_time`) USING BTREE COMMENT 'idx_state_ne_type_id_at'
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_状态记录内存/CPU/磁盘';
|
|
|
|
-- ----------------------------
|
|
-- COLUMN for ne_state
|
|
-- ----------------------------
|