|
Since the configuration and its draft of an agent are now stored in the
Could you share your thoughts on this? |
Replies: 8 comments 15 replies
|
Since this part of code is still under construction, it might be a bit confusing. #[derive(Clone, Deserialize, Serialize, PartialEq)]
struct InnerSettings {
customer_id: u32,
description: String,
hostname: String,
giganto: Option<Giganto>,
}As shown above, settings for pub piglet: bool,
pub giganto: bool,
pub reconverge: bool,
pub hog: bool,we could:
|
|
It's my mistake that I omit the Giganto part in |
|
I think what I have in my mind is very similar with |
|
In other words, I suggest the following:
pub struct Agent {
pub node: u32,
pub key: String,
pub kind: Kind,
pub config: Option<Config>,
pub draft: Option<Config>,
pub enabled: bool, // added
}
struct Settings {
customer_id: u32,
description: String,
hostname: String,
giganto: Option<Giganto>,
giganto_enabled: bool, // added
}
struct Node {
id: u32,
name: String,
name_draft: Option<String>,
settings: Option<Settings>,
settings_draft: Option<Settings>,
creation_time: DateTime<Utc>,
agents: Vec<String>,
} |
struct Node {
...
giganto: Option<Giganto>,
}
struct Giganto { // Noted as Giganto2
status: bool,
config: Option<Config>,
draft: Option<Config>,
}I understand your plan on this and agree with you, except for the |
|
To ensure we are on the same page, I reiterate the following: pub struct Agent {
pub node: u32,
pub key: String,
pub kind: Kind,
pub status: Status,
pub config: Option<Config>,
pub draft: Option<Config>,
}
struct Settings {
customer_id: u32,
description: String,
hostname: String,
}
pub struct Node {
pub id: u32,
pub name: String,
pub name_draft: Option<String>,
pub settings: Option<Settings>,
pub settings_draft: Option<Settings>,
pub creation_time: DateTime<Utc>,
agents: Vec<String>,
giganto: Option<Giganto>,
}
struct Giganto {
status: Status,
draft: Option<Config>,
}Now, I feel like we need to rename struct Profile {
customer_id: u32,
description: String,
hostname: String,
}
pub struct Node {
pub id: u32,
pub name: String,
pub name_draft: Option<String>,
pub profile: Option<Profile>,
pub profile_draft: Option<Profile>,
pub creation_time: DateTime<Utc>,
agents: Vec<String>,
giganto: Option<Giganto>,
}Could you give your thoughts on this? |
|
@minshao Hello, I have one question regarding What's your suggestion for me to use instead of |
|
@minshao |
I've finished the change to expose the new API in review-database, with some touch ups, I'll make a PR today. However, that does not include Giganto modification yet. It will be included in the next PR.