Package org.opennebula.client.secgroup
Class SecurityGroup
- java.lang.Object
-
- org.opennebula.client.PoolElement
-
- org.opennebula.client.secgroup.SecurityGroup
-
public class SecurityGroup extends PoolElement
This class represents an OpenNebula security group. 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 SecurityGroup(int id, Client client)
Creates a new security group representation.protected
SecurityGroup(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 security group 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 security group 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 security group 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 security group into a new onestatic OneResponse
clone(Client client, int id, java.lang.String name)
Clones this security group into a new oneOneResponse
commit(boolean recover)
Commit security group changes to associated VMsstatic OneResponse
commit(Client client, int id, boolean recover)
Commit security group changes to associated VMsOneResponse
delete()
Deletes the security group from OpenNebula.static OneResponse
delete(Client client, int id)
Deletes a security group from OpenNebula.OneResponse
info()
Loads the xml representation of the security group.static OneResponse
info(Client client, int id)
Retrieves the information of the given security groupstatic OneResponse
info(Client client, int id, boolean decrypt)
Retrieves the information of the given Security Group.OneResponse
rename(java.lang.String name)
Renames this security groupstatic OneResponse
rename(Client client, int id, java.lang.String name)
Renames this security groupOneResponse
update(java.lang.String new_template)
Replaces the security group template contents.OneResponse
update(java.lang.String new_template, boolean append)
Replaces the security group template contents.static OneResponse
update(Client client, int id, java.lang.String new_template, boolean append)
Replaces the security group template contents.
-
-
-
Constructor Detail
-
SecurityGroup
public SecurityGroup(int id, Client client)
Creates a new security group representation.- Parameters:
id
- The security group id.client
- XML-RPC Client.
-
SecurityGroup
protected SecurityGroup(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 security group in OpenNebula.- Parameters:
client
- XML-RPC Client.description
- A string containing the template of the security group.- Returns:
- If successful the message contains the associated id generated for this security group.
-
info
public static OneResponse info(Client client, int id)
Retrieves the information of the given security group- Parameters:
client
- XML-RPC Client.id
- the id for the security group 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 Security Group.- Parameters:
client
- XML-RPC Client.id
- The Security Group id for the Security Group 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 security group from OpenNebula.- Parameters:
client
- XML-RPC Client.id
- The id of the target security group.- Returns:
- A encapsulated response.
-
chown
public static OneResponse chown(Client client, int id, int uid, int gid)
Changes the owner/group- Parameters:
client
- XML-RPC Client.id
- The id of the target security group.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 security group permissions- Parameters:
client
- XML-RPC Client.id
- The id of the target security group.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.
-
update
public static OneResponse update(Client client, int id, java.lang.String new_template, boolean append)
Replaces the security group template contents.- Parameters:
client
- XML-RPC Client.id
- The id of the target security group 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 security group id.
-
clone
public static OneResponse clone(Client client, int id, java.lang.String name)
Clones this security group into a new one- Parameters:
client
- XML-RPC Client.id
- The id of the target security group.name
- Name for the new template.- Returns:
- If successful the message contains the new security group ID.
-
rename
public static OneResponse rename(Client client, int id, java.lang.String name)
Renames this security group- Parameters:
client
- XML-RPC Client.id
- The id of the target security group.name
- New name for the security group.- Returns:
- If an error occurs the error message contains the reason.
-
commit
public static OneResponse commit(Client client, int id, boolean recover)
Commit security group changes to associated VMs- Parameters:
client
- XML-RPC Client.id
- The id of the target security group.recover
- If true will only operate on outdated and error VMs. This is intended for retrying updates of VMs or reinitialize the updating process if oned stopped or fail.- Returns:
- If an error occurs the error message contains the reason.
-
info
public OneResponse info()
Loads the xml representation of the security group. The info is also stored internally.- See Also:
info(Client, int)
-
delete
public OneResponse delete()
Deletes the security group from OpenNebula.- Returns:
- A encapsulated response.
-
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 security group 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.
-
update
public OneResponse update(java.lang.String new_template)
Replaces the security group template contents.- Parameters:
new_template
- New template contents.- Returns:
- If successful the message contains the security group id.
-
update
public OneResponse update(java.lang.String new_template, boolean append)
Replaces the security group 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 security group id.
-
clone
public OneResponse clone(java.lang.String name)
Clones this security group into a new one- Parameters:
name
- Name for the new security group.- Returns:
- If successful the message contains the new security group ID.
-
rename
public OneResponse rename(java.lang.String name)
Renames this security group- Parameters:
name
- New name for the security group.- Returns:
- If an error occurs the error message contains the reason.
-
commit
public OneResponse commit(boolean recover)
Commit security group changes to associated VMs- Parameters:
recover
- If true will only operate on outdated and error VMs. This is intended for retrying updates of VMs or reinitialize the updating process if oned stopped or fail.- Returns:
- If an error occurs the error message contains the reason.
-
-