1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/fogdocker/requests/compute/container_all.rb
Paul Thornthwaite 2e0b7e545a Standardise empty lines throughout codebase
Done with `rubocop --auto-correct --only EmptyLineBetweenDefs,EmptyLines,EmptyLinesAroundBody`
2014-05-26 14:20:02 +01:00

37 lines
1.3 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module Fog
module Compute
class Fogdocker
class Real
# filter options
# all true or false, Show all containers. Only running containers are shown by default
# limit Show limit last created containers, include non-running ones.
# since Show only containers created since Id, include non-running ones.
# before Show only containers created before Id, include non-running ones.
# size true or false, Show the containers sizes
def container_all(filters = {})
Docker::Container.all(filters.merge(:all => true)).map do |container|
downcase_hash_keys(container.json)
end
end
end
class Mock
def container_all(filters = {})
[
{'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