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