# DBaaS CLI

dbaas command line tool `central/cmd/cli` can be used to add tenant, add user to existing tenant and seed new region

It can be built by:

```sh
cd central/ && make bin/cli
```

## Add new region

The following command can seed a new region info into database.

```sh
cat <<EOF > region.yaml
region: us-central1
display_name: "US-Central1 (Iowa)"
zones:
- us-central1-a
- us-central1-b
- us-central1-c
status: active
cloud: gcp
profiles:
- t1.tiny
- t1.standard
- t1.highcpu
EOF
aws-vault exec ${env} -- bin/dbaas-cli region --kubeconfig ./base.yaml --project ${PROJECT} --region-config region.yaml --secret-name <mysql-password-secret-name>
```

## Add trial credit for a tenant

The following command can add trial credit for a tenant

```sh
aws-vault exec ${env} -- central/bin/dbaas-cli tenant add-credit --central-url <central-url>  --auth0-domain <auth0 m2m domain> --auth0-client-id <auth0 m2m client id> --auth0-client-secret <auth0 m2m client secret> --auth0-audience <auth0 m2m audience> --tenant-id <tenant-id> --credit <the credit ammount>
```
