diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc1144..ba89da6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,18 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- Added the `TimeSeriesGenerator` variant to the `AgentKind` enum. + ### Changed - Modified `applyNode` GraphQL API logic to prevent notifying agents that are operating with local configuration. - Updated `updateNodeDraft` GraphQL API to no longer require `config` in `NodeDraftInput::agents`. +- Updated review-database to 0.32.0. +- Renamed `AgentKind` enum variants to align with review-database. ## [0.23.0] - 2024-10-23 diff --git a/Cargo.toml b/Cargo.toml index 5aa8a19..a482933 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ num-traits = "0.2" reqwest = { version = "0.12", default-features = false, features = [ "rustls-tls-native-roots", ] } -review-database = { git = "https://github.com/petabi/review-database.git", tag = "0.31.0" } +review-database = { git = "https://github.com/petabi/review-database.git", tag = "0.32.0" } roxy = { git = "https://github.com/aicers/roxy.git", tag = "0.3.0" } rustls = { version = "0.23", default-features = false, features = [ "ring", diff --git a/src/graphql.rs b/src/graphql.rs index fb2c26f..9cb3717 100644 --- a/src/graphql.rs +++ b/src/graphql.rs @@ -593,22 +593,25 @@ impl AgentManager for MockAgentManager { &self, _networks: &HostNetworkGroup, ) -> Result, anyhow::Error> { - Ok(vec!["hog@hostA".to_string()]) + Ok(vec!["semi-supervised@hostA".to_string()]) } async fn broadcast_allow_networks( &self, _networks: &HostNetworkGroup, ) -> Result, anyhow::Error> { - Ok(vec!["hog@hostA".to_string(), "hog@hostB".to_string()]) + Ok(vec![ + "semi-supervised@hostA".to_string(), + "semi-supervised@hostB".to_string(), + ]) } async fn broadcast_block_networks( &self, _networks: &HostNetworkGroup, ) -> Result, anyhow::Error> { Ok(vec![ - "hog@hostA".to_string(), - "hog@hostB".to_string(), - "hog@hostC".to_string(), + "semi-supervised@hostA".to_string(), + "semi-supervised@hostB".to_string(), + "semi-supervised@hostC".to_string(), ]) } async fn online_apps_by_host_id( diff --git a/src/graphql/event.rs b/src/graphql/event.rs index b7d4c87..76ee98e 100644 --- a/src/graphql/event.rs +++ b/src/graphql/event.rs @@ -1297,8 +1297,8 @@ mod tests { description: "This is the collector node", hostname: "collector1", agents: [{ - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED }] giganto: null @@ -1323,8 +1323,8 @@ mod tests { } agents: [ { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED" } ], diff --git a/src/graphql/node.rs b/src/graphql/node.rs index 8a6e7a1..6e492d3 100644 --- a/src/graphql/node.rs +++ b/src/graphql/node.rs @@ -107,9 +107,10 @@ impl TryFrom<&NicInput> for Nic { #[derive(Clone, Deserialize, PartialEq, Serialize, Copy, Eq, Enum)] #[graphql(remote = "database::AgentKind")] pub enum AgentKind { - Reconverge, - Piglet, - Hog, + Unsupervised, + Sensor, + SemiSupervised, + TimeSeriesGenerator, } #[derive(Clone, PartialEq, Deserialize, Serialize, Enum, Copy, Eq)] diff --git a/src/graphql/node/control.rs b/src/graphql/node/control.rs index 59cbd5a..14914b0 100644 --- a/src/graphql/node/control.rs +++ b/src/graphql/node/control.rs @@ -293,10 +293,11 @@ mod tests { use crate::graphql::{AgentManager, BoxedAgentManager, SamplingPolicy, TestSchema}; #[tokio::test] + #[allow(clippy::too_many_lines)] async fn test_apply_node() { let agent_manager: BoxedAgentManager = Box::new(MockAgentManager { online_apps_by_host_id: HashMap::new(), - available_agents: vec!["reconverge@all-in-one", "piglet@all-in-one"], + available_agents: vec!["unsupervised@all-in-one", "sensor@all-in-one"], }); let schema = TestSchema::new_with(agent_manager, None).await; @@ -315,15 +316,15 @@ mod tests { description: "This is the admin node running review.", hostname: "all-in-one", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "test = 'toml'" }, { - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED config: null draft: "test = 'toml'" @@ -394,16 +395,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": null, "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": null, "draft": "test = 'toml'" @@ -434,15 +435,15 @@ mod tests { }, agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, config: null, draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, config: null, draft: "test = 'toml'" @@ -519,16 +520,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" @@ -563,15 +564,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" @@ -588,14 +589,14 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, draft: "test = 'toml'" } @@ -672,16 +673,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" @@ -716,15 +717,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" @@ -801,16 +802,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" @@ -845,15 +846,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" @@ -870,14 +871,14 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, draft: "test = 'toml'" } @@ -915,15 +916,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" @@ -1005,16 +1006,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" @@ -1031,7 +1032,7 @@ mod tests { }) ); - // update piglet draft + // update sensor draft let res = schema .execute( r#"mutation { @@ -1052,15 +1053,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, config: "test = 'toml'", draft: "test = 'toml'" @@ -1080,14 +1081,14 @@ mod tests { } agents: [ { - key: "reconverge", - kind: RECONVERGE, + key: "unsupervised", + kind: UNSUPERVISED, status: ENABLED, draft: "test = 'toml'" }, { - key: "piglet", - kind: PIGLET, + key: "sensor", + kind: SENSOR, status: ENABLED, draft: "test = 'changed_toml'" } @@ -1168,16 +1169,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'changed_toml'" @@ -1215,15 +1216,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: "test = 'toml'", draft: "test = 'changed_toml'" @@ -1305,16 +1306,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": "test = 'changed_toml'", "draft": "test = 'changed_toml'" @@ -1331,7 +1332,7 @@ mod tests { }) ); - // update node to disable one of the agents (piglet@all-in-one) in next apply + // update node to disable one of the agents (sensor@all-in-one) in next apply let res = schema .execute( r#"mutation { @@ -1352,15 +1353,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: "test = 'changed_toml'", draft: "test = 'changed_toml'" @@ -1380,14 +1381,14 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", draft: null } @@ -1401,6 +1402,7 @@ mod tests { }"#, ) .await; + assert_eq!(res.data.to_string(), r#"{updateNodeDraft: "0"}"#); // check node list after update @@ -1467,16 +1469,16 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" }, { "node": 0, - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": "test = 'changed_toml'", "draft": null @@ -1493,7 +1495,7 @@ mod tests { }) ); - // apply node - expected to update db and notify agent, and also piglet is expected to be + // apply node - expected to update db and notify agent, and also sensor is expected to be // removed from the `agents` vector. let res = schema .execute( @@ -1515,15 +1517,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: "test = 'toml'", draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: "test = 'changed_toml'", draft: null @@ -1604,8 +1606,8 @@ mod tests { "agents": [ { "node": 0, - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": "test = 'toml'", "draft": "test = 'toml'" @@ -1644,8 +1646,8 @@ mod tests { description: "This is the admin node running review.", hostname: "all-in-one", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "" @@ -1674,8 +1676,8 @@ mod tests { }, agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: "" @@ -1694,7 +1696,7 @@ mod tests { async fn test_apply_node_error_due_to_invalid_drafts() { let agent_manager: BoxedAgentManager = Box::new(MockAgentManager { online_apps_by_host_id: HashMap::new(), - available_agents: vec!["reconverge@all-in-one", "piglet@all-in-one"], + available_agents: vec!["unsupervised@all-in-one", "sensor@all-in-one"], }); let schema = TestSchema::new_with(agent_manager, None).await; @@ -1709,15 +1711,15 @@ mod tests { description: "This is the admin node running review.", hostname: "all-in-one", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "test = 'toml'" }, { - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED config: null draft: "test = 'toml'" @@ -1761,15 +1763,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: null, draft: "test = 'toml'" @@ -1790,7 +1792,7 @@ mod tests { async fn test_apply_node_error_due_to_different_node_input() { let agent_manager: BoxedAgentManager = Box::new(MockAgentManager { online_apps_by_host_id: HashMap::new(), - available_agents: vec!["reconverge@all-in-one", "piglet@all-in-one"], + available_agents: vec!["unsupervised@all-in-one", "sensor@all-in-one"], }); let schema = TestSchema::new_with(agent_manager, None).await; @@ -1805,15 +1807,15 @@ mod tests { description: "This is the admin node running review.", hostname: "all-in-one", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "test = 'toml'" }, { - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED config: null draft: "test = 'toml'" @@ -1842,15 +1844,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: null, draft: "test = 'different_toml'" @@ -1871,7 +1873,7 @@ mod tests { async fn test_apply_node_empty_hostname() { let agent_manager: BoxedAgentManager = Box::new(MockAgentManager { online_apps_by_host_id: HashMap::new(), - available_agents: vec!["reconverge@all-in-one", "piglet@all-in-one"], + available_agents: vec!["unsupervised@all-in-one", "sensor@all-in-one"], }); let schema = TestSchema::new_with(agent_manager, None).await; @@ -1886,15 +1888,15 @@ mod tests { description: "This is the admin node running review.", hostname: "", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "test = 'toml'" }, { - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED config: null draft: "test = 'toml'" @@ -1923,15 +1925,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: null, draft: "test = 'toml'" @@ -1966,15 +1968,15 @@ mod tests { description: "This is the admin node running review.", hostname: "all-in-one", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "test = 'toml'" }, { - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED config: null draft: "test = 'toml'" @@ -2003,15 +2005,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: null, draft: "test = 'toml'" @@ -2048,7 +2050,7 @@ mod tests { &self, _networks: &HostNetworkGroup, ) -> Result, anyhow::Error> { - Ok(vec!["hog@hostA".to_string()]) + Ok(vec!["semi-supervised@hostA".to_string()]) } async fn broadcast_allow_networks( @@ -2220,11 +2222,15 @@ mod tests { #[tokio::test] async fn test_node_shutdown() { let mut online_apps_by_host_id = HashMap::new(); - insert_apps("analysis", &["hog"], &mut online_apps_by_host_id); + insert_apps( + "analysis", + &["semi-supervised"], + &mut online_apps_by_host_id, + ); let agent_manager: BoxedAgentManager = Box::new(MockAgentManager { online_apps_by_host_id, - available_agents: vec!["hog@analysis"], + available_agents: vec!["semi-supervised@analysis"], }); let schema = TestSchema::new_with(agent_manager, None).await; diff --git a/src/graphql/node/crud.rs b/src/graphql/node/crud.rs index 498691b..4e9f4ad 100644 --- a/src/graphql/node/crud.rs +++ b/src/graphql/node/crud.rs @@ -198,6 +198,7 @@ mod tests { // test scenario : insert node -> update node with different name -> remove node #[tokio::test] + #[allow(clippy::too_many_lines)] async fn node_crud() { let schema = TestSchema::new().await; @@ -215,15 +216,15 @@ mod tests { description: "This is the admin node running review.", hostname: "admin.aice-security.com", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "test = 'toml'" }, { - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED config: null draft: "test = 'toml'" @@ -285,15 +286,15 @@ mod tests { "hostname": "admin.aice-security.com", }, "agents": [{ - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": null, "draft": "test = 'toml'" }, { - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": null, "draft": "test = 'toml'" @@ -320,15 +321,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: "test = 'toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: null, draft: "test = 'toml'" @@ -345,14 +346,14 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", draft: "test = 'changed_toml'" }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", draft: "test = 'changed_toml'" } @@ -411,15 +412,15 @@ mod tests { "hostname": "admin.aice-security.com", }, "agents": [{ - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", "config": null, "draft": "test = 'changed_toml'" }, { - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", "config": null, "draft": "test = 'changed_toml'" @@ -445,15 +446,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: null }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: null, draft: null @@ -489,6 +490,7 @@ mod tests { } #[tokio::test] + #[allow(clippy::too_many_lines)] async fn update_node_name() { let schema = TestSchema::new().await; @@ -506,13 +508,13 @@ mod tests { description: "This is the admin node running review.", hostname: "admin.aice-security.com", agents: [{ - key: "reconverge" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED }, { - key: "piglet" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED }] giganto: null @@ -570,13 +572,13 @@ mod tests { "hostname": "admin.aice-security.com", }, "agents": [{ - "key": "reconverge", - "kind": "RECONVERGE", + "key": "unsupervised", + "kind": "UNSUPERVISED", "status": "ENABLED", }, { - "key": "piglet", - "kind": "PIGLET", + "key": "sensor", + "kind": "SENSOR", "status": "ENABLED", }], "giganto": null @@ -601,15 +603,15 @@ mod tests { } agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", config: null, draft: null }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", config: null, draft: null @@ -621,14 +623,14 @@ mod tests { nameDraft: "AdminNode", agents: [ { - key: "reconverge", - kind: "RECONVERGE", + key: "unsupervised", + kind: "UNSUPERVISED", status: "ENABLED", draft: null }, { - key: "piglet", - kind: "PIGLET", + key: "sensor", + kind: "SENSOR", status: "ENABLED", draft: null } diff --git a/src/graphql/node/status.rs b/src/graphql/node/status.rs index 376fac8..866cf35 100644 --- a/src/graphql/node/status.rs +++ b/src/graphql/node/status.rs @@ -202,12 +202,12 @@ mod tests { let manager_hostname = roxy::hostname(); // Current machine's hostname is the Manager server's hostname. insert_apps( manager_hostname.as_str(), - &["features"], + &["sensor"], &mut online_apps_by_host_id, ); insert_apps( "analysis", - &["models", "learner"], + &["semi-supervised", "unsupervised"], &mut online_apps_by_host_id, ); @@ -232,8 +232,8 @@ mod tests { hostname: "{}", agents: [ {{ - key: "features" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED draft: "my_val=1" }} @@ -263,8 +263,8 @@ mod tests { }}, agents: [ {{ - key: "features" - kind: PIGLET + key: "sensor" + kind: SENSOR status: ENABLED config: null draft: "my_val=1" @@ -286,17 +286,17 @@ mod tests { insertNode( name: "node2", customerId: 0, - description: "This is the node for the Learner and the Models module.", + description: "This is the node for the Unsupervised and the Semi-supervised module.", hostname: "analysis", agents: [{ - key: "learner" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED draft: "my_val=2" }, { - key: "models" - kind: HOG + key: "semi-supervised" + kind: SEMI_SUPERVISED status: ENABLED draft: "my_val=2" }] @@ -318,19 +318,19 @@ mod tests { profile: null, profileDraft: { customerId: 0, - description: "This is the node for the Learner and the Models module.", + description: "This is the node for the Unsupervised and the Semi-supervised module.", hostname: "analysis" }, agents: [{ - key: "learner" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED config: null draft: "my_val=2" }, { - key: "models" - kind: HOG + key: "semi-supervised" + kind: SEMI_SUPERVISED status: ENABLED config: null draft: "my_val=2" @@ -407,7 +407,7 @@ mod tests { "manager": true, "agents": [ { - "kind": "PIGLET", + "kind": "SENSOR", "storedStatus": "ENABLED", "config": "my_val=1", "draft": "my_val=1", @@ -421,12 +421,12 @@ mod tests { "nameDraft": "node2", "profile": { "customerId": "0", - "description": "This is the node for the Learner and the Models module.", + "description": "This is the node for the Unsupervised and the Semi-supervised module.", "hostname": "analysis" }, "profileDraft": { "customerId": "0", - "description": "This is the node for the Learner and the Models module.", + "description": "This is the node for the Unsupervised and the Semi-supervised module.", "hostname": "analysis" }, "gigantoDraft": null, @@ -439,13 +439,13 @@ mod tests { "manager": false, "agents": [ { - "kind": "RECONVERGE", + "kind": "UNSUPERVISED", "storedStatus": "ENABLED", "config": "my_val=2", "draft": "my_val=2" }, { - "kind": "HOG", + "kind": "SEMI_SUPERVISED", "storedStatus": "ENABLED", "config": "my_val=2", "draft": "my_val=2" @@ -462,10 +462,10 @@ mod tests { #[tokio::test] async fn check_node_status_list_ordering() { let mut online_apps_by_host_id = HashMap::new(); - insert_apps("collect", &["features"], &mut online_apps_by_host_id); + insert_apps("collect", &["sensor"], &mut online_apps_by_host_id); insert_apps( "analysis", - &["models", "learner"], + &["semi-supervised", "unsupervised"], &mut online_apps_by_host_id, ); @@ -482,16 +482,16 @@ mod tests { insertNode( name: "test1", customerId: 0, - description: "This node has the Learner and the Models.", + description: "This node has the Unsupervised and the Semi-supervised.", hostname: "admin.aice-security.com", agents: [{ - key: "learner" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED }, { - key: "models" - kind: HOG + key: "semi-supervised" + kind: SEMI_SUPERVISED status: ENABLED }] giganto: null @@ -507,16 +507,16 @@ mod tests { insertNode( name: "test2", customerId: 0, - description: "This node has the Learner and the Models.", + description: "This node has the Unsupervised and the Semi-supervised.", hostname: "admin.aice-security.com", agents: [{ - key: "learner" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED }, { - key: "models" - kind: HOG + key: "semi-supervised" + kind: SEMI_SUPERVISED status: ENABLED }] giganto: null @@ -532,16 +532,16 @@ mod tests { insertNode( name: "test3", customerId: 0, - description: "This node has the Learner and the Models.", + description: "This node has the Unsupervised and the Semi-supervised.", hostname: "admin.aice-security.com", agents: [{ - key: "learner" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED }, { - key: "models" - kind: HOG + key: "semi-supervised" + kind: SEMI_SUPERVISED status: ENABLED }] giganto: null @@ -557,16 +557,16 @@ mod tests { insertNode( name: "test4", customerId: 0, - description: "This node has the Learner and the Models.", + description: "This node has the Unsupervised and the Semi-supervised.", hostname: "admin.aice-security.com", agents: [{ - key: "learner" - kind: RECONVERGE + key: "unsupervised" + kind: UNSUPERVISED status: ENABLED }, { - key: "models" - kind: HOG + key: "semi-supervised" + kind: SEMI_SUPERVISED status: ENABLED }] giganto: null @@ -582,11 +582,11 @@ mod tests { insertNode( name: "test5", customerId: 0, - description: "This node has the Features.", + description: "This node has the Sensor.", hostname: "admin.aice-security.com", agents: [{ - key: "features@collect" - kind: PIGLET + key: "sensor@collect" + kind: SENSOR status: ENABLED }] giganto: null