Package org.opennebula.client.vntemplate
Class VirtualNetworkTemplate
- java.lang.Object
-
- org.opennebula.client.PoolElement
-
- org.opennebula.client.vntemplate.VirtualNetworkTemplate
-
public class VirtualNetworkTemplate extends PoolElement
This class represents an OpenNebula Virtual Network template. It also offers static XML-RPC call wrappers.
-
-
Field Summary
-
Fields inherited from class org.opennebula.client.PoolElement
client, id, xml, xpath
-
-
Constructor Summary
Constructors Modifier Constructor Description VirtualNetworkTemplate(int id, Client client)
Creates a new VNTemplate representation.protected
VirtualNetworkTemplate(org.w3c.dom.Node xmlElement, Client client)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OneResponse
allocate(Client client, java.lang.String description)
Allocates a new VNTemplate in OpenNebula.OneResponse
chgrp(int gid)
Changes the groupOneResponse
chmod(int octet)
Changes the permissionsOneResponse
chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
Changes the vntemplate permissionsOneResponse
chmod(java.lang.String octet)
Changes the permissionsstatic OneResponse
chmod(Client client, int id, int octet)
Changes the permissionsstatic OneResponse
chmod(Client client, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
Changes the vntemplate permissionsstatic OneResponse
chmod(Client client, int id, java.lang.String octet)
Changes the permissionsOneResponse
chown(int uid)
Changes the ownerOneResponse
chown(int uid, int gid)
Changes the owner/groupstatic OneResponse
chown(Client client, int id, int uid, int gid)
Changes the owner/groupOneResponse
clone(java.lang.String name)
Clones this vntemplate into a new onestatic OneResponse
clone(Client client, int id, java.lang.String name)
Clones this vntemplate into a new oneOneResponse
delete()
Deletes the vntemplate from OpenNebula.static OneResponse
delete(Client client, int id)
Deletes a VNTemplate from OpenNebula.OneResponse
info()
Retrieves the information of the VNTemplate.OneResponse
info(boolean extended)
Retrieves the information of the given VNTemplate.static OneResponse
info(Client client, int id)
Retrieves the information of the given VNTemplate.static OneResponse
info(Client client, int id, boolean decrypt)
Retrieves the information of the given VNTemplate.OneResponse
instantiate()
Creates a VM instance from a VNTemplateOneResponse
instantiate(java.lang.String name)
Creates a VM instance from a VNTemplateOneResponse
instantiate(java.lang.String name, java.lang.String template)
Creates a VNET instance from a VNTemplatestatic OneResponse
instantiate(Client client, int id, java.lang.String name, java.lang.String template)
Creates a VNET instance from a VNTemplateOneResponse
lock(int level)
Lock this VNtemplatestatic OneResponse
lock(Client client, int id, int level)
lock this VNtemplateOneResponse
publish()
Publishes the vntemplate.OneResponse
publish(boolean publish)
Publishes or unpublishes the vntemplate.static OneResponse
publish(Client client, int id, boolean publish)
Publishes or unpublishes a VNTemplate.OneResponse
rename(java.lang.String name)
Renames this VNTemplatestatic OneResponse
rename(Client client, int id, java.lang.String name)
Renames this VNTemplateOneResponse
unlock()
Unlock this VNtemplatestatic OneResponse
unlock(Client client, int id)
Unlock this vntemplateOneResponse
unpublish()
Unpublishes the vntemplate.OneResponse
update(java.lang.String new_template)
Replaces the vntemplate contents.OneResponse
update(java.lang.String new_template, boolean append)
Replaces the vntemplate contents.static OneResponse
update(Client client, int id, java.lang.String new_template, boolean append)
Replaces the VNTemplate contents.
-
-
-
Constructor Detail
-
VirtualNetworkTemplate
public VirtualNetworkTemplate(int id, Client client)
Creates a new VNTemplate representation.- Parameters:
id
- The VNtemplate id.client
- XML-RPC Client.
-
VirtualNetworkTemplate
protected VirtualNetworkTemplate(org.w3c.dom.Node xmlElement, Client client)
- See Also:
PoolElement
-
-
Method Detail
-
allocate
public static OneResponse allocate(Client client, java.lang.String description)
Allocates a new VNTemplate in OpenNebula.- Parameters:
client
- XML-RPC Client.description
- A string containing the template of the vntemplate.- Returns:
- If successful the message contains the associated id generated for this VNTemplate.
-
info
public static OneResponse info(Client client, int id)
Retrieves the information of the given VNTemplate.- Parameters:
client
- XML-RPC Client.id
- The VNtemplate id for the VNtemplate to retrieve the information from- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
info
public static OneResponse info(Client client, int id, boolean decrypt)
Retrieves the information of the given VNTemplate.- Parameters:
client
- XML-RPC Client.id
- The VNtemplate id for the VNtemplate to retrieve the information fromdecrypt
- If true decrypt sensitive attributes- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
delete
public static OneResponse delete(Client client, int id)
Deletes a VNTemplate from OpenNebula.- Parameters:
client
- XML-RPC Client.id
- The vntemplate id of the target vntemplate we want to delete.- Returns:
- A encapsulated response.
-
update
public static OneResponse update(Client client, int id, java.lang.String new_template, boolean append)
Replaces the VNTemplate contents.- Parameters:
client
- XML-RPC Client.id
- The vntemplate id of the target vntemplate we want to modify.new_template
- New vntemplate contents.append
- True to append new attributes instead of replace the whole vntemplate- Returns:
- If successful the message contains the vntemplate id.
-
publish
public static OneResponse publish(Client client, int id, boolean publish)
Publishes or unpublishes a VNTemplate.- Parameters:
client
- XML-RPC Client.id
- The vntemplate id of the target vntemplate we want to modify.publish
- True for publishing, false for unpublishing.- Returns:
- If successful the message contains the vntemplate id.
-
chown
public static OneResponse chown(Client client, int id, int uid, int gid)
Changes the owner/group- Parameters:
client
- XML-RPC Client.id
- The vntemplate id of the target vntemplate we want to modify.uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.- Returns:
- If an error occurs the error message contains the reason.
-
chmod
public static OneResponse chmod(Client client, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
Changes the vntemplate permissions- Parameters:
client
- XML-RPC Client.id
- The vntemplate id of the target vntemplate.owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not change- Returns:
- If an error occurs the error message contains the reason.
-
chmod
public static OneResponse chmod(Client client, int id, java.lang.String octet)
Changes the permissions- Parameters:
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640- Returns:
- If an error occurs the error message contains the reason.
-
chmod
public static OneResponse chmod(Client client, int id, int octet)
Changes the permissions- Parameters:
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640- Returns:
- If an error occurs the error message contains the reason.
-
instantiate
public static OneResponse instantiate(Client client, int id, java.lang.String name, java.lang.String template)
Creates a VNET instance from a VNTemplate- Parameters:
client
- XML-RPC Client.id
- The vntemplate id of the target vntemplate.name
- A string containing the name of the VM instance, can be empty.template
- User provided VNTemplate to merge with the one being instantiated- Returns:
- If successful the message contains the VM Instance ID.
-
clone
public static OneResponse clone(Client client, int id, java.lang.String name)
Clones this vntemplate into a new one- Parameters:
client
- XML-RPC Client.id
- The vntemplate id of the target vntemplate.name
- Name for the new vntemplate.- Returns:
- If successful the message contains the new vntemplate ID.
-
rename
public static OneResponse rename(Client client, int id, java.lang.String name)
Renames this VNTemplate- Parameters:
client
- XML-RPC Client.id
- The VNTemplate id of the target VNTemplate.name
- New name for the VNTemplate.- Returns:
- If an error occurs the error message contains the reason.
-
lock
public static OneResponse lock(Client client, int id, int level)
lock this VNtemplate- Parameters:
client
- XML-RPC Client.id
- The vntemplate id.level
- Lock level.- Returns:
- If an error occurs the error message contains the reason.
-
unlock
public static OneResponse unlock(Client client, int id)
Unlock this vntemplate- Parameters:
client
- XML-RPC Client.id
- The vntemplate id.- Returns:
- If an error occurs the error message contains the reason.
-
info
public OneResponse info()
Retrieves the information of the VNTemplate.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
info
public OneResponse info(boolean extended)
Retrieves the information of the given VNTemplate.- Parameters:
extended
- optional flag to process the vntemplate and include extended information, such as the SIZE for each DISK- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
delete
public OneResponse delete()
Deletes the vntemplate from OpenNebula.- Returns:
- A encapsulated response.
-
update
public OneResponse update(java.lang.String new_template)
Replaces the vntemplate contents.- Parameters:
new_template
- New VNtemplate contents.- Returns:
- If successful the message contains the vntemplate id.
-
update
public OneResponse update(java.lang.String new_template, boolean append)
Replaces the vntemplate contents.- Parameters:
new_template
- New vntemplate contents.append
- True to append new attributes instead of replace the whole vntemplate- Returns:
- If successful the message contains the vntemplate id.
-
publish
public OneResponse publish(boolean publish)
Publishes or unpublishes the vntemplate.- Parameters:
publish
- True for publishing, false for unpublishing.- Returns:
- If successful the message contains the vntemplate id.
-
publish
public OneResponse publish()
Publishes the vntemplate.- Returns:
- If successful the message contains the vntemplate id.
-
unpublish
public OneResponse unpublish()
Unpublishes the vntemplate.- Returns:
- If successful the message contains the vntemplate id.
-
chown
public OneResponse chown(int uid, int gid)
Changes the owner/group- Parameters:
uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.- Returns:
- If an error occurs the error message contains the reason.
-
chown
public OneResponse chown(int uid)
Changes the owner- Parameters:
uid
- The new owner user ID.- Returns:
- If an error occurs the error message contains the reason.
-
chgrp
public OneResponse chgrp(int gid)
Changes the group- Parameters:
gid
- The new group ID.- Returns:
- If an error occurs the error message contains the reason.
-
chmod
public OneResponse chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
Changes the vntemplate permissions- Parameters:
owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not change- Returns:
- If an error occurs the error message contains the reason.
-
chmod
public OneResponse chmod(java.lang.String octet)
Changes the permissions- Parameters:
octet
- Permissions octed , e.g. 640- Returns:
- If an error occurs the error message contains the reason.
-
chmod
public OneResponse chmod(int octet)
Changes the permissions- Parameters:
octet
- Permissions octed , e.g. 640- Returns:
- If an error occurs the error message contains the reason.
-
instantiate
public OneResponse instantiate(java.lang.String name, java.lang.String template)
Creates a VNET instance from a VNTemplate- Parameters:
name
- A string containing the name of the VM instance, can be empty.template
- User provided Template to merge with the one being instantiated- Returns:
- If successful the message contains the VM Instance ID.
-
instantiate
public OneResponse instantiate(java.lang.String name)
Creates a VM instance from a VNTemplate- Parameters:
name
- A string containing the name of the VM instance, can be empty.- Returns:
- If successful the message contains the VM Instance ID.
-
instantiate
public OneResponse instantiate()
Creates a VM instance from a VNTemplate- Returns:
- If successful the message contains the VM Instance ID.
-
clone
public OneResponse clone(java.lang.String name)
Clones this vntemplate into a new one- Parameters:
name
- Name for the new vntemplate.- Returns:
- If successful the message contains the new vntemplate ID.
-
rename
public OneResponse rename(java.lang.String name)
Renames this VNTemplate- Parameters:
name
- New name for the VNTemplate.- Returns:
- If an error occurs the error message contains the reason.
-
lock
public OneResponse lock(int level)
Lock this VNtemplate- Parameters:
level
- Lock level.- Returns:
- If an error occurs the error message contains the reason.
-
unlock
public OneResponse unlock()
Unlock this VNtemplate- Returns:
- If an error occurs the error message contains the reason.
-
-