// NewUnregisterCommand returns a command to allow the user to unregister a controller. func NewUnregisterCommand(store jujuclient.ClientStore) cmd.Command { if store == nil { panic("valid store must be specified") } cmd := &unregisterCommand{store: store} return modelcmd.WrapBase(cmd) }
// NewRegisterCommand returns a command to allow the user to register a controller. func NewRegisterCommand() cmd.Command { c := ®isterCommand{} c.apiOpen = c.APIOpen c.listModelsFunc = c.listModels c.store = jujuclient.NewFileClientStore() return modelcmd.WrapBase(c) }
// NewRegisterCommand returns a command to allow the user to register a controller. func NewRegisterCommand() cmd.Command { cmd := ®isterCommand{} cmd.apiOpen = cmd.APIOpen cmd.refreshModels = cmd.RefreshModels cmd.store = jujuclient.NewFileClientStore() return modelcmd.WrapBase(cmd) }
func (s *SwitchSimpleSuite) run(c *gc.C, args ...string) (*cmd.Context, error) { cmd := &switchCommand{ Store: s.stubStore, RefreshModels: s.refreshModels, } return coretesting.RunCommand(c, modelcmd.WrapBase(cmd), args...) }
func newSwitchCommand() cmd.Command { cmd := &switchCommand{ Store: jujuclient.NewFileClientStore(), } cmd.RefreshModels = cmd.JujuCommandBase.RefreshModels return modelcmd.WrapBase(cmd) }
func newSwitchCommand() cmd.Command { cmd := &switchCommand{ Store: jujuclient.NewFileClientStore(), ReadCurrentController: modelcmd.ReadCurrentController, WriteCurrentController: modelcmd.WriteCurrentController, } cmd.RefreshModels = cmd.JujuCommandBase.RefreshModels return modelcmd.WrapBase(cmd) }
// RegisterAll registers all romulus commands with the // provided command registry. func RegisterAll(r commandRegister) { register := func(c cmd.Command) { switch c := c.(type) { case modelcmd.ModelCommand: r.Register(modelcmd.Wrap(c)) case modelcmd.CommandBase: r.Register(modelcmd.WrapBase(c)) default: r.Register(c) } } register(agree.NewAgreeCommand()) register(listagreements.NewListAgreementsCommand()) register(allocate.NewAllocateCommand()) register(listbudgets.NewListBudgetsCommand()) register(createbudget.NewCreateBudgetCommand()) register(listplans.NewListPlansCommand()) register(setbudget.NewSetBudgetCommand()) register(setplan.NewSetPlanCommand()) register(showbudget.NewShowBudgetCommand()) register(updateallocation.NewUpdateAllocationCommand()) }
// NewWhoAmICommand returns a command to print login details. func NewWhoAmICommand() cmd.Command { cmd := &whoAmICommand{ store: jujuclient.NewFileClientStore(), } return modelcmd.WrapBase(cmd) }
// NewListControllersCommand returns a command to list registered controllers. func NewListControllersCommand() cmd.Command { cmd := &listControllersCommand{ store: jujuclient.NewFileClientStore(), } return modelcmd.WrapBase(cmd) }
// NewListCommand returns a command to list the controllers the user knows about. func NewListCommand() cmd.Command { return modelcmd.WrapBase(&listCommand{}) }
// NewShowControllerCommand returns a command to show details of the desired controllers. func NewShowControllerCommand() cmd.Command { cmd := &showControllerCommand{ store: jujuclient.NewFileClientStore(), } return modelcmd.WrapBase(cmd) }
// NewLoginCommand returns a command to allow the user to login to a controller. func NewLoginCommand() cmd.Command { return modelcmd.WrapBase(&loginCommand{}) }