class OpenNebula::VMGroup
Constants
- VMGROUP_METHODS
-
Constants and Class Methods
Public Class Methods
Source
# File lib/opennebula/vm_group.rb, line 43 def VMGroup.build_xml(pe_id=nil) if pe_id obj_xml = "<VM_GROUP><ID>#{pe_id}</ID></VM_GROUP>" else obj_xml = "<VM_GROUP></VM_GROUP>" end XMLElement.build_xml(obj_xml,'VM_GROUP') end
Creates a VMGroup
description with just its identifier this method should be used to create plain VMGroup
objects. @param pe_id [Integer] the id of the object
Source
# File lib/opennebula/vm_group.rb, line 54 def initialize(xml, client) LockableExt.make_lockable(self, VMGROUP_METHODS) super(xml,client) @client = client end
Class constructor
OpenNebula::PoolElement::new
Public Instance Methods
Source
# File lib/opennebula/vm_group.rb, line 79 def allocate(description) super(VMGROUP_METHODS[:allocate], description) end
Allocates a new VMGroup
in OpenNebula
@param description [String] The contents of the VMGroup
.
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#allocate
Source
# File lib/opennebula/vm_group.rb, line 124 def chmod(owner_u, owner_m, owner_a, group_u, group_m, group_a, other_u, other_m, other_a) super(VMGROUP_METHODS[:chmod], owner_u, owner_m, owner_a, group_u, group_m, group_a, other_u, other_m, other_a) end
Changes the SecurityGroup
permissions. Each [Integer] argument must be 1 to allow, 0 deny, -1 do not change
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#chmod
Source
# File lib/opennebula/vm_group.rb, line 115 def chmod_octet(octet) super(VMGROUP_METHODS[:chmod], octet) end
Changes the SecurityGroup
permissions.
@param octet [String] Permissions octed , e.g. 640 @return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#chmod_octet
Source
# File lib/opennebula/vm_group.rb, line 106 def chown(uid, gid) super(VMGROUP_METHODS[:chown], uid, gid) end
Changes the owner/group
@param uid [Integer] the new owner id. Set to -1 to leave the current one @param gid [Integer] the new group id. Set to -1 to leave the current one @return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#chown
Source
# File lib/opennebula/vm_group.rb, line 84 def delete() super(VMGROUP_METHODS[:delete]) end
Deletes the SecurityGroup
OpenNebula::PoolElement#delete
Source
# File lib/opennebula/vm_group.rb, line 177 def gid self['GID'].to_i end
Returns the group identifier
- return
-
Integer the element’s group ID
Source
# File lib/opennebula/vm_group.rb, line 67 def info() super(VMGROUP_METHODS[:info], 'VM_GROUP') end
Retrieves the information of the VMGroup
.
OpenNebula::PoolElement#info
Source
# File lib/opennebula/vm_group.rb, line 136 def rename(name) return call(VMGROUP_METHODS[:rename], @pe_id, name) end
Renames this VMGroup
@param name [String] New name for the VMGroup
.
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vm_group.rb, line 146 def role_add(template) return call(VMGROUP_METHODS[:roleadd], @pe_id, template) end
Add role to VM Group
@param template [String] String template for the new role
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vm_group.rb, line 156 def role_delete(roleid) return call(VMGROUP_METHODS[:roledelete], @pe_id, roleid) end
Delete role from VM Group
@param roleid [Integer] ID of the role to remove
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vm_group.rb, line 186 def role_names self.retrieve_elements('ROLES/ROLE/NAME') end
- return
-
Array with the name of roles
Source
# File lib/opennebula/vm_group.rb, line 167 def role_update(roleid, template) return call(VMGROUP_METHODS[:roleupdate], @pe_id, roleid, template) end
Update VM Group
role
@param roleid [Integer] ID of the role to remove @param template [String] String template with updated values
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vm_group.rb, line 96 def update(new_vmgroup, append=false) super(VMGROUP_METHODS[:update], new_vmgroup, append ? 1 : 0) end
Replaces the vm group contents
@param new_vmgroup [String] New vmgroup contents @param append [true, false] True to append new attributes instead of
replace the whole securitygroup
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#update