Package org.opennebula.client.vrouter
Class VirtualRouter
java.lang.Object
org.opennebula.client.PoolElement
org.opennebula.client.vrouter.VirtualRouter
This class represents an OpenNebula Virtual Router
It also offers static XML-RPC call wrappers.
-
Field Summary
Fields inherited from class org.opennebula.client.PoolElement
client, id, xml, xpath
-
Constructor Summary
ConstructorsModifierConstructorDescriptionVirtualRouter
(int id, Client client) Creates a new VirtualRouter representation.protected
VirtualRouter
(Node xmlElement, Client client) -
Method Summary
Modifier and TypeMethodDescriptionstatic OneResponse
Allocates a new VirtualRouter 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 VirtualRouter 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 VirtualRouter permissionsstatic OneResponse
Changes the permissionschown
(int uid) Changes the ownerchown
(int uid, int gid) Changes the owner/groupstatic OneResponse
Changes the owner/groupdelete()
Deletes the VirtualRouter from OpenNebula.static OneResponse
Deletes a VirtualRouter from OpenNebula.info()
Retrieves the information of the VirtualRouter.static OneResponse
Retrieves the information of the given VirtualRouter.static OneResponse
Retrieves the information of the given VRouter.instantiate
(int nVMs, int templateId) Creates VM instances from a VM Template.instantiate
(int nVMs, int templateId, String name, boolean onHold, String template) Creates VM instances from a VM Template.static OneResponse
instantiate
(Client client, int id, int nVMs, int templateId, String name, boolean onHold, String template) Creates VM instances from a VM Template.lock
(int level) Lock this virtual routerstatic OneResponse
lock this virtual routerAttaches a NIC to this VirtualRouter, and each one of its VMsstatic OneResponse
Attaches a NIC to this VirtualRouter, and each one of its VMsnicDetach
(int nicId) Detaches a NIC from this VirtualRouter, and each one of its VMsstatic OneResponse
Detaches a NIC from this VirtualRouter, and each one of its VMspublish()
Publishes the VirtualRouter.publish
(boolean publish) Publishes or unpublishes the VirtualRouter.static OneResponse
Publishes or unpublishes a VirtualRouter.Renames this VirtualRouterstatic OneResponse
Renames this VirtualRouterunlock()
Unlock this virtual routerstatic OneResponse
Unlock this virtual routerUnpublishes the VirtualRouter.Replaces the VirtualRouter contents.Replaces the template contents.static OneResponse
Replaces the template contents.
-
Constructor Details
-
VirtualRouter
Creates a new VirtualRouter representation.- Parameters:
id
- The VirtualRouter id.client
- XML-RPC Client.
-
VirtualRouter
- See Also:
-
-
Method Details
-
allocate
Allocates a new VirtualRouter in OpenNebula.- Parameters:
client
- XML-RPC Client.description
- A string containing the template of the VirtualRouter.- Returns:
- If successful the message contains the associated id generated for this VirtualRouter.
-
info
Retrieves the information of the given VirtualRouter.- Parameters:
client
- XML-RPC Client.id
- The VirtualRouter id for the VirtualRouter 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 VRouter.- Parameters:
client
- XML-RPC Client.id
- The VRouter id for the VRouter to retrieve the information fromdecrypt
- If true decrypt sensitive attributes- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
instantiate
public static OneResponse instantiate(Client client, int id, int nVMs, int templateId, String name, boolean onHold, String template) Creates VM instances from a VM Template. New VMs will be associated to this Virtual Router, and its Virtual Networks- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter.nVMs
- Number of VMs to instantiatetemplateId
- VM Template id to instantiatename
- Name for the VM instances. If it is an empty string OpenNebula will set a default name. Wildcard %i can be used.onHold
- False to create this VM in pending state, true on holdtemplate
- User provided Template to merge with the one being instantiated- Returns:
- If an error occurs the error message contains the reason.
-
delete
Deletes a VirtualRouter from OpenNebula.- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter we want to delete.- Returns:
- A encapsulated response.
-
update
Replaces the template contents.- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter we want to modify.new_template
- New template contents.append
- True to append new attributes instead of replace the whole template- Returns:
- If successful the message contains the VirtualRouter id.
-
publish
Publishes or unpublishes a VirtualRouter.- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter we want to modify.publish
- True for publishing, false for unpublishing.- Returns:
- If successful the message contains the VirtualRouter id.
-
chown
Changes the owner/group- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter 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 VirtualRouter permissions- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter.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.
-
rename
Renames this VirtualRouter- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter.name
- New name for the VirtualRouter.- Returns:
- If an error occurs the error message contains the reason.
-
nicAttach
Attaches a NIC to this VirtualRouter, and each one of its VMs- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter.nicTemplate
- Template containing the new NIC definition- Returns:
- If an error occurs the error message contains the reason.
-
nicDetach
Detaches a NIC from this VirtualRouter, and each one of its VMs- Parameters:
client
- XML-RPC Client.id
- The id of the target VirtualRouter.nicId
- The NIC_ID of the NIC to detach- Returns:
- If an error occurs the error message contains the reason.
-
lock
lock this virtual router- Parameters:
client
- XML-RPC Client.id
- The virtual router id.level
- Lock level.- Returns:
- If an error occurs the error message contains the reason.
-
unlock
Unlock this virtual router- Parameters:
client
- XML-RPC Client.id
- The virtual router id.- Returns:
- If an error occurs the error message contains the reason.
-
info
Retrieves the information of the VirtualRouter.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
delete
Deletes the VirtualRouter from OpenNebula.- Returns:
- A encapsulated response.
-
update
Replaces the VirtualRouter contents.- Parameters:
new_template
- New template contents.- Returns:
- If successful the message contains the VirtualRouter id.
-
update
Replaces the template contents.- Parameters:
new_template
- New template contents.append
- True to append new attributes instead of replace the whole template- Returns:
- If successful the message contains the VirtualRouter id.
-
publish
Publishes or unpublishes the VirtualRouter.- Parameters:
publish
- True for publishing, false for unpublishing.- Returns:
- If successful the message contains the VirtualRouter id.
-
publish
Publishes the VirtualRouter.- Returns:
- If successful the message contains the VirtualRouter id.
-
unpublish
Unpublishes the VirtualRouter.- Returns:
- If successful the message contains the VirtualRouter 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 VirtualRouter 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
public OneResponse instantiate(int nVMs, int templateId, String name, boolean onHold, String template) Creates VM instances from a VM Template. New VMs will be associated to this Virtual Router, and its Virtual Networks- Parameters:
nVMs
- Number of VMs to instantiatetemplateId
- VM Template id to instantiatename
- Name for the VM instances. If it is an empty string OpenNebula will set a default name. Wildcard %i can be used.onHold
- False to create this VM in pending state, true on holdtemplate
- User provided Template to merge with the one being instantiated- Returns:
- If an error occurs the error message contains the reason.
-
instantiate
Creates VM instances from a VM Template. New VMs will be associated to this Virtual Router, and its Virtual Networks- Parameters:
nVMs
- Number of VMs to instantiatetemplateId
- VM Template id to instantiate- Returns:
- If an error occurs the error message contains the reason.
-
rename
Renames this VirtualRouter- Parameters:
name
- New name for the VirtualRouter.- Returns:
- If an error occurs the error message contains the reason.
-
nicAttach
Attaches a NIC to this VirtualRouter, and each one of its VMs- Parameters:
nicTemplate
- Template containing the new NIC definition- Returns:
- If an error occurs the error message contains the reason.
-
nicDetach
Detaches a NIC from this VirtualRouter, and each one of its VMs- Parameters:
nicId
- The NIC_ID of the NIC to detach- Returns:
- If an error occurs the error message contains the reason.
-
lock
Lock this virtual router- Parameters:
level
- Lock level.- Returns:
- If an error occurs the error message contains the reason.
-
unlock
Unlock this virtual router- Returns:
- If an error occurs the error message contains the reason.
-