Class: Chef::Knife::ProxmoxTemplateAvailable
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::ProxmoxTemplateAvailable
- Includes:
- ProxmoxBase
- Defined in:
- lib/chef/knife/proxmox_template_available.rb
Instance Method Summary collapse
Methods included from ProxmoxBase
#action_response, #check_config_parameter, #check_global_parameter, #connection, #destroy_item, included, #locate_config_value, #new_vmid, #server_create, #server_destroy, #server_get_data, #server_modify, #server_name_to_vmid, #server_start, #server_stop, #server_umount, #template_number_to_name, #vmid_to_node, #waitfor
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/chef/knife/proxmox_template_available.rb', line 11 def run # Needed connection template_list = [ ui.color('Name', :bold), ui.color('Operating System', :bold) ] @connection["nodes/#{Chef::Config[:knife][:pve_node_name]}/aplinfo"].get @auth_params do |response, request, result, &block| JSON.parse(response.body)['data'].each { |entry| template_list << entry['template'].strip template_list << entry['os'].strip } end puts ui.list(template_list, :uneven_columns_across, 2) end |