cf_light_api 1.6.7 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cf_light_api/worker.rb +4 -4
- data/lib/sinatra/cf_light_api.rb +9 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3067cac56cd133c9fc4fd246f29e0874335f2998
|
4
|
+
data.tar.gz: 4fb42dd6f9e61ee969b6d966c15ac5bfc636cc6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 348c46fd0ae464fb196b78598a713ed1b620a989757bdb1d8dcdf61d542df19b8d7edf5bd985e921b4cd5b61ad3c05ded7831c5f49ec6c4b458c85043ea4fbf9
|
7
|
+
data.tar.gz: 64723974aad403fb3cff89385976ce7f7a8c2bb4214a3a5fd325f9ff65c8734a6fba658dde1496ca2f6c1e5e123c1ec3bdafa795ad208f5c54a9c2e1bc37ca97
|
data/lib/cf_light_api/worker.rb
CHANGED
@@ -114,11 +114,11 @@ end
|
|
114
114
|
|
115
115
|
def get_org_data(cf_client)
|
116
116
|
Parallel.map( cf_client.organizations, :in_threads=> PARALLEL_MAPS) do |org|
|
117
|
-
|
118
|
-
@logger.info "Getting org data for #{org_name}..."
|
117
|
+
@logger.info "Getting org data for #{org.name}..."
|
119
118
|
# The CFoundry client returns memory_limit in MB, so we need to normalise to bytes to match the Apps.
|
120
119
|
{
|
121
|
-
:
|
120
|
+
:guid => org.guid,
|
121
|
+
:name => org.name,
|
122
122
|
:quota => {
|
123
123
|
:total_services => org.quota_definition.total_services,
|
124
124
|
:memory_limit => org.quota_definition.memory_limit * 1024 * 1024
|
@@ -151,7 +151,7 @@ def format_app_data(app, org_name, space_name)
|
|
151
151
|
:error => nil
|
152
152
|
}
|
153
153
|
rescue => e
|
154
|
-
|
154
|
+
@logger.info " #{org_name} #{space_name}: '#{app.name}'' error: #{e.message}"
|
155
155
|
additional_data = {
|
156
156
|
:running => 'error',
|
157
157
|
:instances => [],
|
data/lib/sinatra/cf_light_api.rb
CHANGED
@@ -5,9 +5,8 @@ module Sinatra
|
|
5
5
|
|
6
6
|
def self.registered(app)
|
7
7
|
app.get '/v1/apps/?:org?' do
|
8
|
-
all_apps = JSON.parse(REDIS.get("#{ENV['REDIS_KEY_PREFIX']}:apps"))
|
9
|
-
|
10
8
|
content_type :json
|
9
|
+
all_apps = JSON.parse(REDIS.get("#{ENV['REDIS_KEY_PREFIX']}:apps"))
|
11
10
|
|
12
11
|
if params[:org]
|
13
12
|
return all_apps.select{|an_app| an_app['org'] == params[:org]}.to_json
|
@@ -16,9 +15,15 @@ module Sinatra
|
|
16
15
|
return all_apps.to_json
|
17
16
|
end
|
18
17
|
|
19
|
-
app.get '/v1/orgs
|
18
|
+
app.get '/v1/orgs/?:guid?' do
|
20
19
|
content_type :json
|
21
|
-
REDIS.get
|
20
|
+
all_orgs = JSON.parse(REDIS.get("#{ENV['REDIS_KEY_PREFIX']}:orgs"))
|
21
|
+
|
22
|
+
if params[:guid]
|
23
|
+
return all_orgs.select{|an_org| an_org['guid'] == params[:guid]}.to_json
|
24
|
+
end
|
25
|
+
|
26
|
+
return all_orgs.to_json
|
22
27
|
end
|
23
28
|
|
24
29
|
app.get '/v1/last_updated' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf_light_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Springer Platform Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cfoundry
|