hyperdock 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ece6869475b8063978c9ea067048e8cea3b07af8
|
4
|
+
data.tar.gz: a53ed407488432bea41bcaf47f81482523df94c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0b6b9f5813a591456252fdd0f6c6a04e997f1d983e212fcd8a88cf8a973d44e989926c3749b71496852923564bbb95a2d9c321d7fd74803e9a6e4274a0e5fd4
|
7
|
+
data.tar.gz: cdb1bbad3acc14b62d78602656a194670d2803b852825c2321ad6ad3bcb6b850d30d1ebf979e39e4e1f617e2966b70789a8e2e7944e46e84c3fbbaec6131775f
|
data/bin/hyperdock-api
CHANGED
@@ -11,6 +11,7 @@ Webmachine.application.routes do
|
|
11
11
|
add ['project', :project, 'service', :service], HyperDock::Resource::ProjectService
|
12
12
|
add ['containers'], HyperDock::Resource::Containers
|
13
13
|
add ['container', :container], HyperDock::Resource::Container
|
14
|
+
add ['container', :container, 'networks'], HyperDock::Resource::ContainerNetworks
|
14
15
|
add ['container', :container, 'ports'], HyperDock::Resource::ContainerPorts
|
15
16
|
end
|
16
17
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'container'
|
2
|
+
|
3
|
+
module HyperDock
|
4
|
+
module Resource
|
5
|
+
class ContainerNetworks < Container
|
6
|
+
Contract None => ArrayOf[String]
|
7
|
+
def networks
|
8
|
+
@networks ||= (container.info.dig('NetworkSettings', 'Networks') || {} ).values.map do |network|
|
9
|
+
network['NetworkID']
|
10
|
+
end.compact
|
11
|
+
end
|
12
|
+
|
13
|
+
def links
|
14
|
+
@links ||= {
|
15
|
+
networks: networks.map { |network| { "network:#{network}" => "/network/#{network}" } }.reduce(&:merge)
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def attributes
|
20
|
+
{ networks: networks }
|
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.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Olstrom
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- hyperdock.gemspec
|
84
84
|
- lib/hyperdock.rb
|
85
85
|
- lib/hyperdock/resource/container.rb
|
86
|
+
- lib/hyperdock/resource/container_networks.rb
|
86
87
|
- lib/hyperdock/resource/container_ports.rb
|
87
88
|
- lib/hyperdock/resource/containers.rb
|
88
89
|
- lib/hyperdock/resource/core.rb
|