Class: ForemanResourceQuota::Api::V2::ResourceQuotasController
- Inherits:
-
Api::V2::BaseController
- Object
- Api::V2::BaseController
- ForemanResourceQuota::Api::V2::ResourceQuotasController
- Includes:
- Api::Version2, Foreman::Controller::Parameters::ResourceQuota
- Defined in:
- app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #hosts ⇒ Object
- #index ⇒ Object
- #missing_hosts ⇒ Object
- #resource_class ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
- #usergroups ⇒ Object
- #users ⇒ Object
- #utilization ⇒ Object
Methods included from Foreman::Controller::Parameters::ResourceQuota
Instance Method Details
#create ⇒ Object
72 73 74 75 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 72 def create @resource_quota = ForemanResourceQuota::ResourceQuota.new(resource_quota_params) process_response @resource_quota.save end |
#destroy ⇒ Object
86 87 88 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 86 def destroy process_response @resource_quota.destroy end |
#hosts ⇒ Object
48 49 50 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 48 def hosts process_response @resource_quota.hosts end |
#index ⇒ Object
22 23 24 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 22 def index @resource_quotas = resource_scope_for_index end |
#missing_hosts ⇒ Object
41 42 43 44 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 41 def missing_hosts @resource_quota.determine_utilization process_response @resource_quota end |
#resource_class ⇒ Object
90 91 92 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 90 def resource_class ForemanResourceQuota::ResourceQuota end |
#show ⇒ Object
28 29 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 28 def show end |
#update ⇒ Object
80 81 82 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 80 def update process_response @resource_quota.update(resource_quota_params) end |
#usergroups ⇒ Object
60 61 62 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 60 def usergroups process_response @resource_quota.usergroups end |
#users ⇒ Object
54 55 56 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 54 def users process_response @resource_quota.users end |
#utilization ⇒ Object
33 34 35 36 |
# File 'app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb', line 33 def utilization @resource_quota.determine_utilization process_response @resource_quota end |