hyperdock 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hyperdock-api +1 -0
- data/lib/hyperdock/resource/container.rb +8 -0
- data/lib/hyperdock/resource/root.rb +2 -1
- data/lib/hyperdock/resource/volume.rb +24 -0
- data/lib/hyperdock/resources.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ac5a7d70d6c21f9b17ff97cdb95f87702d2f7b9
|
4
|
+
data.tar.gz: 9e2bd811a87c6ad98b6c9e8ee3cbe749a6585c8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9923ac33a2733ebe90707113a97090a25ab56f27803e6fe5d80d5fbc3e7647836e0703e2cd1b3baf5fe123e6a2d94cdc75e1fbedd967a06bb0f914cc889318df
|
7
|
+
data.tar.gz: 88b3b036cf3583e38456ae74815d4fbe23f6bc249f77acb2c15ae334b62b433a05e38d062c554a62c5307fd6081272319d5ba2b3013d193c54559b20ba790ee8
|
data/bin/hyperdock-api
CHANGED
@@ -15,6 +15,7 @@ Webmachine.application.routes do
|
|
15
15
|
add ['networks'], HyperDock::Resource::Networks
|
16
16
|
add ['network', :network], HyperDock::Resource::Network
|
17
17
|
add ['volumes'], HyperDock::Resource::Volumes
|
18
|
+
add ['volume', :volume], HyperDock::Resource::Volume
|
18
19
|
end
|
19
20
|
|
20
21
|
Webmachine.application.run
|
@@ -28,9 +28,17 @@ module HyperDock
|
|
28
28
|
.map { |network| { href: "/network/#{network}" } }
|
29
29
|
end
|
30
30
|
|
31
|
+
def volumes
|
32
|
+
@volumes ||= container
|
33
|
+
.info
|
34
|
+
.fetch('Mounts') { [] }
|
35
|
+
.map { |volume| { href: "/volume/#{volume.fetch('Name')}" } }
|
36
|
+
end
|
37
|
+
|
31
38
|
def links
|
32
39
|
@links ||= {
|
33
40
|
networks: networks,
|
41
|
+
volumes: volumes,
|
34
42
|
ports: { href: "/#{request.disp_path}/ports" }
|
35
43
|
}
|
36
44
|
end
|
@@ -19,7 +19,8 @@ module HyperDock
|
|
19
19
|
'container:ports' => { href: '/container/{container}/ports', templated: true },
|
20
20
|
networks: { href: '/networks' },
|
21
21
|
network: { href: '/network/{network}', templated: true },
|
22
|
-
volumes: { href: '/volumes' }
|
22
|
+
volumes: { href: '/volumes' },
|
23
|
+
volume: { href: '/volume/{volume}', templated: true }
|
23
24
|
}
|
24
25
|
end
|
25
26
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'docker-api'
|
2
|
+
require_relative 'core'
|
3
|
+
|
4
|
+
module HyperDock
|
5
|
+
module Resource
|
6
|
+
class Volume < Core
|
7
|
+
Contract None => Maybe[::Docker::Volume]
|
8
|
+
def volume
|
9
|
+
@volume ||= ::Docker::Volume.get request.path_info[:volume]
|
10
|
+
end
|
11
|
+
|
12
|
+
Contract None => Bool
|
13
|
+
def resource_exists?
|
14
|
+
!volume.nil?
|
15
|
+
rescue ::Docker::Error::NotFoundError
|
16
|
+
false
|
17
|
+
end
|
18
|
+
|
19
|
+
def attributes
|
20
|
+
volume.info
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/hyperdock/resources.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperdock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Olstrom
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/hyperdock/resource/project_services.rb
|
95
95
|
- lib/hyperdock/resource/projects.rb
|
96
96
|
- lib/hyperdock/resource/root.rb
|
97
|
+
- lib/hyperdock/resource/volume.rb
|
97
98
|
- lib/hyperdock/resource/volumes.rb
|
98
99
|
- lib/hyperdock/resources.rb
|
99
100
|
homepage: https://github.com/colstrom/hyperdock
|