Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new graphql qeury #112

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Added three new GraphQL API methods for triage:
- `insert_triage_result`: This new method store triage result.
- `event_list_with_triage`: This new method return event with triage result.
- `insert_event_with_triage`: This new method store event and triage result.
- Added two new GraphQL API methods for rio's ranked outlier:
- `insert_central_ranked_outlier`: This new method store `CentralRankedOutlier`.
- `central_ranked_outliers`: This new method search `CentralRankedOutlier`.
- Added three new GraphQL API methods for semi-supervised model:
- `semi_model_list`: This new method returns a list of semi-supervised models.
- `insert_semi_model`: This new method insert the semi-supervised model into a
`semi models` table.
- `remove_semi_models`: This new method removes the semi-supervised model from
the `semi models` table.
- `apply_semi_model`: This new method broadcast the semi-supervised model list
to all hogs.
- `download_semi_models`: This new method update the `semi models` table with
the semi-supervised model downloaded to the relay server.
- Added `agent_id` for filtering agent id to `EventListWithTriageFilterInput`.
- Added new fields to the sampling policy's enum Interval.
(`FifteenSeconds`, `ThirtySeconds`, `OneMinutes`)

## [0.17.0] - 2024-01-19

### Added
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "review-web"
version = "0.17.0"
version = "0.17.0-rio.0.0.1"
edition = "2021"

[dependencies]
Expand All @@ -21,11 +21,11 @@ ipnet = { version = "2", features = ["serde"] }
jsonwebtoken = "9"
lazy_static = "1"
num-traits = "0.2"
oinq = { git = "https://github.com/petabi/oinq.git", tag = "0.9.1" }
oinq = { git = "https://github.com/petabi/oinq.git", tag = "0.9.2" }
reqwest = { version = "0.11", default-features = false, features = [
"rustls-tls-native-roots",
] }
review-database = { git = "https://github.com/petabi/review-database.git", tag = "0.23.0" }
review-database = { git = "https://github.com/petabi/review-database.git", rev ="4cf2c7d" }
roxy = { git = "https://github.com/aicers/roxy.git", tag = "0.2.1" }
rustls = "0.21"
rustls-native-certs = "0.6"
Expand Down
4 changes: 4 additions & 0 deletions examples/minireview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ impl AgentManager for Manager {
bail!("Not supported")
}

async fn broadcast_semi_model_list(&self, _list: &[u8]) -> Result<(), anyhow::Error> {
bail!("Not supported")
}

async fn broadcast_trusted_user_agent_list(&self, _list: &[u8]) -> Result<(), anyhow::Error> {
bail!("Not supported")
}
Expand Down
10 changes: 10 additions & 0 deletions src/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mod node;
mod outlier;
mod qualifier;
mod sampling;
mod semi_model;
mod slicing;
mod statistics;
mod status;
Expand All @@ -39,6 +40,7 @@ pub use self::block_network::get_block_networks;
pub use self::cert::ParsedCertificate;
pub use self::customer::get_customer_networks;
pub use self::node::{get_customer_id_of_review_host, get_node_settings};
pub use self::semi_model::{get_semi_model_list, SemiModelInfo};
pub use self::trusted_user_agent::get_trusted_user_agent_list;
use async_graphql::{
connection::{Connection, Edge, EmptyFields},
Expand Down Expand Up @@ -81,6 +83,7 @@ pub trait AgentManager: Send + Sync {
_networks: &[u8],
) -> Result<Vec<String>, anyhow::Error>;
async fn broadcast_trusted_user_agent_list(&self, _list: &[u8]) -> Result<(), anyhow::Error>;
async fn broadcast_semi_model_list(&self, _list: &[u8]) -> Result<(), anyhow::Error>;
async fn online_apps_by_host_id(
&self,
) -> Result<HashMap<String, Vec<(String, String)>>, anyhow::Error>;
Expand Down Expand Up @@ -185,6 +188,7 @@ pub(super) struct Query(
triage::TriagePolicyQuery,
triage::TriageResponseQuery,
trusted_domain::TrustedDomainQuery,
semi_model::SemiModelQuery,
traffic_filter::TrafficFilterQuery,
allow_network::AllowNetworkQuery,
trusted_user_agent::UserAgentQuery,
Expand All @@ -204,6 +208,7 @@ pub(super) struct Mutation(
customer::CustomerMutation,
data_source::DataSourceMutation,
db_management::DbManagementMutation,
event::EventMutation,
filter::FilterMutation,
indicator::IndicatorMutation,
model::ModelMutation,
Expand All @@ -221,7 +226,9 @@ pub(super) struct Mutation(
tidb::TidbMutation,
triage::TriagePolicyMutation,
triage::TriageResponseMutation,
triage::TriageMutation,
trusted_domain::TrustedDomainMutation,
semi_model::SemiModelMutation,
traffic_filter::TrafficFilterMutation,
allow_network::AllowNetworkMutation,
trusted_user_agent::UserAgentMutation,
Expand Down Expand Up @@ -515,6 +522,9 @@ impl AgentManager for MockAgentManager {
async fn broadcast_trusted_user_agent_list(&self, _list: &[u8]) -> Result<(), anyhow::Error> {
unimplemented!()
}
async fn broadcast_semi_model_list(&self, _list: &[u8]) -> Result<(), anyhow::Error> {
unimplemented!()
}
async fn broadcast_internal_networks(
&self,
_networks: &[u8],
Expand Down
Loading