docker-api 1.33.3 → 1.33.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/docker/container.rb +3 -2
- data/lib/docker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc4cc0582b0d1790debfb8be47bb928f5c1a92c8
|
4
|
+
data.tar.gz: ec329aa7f8fcbdf7991faa44ca5a54cb962d8dc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707a35dfc34923c91c0f41971c1932749b932396a8a3f8b345630754a07113faa23be27a8af5b4838c4ed6b8f783e24e49d1e416fbfb9a98734f9ee9a246f7e1
|
7
|
+
data.tar.gz: c40703a85329908dc1ca5654fc4e59af856db02504e6b50029f2170f4e465d6d39984aee1b417abfe0c36145578ab2df9263b3b6c6362b4ea4fdb499e7d39a60
|
data/README.md
CHANGED
@@ -339,6 +339,13 @@ container.kill(:signal => "SIGHUP")
|
|
339
339
|
container.top
|
340
340
|
# => [{"PID"=>"4851", "TTY"=>"pts/0", "TIME"=>"00:00:00", "CMD"=>"lxc-start"}]
|
341
341
|
|
342
|
+
# Same as above, but uses the original format
|
343
|
+
container.top(format: :hash)
|
344
|
+
# => {
|
345
|
+
# "Titles" => ["PID", "TTY", "TIME", "CMD"],
|
346
|
+
# "Processes" => [["4851", "pts/0", "00:00:00", "lxc-start"]]
|
347
|
+
# }
|
348
|
+
|
342
349
|
# To expose 1234 to bridge
|
343
350
|
# In Dockerfile: EXPOSE 1234/tcp
|
344
351
|
# docker run resulting-image-name
|
data/lib/docker/container.rb
CHANGED
@@ -17,11 +17,12 @@ class Docker::Container
|
|
17
17
|
|
18
18
|
# Return a List of Hashes that represents the top running processes.
|
19
19
|
def top(opts = {})
|
20
|
+
format = opts.delete(:format) { :array }
|
20
21
|
resp = Docker::Util.parse_json(connection.get(path_for(:top), opts))
|
21
22
|
if resp['Processes'].nil?
|
22
|
-
[]
|
23
|
+
format == :array ? [] : {}
|
23
24
|
else
|
24
|
-
resp['Processes'].map { |ary| Hash[resp['Titles'].zip(ary)] }
|
25
|
+
format == :array ? resp['Processes'].map { |ary| Hash[resp['Titles'].zip(ary)] } : resp
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
data/lib/docker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.33.
|
4
|
+
version: 1.33.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swipely, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|