~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/apiserver/params/controller.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2016 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package params
 
5
 
 
6
// DestroyControllerArgs holds the arguments for destroying a controller.
 
7
type DestroyControllerArgs struct {
 
8
        // DestroyModels specifies whether or not the hosted models
 
9
        // should be destroyed as well. If this is not specified, and there are
 
10
        // other hosted models, the destruction of the controller will fail.
 
11
        DestroyModels bool `json:"destroy-models"`
 
12
}
 
13
 
 
14
// ModelBlockInfo holds information about an model and its
 
15
// current blocks.
 
16
type ModelBlockInfo struct {
 
17
        Name     string   `json:"name"`
 
18
        UUID     string   `json:"model-uuid"`
 
19
        OwnerTag string   `json:"owner-tag"`
 
20
        Blocks   []string `json:"blocks"`
 
21
}
 
22
 
 
23
// ModelBlockInfoList holds information about the blocked models
 
24
// for a controller.
 
25
type ModelBlockInfoList struct {
 
26
        Models []ModelBlockInfo `json:"models,omitempty"`
 
27
}
 
28
 
 
29
// RemoveBlocksArgs holds the arguments for the RemoveBlocks command. It is a
 
30
// struct to facilitate the easy addition of being able to remove blocks for
 
31
// individual models at a later date.
 
32
type RemoveBlocksArgs struct {
 
33
        All bool `json:"all"`
 
34
}
 
35
 
 
36
// ModelStatus holds information about the status of a juju model.
 
37
type ModelStatus struct {
 
38
        ModelTag           string `json:"model-tag"`
 
39
        Life               Life   `json:"life"`
 
40
        HostedMachineCount int    `json:"hosted-machine-count"`
 
41
        ServiceCount       int    `json:"service-count"`
 
42
        OwnerTag           string `json:"owner-tag"`
 
43
}
 
44
 
 
45
// ModelStatusResults holds status information about a group of models.
 
46
type ModelStatusResults struct {
 
47
        Results []ModelStatus `json:"models"`
 
48
}
 
49
 
 
50
// InitiateModelMigrationArgs holds the details required to start one
 
51
// or more model migrations.
 
52
type InitiateModelMigrationArgs struct {
 
53
        Specs []ModelMigrationSpec `json:"specs"`
 
54
}
 
55
 
 
56
// ModelMigrationSpec holds the details required to start the
 
57
// migration of a single model.
 
58
type ModelMigrationSpec struct {
 
59
        ModelTag   string                   `json:"model-tag"`
 
60
        TargetInfo ModelMigrationTargetInfo `json:"target-info"`
 
61
}
 
62
 
 
63
// ModelMigrationTargetInfo holds the details required to connect to
 
64
// and authenticate with a remote controller for model migration.
 
65
type ModelMigrationTargetInfo struct {
 
66
        ControllerTag string   `json:"controller-tag"`
 
67
        Addrs         []string `json:"addrs"`
 
68
        CACert        string   `json:"ca-cert"`
 
69
        AuthTag       string   `json:"auth-tag"`
 
70
        Password      string   `json:"password"`
 
71
}
 
72
 
 
73
// InitiateModelMigrationResults is used to return the result of one
 
74
// or more attempts to start model migrations.
 
75
type InitiateModelMigrationResults struct {
 
76
        Results []InitiateModelMigrationResult `json:"results"`
 
77
}
 
78
 
 
79
// InitiateModelMigrationResult is used to return the result of one
 
80
// model migration initiation attempt.
 
81
type InitiateModelMigrationResult struct {
 
82
        ModelTag string `json:"model-tag"`
 
83
        Error    *Error `json:"error"`
 
84
        Id       string `json:"id"` // the ID for the migration attempt
 
85
}