Sha256: 2974da28570e8d65c666aeec0b9d0f1c1cca6ddc9c98dc07871bb64839a93354

Contents?: true

Size: 1.63 KB

Versions: 34

Compression:

Stored size: 1.63 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, :username

        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 username
          @username ||= 'root'
        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

34 entries across 34 versions & 9 rubygems

Version Path
fog-parser-fix-1.6.1 lib/fog/storm_on_demand/models/compute/server.rb
fog-test-again-1.6.0 lib/fog/storm_on_demand/models/compute/server.rb
fog-parser-fix-1.6.0 lib/fog/storm_on_demand/models/compute/server.rb
fog-1.6.0 lib/fog/storm_on_demand/models/compute/server.rb
fog-1.5.0 lib/fog/storm_on_demand/models/compute/server.rb
fog-1.4.0 lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb
michiels-fog-1.3.1 lib/fog/storm_on_demand/models/compute/server.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb
fog-1.3.1 lib/fog/storm_on_demand/models/compute/server.rb
fog-1.3.0 lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb
fog-1.2.0 lib/fog/storm_on_demand/models/compute/server.rb
ktheory-fog-1.1.2 lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/server.rb