Module: ForemanAzureRm::Concerns::ComputeResourcesControllerExtensions

Extended by:
Apipie::DSL::Concern
Includes:
Api::Version2, Foreman::Controller::Parameters::ComputeResource
Defined in:
app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb

Instance Method Summary collapse

Instance Method Details

#action_permissionObject



41
42
43
44
45
46
47
48
# File 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb', line 41

def action_permission
  case params[:action]
    when 'available_resource_groups', 'available_sizes', 'available_subnets', 'available_vnets'
      :view
    else
      super
  end
end

#available_resource_groupsObject



17
18
19
20
21
# File 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb', line 17

def available_resource_groups
  compute_resource = ComputeResource.find_by_id(params[:id])
  @available_resource_groups = compute_resource.available_resource_groups
  render :available_resource_groups, :layout => 'api/v2/layouts/index_layout'
end

#available_sizesObject



23
24
25
26
27
# File 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb', line 23

def available_sizes
  compute_resource = ComputeResource.find_by_id(params[:id])
  @available_sizes = compute_resource.vm_sizes(params[:region_id])
  render :available_sizes, :layout => 'api/v2/layouts/index_layout'
end

#available_subnetsObject



29
30
31
32
33
# File 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb', line 29

def available_subnets
  compute_resource = ComputeResource.find_by_id(params[:id])
  @available_subnets = compute_resource.available_subnets
  render :available_subnets, :layout => 'api/v2/layouts/index_layout'
end

#available_vnetsObject



35
36
37
38
39
# File 'app/controllers/foreman_azure_rm/concerns/compute_resources_controller_extensions.rb', line 35

def available_vnets
  compute_resource = ComputeResource.find_by_id(params[:id])
  @available_vnets = compute_resource.available_vnets
  render :available_vnets, :layout => 'api/v2/layouts/index_layout'
end