How onemind-services-llc/evengsdk works
Project Type and Purpose
• That evengsdk is a library combined with a CLI application that serves two main purposes: providing a Python API client (EvengClient) for interacting with the EVE-NG REST API, and offering command-line utilities (organized under multiple subcommands like folder, lab, node, user, system, etc.) for automating lab creation and management.
• Stress that the tool’s primary role is to simplify the creation, configuration, and management of network topologies in EVE-NG environments.
Analyzing the File Structure
• The top-level directories and files (src, docs, examples, tests, Makefile, setup.py, etc.) immediately suggest separation of concerns:
• The “src/evengsdk” directory is the core library, featuring modules for the API client, CLI commands (segmented further into folders, labs, nodes, system, and users), templates, schemas, exceptions, and even plugins.
• The “examples” directory provides sample configuration files, templates (Jinja) and YAML topology declarations that show how to build lab topologies.
• The “docs” directory documents the API reference, CLI usage, and even a topology builder guide.
• The “tests” directory indicates a comprehensive testing strategy divided into API tests and CLI tests.
• Notice the presence of configuration files (like .dockerignore, flake8, pre-commit, etc.) and CI/CD related files in the “.github/workflows” directory, suggesting that the project has an established development process.
Key Components
a. Main Components:
• API Client Module: Represented by the EvengClient (in src/evengsdk/client.py and api.py) that encapsulates communication with the EVE-NG server’s REST API.
• CLI Application: Include the CLI entry point (src/evengsdk/__main__.py) and the various subcommand modules (cli/folders, cli/lab, cli/node, cli/system, and cli/users).
• Topology Builder: Reflect the declarative topology engine that resolves YAML/ Jinja templates and configuration files (examples and templates in src/evengsdk/templates and docs/topology_builder.md).
• Supporting Modules: Such as plugins (for extensibility), schemas/validators (to enforce valid lab definitions), and exceptions (for error handling).
b. Relationships and Interactions:
• Flow between the CLI commands and core functions such as “create lab,” “add node,” “connect nodes,” and “manage users.”
• An external node for the EVE-NG server showing that API calls flow externally from evengsdk to an EVE-NG instance.
c. Architectural Patterns and Design Principles:
• A modular design with clear separation between command handling (CLI modules) and API operations (client, API modules).
• Use of declarative configuration for building labs (topology YAML files combined with Jinja templates) that decouple lab representation from code.
• That tests are organized to mirror these components (API and CLI testing), reinforcing clean interfaces and modularity.
d. Relevant Technologies and Frameworks:
• Python is the core language with dependencies outlined in the requirements files.
• Jinja templating is used for node configuration and lab templates.
• Standard practices like environment variable configurations are supported for API connectivity.
• The integration with CI/CD workflows is bolstered by GitHub Actions (see .github/workflows).
Capturing Essential Architectural Elements
• Visual elements for error handling (exceptions) and extensibility (plugins) if appropriate.