package cli import ( "fmt" "github.com/spf13/cobra" ) var poolCmd = &cobra.Command{ Use: "pool", Short: "Manage VM pool", } var poolStatusCmd = &cobra.Command{ Use: "status", Short: "Show VM pool status", RunE: runPoolStatus, } var poolWarmCmd = &cobra.Command{ Use: "warm", Short: "Pre-warm VMs", RunE: runPoolWarm, } var poolDrainCmd = &cobra.Command{ Use: "drain", Short: "Gracefully drain all VMs", RunE: runPoolDrain, } func init() { poolCmd.AddCommand(poolStatusCmd) poolCmd.AddCommand(poolWarmCmd) poolCmd.AddCommand(poolDrainCmd) } func runPoolStatus(cmd *cobra.Command, args []string) error { // TODO: Connect to running at-rund instance and query pool status fmt.Println("Pool status requires a running at-rund server.") fmt.Println("This will query the server's /pool/status endpoint.") return nil } func runPoolWarm(cmd *cobra.Command, args []string) error { // TODO: Connect to running at-rund instance and warm pool fmt.Println("Pool warm requires a running at-rund server.") return nil } func runPoolDrain(cmd *cobra.Command, args []string) error { // TODO: Connect to running at-rund instance and drain pool fmt.Println("Pool drain requires a running at-rund server.") return nil }