github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/apiserver/params/block.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package params 5 6 // Block describes a Juju block that protects model from 7 // corruption. 8 type Block struct { 9 // Id is this blocks id. 10 Id string `json:"id"` 11 12 // Tag holds the tag of the entity that is blocked. 13 Tag string `json:"tag"` 14 15 // Type is block type as per state.multiwatcher.BlockType. 16 // Valid types are "BlockDestroy", "BlockRemove" and "BlockChange". 17 Type string `json:"type"` 18 19 // Message is a descriptive or an explanatory message 20 // that the block was created with. 21 Message string `json:"message,omitempty"` 22 } 23 24 // BlockSwitchParams holds the parameters for switching 25 // a block on/off. 26 type BlockSwitchParams struct { 27 // Type is block type as per state.multiwatcher.BlockType. 28 // Valid types are "BlockDestroy", "BlockRemove" and "BlockChange". 29 Type string `json:"type"` 30 31 // Message is a descriptive or an explanatory message 32 // that accompanies the switch. 33 Message string `json:"message,omitempty"` 34 } 35 36 // BlockResult holds the result of an API call to retrieve details 37 // for a block. 38 type BlockResult struct { 39 Result Block `json:"result"` 40 Error *Error `json:"error,omitempty"` 41 } 42 43 // BlockResults holds the result of an API call to list blocks. 44 type BlockResults struct { 45 Results []BlockResult `json:"results,omitempty"` 46 }