Class: Pvectl::Commands::Reset

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

Overview

Handler for the pvectl reset command.

Resets one or more virtual machines (hard reset).

Examples:

Reset a single VM

pvectl reset vm 100

Reset with JSON output

pvectl reset vm 100 -o json

Constant Summary collapse

OPERATION =

Returns:

  • (Symbol)
:reset

Class Method Summary collapse

Methods included from VmLifecycleCommand

#build_presenter, #build_repository, #build_selector, #build_service, included, #resource_id_label, #resource_label, #supported_resources

Methods included from ResourceLifecycleCommand

#apply_selectors, #build_presenter, #build_repository, #build_selector, #build_service, #confirm_operation, #determine_exit_code, #execute, included, #initialize, #load_config, #no_resources_found, #operation_name, #output_results, #perform_operation, #resolve_resources, #resource_id_label, #resource_label, #selector_strings, #service_options, #supported_resources, #usage_error

Class Method Details

.register(cli) ⇒ void

This method returns an undefined value.

Registers the reset command with the CLI.

Parameters:

  • cli (GLI::App)

    the CLI application object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/pvectl/commands/reset.rb', line 22

def self.register(cli)
  cli.desc "Reset virtual machines (hard reset)"
  cli.long_desc "    Hard reset one or more virtual machines. Equivalent to pressing the\n    physical reset button \u2014 the VM is immediately restarted without\n    graceful OS shutdown.\n\n    Only available for VMs. Containers do not support hard reset.\n\n    EXAMPLES\n      Hard reset a VM:\n        $ pvectl reset vm 100\n\n      Reset multiple VMs:\n        $ pvectl reset vm 100 101 102\n\n    NOTES\n      May cause data loss or filesystem corruption. Use 'pvectl restart'\n      for a graceful reboot instead.\n\n      Not available for containers \u2014 use 'pvectl restart ct' instead.\n\n    SEE ALSO\n      pvectl help restart         Graceful reboot (VMs and containers)\n      pvectl help stop            Hard stop without restart\n  HELP\n  cli.arg_name \"RESOURCE_TYPE [ID...]\"\n  cli.command :reset do |c|\n    SharedFlags.lifecycle(c)\n\n    c.action do |global_options, options, args|\n      resource_type = args.shift\n      resource_ids = args\n      exit_code = execute(resource_type, resource_ids, options, global_options)\n      exit exit_code if exit_code != 0\n    end\n  end\nend\n"