@@ -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,11 +82,11 @@ 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
@@ -98,6 +100,23 @@ type ProcessData struct {
98
100
Endpoint * string `json:"endpoint,omitempty"`
99
101
}
100
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
+
101
120
type ProcessRelationships struct {
102
121
App ToOneRelationship `json:"app"` // The app the process belongs to
103
122
Revision ToOneRelationship `json:"revision"` // The app revision the process is currently running
@@ -182,3 +201,35 @@ func (p *ProcessUpdate) WithHealthCheckEndpoint(endpoint string) *ProcessUpdate
182
201
p .HealthCheck .Data .Endpoint = & endpoint
183
202
return p
184
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