Repository navigation
Expand file tree
/
Copy pathHealthConfig.php
More file actions
244 lines (220 loc) · 7.16 KB
/
Copy pathHealthConfig.php
File metadata and controls
244 lines (220 loc) · 7.16 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?php
declare(strict_types=1);
namespace Docker\API\Model;
use Docker\API\Runtime\AdditionalAndPatternProperties;
use Docker\API\Runtime\AdditionalPropertiesInterface;
class HealthConfig implements AdditionalPropertiesInterface
{
use AdditionalAndPatternProperties;
/**
* @var array
*/
protected $initialized = [];
public function isInitialized($property): bool
{
return \array_key_exists($property, $this->initialized);
}
/**
* The test to perform. Possible values are:
*
* - `[]` inherit healthcheck from image or parent image
* - `["NONE"]` disable healthcheck
* - `["CMD", args...]` exec arguments directly
* - `["CMD-SHELL", command]` run command with system's default shell
*
* A non-zero exit code indicates a failed healthcheck:
* - `0` healthy
* - `1` unhealthy
* - `2` reserved (treated as unhealthy)
* - other values: error running probe
*
* @var list<string>|null
*/
protected $test;
/**
* The time to wait between checks in nanoseconds. It should be 0 or at
* least 1000000 (1 ms). 0 means inherit.
*
* @var int|null
*/
protected $interval;
/**
* The time to wait before considering the check to have hung. It should
* be 0 or at least 1000000 (1 ms). 0 means inherit.
*
* If the health check command does not complete within this timeout,
* the check is considered failed and the health check process is
* forcibly terminated without a graceful shutdown.
*
* @var int|null
*/
protected $timeout;
/**
* The number of consecutive failures needed to consider a container as
* unhealthy. 0 means inherit.
*
* @var int|null
*/
protected $retries;
/**
* Start period for the container to initialize before starting
* health-retries countdown in nanoseconds. It should be 0 or at least
* 1000000 (1 ms). 0 means inherit.
*
* @var int|null
*/
protected $startPeriod;
/**
* The time to wait between checks in nanoseconds during the start period.
* It should be 0 or at least 1000000 (1 ms). 0 means inherit.
*
* @var int|null
*/
protected $startInterval;
/**
* The test to perform. Possible values are:
*
* - `[]` inherit healthcheck from image or parent image
* - `["NONE"]` disable healthcheck
* - `["CMD", args...]` exec arguments directly
* - `["CMD-SHELL", command]` run command with system's default shell
*
* A non-zero exit code indicates a failed healthcheck:
* - `0` healthy
* - `1` unhealthy
* - `2` reserved (treated as unhealthy)
* - other values: error running probe
*
* @return list<string>|null
*/
public function getTest(): ?array
{
return $this->test;
}
/**
* The test to perform. Possible values are:
*
* - `[]` inherit healthcheck from image or parent image
* - `["NONE"]` disable healthcheck
* - `["CMD", args...]` exec arguments directly
* - `["CMD-SHELL", command]` run command with system's default shell
*
* A non-zero exit code indicates a failed healthcheck:
* - `0` healthy
* - `1` unhealthy
* - `2` reserved (treated as unhealthy)
* - other values: error running probe
*
* @param list<string>|null $test
*/
public function setTest(?array $test): self
{
$this->initialized['test'] = true;
$this->test = $test;
return $this;
}
/**
* The time to wait between checks in nanoseconds. It should be 0 or at
* least 1000000 (1 ms). 0 means inherit.
*/
public function getInterval(): ?int
{
return $this->interval;
}
/**
* The time to wait between checks in nanoseconds. It should be 0 or at
* least 1000000 (1 ms). 0 means inherit.
*/
public function setInterval(?int $interval): self
{
$this->initialized['interval'] = true;
$this->interval = $interval;
return $this;
}
/**
* The time to wait before considering the check to have hung. It should
* be 0 or at least 1000000 (1 ms). 0 means inherit.
*
* If the health check command does not complete within this timeout,
* the check is considered failed and the health check process is
* forcibly terminated without a graceful shutdown.
*/
public function getTimeout(): ?int
{
return $this->timeout;
}
/**
* The time to wait before considering the check to have hung. It should
* be 0 or at least 1000000 (1 ms). 0 means inherit.
*
* If the health check command does not complete within this timeout,
* the check is considered failed and the health check process is
* forcibly terminated without a graceful shutdown.
*/
public function setTimeout(?int $timeout): self
{
$this->initialized['timeout'] = true;
$this->timeout = $timeout;
return $this;
}
/**
* The number of consecutive failures needed to consider a container as
* unhealthy. 0 means inherit.
*/
public function getRetries(): ?int
{
return $this->retries;
}
/**
* The number of consecutive failures needed to consider a container as
* unhealthy. 0 means inherit.
*/
public function setRetries(?int $retries): self
{
$this->initialized['retries'] = true;
$this->retries = $retries;
return $this;
}
/**
* Start period for the container to initialize before starting
* health-retries countdown in nanoseconds. It should be 0 or at least
* 1000000 (1 ms). 0 means inherit.
*/
public function getStartPeriod(): ?int
{
return $this->startPeriod;
}
/**
* Start period for the container to initialize before starting
* health-retries countdown in nanoseconds. It should be 0 or at least
* 1000000 (1 ms). 0 means inherit.
*/
public function setStartPeriod(?int $startPeriod): self
{
$this->initialized['startPeriod'] = true;
$this->startPeriod = $startPeriod;
return $this;
}
/**
* The time to wait between checks in nanoseconds during the start period.
* It should be 0 or at least 1000000 (1 ms). 0 means inherit.
*/
public function getStartInterval(): ?int
{
return $this->startInterval;
}
/**
* The time to wait between checks in nanoseconds during the start period.
* It should be 0 or at least 1000000 (1 ms). 0 means inherit.
*/
public function setStartInterval(?int $startInterval): self
{
$this->initialized['startInterval'] = true;
$this->startInterval = $startInterval;
return $this;
}
public function definedProperties(): array
{
return ['test' => ['Test', 'getTest', 'setTest'], 'interval' => ['Interval', 'getInterval', 'setInterval'], 'timeout' => ['Timeout', 'getTimeout', 'setTimeout'], 'retries' => ['Retries', 'getRetries', 'setRetries'], 'startPeriod' => ['StartPeriod', 'getStartPeriod', 'setStartPeriod'], 'startInterval' => ['StartInterval', 'getStartInterval', 'setStartInterval']];
}
}