Module: ForemanHyperv::ComputeResourcesVmsHelper
- Defined in:
- app/helpers/foreman_hyperv/compute_resources_vms_helper.rb
Instance Method Summary collapse
- #hyperv_generations ⇒ Object
- #hyperv_networks(compute_resource) ⇒ Object
- #hyperv_private_vlan_modes ⇒ Object
- #hyperv_vlan_modes ⇒ Object
Instance Method Details
#hyperv_generations ⇒ Object
11 12 13 |
# File 'app/helpers/foreman_hyperv/compute_resources_vms_helper.rb', line 11 def hyperv_generations Fog::Hyperv::Compute::Server::VM_GENERATION_VALUES.map { |gen, num| [gen, "Generation #{num} (#{gen})"] } end |
#hyperv_networks(compute_resource) ⇒ Object
5 6 7 8 9 |
# File 'app/helpers/foreman_hyperv/compute_resources_vms_helper.rb', line 5 def hyperv_networks(compute_resource) compute_resource.switches(nil).map do |sw| [sw.id, "#{sw.name}#{" (#{sw.switch_type})" if sw.switch_type}"] end end |
#hyperv_private_vlan_modes ⇒ Object
19 20 21 |
# File 'app/helpers/foreman_hyperv/compute_resources_vms_helper.rb', line 19 def hyperv_private_vlan_modes Fog::Hyperv::Compute::NetworkAdapterVlan::PRIVATE_VLAN_MODE.reject { |mode| mode == :Unknown }.map { |mode| [mode, mode] } end |
#hyperv_vlan_modes ⇒ Object
15 16 17 |
# File 'app/helpers/foreman_hyperv/compute_resources_vms_helper.rb', line 15 def hyperv_vlan_modes Fog::Hyperv::Compute::NetworkAdapterVlan::VLAN_OPERATION_MODE.map { |mode| [mode, mode] } end |