delete.go 767 B

123456789101112131415161718192021222324252627
  1. package gateway
  2. import (
  3. "github.com/gravitl/netmaker/cli/functions"
  4. "github.com/spf13/cobra"
  5. )
  6. var gatewayDeleteCmd = &cobra.Command{
  7. Use: "delete [NETWORK NAME] [NODE ID]",
  8. Args: cobra.ExactArgs(2),
  9. Short: "Delete a Gateway.",
  10. Long: `
  11. Removes the gateway configuration from a node in a specified network. The node itself remains, but it will no longer function as a gateway.
  12. Arguments:
  13. NETWORK NAME: The name of the network from which the gateway configuration should be removed.
  14. NODE ID: The ID of the node that is currently acting as a gateway.
  15. `,
  16. Aliases: []string{"rm"},
  17. Run: func(cmd *cobra.Command, args []string) {
  18. functions.PrettyPrint(functions.DeleteGateway(args[0], args[1]))
  19. },
  20. }
  21. func init() {
  22. rootCmd.AddCommand(gatewayDeleteCmd)
  23. }