ic-query-cli 0.104.0

Command-line wrapper for read-only Internet Computer metadata queries
Documentation
mod read;
mod refresh;

use crate::nns::NnsCommandError;
use clap::ArgMatches;
use ic_query::nns::topology;

pub(in crate::nns) async fn run(
    matches: &ArgMatches,
    network: &str,
) -> Result<(), NnsCommandError> {
    match crate::cli::clap::parsed_options::<super::commands::TopologyCommand>(matches) {
        super::commands::TopologyCommand::Summary(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_summary_report_with_source,
                crate::presentation::nns::topology::nns_topology_summary_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Coverage(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_coverage_report_with_source,
                crate::presentation::nns::topology::nns_topology_coverage_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Versions(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_versions_report_with_source,
                crate::presentation::nns::topology::nns_topology_versions_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Check(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_check_report_with_source,
                crate::presentation::nns::topology::nns_topology_check_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Gaps(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_gaps_report_with_source,
                crate::presentation::nns::topology::nns_topology_gaps_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Capacity(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_capacity_report_with_source,
                crate::presentation::nns::topology::nns_topology_capacity_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Regions(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_regions_report_with_source,
                crate::presentation::nns::topology::nns_topology_regions_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Providers(options) => {
            read::run_topology_read(
                options,
                network,
                topology::build_nns_topology_providers_report_with_source,
                crate::presentation::nns::topology::nns_topology_providers_report_text,
            )
            .await
        }
        super::commands::TopologyCommand::Refresh(options) => {
            refresh::run_topology_refresh(options, network).await
        }
    }
}