config.go 860 B

123456789101112131415161718192021222324252627282930313233
  1. package ext_client
  2. import (
  3. "fmt"
  4. "github.com/gravitl/netmaker/cli/functions"
  5. "github.com/spf13/cobra"
  6. )
  7. var extClientConfigCmd = &cobra.Command{
  8. Use: "config [NETWORK NAME] [EXTERNAL CLIENT ID]",
  9. Args: cobra.ExactArgs(2),
  10. Short: "Get an External Client Configuration",
  11. Long: `Get an External Client Configuration`,
  12. Run: func(cmd *cobra.Command, args []string) {
  13. fmt.Println(functions.GetExtClientConfig(args[0], args[1]))
  14. },
  15. }
  16. var extClientHAConfigCmd = &cobra.Command{
  17. Use: "auto_config [NETWORK NAME]",
  18. Args: cobra.ExactArgs(1),
  19. Short: "Get an External Client Configuration",
  20. Long: `Get an External Client Configuration`,
  21. Run: func(cmd *cobra.Command, args []string) {
  22. fmt.Println(functions.GetExtClientHAConfig(args[0]))
  23. },
  24. }
  25. func init() {
  26. rootCmd.AddCommand(extClientConfigCmd)
  27. rootCmd.AddCommand(extClientHAConfigCmd)
  28. }