dockerapi 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e010cc4d2a5c4aa102ffe7cd9d58e7e4823bf4ba9079f9a622cb021dad8cd0e
4
- data.tar.gz: 47163ffb19a35b4a473da7f88f40d5eac418a15638ccc8d91b6b1672a1af09f6
3
+ metadata.gz: c8cda98d22f89e4f925e266c90afbeb1b190e37034205b3b7abc22ba8c5489e2
4
+ data.tar.gz: f911265e3661b021098032b1e4338373e31bd04d256ed89ef20856b40a948907
5
5
  SHA512:
6
- metadata.gz: b48b06f99c46c936d4458a1908c08fe13f862ce7c63394077f52d8b621b2eb9e0be959682227f9b7ba59946f18b9098f2983a4bf1a781d16218ad66b08c730a3
7
- data.tar.gz: ee2cb40d653054ea9bb559b9d39f43dd28556dcc25374033904f5c292403e371176ce1233636209bd5678df06f90436f6214aaafadd255d0b438cc870c318591
6
+ metadata.gz: fefb6660133b5f424608819ae8aaa0a3bca0aae00398823f1d755e59ed3763ff147bb6bc87e284183e5de3940f5ebb159fd33fb0c84d53bbd2306227ebf333d4
7
+ data.tar.gz: 1ea1391ff3a464f99d1fd61cfb8bb2c2801632adc40265f2667d7ab3c6ac8f0155365217cafca188f106cc300422c061bf0c072a66419989924e40f3ee0f6e79
@@ -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
- Major 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.
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
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dockerapi (0.8.0)
4
+ dockerapi (0.8.1)
5
5
  excon (~> 0.74.0)
6
6
 
7
7
  GEM
@@ -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))
@@ -2,8 +2,10 @@ module Docker
2
2
  module API
3
3
  class Exec < Docker::API::Base
4
4
 
5
- def base_path
6
- "/exec"
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([name, "resize"], params))
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
@@ -11,7 +11,9 @@ module Docker
11
11
  "/images"
12
12
  end
13
13
 
14
- def inspect name
14
+ def inspect *args
15
+ return super.inspect if args.size == 0
16
+ name = args[0]
15
17
  @connection.get(build_path([name, "json"]))
16
18
  end
17
19
 
@@ -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)
@@ -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
@@ -14,6 +14,7 @@ module Docker
14
14
  end
15
15
 
16
16
  def inspect
17
+ caller.each { | el | return super.inspect if el.match(/inspector/) }
17
18
  @connection.get("/swarm")
18
19
  end
19
20
 
@@ -1,6 +1,6 @@
1
1
  module Docker
2
2
  module API
3
- GEM_VERSION = "0.8.0"
3
+ GEM_VERSION = "0.8.1"
4
4
 
5
5
  API_VERSION = "1.40"
6
6
 
@@ -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.0
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-08 00:00:00.000000000 Z
11
+ date: 2020-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon