rpm --import http://mirror.fuel-infra.org/mos-repos/centos/mos9.0-centos7/os/RPM-GPG-KEY-mos9.0
yum-config-manager --add-repo http://mirror.fuel-infra.org/mos-repos/centos/mos9.0-centos7/os/x86_64/
yum-config-manager --add-repo http://packages.fuel-infra.org/review/FUEL-304811//repositories/centos/master-centos7/os/x86_64
yum install -y tuning-box
nailgun_syncdb
service nailgun restart

export OS_USERNAME=admin OS_PASSWORD=admin OS_PROJECT_NAME=admin OS_AUTH_URL=http://10.20.0.2:5000
openstack service create --name tuning-box config
openstack endpoint create --publicurl http://10.20.0.2:8000/api/config --region RegionOne tuning-box
openstack catalog list

token_id=$(openstack token issue -c id -f value)

curl -H "X-Auth-Token: $token_id" http://10.20.0.2:8000/api/config/components -H "Content-type: application/json" -d @component.json
curl -H "X-Auth-Token: $token_id" http://10.20.0.2:8000/api/config/environments -H "Content-type: application/json" -d @environment.json

fuel2 config get --env 1 --resource resource1 --format yaml

echo '{"a": 1, "b": null}' | fuel2 config set --env 1 --resource resource1 --format json
fuel2 config get --env 1 --resource resource1 --format yaml
fuel2 config get --env 1 --resource resource1 --format yaml --level nodes=1

echo '{"a": 2}' | fuel2 config set --env 1 --resource resource1 --format json --level nodes=1
fuel2 config get --env 1 --resource resource1 --format yaml
fuel2 config get --env 1 --resource resource1 --format yaml --level nodes=1

fuel2 config override --env 1 --resource resource1 --key b --value s --type str
fuel2 config get --env 1 --resource resource1 --format yaml
fuel2 config get --env 1 --resource resource1 --format yaml --level nodes=1

echo '{"a": 1, "b": "s3"}' | fuel2 config set --env 1 --resource resource1 --format json
fuel2 config get --env 1 --resource resource1 --format yaml
fuel2 config get --env 1 --resource resource1 --format yaml --level nodes=1
