-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.go
155 lines (150 loc) · 6.59 KB
/
deploy.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
package service
import (
"time"
)
// deploy binding from JSON
type DeployServices struct {
Services []Deploy `json:"services" binding:"required"`
}
type Deploy struct {
Cluster string `json:"cluster" binding:"required"`
ServiceName string `json:"serviceName"`
ServicePort int64 `json:"servicePort"`
ServiceProtocol string `json:"serviceProtocol" binding:"required"`
DesiredCount int64 `json:"desiredCount" binding:"required"`
MinimumHealthyPercent int64 `json:"minimumHealthyPercent"`
MaximumPercent int64 `json:"maximumPercent"`
Containers []*DeployContainer `json:"containers" binding:"required,dive"`
HealthCheck DeployHealthCheck `json:"healthCheck"`
RuleConditions []*DeployRuleConditions `json:"ruleConditions`
NetworkMode string `json:"networkMode"`
NetworkConfiguration DeployNetworkConfiguration `json:"networkConfiguration"`
PlacementConstraints []DeployPlacementConstraint `json:"placementConstraints"`
LaunchType string `json:"launchType"`
DeregistrationDelay int64 `json:"deregistrationDelay"`
Stickiness DeployStickiness `json:"stickiness"`
}
type DeployContainer struct {
ContainerName string `json:"containerName" binding:"required"`
ContainerTag string `json:"containerTag" binding:"required"`
ContainerPort int64 `json:"containerPort"`
ContainerCommand []*string `json:"containerCommand"`
ContainerImage string `json:"containerImage`
ContainerURI string `json:"containerURI"`
Essential bool `json:"essential"`
Memory int64 `json:"memory"`
MemoryReservation int64 `json:"memoryReservation"`
CPU int64 `json:"cpu"`
CPUReservation int64 `json:"cpuReservation"`
}
type DeployNetworkConfiguration struct {
AssignPublicIp string `json:"assignPublicIp"`
SecurityGroups []string `json:"securityGroups"`
Subnets []string `json:"subnets"`
}
type DeployPlacementConstraint struct {
Expression string `json:"expression"`
Type string `json:"type"`
}
type DeployHealthCheck struct {
HealthyThreshold int64 `json:"healthyThreshold"`
UnhealthyThreshold int64 `json:"unhealthyThreshold"`
Path string `json:"path"`
Port string `json:"port"`
Protocol string `json:"protocol"`
Interval int64 `json:"interval"`
Matcher string `json:"matcher"`
Timeout int64 `json:"timeout"`
GracePeriodSeconds int64 `json:"gracePeriodSeconds"`
}
type DeployRuleConditions struct {
Listeners []string `json:"listeners"`
PathPattern string `json:"pathPattern"`
Hostname string `json:"hostname"`
}
type DeployStickiness struct {
Enabled bool `json:"enabled"`
Duration int64 `json:"duration"`
}
type DeployResult struct {
ServiceName string `json:"serviceName"`
ClusterName string `json:"clusterName"`
TaskDefinitionArn string `json:"taskDefinitionArn"`
Status string `json:"status"`
DeployError string `json:"deployError"`
DeploymentTime time.Time `json:"deploymentTime"`
}
type DeployServiceParameter struct {
Name string `json:"name" binding:"required"`
Value string `json:"value" binding:"required"`
Encrypted bool `json:"encrypted"`
}
type RunningService struct {
ServiceName string `json:"serviceName"`
ClusterName string `json:"clusterName"`
RunningCount int64 `json:"runningCount"`
PendingCount int64 `json:"pendingCount"`
DesiredCount int64 `json:"desiredCount"`
Status string `json:"status"`
Events []RunningServiceEvent `json:"events"`
Deployments []RunningServiceDeployment `json:"deployments"`
Tasks []RunningTask `json:"tasks"`
}
type RunningServiceDeployment struct {
Status string `json:"status"`
RunningCount int64 `json:"runningCount"`
PendingCount int64 `json:"pendingCount"`
DesiredCount int64 `json:"desiredCount"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
TaskDefinition string `json:"taskDefinition"`
}
type RunningServiceEvent struct {
CreatedAt time.Time `json:"createdAt"`
Id string `json:"id"`
Message string `json:"message"`
}
type ServiceVersion struct {
ImageName string `json:"imageName"`
Tag string `json:"tag"`
ImageId string `json:"imageId"`
LastDeploy time.Time `json:"lastDeploy"`
}
type RunningTask struct {
ContainerInstanceArn string `json:"containerInstanceArn"`
Containers []RunningTaskContainer `json:"containers"`
Cpu string `json:"cpu"`
CreatedAt time.Time `json:"createdAt"`
DesiredStatus string `json:"desiredStatus"`
ExecutionStoppedAt time.Time `json:"executionStoppedAt"`
Group string `json:"group"`
LastStatus string `json:"lastStatus"`
LaunchType string `json:"launchType"`
Memory string `json:"memory"`
PullStartedAt time.Time `json:"pullStartedAt"`
PullStoppedAt time.Time `json:"pullStoppedAt"`
StartedAt time.Time `json:"startedAt"`
StartedBy string `json:"startedBy"`
StoppedAt time.Time `json:"stoppedAt"`
StoppedReason string `json:"stoppedReason"`
StoppingAt time.Time `json:"stoppingAt"`
TaskArn string `json:"taskArn"`
TaskDefinitionArn string `json:"taskDefinitionArn"`
Version int64 `json:"version"`
}
type RunningTaskContainer struct {
ContainerArn string `json:"containerArn"`
ExitCode int64 `json:"exitCode"`
LastStatus string `json:"lastStatus"`
Name string `json:"name"`
Reason string `json:"reason"`
}
// "Run ad-hoc task" type
type RunTask struct {
StartedBy string `json:"startedBy"`
ContainerOverrides []RunTaskContainerOverride `json:"containerOverrides"`
}
type RunTaskContainerOverride struct {
Name string `json:"name"`
Command []string `json:"command"`
}