From 32cfb4100881bbcf1fa1726f7fea20ee6e617243 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Lopes Ribeiro Date: Tue, 10 Dec 2013 23:05:42 -0200 Subject: [PATCH] [xenserver] Updated models to have all attributes from version 6.2.0 --- lib/fog/xenserver/models/compute/console.rb | 4 +- .../xenserver/models/compute/guest_metrics.rb | 3 +- lib/fog/xenserver/models/compute/host.rb | 49 +++++++++-- lib/fog/xenserver/models/compute/host_cpu.rb | 3 +- .../xenserver/models/compute/host_metrics.rb | 2 +- lib/fog/xenserver/models/compute/network.rb | 13 +-- lib/fog/xenserver/models/compute/pbd.rb | 4 +- lib/fog/xenserver/models/compute/pif.rb | 27 ++++-- lib/fog/xenserver/models/compute/pool.rb | 19 ++++- lib/fog/xenserver/models/compute/server.rb | 83 +++++++++++++------ .../models/compute/storage_repository.rb | 5 +- lib/fog/xenserver/models/compute/vbd.rb | 5 +- .../xenserver/models/compute/vbd_metrics.rb | 2 +- lib/fog/xenserver/models/compute/vdi.rb | 5 +- lib/fog/xenserver/models/compute/vif.rb | 13 ++- lib/fog/xenserver/models/compute/vlan.rb | 3 +- 16 files changed, 179 insertions(+), 61 deletions(-) diff --git a/lib/fog/xenserver/models/compute/console.rb b/lib/fog/xenserver/models/compute/console.rb index ff5c60901..c6bd77ccd 100644 --- a/lib/fog/xenserver/models/compute/console.rb +++ b/lib/fog/xenserver/models/compute/console.rb @@ -5,10 +5,12 @@ module Fog class XenServer class Console < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=console + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=console identity :reference + attribute :location + attribute :other_config attribute :protocol attribute :uuid attribute :__vm, aliases: :VM diff --git a/lib/fog/xenserver/models/compute/guest_metrics.rb b/lib/fog/xenserver/models/compute/guest_metrics.rb index 26cfd940b..24b445d4b 100644 --- a/lib/fog/xenserver/models/compute/guest_metrics.rb +++ b/lib/fog/xenserver/models/compute/guest_metrics.rb @@ -6,11 +6,12 @@ module Fog class GuestMetrics < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VM_guest_metrics + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VM_guest_metrics identity :reference attribute :uuid + attribute :disk attribute :last_updated attribute :live attribute :memory diff --git a/lib/fog/xenserver/models/compute/host.rb b/lib/fog/xenserver/models/compute/host.rb index 1991146df..e1fd39c85 100644 --- a/lib/fog/xenserver/models/compute/host.rb +++ b/lib/fog/xenserver/models/compute/host.rb @@ -6,23 +6,56 @@ module Fog class Host < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=host + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=host identity :reference - attribute :name, :aliases => :name_label + attribute :name, :aliases => :name_label attribute :uuid attribute :address attribute :allowed_operations + attribute :api_version_major, :aliases => :API_version_major + attribute :api_version_minor, :aliases => :API_version_minor + attribute :api_version_vendor, :aliases => :API_version_vendor + attribute :api_version_vendor_implementation, :aliases => :API_version_vendor_implementation + attribute :bios_strings + attribute :blobs + attribute :capabilities + attribute :chipset_info + attribute :cpu_configuration + attribute :cpu_info + attribute :__crash_dump_sr, :aliases => :crash_dump_sr + attribute :__crashdumps, :aliases => :crashdumps + attribute :current_operations attribute :enabled + attribute :external_auth_configuration + attribute :external_auth_service_name + attribute :external_auth_type + attribute :guest_vcpus_params, :aliases => :guest_VCPUs_params + attribute :ha_network_peers + attribute :ha_statefiles attribute :hostname - attribute :__metrics, :aliases => :metrics - attribute :name_description + attribute :license_params + attribute :license_server + attribute :__local_cache_sr, :aliases => :local_cache_sr + attribute :logging + attribute :memory_overhead + attribute :__metrics, :aliases => :metrics + attribute :description, :aliases => :name_description attribute :other_config - attribute :__pbds, :aliases => :PBDs - attribute :__pifs, :aliases => :PIFs - attribute :__resident_vms, :aliases => :resident_VMs - attribute :__host_cpus, :aliases => :host_CPUs + attribute :patches + attribute :__pbds, :aliases => :PBDs + attribute :__pcis, :aliases => :PCIs + attribute :__pgpus, :aliases => :PGPUs + attribute :__pifs, :aliases => :PIFs + attribute :power_on_config + attribute :power_on_mode + attribute :__resident_vms, :aliases => :resident_VMs + attribute :sched_policy + attribute :supported_bootloaders + attribute :suspend_image_sr + attribute :tags + attribute :__host_cpus, :aliases => :host_CPUs attribute :edition attribute :software_version diff --git a/lib/fog/xenserver/models/compute/host_cpu.rb b/lib/fog/xenserver/models/compute/host_cpu.rb index 6c28c6358..f989eb921 100644 --- a/lib/fog/xenserver/models/compute/host_cpu.rb +++ b/lib/fog/xenserver/models/compute/host_cpu.rb @@ -7,7 +7,7 @@ module Fog # # A physical CPU # - # @see http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/api/?c=host_cpu + # @see http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=host_cpu # class HostCpu < Fog::Model @@ -15,6 +15,7 @@ module Fog attribute :uuid attribute :family + attribute :features attribute :flags attribute :__host, :aliases => :host attribute :model diff --git a/lib/fog/xenserver/models/compute/host_metrics.rb b/lib/fog/xenserver/models/compute/host_metrics.rb index d9276c952..54c245e33 100644 --- a/lib/fog/xenserver/models/compute/host_metrics.rb +++ b/lib/fog/xenserver/models/compute/host_metrics.rb @@ -6,7 +6,7 @@ module Fog class HostMetrics < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VM_host_metrics + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=host_metrics identity :reference diff --git a/lib/fog/xenserver/models/compute/network.rb b/lib/fog/xenserver/models/compute/network.rb index 452185f92..91b0f7c21 100644 --- a/lib/fog/xenserver/models/compute/network.rb +++ b/lib/fog/xenserver/models/compute/network.rb @@ -6,21 +6,22 @@ module Fog class Network < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=network + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=network identity :reference attribute :uuid - attribute :__vifs, :aliases => :VIFs + attribute :__vifs, :aliases => :VIFs attribute :tags - attribute :mtu, :aliases => :MTU + attribute :mtu, :aliases => :MTU attribute :bridge - attribute :description, :aliases => :name_description - attribute :name, :aliases => :name_label + attribute :description, :aliases => :name_description + attribute :name, :aliases => :name_label attribute :other_config - attribute :__pifs, :aliases => :PIFs + attribute :__pifs, :aliases => :PIFs attribute :allowed_operations attribute :current_operations + attribute :default_locking_mode attribute :blobs def refresh diff --git a/lib/fog/xenserver/models/compute/pbd.rb b/lib/fog/xenserver/models/compute/pbd.rb index 67be5bf05..e911ac196 100644 --- a/lib/fog/xenserver/models/compute/pbd.rb +++ b/lib/fog/xenserver/models/compute/pbd.rb @@ -6,7 +6,7 @@ module Fog class PBD < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=PBD + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PBD identity :reference @@ -14,6 +14,8 @@ module Fog attribute :__host, :aliases => :host attribute :__sr, :aliases => :SR attribute :currently_attached + attribute :device_config + attribute :other_config def sr service.storage_repositories.get __sr diff --git a/lib/fog/xenserver/models/compute/pif.rb b/lib/fog/xenserver/models/compute/pif.rb index dfebda149..07e5cfec2 100644 --- a/lib/fog/xenserver/models/compute/pif.rb +++ b/lib/fog/xenserver/models/compute/pif.rb @@ -6,30 +6,41 @@ module Fog class PIF < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=PIF + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PIF identity :reference attribute :uuid + attribute :__bond_master_of, :aliases => :bond_master_of + attribute :__bond_slave_of, :aliases => :bond_slave_of + attribute :disallow_unplug attribute :physical - attribute :mac, :aliases => :MAC + attribute :mac, :aliases => :MAC attribute :currently_attached attribute :device attribute :device_name attribute :metrics - attribute :dns, :aliases => :DNS + attribute :dns, :aliases => :DNS attribute :gateway - attribute :ip, :aliases => :IP + attribute :ip, :aliases => :IP attribute :ip_configuration_mode - attribute :mtu, :aliases => :MTU - attribute :__network, :aliases => :network + attribute :ipv6, :aliases => :IPv6 + attribute :ipv6_configuration_mode + attribute :ipv6_gateway + attribute :mtu, :aliases => :MTU + attribute :__network, :aliases => :network attribute :netmask attribute :status_code attribute :status_detail attribute :management - attribute :vlan, :aliases => :VLAN + attribute :primary_address_type + attribute :__tunnel_access_pif_of, :aliases => :tunnel_access_PIF_of + attribute :__tunnel_transport_pif_of, :aliases => :tunnel_transport_PIF_of + attribute :vlan, :aliases => :VLAN + attribute :vlan_master_of, :aliases => :VLAN_master_of + attribute :vlan_slave_of, :aliases => :VLAN_slave_of attribute :other_config - attribute :__host, :aliases => :host + attribute :__host, :aliases => :host def network service.networks.get __network diff --git a/lib/fog/xenserver/models/compute/pool.rb b/lib/fog/xenserver/models/compute/pool.rb index cdb230ffb..3c6e77783 100644 --- a/lib/fog/xenserver/models/compute/pool.rb +++ b/lib/fog/xenserver/models/compute/pool.rb @@ -6,20 +6,37 @@ module Fog class Pool < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=pool + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=pool identity :reference attribute :uuid + attribute :blobs + attribute :__crash_dump_sr, :aliases => :crash_dump_SR attribute :name, :aliases => :name_label attribute :description, :aliases => :name_description attribute :__default_sr, :aliases => :default_SR + attribute :gui_config + attribute :ha_allow_overcommit + attribute :ha_configuration attribute :__master, :aliases => :master attribute :tags attribute :restrictions attribute :ha_enabled + attribute :ha_host_failures_to_tolerate + attribute :ha_overcommitted + attribute :ha_plan_exists_for + attribute :ha_statefiles + attribute :__metadata_vdis, :aliases => :metadata_VDIs + attribute :other_config + attribute :redo_log_enabled + attribute :redo_log_vdi attribute :vswitch_controller attribute :__suspend_image_sr, :aliases => :suspend_image_SR + attribute :wlb_enabled + attribute :wlb_url + attribute :wlb_username + attribute :wlb_verify_cert def default_sr diff --git a/lib/fog/xenserver/models/compute/server.rb b/lib/fog/xenserver/models/compute/server.rb index e3ab7fa71..f16d14a3d 100644 --- a/lib/fog/xenserver/models/compute/server.rb +++ b/lib/fog/xenserver/models/compute/server.rb @@ -6,56 +6,89 @@ module Fog class Server < Fog::Compute::Server # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VM + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VM identity :reference attribute :uuid - attribute :name, :aliases => :name_label - attribute :__affinity, :aliases => :affinity + attribute :name, :aliases => :name_label + attribute :description, :aliases => :name_description + attribute :__affinity, :aliases => :affinity + attribute :actions_after_crash + attribute :actions_after_reboot + attribute :actions_after_shutdown attribute :allowed_operations + attribute :__attached_pcis, :aliases => :attached_PCIs + attribute :bios_strings + attribute :blobs + attribute :blocked_operations + attribute :__children, :aliases => :children attribute :__consoles + attribute :__crash_dumps, :aliases => :crash_dumps + attribute :current_operations attribute :domarch attribute :domid + attribute :generation_id attribute :tags - attribute :__guest_metrics, :aliases => :guest_metrics + attribute :__guest_metrics, :aliases => :guest_metrics + attribute :ha_always_run + attribute :ha_restart_priority attribute :is_a_snapshot attribute :is_a_template attribute :is_control_domain + attribute :is_snapshot_from_vmpp + attribute :last_boot_cpu_flags, :aliases => :last_boot_CPU_flags + attribute :last_booted_record attribute :memory_dynamic_max attribute :memory_dynamic_min + attribute :memory_overhead attribute :memory_static_max attribute :memory_static_min attribute :memory_target - attribute :metrics - attribute :name_description + attribute :__metrics, :aliases => :metrics + attribute :order attribute :other_config + attribute :__parent, :aliases => :parent + attribute :platform attribute :power_state - attribute :pv_args, :aliases => :PV_args - attribute :pv_bootloader, :aliases => :PV_bootloader - attribute :pv_bootloader_args, :aliases => :PV_bootloader_args - attribute :pv_kernel, :aliases => :PV_kernel - attribute :pv_ramdisk, :aliases => :PV_ramdisk - attribute :pv_legacy_args, :aliases => :PV_legacy_args - attribute :__resident_on, :aliases => :resident_on + attribute :protection_policy + attribute :pv_args, :aliases => :PV_args + attribute :pv_bootloader, :aliases => :PV_bootloader + attribute :pv_bootloader_args, :aliases => :PV_bootloader_args + attribute :pv_kernel, :aliases => :PV_kernel + attribute :pv_ramdisk, :aliases => :PV_ramdisk + attribute :pv_legacy_args, :aliases => :PV_legacy_args + attribute :recommendations + attribute :__resident_on, :aliases => :resident_on + attribute :shutdown_delay + attribute :snapshot_info + attribute :snapshot_metadata + attribute :__snapshot_of, :aliases => :snapshot_of + attribute :snapshot_time + attribute :start_delay + attribute :__suspend_sr, :aliases => :suspend_sr + attribute :__suspend_vdi, :aliases => :suspend_VDI + attribute :transportable_snapshot_id + attribute :user_version + attribute :version + attribute :__vgpus, :aliases => :VGPUs + attribute :__vtpms, :aliases => :VTPMs + attribute :xenstore_data # Virtual Block Devices - attribute :__vbds, :aliases => :VBDs + attribute :__vbds, :aliases => :VBDs # Virtual CPUs - attribute :vcpus_at_startup, :aliases => :VCPUs_at_startup - attribute :vcpus_max, :aliases => :VCPUs_max - attribute :vcpus_params, :aliases => :VCPUs_params + attribute :vcpus_at_startup, :aliases => :VCPUs_at_startup + attribute :vcpus_max, :aliases => :VCPUs_max + attribute :vcpus_params, :aliases => :VCPUs_params # Virtual Interfaces (NIC) - attribute :__vifs, :aliases => :VIFs + attribute :__vifs, :aliases => :VIFs attribute :template_name - attribute :hvm_boot_policy, :aliases => :HVM_boot_policy - attribute :hvm_boot_params, :aliases => :HVM_boot_params - attribute :pci_bus, :aliases => :PCI_bus + attribute :hvm_boot_policy, :aliases => :HVM_boot_policy + attribute :hvm_boot_params, :aliases => :HVM_boot_params + attribute :hvm_shadow_multiplier, :aliases => :HVM_shadow_multiplier + attribute :pci_bus, :aliases => :PCI_bus attribute :snapshots - def initialize(attributes={}) - super - end - def vbds __vbds.collect {|vbd| service.vbds.get vbd } end diff --git a/lib/fog/xenserver/models/compute/storage_repository.rb b/lib/fog/xenserver/models/compute/storage_repository.rb index 07196701c..cbfaa1813 100644 --- a/lib/fog/xenserver/models/compute/storage_repository.rb +++ b/lib/fog/xenserver/models/compute/storage_repository.rb @@ -6,15 +6,18 @@ module Fog class StorageRepository < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=SR + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=SR identity :reference attribute :name, :aliases => :name_label attribute :description, :aliases => :name_description attribute :uuid + attribute :blobs attribute :allowed_operations attribute :current_operations + attribute :introduced_by + attribute :local_cache_enabled attribute :content_type attribute :other_config attribute :__pbds, :aliases => :PBDs diff --git a/lib/fog/xenserver/models/compute/vbd.rb b/lib/fog/xenserver/models/compute/vbd.rb index 9fa22470f..e79f6b7ad 100644 --- a/lib/fog/xenserver/models/compute/vbd.rb +++ b/lib/fog/xenserver/models/compute/vbd.rb @@ -6,7 +6,7 @@ module Fog class VBD < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VBD + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VBD identity :reference @@ -22,8 +22,8 @@ module Fog attribute :type attribute :userdevice attribute :empty - attribute :type attribute :mode + attribute :other_config attribute :storage_lock attribute :runtime_properties attribute :unpluggable @@ -31,6 +31,7 @@ module Fog attribute :qos_supported_algorithms attribute :qos_algorithm_params attribute :qos_algorithm_type + attribute :qos_supported_algorithms attribute :empty attribute :__metrics, :aliases => :metrics diff --git a/lib/fog/xenserver/models/compute/vbd_metrics.rb b/lib/fog/xenserver/models/compute/vbd_metrics.rb index 5a2571a60..237e70b77 100644 --- a/lib/fog/xenserver/models/compute/vbd_metrics.rb +++ b/lib/fog/xenserver/models/compute/vbd_metrics.rb @@ -6,7 +6,7 @@ module Fog class VbdMetrics < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VBD_metrics + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VBD_metrics identity :reference diff --git a/lib/fog/xenserver/models/compute/vdi.rb b/lib/fog/xenserver/models/compute/vdi.rb index da3f3e964..739e6133a 100644 --- a/lib/fog/xenserver/models/compute/vdi.rb +++ b/lib/fog/xenserver/models/compute/vdi.rb @@ -6,7 +6,7 @@ module Fog class VDI < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VDI + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VDI identity :reference @@ -22,6 +22,7 @@ module Fog attribute :read_only attribute :current_operations attribute :allowed_operations + attribute :__crash_dumps, :aliases => :crash_dumps attribute :type attribute :other_config attribute :tags @@ -30,6 +31,8 @@ module Fog attribute :missing attribute :location attribute :managed + attribute :metadata_latest + attribute :metadata_of_pool attribute :allow_caching attribute :on_boot attribute :sm_config diff --git a/lib/fog/xenserver/models/compute/vif.rb b/lib/fog/xenserver/models/compute/vif.rb index 7b83a1f8f..7523a9d73 100644 --- a/lib/fog/xenserver/models/compute/vif.rb +++ b/lib/fog/xenserver/models/compute/vif.rb @@ -6,17 +6,26 @@ module Fog class VIF < Fog::Model # API Reference here: - # http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VIF + # http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VIF identity :reference attribute :mac, :aliases => :MAC attribute :uuid attribute :allowed_operations + attribute :current_operations attribute :currently_attached attribute :device + attribute :ipv4_allowed + attribute :ipv6_allowed + attribute :locking_mode attribute :mac_autogenerated, :aliases => :MAC_autogenerated - attribute :metrics + attribute :__metrics, :aliases => :metrics + attribute :other_config + attribute :qos_algorithm_params + attribute :qos_algorithm_type + attribute :qos_supported_algorithms + attribute :runtime_properties attribute :mtu, :aliases => :MTU attribute :__network, :aliases => :network attribute :status_code diff --git a/lib/fog/xenserver/models/compute/vlan.rb b/lib/fog/xenserver/models/compute/vlan.rb index 57456a8c1..4a5cb29c6 100644 --- a/lib/fog/xenserver/models/compute/vlan.rb +++ b/lib/fog/xenserver/models/compute/vlan.rb @@ -6,12 +6,13 @@ module Fog class VLAN < Fog::Model # API Reference here: - # @see http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VLAN + # @see http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VLAN identity :reference attribute :uuid attribute :tag, :type => :integer + attribute :other_config attribute :__untagged_pif, :aliases => :untagged_PIF attribute :__tagged_pif, :aliases => :tagged_PIF