gaptool-server 0.2.0 → 0.2.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gaptool-server"
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Bailey"]
12
- s.date = "2013-01-05"
12
+ s.date = "2013-01-07"
13
13
  s.description = "gaptool-server for managing cloud resources"
14
14
  s.email = "m@mdb.io"
15
15
  s.executables = ["gaptool-server"]
@@ -6,6 +6,18 @@ module GaptoolBaseHelpers
6
6
  end
7
7
  end
8
8
 
9
+ def redishash(query)
10
+ result = Hash.new
11
+ query.keys.each do |key|
12
+ entry = Hash.new
13
+ query[key].each do |hkey|
14
+ entry.merge!(hkey => $redis.hget(key, hkey))
15
+ end
16
+ result.merge!({ key => entry })
17
+ end
18
+ return result
19
+ end
20
+
9
21
  def putkey( host )
10
22
  @key = OpenSSL::PKey::RSA.new 2048
11
23
  @pubkey = "#{@key.ssh_type} #{[@key.to_blob].pack('m0')} GAPTOOL_GENERATED_KEY"
data/lib/routes/main.rb CHANGED
@@ -5,6 +5,11 @@ class GaptoolServer < Sinatra::Application
5
5
  "You must be lost. Read the instructions."
6
6
  end
7
7
 
8
+ post '/redishash' do
9
+ data = JSON.parse request.body.read
10
+ redishash(data).to_json
11
+ end
12
+
8
13
  get '/servicebalance/:role/:environment' do
9
14
  runlist = balanceservices(params[:role], params[:environment])
10
15
  unless runlist.kind_of? Hash
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gaptool-server
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.0
5
+ version: 0.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matt Bailey
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-01-05 00:00:00 Z
13
+ date: 2013-01-07 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sinatra
@@ -205,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
- hash: 1050799946438420370
208
+ hash: -4507266766054900677
209
209
  segments:
210
210
  - 0
211
211
  version: "0"