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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +35 -0
- data/.gitignore +4 -0
- data/CHANGELOG.md +35 -0
- data/Gemfile.lock +3 -3
- data/README.md +73 -23
- data/bin/setup +9 -1
- data/dockerapi.gemspec +5 -4
- data/lib/docker/api/base.rb +64 -20
- data/lib/docker/api/connection.rb +23 -17
- data/lib/docker/api/container.rb +306 -144
- data/lib/docker/api/error.rb +19 -3
- data/lib/docker/api/exec.rb +49 -36
- data/lib/docker/api/image.rb +32 -14
- data/lib/docker/api/network.rb +84 -48
- data/lib/docker/api/node.rb +47 -28
- data/lib/docker/api/response.rb +27 -19
- data/lib/docker/api/secret.rb +1 -9
- data/lib/docker/api/service.rb +3 -18
- data/lib/docker/api/swarm.rb +70 -36
- data/lib/docker/api/system.rb +57 -24
- data/lib/docker/api/task.rb +10 -10
- data/lib/docker/api/version.rb +1 -1
- data/lib/docker/api/volume.rb +56 -37
- data/lib/dockerapi.rb +8 -1
- metadata +10 -7
- data/.travis.yml +0 -6
data/lib/docker/api/volume.rb
CHANGED
@@ -1,42 +1,61 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
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
|
data/lib/dockerapi.rb
CHANGED
@@ -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
|
-
"
|
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.
|
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-
|
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.
|
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.
|
27
|
-
description: Interact
|
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
|
93
|
+
summary: Interact with Docker API from Ruby code.
|
91
94
|
test_files: []
|