Docker and dev Documentation update

Updating dev install documentation to include pymysql database connection.
Updating docker documentation to gather bootstrap auth credentials and
change api port.

Change-Id: I5df061749f7c4143c7d2b3f7f6fecddd5be0223b
Closes-Bug: #1674731
This commit is contained in:
Michael Porras 2017-03-21 14:21:15 -05:00
parent 12b31e49ac
commit b571719f67
2 changed files with 13 additions and 6 deletions

View File

@ -168,7 +168,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:

View File

@ -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