lib/dcloud/instance.rb in deltacloud-client-0.0.2 vs lib/dcloud/instance.rb in deltacloud-client-0.0.3
- old
+ new
@@ -37,9 +37,20 @@
def initialize(client, uri, xml=nil)
@action_urls = {}
super( client, uri, xml )
end
+ def to_plain
+ sprintf("%-15s | %-15s | %-15s | %10s | %32s | %32s",
+ self.id ? self.id[0,15] : '-',
+ self.name ? self.name[0,15] : 'unknown',
+ self.image.name ? self.image.name[0,15] : 'unknown',
+ self.state ? self.state.to_s[0,10] : 'unknown',
+ self.public_addresses.join(',')[0,32],
+ self.private_addresses.join(',')[0,32]
+ )
+ end
+
def start!()
url = action_urls['start']
throw Exception.new( "Unable to start" ) unless url
client.post_instance( url )
unload