Software TSN Switch
A software switch to connect VMs and Containers to a TSN network
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
cnc::JsonImporter Class Reference

Imports CNC topology and inventory data from JSON sources. More...

#include <JsonImporter.h>

Collaboration diagram for cnc::JsonImporter:
Collaboration graph

Static Public Member Functions

static bool importFromFile (const std::string &filename, Topology &topology)
 Imports CNC node configurations from a JSON file.
 
static InventoryMap importInventory (const std::string &filename)
 Imports device inventory (credentials) from a JSON file.
 

Detailed Description

Imports CNC topology and inventory data from JSON sources.

This utility class provides static import routines for reading node/interface configuration into Topology objects and for loading device access credentials into an InventoryMap. It is intended as the JSON ingestion boundary between external configuration files and internal CNC data models.

Member Function Documentation

◆ importFromFile()

bool cnc::JsonImporter::importFromFile ( const std::string &  filename,
Topology &  topology 
)
static

Imports CNC node configurations from a JSON file.

Parameters
filenameThe path to the JSON file.
Returns
True if the import was successful, false otherwise.

◆ importInventory()

InventoryMap cnc::JsonImporter::importInventory ( const std::string &  filename)
static

Imports device inventory (credentials) from a JSON file.

Parameters
filenameThe path to the inventory JSON file.
Returns
An InventoryMap mapping hostnames to their credentials (username and password).

The documentation for this class was generated from the following files: