lib/yao/resources/server.rb in yao-0.2.0 vs lib/yao/resources/server.rb in yao-0.2.1
- old
+ new
@@ -19,10 +19,13 @@
map_attribute_to_attribute 'OS-EXT-STS:vm_state' => :ext_sts_vm_state
self.service = "compute"
self.resource_name = "server"
self.resources_name = "servers"
+ def self.start(id)
+ action(id, "os-start" => nil)
+ end
def self.shutoff(id)
action(id, "os-stop" => nil)
end
@@ -30,9 +33,13 @@
action(id,"reboot" => { "type" => "HARD" })
end
def self.resize(id, flavor_id)
action(id,"resize" => { "flavorRef" => flavor_id })
+ end
+
+ class << self
+ alias :stop :shutoff
end
extend MetadataAvailable
extend Action
end