Merge pull request #2475 from zertico/adding_more_models

[xenserver] Adding more XenServer Models
This commit is contained in:
Wesley Beary 2013-12-16 06:51:34 -08:00
commit e8bb800d65
35 changed files with 843 additions and 0 deletions

View File

@ -12,10 +12,45 @@ module Fog
requires :xenserver_password
requires :xenserver_url
recognizes :xenserver_defaults
recognizes :xenserver_timeout
model_path 'fog/xenserver/models/compute'
model :blob
collection :blobs
model :bond
collection :bonds
model :crash_dump
collection :crash_dumps
model :dr_task
collection :dr_tasks
model :gpu_group
collection :gpu_groups
model :host_crash_dump
collection :host_crash_dumps
model :host_patch
collection :host_patchs
model :pci
collection :pcis
model :pgpu
collection :pgpus
model :pif_metrics
collection :pifs_metrics
model :pool_patch
collection :pool_patchs
model :role
collection :roles
model :server
collection :servers
model :server_appliance
collection :server_appliances
model :storage_manager
collection :storage_managers
model :tunnel
collection :tunnels
model :vmpp
collection :vmpps
model :vtpm
collection :vtpms
model :host
collection :hosts
collection :vifs

View File

@ -0,0 +1,22 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Blob < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=blob
identity :reference
attribute :last_updated
attribute :mime_type
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :public
attribute :size
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/blob'
module Fog
module Compute
class XenServer
class Blobs < Fog::Collection
model Fog::Compute::XenServer::Blob
def all(options={})
data = service.get_records 'blob'
load(data)
end
def get( blob_ref )
if blob_ref && blob = service.get_record( blob_ref, 'blob' )
new(blob)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,23 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Bond < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=Bond
identity :reference
attribute :links_up
attribute :__master, :aliases => :master
attribute :mode
attribute :other_config
attribute :__primary_slave, :aliases => :primary_slave
attribute :properties
attribute :__slaves, :aliases => :slaves
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/bond'
module Fog
module Compute
class XenServer
class Bonds < Fog::Collection
model Fog::Compute::XenServer::Bond
def all(options={})
data = service.get_records 'Bond'
load(data)
end
def get( bond_ref )
if bond_ref && bond = service.get_record( bond_ref, 'Bond' )
new(bond)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,19 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class CrashDump < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=crashdump
identity :reference
attribute :other_config
attribute :__vdi, :aliases => :VDI
attribute :__vm, :aliases => :VM
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/crash_dump'
module Fog
module Compute
class XenServer
class Bonds < Fog::Collection
model Fog::Compute::XenServer::CrashDump
def all(options={})
data = service.get_records 'crashdump'
load(data)
end
def get( crashdump_ref )
if crashdump_ref && crashdump = service.get_record( crashdump_ref, 'crashdump' )
new(crashdump)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,17 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class DrTask < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=DR_task
identity :reference
attribute :__introduced_srs, :aliases => :introduced_SRs
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/dr_task'
module Fog
module Compute
class XenServer
class DrTasks < Fog::Collection
model Fog::Compute::XenServer::DrTask
def all(options={})
data = service.get_records 'DR_task'
load(data)
end
def get( dr_task_ref )
if dr_task_ref && dr_task = service.get_record( dr_task_ref, 'DR_task' )
new(dr_task)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,22 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class GpuGroup < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=GPU_group
identity :reference
attribute :gpu_types, :aliases => :GPU_types
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :other_config
attribute :__pgpus, :aliases => :PGPUs
attribute :__vgpus, :aliases => :VGPUs
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/gpu_group'
module Fog
module Compute
class XenServer
class GpuGroups < Fog::Collection
model Fog::Compute::XenServer::GpuGroup
def all(options={})
data = service.get_records 'GPU_group'
load(data)
end
def get( gpu_group_ref )
if gpu_group_ref && gpu_group = service.get_record( gpu_group_ref, 'GPU_group' )
new(gpu_group)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,20 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class HostCrashDump < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=host_crashdump
identity :reference
attribute :__host, :aliases => :host
attribute :other_config
attribute :size
attribute :timestamp
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/host_crash_dump'
module Fog
module Compute
class XenServer
class HostCrashDumps < Fog::Collection
model Fog::Compute::XenServer::HostCrashDump
def all(options={})
data = service.get_records 'host_crashdump'
load(data)
end
def get( host_crashdump_ref )
if host_crashdump_ref && host_crashdump = service.get_record( host_crashdump_ref, 'host_crashdump' )
new(host_crashdump)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class HostPatch < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=host_patch
identity :reference
attribute :applied
attribute :__host, :aliases => :host
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :other_config
attribute :__pool_patch, :aliases => :pool_patch
attribute :size
attribute :timestamp_applied
attribute :uuid
attribute :version
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/host_patch'
module Fog
module Compute
class XenServer
class HostPatchs < Fog::Collection
model Fog::Compute::XenServer::HostPatch
def all(options={})
data = service.get_records 'host_patch'
load(data)
end
def get( host_patch_ref )
if host_patch_ref && host_patch = service.get_record( host_patch_ref, 'host_patch' )
new(host_patch)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,22 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Pci < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PCI
identity :reference
attribute :__dependencies, :aliases => :dependencies
attribute :device_name
attribute :__host, :aliases => :host
attribute :other_config
attribute :pci_id
attribute :uuid
attribute :vendor_name
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/pci'
module Fog
module Compute
class XenServer
class Pcis < Fog::Collection
model Fog::Compute::XenServer::Pci
def all(options={})
data = service.get_records 'PCI'
load(data)
end
def get( pci_ref )
if pci_ref && pci = service.get_record( pci_ref, 'PCI' )
new(pci)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,20 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Pgpu < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PGPU
identity :reference
attribute :__gpu_group, :aliases => :GPU_group
attribute :__host, :aliases => :host
attribute :other_config
attribute :__pci, :aliases => :PCI
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/pgpu'
module Fog
module Compute
class XenServer
class Pgpus < Fog::Collection
model Fog::Compute::XenServer::Pgpu
def all(options={})
data = service.get_records 'PGPU'
load(data)
end
def get( pgpu_ref )
if pgpu_ref && pgpu = service.get_record( pgpu_ref, 'PGPU' )
new(pgpu)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,28 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class PifMetrics < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=PIF_metrics
identity :reference
attribute :carrier
attribute :device_id
attribute :device_name
attribute :duplex
attribute :io_read_kbs
attribute :io_write_kbs
attribute :last_updated
attribute :other_config
attribute :pci_bus_path
attribute :speed
attribute :uuid
attribute :vendor_id
attribute :vendor_name
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/pif_metrics'
module Fog
module Compute
class XenServer
class PifsMetrics < Fog::Collection
model Fog::Compute::XenServer::PifMetrics
def all(options={})
data = service.get_records 'PIF_metrics'
load(data)
end
def get( pif_metrics_ref )
if pif_metrics_ref && pif_metrics = service.get_record( pif_metrics_ref, 'PIF_metrics' )
new(pif_metrics)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,24 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class PoolPatch < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=pool_patch
identity :reference
attribute :after_apply_guidance
attribute :__host_patches, :aliases => :host_patches
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :other_config
attribute :pool_applied
attribute :size
attribute :uuid
attribute :version
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/pool_patch'
module Fog
module Compute
class XenServer
class PoolPatchs < Fog::Collection
model Fog::Compute::XenServer::PoolPatch
def all(options={})
data = service.get_records 'pool_patch'
load(data)
end
def get( pool_patch_ref )
if pool_patch_ref && pool_patch = service.get_record( pool_patch_ref, 'pool_patch' )
new(pool_patch)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,19 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Role < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=role
identity :reference
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :__subroles, :aliases => :subroles
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/role'
module Fog
module Compute
class XenServer
class Roles < Fog::Collection
model Fog::Compute::XenServer::Role
def all(options={})
data = service.get_records 'role'
load(data)
end
def get( role_ref )
if role_ref && role = service.get_record( role_ref, 'role' )
new(role)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,21 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class ServerAppliance < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VM_appliance
identity :reference
attribute :allowed_operations
attribute :current_operations
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :uuid
attribute :__vms, :aliases => :VMs
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/server_appliance'
module Fog
module Compute
class XenServer
class ServerAppliances < Fog::Collection
model Fog::Compute::XenServer::ServerAppliance
def all(options={})
data = service.get_records 'VM_appliance'
load(data)
end
def get( server_appliance_ref )
if server_appliance_ref && server_appliance = service.get_record( server_appliance_ref, 'VM_appliance' )
new(server_appliance)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,28 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class StorageManager < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=SM
identity :reference
attribute :capabilities
attribute :configuration
attribtue :copyright
attribute :driver_filename
attribute :features
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :other_config
attribute :required_api_version
attribute :type
attribute :uuid
attribute :vendor
attribute :version
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/storage_manager'
module Fog
module Compute
class XenServer
class StorageManagers < Fog::Collection
model Fog::Compute::XenServer::StorageManager
def all(options={})
data = service.get_records 'SM'
load(data)
end
def get( sm_ref )
if sm_ref && sm = service.get_record( sm_ref, 'SM' )
new(sm)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,20 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Tunnel < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=tunnel
identity :reference
attribute :access_pif, :aliases => :access_PIF
attribute :other_config
attribute :status
attribute :transport_pif, :aliases => :transport_PIF
attribute :uuid
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/tunnel'
module Fog
module Compute
class XenServer
class Tunnels < Fog::Collection
model Fog::Compute::XenServer::Tunnel
def all(options={})
data = service.get_records 'tunnel'
load(data)
end
def get( tunnel_ref )
if tunnel_ref && tunnel = service.get_record( tunnel_ref, 'tunnel' )
new(tunnel)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,35 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Vmpp < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VMPP
identity :reference
attribute :alarm_config
attribute :archive_frequency
attribute :archive_last_run_time
attribute :archive_schedule
attribute :archive_target_config
attribute :archive_target_type
attribute :backup_frequency
attribute :backup_last_run_time
attribute :backup_retention_value
attribute :backup_schedule
attribute :backup_type
attribute :is_alarm_enabled
attribute :is_archive_running
attribute :is_backup_running
attribute :is_policy_enabled
attribute :description, :aliases => :name_description
attribute :name, :aliases => :name_label
attribute :recent_alerts
attribute :uuid
attribute :__vms, :aliases => :VMs
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/vmpp'
module Fog
module Compute
class XenServer
class Vmpps < Fog::Collection
model Fog::Compute::XenServer::Vmpp
def all(options={})
data = service.get_records 'VMPP'
load(data)
end
def get( vmpp_ref )
if vmpp_ref && vmpp = service.get_record( vmpp_ref, 'VMPP' )
new(vmpp)
else
nil
end
end
end
end
end
end

View File

@ -0,0 +1,18 @@
require 'fog/core/model'
module Fog
module Compute
class XenServer
class Vtpm < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VTPM
identity :reference
attribute :__backend, :aliases => :backend
attribute :uuid
attribute :__vm, :aliases => :vm
end
end
end
end

View File

@ -0,0 +1,25 @@
require 'fog/core/collection'
require 'fog/xenserver/models/compute/vtpm'
module Fog
module Compute
class XenServer
class Vtpms < Fog::Collection
model Fog::Compute::XenServer::Vtpm
def all(options={})
data = service.get_records 'VTPM'
load(data)
end
def get( vtpm_ref )
if vtpm_ref && vtpm = service.get_record( vtpm_ref, 'VTPM' )
new(vtpm)
else
nil
end
end
end
end
end
end