add_interface(id, options = {})
click to toggle source
def add_interface(id, options = {})
raise ArgumentError, "instance id is a required parameter" unless id
true
end
add_to_affinity_group(id, options = {})
click to toggle source
def add_to_affinity_group(id, options = {})
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "affinity group id is a required parameter for add-to-affinity-group" unless options.key? :id
true
end
add_volume(id, options = {})
click to toggle source
def add_volume(id, options = {})
raise ArgumentError, "instance id is a required parameter" unless id
true
end
api_version()
click to toggle source
def api_version
"3.1"
end
attach_volume(id, options)
click to toggle source
def attach_volume(id, options)
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "volume id is a required parameter for attach-volume" unless options.key? :id
true
end
create_affinity_group(attrs)
click to toggle source
def create_affinity_group(attrs)
xml = read_xml('affinitygroup.xml')
OVIRT::AffinityGroup::new(self, Nokogiri::XML(xml).root)
end
create_vm(attrs)
click to toggle source
def create_vm(attrs)
xml = read_xml('vm.xml')
OVIRT::VM::new(self, Nokogiri::XML(xml).root)
end
datacenters(filters = {})
click to toggle source
def datacenters(filters = {})
xml = read_xml 'data_centers.xml'
Nokogiri::XML(xml).xpath('/data_centers/data_center').map do |dc|
ovirt_attrs OVIRT::DataCenter::new(self, dc)
end
end
destroy_affinity_group(id)
click to toggle source
def destroy_affinity_group(id)
raise ArgumentError, "instance id is a required parameter" unless id
true
end
destroy_interface(id, options)
click to toggle source
def destroy_interface(id, options)
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "interface id is a required parameter for destroy-interface" unless options.key? :id
true
end
destroy_vm(options = {})
click to toggle source
def destroy_vm(options = {})
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
true
end
destroy_volume(id, options)
click to toggle source
def destroy_volume(id, options)
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "volume id is a required parameter for destroy-volume" unless options.key? :id
true
end
detach_volume(id, options)
click to toggle source
def detach_volume(id, options)
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "volume id is a required parameter for detach-volume" unless options.key? :id
true
end
get_affinity_group(id)
click to toggle source
def get_affinity_group(id)
xml = read_xml('affinitygroup.xml')
ovirt_attrs OVIRT::AffinityGroup::new(self, Nokogiri::XML(xml).root)
end
get_cluster(id)
click to toggle source
def get_cluster(id)
xml = read_xml('cluster.xml')
ovirt_attrs OVIRT::Cluster::new(self, Nokogiri::XML(xml).root)
end
get_instance_type(id)
click to toggle source
def get_instance_type(id)
xml = read_xml 'instance_type.xml'
ovirt_attrs OVIRT::InstanceType::new(self, Nokogiri::XML(xml).root)
end
get_quota(id)
click to toggle source
def get_quota(id)
xml = read_xml('quota.xml')
ovirt_attrs OVIRT::Quota::new(self, Nokogiri::XML(xml).root)
end
get_template(id)
click to toggle source
def get_template(id)
xml = read_xml 'template.xml'
ovirt_attrs OVIRT::Template::new(self, Nokogiri::XML(xml).root)
end
get_virtual_machine(id)
click to toggle source
def get_virtual_machine(id)
xml = read_xml 'vm.xml'
ovirt_attrs OVIRT::VM::new(self, Nokogiri::XML(xml).root)
end
list_affinity_group_vms(id)
click to toggle source
def list_affinity_group_vms(id)
vms = []
Nokogiri::XML(read_xml('affinitygroup_vms.xml')).xpath('/vms/vm/@id').each do |id|
xml = Nokogiri::XML(read_xml('vms.xml')).xpath("/vms/vm[@id='%s']" % id.value).first
vms << ovirt_attrs(OVIRT::VM::new(self, xml))
end
vms
end
list_affinity_groups(filters = {})
click to toggle source
def list_affinity_groups(filters = {})
xml = read_xml('affinitygroups.xml')
Nokogiri::XML(xml).xpath('/affinity_groups/affinity_group').map do |ag|
ovirt_attrs OVIRT::AffinityGroup::new(self, ag)
end
end
list_clusters(filters = {})
click to toggle source
def list_clusters(filters = {})
xml = read_xml 'clusters.xml'
Nokogiri::XML(xml).xpath('/clusters/cluster').map do |cl|
ovirt_attrs OVIRT::Cluster::new(self, cl)
end
end
list_instance_types(filters = {})
click to toggle source
def list_instance_types(filters = {})
xml = read_xml 'instance_types.xml'
Nokogiri::XML(xml).xpath('/instance_types/instance_type').map do |t|
ovirt_attrs OVIRT::InstanceType::new(self, t)
end
end
list_networks(cluster_id)
click to toggle source
def list_networks(cluster_id)
[]
end
list_quotas(filters = {})
click to toggle source
def list_quotas(filters = {})
xml = read_xml 'quotas.xml'
Nokogiri::XML(xml).xpath('/quotas/quota').map do |q|
ovirt_attrs OVIRT::Quotas::new(self, q)
end
end
list_template_interfaces(vm_id)
click to toggle source
def list_template_interfaces(vm_id)
xml = read_xml 'nics.xml'
Nokogiri::XML(xml).xpath('/nics/nic').map do |nic|
ovirt_attrs OVIRT::Interface::new(self, nic)
end
end
list_template_volumes(template_id)
click to toggle source
def list_template_volumes(template_id)
xml = read_xml 'volumes.xml'
Nokogiri::XML(xml).xpath('/disks/disk').map do |vol|
ovirt_attrs OVIRT::Volume::new(self, vol)
end
end
list_templates(filters = {})
click to toggle source
def list_templates(filters = {})
xml = read_xml 'templates.xml'
Nokogiri::XML(xml).xpath('/templates/template').map do |t|
ovirt_attrs OVIRT::Template::new(self, t)
end
end
list_virtual_machines(filters = {})
click to toggle source
def list_virtual_machines(filters = {})
xml = read_xml 'vms.xml'
Nokogiri::XML(xml).xpath('/vms/vm').map do |vm|
ovirt_attrs OVIRT::VM::new(self, vm)
end
end
list_vm_interfaces(vm_id)
click to toggle source
def list_vm_interfaces(vm_id)
xml = read_xml 'nics.xml'
Nokogiri::XML(xml).xpath('/nics/nic').map do |nic|
ovirt_attrs OVIRT::Interface::new(self, nic)
end
end
list_vm_volumes(vm_id)
click to toggle source
def list_vm_volumes(vm_id)
xml = read_xml 'volumes.xml'
Nokogiri::XML(xml).xpath('/disks/disk').map do |vol|
ovirt_attrs OVIRT::Volume::new(self, vol)
end
end
list_volumes()
click to toggle source
def list_volumes
xml = read_xml 'disks.xml'
Nokogiri::XML(xml).xpath('/disks/disk').map do |vol|
ovirt_attrs OVIRT::Volume::new(self, vol)
end
end
remove_from_affinity_group(id, options = {})
click to toggle source
def remove_from_affinity_group(id, options = {})
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "affinity group id is a required parameter for remove-from-affinity-group" unless options.key? :id
true
end
storage_domains(filters = {})
click to toggle source
def storage_domains(filters = {})
xml = read_xml 'storage_domains.xml'
Nokogiri::XML(xml).xpath('/storage_domains/storage_domain').map do |sd|
OVIRT::StorageDomain::new(self, sd)
end
end
update_interface(id, options)
click to toggle source
def update_interface(id, options)
check_arguments(id, options)
true
end
update_vm(attrs)
click to toggle source
def update_vm(attrs)
xml = read_xml('vm.xml')
OVIRT::VM::new(self, Nokogiri::XML(xml).root)
end
update_volume(id, options)
click to toggle source
def update_volume(id, options)
check_arguments(id, options)
true
end
vm_action(options = {})
click to toggle source
def vm_action(options = {})
raise ArgumentError, "id is a required parameter" unless options.key? :id
raise ArgumentError, "action is a required parameter" unless options.key? :action
true
end
vm_start_with_cloudinit(options = {})
click to toggle source
def vm_start_with_cloudinit(options = {})
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
true
end
vm_ticket(id, options = {})
click to toggle source
def vm_ticket(id, options = {})
"Secret"
end