Module: Pvectl::Commands::TemplateCommand

Includes:
IrreversibleCommand
Included in:
TemplateContainer, TemplateVm
Defined in:
lib/pvectl/commands/template_command.rb

Overview

Template-specific functionality built on IrreversibleCommand.

Converts VMs/containers to Proxmox templates (irreversible operation). Filters out resources that are already templates with a warning. Calls the repository’s convert_to_template method for each resource.

Examples:

Including in a command class

class TemplateVm
  include TemplateCommand
  RESOURCE_TYPE = :vm
  SUPPORTED_RESOURCES = %w[vm].freeze
end

Class Method Summary collapse

Methods included from IrreversibleCommand

#execute, #initialize

Class Method Details

.included(base) ⇒ Object

Hook called when module is included.

Parameters:

  • base (Class)

    the class including this module



24
25
26
# File 'lib/pvectl/commands/template_command.rb', line 24

def self.included(base)
  base.extend(IrreversibleCommand::ClassMethods)
end