Class: AvstCloud::AzureRmServer

Inherits:
CloudServer show all
Defined in:
lib/avst-cloud/azure_rm_server.rb

Constant Summary

Constants inherited from CloudServer

CloudServer::UNIMPLEMENTED

Instance Attribute Summary

Attributes inherited from CloudServer

#access_password, #access_user, #ip_address, #server, #server_name

Instance Method Summary collapse

Methods inherited from CloudServer

#bootstrap, #initialize, #post_provisioning_commands, #provision, #run_tasks, #status, #wait_for_state

Methods included from Logging

included, logger, #logger, logger=, mask_message, show_passwords=

Constructor Details

This class inherits a constructor from AvstCloud::CloudServer

Instance Method Details

#destroyObject



42
43
44
45
46
47
48
49
50
# File 'lib/avst-cloud/azure_rm_server.rb', line 42

def destroy
    if @server
        logger.debug "Killing #{@server_name}"
        @server.destroy
        logger.debug "Server #{@server_name} destroyed...".green
    else
        raise "Server #{@server_name} does not exist!".red
    end
end

#startObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/avst-cloud/azure_rm_server.rb', line 31

def start
    if @server
        logger.debug "Starting #{@server_name}"
        @server.start
        logger.debug "[DONE]\n\n"
        logger.debug "Server #{@server_name} started...".green
    else
        raise "Server #{@server_name} does not exist!".red
    end
end

#stopObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/avst-cloud/azure_rm_server.rb', line 20

def stop
    if @server
        logger.debug "Stopping #{@server_name}"
        @server.power_off
        logger.debug "[DONE]\n\n"
        logger.debug "Server #{@server_name} stopped...".green
    else
        raise "Server #{@server_name} does not exist!".red
    end
end