-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstructs.go
More file actions
81 lines (65 loc) · 1.81 KB
/
structs.go
File metadata and controls
81 lines (65 loc) · 1.81 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package gogo
import "sync"
// CloudKind is the kind of cloud, eg. aws, maas, etc.
type CloudKind string
// Supported Cloud Kinds
const (
Aws CloudKind = "aws"
Maas CloudKind = "maas"
)
// Juju defines the cluster name, which bundle to use, and the manifest for credentials and cloud
type Juju struct {
Kind CloudKind // should be gogo.Aws or gogo.Maas - will be used to figure out which creds and cloud to set
Name string
Bundle string // ex "cs:bundle/canonical-kubernetes-193"
MaasCl MaasCloud
MaasCr MaasCredentials
AwsCl AWSCloud
AwsCr AWSCredentials
}
// MaasCloud information
type MaasCloud struct {
Endpoint string
}
// MaasCredentials to be used with MaasCloud
type MaasCredentials struct {
Username string
MaasOauth string
}
// AWSCredentials information
type AWSCredentials struct {
Username string
AccessKey string
SecretKey string
}
// AWSCloud information to be used with AWS Creds
type AWSCloud struct {
Region string
}
// Parallel sets the waitgroup if user wishes to bring up several clusters at once
type Parallel struct {
wg sync.WaitGroup
}
// the following structs are for json parsing used with GetJujuStatus()
type jujuStatus struct {
ApplicationResults map[string]applications `json:"applications"`
Machines map[string]machines `json:"machines"`
}
type machines struct {
MachStatus map[string]string `json:"juju-status"`
}
type applications struct {
AppStatus map[string]string `json:"application-status"`
}
// for use with json parsing with DestroyComplete
type jujuControllers struct {
Controllers map[string]interface{} `json:"controllers"`
}
// for use with json parsing with ControllerReady
type jujuModels struct {
Models []model `json:"models"`
}
type model struct {
ShortName string `json:"short-name"`
Status map[string]string `json:"status"`
}