ic_query/nns/node_operator/report/model/
report.rs1#[cfg(feature = "host")]
2use crate::cache_file::JsonCacheReport;
3use serde::{Deserialize, Serialize};
4
5#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
12pub struct NnsNodeOperatorListReport {
13 pub schema_version: u32,
14 pub network: String,
15 pub registry_canister_id: String,
16 pub registry_version: u64,
17 pub fetched_at: String,
18 pub source_endpoint: String,
19 pub fetched_by: String,
20 pub node_operator_count: usize,
21 pub node_operators: Vec<NnsNodeOperatorRow>,
22}
23
24#[cfg(feature = "host")]
25impl JsonCacheReport for NnsNodeOperatorListReport {
26 fn schema_version(&self) -> u32 {
27 self.schema_version
28 }
29
30 fn network(&self) -> &str {
31 &self.network
32 }
33}
34
35#[cfg(feature = "host")]
36impl_nns_inventory_report!(
37 NnsNodeOperatorListReport,
38 super::super::NNS_NODE_OPERATOR_LIST_REPORT_SCHEMA_VERSION,
39 "node_operator",
40 node_operator_count,
41 node_operators,
42);
43
44#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
51pub struct NnsNodeOperatorRow {
52 pub node_operator_principal: String,
53 pub node_provider_principal: String,
54 pub node_allowance: u64,
55 pub data_center_id: String,
56 pub node_count: Option<u32>,
57}
58
59#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
66pub struct NnsNodeOperatorInfoReport {
67 pub schema_version: u32,
68 pub input: String,
69 pub resolved_from: String,
70 pub network: String,
71 pub registry_canister_id: String,
72 pub registry_version: u64,
73 pub fetched_at: String,
74 pub source_endpoint: String,
75 pub fetched_by: String,
76 pub node_operator_principal: String,
77 pub node_provider_principal: String,
78 pub node_allowance: u64,
79 pub data_center_id: String,
80 pub node_count: Option<u32>,
81}
82
83#[cfg(feature = "host")]
90#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
91pub struct NnsNodeOperatorRefreshReport {
92 pub schema_version: u32,
93 pub network: String,
94 pub cache_path: String,
95 pub refresh_lock_path: String,
96 pub output_path: Option<String>,
97 pub registry_canister_id: String,
98 pub registry_version: u64,
99 pub fetched_at: String,
100 pub source_endpoint: String,
101 pub fetched_by: String,
102 pub dry_run: bool,
103 pub wrote_cache: bool,
104 pub replaced_existing_cache: bool,
105 pub node_operator_count: usize,
106}