dockerapi 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +1 -1
- data/lib/docker/api/container.rb +7 -5
- data/lib/docker/api/exec.rb +5 -7
- data/lib/docker/api/image.rb +3 -1
- data/lib/docker/api/network.rb +7 -5
- data/lib/docker/api/node.rb +6 -4
- data/lib/docker/api/swarm.rb +1 -0
- data/lib/docker/api/version.rb +1 -1
- data/lib/docker/api/volume.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8cda98d22f89e4f925e266c90afbeb1b190e37034205b3b7abc22ba8c5489e2
|
4
|
+
data.tar.gz: f911265e3661b021098032b1e4338373e31bd04d256ed89ef20856b40a948907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fefb6660133b5f424608819ae8aaa0a3bca0aae00398823f1d755e59ed3763ff147bb6bc87e284183e5de3940f5ebb159fd33fb0c84d53bbd2306227ebf333d4
|
7
|
+
data.tar.gz: 1ea1391ff3a464f99d1fd61cfb8bb2c2801632adc40265f2667d7ab3c6ac8f0155365217cafca188f106cc300422c061bf0c072a66419989924e40f3ee0f6e79
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 0.8.1
|
2
|
+
|
3
|
+
Restore the default `#inspect` output for `Docker::API` classes.
|
4
|
+
|
5
|
+
Most of the overriding methods take an argument, therefore calling using the expect arguments will return a `Docker::API::Response` object, while calling without arguments will return `Kernel#inspect`. To avoid this confusing schema, next release will rename `#inspect` within `Docker::API` to something else.
|
6
|
+
|
1
7
|
# 0.8.0
|
2
8
|
|
3
9
|
Add Docker::API::Swarm methods:
|
@@ -19,7 +25,7 @@ Query parameters and request body json can now skip the validation step with `:s
|
|
19
25
|
|
20
26
|
# 0.7.0
|
21
27
|
|
22
|
-
|
28
|
+
Significant changes: Docker::API::Connection is now a regular class intead of a Singleton, allowing multiple connections to be stablished within the same program (replacing the connect_to implementation). To leverage this feature, API-related classes must be initialized and may or may not receive a Docker::API::Connection as parameter, or it'll connect to /var/run/docker.sock by default. For this reason, class methods were replaced with instance methods. Documentation will reflect this changes of implementation.
|
23
29
|
|
24
30
|
Bug fix: Image push returns a 20X status even when the push is unsucessful. To prevent false positives, it now requires the authentication parameters to be provided, generating a 403 status for invalid credentials or an error if they are absent.
|
25
31
|
|
data/Gemfile.lock
CHANGED
data/lib/docker/api/container.rb
CHANGED
@@ -9,16 +9,18 @@ module Docker
|
|
9
9
|
"/containers"
|
10
10
|
end
|
11
11
|
|
12
|
+
def inspect *args
|
13
|
+
return super.inspect if args.size == 0
|
14
|
+
name, params = args[0], args[1] || {}
|
15
|
+
validate Docker::API::InvalidParameter, [:size], params
|
16
|
+
@connection.get(build_path([name, "json"], params))
|
17
|
+
end
|
18
|
+
|
12
19
|
def list params = {}
|
13
20
|
validate Docker::API::InvalidParameter, [:all, :limit, :size, :filters], params
|
14
21
|
@connection.get(build_path(["json"], params))
|
15
22
|
end
|
16
23
|
|
17
|
-
def inspect name, params = {}
|
18
|
-
validate Docker::API::InvalidParameter, [:size], params
|
19
|
-
@connection.get(build_path([name, "json"], params))
|
20
|
-
end
|
21
|
-
|
22
24
|
def top name, params = {}
|
23
25
|
validate Docker::API::InvalidParameter, [:ps_args], params
|
24
26
|
@connection.get(build_path([name, "top"], params))
|
data/lib/docker/api/exec.rb
CHANGED
@@ -2,8 +2,10 @@ module Docker
|
|
2
2
|
module API
|
3
3
|
class Exec < Docker::API::Base
|
4
4
|
|
5
|
-
def
|
6
|
-
|
5
|
+
def inspect *args
|
6
|
+
return super.inspect if args.size == 0
|
7
|
+
name = args[0]
|
8
|
+
@connection.get("/exec/#{name}/json")
|
7
9
|
end
|
8
10
|
|
9
11
|
def create name, body = {}
|
@@ -27,11 +29,7 @@ module Docker
|
|
27
29
|
|
28
30
|
def resize name, params = {}
|
29
31
|
validate Docker::API::InvalidParameter, [:w, :h], params
|
30
|
-
@connection.post(build_path(
|
31
|
-
end
|
32
|
-
|
33
|
-
def inspect name
|
34
|
-
@connection.get(build_path([name, "json"]))
|
32
|
+
@connection.post(build_path("/exec/#{name}/resize", params))
|
35
33
|
end
|
36
34
|
|
37
35
|
end
|
data/lib/docker/api/image.rb
CHANGED
data/lib/docker/api/network.rb
CHANGED
@@ -6,16 +6,18 @@ module Docker
|
|
6
6
|
"/networks"
|
7
7
|
end
|
8
8
|
|
9
|
+
def inspect *args
|
10
|
+
return super.inspect if args.size == 0
|
11
|
+
name, params = args[0], args[1] || {}
|
12
|
+
validate Docker::API::InvalidParameter, [:verbose, :scope], params
|
13
|
+
@connection.get(build_path([name], params))
|
14
|
+
end
|
15
|
+
|
9
16
|
def list params = {}
|
10
17
|
validate Docker::API::InvalidParameter, [:filters], params
|
11
18
|
@connection.get(build_path("/networks", params))
|
12
19
|
end
|
13
20
|
|
14
|
-
def inspect name, params = {}
|
15
|
-
validate Docker::API::InvalidParameter, [:verbose, :scope], params
|
16
|
-
@connection.get(build_path([name], params))
|
17
|
-
end
|
18
|
-
|
19
21
|
def create body = {}
|
20
22
|
validate Docker::API::InvalidRequestBody, [:Name, :CheckDuplicate, :Driver, :Internal, :Attachable, :Ingress, :IPAM, :EnableIPv6, :Options, :Labels], body
|
21
23
|
@connection.request(method: :post, path: build_path(["create"]), headers: {"Content-Type": "application/json"}, body: body.to_json)
|
data/lib/docker/api/node.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
module Docker
|
2
2
|
module API
|
3
3
|
class Node < Docker::API::Base
|
4
|
+
|
5
|
+
def inspect *args
|
6
|
+
return super.inspect if args.size == 0
|
7
|
+
name = args[0]
|
8
|
+
@connection.get("/nodes/#{name}")
|
9
|
+
end
|
4
10
|
|
5
11
|
def list params = {}
|
6
12
|
validate Docker::API::InvalidParameter, [:filters], params
|
7
13
|
@connection.get(build_path("/nodes", params))
|
8
14
|
end
|
9
15
|
|
10
|
-
def inspect name
|
11
|
-
@connection.get("/nodes/#{name}")
|
12
|
-
end
|
13
|
-
|
14
16
|
def update name, params = {}, body = {}
|
15
17
|
validate Docker::API::InvalidParameter, [:version], params
|
16
18
|
validate Docker::API::InvalidRequestBody, [:Name, :Labels, :Role, :Availability], body
|
data/lib/docker/api/swarm.rb
CHANGED
data/lib/docker/api/version.rb
CHANGED
data/lib/docker/api/volume.rb
CHANGED
@@ -5,6 +5,12 @@ module Docker
|
|
5
5
|
"/volumes"
|
6
6
|
end
|
7
7
|
|
8
|
+
def inspect *args
|
9
|
+
return super.inspect if args.size == 0
|
10
|
+
name = args[0]
|
11
|
+
@connection.get(build_path([name]))
|
12
|
+
end
|
13
|
+
|
8
14
|
def list params = {}
|
9
15
|
validate Docker::API::InvalidParameter, [:filters], params
|
10
16
|
@connection.get(build_path("/volumes", params))
|
@@ -15,10 +21,6 @@ module Docker
|
|
15
21
|
@connection.request(method: :post, path: build_path(["create"]), headers: {"Content-Type": "application/json"}, body: body.to_json)
|
16
22
|
end
|
17
23
|
|
18
|
-
def inspect name
|
19
|
-
@connection.get(build_path([name]))
|
20
|
-
end
|
21
|
-
|
22
24
|
def remove name, params = {}
|
23
25
|
validate Docker::API::InvalidParameter, [:force], params
|
24
26
|
@connection.delete(build_path([name]))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockerapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alysson A. Costa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|