mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * tutorials/dev-app-cli.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="getting-started-cli-load-data-output_{context}"]
|
|
= Loading data into the database
|
|
|
|
[role="_abstract"]
|
|
After you have deployed the `mongodb-nationalparks` database application, load the national park location information into the database.
|
|
|
|
.Prerequisites
|
|
|
|
* You have deployed the `nationalparks` back-end application.
|
|
* You have deployed the `mongodb-nationalparks` database application.
|
|
|
|
.Procedure
|
|
|
|
* Load the national parks data by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc exec $(oc get pods -l component=nationalparks | tail -n 1 | awk '{print $1;}') -- curl -s http://localhost:8080/ws/data/load
|
|
----
|
|
+
|
|
.Example output
|
|
[source,text]
|
|
----
|
|
"Items inserted in database: 2893"
|
|
----
|
|
|
|
.Verification
|
|
|
|
* Verify that the map data was loaded properly by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc exec $(oc get pods -l component=nationalparks | tail -n 1 | awk '{print $1;}') -- curl -s http://localhost:8080/ws/data/all
|
|
----
|
|
+
|
|
.Example output (trimmed)
|
|
[source,terminal]
|
|
----
|
|
...
|
|
, {"id": "Great Zimbabwe", "latitude": "-20.2674635", "longitude": "30.9337986", "name": "Great Zimbabwe"}]
|
|
----
|