Documentation ¶
Index ¶
- Variables
- func NewSuperBlockCommand() cmd.Command
- func ProcessBlockedError(err error, block Block) error
- type BaseBlockCommand
- type Block
- type BlockClientAPI
- type BlockInfo
- type BlockListAPI
- type ChangeCommand
- type Command
- type DestroyCommand
- type ListCommand
- type RemoveCommand
- type UnblockClientAPI
- type UnblockCommand
Constants ¶
This section is empty.
Variables ¶
var OperationFromType = func(blockType string) string {
return blockTypes[blockType]
}
OperationFromType translates given block type as defined in multiwatcher into the operation such as destroy-environment.
var TypeFromOperation = func(operation string) string { for key, value := range blockTypes { if value == operation { return key } } panic(fmt.Sprintf("unknown operation %v", operation)) }
TypeFromOperation translates given operation string such as destroy-environment, remove-object, etc to block type string as defined in multiwatcher.
Functions ¶
func NewSuperBlockCommand ¶
NewSuperBlockCommand creates the block supercommand and registers the subcommands that it supports.
func ProcessBlockedError ¶
ProcessBlockedError ensures that correct and user-friendly message is displayed to the user based on the block type.
Types ¶
type BaseBlockCommand ¶
type BaseBlockCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
BaseBlockCommand is base command for all commands that enable blocks.
func (*BaseBlockCommand) Init ¶
func (c *BaseBlockCommand) Init(args []string) error
Init initializes the command. Satisfying Command interface.
func (*BaseBlockCommand) SetFlags ¶
func (c *BaseBlockCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type BlockClientAPI ¶
BlockClientAPI defines the client API methods that block command uses.
type BlockInfo ¶
type BlockInfo struct { Operation string `yaml:"block" json:"block"` Enabled bool `yaml:"enabled" json:"enabled"` Message *string `yaml:"message,omitempty" json:"message,omitempty"` }
BlockInfo defines the serialization behaviour of the block information.
type BlockListAPI ¶
BlockListAPI defines the client API methods that block list command uses.
type ChangeCommand ¶
type ChangeCommand struct {
BaseBlockCommand
}
ChangeCommand blocks commands that may change environment.
func (*ChangeCommand) Info ¶
func (c *ChangeCommand) Info() *cmd.Info
Info provides information about command. Satisfying Command interface.
type Command ¶
type Command struct {
cmd.SuperCommand
}
Command is the top-level command wrapping all storage functionality.
type DestroyCommand ¶
type DestroyCommand struct {
BaseBlockCommand
}
DestroyCommand blocks destroy environment.
func (*DestroyCommand) Info ¶
func (c *DestroyCommand) Info() *cmd.Info
Info provides information about command. Satisfying Command interface.
type ListCommand ¶
type ListCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
ListCommand list blocks.
func (*ListCommand) Init ¶
func (c *ListCommand) Init(args []string) (err error)
Init implements Command.Init.
func (*ListCommand) Run ¶
func (c *ListCommand) Run(ctx *cmd.Context) (err error)
Run implements Command.Run.
func (*ListCommand) SetFlags ¶
func (c *ListCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.
type RemoveCommand ¶
type RemoveCommand struct {
BaseBlockCommand
}
RemoveCommand blocks commands that remove juju objects.
func (*RemoveCommand) Info ¶
func (c *RemoveCommand) Info() *cmd.Info
Info provides information about command. Satisfying Command interface.
type UnblockClientAPI ¶
UnblockClientAPI defines the client API methods that unblock command uses.
type UnblockCommand ¶
type UnblockCommand struct { envcmd.EnvCommandBase // contains filtered or unexported fields }
UnblockCommand removes the block from desired operation.
func (*UnblockCommand) Info ¶
func (c *UnblockCommand) Info() *cmd.Info
Info provides information about command. Satisfying Command interface.
func (*UnblockCommand) Init ¶
func (c *UnblockCommand) Init(args []string) error
Init initializes the command. Satisfying Command interface.
func (*UnblockCommand) Run ¶
func (c *UnblockCommand) Run(_ *cmd.Context) error
Run unblocks previously blocked commands. Satisfying Command interface.
func (*UnblockCommand) SetFlags ¶
func (c *UnblockCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags implements Command.SetFlags.