panteras_api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/License +21 -0
- data/README.md +10 -7
- data/lib/panteras_api/mesos_cluster.rb +7 -5
- data/lib/panteras_api/version.rb +1 -1
- data/panteras_api.gemspec +1 -0
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49553c927d9b2678f85f7b62c89b879a125e1b91
|
4
|
+
data.tar.gz: 33b7edfa7e0e25e8ab87a7808084ee60665506d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e425e56e2add51a1c350190d268dd260086673197b484ccac6c97532db2f0241984a90923dc1c13fb47363cda5fc1a2cf1a39a24bfafce85703c181c3103e07
|
7
|
+
data.tar.gz: f8af45194c3e3312cd546a4f5adb7a735efe5abcb662046a7d66faa7b271b675c089f81e3e4cde3eeb793ce8efc2086ba86bfe2e737d9c02072837c6c7ab4109
|
data/License
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 eBay Classifieds Group
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,18 +1,21 @@
|
|
1
1
|
# PanterasApi
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
It is intended for use together with the [Panteras](https://github.com/eBayClassifiedsGroup/PanteraS) project.
|
6
|
-
|
7
|
-
**It will not work on other systems without tweaking the main program.**
|
3
|
+
A convenient api for getting information from consul, mesos, marathon, and docker in the Panteras PaaS infrastructure.
|
4
|
+
ex
|
8
5
|
|
9
6
|
## Installation
|
10
7
|
|
11
8
|
$ gem install panteras_api
|
12
9
|
|
13
|
-
##
|
10
|
+
## mesos_marathon_consistency_check (in Extras directory)
|
11
|
+
|
12
|
+
This is a program that checks services consistencies in a mesos/marathon/consul/docker PaaS infrastructure.
|
13
|
+
|
14
|
+
It is intended for use together with the [Panteras](https://github.com/eBayClassifiedsGroup/PanteraS) project.
|
15
|
+
|
16
|
+
**It will not work on other systems without tweaking the main program.**
|
14
17
|
|
15
|
-
Usage:
|
18
|
+
Usage: mesos_marathon_consistency_check [options]
|
16
19
|
-m MESOS_MASTER_HOSTNAME, Default: localhost
|
17
20
|
--mesos-master-hostname
|
18
21
|
-p MESOS_MASTER_PORT, Default: 5050
|
@@ -10,6 +10,7 @@ class MesosCluster
|
|
10
10
|
attr_reader :state
|
11
11
|
|
12
12
|
def initialize(host, port=5050)
|
13
|
+
@protocol = "http:"
|
13
14
|
@host = host
|
14
15
|
@port = port
|
15
16
|
@master_info = "/master/redirect"
|
@@ -18,11 +19,12 @@ class MesosCluster
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def parse_state
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
response = get_response_with_redirect(@host, @master_info, @port).to_s
|
23
|
+
response = @protocol + response if !response.include?@protocol
|
24
|
+
redirect_response = response
|
25
|
+
if URI.parse(redirect_response).kind_of?(URI::HTTP)
|
24
26
|
if ! valid_url(redirect_response.to_s)
|
25
|
-
raise StandardError, "Response from
|
27
|
+
raise StandardError, "Response from #{@protocol}//#{@host}:#{@port}#{@master_info} is not a valid url: #{redirect_response.to_s}"
|
26
28
|
end
|
27
29
|
return to_j(get_response_with_redirect(URI.join(redirect_response.to_s, @state_info)))
|
28
30
|
end
|
@@ -77,4 +79,4 @@ class MesosCluster
|
|
77
79
|
JSON.pretty_generate @state
|
78
80
|
end
|
79
81
|
|
80
|
-
end
|
82
|
+
end
|
data/lib/panteras_api/version.rb
CHANGED
data/panteras_api.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panteras_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Colby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: A convenient api for getting information from consul, mesos, marathon,
|
42
56
|
and docker in the Panteras PaaS infrastructure.
|
43
57
|
email:
|
@@ -50,6 +64,7 @@ files:
|
|
50
64
|
- ".rspec"
|
51
65
|
- ".travis.yml"
|
52
66
|
- Gemfile
|
67
|
+
- License
|
53
68
|
- README.md
|
54
69
|
- Rakefile
|
55
70
|
- extra/mesos_consul_consistency_check
|
@@ -82,8 +97,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
97
|
version: '0'
|
83
98
|
requirements: []
|
84
99
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.4.
|
100
|
+
rubygems_version: 2.4.6
|
86
101
|
signing_key:
|
87
102
|
specification_version: 4
|
88
103
|
summary: Ruby API library for Panteras PaaS platform.
|
89
104
|
test_files: []
|
105
|
+
has_rdoc:
|