dockerapi 0.13.0 → 0.18.0

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.
@@ -1,42 +1,61 @@
1
- module Docker
2
- module API
3
- class Volume < Docker::API::Base
4
-
5
- def list params = {}
6
- @connection.get(build_path("/volumes", params))
7
- end
8
-
9
- def details name
10
- @connection.get(build_path([name]))
11
- end
12
-
13
- def create body = {}
14
- @connection.request(method: :post, path: build_path(["create"]), headers: {"Content-Type": "application/json"}, body: body.to_json)
15
- end
16
-
17
- def remove name, params = {}
18
- @connection.delete(build_path([name]))
19
- end
1
+ ##
2
+ # This class represents the Docker API endpoints regarding volumes.
3
+ # @see https://docs.docker.com/engine/api/v1.40/#tag/Volume
4
+ class Docker::API::Volume < Docker::API::Base
5
+
6
+ ##
7
+ # List volumes.
8
+ #
9
+ # Docker API: GET
10
+ # @see https://docs.docker.com/engine/api/v1.40/#operation/VolumeList
11
+ #
12
+ # @param params [Hash]: Parameters that are appended to the URL.
13
+ def list params = {}
14
+ @connection.get(build_path("/volumes", params))
15
+ end
20
16
 
21
- def prune params = {}
22
- @connection.post(build_path(["prune"], params))
23
- end
17
+ ##
18
+ # Inspect a volume.
19
+ #
20
+ # Docker API: GET /volumes/{name}
21
+ # @see https://docs.docker.com/engine/api/v1.40/#operation/VolumeInspect
22
+ #
23
+ # @param name [String]: The ID or name of the volume.
24
+ def details name
25
+ @connection.get("/volumes/#{name}")
26
+ end
24
27
 
25
- #################################################
26
- # Items in this area to be removed before 1.0.0 #
27
- #################################################
28
- def base_path
29
- "/volumes"
30
- end
28
+ ##
29
+ # Create a volume.
30
+ #
31
+ # Docker API: POST /volumes/create
32
+ # @see https://docs.docker.com/engine/api/v1.40/#operation/VolumeCreate
33
+ #
34
+ # @param body [Hash]: Request body to be sent as json.
35
+ def create body = {}
36
+ @connection.request(method: :post, path: "/volumes/create", headers: {"Content-Type": "application/json"}, body: body.to_json)
37
+ end
31
38
 
32
- def inspect *args
33
- return super.inspect if args.size == 0
34
- warn "WARNING: #inspect is deprecated and will be removed in the future, please use #details instead."
35
- name = args[0]
36
- @connection.get(build_path([name]))
37
- end
38
- #################################################
39
+ ##
40
+ # Remove a volume.
41
+ #
42
+ # Docker API: DELETE /volumes/{name}
43
+ # @see https://docs.docker.com/engine/api/v1.40/#operation/VolumeDelete
44
+ #
45
+ # @param name [String]: The ID or name of the volume.
46
+ # @param params [Hash]: Parameters that are appended to the URL.
47
+ def remove name, params = {}
48
+ @connection.delete(build_path("/volumes/#{name}",params))
49
+ end
39
50
 
40
- end
51
+ ##
52
+ # Delete unused volumes.
53
+ #
54
+ # Docker API: POST /volumes/prune
55
+ # @see https://docs.docker.com/engine/api/v1.40/#operation/VolumePrune
56
+ #
57
+ # @param params [Hash]: Parameters that are appended to the URL.
58
+ def prune params = {}
59
+ @connection.post(build_path("/volumes/prune", params))
41
60
  end
42
- end
61
+ end
@@ -25,8 +25,12 @@ require "docker/api/plugin"
25
25
  module Docker
26
26
  module API
27
27
 
28
+ ##
29
+ # This variable controls output verbosity.
28
30
  PRINT_TO_STDOUT = true
29
31
 
32
+ ##
33
+ # Valid values for parameter validations.
30
34
  VALID_PARAMS = {
31
35
  "Docker::API::Image" => {
32
36
  "build" => [:dockerfile, :t, :extrahosts, :remote, :q, :nocache, :cachefrom, :pull, :rm, :forcerm, :memory, :memswap, :cpushares, :cpusetcpus, :cpuperiod, :cpuquota, :buildargs, :shmsize, :squash, :labels, :networkmode, :platform, :target, :outputs],
@@ -57,7 +61,8 @@ module Docker
57
61
  "logs" => [:follow, :stdout, :stderr, :since, :until, :timestamps, :tail],
58
62
  "attach" => [:detachKeys, :logs, :stream, :stdin, :stdout, :stderr],
59
63
  "stats" => [:stream],
60
- "archive" => [:path, :noOverwriteDirNonDir, :copyUIDGID],
64
+ "get_archive" => [:path],
65
+ "put_archive" => [:path, :noOverwriteDirNonDir, :copyUIDGID],
61
66
  "create" => [:name]
62
67
  },
63
68
  "Docker::API::Volume" => {
@@ -113,6 +118,8 @@ module Docker
113
118
  }
114
119
  }
115
120
 
121
+ ##
122
+ # Valid values for request body validations.
116
123
  VALID_BODY = {
117
124
  "Docker::API::Image" => {
118
125
  "commit" => [:Hostname, :Domainname, :User, :AttachStdin, :AttachStdout, :AttachStderr, :ExposedPorts, :Tty, :OpenStdin, :StdinOnce, :Env, :Cmd, :HealthCheck, :ArgsEscaped, :Image, :Volumes, :WorkingDir, :Entrypoint, :NetworkDisabled, :MacAddress, :OnBuild, :Labels, :StopSignal, :StopTimeout, :Shell]
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.13.0
4
+ version: 0.18.0
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-31 00:00:00.000000000 Z
11
+ date: 2020-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -16,24 +16,26 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.74.0
19
+ version: '0.76'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.74.0
27
- description: Interact directly with Docker API from Ruby code.
26
+ version: '0.76'
27
+ description: Interact with Docker API directly from Ruby code. Comprehensive implementation
28
+ (all available endpoints), no local Docker installation required, easily manipulated
29
+ http responses.
28
30
  email:
29
31
  - alysson.avila.costa@gmail.com
30
32
  executables: []
31
33
  extensions: []
32
34
  extra_rdoc_files: []
33
35
  files:
36
+ - ".github/workflows/ruby.yml"
34
37
  - ".gitignore"
35
38
  - ".rspec"
36
- - ".travis.yml"
37
39
  - CHANGELOG.md
38
40
  - Gemfile
39
41
  - Gemfile.lock
@@ -69,6 +71,7 @@ metadata:
69
71
  homepage_uri: https://github.com/nu12/dockerapi
70
72
  source_code_uri: https://github.com/nu12/dockerapi.git
71
73
  changelog_uri: https://github.com/nu12/dockerapi/blob/master/CHANGELOG.md
74
+ documentation_uri: https://www.rubydoc.info/gems/dockerapi
72
75
  post_install_message:
73
76
  rdoc_options: []
74
77
  require_paths:
@@ -87,5 +90,5 @@ requirements: []
87
90
  rubygems_version: 3.1.2
88
91
  signing_key:
89
92
  specification_version: 4
90
- summary: Interact directly with Docker API from Ruby code.
93
+ summary: Interact with Docker API from Ruby code.
91
94
  test_files: []
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.1
6
- before_install: gem install bundler -v 2.1.4