lib/fog/storm_on_demand/models/compute/server.rb in fog-1.11.1 vs lib/fog/storm_on_demand/models/compute/server.rb in fog-1.12.0
- old
+ new
@@ -6,10 +6,11 @@
class Server < Fog::Compute::Server
identity :uniq_id
attribute :accnt
+ attribute :active
attribute :backup_enabled
attribute :backup_plan
attribute :backup_quota
attribute :backup_size
attribute :bandwidth_quota
@@ -18,52 +19,75 @@
attribute :create_date
attribute :domain
attribute :ip
attribute :ip_count
attribute :manage_level
- attribute :subaccnt
attribute :template
attribute :template_description
+ attribute :type
attribute :zone
- attribute :active
attr_writer :password
def initialize(attributes={})
super
end
- def create(options)
- data = service.create_server(options).body['servers']
- load(data)
- end
-
def destroy
requires :identity
service.delete_server(:uniq_id => identity)
true
end
def ready?
active == 1
end
- def reboot
+ def reboot(options={})
requires :identity
- service.reboot_server(:uniq_id => identity)
+ service.reboot_server({:uniq_id => identity}.merge!(options))
true
end
def clone(options)
requires :identity
service.clone_server({:uniq_id => identity}.merge!(options))
true
end
+
def resize(options)
requires :identity
service.resize_server({:uniq_id => identity}.merge!(options))
true
end
+
+ def history(options={})
+ requires :identity
+ params = {:uniq_id => identity}.merge!(options)
+ res = service.server_history(params).body
+ res['items']
+ end
+
+ def shutdown(options={})
+ requires :identity
+ service.shutdown_server({:uniq_id => identity}.merge!(options)).body
+ end
+
+ def start
+ reqwuires :identity
+ service.start_server({:uniq_id => identity}).body
+ end
+
+ def status
+ requires :identity
+ service.server_status({:uniq_id => identity}).body
+ end
+
+ def update(options)
+ requires :identity
+ service.update_server({:uniq_id => identity}.merge!(options)).body
+ end
+
end
end
end
end