Sha256: 934af7d3835f174cd418b2da81e6398abdd92f662bb30d989f6397a2f517536b

Contents?: true

Size: 1.71 KB

Versions: 16

Compression:

Stored size: 1.71 KB

Contents

require 'mccloud/provider/host/provider/status'
require 'mccloud/provider/host/vm'
require 'mccloud/provider/core/provider'

module Mccloud
  module Provider
    module Host
      class Provider  < ::Mccloud::Provider::Core::Provider

        attr_accessor :name
        attr_accessor :flavor

        attr_accessor :options

        attr_accessor :vms

        include Mccloud::Provider::Host::ProviderCommand


        def initialize(name,options,env)

          super(name,options,env)

          @vms=Hash.new

          @options=options
          @flavor=self.class.to_s.split("::")[-2]
          @name=name
        end

        def raw
          # We don't use this
          @raw=nil
        end
        def up(selection,options)
          on_selected_components("vm",selection) do |id,vm|
            vm.up(options)
          end
        end

        def bootstrap(selection,script,options)
          on_selected_components("vm",selection) do |id,vm|
            vm._bootstrap(script,options)
          end

        end

        def destroy(selection,options)

          on_selected_components("vm",selection) do |id,vm|
            vm.destroy(options)
          end

        end

        def ssh(selection,command,options)

          on_selected_components("vm",selection) do |id,vm|
            vm.ssh(command,options)
          end

        end



        def provision(selection,options)

          on_selected_components("vm",selection) do |id,vm|
            vm._provision(options)
          end

        end

        def halt(selection,options)
          on_selected_components("vm",selection) do |id,vm|
            env.ui.info "Matched #{vm.name}"
            vm.halt(options)
          end

        end

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mccloud-0.1.1 lib/mccloud/provider/host/provider.rb
mccloud-0.0.28 lib/mccloud/provider/host/provider.rb
mccloud-0.0.27 lib/mccloud/provider/host/provider.rb
mccloud-0.0.26 lib/mccloud/provider/host/provider.rb
mccloud-0.0.25 lib/mccloud/provider/host/provider.rb
mccloud-0.0.24 lib/mccloud/provider/host/provider.rb
mccloud-0.0.23 lib/mccloud/provider/host/provider.rb
mccloud-0.0.22 lib/mccloud/provider/host/provider.rb
mccloud-0.0.21 lib/mccloud/provider/host/provider.rb
mccloud-0.0.20 lib/mccloud/provider/host/provider.rb
mccloud-0.0.19 lib/mccloud/provider/host/provider.rb
mccloud-0.0.18 lib/mccloud/provider/host/provider.rb
mccloud-0.0.17 lib/mccloud/provider/host/provider.rb
mccloud-0.0.16 lib/mccloud/provider/host/provider.rb
mccloud-0.0.15 lib/mccloud/provider/host/provider.rb
mccloud-0.0.14 lib/mccloud/provider/host/provider.rb