dockerapi 0.11.0 → 0.16.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,5 +1,7 @@
1
1
  require "excon"
2
2
  require "json"
3
+ require "base64"
4
+ require "fileutils"
3
5
 
4
6
  require "docker/api/version"
5
7
  require "docker/api/error"
@@ -18,9 +20,151 @@ require "docker/api/service"
18
20
  require "docker/api/task"
19
21
  require "docker/api/secret"
20
22
  require "docker/api/config"
23
+ require "docker/api/plugin"
21
24
 
22
25
  module Docker
23
26
  module API
27
+
28
+ ##
29
+ # This variable controls output verbosity.
30
+ PRINT_TO_STDOUT = true
31
+
32
+ ##
33
+ # Valid values for parameter validations.
34
+ VALID_PARAMS = {
35
+ "Docker::API::Image" => {
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],
37
+ "prune" => [:filters],
38
+ "list" => [:all, :filters, :digests],
39
+ "search" => [:term, :limit, :filters],
40
+ "tag" => [:repo, :tag],
41
+ "remove" => [:force, :noprune],
42
+ "import" => [:quiet],
43
+ "push" => [:tag],
44
+ "commit" => [:container, :repo, :tag, :comment, :author, :pause, :changes],
45
+ "create" => [:fromImage, :fromSrc, :repo, :tag, :message, :platform],
46
+ "delete_cache" => [:all, "keep-storage", :filters]
47
+ },
48
+ "Docker::API::Container" => {
49
+ "list" => [:all, :limit, :size, :filters],
50
+ "details" => [:size],
51
+ "top" => [:ps_args],
52
+ "start" => [:detachKeys],
53
+ "stop" => [:t],
54
+ "restart" => [:t],
55
+ "kill" => [:signal],
56
+ "wait" => [:condition],
57
+ "rename" => [:name],
58
+ "resize" => [:w, :h],
59
+ "prune" => [:filters],
60
+ "remove" => [:v, :force, :link],
61
+ "logs" => [:follow, :stdout, :stderr, :since, :until, :timestamps, :tail],
62
+ "attach" => [:detachKeys, :logs, :stream, :stdin, :stdout, :stderr],
63
+ "stats" => [:stream],
64
+ "get_archive" => [:path],
65
+ "put_archive" => [:path, :noOverwriteDirNonDir, :copyUIDGID],
66
+ "create" => [:name]
67
+ },
68
+ "Docker::API::Volume" => {
69
+ "list" => [:filters],
70
+ "remove" => [:force],
71
+ "prune" => [:filters]
72
+ },
73
+ "Docker::API::Network" => {
74
+ "list" => [:filters],
75
+ "details" => [:verbose, :scope],
76
+ "prune" => [:filters]
77
+ },
78
+ "Docker::API::System" => {
79
+ "events" => [:since, :until, :filters]
80
+ },
81
+ "Docker::API::Exec" => {
82
+ "resize" => [:w, :h]
83
+ },
84
+ "Docker::API::Swarm" => {
85
+ "leave" => [:force],
86
+ "update" => [:version, :rotateWorkerToken, :rotateManagerToken, :rotateManagerUnlockKey]
87
+ },
88
+ "Docker::API::Node" => {
89
+ "list" => [:filters],
90
+ "update" => [:version],
91
+ "delete" => [:force]
92
+ },
93
+ "Docker::API::Service" => {
94
+ "list" => [:filters],
95
+ "update" => [:version, :registryAuthFrom, :rollback],
96
+ "details" => [:insertDefaults],
97
+ "logs" => [:details, :follow, :stdout, :stderr, :since, :timestamps, :tail]
98
+ },
99
+ "Docker::API::Secret" => {
100
+ "list" => [:filters],
101
+ "update" => [:version]
102
+ },
103
+ "Docker::API::Task" => {
104
+ "list" => [:filters],
105
+ "logs" => [:details, :follow, :stdout, :stderr, :since, :timestamps, :tail]
106
+ },
107
+ "Docker::API::Plugin" => {
108
+ "list" => [:filters],
109
+ "privileges" => [:remote],
110
+ "install" => [:remote, :name],
111
+ "remove" => [:force],
112
+ "enable" => [:timeout],
113
+ "upgrade" => [:remote]
114
+ },
115
+ "Docker::API::Config" => {
116
+ "list" => [:filters],
117
+ "update" => [:version]
118
+ }
119
+ }
120
+
121
+ ##
122
+ # Valid values for request body validations.
123
+ VALID_BODY = {
124
+ "Docker::API::Image" => {
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]
126
+ },
127
+ "Docker::API::Container" => {
128
+ "create" => [: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,:HostConfig,:NetworkingConfig],
129
+ "update" => [:CpuShares, :Memory, :CgroupParent, :BlkioWeight, :BlkioWeightDevice, :BlkioWeightReadBps, :BlkioWeightWriteBps, :BlkioWeightReadOps, :BlkioWeightWriteOps, :CpuPeriod, :CpuQuota, :CpuRealtimePeriod, :CpuRealtimeRuntime, :CpusetCpus, :CpusetMems, :Devices, :DeviceCgroupRules, :DeviceRequest, :Kernel, :Memory, :KernelMemoryTCP, :MemoryReservation, :MemorySwap, :MemorySwappiness, :NanoCPUs, :OomKillDisable, :Init, :PidsLimit, :ULimits, :CpuCount, :CpuPercent, :IOMaximumIOps, :IOMaximumBandwidth, :RestartPolicy]
130
+ },
131
+ "Docker::API::Volume" => {
132
+ "create" => [:Name, :Driver, :DriverOpts, :Labels]
133
+ },
134
+ "Docker::API::Network" => {
135
+ "create" => [:Name, :CheckDuplicate, :Driver, :Internal, :Attachable, :Ingress, :IPAM, :EnableIPv6, :Options, :Labels],
136
+ "connect" => [:Container, :EndpointConfig],
137
+ "disconnect" => [:Container, :Force]
138
+ },
139
+ "Docker::API::System" => {
140
+ "auth" => [:username, :password, :email, :serveraddress, :identitytoken]
141
+ },
142
+ "Docker::API::Exec" => {
143
+ "create" => [:AttachStdin, :AttachStdout, :AttachStderr, :DetachKeys, :Tty, :Env, :Cmd, :Privileged, :User, :WorkingDir],
144
+ "start" => [:Detach, :Tty]
145
+ },
146
+ "Docker::API::Swarm" => {
147
+ "init" => [:ListenAddr, :AdvertiseAddr, :DataPathAddr, :DataPathPort, :DefaultAddrPool, :ForceNewCluster, :SubnetSize, :Spec],
148
+ "update" => [:Name, :Labels, :Orchestration, :Raft, :Dispatcher, :CAConfig, :EncryptionConfig, :TaskDefaults],
149
+ "unlock" => [:UnlockKey],
150
+ "join" => [:ListenAddr, :AdvertiseAddr, :DataPathAddr, :RemoteAddrs, :JoinToken]
151
+ },
152
+ "Docker::API::Node" => {
153
+ "update" => [:Name, :Labels, :Role, :Availability]
154
+ },
155
+ "Docker::API::Service" => {
156
+ "create" => [:Name, :Labels, :TaskTemplate, :Mode, :UpdateConfig, :RollbackConfig, :Networks, :EndpointSpec],
157
+ "update" => [:Name, :Labels, :TaskTemplate, :Mode, :UpdateConfig, :RollbackConfig, :Networks, :EndpointSpec]
158
+ },
159
+ "Docker::API::Secret" => {
160
+ "create" => [:Name, :Labels, :Data, :Driver, :Templating],
161
+ "update" => [:Name, :Labels, :Data, :Driver, :Templating]
162
+ },
163
+ "Docker::API::Config" => {
164
+ "create" => [:Name, :Labels, :Data, :Templating],
165
+ "update" => [:Name, :Labels, :Data, :Driver, :Templating]
166
+ }
167
+ }
24
168
 
