Esempio n. 1
0
// 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)
}
Esempio n. 2
0
File: register.go Progetto: bac/juju
// NewRegisterCommand returns a command to allow the user to register a controller.
func NewRegisterCommand() cmd.Command {
	c := &registerCommand{}
	c.apiOpen = c.APIOpen
	c.listModelsFunc = c.listModels
	c.store = jujuclient.NewFileClientStore()
	return modelcmd.WrapBase(c)
}
Esempio n. 3
0
// NewRegisterCommand returns a command to allow the user to register a controller.
func NewRegisterCommand() cmd.Command {
	cmd := &registerCommand{}
	cmd.apiOpen = cmd.APIOpen
	cmd.refreshModels = cmd.RefreshModels
	cmd.store = jujuclient.NewFileClientStore()
	return modelcmd.WrapBase(cmd)
}
Esempio n. 4
0
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...)
}
Esempio n. 5
0
File: switch.go Progetto: bac/juju
func newSwitchCommand() cmd.Command {
	cmd := &switchCommand{
		Store: jujuclient.NewFileClientStore(),
	}
	cmd.RefreshModels = cmd.JujuCommandBase.RefreshModels
	return modelcmd.WrapBase(cmd)
}
Esempio n. 6
0
func newSwitchCommand() cmd.Command {
	cmd := &switchCommand{
		Store: jujuclient.NewFileClientStore(),
		ReadCurrentController:  modelcmd.ReadCurrentController,
		WriteCurrentController: modelcmd.WriteCurrentController,
	}
	cmd.RefreshModels = cmd.JujuCommandBase.RefreshModels
	return modelcmd.WrapBase(cmd)
}
Esempio n. 7
0
File: commands.go Progetto: bac/juju
// 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())
}
Esempio n. 8
0
File: whoami.go Progetto: bac/juju
// NewWhoAmICommand returns a command to print login details.
func NewWhoAmICommand() cmd.Command {
	cmd := &whoAmICommand{
		store: jujuclient.NewFileClientStore(),
	}
	return modelcmd.WrapBase(cmd)
}
Esempio n. 9
0
// NewListControllersCommand returns a command to list registered controllers.
func NewListControllersCommand() cmd.Command {
	cmd := &listControllersCommand{
		store: jujuclient.NewFileClientStore(),
	}
	return modelcmd.WrapBase(cmd)
}
Esempio n. 10
0
// NewListCommand returns a command to list the controllers the user knows about.
func NewListCommand() cmd.Command {
	return modelcmd.WrapBase(&listCommand{})
}
Esempio n. 11
0
// NewShowControllerCommand returns a command to show details of the desired controllers.
func NewShowControllerCommand() cmd.Command {
	cmd := &showControllerCommand{
		store: jujuclient.NewFileClientStore(),
	}
	return modelcmd.WrapBase(cmd)
}
Esempio n. 12
0
// NewLoginCommand returns a command to allow the user to login to a controller.
func NewLoginCommand() cmd.Command {
	return modelcmd.WrapBase(&loginCommand{})
}