Sha256: 5c6d6ecf401d0abb80a9d81e4fde00e7eedc96592df793e64f1e9cb92a1667f2

Contents?: true

Size: 612 Bytes

Versions: 13

Compression:

Stored size: 612 Bytes

Contents

module Fog
  module Compute
    class OpenNebula
      class Real
        def vm_suspend(id)
          vmpool = ::OpenNebula::VirtualMachinePool.new(client)
      	  vmpool.info!(-2,id,id,-1)

          vmpool.each do |vm|
            vm.suspend
          end
        end
      end

      class Mock
        def vm_suspend(id)
          response = Excon::Response.new
          response.status = 200

          self.data['vms'].each do |vm|
            if id == vm['id']
              vm['state'] = 'LCM_INIT'
              vm['status'] = 5
            end
          end

        end
      end
    end
  end
end

Version data entries

13 entries across 11 versions & 3 rubygems

Version Path
fog-2.3.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-ifeel-2.2.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-2.2.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-2.1.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/opennebula/requests/compute/vm_suspend.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/opennebula/requests/compute/vm_suspend.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-1.42.1 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-2.0.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-1.42.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-1.41.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-1.40.0 lib/fog/opennebula/requests/compute/vm_suspend.rb
fog-1.39.0 lib/fog/opennebula/requests/compute/vm_suspend.rb