Module: Role

Defined in:
lib/opennebula/oneflow_client.rb

Constant Summary collapse

SCHEDULE_ACTIONS =

Actions that can be performed on the VMs of a given Role

[
    'terminate',
    'terminate-hard',
    'undeploy',
    'undeploy-hard',
    'hold',
    'release',
    'stop',
    'suspend',
    'resume',
    'reboot',
    'reboot-hard',
    'poweroff',
    'poweroff-hard',
    'snapshot-create'
]
STATE =
{
    'PENDING'            => 0,
    'DEPLOYING'          => 1,
    'RUNNING'            => 2,
    'UNDEPLOYING'        => 3,
    'WARNING'            => 4,
    'DONE'               => 5,
    'FAILED_UNDEPLOYING' => 6,
    'FAILED_DEPLOYING'   => 7,
    'SCALING'            => 8,
    'FAILED_SCALING'     => 9,
    'COOLDOWN'           => 10
}
STATE_STR =
[
    'PENDING',
    'DEPLOYING',
    'RUNNING',
    'UNDEPLOYING',
    'WARNING',
    'DONE',
    'FAILED_UNDEPLOYING',
    'FAILED_DEPLOYING',
    'SCALING',
    'FAILED_SCALING',
    'COOLDOWN'
]

Class Method Summary collapse

Class Method Details

.state_str(state_number) ⇒ Object

Returns the string representation of the role state

Parameters:

  • state (String)

    String number representing the state

Returns:

  • the state string



72
73
74
# File 'lib/opennebula/oneflow_client.rb', line 72

def self.state_str(state_number)
    return STATE_STR[state_number.to_i]
end