vagrant-subutai 1.0.3 → 1.1.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/.gitignore +2 -1
- data/CHANGELOG.md +7 -0
- data/README.md +3 -2
- data/lib/vagrant-subutai.rb +33 -7
- data/lib/vagrant-subutai/blueprint/ansible_controller.rb +93 -0
- data/lib/vagrant-subutai/blueprint/environment_controller.rb +324 -0
- data/lib/vagrant-subutai/blueprint/variables_controller.rb +547 -0
- data/lib/vagrant-subutai/command.rb +84 -90
- data/lib/vagrant-subutai/config.rb +8 -43
- data/lib/vagrant-subutai/configs/configs.rb +179 -0
- data/lib/vagrant-subutai/models/ansible.rb +18 -0
- data/lib/vagrant-subutai/models/console/container.rb +27 -0
- data/lib/vagrant-subutai/models/console/environment.rb +16 -0
- data/lib/vagrant-subutai/models/container.rb +34 -0
- data/lib/vagrant-subutai/models/domain.rb +11 -0
- data/lib/vagrant-subutai/models/environment.rb +13 -0
- data/lib/vagrant-subutai/packer/subutai_config.rb +17 -1
- data/lib/vagrant-subutai/plugin.rb +10 -3
- data/lib/vagrant-subutai/provisioner.rb +63 -0
- data/lib/vagrant-subutai/put.rb +21 -0
- data/lib/vagrant-subutai/rest/bazaar.rb +141 -0
- data/lib/vagrant-subutai/rest/gorjun.rb +40 -0
- data/lib/vagrant-subutai/rest/subutai_console.rb +189 -0
- data/lib/vagrant-subutai/subutai_commands.rb +250 -122
- data/lib/vagrant-subutai/version.rb +1 -1
- metadata +18 -6
- data/Vagrantfile +0 -7
- data/lib/vagrant-subutai/models/resource_host.rb +0 -7
- data/lib/vagrant-subutai/rest.rb +0 -77
- data/lib/vagrant-subutai/rh_controller.rb +0 -32
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-subutai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Subutai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -45,23 +45,35 @@ extensions: []
|
|
45
45
|
extra_rdoc_files: []
|
46
46
|
files:
|
47
47
|
- .gitignore
|
48
|
+
- CHANGELOG.md
|
48
49
|
- CODEOWNERS
|
49
50
|
- Gemfile
|
50
51
|
- README.md
|
51
52
|
- Rakefile
|
52
|
-
- Vagrantfile
|
53
53
|
- build.sh
|
54
54
|
- lib/vagrant-subutai.rb
|
55
|
+
- lib/vagrant-subutai/blueprint/ansible_controller.rb
|
56
|
+
- lib/vagrant-subutai/blueprint/environment_controller.rb
|
57
|
+
- lib/vagrant-subutai/blueprint/variables_controller.rb
|
55
58
|
- lib/vagrant-subutai/command.rb
|
56
59
|
- lib/vagrant-subutai/config.rb
|
57
|
-
- lib/vagrant-subutai/
|
60
|
+
- lib/vagrant-subutai/configs/configs.rb
|
61
|
+
- lib/vagrant-subutai/models/ansible.rb
|
62
|
+
- lib/vagrant-subutai/models/console/container.rb
|
63
|
+
- lib/vagrant-subutai/models/console/environment.rb
|
64
|
+
- lib/vagrant-subutai/models/container.rb
|
65
|
+
- lib/vagrant-subutai/models/domain.rb
|
66
|
+
- lib/vagrant-subutai/models/environment.rb
|
58
67
|
- lib/vagrant-subutai/packer/subutai_config.rb
|
59
68
|
- lib/vagrant-subutai/packer/subutai_disk.rb
|
60
69
|
- lib/vagrant-subutai/packer/subutai_hooks.rb
|
61
70
|
- lib/vagrant-subutai/packer/subutai_net.rb
|
62
71
|
- lib/vagrant-subutai/plugin.rb
|
63
|
-
- lib/vagrant-subutai/
|
64
|
-
- lib/vagrant-subutai/
|
72
|
+
- lib/vagrant-subutai/provisioner.rb
|
73
|
+
- lib/vagrant-subutai/put.rb
|
74
|
+
- lib/vagrant-subutai/rest/bazaar.rb
|
75
|
+
- lib/vagrant-subutai/rest/gorjun.rb
|
76
|
+
- lib/vagrant-subutai/rest/subutai_console.rb
|
65
77
|
- lib/vagrant-subutai/subutai_commands.rb
|
66
78
|
- lib/vagrant-subutai/version.rb
|
67
79
|
- lib/vagrant_init.rb
|
data/Vagrantfile
DELETED
data/lib/vagrant-subutai/rest.rb
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
require 'net/https'
|
2
|
-
require 'uri'
|
3
|
-
require_relative '../vagrant-subutai'
|
4
|
-
|
5
|
-
module VagrantSubutai
|
6
|
-
module Rest
|
7
|
-
class SubutaiConsole
|
8
|
-
# Subutai Console credentials username, password
|
9
|
-
# Subutai Console url
|
10
|
-
# login methods gets token
|
11
|
-
def self.token(url, username, password)
|
12
|
-
uri = URI.parse(url + SubutaiConsoleAPI::V1::TOKEN)
|
13
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
14
|
-
http.use_ssl = true
|
15
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
16
|
-
|
17
|
-
request = Net::HTTP::Post.new(uri.request_uri)
|
18
|
-
request.set_form_data('username' => username, 'password' => password)
|
19
|
-
|
20
|
-
# returns response
|
21
|
-
return http.request(request)
|
22
|
-
end
|
23
|
-
|
24
|
-
# Subutai Hub credentials email, password
|
25
|
-
# specify your peer_name
|
26
|
-
# peer_scope acceptable only like this "Public" : "Private"
|
27
|
-
def self.register(token, url, email, password, peer_name, peer_scope)
|
28
|
-
uri = URI.parse(url + SubutaiConsoleAPI::V1::REGISTER_HUB + token)
|
29
|
-
https = Net::HTTP.new(uri.host, uri.port)
|
30
|
-
https.use_ssl = true
|
31
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
32
|
-
|
33
|
-
request = Net::HTTP::Post.new(uri.request_uri)
|
34
|
-
request.set_form_data({'email' => email, 'password' => password, 'peerName' => peer_name, 'peerScope' => peer_scope})
|
35
|
-
|
36
|
-
# returns response
|
37
|
-
return https.request(request)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Approves Resource Host
|
41
|
-
def self.approve(token, url, id)
|
42
|
-
uri = URI.parse(url + SubutaiConsoleAPI::V1::APPROVE + "/#{id}/approve?sptoken?=" + token)
|
43
|
-
https = Net::HTTP.new(uri.host, uri.port)
|
44
|
-
https.use_ssl = true
|
45
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
46
|
-
|
47
|
-
request = Net::HTTP::Post.new(uri.request_uri)
|
48
|
-
|
49
|
-
return https.request(request)
|
50
|
-
end
|
51
|
-
|
52
|
-
# Gets Finger print Subutai Console
|
53
|
-
def self.fingerprint(url)
|
54
|
-
uri = URI.parse(url + SubutaiConsoleAPI::V1::FINGERPRINT)
|
55
|
-
https = Net::HTTP.new(uri.host, uri.port)
|
56
|
-
https.use_ssl = true
|
57
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
58
|
-
|
59
|
-
request = Net::HTTP::Get.new(uri.request_uri)
|
60
|
-
|
61
|
-
return https.request(request)
|
62
|
-
end
|
63
|
-
|
64
|
-
# Get Subutai Console RH requests
|
65
|
-
def self.requests(url, token)
|
66
|
-
uri = URI.parse(url + SubutaiConsoleAPI::V1::REQUESTS + token)
|
67
|
-
https = Net::HTTP.new(uri.host, uri.port)
|
68
|
-
https.use_ssl = true
|
69
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
70
|
-
|
71
|
-
request = Net::HTTP::Get.new(uri.request_uri)
|
72
|
-
|
73
|
-
return https.request(request)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require_relative '../vagrant-subutai'
|
2
|
-
require 'json'
|
3
|
-
|
4
|
-
module VagrantSubutai
|
5
|
-
class RhController
|
6
|
-
|
7
|
-
def all(token)
|
8
|
-
response = VagrantSubutai::Rest::SubutaiConsole.requests($SUBUTAI_CONSOLE_URL, token)
|
9
|
-
rhs = []
|
10
|
-
|
11
|
-
case response
|
12
|
-
when Net::HTTPOK
|
13
|
-
json = JSON.parse(response.body)
|
14
|
-
|
15
|
-
json.each do |data|
|
16
|
-
rh = VagrantSubutai::Models::Rh.new
|
17
|
-
rh.id = data['id']
|
18
|
-
rh.hostname = data['hostname']
|
19
|
-
rh.status = data['status']
|
20
|
-
rh.isConnected = data['isConnected']
|
21
|
-
rh.isManagement = data['isManagement']
|
22
|
-
rhs << rh
|
23
|
-
end
|
24
|
-
else
|
25
|
-
STDERR.puts "#{response.body}"
|
26
|
-
raise 'Can\'t get requests info from Subutai Console'
|
27
|
-
end
|
28
|
-
|
29
|
-
rhs
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|