smart_proxy_discovery 1.0.0 → 1.0.1
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: c44e7552bc04515acee1e8328dffda3fd594d215
|
4
|
+
data.tar.gz: d1d3e26f7abd3962fe84d4ab7aeae107e32a349e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 085cac6a876cca7bb6e9b0c2333e5100eee192fd82fec65040a5d10a9f0d240412247e535e5bf24365be947037a557f36d6c1f9ddb99918de6e5d6e2a2e0c37c
|
7
|
+
data.tar.gz: 00195756941fdd901fa70443085ba12999e39aee15013c16087f07bbd5f5f5bf3d14ac884b2d06dfa6574cf50051c7ab7cdc5a7341d801b92013d1b15aaf8e13
|
@@ -1,19 +1,17 @@
|
|
1
1
|
require 'sinatra'
|
2
|
-
require 'rack/contrib'
|
3
2
|
require 'smart_proxy_discovery/discovery'
|
4
3
|
require 'smart_proxy_discovery/discovery_main'
|
5
4
|
|
6
5
|
module Proxy::Discovery
|
7
6
|
|
8
7
|
class Api < ::Sinatra::Base
|
9
|
-
use Rack::PostBodyContentTypeParser
|
10
8
|
helpers ::Proxy::Helpers
|
11
9
|
authorize_with_trusted_hosts
|
12
10
|
|
13
11
|
post '/create' do
|
14
12
|
content_type :json
|
15
13
|
begin
|
16
|
-
Proxy::Discovery.create_discovered_host(
|
14
|
+
Proxy::Discovery.create_discovered_host(request)
|
17
15
|
rescue => error
|
18
16
|
error_responder(error)
|
19
17
|
end
|
@@ -9,9 +9,10 @@ module Proxy::Discovery
|
|
9
9
|
CREATE_DISCOVERED_HOST_PATH = '/api/v2/discovered_hosts/facts'
|
10
10
|
REFRESH_HOST_PATH = '/facts'
|
11
11
|
|
12
|
-
def create_discovered_host(
|
12
|
+
def create_discovered_host(request)
|
13
13
|
foreman_request = Proxy::HttpRequest::ForemanRequest.new()
|
14
|
-
foreman_request.
|
14
|
+
req = foreman_request.request_factory.create_post(CREATE_DISCOVERED_HOST_PATH, request.body)
|
15
|
+
foreman_request.send_request(req)
|
15
16
|
end
|
16
17
|
|
17
18
|
def refresh_facts(ip)
|
@@ -30,10 +31,7 @@ module Proxy::Discovery
|
|
30
31
|
private
|
31
32
|
|
32
33
|
def get_rest_client(url)
|
33
|
-
RestClient::Resource.new(
|
34
|
-
url,
|
35
|
-
:verify_ssl => OpenSSL::SSL::VERIFY_NONE
|
36
|
-
)
|
34
|
+
RestClient::Resource.new(url, :verify_ssl => OpenSSL::SSL::VERIFY_NONE)
|
37
35
|
end
|
38
36
|
end
|
39
37
|
end
|
metadata
CHANGED
@@ -1,93 +1,65 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_discovery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shlomi Zadok
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: mocha
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: webmock
|
14
|
+
name: rake
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
44
16
|
requirements:
|
45
|
-
- - "
|
17
|
+
- - ">="
|
46
18
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
19
|
+
version: '0'
|
48
20
|
type: :development
|
49
21
|
prerelease: false
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
51
23
|
requirements:
|
52
|
-
- - "
|
24
|
+
- - ">="
|
53
25
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
26
|
+
version: '0'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: rack-test
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
|
-
- - "
|
31
|
+
- - ">="
|
60
32
|
- !ruby/object:Gem::Version
|
61
33
|
version: '0'
|
62
34
|
type: :development
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
|
-
- - "
|
38
|
+
- - ">="
|
67
39
|
- !ruby/object:Gem::Version
|
68
40
|
version: '0'
|
69
41
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
42
|
+
name: mocha
|
71
43
|
requirement: !ruby/object:Gem::Requirement
|
72
44
|
requirements:
|
73
|
-
- - "
|
45
|
+
- - ">="
|
74
46
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
47
|
+
version: '0'
|
76
48
|
type: :development
|
77
49
|
prerelease: false
|
78
50
|
version_requirements: !ruby/object:Gem::Requirement
|
79
51
|
requirements:
|
80
|
-
- - "
|
52
|
+
- - ">="
|
81
53
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
54
|
+
version: '0'
|
83
55
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
56
|
+
name: webmock
|
85
57
|
requirement: !ruby/object:Gem::Requirement
|
86
58
|
requirements:
|
87
59
|
- - ">="
|
88
60
|
- !ruby/object:Gem::Version
|
89
61
|
version: '0'
|
90
|
-
type: :
|
62
|
+
type: :development
|
91
63
|
prerelease: false
|
92
64
|
version_requirements: !ruby/object:Gem::Requirement
|
93
65
|
requirements:
|