hyperdock 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +54 -0
- data/bin/hyperdock-api +1 -0
- data/lib/hyperdock/resource/network.rb +39 -0
- data/lib/hyperdock/resources.rb +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0b05ae697ecdfad1bcb4eb21abf59a1060b7230
|
4
|
+
data.tar.gz: 8f19cd8371eaa702f49600d28716657ade33e595
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a570ec6b00bbb62ef38ea335714e01d191be0e737451a6657b980c2c0f6ba458d95338e022fdde1b016aa508bc671fedf9060a6921b08295c43641e328a6b47
|
7
|
+
data.tar.gz: 6df9901707ddeefa79f86684b2c8de1e1ec089f5af6863bdfe5148e5c4c3685b7fd0b08b4e05704ef5094dc3d884d0caa2f5ea68b76392977da58ef487dff4c5
|
data/.gitignore
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
|
2
|
+
# Created by https://www.gitignore.io/api/ruby
|
3
|
+
|
4
|
+
### Ruby ###
|
5
|
+
*.gem
|
6
|
+
*.rbc
|
7
|
+
/.config
|
8
|
+
/coverage/
|
9
|
+
/InstalledFiles
|
10
|
+
/pkg/
|
11
|
+
/spec/reports/
|
12
|
+
/spec/examples.txt
|
13
|
+
/test/tmp/
|
14
|
+
/test/version_tmp/
|
15
|
+
/tmp/
|
16
|
+
|
17
|
+
# Used by dotenv library to load environment variables.
|
18
|
+
# .env
|
19
|
+
|
20
|
+
## Specific to RubyMotion:
|
21
|
+
.dat*
|
22
|
+
.repl_history
|
23
|
+
build/
|
24
|
+
*.bridgesupport
|
25
|
+
build-iPhoneOS/
|
26
|
+
build-iPhoneSimulator/
|
27
|
+
|
28
|
+
## Specific to RubyMotion (use of CocoaPods):
|
29
|
+
#
|
30
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
31
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
32
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
33
|
+
#
|
34
|
+
# vendor/Pods/
|
35
|
+
|
36
|
+
## Documentation cache and generated files:
|
37
|
+
/.yardoc/
|
38
|
+
/_yardoc/
|
39
|
+
/doc/
|
40
|
+
/rdoc/
|
41
|
+
|
42
|
+
## Environment normalization:
|
43
|
+
/.bundle/
|
44
|
+
/vendor/bundle
|
45
|
+
/lib/bundler/man/
|
46
|
+
|
47
|
+
# for a library or gem, you might want to ignore these files since the code is
|
48
|
+
# intended to run in multiple environments; otherwise, check them in:
|
49
|
+
# Gemfile.lock
|
50
|
+
# .ruby-version
|
51
|
+
# .ruby-gemset
|
52
|
+
|
53
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
54
|
+
.rvmrc
|
data/bin/hyperdock-api
CHANGED
@@ -13,6 +13,7 @@ Webmachine.application.routes do
|
|
13
13
|
add ['container', :container], HyperDock::Resource::Container
|
14
14
|
add ['container', :container, 'ports'], HyperDock::Resource::ContainerPorts
|
15
15
|
add ['networks'], HyperDock::Resource::Networks
|
16
|
+
add ['network', :network], HyperDock::Resource::Network
|
16
17
|
end
|
17
18
|
|
18
19
|
Webmachine.application.run
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'docker-api'
|
2
|
+
require_relative 'core'
|
3
|
+
|
4
|
+
module HyperDock
|
5
|
+
module Resource
|
6
|
+
class Network < Core
|
7
|
+
Contract None => Maybe[::Docker::Network]
|
8
|
+
def network
|
9
|
+
@network ||= ::Docker::Network.get request.path_info[:network]
|
10
|
+
end
|
11
|
+
|
12
|
+
Contract None => Bool
|
13
|
+
def resource_exists?
|
14
|
+
!network.nil?
|
15
|
+
rescue ::Docker::Error::NotFoundError
|
16
|
+
false
|
17
|
+
end
|
18
|
+
|
19
|
+
Contract None => ArrayOf[HashOf[RespondTo[:to_s], String]]
|
20
|
+
def containers
|
21
|
+
@containers ||= network
|
22
|
+
.info
|
23
|
+
.fetch('Containers') { {} }
|
24
|
+
.keys
|
25
|
+
.map { |container| { href: "/container/#{container}" } }
|
26
|
+
end
|
27
|
+
|
28
|
+
def links
|
29
|
+
@links ||= {
|
30
|
+
containers: containers
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def attributes
|
35
|
+
network.info
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/hyperdock/resources.rb
CHANGED
@@ -2,6 +2,7 @@ require_relative 'resource/container'
|
|
2
2
|
require_relative 'resource/container_ports'
|
3
3
|
require_relative 'resource/containers'
|
4
4
|
require_relative 'resource/networks'
|
5
|
+
require_relative 'resource/network'
|
5
6
|
require_relative 'resource/project'
|
6
7
|
require_relative 'resource/project_service'
|
7
8
|
require_relative 'resource/project_services'
|
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.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Olstrom
|
@@ -77,6 +77,7 @@ executables:
|
|
77
77
|
extensions: []
|
78
78
|
extra_rdoc_files: []
|
79
79
|
files:
|
80
|
+
- ".gitignore"
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.org
|
82
83
|
- bin/hyperdock-api
|
@@ -86,6 +87,7 @@ files:
|
|
86
87
|
- lib/hyperdock/resource/container_ports.rb
|
87
88
|
- lib/hyperdock/resource/containers.rb
|
88
89
|
- lib/hyperdock/resource/core.rb
|
90
|
+
- lib/hyperdock/resource/network.rb
|
89
91
|
- lib/hyperdock/resource/networks.rb
|
90
92
|
- lib/hyperdock/resource/project.rb
|
91
93
|
- lib/hyperdock/resource/project_service.rb
|