Class: Pvectl::Commands::EditNode

Inherits:
Object
  • Object
show all
Includes:
EditResourceCommand
Defined in:
lib/pvectl/commands/edit_node.rb,
sig/pvectl/commands/edit_node.rbs

Overview

Handler for the pvectl edit node command.

Includes EditResourceCommand for shared workflow and overrides template methods with node-specific behavior.

Examples:

Basic usage

pvectl edit node pve1

Dry-run mode

pvectl edit node pve1 --dry-run

Instance Method Summary collapse

Methods included from EditResourceCommand

#build_editor_session, #display_diff, #execute, included, #initialize, #load_config, #service_options, #usage_error

Instance Method Details

#build_edit_service(connection) ⇒ Services::EditNode

Builds the node edit service.



44
45
46
47
48
49
50
51
# File 'lib/pvectl/commands/edit_node.rb', line 44

def build_edit_service(connection)
  node_repo = Pvectl::Repositories::Node.new(connection)
  Pvectl::Services::EditNode.new(
    node_repository: node_repo,
    editor_session: build_editor_session,
    options: service_options
  )
end

#execute_params(resource_id) ⇒ Hash

Builds execution parameters from a node name. Node uses string name (not integer ID).



36
37
38
# File 'lib/pvectl/commands/edit_node.rb', line 36

def execute_params(resource_id)
  { node_name: resource_id }
end

#resource_id_labelString



27
28
29
# File 'lib/pvectl/commands/edit_node.rb', line 27

def resource_id_label
  "NODE"
end

#resource_labelString



22
23
24
# File 'lib/pvectl/commands/edit_node.rb', line 22

def resource_label
  "node"
end