node_limit.go 605 B

123456789101112131415161718192021222324252627
  1. package network
  2. import (
  3. "log"
  4. "strconv"
  5. "github.com/gravitl/netmaker/cli/functions"
  6. "github.com/spf13/cobra"
  7. )
  8. var networkNodeLimitCmd = &cobra.Command{
  9. Use: "node_limit [NETWORK NAME] [NEW LIMIT]",
  10. Short: "Update network nodel limit",
  11. Long: `Update network nodel limit`,
  12. Args: cobra.ExactArgs(2),
  13. Run: func(cmd *cobra.Command, args []string) {
  14. nodelimit, err := strconv.ParseInt(args[1], 10, 32)
  15. if err != nil {
  16. log.Fatal(err)
  17. }
  18. functions.PrettyPrint(functions.UpdateNetworkNodeLimit(args[0], int32(nodelimit)))
  19. },
  20. }
  21. func init() {
  22. rootCmd.AddCommand(networkNodeLimitCmd)
  23. }