Class: Chef::Knife::ProxmoxVmList
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::ProxmoxVmList
- Includes:
- ProxmoxBase
- Defined in:
- lib/chef/knife/proxmox_vm_list.rb
Overview
‘knife proxmox vm list` — list the cluster’s qemu VMs (templates excluded).
Nested under Chef::Knife so the unqualified ‘include Knife::ProxmoxBase` resolves the mixin (Chef::Knife::ProxmoxBase) through lexical scope. The CamelCase class name maps to the command words: ProxmoxVmList -> “knife proxmox vm list”.
Constant Summary
Constants included from ProxmoxBase
Chef::Knife::ProxmoxBase::ENV_SECRET_GLOBAL, Chef::Knife::ProxmoxBase::ENV_SECRET_PREFIX
Instance Method Summary collapse
Methods included from ProxmoxBase
included, #msg_pair, #proxmox_api, #proxmox_client, #proxmox_cluster_config, #proxmox_token_secret_present?
Instance Method Details
#run ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/chef/knife/proxmox_vm_list.rb', line 27 def run unless name_args.empty? ui.error("knife proxmox vm list takes no arguments") show_usage exit 1 end rows = proxmox_api.list_resources(template: false) rows = filter_by_node(rows) ui.output(format_for_display(rows)) end |