Package org.opennebula.client.secgroup
Class SecurityGroup
java.lang.Object
org.opennebula.client.PoolElement
org.opennebula.client.secgroup.SecurityGroup
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
ConstructorsModifierConstructorDescriptionSecurityGroup
(int id, Client client) Creates a new security group representation.protected
SecurityGroup
(Node xmlElement, Client client) -
Method Summary
Modifier and TypeMethodDescriptionstatic OneResponse
Allocates a new security group 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 security group 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 security group permissionsstatic OneResponse
Changes the permissionschown
(int uid) Changes the ownerchown
(int uid, int gid) Changes the owner/groupstatic OneResponse
Changes the owner/groupClones this security group into a new onestatic OneResponse
Clones this security group into a new onecommit
(boolean recover) Commit security group changes to associated VMsstatic OneResponse
Commit security group changes to associated VMsdelete()
Deletes the security group from OpenNebula.static OneResponse
Deletes a security group from OpenNebula.info()
Loads the xml representation of the security group.static OneResponse
Retrieves the information of the given security groupstatic OneResponse
Retrieves the information of the given Security Group.Renames this security groupstatic OneResponse
Renames this security groupReplaces the security group template contents.Replaces the security group template contents.static OneResponse
Replaces the security group template contents.
-
Constructor Details
-
SecurityGroup
Creates a new security group representation.- Parameters:
id
- The security group id.client
- XML-RPC Client.
-
SecurityGroup
- See Also:
-
-
Method Details
-
allocate
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
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
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
Deletes a security group from OpenNebula.- Parameters:
client
- XML-RPC Client.id
- The id of the target security group.- Returns:
- A encapsulated response.
-
chown
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
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.
-
update
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
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
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
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
Loads the xml representation of the security group. The info is also stored internally.- See Also:
-
delete
Deletes the security group from OpenNebula.- Returns:
- A encapsulated response.
-
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 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
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.
-
update
Replaces the security group template contents.- Parameters:
new_template
- New template contents.- Returns:
- If successful the message contains the security group id.
-
update
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
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
Renames this security group- Parameters:
name
- New name for the security group.- Returns:
- If an error occurs the error message contains the reason.
-
commit
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.
-