Sha256: 2b26c2ad7cfe8289509c9b9bfd803ad0bf217ad166aa6c02a56685fe71d82f0a
Contents?: true
Size: 1.41 KB
Versions: 19
Compression:
Stored size: 1.41 KB
Contents
module Fog module Rackspace class Servers class Server < Fog::Model identity :id attribute :addresses attribute :password, 'adminPass' attribute :flavor_id, 'flavorId' attribute :host_id, 'hostId' attribute :image_id, 'imageId' attribute :metadata attribute :name attribute :personality attribute :progress attribute :status def destroy requires :id connection.delete_server(@id) true end def flavor requires :flavor_id connection.flavors.get(@flavor_id) end def image requires :image_id connection.images.get(@image_id) end def images requires :id connection.images(:server => self) end def ready? @status == 'ACTIVE' end def reboot(type = 'SOFT') requires :id connection.reboot_server(@id, type) true end def save requires :flavor_id, :image_id, :name options = { 'metadata' => @metadata, 'personality' => @personality } options = options.reject {|key, value| value.nil?} data = connection.create_server(@flavor_id, @image_id, @name, options) merge_attributes(data.body['server']) true end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems