oca.template

class oca.VmTemplate(xml, client)

Bases: oca.pool.PoolElement

ELEMENT_NAME = 'VMTEMPLATE'
METHODS = {'info': 'template.info', 'instantiate': 'template.instantiate', 'update': 'template.update', 'publish': 'template.publish', 'chown': 'template.chown', 'allocate': 'template.allocate', 'delete': 'template.delete'}
XML_TYPES = {'uname': <type 'str'>, 'gid': <type 'int'>, 'uid': <type 'int'>, 'template': ['TEMPLATE', <class 'oca.pool.Template'>], 'gname': <type 'str'>, 'id': <type 'int'>, 'regtime': <type 'int'>, 'name': <type 'str'>}
static allocate(client, template)

Allocates a new template in OpenNebula

client
oca.Client object
group
a string containing the group name
chown(uid=-1, gid=-1)

Changes the ownership of a template.

uid
The User ID of the new owner. If set to -1, the owner is not changed.
gid
The Group ID of the new group. If set to -1, the group is not changed.
delete()

Deletes current object from the pool

info(*args)
instantiate(name='')

Creates a VM instance from a VmTemplate

name
name of the VM instance
classmethod new_with_id(client, element_id)

Retrives object which id equals `id`.

Arguments

`client`
oca.Client object.
`element_id
object id.
publish()

Publishes a template.

unpublish()

Unpublishes a template.

update(template)

Replaces the template contents.

template
The new template contents.
class oca.VmTemplatePool(client)

Bases: oca.pool.Pool

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

Previous topic

oca.group

Next topic

oca.virtualmachine

This Page