github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/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 10 const superBlockCmdDoc = ` 11 12 Juju allows to safeguard deployed models from unintentional damage by preventing 13 execution of operations that could alter model. 14 15 This is done by blocking certain commands from successful execution. Blocked commands 16 must be manually unblocked to proceed. 17 18 "juju block" is used to list or to enable model blocks in 19 the Juju model. 20 ` 21 22 const superBlockCmdPurpose = "list and enable model blocks" 23 24 // Command is the top-level command wrapping all storage functionality. 25 type Command struct { 26 cmd.SuperCommand 27 } 28 29 // NewSuperBlockCommand creates the block supercommand and 30 // registers the subcommands that it supports. 31 func NewSuperBlockCommand() cmd.Command { 32 blockcmd := Command{ 33 SuperCommand: *cmd.NewSuperCommand( 34 cmd.SuperCommandParams{ 35 Name: "block", 36 Doc: superBlockCmdDoc, 37 UsagePrefix: "juju", 38 Purpose: superBlockCmdPurpose, 39 })} 40 blockcmd.Register(newDestroyCommand()) 41 blockcmd.Register(newRemoveCommand()) 42 blockcmd.Register(newChangeCommand()) 43 blockcmd.Register(newListCommand()) 44 return &blockcmd 45 }