@@ -21,8 +21,9 @@ type Process struct {
21
21
// The log rate in bytes per second allocated per instance
22
22
LogRateLimitInBytesPerSecond int `json:"log_rate_limit_in_bytes_per_second"`
23
23
24
- HealthCheck ProcessHealthCheck `json:"health_check"`
25
- Relationships ProcessRelationships `json:"relationships"`
24
+ HealthCheck ProcessHealthCheck `json:"health_check"`
25
+ ReadinessCheck ProcessReadinessCheck `json:"readiness_health_check"`
26
+ Relationships ProcessRelationships `json:"relationships"`
26
27
27
28
Metadata * Metadata `json:"metadata"`
28
29
Resource `json:",inline"`
@@ -36,8 +37,9 @@ type ProcessList struct {
36
37
type ProcessUpdate struct {
37
38
Command * string `json:"command"`
38
39
39
- HealthCheck * ProcessHealthCheck `json:"health_check,omitempty"`
40
- Metadata * Metadata `json:"metadata,omitempty"`
40
+ HealthCheck * ProcessHealthCheck `json:"health_check,omitempty"`
41
+ ReadinessCheck * ProcessReadinessCheck `json:"readiness_health_check,omitempty"`
42
+ Metadata * Metadata `json:"metadata,omitempty"`
41
43
}
42
44
43
45
type ProcessStats struct {
@@ -80,21 +82,41 @@ type ProcessScale struct {
80
82
81
83
type ProcessHealthCheck struct {
82
84
// The type of health check to perform; valid values are http, port, and process; default is port
83
- Type string `json:"type"`
84
- Data ProcessData `json:"data"`
85
+ Type string `json:"type"`
86
+ Data ProcessHealthCheckData `json:"data"`
85
87
}
86
88
87
- type ProcessData struct {
89
+ type ProcessHealthCheckData struct {
88
90
// The duration in seconds that health checks can fail before the process is restarted
89
91
Timeout * int `json:"timeout"`
90
92
91
93
// The timeout in seconds for individual health check requests for http and port health checks
92
94
InvocationTimeout * int `json:"invocation_timeout,omitempty"`
93
95
96
+ // The interval in seconds between health check requests
97
+ Interval * int `json:"interval,omitempty"`
98
+
94
99
// The endpoint called to determine if the app is healthy; this key is only present for http health check
95
100
Endpoint * string `json:"endpoint,omitempty"`
96
101
}
97
102
103
+ type ProcessReadinessCheck struct {
104
+ // The type of health check to perform; valid values are http, port, and process; default is process
105
+ Type string `json:"type"`
106
+ Data ProcessReadinessCheckData `json:"data"`
107
+ }
108
+
109
+ type ProcessReadinessCheckData struct {
110
+ // The timeout in seconds for individual readiness check requests for http and port health checks
111
+ InvocationTimeout * int `json:"invocation_timeout,omitempty"`
112
+
113
+ // The interval in seconds between readiness check requests
114
+ Interval * int `json:"interval,omitempty"`
115
+
116
+ // The endpoint called to determine if the app is ready; this key is only present for http readiness checks
117
+ Endpoint * string `json:"endpoint,omitempty"`
118
+ }
119
+
98
120
type ProcessRelationships struct {
99
121
App ToOneRelationship `json:"app"` // The app the process belongs to
100
122
Revision ToOneRelationship `json:"revision"` // The app revision the process is currently running
@@ -164,10 +186,50 @@ func (p *ProcessUpdate) WithHealthCheckInvocationTimeout(timeout int) *ProcessUp
164
186
return p
165
187
}
166
188
189
+ func (p * ProcessUpdate ) WithHealthCheckInterval (interval int ) * ProcessUpdate {
190
+ if p .HealthCheck == nil {
191
+ p .HealthCheck = & ProcessHealthCheck {}
192
+ }
193
+ p .HealthCheck .Data .Interval = & interval
194
+ return p
195
+ }
196
+
167
197
func (p * ProcessUpdate ) WithHealthCheckEndpoint (endpoint string ) * ProcessUpdate {
168
198
if p .HealthCheck == nil {
169
199
p .HealthCheck = & ProcessHealthCheck {}
170
200
}
171
201
p .HealthCheck .Data .Endpoint = & endpoint
172
202
return p
173
203
}
204
+
205
+ func (p * ProcessUpdate ) WithReadinessCheckType (hcType string ) * ProcessUpdate {
206
+ if p .ReadinessCheck == nil {
207
+ p .ReadinessCheck = & ProcessReadinessCheck {}
208
+ }
209
+ p .ReadinessCheck .Type = hcType
210
+ return p
211
+ }
212
+
213
+ func (p * ProcessUpdate ) WithReadinessCheckInvocationTimeout (timeout int ) * ProcessUpdate {
214
+ if p .ReadinessCheck == nil {
215
+ p .ReadinessCheck = & ProcessReadinessCheck {}
216
+ }
217
+ p .ReadinessCheck .Data .InvocationTimeout = & timeout
218
+ return p
219
+ }
220
+
221
+ func (p * ProcessUpdate ) WithReadinessCheckInterval (interval int ) * ProcessUpdate {
222
+ if p .ReadinessCheck == nil {
223
+ p .ReadinessCheck = & ProcessReadinessCheck {}
224
+ }
225
+ p .ReadinessCheck .Data .Interval = & interval
226
+ return p
227
+ }
228
+
229
+ func (p * ProcessUpdate ) WithReadinessCheckEndpoint (endpoint string ) * ProcessUpdate {
230
+ if p .ReadinessCheck == nil {
231
+ p .ReadinessCheck = & ProcessReadinessCheck {}
232
+ }
233
+ p .ReadinessCheck .Data .Endpoint = & endpoint
234
+ return p
235
+ }
0 commit comments