Skip to main content

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

1use crate::subnet_catalog::SubnetKind;
2use serde::{Deserialize, Serialize};
3
4///
5/// NnsNodeListReport
6///
7/// Filtered NNS node inventory report with source metadata.
8///
9
10#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
11#[serde(deny_unknown_fields)]
12pub struct NnsNodeListReport {
13    pub schema_version: u32,
14    /// Registry acquisition metadata, flattened in JSON.
15    #[serde(flatten)]
16    pub provenance: crate::nns::registry::NnsRegistryInventoryProvenance,
17    pub nodes: Vec<NnsNodeRow>,
18}
19
20///
21/// NnsNodeRow
22///
23/// One node row projected from the NNS registry inventory.
24///
25
26#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
27#[serde(deny_unknown_fields)]
28pub struct NnsNodeRow {
29    pub node_principal: String,
30    pub node_operator_principal: String,
31    pub node_provider_principal: String,
32    pub subnet_principal: String,
33    pub subnet_kind: SubnetKind,
34    pub data_center_id: String,
35}
36
37///
38/// NnsNodeInfoReport
39///
40/// Detailed report for one resolved NNS node.
41///
42
43#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
44pub struct NnsNodeInfoReport {
45    pub schema_version: u32,
46    pub input: String,
47    pub resolved_from: String,
48    /// Registry acquisition metadata, flattened in JSON.
49    #[serde(flatten)]
50    pub provenance: crate::nns::registry::NnsRegistryInventoryProvenance,
51    /// Resolved inventory row.
52    #[serde(flatten)]
53    pub node: NnsNodeRow,
54}