oca.host

class oca.Host(xml, client)

Bases: oca.pool.PoolElement

DISABLED = 4
ELEMENT_NAME = 'HOST'
ERROR = 3
HOST_STATES = ['INIT', 'MONITORING', 'MONITORED', 'ERROR', 'DISABLED']
INIT = 0
METHODS = {'info': 'host.info', 'update': 'host.update', 'enable': 'host.enable', 'allocate': 'host.allocate', 'delete': 'host.delete'}
MONITORED = 2
MONITORING = 1
SHORT_HOST_STATES = {'DISABLED': 'off', 'MONITORED': 'on', 'INIT': 'on', 'MONITORING': 'on', 'ERROR': 'err'}
XML_TYPES = {'host_share': ['HOST_SHARE', <class 'oca.host.HostShare'>], 'state': <type 'int'>, 'vm_ids': ['VMS', <function <lambda> at 0x7f855ed0db90>], 'name': <type 'str'>, 'template': ['TEMPLATE', <class 'oca.pool.Template'>], 'last_mon_time': <type 'int'>, 'id': <type 'int'>, 'vm_mad': <type 'str'>, 'im_mad': <type 'str'>}
static allocate(client, hostname, im, vmm, tm)

Adds a host to the host list

Arguments

hostname
Hostname machine to add
im
Information manager’
vmm
Virtual machine manager.
tm
Transfer manager
delete()

Deletes current object from the pool

disable()

Disable this host.

enable()

Enable this host

info(*args)
classmethod new_with_id(client, element_id)

Retrives object which id equals `id`.

Arguments

`client`
oca.Client object.
`element_id
object id.
short_state

Short string representation of host state. One of ‘on’, ‘off’, ‘err’

str_state

String representation of host state. One of ‘INIT’, ‘MONITORING’, ‘MONITORED’, ‘ERROR’, ‘DISABLED’

update(template, merge=False)

Update the template of this host. If merge is false (default), the existing template is replaced.

class oca.HostPool(client)

Bases: oca.pool.Pool

METHODS = {'info': 'hostpool.info'}

Previous topic

oca.Client

Next topic

oca.image

This Page