nodejitsu/jitsu — Issue #143: Command to view details of database instances
Author: thepumpkin1979
Created: 2011-12-16 14:21:42+00:00
State: open

It would be really cool to have a command to view the details of a database, it could be something like `jitsu databases view my-db`.
Useful information to show:

* Plan Id
* Current DB Size
* Max DB Size
* Tables/Collection counts.
* Other quota details common for mongo, redis and couch databases.

I think this requires API enhancements. In the case of MongoDB, the MongoHQ API already provides details for the database here http://docs.mongohq.com/rest_api_databases.

```json
{
"db" : "weekly",
"collections" : 4,
"objects" : 16,
"avgObjSize" : 76.25,
"dataSize" : 1220,
"storageSize" : 77312,
"numExtents" : 5,
"indexes" : 4,
"indexSize" : 32768,
"fileSize" : 201326592,
"ok" : 1
}
```

Same with Redistogo: https://redistogo.com/documentation/api

```json
{
"vm_size": 0,
"plan": "small",
"persistence": "aof",
"last_bgrewriteaof_at": null,
"label": "server-9001",
"created_at": "2010-12-20T00:35:22Z",
"vm_page_size": 32,
"master_password": null,
"updated_at": "2010-12-20T00:35:22Z",
"timeout": 150,
"slave": false,
"server_id": 1,
"port": 9001,
"memory": 104857600,
"memory_limit_notification": false,
"databases": 1,
"id": 1,
"hash_max_zipmap_value": 512,
"vm_max_memory": 94371840,
"version": "v2.0.4-stable",
"user_id": 2,
"snapshots": ["900 1", "300 10", "60 10000"],
"hash_max_zipmap_entries": 64,
"vm_enabled": false,
"master_host": null,
"appendfsync": "everysec",
"activerehashing": true,
"connections": 256,
"status": "new",
"password": "cc3da5b7aaaad5b4895d243239beed97",
"last_backup_at": null,
"vm_max_threads": 4,
"master_port": null
}
```

I'd vote for just format the JSON result of the provider API since `jitsu databases list` already shows some pretty formatted information but is also very limited.