class OpenNebula::Vdc
Constants
- ALL_RESOURCES
-
Constants and Class Methods
- VDC_METHODS
Public Class Methods
Source
# File lib/opennebula/vdc.rb, line 54 def Vdc.build_xml(pe_id=nil) if pe_id vdc_xml = "<VDC><ID>#{pe_id}</ID></VDC>" else vdc_xml = "<VDC></VDC>" end XMLElement.build_xml(vdc_xml,'VDC') end
Creates a Vdc
description with just its identifier this method should be used to create plain Vdc
objects. @param id [Integer] the id of the Vdc
Example:
vdc = Vdc.new(Vdc.build_xml(3),rpc_client)
Source
# File lib/opennebula/vdc.rb, line 65 def initialize(xml, client) super(xml,client) end
Class constructor
OpenNebula::PoolElement::new
Public Instance Methods
Source
# File lib/opennebula/vdc.rb, line 144 def add_cluster(zone_id, cluster_id) return call(VDC_METHODS[:add_cluster], @pe_id, zone_id.to_i, cluster_id.to_i) end
Adds a cluster to this VDC @param zone_id [Integer] Zone
ID @param cluster_id [Integer] Cluster
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 202 def add_datastore(zone_id, datastore_id) return call(VDC_METHODS[:add_datastore], @pe_id, zone_id.to_i, datastore_id.to_i) end
Adds a datastore to this VDC @param zone_id [Integer] Zone
ID @param datastore_id [Integer] Datastore
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 125 def add_group(group_id) return call(VDC_METHODS[:add_group], @pe_id, group_id.to_i) end
Adds a group to this VDC @param group_id [Integer] Group
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 164 def add_host(zone_id, host_id) return call(VDC_METHODS[:add_host], @pe_id, zone_id.to_i, host_id.to_i) end
Adds a host to this VDC @param zone_id [Integer] Zone
ID @param host_id [Integer] Host
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 222 def add_vnet(zone_id, vnet_id) return call(VDC_METHODS[:add_vnet], @pe_id, zone_id.to_i, vnet_id.to_i) end
Adds a vnet to this VDC @param zone_id [Integer] Zone
ID @param vnet_id [Integer] Vnet ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 87 def allocate(description) super(VDC_METHODS[:allocate], description) end
Allocates a new Vdc
in OpenNebula
@param description [String] The template of the Vdc
. @return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#allocate
Source
# File lib/opennebula/vdc.rb, line 154 def del_cluster(zone_id, cluster_id) return call(VDC_METHODS[:del_cluster], @pe_id, zone_id.to_i, cluster_id.to_i) end
Deletes a cluster from this VDC @param zone_id [Integer] Zone
ID @param cluster_id [Integer] Cluster
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 212 def del_datastore(zone_id, datastore_id) return call(VDC_METHODS[:del_datastore], @pe_id, zone_id.to_i, datastore_id.to_i) end
Deletes a datastore from this VDC @param zone_id [Integer] Zone
ID @param datastore_id [Integer] Datastore
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 134 def del_group(group_id) return call(VDC_METHODS[:del_group], @pe_id, group_id.to_i) end
Deletes a group from this VDC @param group_id [Integer] Group
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 186 def del_host(zone_id, host_id) return call(VDC_METHODS[:del_host], @pe_id, zone_id.to_i, host_id.to_i) end
Deletes a host from this VDC @param zone_id [Integer] Zone
ID @param host_id [Integer] Host
ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 232 def del_vnet(zone_id, vnet_id) return call(VDC_METHODS[:del_vnet], @pe_id, zone_id.to_i, vnet_id.to_i) end
Deletes a vnet from this VDC @param zone_id [Integer] Zone
ID @param vnet_id [Integer] Vnet ID
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 106 def delete() super(VDC_METHODS[:delete]) end
Deletes the Vdc
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#delete
Source
# File lib/opennebula/vdc.rb, line 76 def info() super(VDC_METHODS[:info], 'VDC') end
Retrieves the information of the given Vdc
. @return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#info
Source
# File lib/opennebula/vdc.rb, line 116 def rename(name) return call(VDC_METHODS[:rename], @pe_id, name) end
Renames this Vdc
@param name [String] New name for the Vdc
.
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
Source
# File lib/opennebula/vdc.rb, line 99 def update(new_template=nil, append=false) super(VDC_METHODS[:update], new_template, append ? 1 : 0) end
Replaces the template contents
@param new_template [String] New template contents @param append [true, false] True to append new attributes instead of
replace the whole template
@return [nil, OpenNebula::Error
] nil in case of success, Error
otherwise
OpenNebula::PoolElement#update