|
|
@@ -72,448 +72,447 @@ public static class CliBootstrap
|
|
|
services.AddCommands();
|
|
|
|
|
|
// Spectre bootstrap
|
|
|
-app.Configure(config =>
|
|
|
-{
|
|
|
- config.SetApplicationName("rpk");
|
|
|
- config.ValidateExamples();
|
|
|
-
|
|
|
- // Global summary
|
|
|
- config.AddCommand<GetTotalSummaryCommand>("summary")
|
|
|
- .WithDescription("Show a summarized report of all resources in the system.");
|
|
|
-
|
|
|
- // ----------------------------
|
|
|
- // Server commands (CRUD-style)
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("servers", server =>
|
|
|
- {
|
|
|
- server.SetDescription("Manage servers and their components.");
|
|
|
-
|
|
|
- server.AddCommand<ServerReportCommand>("summary")
|
|
|
- .WithDescription("Show a summarized hardware report for all servers.");
|
|
|
-
|
|
|
- server.AddCommand<ServerAddCommand>("add")
|
|
|
- .WithDescription("Add a new server to the inventory.");
|
|
|
-
|
|
|
- server.AddCommand<ServerGetByNameCommand>("get")
|
|
|
- .WithDescription("List all servers or retrieve a specific server by name.");
|
|
|
-
|
|
|
- server.AddCommand<ServerDescribeCommand>("describe")
|
|
|
- .WithDescription("Display detailed information about a specific server.");
|
|
|
-
|
|
|
- server.AddCommand<ServerSetCommand>("set")
|
|
|
- .WithDescription("Update properties of an existing server.");
|
|
|
-
|
|
|
- server.AddCommand<ServerDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a server from the inventory.");
|
|
|
-
|
|
|
- server.AddCommand<ServerTreeCommand>("tree")
|
|
|
- .WithDescription("Display the dependency tree of a server.");
|
|
|
-
|
|
|
- // Server CPUs
|
|
|
- server.AddBranch("cpu", cpu =>
|
|
|
- {
|
|
|
- cpu.SetDescription("Manage CPUs attached to a server.");
|
|
|
-
|
|
|
- cpu.AddCommand<ServerCpuAddCommand>("add")
|
|
|
- .WithDescription("Add a CPU to a specific server.");
|
|
|
-
|
|
|
- cpu.AddCommand<ServerCpuSetCommand>("set")
|
|
|
- .WithDescription("Update configuration of a server CPU.");
|
|
|
-
|
|
|
- cpu.AddCommand<ServerCpuRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a CPU from a server.");
|
|
|
- });
|
|
|
-
|
|
|
- // Server Drives
|
|
|
- server.AddBranch("drive", drive =>
|
|
|
- {
|
|
|
- drive.SetDescription("Manage drives attached to a server.");
|
|
|
-
|
|
|
- drive.AddCommand<ServerDriveAddCommand>("add")
|
|
|
- .WithDescription("Add a storage drive to a server.");
|
|
|
-
|
|
|
- drive.AddCommand<ServerDriveUpdateCommand>("set")
|
|
|
- .WithDescription("Update properties of a server drive.");
|
|
|
-
|
|
|
- drive.AddCommand<ServerDriveRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a drive from a server.");
|
|
|
- });
|
|
|
-
|
|
|
- // Server GPUs
|
|
|
- server.AddBranch("gpu", gpu =>
|
|
|
+ app.Configure(config =>
|
|
|
{
|
|
|
- gpu.SetDescription("Manage GPUs attached to a server.");
|
|
|
+ config.SetApplicationName("rpk");
|
|
|
+ config.ValidateExamples();
|
|
|
|
|
|
- gpu.AddCommand<ServerGpuAddCommand>("add")
|
|
|
- .WithDescription("Add a GPU to a server.");
|
|
|
+ // Global summary
|
|
|
+ config.AddCommand<GetTotalSummaryCommand>("summary")
|
|
|
+ .WithDescription("Show a summarized report of all resources in the system.");
|
|
|
|
|
|
- gpu.AddCommand<ServerGpuUpdateCommand>("set")
|
|
|
- .WithDescription("Update properties of a server GPU.");
|
|
|
+ // ----------------------------
|
|
|
+ // Server commands (CRUD-style)
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("servers", server =>
|
|
|
+ {
|
|
|
+ server.SetDescription("Manage servers and their components.");
|
|
|
|
|
|
- gpu.AddCommand<ServerGpuRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a GPU from a server.");
|
|
|
- });
|
|
|
-
|
|
|
- // Server NICs
|
|
|
- server.AddBranch("nic", nic =>
|
|
|
- {
|
|
|
- nic.SetDescription("Manage network interface cards (NICs) for a server.");
|
|
|
-
|
|
|
- nic.AddCommand<ServerNicAddCommand>("add")
|
|
|
- .WithDescription("Add a NIC to a server.");
|
|
|
+ server.AddCommand<ServerReportCommand>("summary")
|
|
|
+ .WithDescription("Show a summarized hardware report for all servers.");
|
|
|
|
|
|
- nic.AddCommand<ServerNicUpdateCommand>("set")
|
|
|
- .WithDescription("Update properties of a server NIC.");
|
|
|
-
|
|
|
- nic.AddCommand<ServerNicRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a NIC from a server.");
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- // ----------------------------
|
|
|
- // Switch commands
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("switches", switches =>
|
|
|
- {
|
|
|
- switches.SetDescription("Manage network switches.");
|
|
|
+ server.AddCommand<ServerAddCommand>("add")
|
|
|
+ .WithDescription("Add a new server to the inventory.");
|
|
|
|
|
|
- switches.AddCommand<SwitchReportCommand>("summary")
|
|
|
- .WithDescription("Show a hardware report for all switches.");
|
|
|
+ server.AddCommand<ServerGetByNameCommand>("get")
|
|
|
+ .WithDescription("List all servers or retrieve a specific server by name.");
|
|
|
|
|
|
- switches.AddCommand<SwitchAddCommand>("add")
|
|
|
- .WithDescription("Add a new network switch to the inventory.");
|
|
|
+ server.AddCommand<ServerDescribeCommand>("describe")
|
|
|
+ .WithDescription("Display detailed information about a specific server.");
|
|
|
|
|
|
- switches.AddCommand<SwitchGetCommand>("list")
|
|
|
- .WithDescription("List all switches in the system.");
|
|
|
+ server.AddCommand<ServerSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of an existing server.");
|
|
|
|
|
|
- switches.AddCommand<SwitchGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve details of a specific switch by name.");
|
|
|
+ server.AddCommand<ServerDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a server from the inventory.");
|
|
|
|
|
|
- switches.AddCommand<SwitchDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a switch.");
|
|
|
+ server.AddCommand<ServerTreeCommand>("tree")
|
|
|
+ .WithDescription("Display the dependency tree of a server.");
|
|
|
|
|
|
- switches.AddCommand<SwitchSetCommand>("set")
|
|
|
- .WithDescription("Update properties of a switch.");
|
|
|
+ // Server CPUs
|
|
|
+ server.AddBranch("cpu", cpu =>
|
|
|
+ {
|
|
|
+ cpu.SetDescription("Manage CPUs attached to a server.");
|
|
|
|
|
|
- switches.AddCommand<SwitchDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a switch from the inventory.");
|
|
|
- });
|
|
|
+ cpu.AddCommand<ServerCpuAddCommand>("add")
|
|
|
+ .WithDescription("Add a CPU to a specific server.");
|
|
|
|
|
|
- // ----------------------------
|
|
|
- // Routers commands
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("routers", routers =>
|
|
|
- {
|
|
|
- routers.SetDescription("Manage network routers.");
|
|
|
+ cpu.AddCommand<ServerCpuSetCommand>("set")
|
|
|
+ .WithDescription("Update configuration of a server CPU.");
|
|
|
|
|
|
- routers.AddCommand<FirewallReportCommand>("summary")
|
|
|
- .WithDescription("Show a hardware report for all routers.");
|
|
|
+ cpu.AddCommand<ServerCpuRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a CPU from a server.");
|
|
|
+ });
|
|
|
|
|
|
- routers.AddCommand<FirewallAddCommand>("add")
|
|
|
- .WithDescription("Add a new network router to the inventory.");
|
|
|
+ // Server Drives
|
|
|
+ server.AddBranch("drive", drive =>
|
|
|
+ {
|
|
|
+ drive.SetDescription("Manage drives attached to a server.");
|
|
|
|
|
|
- routers.AddCommand<FirewallGetCommand>("list")
|
|
|
- .WithDescription("List all routers in the system.");
|
|
|
+ drive.AddCommand<ServerDriveAddCommand>("add")
|
|
|
+ .WithDescription("Add a storage drive to a server.");
|
|
|
|
|
|
- routers.AddCommand<FirewallGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve details of a specific router by name.");
|
|
|
+ drive.AddCommand<ServerDriveUpdateCommand>("set")
|
|
|
+ .WithDescription("Update properties of a server drive.");
|
|
|
|
|
|
- routers.AddCommand<FirewallDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a router.");
|
|
|
+ drive.AddCommand<ServerDriveRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a drive from a server.");
|
|
|
+ });
|
|
|
|
|
|
- routers.AddCommand<FirewallSetCommand>("set")
|
|
|
- .WithDescription("Update properties of a router.");
|
|
|
+ // Server GPUs
|
|
|
+ server.AddBranch("gpu", gpu =>
|
|
|
+ {
|
|
|
+ gpu.SetDescription("Manage GPUs attached to a server.");
|
|
|
|
|
|
- routers.AddCommand<FirewallDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a router from the inventory.");
|
|
|
- });
|
|
|
-
|
|
|
- // ----------------------------
|
|
|
- // Firewalls commands
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("firewalls", firewalls =>
|
|
|
- {
|
|
|
- firewalls.SetDescription("Manage firewalls.");
|
|
|
+ gpu.AddCommand<ServerGpuAddCommand>("add")
|
|
|
+ .WithDescription("Add a GPU to a server.");
|
|
|
|
|
|
- firewalls.AddCommand<FirewallReportCommand>("summary")
|
|
|
- .WithDescription("Show a hardware report for all firewalls.");
|
|
|
+ gpu.AddCommand<ServerGpuUpdateCommand>("set")
|
|
|
+ .WithDescription("Update properties of a server GPU.");
|
|
|
|
|
|
- firewalls.AddCommand<FirewallAddCommand>("add")
|
|
|
- .WithDescription("Add a new firewall to the inventory.");
|
|
|
+ gpu.AddCommand<ServerGpuRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a GPU from a server.");
|
|
|
+ });
|
|
|
|
|
|
- firewalls.AddCommand<FirewallGetCommand>("list")
|
|
|
- .WithDescription("List all firewalls in the system.");
|
|
|
+ // Server NICs
|
|
|
+ server.AddBranch("nic", nic =>
|
|
|
+ {
|
|
|
+ nic.SetDescription("Manage network interface cards (NICs) for a server.");
|
|
|
|
|
|
- firewalls.AddCommand<FirewallGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve details of a specific firewall by name.");
|
|
|
+ nic.AddCommand<ServerNicAddCommand>("add")
|
|
|
+ .WithDescription("Add a NIC to a server.");
|
|
|
|
|
|
- firewalls.AddCommand<FirewallDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a firewall.");
|
|
|
+ nic.AddCommand<ServerNicUpdateCommand>("set")
|
|
|
+ .WithDescription("Update properties of a server NIC.");
|
|
|
|
|
|
- firewalls.AddCommand<FirewallSetCommand>("set")
|
|
|
- .WithDescription("Update properties of a firewall.");
|
|
|
+ nic.AddCommand<ServerNicRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a NIC from a server.");
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- firewalls.AddCommand<FirewallDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a firewall from the inventory.");
|
|
|
- });
|
|
|
-
|
|
|
- // ----------------------------
|
|
|
- // System commands
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("systems", system =>
|
|
|
- {
|
|
|
- system.SetDescription("Manage systems and their dependencies.");
|
|
|
+ // ----------------------------
|
|
|
+ // Switch commands
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("switches", switches =>
|
|
|
+ {
|
|
|
+ switches.SetDescription("Manage network switches.");
|
|
|
|
|
|
- system.AddCommand<SystemReportCommand>("summary")
|
|
|
- .WithDescription("Show a summary report for all systems.");
|
|
|
+ switches.AddCommand<SwitchReportCommand>("summary")
|
|
|
+ .WithDescription("Show a hardware report for all switches.");
|
|
|
|
|
|
- system.AddCommand<SystemAddCommand>("add")
|
|
|
- .WithDescription("Add a new system to the inventory.");
|
|
|
+ switches.AddCommand<SwitchAddCommand>("add")
|
|
|
+ .WithDescription("Add a new network switch to the inventory.");
|
|
|
|
|
|
- system.AddCommand<SystemGetCommand>("list")
|
|
|
- .WithDescription("List all systems.");
|
|
|
+ switches.AddCommand<SwitchGetCommand>("list")
|
|
|
+ .WithDescription("List all switches in the system.");
|
|
|
|
|
|
- system.AddCommand<SystemGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve a system by name.");
|
|
|
+ switches.AddCommand<SwitchGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve details of a specific switch by name.");
|
|
|
|
|
|
- system.AddCommand<SystemDescribeCommand>("describe")
|
|
|
- .WithDescription("Display detailed information about a system.");
|
|
|
+ switches.AddCommand<SwitchDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a switch.");
|
|
|
|
|
|
- system.AddCommand<SystemSetCommand>("set")
|
|
|
- .WithDescription("Update properties of a system.");
|
|
|
+ switches.AddCommand<SwitchSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of a switch.");
|
|
|
|
|
|
- system.AddCommand<SystemDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a system from the inventory.");
|
|
|
+ switches.AddCommand<SwitchDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a switch from the inventory.");
|
|
|
+ });
|
|
|
|
|
|
- system.AddCommand<SystemTreeCommand>("tree")
|
|
|
- .WithDescription("Display the dependency tree for a system.");
|
|
|
- });
|
|
|
+ // ----------------------------
|
|
|
+ // Routers commands
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("routers", routers =>
|
|
|
+ {
|
|
|
+ routers.SetDescription("Manage network routers.");
|
|
|
|
|
|
- // ----------------------------
|
|
|
- // Access Points
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("accesspoints", ap =>
|
|
|
- {
|
|
|
- ap.SetDescription("Manage access points.");
|
|
|
+ routers.AddCommand<FirewallReportCommand>("summary")
|
|
|
+ .WithDescription("Show a hardware report for all routers.");
|
|
|
|
|
|
- ap.AddCommand<AccessPointReportCommand>("summary")
|
|
|
- .WithDescription("Show a hardware report for all access points.");
|
|
|
+ routers.AddCommand<FirewallAddCommand>("add")
|
|
|
+ .WithDescription("Add a new network router to the inventory.");
|
|
|
|
|
|
- ap.AddCommand<AccessPointAddCommand>("add")
|
|
|
- .WithDescription("Add a new access point.");
|
|
|
+ routers.AddCommand<FirewallGetCommand>("list")
|
|
|
+ .WithDescription("List all routers in the system.");
|
|
|
|
|
|
- ap.AddCommand<AccessPointGetCommand>("list")
|
|
|
- .WithDescription("List all access points.");
|
|
|
+ routers.AddCommand<FirewallGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve details of a specific router by name.");
|
|
|
|
|
|
- ap.AddCommand<AccessPointGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve an access point by name.");
|
|
|
+ routers.AddCommand<FirewallDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a router.");
|
|
|
|
|
|
- ap.AddCommand<AccessPointDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about an access point.");
|
|
|
+ routers.AddCommand<FirewallSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of a router.");
|
|
|
|
|
|
- ap.AddCommand<AccessPointSetCommand>("set")
|
|
|
- .WithDescription("Update properties of an access point.");
|
|
|
+ routers.AddCommand<FirewallDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a router from the inventory.");
|
|
|
+ });
|
|
|
|
|
|
- ap.AddCommand<AccessPointDeleteCommand>("del")
|
|
|
- .WithDescription("Delete an access point.");
|
|
|
- });
|
|
|
+ // ----------------------------
|
|
|
+ // Firewalls commands
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("firewalls", firewalls =>
|
|
|
+ {
|
|
|
+ firewalls.SetDescription("Manage firewalls.");
|
|
|
|
|
|
- // ----------------------------
|
|
|
- // UPS units
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("ups", ups =>
|
|
|
- {
|
|
|
- ups.SetDescription("Manage UPS units.");
|
|
|
+ firewalls.AddCommand<FirewallReportCommand>("summary")
|
|
|
+ .WithDescription("Show a hardware report for all firewalls.");
|
|
|
|
|
|
- ups.AddCommand<UpsReportCommand>("summary")
|
|
|
- .WithDescription("Show a hardware report for all UPS units.");
|
|
|
+ firewalls.AddCommand<FirewallAddCommand>("add")
|
|
|
+ .WithDescription("Add a new firewall to the inventory.");
|
|
|
|
|
|
- ups.AddCommand<UpsAddCommand>("add")
|
|
|
- .WithDescription("Add a new UPS unit.");
|
|
|
+ firewalls.AddCommand<FirewallGetCommand>("list")
|
|
|
+ .WithDescription("List all firewalls in the system.");
|
|
|
|
|
|
- ups.AddCommand<UpsGetCommand>("list")
|
|
|
- .WithDescription("List all UPS units.");
|
|
|
+ firewalls.AddCommand<FirewallGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve details of a specific firewall by name.");
|
|
|
|
|
|
- ups.AddCommand<UpsGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve a UPS unit by name.");
|
|
|
+ firewalls.AddCommand<FirewallDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a firewall.");
|
|
|
|
|
|
- ups.AddCommand<UpsDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a UPS unit.");
|
|
|
+ firewalls.AddCommand<FirewallSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of a firewall.");
|
|
|
|
|
|
- ups.AddCommand<UpsSetCommand>("set")
|
|
|
- .WithDescription("Update properties of a UPS unit.");
|
|
|
+ firewalls.AddCommand<FirewallDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a firewall from the inventory.");
|
|
|
+ });
|
|
|
|
|
|
- ups.AddCommand<UpsDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a UPS unit.");
|
|
|
- });
|
|
|
+ // ----------------------------
|
|
|
+ // System commands
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("systems", system =>
|
|
|
+ {
|
|
|
+ system.SetDescription("Manage systems and their dependencies.");
|
|
|
|
|
|
- // ----------------------------
|
|
|
- // Desktops
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("desktops", desktops =>
|
|
|
- {
|
|
|
- desktops.SetDescription("Manage desktop computers and their components.");
|
|
|
-
|
|
|
- // CRUD
|
|
|
- desktops.AddCommand<DesktopAddCommand>("add")
|
|
|
- .WithDescription("Add a new desktop.");
|
|
|
- desktops.AddCommand<DesktopGetCommand>("list")
|
|
|
- .WithDescription("List all desktops.");
|
|
|
- desktops.AddCommand<DesktopGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve a desktop by name.");
|
|
|
- desktops.AddCommand<DesktopDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a desktop.");
|
|
|
- desktops.AddCommand<DesktopSetCommand>("set")
|
|
|
- .WithDescription("Update properties of a desktop.");
|
|
|
- desktops.AddCommand<DesktopDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a desktop from the inventory.");
|
|
|
- desktops.AddCommand<DesktopReportCommand>("summary")
|
|
|
- .WithDescription("Show a summarized hardware report for all desktops.");
|
|
|
- desktops.AddCommand<DesktopTreeCommand>("tree")
|
|
|
- .WithDescription("Display the dependency tree for a desktop.");
|
|
|
-
|
|
|
- // CPU
|
|
|
- desktops.AddBranch("cpu", cpu =>
|
|
|
- {
|
|
|
- cpu.SetDescription("Manage CPUs attached to desktops.");
|
|
|
- cpu.AddCommand<DesktopCpuAddCommand>("add")
|
|
|
- .WithDescription("Add a CPU to a desktop.");
|
|
|
- cpu.AddCommand<DesktopCpuSetCommand>("set")
|
|
|
- .WithDescription("Update a desktop CPU.");
|
|
|
- cpu.AddCommand<DesktopCpuRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a CPU from a desktop.");
|
|
|
- });
|
|
|
+ system.AddCommand<SystemReportCommand>("summary")
|
|
|
+ .WithDescription("Show a summary report for all systems.");
|
|
|
|
|
|
- // Drives
|
|
|
- desktops.AddBranch("drive", drive =>
|
|
|
- {
|
|
|
- drive.SetDescription("Manage storage drives attached to desktops.");
|
|
|
- drive.AddCommand<DesktopDriveAddCommand>("add")
|
|
|
- .WithDescription("Add a drive to a desktop.");
|
|
|
- drive.AddCommand<DesktopDriveSetCommand>("set")
|
|
|
- .WithDescription("Update a desktop drive.");
|
|
|
- drive.AddCommand<DesktopDriveRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a drive from a desktop.");
|
|
|
- });
|
|
|
+ system.AddCommand<SystemAddCommand>("add")
|
|
|
+ .WithDescription("Add a new system to the inventory.");
|
|
|
|
|
|
- // GPUs
|
|
|
- desktops.AddBranch("gpu", gpu =>
|
|
|
- {
|
|
|
- gpu.SetDescription("Manage GPUs attached to desktops.");
|
|
|
- gpu.AddCommand<DesktopGpuAddCommand>("add")
|
|
|
- .WithDescription("Add a GPU to a desktop.");
|
|
|
- gpu.AddCommand<DesktopGpuSetCommand>("set")
|
|
|
- .WithDescription("Update a desktop GPU.");
|
|
|
- gpu.AddCommand<DesktopGpuRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a GPU from a desktop.");
|
|
|
- });
|
|
|
+ system.AddCommand<SystemGetCommand>("list")
|
|
|
+ .WithDescription("List all systems.");
|
|
|
|
|
|
- // NICs
|
|
|
- desktops.AddBranch("nic", nic =>
|
|
|
- {
|
|
|
- nic.SetDescription("Manage network interface cards (NICs) for desktops.");
|
|
|
- nic.AddCommand<DesktopNicAddCommand>("add")
|
|
|
- .WithDescription("Add a NIC to a desktop.");
|
|
|
- nic.AddCommand<DesktopNicSetCommand>("set")
|
|
|
- .WithDescription("Update a desktop NIC.");
|
|
|
- nic.AddCommand<DesktopNicRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a NIC from a desktop.");
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- // ----------------------------
|
|
|
- // Laptops
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("Laptops", Laptops =>
|
|
|
- {
|
|
|
- Laptops.SetDescription("Manage Laptop computers and their components.");
|
|
|
-
|
|
|
- // CRUD
|
|
|
- Laptops.AddCommand<LaptopAddCommand>("add")
|
|
|
- .WithDescription("Add a new Laptop.");
|
|
|
- Laptops.AddCommand<LaptopGetCommand>("list")
|
|
|
- .WithDescription("List all Laptops.");
|
|
|
- Laptops.AddCommand<LaptopGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve a Laptop by name.");
|
|
|
- Laptops.AddCommand<LaptopDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a Laptop.");
|
|
|
- Laptops.AddCommand<LaptopDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a Laptop from the inventory.");
|
|
|
- Laptops.AddCommand<LaptopReportCommand>("summary")
|
|
|
- .WithDescription("Show a summarized hardware report for all Laptops.");
|
|
|
- Laptops.AddCommand<LaptopTreeCommand>("tree")
|
|
|
- .WithDescription("Display the dependency tree for a Laptop.");
|
|
|
-
|
|
|
- // CPU
|
|
|
- Laptops.AddBranch("cpu", cpu =>
|
|
|
- {
|
|
|
- cpu.SetDescription("Manage CPUs attached to Laptops.");
|
|
|
- cpu.AddCommand<LaptopCpuAddCommand>("add")
|
|
|
- .WithDescription("Add a CPU to a Laptop.");
|
|
|
- cpu.AddCommand<LaptopCpuSetCommand>("set")
|
|
|
- .WithDescription("Update a Laptop CPU.");
|
|
|
- cpu.AddCommand<LaptopCpuRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a CPU from a Laptop.");
|
|
|
- });
|
|
|
+ system.AddCommand<SystemGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve a system by name.");
|
|
|
|
|
|
- // Drives
|
|
|
- Laptops.AddBranch("drive", drive =>
|
|
|
- {
|
|
|
- drive.SetDescription("Manage storage drives attached to Laptops.");
|
|
|
- drive.AddCommand<LaptopDriveAddCommand>("add")
|
|
|
- .WithDescription("Add a drive to a Laptop.");
|
|
|
- drive.AddCommand<LaptopDriveSetCommand>("set")
|
|
|
- .WithDescription("Update a Laptop drive.");
|
|
|
- drive.AddCommand<LaptopDriveRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a drive from a Laptop.");
|
|
|
- });
|
|
|
+ system.AddCommand<SystemDescribeCommand>("describe")
|
|
|
+ .WithDescription("Display detailed information about a system.");
|
|
|
|
|
|
- // GPUs
|
|
|
- Laptops.AddBranch("gpu", gpu =>
|
|
|
- {
|
|
|
- gpu.SetDescription("Manage GPUs attached to Laptops.");
|
|
|
- gpu.AddCommand<LaptopGpuAddCommand>("add")
|
|
|
- .WithDescription("Add a GPU to a Laptop.");
|
|
|
- gpu.AddCommand<LaptopGpuSetCommand>("set")
|
|
|
- .WithDescription("Update a Laptop GPU.");
|
|
|
- gpu.AddCommand<LaptopGpuRemoveCommand>("del")
|
|
|
- .WithDescription("Remove a GPU from a Laptop.");
|
|
|
+ system.AddCommand<SystemSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of a system.");
|
|
|
+
|
|
|
+ system.AddCommand<SystemDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a system from the inventory.");
|
|
|
+
|
|
|
+ system.AddCommand<SystemTreeCommand>("tree")
|
|
|
+ .WithDescription("Display the dependency tree for a system.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // ----------------------------
|
|
|
+ // Access Points
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("accesspoints", ap =>
|
|
|
+ {
|
|
|
+ ap.SetDescription("Manage access points.");
|
|
|
+
|
|
|
+ ap.AddCommand<AccessPointReportCommand>("summary")
|
|
|
+ .WithDescription("Show a hardware report for all access points.");
|
|
|
+
|
|
|
+ ap.AddCommand<AccessPointAddCommand>("add")
|
|
|
+ .WithDescription("Add a new access point.");
|
|
|
+
|
|
|
+ ap.AddCommand<AccessPointGetCommand>("list")
|
|
|
+ .WithDescription("List all access points.");
|
|
|
+
|
|
|
+ ap.AddCommand<AccessPointGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve an access point by name.");
|
|
|
+
|
|
|
+ ap.AddCommand<AccessPointDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about an access point.");
|
|
|
+
|
|
|
+ ap.AddCommand<AccessPointSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of an access point.");
|
|
|
+
|
|
|
+ ap.AddCommand<AccessPointDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete an access point.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // ----------------------------
|
|
|
+ // UPS units
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("ups", ups =>
|
|
|
+ {
|
|
|
+ ups.SetDescription("Manage UPS units.");
|
|
|
+
|
|
|
+ ups.AddCommand<UpsReportCommand>("summary")
|
|
|
+ .WithDescription("Show a hardware report for all UPS units.");
|
|
|
+
|
|
|
+ ups.AddCommand<UpsAddCommand>("add")
|
|
|
+ .WithDescription("Add a new UPS unit.");
|
|
|
+
|
|
|
+ ups.AddCommand<UpsGetCommand>("list")
|
|
|
+ .WithDescription("List all UPS units.");
|
|
|
+
|
|
|
+ ups.AddCommand<UpsGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve a UPS unit by name.");
|
|
|
+
|
|
|
+ ups.AddCommand<UpsDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a UPS unit.");
|
|
|
+
|
|
|
+ ups.AddCommand<UpsSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of a UPS unit.");
|
|
|
+
|
|
|
+ ups.AddCommand<UpsDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a UPS unit.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // ----------------------------
|
|
|
+ // Desktops
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("desktops", desktops =>
|
|
|
+ {
|
|
|
+ desktops.SetDescription("Manage desktop computers and their components.");
|
|
|
+
|
|
|
+ // CRUD
|
|
|
+ desktops.AddCommand<DesktopAddCommand>("add")
|
|
|
+ .WithDescription("Add a new desktop.");
|
|
|
+ desktops.AddCommand<DesktopGetCommand>("list")
|
|
|
+ .WithDescription("List all desktops.");
|
|
|
+ desktops.AddCommand<DesktopGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve a desktop by name.");
|
|
|
+ desktops.AddCommand<DesktopDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a desktop.");
|
|
|
+ desktops.AddCommand<DesktopSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of a desktop.");
|
|
|
+ desktops.AddCommand<DesktopDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a desktop from the inventory.");
|
|
|
+ desktops.AddCommand<DesktopReportCommand>("summary")
|
|
|
+ .WithDescription("Show a summarized hardware report for all desktops.");
|
|
|
+ desktops.AddCommand<DesktopTreeCommand>("tree")
|
|
|
+ .WithDescription("Display the dependency tree for a desktop.");
|
|
|
+
|
|
|
+ // CPU
|
|
|
+ desktops.AddBranch("cpu", cpu =>
|
|
|
+ {
|
|
|
+ cpu.SetDescription("Manage CPUs attached to desktops.");
|
|
|
+ cpu.AddCommand<DesktopCpuAddCommand>("add")
|
|
|
+ .WithDescription("Add a CPU to a desktop.");
|
|
|
+ cpu.AddCommand<DesktopCpuSetCommand>("set")
|
|
|
+ .WithDescription("Update a desktop CPU.");
|
|
|
+ cpu.AddCommand<DesktopCpuRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a CPU from a desktop.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // Drives
|
|
|
+ desktops.AddBranch("drive", drive =>
|
|
|
+ {
|
|
|
+ drive.SetDescription("Manage storage drives attached to desktops.");
|
|
|
+ drive.AddCommand<DesktopDriveAddCommand>("add")
|
|
|
+ .WithDescription("Add a drive to a desktop.");
|
|
|
+ drive.AddCommand<DesktopDriveSetCommand>("set")
|
|
|
+ .WithDescription("Update a desktop drive.");
|
|
|
+ drive.AddCommand<DesktopDriveRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a drive from a desktop.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // GPUs
|
|
|
+ desktops.AddBranch("gpu", gpu =>
|
|
|
+ {
|
|
|
+ gpu.SetDescription("Manage GPUs attached to desktops.");
|
|
|
+ gpu.AddCommand<DesktopGpuAddCommand>("add")
|
|
|
+ .WithDescription("Add a GPU to a desktop.");
|
|
|
+ gpu.AddCommand<DesktopGpuSetCommand>("set")
|
|
|
+ .WithDescription("Update a desktop GPU.");
|
|
|
+ gpu.AddCommand<DesktopGpuRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a GPU from a desktop.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // NICs
|
|
|
+ desktops.AddBranch("nic", nic =>
|
|
|
+ {
|
|
|
+ nic.SetDescription("Manage network interface cards (NICs) for desktops.");
|
|
|
+ nic.AddCommand<DesktopNicAddCommand>("add")
|
|
|
+ .WithDescription("Add a NIC to a desktop.");
|
|
|
+ nic.AddCommand<DesktopNicSetCommand>("set")
|
|
|
+ .WithDescription("Update a desktop NIC.");
|
|
|
+ nic.AddCommand<DesktopNicRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a NIC from a desktop.");
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // ----------------------------
|
|
|
+ // Laptops
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("Laptops", Laptops =>
|
|
|
+ {
|
|
|
+ Laptops.SetDescription("Manage Laptop computers and their components.");
|
|
|
+
|
|
|
+ // CRUD
|
|
|
+ Laptops.AddCommand<LaptopAddCommand>("add")
|
|
|
+ .WithDescription("Add a new Laptop.");
|
|
|
+ Laptops.AddCommand<LaptopGetCommand>("list")
|
|
|
+ .WithDescription("List all Laptops.");
|
|
|
+ Laptops.AddCommand<LaptopGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve a Laptop by name.");
|
|
|
+ Laptops.AddCommand<LaptopDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a Laptop.");
|
|
|
+ Laptops.AddCommand<LaptopDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a Laptop from the inventory.");
|
|
|
+ Laptops.AddCommand<LaptopReportCommand>("summary")
|
|
|
+ .WithDescription("Show a summarized hardware report for all Laptops.");
|
|
|
+ Laptops.AddCommand<LaptopTreeCommand>("tree")
|
|
|
+ .WithDescription("Display the dependency tree for a Laptop.");
|
|
|
+
|
|
|
+ // CPU
|
|
|
+ Laptops.AddBranch("cpu", cpu =>
|
|
|
+ {
|
|
|
+ cpu.SetDescription("Manage CPUs attached to Laptops.");
|
|
|
+ cpu.AddCommand<LaptopCpuAddCommand>("add")
|
|
|
+ .WithDescription("Add a CPU to a Laptop.");
|
|
|
+ cpu.AddCommand<LaptopCpuSetCommand>("set")
|
|
|
+ .WithDescription("Update a Laptop CPU.");
|
|
|
+ cpu.AddCommand<LaptopCpuRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a CPU from a Laptop.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // Drives
|
|
|
+ Laptops.AddBranch("drive", drive =>
|
|
|
+ {
|
|
|
+ drive.SetDescription("Manage storage drives attached to Laptops.");
|
|
|
+ drive.AddCommand<LaptopDriveAddCommand>("add")
|
|
|
+ .WithDescription("Add a drive to a Laptop.");
|
|
|
+ drive.AddCommand<LaptopDriveSetCommand>("set")
|
|
|
+ .WithDescription("Update a Laptop drive.");
|
|
|
+ drive.AddCommand<LaptopDriveRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a drive from a Laptop.");
|
|
|
+ });
|
|
|
+
|
|
|
+ // GPUs
|
|
|
+ Laptops.AddBranch("gpu", gpu =>
|
|
|
+ {
|
|
|
+ gpu.SetDescription("Manage GPUs attached to Laptops.");
|
|
|
+ gpu.AddCommand<LaptopGpuAddCommand>("add")
|
|
|
+ .WithDescription("Add a GPU to a Laptop.");
|
|
|
+ gpu.AddCommand<LaptopGpuSetCommand>("set")
|
|
|
+ .WithDescription("Update a Laptop GPU.");
|
|
|
+ gpu.AddCommand<LaptopGpuRemoveCommand>("del")
|
|
|
+ .WithDescription("Remove a GPU from a Laptop.");
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ // ----------------------------
|
|
|
+ // Services
|
|
|
+ // ----------------------------
|
|
|
+ config.AddBranch("services", service =>
|
|
|
+ {
|
|
|
+ service.SetDescription("Manage services and their configurations.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceReportCommand>("summary")
|
|
|
+ .WithDescription("Show a summary report for all services.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceAddCommand>("add")
|
|
|
+ .WithDescription("Add a new service.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceGetCommand>("list")
|
|
|
+ .WithDescription("List all services.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceGetByNameCommand>("get")
|
|
|
+ .WithDescription("Retrieve a service by name.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceDescribeCommand>("describe")
|
|
|
+ .WithDescription("Show detailed information about a service.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceSetCommand>("set")
|
|
|
+ .WithDescription("Update properties of a service.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceDeleteCommand>("del")
|
|
|
+ .WithDescription("Delete a service.");
|
|
|
+
|
|
|
+ service.AddCommand<ServiceSubnetsCommand>("subnets")
|
|
|
+ .WithDescription("List subnets associated with a service, optionally filtered by CIDR.");
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- // ----------------------------
|
|
|
- // Services
|
|
|
- // ----------------------------
|
|
|
- config.AddBranch("services", service =>
|
|
|
- {
|
|
|
- service.SetDescription("Manage services and their configurations.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceReportCommand>("summary")
|
|
|
- .WithDescription("Show a summary report for all services.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceAddCommand>("add")
|
|
|
- .WithDescription("Add a new service.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceGetCommand>("list")
|
|
|
- .WithDescription("List all services.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceGetByNameCommand>("get")
|
|
|
- .WithDescription("Retrieve a service by name.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceDescribeCommand>("describe")
|
|
|
- .WithDescription("Show detailed information about a service.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceSetCommand>("set")
|
|
|
- .WithDescription("Update properties of a service.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceDeleteCommand>("del")
|
|
|
- .WithDescription("Delete a service.");
|
|
|
-
|
|
|
- service.AddCommand<ServiceSubnetsCommand>("subnets")
|
|
|
- .WithDescription("List subnets associated with a service, optionally filtered by CIDR.");
|
|
|
- });
|
|
|
-});
|
|
|
-
|
|
|
}
|
|
|
}
|