25
169
  end
26
170
  end
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.11.0
4
+ version: 0.16.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-17 00:00:00.000000000 Z
11
+ date: 2020-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -16,15 +16,17 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.74.0
19
+ version: 0.76.0
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.0
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: []
@@ -52,6 +54,7 @@ files:
52
54
  - lib/docker/api/image.rb
53
55
  - lib/docker/api/network.rb
54
56
  - lib/docker/api/node.rb
57
+ - lib/docker/api/plugin.rb
55
58
  - lib/docker/api/response.rb
56
59
  - lib/docker/api/secret.rb
57
60
  - lib/docker/api/service.rb
@@ -68,6 +71,7 @@ metadata:
68
71
  homepage_uri: https://github.com/nu12/dockerapi
69
72
  source_code_uri: https://github.com/nu12/dockerapi.git
70
73
  changelog_uri: https://github.com/nu12/dockerapi/blob/master/CHANGELOG.md
74
+ documentation_uri: https://www.rubydoc.info/gems/dockerapi
71
75
  post_install_message:
72
76
  rdoc_options: []
73
77
  require_paths:
@@ -86,5 +90,5 @@ requirements: []
86
90
  rubygems_version: 3.1.2
87
91
  signing_key:
88
92
  specification_version: 4
89
- summary: Interact directly with Docker API from Ruby code.
93
+ summary: Interact with Docker API from Ruby code.
90
94
  test_files: []