Sha256: 644d9512f46488fa9e83b3580a37d778319d231167c01b181d5a20fa7648ef38

Contents?: true

Size: 1.56 KB

Versions: 7

Compression:

Stored size: 1.56 KB

Contents

require 'fog/compute/models/server'

module Fog
  module Compute
    class StormOnDemand

      class Server < Fog::Compute::Server
        identity :uniq_id

        attribute :accnt
        attribute :backup_enabled
        attribute :backup_plan
        attribute :backup_quota
        attribute :backup_size
        attribute :bandwidth_quota
        attribute :config_description
        attribute :config_id
        attribute :create_date
        attribute :domain
        attribute :ip
        attribute :ip_count
        attribute :manage_level
        attribute :subaccnt
        attribute :template
        attribute :template_description
        attribute :zone
        attribute :active

        attr_writer :password

        def initialize(attributes={})
          super
        end

        def create(options)
          data = connection.create_server(options).body['servers']
          load(data)
        end

        def destroy
          requires :identity
          connection.delete_server(:uniq_id => identity)
          true
        end

        def ready?
          active == 1
        end

        def reboot
          requires :identity
          connection.reboot_server(:uniq_id => identity)
          true
        end

        def clone(options)
          requires :identity
          connection.clone_server({:uniq_id => identity}.merge!(options))
          true
        end
        def resize(options)
          requires :identity
          connection.resize_server({:uniq_id => identity}.merge!(options))
          true
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 5 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/storm_on_demand/models/compute/server.rb
fog-nirvanix-1.8.1 lib/fog/storm_on_demand/models/compute/server.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/storm_on_demand/models/compute/server.rb
fog-sgonyea-1.8.1 lib/fog/storm_on_demand/models/compute/server.rb
fog-1.8.0 lib/fog/storm_on_demand/models/compute/server.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/storm_on_demand/models/compute/server.rb
fog-1.7.0 lib/fog/storm_on_demand/models/compute/server.rb