create_relay.go 631 B

1234567891011121314151617181920212223
  1. package node
  2. import (
  3. "strings"
  4. "github.com/gravitl/netmaker/cli/functions"
  5. "github.com/spf13/cobra"
  6. )
  7. var hostCreateRelayCmd = &cobra.Command{
  8. Use: "create_relay [NETWORK][NODE ID] [RELAYED NODE IDS (comma separated)]",
  9. Args: cobra.ExactArgs(3),
  10. Short: "Turn a Node into a Relay",
  11. Long: `Turn a Node into a Relay`,
  12. Deprecated: "in favour of the `gateway` subcommand, in Netmaker v0.90.0.",
  13. Run: func(cmd *cobra.Command, args []string) {
  14. functions.PrettyPrint(functions.CreateRelay(args[0], args[1], strings.Split(args[2], ",")))
  15. },
  16. }
  17. func init() {
  18. rootCmd.AddCommand(hostCreateRelayCmd)
  19. }