Package org.opennebula.client.vntemplate
Class VirtualNetworkTemplate
java.lang.Object
org.opennebula.client.PoolElement
org.opennebula.client.vntemplate.VirtualNetworkTemplate
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
ConstructorsModifierConstructorDescriptionVirtualNetworkTemplate
(int id, Client client) Creates a new VNTemplate representation.protected
VirtualNetworkTemplate
(Node xmlElement, Client client) -
Method Summary
Modifier and TypeMethodDescriptionstatic OneResponse
Allocates a new VNTemplate in OpenNebula.chgrp
(int gid) Changes the groupchmod
(int octet) Changes the permissionschmod
(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 permissionsChanges the permissionsstatic OneResponse
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
Changes the permissionschown
(int uid) Changes the ownerchown
(int uid, int gid) Changes the owner/groupstatic OneResponse
Changes the owner/groupClones this vntemplate into a new onestatic OneResponse
Clones this vntemplate into a new onedelete()
Deletes the vntemplate from OpenNebula.static OneResponse
Deletes a VNTemplate from OpenNebula.info()
Retrieves the information of the VNTemplate.info
(boolean extended) Retrieves the information of the given VNTemplate.static OneResponse
Retrieves the information of the given VNTemplate.static OneResponse
Retrieves the information of the given VNTemplate.Creates a VM instance from a VNTemplateinstantiate
(String name) Creates a VM instance from a VNTemplateinstantiate
(String name, String template) Creates a VNET instance from a VNTemplatestatic OneResponse
instantiate
(Client client, int id, String name, String template) Creates a VNET instance from a VNTemplatelock
(int level) Lock this VNtemplatestatic OneResponse
lock this VNtemplatepublish()
Publishes the vntemplate.publish
(boolean publish) Publishes or unpublishes the vntemplate.static OneResponse
Publishes or unpublishes a VNTemplate.Renames this VNTemplatestatic OneResponse
Renames this VNTemplateunlock()
Unlock this VNtemplatestatic OneResponse
Unlock this vntemplateUnpublishes the vntemplate.Replaces the vntemplate contents.Replaces the vntemplate contents.static OneResponse
Replaces the VNTemplate contents.
-
Constructor Details
-
VirtualNetworkTemplate
Creates a new VNTemplate representation.- Parameters:
id
- The VNtemplate id.client
- XML-RPC Client.
-
VirtualNetworkTemplate
- See Also:
-
-
Method Details
-
allocate
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
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
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
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
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
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
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
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
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
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
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
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
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
Unlock this vntemplate- Parameters:
client
- XML-RPC Client.id
- The vntemplate id.- Returns:
- If an error occurs the error message contains the reason.
-
info
Retrieves the information of the VNTemplate.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
info
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
Deletes the vntemplate from OpenNebula.- Returns:
- A encapsulated response.
-
update
Replaces the vntemplate contents.- Parameters:
new_template
- New VNtemplate contents.- Returns:
- If successful the message contains the vntemplate id.
-
update
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
Publishes or unpublishes the vntemplate.- Parameters:
publish
- True for publishing, false for unpublishing.- Returns:
- If successful the message contains the vntemplate id.
-
publish
Publishes the vntemplate.- Returns:
- If successful the message contains the vntemplate id.
-
unpublish
Unpublishes the vntemplate.- Returns:
- If successful the message contains the vntemplate id.
-
chown
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
Changes the owner- Parameters:
uid
- The new owner user ID.- Returns:
- If an error occurs the error message contains the reason.
-
chgrp
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
Changes the permissions- Parameters:
octet
- Permissions octed , e.g. 640- Returns:
- If an error occurs the error message contains the reason.
-
chmod
Changes the permissions- Parameters:
octet
- Permissions octed , e.g. 640- Returns:
- If an error occurs the error message contains the reason.
-
instantiate
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
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
Creates a VM instance from a VNTemplate- Returns:
- If successful the message contains the VM Instance ID.
-
clone
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
Renames this VNTemplate- Parameters:
name
- New name for the VNTemplate.- Returns:
- If an error occurs the error message contains the reason.
-
lock
Lock this VNtemplate- Parameters:
level
- Lock level.- Returns:
- If an error occurs the error message contains the reason.
-
unlock
Unlock this VNtemplate- Returns:
- If an error occurs the error message contains the reason.
-