Merge "Docker and dev Documentation update"
This commit is contained in:
commit
a2d645c6ee
|
@ -169,7 +169,7 @@ Modify etc/craton-api-conf.sample
|
|||
|
||||
* Add the following line to the [database] section:
|
||||
|
||||
# connection = mysql://craton:craton@localhost/craton
|
||||
# connection = mysql+pymysql://craton:craton@localhost/craton
|
||||
|
||||
* Update the host in the [api] section to match your IP:
|
||||
|
||||
|
|
|
@ -71,13 +71,23 @@ Calling into Craton
|
|||
|
||||
$ ContainerIP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${ContainerId})
|
||||
|
||||
* Bootstrap credentials are generated at the top of the craton-api logs for initial authentication. You can manually copy the username, api key, and project id from the logs by running::
|
||||
|
||||
$ docker logs -f craton-api
|
||||
|
||||
Or you can grep for them::
|
||||
|
||||
$ CRATON_PROJECT_ID=$(docker logs craton-api | grep "ProjectId:" | awk '{print $2}' | tr -d '\r')
|
||||
$ CRATON_USERNAME=$(docker logs craton-api | grep "Username:" | awk '{print $2}' | tr -d '\r')
|
||||
$ CRATON_API_KEY=$(docker logs craton-api | grep "APIKey:" | awk '{print $2}' | tr -d '\r')
|
||||
|
||||
* To generate a sample data set, use the following command::
|
||||
|
||||
$ python tools/generate_fake_data.py --url http://${ContainerIP}:8080/v1 --user demo --project b9f10eca66ac4c279c139d01e65f96b4 --key demo
|
||||
$ python tools/generate_fake_data.py --url http://${ContainerIP}:7780/v1 --user "$CRATON_USERNAME" --project "$CRATON_PROJECT_ID" --key "$CRATON_API_KEY"
|
||||
|
||||
* Now you can run a curl command like the one below to query Craton::
|
||||
|
||||
$ curl -i "http://${ContainerIP}:8080/v1/hosts?region_id=1" -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4"
|
||||
$ curl -i "http://${ContainerIP}:7780/v1/hosts?region_id=1" -H "Content-Type: application/json" -H "X-Auth-Token: ${CRATON_API_KEY}" -H "X-Auth-User: ${CRATON_USERNAME}" -H "X-Auth-Project: ${CRATON_PROJECT_ID}"
|
||||
|
||||
|
||||
-------------------
|
||||
|
@ -95,6 +105,3 @@ Command Cheat-Sheet
|
|||
* Get a bash shell from the Craton container::
|
||||
|
||||
$ docker exec -it craton-api bash # for a bash shell, etc
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue