@@ -89,21 +89,21 @@ ifdef::cloud-hosted[]
89
89
Open another command-line session by selecting **Terminal** > **New Terminal** from the menu of the IDE.
90
90
To access the **system** service, run the following curl command:
91
91
```
92
- curl http://localhost:9080/system/properties
92
+ curl -s http://localhost:9080/system/properties | jq
93
93
```
94
94
{: codeblock}
95
95
96
96
To access the **inventory** service, run the following curl command:
97
97
```
98
- curl http://localhost:9080/inventory/systems
98
+ curl -s http://localhost:9080/inventory/systems | jq
99
99
```
100
100
{: codeblock}
101
101
102
102
Visit the http://localhost:9080/health URL to see the
103
103
overall health status of the application, as well as the aggregated data of the liveness
104
104
and readiness checks. Run the following curl command:
105
105
```
106
- curl http://localhost:9080/health
106
+ curl -s http://localhost:9080/health | jq
107
107
```
108
108
{: codeblock}
109
109
@@ -114,14 +114,14 @@ checks show the state of the **inventory** service. As you might expect, both se
114
114
You can also access the **/health/ready** endpoint by visiting the http://localhost:9080/health/ready
115
115
URL to view the data from the readiness health checks. Run the following curl command:
116
116
```
117
- curl http://localhost:9080/health/ready
117
+ curl -s http://localhost:9080/health/ready | jq
118
118
```
119
119
{: codeblock}
120
120
121
121
Similarly, access the **/health/live** endpoint by visiting the http://localhost:9080/health/live
122
122
URL to view the data from the liveness health checks. Run the following curl command:
123
123
```
124
- curl http://localhost:9080/health/live
124
+ curl -s http://localhost:9080/health/live | jq
125
125
```
126
126
{: codeblock}
127
127
endif::[]
@@ -183,7 +183,7 @@ include::finish/src/main/liberty/config/server.xml[]
183
183
----
184
184
185
185
SystemReadinessCheck.java
186
- [source, java, linenums, role='code_column hide_tags=copyright tags=SystemReadinessCheck']
186
+ [source, java, linenums, role='code_column tags=SystemReadinessCheck hide_tags=copyright ']
187
187
----
188
188
include::finish/src/main/java/io/openliberty/guides/system/SystemReadinessCheck.java[]
189
189
----
@@ -220,7 +220,7 @@ health checks.
220
220
----
221
221
222
222
SystemLivenessCheck.java
223
- [source, java, linenums, role='code_column hide_tags=copyright tags=SystemLivenessCheck']
223
+ [source, java, linenums, role='code_column tags=SystemLivenessCheck hide_tags=copyright ']
224
224
----
225
225
include::finish/src/main/java/io/openliberty/guides/system/SystemLivenessCheck.java[]
226
226
----
@@ -242,7 +242,7 @@ is being used, a status of `DOWN` is returned.
242
242
----
243
243
244
244
InventoryReadinessCheck.java
245
- [source, java, linenums, role='code_column hide_tags=copyright tags=InventoryReadinessCheck']
245
+ [source, java, linenums, role='code_column tags=InventoryReadinessCheck hide_tags=copyright ']
246
246
----
247
247
include::finish/src/main/java/io/openliberty/guides/inventory/InventoryReadinessCheck.java[]
248
248
----
@@ -270,7 +270,7 @@ https://openliberty.io/guides/microprofile-config.html[Configuring microservices
270
270
----
271
271
272
272
InventoryLivenessCheck.java
273
- [source, java, linenums, role='code_column hide_tags=copyright tags=InventoryLivenessCheck']
273
+ [source, java, linenums, role='code_column tags=InventoryLivenessCheck hide_tags=copyright ']
274
274
----
275
275
include::finish/src/main/java/io/openliberty/guides/inventory/InventoryLivenessCheck.java[]
276
276
----
@@ -315,19 +315,19 @@ ifdef::cloud-hosted[]
315
315
While the server is running, run the following curl command to find
316
316
the aggregated liveness and readiness health reports on the two services:
317
317
```
318
- curl http://localhost:9080/health
318
+ curl -s http://localhost:9080/health | jq
319
319
```
320
320
{: codeblock}
321
321
322
322
You can also run the following curl command to view the readiness health report:
323
323
```
324
- curl http://localhost:9080/health/ready
324
+ curl -s http://localhost:9080/health/ready | jq
325
325
```
326
326
{: codeblock}
327
327
328
328
or run the following curl command to view the liveness health report:
329
329
```
330
- curl http://localhost:9080/health/live
330
+ curl -s http://localhost:9080/health/live | jq
331
331
```
332
332
{: codeblock}
333
333
@@ -348,14 +348,14 @@ property to **true** in the **resources/CustomConfigSource.json** file.
348
348
Because this configuration file is picked up dynamically, simply refresh the http://localhost:9080/health
349
349
URL to see that the state of the **inventory** service changed to **DOWN**. Run the following curl command:
350
350
```
351
- curl http://localhost:9080/health
351
+ curl -s http://localhost:9080/health | jq
352
352
```
353
353
{: codeblock}
354
354
355
355
The overall state of the application also changed to **DOWN** as a result. Run the following curl command
356
356
to verify that the **inventory** service is indeed in maintenance:
357
357
```
358
- curl http://localhost:9080/inventory/systems
358
+ curl -s http://localhost:9080/inventory/systems | jq
359
359
```
360
360
{: codeblock}
361
361
@@ -395,7 +395,7 @@ You will implement several test methods to validate the health of the `system` a
395
395
----
396
396
397
397
HealthIT.java
398
- [source, java, linenums, role='code_column hide_tags=copyright tags=HealthIT']
398
+ [source, java, linenums, role='code_column tags=HealthIT hide_tags=copyright ']
399
399
----
400
400
include::finish/src/test/java/it/io/openliberty/guides/health/HealthIT.java[]
401
401
----
0 commit comments