Class: Central::Cli::Nodes::Azure::RestartCommand
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- Central::Cli::Nodes::Azure::RestartCommand
- Includes:
- Common, StackOptions
- Defined in:
- lib/central/cli/nodes/azure/restart_command.rb
Instance Method Summary collapse
Methods included from StackOptions
Methods included from Common
#access_token=, #add_master, #api_url, #api_url=, #clear_current_stack, #client, #current_master, #current_master=, #current_master_index, #current_stack, #current_stack=, #ensure_custom_ssl_ca, #require_api_url, #require_current_stack, #require_token, #reset_client, #save_settings, #settings, #settings_filename
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/central/cli/nodes/azure/restart_command.rb', line 10 def execute require_api_url require_current_stack require 'central/machine/azure' client = ::Azure client.management_certificate = certificate client.subscription_id = subscription_id client.vm_management.initialize_external_logger(Central::Machine::Azure::Logger.new) # We don't want all the output ShellSpinner "Restarting Azure VM #{name.colorize(:cyan)} " do vm = client.vm_management.get_virtual_machine(name, "central-#{current_stack}-#{name}") if vm client.vm_management.restart_virtual_machine(name, "central-#{current_stack}-#{name}") else abort "\nCannot find Virtual Machine #{name.colorize(:cyan)} in Azure" end end end |