diff --git a/src/oca/ruby/OpenNebula/Cluster.rb b/src/oca/ruby/OpenNebula/Cluster.rb index 19a069b7f9..408e90afe8 100644 --- a/src/oca/ruby/OpenNebula/Cluster.rb +++ b/src/oca/ruby/OpenNebula/Cluster.rb @@ -42,18 +42,27 @@ module OpenNebula # --------------------------------------------------------------------- # XML-RPC Methods for the User Object # --------------------------------------------------------------------- + + # Retrieves the information of the given Cluster. def info() super(CLUSTER_METHODS[:info], 'CLUSTER') end + # Allocates a new Cluster in OpenNebula + # + # +clustername+ A string containing the name of the Cluster. def allocate(clustername) super(CLUSTER_METHODS[:allocate], clustername) end + # Deletes the Cluster def delete() super(CLUSTER_METHODS[:delete]) end + # Add a host to the cluster + # + # +host_id+ ID of the Host to be added to the Cluster def add_host(host_id) return Error.new('ID not defined') if !@pe_id @@ -63,6 +72,9 @@ module OpenNebula return rc end + # Remove a host from the cluster + # + # +host_id+ ID of the Host to be removed from the Cluster def remove_host(host_id) return Error.new('ID not defined') if !@pe_id diff --git a/src/oca/ruby/OpenNebula/ClusterPool.rb b/src/oca/ruby/OpenNebula/ClusterPool.rb index a1078c7875..561d84d0bc 100644 --- a/src/oca/ruby/OpenNebula/ClusterPool.rb +++ b/src/oca/ruby/OpenNebula/ClusterPool.rb @@ -27,7 +27,8 @@ module OpenNebula # --------------------------------------------------------------------- # XML-RPC Methods for the User Object # --------------------------------------------------------------------- - + + # Retrieves all the Clusters in the pool. def info() super(CLUSTER_POOL_METHODS[:info]) end diff --git a/src/oca/ruby/OpenNebula/Host.rb b/src/oca/ruby/OpenNebula/Host.rb index 50130d008a..1af58430db 100644 --- a/src/oca/ruby/OpenNebula/Host.rb +++ b/src/oca/ruby/OpenNebula/Host.rb @@ -52,22 +52,36 @@ module OpenNebula ####################################################################### # XML-RPC Methods for the Host ####################################################################### + + # Retrieves the information of the given Host. def info() super(HOST_METHODS[:info], 'HOST') end + # Allocates a new Host in OpenNebula + # + # +hostname+ A string containing the name of the new Host. + # + # +im+ A string containing the name of the im_driver + # + # +vmm+ A string containing the name of the vmm_driver + # + # +tm+ A string containing the name of the tm_driver def allocate(hostname,im,vmm,tm) super(HOST_METHODS[:allocate],hostname,im,vmm,tm) end + # Deletes the Host def delete() super(HOST_METHODS[:delete]) end + # Enables the Host def enable() set_enabled(true) end + # Disables the Host def disable() set_enabled(false) end diff --git a/src/oca/ruby/OpenNebula/HostPool.rb b/src/oca/ruby/OpenNebula/HostPool.rb index 2231b5b1f2..6e4d03da84 100644 --- a/src/oca/ruby/OpenNebula/HostPool.rb +++ b/src/oca/ruby/OpenNebula/HostPool.rb @@ -28,6 +28,7 @@ module OpenNebula # XML-RPC Methods for the Host Pool ####################################################################### + # Retrieves all the Hosts in the pool. def info() super(HOST_POOL_METHODS[:info]) end diff --git a/src/oca/ruby/OpenNebula/Image.rb b/src/oca/ruby/OpenNebula/Image.rb index 3942e8fbc8..74840da8ab 100644 --- a/src/oca/ruby/OpenNebula/Image.rb +++ b/src/oca/ruby/OpenNebula/Image.rb @@ -62,38 +62,55 @@ module OpenNebula # XML-RPC Methods for the Image Object ####################################################################### + # Retrieves the information of the given Image. def info() super(IMAGE_METHODS[:info], 'IMAGE') end + # Allocates a new Image in OpenNebula + # + # +description+ A string containing the template of the Image. def allocate(description) super(IMAGE_METHODS[:allocate],description) end + # Modifies an image attribute + # + # +name+ Name of the attribute to be changed + # + # +value+ New value for the attribute def update(name, value) super(IMAGE_METHODS[:update], name, value) end + # Deletes an Image attribute + # + # +name+ Name of the attribute to be deleted def remove_attr(name) do_rm_attr(name) end + # Enables an Image def enable set_enabled(true) end + # Disables an Image def disable set_enabled(false) end + # Publishes the Image, to be used by other users def publish set_publish(true) end + # Unplubishes the Image def unpublish set_publish(false) end + # Deletes the Image def delete() super(IMAGE_METHODS[:delete]) end diff --git a/src/oca/ruby/OpenNebula/ImagePool.rb b/src/oca/ruby/OpenNebula/ImagePool.rb index baa9127a62..58c962a701 100644 --- a/src/oca/ruby/OpenNebula/ImagePool.rb +++ b/src/oca/ruby/OpenNebula/ImagePool.rb @@ -31,6 +31,7 @@ module OpenNebula # XML-RPC Methods for the Image Object ####################################################################### + # Retrieves all or part of the Images in the pool. def info() super(IMAGE_POOL_METHODS[:info],@user_id) end diff --git a/src/oca/ruby/OpenNebula/User.rb b/src/oca/ruby/OpenNebula/User.rb index 17885ca16a..a444117498 100644 --- a/src/oca/ruby/OpenNebula/User.rb +++ b/src/oca/ruby/OpenNebula/User.rb @@ -41,18 +41,29 @@ module OpenNebula # --------------------------------------------------------------------- # XML-RPC Methods for the User Object # --------------------------------------------------------------------- + + # Retrieves the information of the given User. def info() super(USER_METHODS[:info], 'USER') end + # Allocates a new User in OpenNebula + # + # +username+ Name of the new user. + # + # +password+ Password for the new user def allocate(username, password) super(USER_METHODS[:allocate], username, password) end + # Deletes the User def delete() super(USER_METHODS[:delete]) end + # Changes the password of the given User + # + # +password+ String containing the new password def passwd(password) return Error.new('ID not defined') if !@pe_id diff --git a/src/oca/ruby/OpenNebula/UserPool.rb b/src/oca/ruby/OpenNebula/UserPool.rb index 1d84904c16..58bce9b618 100644 --- a/src/oca/ruby/OpenNebula/UserPool.rb +++ b/src/oca/ruby/OpenNebula/UserPool.rb @@ -28,6 +28,7 @@ module OpenNebula # XML-RPC Methods for the User Object # --------------------------------------------------------------------- + # Retrieves all the Users in the pool. def info() super(USER_POOL_METHODS[:info]) end diff --git a/src/oca/ruby/OpenNebula/VirtualMachine.rb b/src/oca/ruby/OpenNebula/VirtualMachine.rb index 1378cb50a7..e9dc245ff0 100644 --- a/src/oca/ruby/OpenNebula/VirtualMachine.rb +++ b/src/oca/ruby/OpenNebula/VirtualMachine.rb @@ -98,14 +98,22 @@ module OpenNebula # XML-RPC Methods for the Virtual Machine Object ####################################################################### + # Retrieves the information of the given VirtualMachine. def info() super(VM_METHODS[:info], 'VM') end - + + # Allocates a new VirtualMachine in OpenNebula + # + # +description+ A string containing the template of the VirtualMachine. def allocate(description) super(VM_METHODS[:allocate],description) end - + + # Initiates the instance of the VM on the target host. + # + # +host_id+ The host id (hid) of the target host where + # the VM will be instantiated. def deploy(host_id) return Error.new('ID not defined') if !@pe_id @@ -115,42 +123,52 @@ module OpenNebula return rc end + # Shutdowns an already deployed VM def shutdown action('shutdown') end + # Cancels a running VM def cancel action('cancel') end + # Sets a VM to hold state, scheduler will not deploy it def hold action('hold') end + # Releases a VM from hold state def release action('release') end + # Stops a running VM def stop action('stop') end + # Saves a running VM def suspend action('suspend') end + # Resumes the execution of a saved VM def resume action('resume') end + # Deletes a VM from the pool and DB def finalize action('finalize') end + # Resubmits the VM after failure def restart action('restart') end + # Saves a running VM and starts it again in the specified host def migrate(host_id) return Error.new('ID not defined') if !@pe_id @@ -160,6 +178,7 @@ module OpenNebula return rc end + # Migrates a running VM to another host without downtime def live_migrate(host_id) return Error.new('ID not defined') if !@pe_id @@ -169,6 +188,12 @@ module OpenNebula return rc end + # Set the specified vm's disk to be saved in a new image + # when the VirtualMachine shutdowns + # + # +disk_id+ ID of the disk to be saved + # + # +image_id+ ID of the new image where the disk will be saved def save_as(disk_id, image_id) return Error.new('ID not defined') if !@pe_id diff --git a/src/oca/ruby/OpenNebula/VirtualMachinePool.rb b/src/oca/ruby/OpenNebula/VirtualMachinePool.rb index 8649c17659..0649f258ab 100644 --- a/src/oca/ruby/OpenNebula/VirtualMachinePool.rb +++ b/src/oca/ruby/OpenNebula/VirtualMachinePool.rb @@ -30,7 +30,8 @@ module OpenNebula ####################################################################### # XML-RPC Methods for the Virtual Network Object ####################################################################### - + + # Retrieves all or part of the VirtualMachines in the pool. def info() super(VM_POOL_METHODS[:info],@user_id) end diff --git a/src/oca/ruby/OpenNebula/VirtualNetwork.rb b/src/oca/ruby/OpenNebula/VirtualNetwork.rb index 2f46d6a48a..4e10ebd7d6 100644 --- a/src/oca/ruby/OpenNebula/VirtualNetwork.rb +++ b/src/oca/ruby/OpenNebula/VirtualNetwork.rb @@ -40,22 +40,29 @@ module OpenNebula # XML-RPC Methods for the Virtual Network Object ####################################################################### + # Retrieves the information of the given VirtualNetwork. def info() super(VN_METHODS[:info], 'VNET') end + # Allocates a new VirtualNetwork in OpenNebula + # + # +description+ A string containing the template of the VirtualNetwork. def allocate(description) super(VN_METHODS[:allocate],description) end - + + # Publishes the VirtualNetwork, to be used by other users def publish set_publish(true) end + # Unplubishes the VirtualNetwork def unpublish set_publish(false) end + # Deletes the VirtualNetwork def delete() super(VN_METHODS[:delete]) end diff --git a/src/oca/ruby/OpenNebula/VirtualNetworkPool.rb b/src/oca/ruby/OpenNebula/VirtualNetworkPool.rb index 6ce370bd1d..1e66d33a6a 100644 --- a/src/oca/ruby/OpenNebula/VirtualNetworkPool.rb +++ b/src/oca/ruby/OpenNebula/VirtualNetworkPool.rb @@ -31,6 +31,7 @@ module OpenNebula # XML-RPC Methods for the Virtual Network Object ####################################################################### + # Retrieves all or part of the VirtualNetwork in the pool. def info() super(VN_POOL_METHODS[:info],@user_id) end