Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Merge "Docker and dev Documentation update"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Mar 22, 2017
2 parents 034255e + b571719 commit a2d645c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/source/dev/install.rst
Expand Up @@ -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:

Expand Down
17 changes: 12 additions & 5 deletions doc/source/docker-install.rst
Expand Up @@ -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}"


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



0 comments on commit a2d645c

Please sign in to comment.