|
|
@@ -53,7 +53,7 @@ public static class CliBootstrap
|
|
|
var yamlFiles = Directory.EnumerateFiles(yamlPath, "*.yml")
|
|
|
.Concat(Directory.EnumerateFiles(yamlPath, "*.yaml"))
|
|
|
.ToArray();
|
|
|
-
|
|
|
+
|
|
|
collection.LoadFiles(yamlFiles.Select(f => Path.Combine(basePath, f)));
|
|
|
|
|
|
// Infrastructure
|
|
|
@@ -156,191 +156,191 @@ public static class CliBootstrap
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
config.AddBranch("switches", switches =>
|
|
|
- {
|
|
|
- switches.SetDescription("Manage switches");
|
|
|
+ {
|
|
|
+ switches.SetDescription("Manage switches");
|
|
|
|
|
|
- switches.AddCommand<SwitchReportCommand>("summary")
|
|
|
- .WithDescription("Show switch hardware report");
|
|
|
+ switches.AddCommand<SwitchReportCommand>("summary")
|
|
|
+ .WithDescription("Show switch hardware report");
|
|
|
|
|
|
- switches.AddCommand<SwitchAddCommand>("add")
|
|
|
- .WithDescription("Add a new switch");
|
|
|
+ switches.AddCommand<SwitchAddCommand>("add")
|
|
|
+ .WithDescription("Add a new switch");
|
|
|
|
|
|
- switches.AddCommand<SwitchGetCommand>("list")
|
|
|
- .WithDescription("List switches");
|
|
|
+ switches.AddCommand<SwitchGetCommand>("list")
|
|
|
+ .WithDescription("List switches");
|
|
|
|
|
|
- switches.AddCommand<SwitchGetByNameCommand>("get")
|
|
|
- .WithDescription("Get a switches by name");
|
|
|
+ switches.AddCommand<SwitchGetByNameCommand>("get")
|
|
|
+ .WithDescription("Get a switches by name");
|
|
|
|
|
|
- switches.AddCommand<SwitchDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a switch");
|
|
|
+ switches.AddCommand<SwitchDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a switch");
|
|
|
|
|
|
- switches.AddCommand<SwitchSetCommand>("set")
|
|
|
- .WithDescription("Update switch properties");
|
|
|
+ switches.AddCommand<SwitchSetCommand>("set")
|
|
|
+ .WithDescription("Update switch properties");
|
|
|
|
|
|
- switches.AddCommand<SwitchDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a switch");
|
|
|
- });
|
|
|
+ switches.AddCommand<SwitchDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a switch");
|
|
|
+ });
|
|
|
|
|
|
- config.AddBranch("systems", system =>
|
|
|
- {
|
|
|
- system.SetDescription("Manage systems");
|
|
|
+ config.AddBranch("systems", system =>
|
|
|
+ {
|
|
|
+ system.SetDescription("Manage systems");
|
|
|
|
|
|
- system.AddCommand<SystemReportCommand>("summary")
|
|
|
- .WithDescription("Show system report");
|
|
|
+ system.AddCommand<SystemReportCommand>("summary")
|
|
|
+ .WithDescription("Show system report");
|
|
|
|
|
|
- system.AddCommand<SystemAddCommand>("add")
|
|
|
- .WithDescription("Add a new system");
|
|
|
+ system.AddCommand<SystemAddCommand>("add")
|
|
|
+ .WithDescription("Add a new system");
|
|
|
|
|
|
- system.AddCommand<SystemGetCommand>("list")
|
|
|
- .WithDescription("List systems");
|
|
|
+ system.AddCommand<SystemGetCommand>("list")
|
|
|
+ .WithDescription("List systems");
|
|
|
|
|
|
- system.AddCommand<SystemGetByNameCommand>("get")
|
|
|
- .WithDescription("Get a system by name");
|
|
|
+ system.AddCommand<SystemGetByNameCommand>("get")
|
|
|
+ .WithDescription("Get a system by name");
|
|
|
|
|
|
- system.AddCommand<SystemDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a system");
|
|
|
+ system.AddCommand<SystemDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a system");
|
|
|
|
|
|
- system.AddCommand<SystemSetCommand>("set")
|
|
|
- .WithDescription("Update system properties");
|
|
|
+ system.AddCommand<SystemSetCommand>("set")
|
|
|
+ .WithDescription("Update system properties");
|
|
|
|
|
|
- system.AddCommand<SystemDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a system");
|
|
|
+ system.AddCommand<SystemDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a system");
|
|
|
|
|
|
- system.AddCommand<SystemTreeCommand>("tree")
|
|
|
- .WithDescription("Displays a dependency tree for the system.");
|
|
|
- });
|
|
|
+ system.AddCommand<SystemTreeCommand>("tree")
|
|
|
+ .WithDescription("Displays a dependency tree for the system.");
|
|
|
+ });
|
|
|
|
|
|
- config.AddBranch("accesspoints", ap =>
|
|
|
- {
|
|
|
- ap.SetDescription("Manage access points");
|
|
|
+ config.AddBranch("accesspoints", ap =>
|
|
|
+ {
|
|
|
+ ap.SetDescription("Manage access points");
|
|
|
|
|
|
- ap.AddCommand<AccessPointReportCommand>("summary")
|
|
|
- .WithDescription("Show access point hardware report");
|
|
|
+ ap.AddCommand<AccessPointReportCommand>("summary")
|
|
|
+ .WithDescription("Show access point hardware report");
|
|
|
|
|
|
- ap.AddCommand<AccessPointAddCommand>("add")
|
|
|
- .WithDescription("Add a new access point");
|
|
|
+ ap.AddCommand<AccessPointAddCommand>("add")
|
|
|
+ .WithDescription("Add a new access point");
|
|
|
|
|
|
- ap.AddCommand<AccessPointGetCommand>("list")
|
|
|
- .WithDescription("List access points");
|
|
|
+ ap.AddCommand<AccessPointGetCommand>("list")
|
|
|
+ .WithDescription("List access points");
|
|
|
|
|
|
- ap.AddCommand<AccessPointGetByNameCommand>("get")
|
|
|
- .WithDescription("Get an access point by name");
|
|
|
+ ap.AddCommand<AccessPointGetByNameCommand>("get")
|
|
|
+ .WithDescription("Get an access point by name");
|
|
|
|
|
|
- ap.AddCommand<AccessPointDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about an access point");
|
|
|
+ ap.AddCommand<AccessPointDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about an access point");
|
|
|
|
|
|
- ap.AddCommand<AccessPointSetCommand>("set")
|
|
|
- .WithDescription("Update access point properties");
|
|
|
+ ap.AddCommand<AccessPointSetCommand>("set")
|
|
|
+ .WithDescription("Update access point properties");
|
|
|
|
|
|
- ap.AddCommand<AccessPointDeleteCommand>("del")
|
|
|
- .WithDescription("Delete an access point");
|
|
|
- });
|
|
|
+ ap.AddCommand<AccessPointDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete an access point");
|
|
|
+ });
|
|
|
|
|
|
- config.AddBranch("ups", ups =>
|
|
|
- {
|
|
|
- ups.SetDescription("Manage UPS units");
|
|
|
+ config.AddBranch("ups", ups =>
|
|
|
+ {
|
|
|
+ ups.SetDescription("Manage UPS units");
|
|
|
|
|
|
- ups.AddCommand<UpsReportCommand>("summary")
|
|
|
- .WithDescription("Show UPS hardware report");
|
|
|
+ ups.AddCommand<UpsReportCommand>("summary")
|
|
|
+ .WithDescription("Show UPS hardware report");
|
|
|
|
|
|
- ups.AddCommand<UpsAddCommand>("add")
|
|
|
- .WithDescription("Add a new UPS");
|
|
|
+ ups.AddCommand<UpsAddCommand>("add")
|
|
|
+ .WithDescription("Add a new UPS");
|
|
|
|
|
|
- ups.AddCommand<UpsGetCommand>("list")
|
|
|
- .WithDescription("List UPS units");
|
|
|
+ ups.AddCommand<UpsGetCommand>("list")
|
|
|
+ .WithDescription("List UPS units");
|
|
|
|
|
|
- ups.AddCommand<UpsGetByNameCommand>("get")
|
|
|
- .WithDescription("Get a UPS by name");
|
|
|
+ ups.AddCommand<UpsGetByNameCommand>("get")
|
|
|
+ .WithDescription("Get a UPS by name");
|
|
|
|
|
|
- ups.AddCommand<UpsDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a UPS");
|
|
|
+ ups.AddCommand<UpsDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a UPS");
|
|
|
|
|
|
- ups.AddCommand<UpsSetCommand>("set")
|
|
|
- .WithDescription("Update UPS properties");
|
|
|
+ ups.AddCommand<UpsSetCommand>("set")
|
|
|
+ .WithDescription("Update UPS properties");
|
|
|
|
|
|
- ups.AddCommand<UpsDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a UPS");
|
|
|
- });
|
|
|
+ ups.AddCommand<UpsDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a UPS");
|
|
|
+ });
|
|
|
|
|
|
- config.AddBranch("desktops", desktops =>
|
|
|
+ config.AddBranch("desktops", desktops =>
|
|
|
+ {
|
|
|
+ // CRUD
|
|
|
+ desktops.AddCommand<DesktopAddCommand>("add");
|
|
|
+ desktops.AddCommand<DesktopGetCommand>("list");
|
|
|
+ desktops.AddCommand<DesktopGetByNameCommand>("get");
|
|
|
+ desktops.AddCommand<DesktopDescribeCommand>("describe");
|
|
|
+ desktops.AddCommand<DesktopSetCommand>("set");
|
|
|
+ desktops.AddCommand<DesktopDeleteCommand>("del");
|
|
|
+ desktops.AddCommand<DesktopReportCommand>("summary")
|
|
|
+ .WithDescription("Show desktop hardware report");
|
|
|
+ desktops.AddCommand<DesktopTreeCommand>("tree");
|
|
|
+
|
|
|
+
|
|
|
+ // CPU
|
|
|
+ desktops.AddBranch("cpu", cpu =>
|
|
|
{
|
|
|
- // CRUD
|
|
|
- desktops.AddCommand<DesktopAddCommand>("add");
|
|
|
- desktops.AddCommand<DesktopGetCommand>("list");
|
|
|
- desktops.AddCommand<DesktopGetByNameCommand>("get");
|
|
|
- desktops.AddCommand<DesktopDescribeCommand>("describe");
|
|
|
- desktops.AddCommand<DesktopSetCommand>("set");
|
|
|
- desktops.AddCommand<DesktopDeleteCommand>("del");
|
|
|
- desktops.AddCommand<DesktopReportCommand>("summary")
|
|
|
- .WithDescription("Show desktop hardware report");
|
|
|
- desktops.AddCommand<DesktopTreeCommand>("tree");
|
|
|
-
|
|
|
-
|
|
|
- // CPU
|
|
|
- desktops.AddBranch("cpu", cpu =>
|
|
|
- {
|
|
|
- cpu.AddCommand<DesktopCpuAddCommand>("add");
|
|
|
- cpu.AddCommand<DesktopCpuSetCommand>("set");
|
|
|
- cpu.AddCommand<DesktopCpuRemoveCommand>("del");
|
|
|
- });
|
|
|
-
|
|
|
- // Drives
|
|
|
- desktops.AddBranch("drive", drive =>
|
|
|
- {
|
|
|
- drive.AddCommand<DesktopDriveAddCommand>("add");
|
|
|
- drive.AddCommand<DesktopDriveSetCommand>("set");
|
|
|
- drive.AddCommand<DesktopDriveRemoveCommand>("del");
|
|
|
- });
|
|
|
+ cpu.AddCommand<DesktopCpuAddCommand>("add");
|
|
|
+ cpu.AddCommand<DesktopCpuSetCommand>("set");
|
|
|
+ cpu.AddCommand<DesktopCpuRemoveCommand>("del");
|
|
|
+ });
|
|
|
|
|
|
- // GPUs
|
|
|
- desktops.AddBranch("gpu", gpu =>
|
|
|
- {
|
|
|
- gpu.AddCommand<DesktopGpuAddCommand>("add");
|
|
|
- gpu.AddCommand<DesktopGpuSetCommand>("set");
|
|
|
- gpu.AddCommand<DesktopGpuRemoveCommand>("del");
|
|
|
- });
|
|
|
+ // Drives
|
|
|
+ desktops.AddBranch("drive", drive =>
|
|
|
+ {
|
|
|
+ drive.AddCommand<DesktopDriveAddCommand>("add");
|
|
|
+ drive.AddCommand<DesktopDriveSetCommand>("set");
|
|
|
+ drive.AddCommand<DesktopDriveRemoveCommand>("del");
|
|
|
+ });
|
|
|
|
|
|
- // NICs
|
|
|
- desktops.AddBranch("nic", nic =>
|
|
|
- {
|
|
|
- nic.AddCommand<DesktopNicAddCommand>("add");
|
|
|
- nic.AddCommand<DesktopNicSetCommand>("set");
|
|
|
- nic.AddCommand<DesktopNicRemoveCommand>("del");
|
|
|
- });
|
|
|
+ // GPUs
|
|
|
+ desktops.AddBranch("gpu", gpu =>
|
|
|
+ {
|
|
|
+ gpu.AddCommand<DesktopGpuAddCommand>("add");
|
|
|
+ gpu.AddCommand<DesktopGpuSetCommand>("set");
|
|
|
+ gpu.AddCommand<DesktopGpuRemoveCommand>("del");
|
|
|
});
|
|
|
|
|
|
- config.AddBranch("services", service =>
|
|
|
+ // NICs
|
|
|
+ desktops.AddBranch("nic", nic =>
|
|
|
{
|
|
|
- service.SetDescription(
|
|
|
- "Manage services."
|
|
|
- );
|
|
|
+ nic.AddCommand<DesktopNicAddCommand>("add");
|
|
|
+ nic.AddCommand<DesktopNicSetCommand>("set");
|
|
|
+ nic.AddCommand<DesktopNicRemoveCommand>("del");
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- service.AddCommand<ServiceReportCommand>("summary")
|
|
|
- .WithDescription("Show service summary report");
|
|
|
+ config.AddBranch("services", service =>
|
|
|
+ {
|
|
|
+ service.SetDescription(
|
|
|
+ "Manage services."
|
|
|
+ );
|
|
|
|
|
|
- service.AddCommand<ServiceAddCommand>("add")
|
|
|
- .WithDescription("Add a new service");
|
|
|
+ service.AddCommand<ServiceReportCommand>("summary")
|
|
|
+ .WithDescription("Show service summary report");
|
|
|
|
|
|
- service.AddCommand<ServiceGetCommand>("list")
|
|
|
- .WithDescription("List all services");
|
|
|
+ service.AddCommand<ServiceAddCommand>("add")
|
|
|
+ .WithDescription("Add a new service");
|
|
|
|
|
|
- service.AddCommand<ServiceGetByNameCommand>("get")
|
|
|
- .WithDescription("Get a service by name");
|
|
|
+ service.AddCommand<ServiceGetCommand>("list")
|
|
|
+ .WithDescription("List all services");
|
|
|
|
|
|
- service.AddCommand<ServiceDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a service");
|
|
|
+ service.AddCommand<ServiceGetByNameCommand>("get")
|
|
|
+ .WithDescription("Get a service by name");
|
|
|
|
|
|
- service.AddCommand<ServiceSetCommand>("set")
|
|
|
- .WithDescription("Update service properties");
|
|
|
+ service.AddCommand<ServiceDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a service");
|
|
|
|
|
|
- service.AddCommand<ServiceDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a service");
|
|
|
-
|
|
|
- service.AddCommand<ServiceSubnetsCommand>("subnets")
|
|
|
- .WithDescription("List service subnets or filter by CIDR");
|
|
|
- });
|
|
|
+ service.AddCommand<ServiceSetCommand>("set")
|
|
|
+ .WithDescription("Update service properties");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a service");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceSubnetsCommand>("subnets")
|
|
|
+ .WithDescription("List service subnets or filter by CIDR");
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|