Sha256: df01c0e9e2bbab333ed936003c589ec1c8c38a274178071b4e0924f5ca4f3afc

Contents?: true

Size: 1.38 KB

Versions: 26

Compression:

Stored size: 1.38 KB

Contents

module Fog
  module Compute
    class Fogdocker
      # Create attributes
      #'Hostname' => '',
      #'User' => '',
      #'Memory' => 0,
      #'MemorySwap' => 0,
      #'AttachStdin' => false,
      #'AttachStdout' => true,
      #'AttachStderr' => true,
      #'PortSpecs' => nil,
      #'Tty' => false,
      #'OpenStdin' => false,
      #'StdinOnce' => false,
      #'Env' => nil,
      #'Cmd' => ['date'],
      #'Dns' => nil,
      #'Image' => 'base',
      #'Volumes' => {
      #    '/tmp' =>  {}
      #},
      #'VolumesFrom' => '',
      #'WorkingDir' => '',
      #'ExposedPorts' => {
      #    '22/tcp' => {}
      #}
      class Real
        def container_create(attrs)
          downcase_hash_keys Docker::Container.create(camelize_hash_keys(attrs), @connection).json
        end
      end

      class Mock
        def container_create(attrs)
          {'id'         => '2ce79789656e4f7474624be6496dc6d988899af30d556574389a19aade2f9650',
           'image'      => 'mattdm/fedora:f19',
           'command'    => '/bin/bash',
           'created'    => '1389876158',
           'status'     => 'Up 45 hours',
           'state'      => {'running' => 'true'},
           'ports'      =>  nil,
           'sizerw'     =>  0,
           'sizerootfs' =>  0,
           'name'       => '123123123',
           'names'      =>  ['/boring_engelbert']
          }
        end
      end
    end
  end
end

Version data entries

26 entries across 24 versions & 4 rubygems

Version Path
fog-2.3.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-ifeel-2.2.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-2.2.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-2.1.0 lib/fog/fogdocker/requests/compute/container_create.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/fogdocker/requests/compute/container_create.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/fogdocker/requests/compute/container_create.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.42.1 lib/fog/fogdocker/requests/compute/container_create.rb
fog-2.0.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.42.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.41.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.40.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.39.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.38.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.37.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.36.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.35.0 lib/fog/fogdocker/requests/compute/container_create.rb
fog-2.0.0.pre.0 lib/fog/fogdocker/requests/compute/container_create.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/fogdocker/requests/compute/container_create.rb
fog-1.34.0 lib/fog/fogdocker/requests/compute/container_create.rb