Skip to content

Commit 35753d7

Browse files
Merge pull request #1257 from cloudfoundry/anthony-health-check2
Health Check: with Yavor squashed commit with proper CLA and fixed compilation and tests
2 parents dd6fbf3 + 7bb0534 commit 35753d7

File tree

32 files changed

+525
-20
lines changed

32 files changed

+525
-20
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ bin/
99
.factorypath
1010
.gradle
1111
.history/
12+
*.iml

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

+42
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

+52
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

+16
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

+8
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

+8
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

+16
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

+8
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

+8
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

+8
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/CloudFoundryClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public interface CloudFoundryClient {
8181
/**
8282
* The currently supported Cloud Controller API version
8383
*/
84-
String SUPPORTED_API_VERSION = "2.233.0";
84+
String SUPPORTED_API_VERSION = "2.245.0";
8585

8686
/**
8787
* Main entry point to the Cloud Foundry Application Usage Events Client API

cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/applications/_ApplicationRelationships.java

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import com.fasterxml.jackson.annotation.JsonProperty;
2020
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
21+
22+
import org.cloudfoundry.Nullable;
2123
import org.cloudfoundry.client.v3.ToOneRelationship;
2224
import org.immutables.value.Value;
2325

@@ -34,4 +36,10 @@ abstract class _ApplicationRelationships {
3436
@JsonProperty("space")
3537
abstract ToOneRelationship getSpace();
3638

39+
/**
40+
* The current droplet relationship
41+
*/
42+
@JsonProperty("current_droplet")
43+
@Nullable
44+
abstract ToOneRelationship getCurrentDroplet();
3745
}

cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/deployments/Deployment.java

+7
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,11 @@ public abstract class Deployment extends Resource {
9999
@JsonProperty("strategy")
100100
@Nullable
101101
public abstract DeploymentStrategy getStrategy();
102+
103+
/**
104+
* The options for the deployment
105+
*/
106+
@JsonProperty("options")
107+
@Nullable
108+
public abstract Options getOptions();
102109
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2013-2021 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.cloudfoundry.client.v3.deployments;
18+
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
21+
import org.immutables.value.Value;
22+
23+
@JsonDeserialize
24+
@Value.Immutable
25+
abstract class _Options {
26+
27+
/**
28+
* The The maximum number of new instances to deploy simultaneously
29+
*/
30+
@JsonProperty("max_in_flight")
31+
abstract Integer getMaxInFlight();
32+
33+
}

0 commit comments

Comments
 (0)