Sha256: e72604d85ac99bb0722b7e982f5b2a0de9970f95d0ca0a1bbcf879aa13108720

Contents?: true

Size: 1.86 KB

Versions: 31

Compression:

Stored size: 1.86 KB

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#
module Fog
  module Compute
    class Softlayer

      class Mock

        # Launch a single SoftLayer VM.
        #
        # @param [<Hash>] opts
        # @option opts [<Hash>] :body
        #   HTTP request body parameters
        # @option opts [String] "hostname"
        #   VM hostname, should be unique within the domain.
        # @option opts [String] "domain"
        #   VM domain.
        # @option opts [Integer] "startCpus"
        #   Number of CPU cores provisioned for the VM.
        # @option opts [Integer] "maxMemory"
        #   Available RAM for the VM in MB.  Valid arguments are 1024, 2048, 4096, 6144, 8192, 12288, 16384, 32768, 49152, 65536
        # @option opts [Boolean] "hourlyBillingFlag"
        #   Should the VM be billed hourly or monthly (monthly is less expensive, minimum charge of 1 month).
        # @option opts [Boolean] "localDiskFlag"
        #   Should the root volume be on the machine or on the SAN
        # @option opts [String] "operatingSystemReferenceCode"
        #   A valid SoftLayer operatingSystemReferenceCode string
        # @option opts [Boolean] "dedicatedAccountHostOnlyFlag"
        #   Defaults to false, pass true for a single-tenant VM.
        # @return [Excon::Response]
        def create_vm(opts)
          raise ArgumentError, "Fog::Compute::Softlayer#create_vm expects argument of type Hash" unless opts.kind_of?(Hash)
          opts = [opts]
          self.create_vms(opts)
        end

      end

      class Real
        def create_vm(opts)
          raise ArgumentError, "Fog::Compute::Softlayer#create_vm expects argument of type Hash" unless opts.kind_of?(Hash)
          opts = [[opts]] # don't ask...
          self.create_vms(opts)
        end
      end
    end
  end
end

Version data entries

31 entries across 29 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/compute/create_vm.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/compute/create_vm.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.1.4 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.1.3 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.1.2 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.1.1 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.1.0 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.0.3 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.0.2 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.0.1 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-1.0.0 lib/fog/softlayer/requests/compute/create_vm.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-0.4.7 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-0.4.6 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-0.4.5 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-0.4.4 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-0.4.3 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-0.4.2 lib/fog/softlayer/requests/compute/create_vm.rb
fog-softlayer-0.4.2.pre lib/fog/softlayer/requests/compute/create_vm.rb