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