1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Adding more XenServer models

This commit is contained in:
Paulo Henrique Lopes Ribeiro 2013-12-12 10:16:21 -02:00
parent 04cce1faf1
commit 2b9ac7dec1
21 changed files with 486 additions and 1 deletions

View file

@ -4,7 +4,7 @@ require 'fog/xenserver/models/compute/host_patch'
module Fog
module Compute
class XenServer
class HostPatches < Fog::Collection
class HostPatchs < Fog::Collection
model Fog::Compute::XenServer::HostPatch
def all(options={})

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