github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/cmd/juju/block/blocksuper.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package block 5 6 import ( 7 "github.com/juju/cmd" 8 9 "github.com/juju/juju/cmd/envcmd" 10 ) 11 12 const superBlockCmdDoc = ` 13 14 Juju allows to safeguard deployed environments from unintentional damage by preventing 15 execution of operations that could alter environment. 16 17 This is done by blocking certain commands from successful execution. Blocked commands 18 must be manually unblocked to proceed. 19 20 "juju block" is used to list or to enable environment blocks in 21 the Juju environment. 22 ` 23 24 const superBlockCmdPurpose = "list and enable environment blocks" 25 26 // Command is the top-level command wrapping all storage functionality. 27 type Command struct { 28 cmd.SuperCommand 29 } 30 31 // NewSuperBlockCommand creates the block supercommand and 32 // registers the subcommands that it supports. 33 func NewSuperBlockCommand() cmd.Command { 34 blockcmd := Command{ 35 SuperCommand: *cmd.NewSuperCommand( 36 cmd.SuperCommandParams{ 37 Name: "block", 38 Doc: superBlockCmdDoc, 39 UsagePrefix: "juju", 40 Purpose: superBlockCmdPurpose, 41 })} 42 blockcmd.Register(envcmd.Wrap(&DestroyCommand{})) 43 blockcmd.Register(envcmd.Wrap(&RemoveCommand{})) 44 blockcmd.Register(envcmd.Wrap(&ChangeCommand{})) 45 blockcmd.Register(envcmd.Wrap(&ListCommand{})) 46 return &blockcmd 47 }