Skip to main content

ic_query/nns/node/report/model/
report.rs

1#[cfg(feature = "host")]
2use crate::cache_file::JsonCacheReport;
3use serde::{Deserialize, Serialize};
4
5///
6/// NnsNodeListReport
7///
8#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
9pub struct NnsNodeListReport {
10    pub schema_version: u32,
11    pub network: String,
12    pub registry_canister_id: String,
13    pub registry_version: u64,
14    pub fetched_at: String,
15    pub source_endpoint: String,
16    pub fetched_by: String,
17    pub node_count: usize,
18    pub nodes: Vec<NnsNodeRow>,
19}
20
21#[cfg(feature = "host")]
22impl JsonCacheReport for NnsNodeListReport {
23    fn schema_version(&self) -> u32 {
24        self.schema_version
25    }
26
27    fn network(&self) -> &str {
28        &self.network
29    }
30}
31
32///
33/// NnsNodeRow
34///
35#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
36pub struct NnsNodeRow {
37    pub node_principal: String,
38    pub node_operator_principal: String,
39    pub node_provider_principal: String,
40    pub subnet_principal: String,
41    pub subnet_kind: String,
42    pub data_center_id: String,
43}
44
45///
46/// NnsNodeInfoReport
47///
48#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
49pub struct NnsNodeInfoReport {
50    pub schema_version: u32,
51    pub input: String,
52    pub resolved_from: String,
53    pub network: String,
54    pub registry_canister_id: String,
55    pub registry_version: u64,
56    pub fetched_at: String,
57    pub source_endpoint: String,
58    pub fetched_by: String,
59    pub node_principal: String,
60    pub node_operator_principal: String,
61    pub node_provider_principal: String,
62    pub subnet_principal: String,
63    pub subnet_kind: String,
64    pub data_center_id: String,
65}
66
67///
68/// NnsNodeRefreshReport
69///
70#[cfg(feature = "host")]
71#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
72pub struct NnsNodeRefreshReport {
73    pub schema_version: u32,
74    pub network: String,
75    pub cache_path: String,
76    pub refresh_lock_path: String,
77    pub output_path: Option<String>,
78    pub registry_canister_id: String,
79    pub registry_version: u64,
80    pub fetched_at: String,
81    pub source_endpoint: String,
82    pub fetched_by: String,
83    pub dry_run: bool,
84    pub wrote_cache: bool,
85    pub replaced_existing_cache: bool,
86    pub node_count: usize,
87}