Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 926 Bytes

README.md

File metadata and controls

26 lines (17 loc) · 926 Bytes

database-api

API to create, list and delete etcd database instances running in AWS. It uses default VPC/Subnet/SecurityGroup

before to run:

  • create .aws/credentials file inside the repo with access and secret keys

to run the api:

  • docker build -t db-api .
  • docker run -ti -p 8080:8080 -e "TOKEN1={token-id}" db-api

to get databases:

to create database:

  • curl -X POST -H "X-AUTH: {token-id}" --header "Content-Type: application/json" localhost:8080/databases -d '{"name": "database1", "plan": "t2.micro"}'

to delete database:

to test etcd after create database:

  • open port 2379 in security group from source required
  • etcdctl --endpoints http://{public_instance_ip}:2379 mk {/path/key} {value}
  • etcdctl --endpoints http://{public_instance_ip}:2379 ls