pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
154 stars 24 forks source link

Details of a droplet #42

Closed sckott closed 9 years ago

sckott commented 10 years ago

@hadley maybe not needed, but perhaps the droplet object could be passed to another function to neatly show all metadata for the droplet, eg.,

drops <- droplets()
drops[[1]] %>% summary

Giving something like that listed in the readme here https://github.com/sckott/analogsea#get-droplets. Of course user can index to each element, but seems somewhat tedious.

hadley commented 10 years ago

I think summary() would be a reasonable generic, although currently droplets() returns a list of droplets so we'd need an extra class on the return.

What do you imagine people doing with the summary?

sckott commented 10 years ago

I'm thinking they would only inspect the summary, so it could simply be printed to screen via cat() . Actually, a lot of that information is simply what image sizes are available for that region, etc, and can be excluded

hadley commented 10 years ago

I was wondering what you think is missing compared to the current display of droplets()? Or do you want the same info displayed more compactly?

sckott commented 9 years ago

see the droplet.summary fxn I just pushed 6232aaa69b95fb43de3449684a6bed83e4ce96d9 - I think it might be of interest to users to see more details printed nicely. Thoughts?

This is what it looks like:

droplets()[[4]] %>% summary
<droplet_detail>unsophistically (2728020)
  Status: active
  Region: San Francisco 1
  Image: Ubuntu 14.04 x64
  Size: 512mb ($0.00744 / hr)
  Estimated cost ($): 0.009
  Locked: FALSE
  Created at: 2014-09-28T17:21:12Z UTC
  Networks: 
     v4: ip_address (192.241.229.30), netmask (255.255.255.0), gateway (192.241.229.1), type (public)
     v6: none
  Kernel:  id (1682), name (Ubuntu 14.04 x64 vmlinuz-3.13.0-32-generic), version (3.13.0-32-generic) 
  Snapshots:  
  Backups: 
hadley commented 9 years ago

I like it!