55class InfoController < ApplicationController
66 def v3_info
77 info = Info . new
8- config = VCAP ::CloudController ::Config . config
9-
10- info . build = config . get ( :info , :build ) || ''
11- info . min_cli_version = config . get ( :info , :min_cli_version ) || ''
12- info . min_recommended_cli_version = config . get ( :info , :min_recommended_cli_version ) || ''
13- info . custom = config . get ( :info , :custom ) || { }
14- info . description = config . get ( :info , :description ) || ''
15- info . name = config . get ( :info , :name ) || ''
16- info . version = config . get ( :info , :version ) || 0
17- info . support_address = config . get ( :info , :support_address ) || ''
18- info . request_rate_limiter_enabled = config . get ( :rate_limiter , :enabled ) || false
19- info . request_rate_limiter_general_limit = config . get ( :rate_limiter , :per_process_general_limit ) || ''
20- info . request_rate_limiter_reset_interval_in_mins = config . get ( :rate_limiter , :reset_interval_in_minutes ) || ''
21-
8+ populate_info_fields ( info )
229 osbapi_version_file = Rails . root . join ( 'config/osbapi_version' ) . to_s
2310 if File . exist? ( osbapi_version_file )
2411 info . osbapi_version = File . read ( osbapi_version_file ) . strip
@@ -37,6 +24,25 @@ def show_usage_summary
3724
3825 render status : :ok , json : VCAP ::CloudController ::Presenters ::V3 ::InfoUsageSummaryPresenter . new ( summary )
3926 end
27+
28+ private
29+
30+ def populate_info_fields ( info )
31+ config = VCAP ::CloudController ::Config . config
32+
33+ info . build = config . get ( :info , :build ) || ''
34+ info . min_cli_version = config . get ( :info , :min_cli_version ) || ''
35+ info . min_recommended_cli_version = config . get ( :info , :min_recommended_cli_version ) || ''
36+ info . custom = config . get ( :info , :custom ) || { }
37+ info . description = config . get ( :info , :description ) || ''
38+ info . name = config . get ( :info , :name ) || ''
39+ info . version = config . get ( :info , :version ) || 0
40+ info . support_address = config . get ( :info , :support_address ) || ''
41+ info . request_rate_limiter_enabled = config . get ( :rate_limiter , :enabled ) || false
42+ info . request_rate_limiter_general_limit = config . get ( :rate_limiter , :per_process_general_limit ) || ''
43+ info . request_rate_limiter_reset_interval_in_mins = config . get ( :rate_limiter , :reset_interval_in_minutes ) || ''
44+ end
45+
4046end
4147
4248class Info
0 commit comments