Class: Katello::Api::V2::RootController
- Inherits:
-
ApiController
- Object
- Api::V2::BaseController
- ApiController
- Katello::Api::V2::RootController
show all
- Defined in:
- app/controllers/katello/api/v2/root_controller.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#check_katello_agent_not_disabled, #deprecate_katello_agent, #empty_search_query?, #full_result_response, #katello_agent_removal_release, #resource_class, #scoped_search, #skip_session
Methods included from Rendering
#respond_for_async, #respond_for_bulk_async, #respond_for_create, #respond_for_destroy, #respond_for_index, #respond_for_show, #respond_for_status, #respond_for_update, #respond_with_template, #respond_with_template_collection, #respond_with_template_resource, #try_specific_collection_template, #try_specific_resource_template
#api_version
Class Method Details
.generate_rhsm_resource_list ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'app/controllers/katello/api/v2/root_controller.rb', line 25
def self.generate_rhsm_resource_list
all_routes = Engine.routes.routes.collect { |r| r.path.spec.to_s }
api_routes = all_routes.select do |path|
path =~ %r{^/rhsm/.+$}
end
api_routes = api_routes.collect do |path|
path = path.sub("(.:format)", "")
path_elements = path.split("/")
if path_elements.last.start_with?(':') && path_elements.last.end_with?('id')
path_elements.delete_at(-1)
path_elements.join('/')
else
path
end
end
api_routes.uniq!
api_routes.collect! { |r| { :rel => r.split('/').last, :href => r } }
end
|
.rhsm_resource_list ⇒ Object
21
22
23
|
# File 'app/controllers/katello/api/v2/root_controller.rb', line 21
def self.rhsm_resource_list
@rhsm_resource_list ||= generate_rhsm_resource_list
end
|
Instance Method Details
#rhsm_resource_list ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'app/controllers/katello/api/v2/root_controller.rb', line 12
def rhsm_resource_list
render json: self.class.rhsm_resource_list
end
|