ic_query/nns/node/report/model/
report.rs1#[cfg(feature = "nns-host")]
2use crate::cache_file::JsonCacheReport;
3use crate::subnet_catalog::SubnetKind;
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
13pub struct NnsNodeListReport {
14 pub schema_version: u32,
15 pub network: String,
16 pub registry_canister_id: String,
17 pub registry_version: u64,
18 pub fetched_at: String,
19 pub source_endpoint: String,
20 pub fetched_by: String,
21 pub node_count: usize,
22 pub nodes: Vec<NnsNodeRow>,
23}
24
25#[cfg(feature = "nns-host")]
26impl JsonCacheReport for NnsNodeListReport {
27 fn schema_version(&self) -> u32 {
28 self.schema_version
29 }
30
31 fn network(&self) -> &str {
32 &self.network
33 }
34}
35
36#[cfg(feature = "nns-host")]
37impl_nns_inventory_report!(
38 NnsNodeListReport,
39 super::super::NNS_NODE_LIST_REPORT_SCHEMA_VERSION,
40 "node",
41 node_count,
42 nodes,
43 |_report: &NnsNodeListReport| None,
44);
45
46#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
53pub struct NnsNodeRow {
54 pub node_principal: String,
55 pub node_operator_principal: String,
56 pub node_provider_principal: String,
57 pub subnet_principal: String,
58 pub subnet_kind: SubnetKind,
59 pub data_center_id: String,
60}
61
62#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
69pub struct NnsNodeInfoReport {
70 pub schema_version: u32,
71 pub input: String,
72 pub resolved_from: String,
73 pub network: String,
74 pub registry_canister_id: String,
75 pub registry_version: u64,
76 pub fetched_at: String,
77 pub source_endpoint: String,
78 pub fetched_by: String,
79 pub node_principal: String,
80 pub node_operator_principal: String,
81 pub node_provider_principal: String,
82 pub subnet_principal: String,
83 pub subnet_kind: SubnetKind,
84 pub data_center_id: String,
85}