// addServerCommand creates and returns a server command
170414
func addServerCommand() cli.Command {
	return cli.Command{
		Name:  "server",
		Usage: "starts the node-authorizer in server mode",

		Flags: []cli.Flag{
			cli.StringFlag{
				Name:   "authorizer",
				Usage:  "provider we should use to authorize the node registration `NAME`",
				EnvVar: "AUTHORIZER",
			},
			cli.StringFlag{
				Name:   "listen",
				Usage:  "interface to bind the service `INTERFACE`",
				EnvVar: "LISTEN",
				Value:  ":10443",
			},
			cli.StringFlag{
				Name:   "tls-client-ca",
				Usage:  "file containing the client certificate authority, required for mutual tls `PATH`",
				EnvVar: "TLS_CLIENT_CA",
			},
			cli.StringFlag{
				Name:   "tls-cert",
				Usage:  "file containing the certificate `PATH`",
				EnvVar: "TLS_CERT",
				Value:  "/certs/node-authorizer.pem",
			},
			cli.StringFlag{
				Name:   "tls-private-key",
				Usage:  "file containing the private key `PATH`",
				EnvVar: "TLS_PRIVATE_KEY",
				Value:  "/certs/node-authorizer-key.pem",
			},
			cli.StringFlag{
				Name:   "cluster-name",
				Usage:  "name of the kubernetes cluster we are provisioning `NAME`",
				EnvVar: "CLUSTER_NAME",
			},
			cli.StringFlag{
				Name:   "cluster-tag",
				Usage:  "name of the cloud tag used to identify the cluster name `NAME`",
				EnvVar: "CLUSTER_TAG",
				Value:  "KubernetesCluster",
			},
			cli.StringSliceFlag{
				Name:  "feature",
				Usage: "enables or disables a feature in the chosen authorizer `NAME`",
			},
			cli.DurationFlag{
				Name:   "token-ttl",
				Usage:  "expiration on created bootstrap token `DURATION`",
				EnvVar: "TOKEN_TTL",
				Value:  5 * time.Minute,
			},
			cli.StringFlag{
				Name:   "client-common-name",
				Usage:  "the common name of the client certificate when use mutual tls `NAME`",
				EnvVar: "CLIENT_COMMON_NAME",
				Value:  "node-authorizer-client",
			},
			cli.DurationFlag{
				Name:   "certificate-ttl",
				Usage:  "check the certificates exist and if not wait for x period `DURATION`",
				EnvVar: "CERTIFICATE_TTL",
				Value:  1 * time.Hour,
			},
			cli.DurationFlag{
				Name:   "authorization-timeout",
				Usage:  "max time permitted for a authorization `DURATION`",
				EnvVar: "AUTHORIZATION_TIMEOUT",
				Value:  15 * time.Second,
			},
		},

		Action: func(ctx *cli.Context) error {
			return actionServerCommand(ctx)
		},
	}
}
370707
func (s *Server) AddHost(host host.Host, hostReply *[]byte) error {
	privateKey, err := s.f.AddHost(s.context(), &host)
	if err != nil {
		return err
	}
	*hostReply = privateKey
	return nil
}
1305697
func (_m *DBClient) AddCommand(c models.Command) (string, error) {
	ret := _m.Called(c)

	var r0 string
	if rf, ok := ret.Get(0).(func(models.Command) string); ok {
		r0 = rf(c)
	} else {
		r0 = ret.Get(0).(string)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(models.Command) error); ok {
		r1 = rf(c)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
316102
func WithCommand(cmd ...cli.Command) Option {
	return func(o *Options) {
		o.Commands = append(o.Commands, cmd...)
	}
}
136490
func (worker *Worker) AddServer(net, addr string) (err error) {
	// Create a new job server's client as a agent of server
	a, err := newAgent(net, addr, worker)
	if err != nil {
		return err
	}
	worker.agents = append(worker.agents, a)
	return
}
46004
func (b *BigIP) AddServerSSLProfile(config *ServerSSLProfile) error {
	return b.post(config, uriLtm, uriProfile, uriServerSSL)
}
660229
func addNICCmd(params *Parameters) *subcommands.Command {
	return &subcommands.Command{
		UsageLine: "add-nic -name <name> -machine <machine> -mac <mac address> -switch <switch> [-port <switch port>] [-host <hostname>] [-ip <ip address>]",
		ShortDesc: "adds a NIC",
		LongDesc:  "Adds a network interface to the database.\n\nExample:\ncrimson add-nic -name eth0 -machine xx1-01-720 -mac 00:00:00:00:00:bc -switch switch1.lab -port 30",
		CommandRun: func() subcommands.CommandRun {
			cmd := &AddNICCmd{}
			cmd.Initialize(params)
			cmd.Flags.StringVar(&cmd.nic.Name, "name", "", "The name of the NIC. Required and must be unique per machine within the database.")
			cmd.Flags.StringVar(&cmd.nic.Machine, "machine", "", "The machine this NIC belongs to. Required and must be the name of a machine returned by get-machines.")
			cmd.Flags.StringVar(&cmd.nic.MacAddress, "mac", "", "The MAC address of this NIC. Required and must be a valid MAC-48 address.")
			cmd.Flags.StringVar(&cmd.nic.Switch, "switch", "", "The switch this NIC is connected to. Required and must be the name of a switch returned by get-switches.")
			cmd.Flags.Var(flag.Int32(&cmd.nic.Switchport), "port", "The switchport this NIC is connected to.")
			cmd.Flags.StringVar(&cmd.nic.Hostname, "host", "", "The name of this NIC on the network.")
			cmd.Flags.StringVar(&cmd.nic.Ipv4, "ip", "", "The IPv4 address assigned to this NIC. Must be a free IP address returned by get-ips.")
			return cmd
		},
	}
}
1078082
func BuildCommand(factory app.ProjectFactory) cli.Command {
	return cli.Command{
		Name:   "build",
		Usage:  "Build or rebuild services.",
		Action: app.WithProject(factory, app.ProjectBuild),
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "no-cache",
				Usage: "Do not use cache when building the image",
			},
			cli.BoolFlag{
				Name:  "force-rm",
				Usage: "Always remove intermediate containers",
			},
			cli.BoolFlag{
				Name:  "pull",
				Usage: "Always attempt to pull a newer version of the image",
			},
		},
	}
}
1301209
func (c *Client) AddNode(host string, command AddNodeCommand) error {
	return c.AddNodeAsync(host, command).Receive()
}
1263414
func (o *NSGateway) CreateCommand(child *Command) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
133404
func newCommand(cmdName string, cmdArgs []string, cli *client.Client) (command, error) {
	switch cmdName {
	case cmdNameConn:
		return newCommandConn(cmdArgs, cli)
	case cmdNameDisconn:
		return newCommandDisconn(cli), nil
	case cmdNameHelp:
		return newCommandHelp(), nil
	case cmdNamePub:
		return newCommandPub(cmdArgs, cli)
	case cmdNameQuit:
		return newCommandQuit(cli), nil
	case cmdNameSub:
		return newCommandSub(cmdArgs, cli)
	case cmdNameUnsub:
		return newCommandUnsub(cmdArgs, cli)
	}

	return nil, errInvalidCmdName
}
220927
func NewAPIServerCommand(stopCh <-chan struct{}) *cobra.Command {
	s := options.NewServerRunOptions()
	cmd := &cobra.Command{
		Use: "kube-apiserver",
		Long: `The Kubernetes API server validates and configures data
for the api objects which include pods, services, replicationcontrollers, and
others. The API Server services REST operations and provides the frontend to the
cluster's shared state through which all other components interact.`,
		RunE: func(cmd *cobra.Command, args []string) error {
			verflag.PrintAndExitIfRequested()
			utilflag.PrintFlags(cmd.Flags())

			// set default options
			completedOptions, err := Complete(s)
			if err != nil {
				return err
			}

			// validate options
			if errs := completedOptions.Validate(); len(errs) != 0 {
				return utilerrors.NewAggregate(errs)
			}

			return Run(completedOptions, stopCh)
		},
	}

	fs := cmd.Flags()
	namedFlagSets := s.Flags()
	verflag.AddFlags(namedFlagSets.FlagSet("global"))
	globalflag.AddGlobalFlags(namedFlagSets.FlagSet("global"), cmd.Name())
	options.AddCustomGlobalFlags(namedFlagSets.FlagSet("generic"))
	for _, f := range namedFlagSets.FlagSets {
		fs.AddFlagSet(f)
	}

	usageFmt := "Usage:\n  %s\n"
	cols, _, _ := term.TerminalSize(cmd.OutOrStdout())
	cmd.SetUsageFunc(func(cmd *cobra.Command) error {
		fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
		cliflag.PrintSections(cmd.OutOrStderr(), namedFlagSets, cols)
		return nil
	})
	cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
		fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine())
		cliflag.PrintSections(cmd.OutOrStdout(), namedFlagSets, cols)
	})

	return cmd
}
733275
func (s *server) processCommand(command Command, e *ev) {
	s.debugln("server.command.process")

	// Create an entry for the command in the log.
	entry, err := s.log.createEntry(s.currentTerm, command, e)

	if err != nil {
		s.debugln("server.command.log.entry.error:", err)
		e.c <- err
		return
	}

	if err := s.log.appendEntry(entry); err != nil {
		s.debugln("server.command.log.error:", err)
		e.c <- err
		return
	}

	s.syncedPeer[s.Name()] = true
	if len(s.peers) == 0 {
		commitIndex := s.log.currentIndex()
		s.log.setCommitIndex(commitIndex)
		s.debugln("commit index ", commitIndex)
	}
}
1344943
func (f *Flaeg) AddCommand(command *Command) {
	f.commands = append(f.commands, command)
}
982876
func NewUploadCommand(deps UploadDeps) modelcmd.ModelCommand {
	return modelcmd.Wrap(&UploadCommand{deps: deps})
}
1131213
func AddCommand(cmd string, format int, post PostProcessor, desc, usage string) {
	pprofCommands[cmd] = &command{format, post, nil, false, desc, usage}
}
511178
func (cl *CommandList) Add(uri string) {
	cl.cmdQ.PushBack(&command{fmt.Sprintf("add %s", quote(uri)), nil, cmdNoReturn})
}