oca.virtualnetwork

class oca.VirtualNetwork(xml, client)

Bases: oca.pool.PoolElement

ELEMENT_NAME = 'VNET'
METHODS = {'info': 'vn.info', 'chown': 'vn.chown', 'allocate': 'vn.allocate', 'publish': 'vn.publish', 'delete': 'vn.delete'}
XML_TYPES = {'bridge': <type 'str'>, 'uname': <type 'str'>, 'gid': <type 'int'>, 'used_leases': <type 'int'>, 'uid': <type 'int'>, 'template': ['TEMPLATE', <class 'oca.pool.Template'>], 'gname': <type 'str'>, 'address_ranges': ['AR_POOL', <class 'oca.vn.AddressRangeList'>], 'id': <type 'int'>, 'name': <type 'str'>}
static allocate(client, template)

allocates a new virtual network in OpenNebula

Arguments

template
a string containing the template of the virtual network
chown(uid, gid)

Changes the owner/group

Arguments

uid New owner id. Set to -1 to leave current value gid New group id. Set to -1 to leave current value

delete()

Deletes current object from the pool

info(*args)
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 virtual network.

unpublish()

Unpublishes a virtual network.

class oca.VirtualNetworkPool(client)

Bases: oca.pool.Pool

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

Previous topic

oca.image

Next topic

oca.user

This Page