-
Notifications
You must be signed in to change notification settings - Fork 142
/
gce.go
68 lines (61 loc) · 2.27 KB
/
gce.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package gce
//GCE struct reperesnts Google Compute Engine.
type GCE struct {
Name string `json:"name"`
Zone string `json:"zone"`
MachineType string `json:"machineType"`
Disks []Disk `json:"disks"`
CanIPForward bool `json:"canIpForward"`
NetworkInterfaces []NetworkInterface `json:"networkInterfaces"`
Description string `json:"description"`
selfLink string `json:"selfLink"`
Scheduling `json:"scheduling"`
}
//Disk represents GCE disk.
type Disk struct {
Type string `json:"type"`
Boot bool `json:"boot"`
Mode string `json:"mode"`
AutoDelete bool `json:"autoDelete"`
DeviceName string `json:"deviceName"`
InitializeParams InitializeParam `json:"initializeParams"`
}
//InitializeParam represents GCE disk InitializeParam.
type InitializeParam struct {
SourceImage string `json:"sourceImage"`
DiskType string `json:"diskType"`
DiskSizeGb string `json:"diskSizeGb"`
}
//NetworkInterface represents GCE NetworkInterface.
type NetworkInterface struct {
Network string `json:"network"`
Subnetwork string `json:"subnetwork"`
AccessConfigs []accessConfig `json:"accessConfigs"`
}
//accessConfig represents GCE NetworkInterface accessConfig.
type accessConfig struct {
Name string `json:"name"`
Type string `json:"type"`
}
//Scheduling represents GCE instance Scheduling.
type Scheduling struct {
Preemptible bool `json:"preemptible"`
OnHostMaintenance string `json:"onHostMaintenance"`
AutomaticRestart bool `json:"automaticRestart"`
}
type GCEResponse struct {
Kind string `json:"kind"`
ID string `json:"id"`
Name string `json:"name"`
Zone string `json:"zone"`
OperationType string `json:"operationType"`
TargetLink string `json:"targetLink"`
TargetID string `json:"targetId"`
Status string `json:"status"`
User string `json:"user"`
Progress int `json:"progress"`
InsertTime string `json:"insertTime"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
SelfLink string `json:"selfLink"`
}