Skip to content

Commit 6f1579a

Browse files
Yavor16David O'Sullivan
authored andcommitted
add readiness health check support in client
1 parent 5ff0449 commit 6f1579a

File tree

16 files changed

+351
-2
lines changed

16 files changed

+351
-2
lines changed

cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/applications/ReactorApplicationsV3Test.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@
117117
import org.cloudfoundry.client.v3.processes.ProcessState;
118118
import org.cloudfoundry.client.v3.processes.ProcessStatisticsResource;
119119
import org.cloudfoundry.client.v3.processes.ProcessUsage;
120+
import org.cloudfoundry.client.v3.processes.ReadinessHealthCheck;
121+
import org.cloudfoundry.client.v3.processes.ReadinessHealthCheckType;
120122
import org.cloudfoundry.client.v3.routes.Application;
121123
import org.cloudfoundry.client.v3.routes.Destination;
122124
import org.cloudfoundry.client.v3.routes.Process;
@@ -807,6 +809,16 @@ void getProcess() {
807809
.endpoint(null)
808810
.build())
809811
.build())
812+
.readinessHealthCheck(
813+
ReadinessHealthCheck.builder()
814+
.type(ReadinessHealthCheckType.PORT)
815+
.data(
816+
Data.builder()
817+
.interval(null)
818+
.timeout(null)
819+
.endpoint(null)
820+
.build())
821+
.build())
810822
.metadata(
811823
Metadata.builder()
812824
.annotations(Collections.emptyMap())
@@ -1627,6 +1639,16 @@ void listProcesses() {
16271639
.endpoint(null)
16281640
.build())
16291641
.build())
1642+
.readinessHealthCheck(
1643+
ReadinessHealthCheck.builder()
1644+
.type(ReadinessHealthCheckType.PORT)
1645+
.data(
1646+
Data.builder()
1647+
.interval(null)
1648+
.timeout(null)
1649+
.endpoint(null)
1650+
.build())
1651+
.build())
16301652
.metadata(
16311653
Metadata.builder()
16321654
.annotations(Collections.emptyMap())
@@ -1685,6 +1707,16 @@ void listProcesses() {
16851707
.endpoint(null)
16861708
.build())
16871709
.build())
1710+
.readinessHealthCheck(
1711+
ReadinessHealthCheck.builder()
1712+
.type(ReadinessHealthCheckType.PORT)
1713+
.data(
1714+
Data.builder()
1715+
.interval(null)
1716+
.timeout(null)
1717+
.endpoint(null)
1718+
.build())
1719+
.build())
16881720
.metadata(
16891721
Metadata.builder()
16901722
.annotations(Collections.emptyMap())
@@ -2052,6 +2084,16 @@ void scale() {
20522084
.endpoint(null)
20532085
.build())
20542086
.build())
2087+
.readinessHealthCheck(
2088+
ReadinessHealthCheck.builder()
2089+
.type(ReadinessHealthCheckType.PORT)
2090+
.data(
2091+
Data.builder()
2092+
.interval(null)
2093+
.timeout(null)
2094+
.endpoint(null)
2095+
.build())
2096+
.build())
20552097
.metadata(
20562098
Metadata.builder()
20572099
.annotations(Collections.emptyMap())

cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/processes/ReactorProcessesTest.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import org.cloudfoundry.client.v3.processes.ProcessState;
4444
import org.cloudfoundry.client.v3.processes.ProcessStatisticsResource;
4545
import org.cloudfoundry.client.v3.processes.ProcessUsage;
46+
import org.cloudfoundry.client.v3.processes.ReadinessHealthCheck;
47+
import org.cloudfoundry.client.v3.processes.ReadinessHealthCheckType;
4648
import org.cloudfoundry.client.v3.processes.ScaleProcessRequest;
4749
import org.cloudfoundry.client.v3.processes.ScaleProcessResponse;
4850
import org.cloudfoundry.client.v3.processes.TerminateProcessInstanceRequest;
@@ -121,6 +123,16 @@ void get() {
121123
.endpoint(null)
122124
.build())
123125
.build())
126+
.readinessHealthCheck(
127+
ReadinessHealthCheck.builder()
128+
.type(ReadinessHealthCheckType.PORT)
129+
.data(
130+
Data.builder()
131+
.interval(null)
132+
.timeout(null)
133+
.endpoint(null)
134+
.build())
135+
.build())
124136
.metadata(
125137
Metadata.builder()
126138
.annotations(Collections.emptyMap())
@@ -309,6 +321,16 @@ void list() {
309321
.endpoint(null)
310322
.build())
311323
.build())
324+
.readinessHealthCheck(
325+
ReadinessHealthCheck.builder()
326+
.type(ReadinessHealthCheckType.PORT)
327+
.data(
328+
Data.builder()
329+
.interval(null)
330+
.timeout(null)
331+
.endpoint(null)
332+
.build())
333+
.build())
312334
.metadata(
313335
Metadata.builder()
314336
.annotations(Collections.emptyMap())
@@ -367,6 +389,16 @@ void list() {
367389
.endpoint(null)
368390
.build())
369391
.build())
392+
.readinessHealthCheck(
393+
ReadinessHealthCheck.builder()
394+
.type(ReadinessHealthCheckType.PORT)
395+
.data(
396+
Data.builder()
397+
.interval(null)
398+
.timeout(null)
399+
.endpoint(null)
400+
.build())
401+
.build())
370402
.metadata(
371403
Metadata.builder()
372404
.annotations(Collections.emptyMap())
@@ -458,6 +490,16 @@ void scale() {
458490
.endpoint(null)
459491
.build())
460492
.build())
493+
.readinessHealthCheck(
494+
ReadinessHealthCheck.builder()
495+
.type(ReadinessHealthCheckType.PORT)
496+
.data(
497+
Data.builder()
498+
.interval(null)
499+
.timeout(null)
500+
.endpoint(null)
501+
.build())
502+
.build())
461503
.metadata(
462504
Metadata.builder()
463505
.annotations(Collections.emptyMap())
@@ -545,6 +587,16 @@ void update() {
545587
.endpoint(null)
546588
.build())
547589
.build())
590+
.readinessHealthCheck(
591+
ReadinessHealthCheck.builder()
592+
.type(ReadinessHealthCheckType.PORT)
593+
.data(
594+
Data.builder()
595+
.interval(null)
596+
.timeout(null)
597+
.endpoint(null)
598+
.build())
599+
.build())
548600
.metadata(
549601
Metadata.builder()
550602
.annotations(Collections.emptyMap())

cloudfoundry-client-reactor/src/test/resources/fixtures/client/v3/apps/GET_{id}_processes_response.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
"endpoint": null
2929
}
3030
},
31+
"readiness_health_check": {
32+
"type": "port",
33+
"data": {
34+
"interval": null,
35+
"endpoint": null,
36+
"invocation_timeout": null
37+
}
38+
},
3139
"metadata": {
3240
"annotations": {},
3341
"labels": {}
@@ -68,6 +76,14 @@
6876
"endpoint": null
6977
}
7078
},
79+
"readiness_health_check": {
80+
"type": "port",
81+
"data": {
82+
"interval": null,
83+
"endpoint": null,
84+
"invocation_timeout": null
85+
}
86+
},
7187
"metadata": {
7288
"annotations": {},
7389
"labels": {}

cloudfoundry-client-reactor/src/test/resources/fixtures/client/v3/apps/GET_{id}_processes_{type}_response.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"endpoint": null
1313
}
1414
},
15+
"readiness_health_check": {
16+
"type": "port",
17+
"data": {
18+
"interval": null,
19+
"endpoint": null,
20+
"invocation_timeout": null
21+
}
22+
},
1523
"metadata": {
1624
"annotations": {},
1725
"labels": {}

cloudfoundry-client-reactor/src/test/resources/fixtures/client/v3/apps/PUT_{id}_processes_{type}_actions_scale_response.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"endpoint": null
1313
}
1414
},
15+
"readiness_health_check": {
16+
"type": "port",
17+
"data": {
18+
"interval": null,
19+
"endpoint": null,
20+
"invocation_timeout": null
21+
}
22+
},
1523
"metadata": {
1624
"annotations": {},
1725
"labels": {}

cloudfoundry-client-reactor/src/test/resources/fixtures/client/v3/processes/GET_response.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
"endpoint": null
2929
}
3030
},
31+
"readiness_health_check": {
32+
"type": "port",
33+
"data": {
34+
"interval": null,
35+
"endpoint": null,
36+
"invocation_timeout": null
37+
}
38+
},
3139
"metadata": {
3240
"annotations": {},
3341
"labels": {}
@@ -68,6 +76,14 @@
6876
"endpoint": null
6977
}
7078
},
79+
"readiness_health_check": {
80+
"type": "port",
81+
"data": {
82+
"interval": null,
83+
"endpoint": null,
84+
"invocation_timeout": null
85+
}
86+
},
7187
"metadata": {
7288
"annotations": {},
7389
"labels": {}

cloudfoundry-client-reactor/src/test/resources/fixtures/client/v3/processes/GET_{id}_response.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"endpoint": null
1313
}
1414
},
15+
"readiness_health_check": {
16+
"type": "port",
17+
"data": {
18+
"interval": null,
19+
"endpoint": null,
20+
"invocation_timeout": null
21+
}
22+
},
1523
"metadata": {
1624
"annotations": {},
1725
"labels": {}

cloudfoundry-client-reactor/src/test/resources/fixtures/client/v3/processes/PATCH_{id}_response.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"endpoint": null
1313
}
1414
},
15+
"readiness_health_check": {
16+
"type": "port",
17+
"data": {
18+
"interval": null,
19+
"endpoint": null,
20+
"invocation_timeout": null
21+
}
22+
},
1523
"metadata": {
1624
"annotations": {},
1725
"labels": {}

cloudfoundry-client-reactor/src/test/resources/fixtures/client/v3/processes/POST_{id}_actions_scale_response.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"endpoint": null
1313
}
1414
},
15+
"readiness_health_check": {
16+
"type": "port",
17+
"data": {
18+
"interval": null,
19+
"endpoint": null,
20+
"invocation_timeout": null
21+
}
22+
},
1523
"metadata": {
1624
"annotations": {},
1725
"labels": {}

cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/processes/Process.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ public abstract class Process extends Resource {
4444
@JsonProperty("health_check")
4545
public abstract HealthCheck getHealthCheck();
4646

47+
/**
48+
* The readiness health check
49+
*/
50+
@JsonProperty("readiness_health_check")
51+
public abstract ReadinessHealthCheck getReadinessHealthCheck();
52+
4753
/**
4854
* The instances
4955
*/

0 commit comments

Comments
 (0)