mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[xenserver] Adding more XenServer Models
This commit is contained in:
parent
5375a817fa
commit
04cce1faf1
14 changed files with 323 additions and 0 deletions
22
lib/fog/xenserver/models/compute/blob.rb
Normal file
22
lib/fog/xenserver/models/compute/blob.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/blobs.rb
Normal file
25
lib/fog/xenserver/models/compute/blobs.rb
Normal 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
|
23
lib/fog/xenserver/models/compute/bond.rb
Normal file
23
lib/fog/xenserver/models/compute/bond.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/bonds.rb
Normal file
25
lib/fog/xenserver/models/compute/bonds.rb
Normal 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
|
19
lib/fog/xenserver/models/compute/crash_dump.rb
Normal file
19
lib/fog/xenserver/models/compute/crash_dump.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/crash_dumps.rb
Normal file
25
lib/fog/xenserver/models/compute/crash_dumps.rb
Normal 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
|
17
lib/fog/xenserver/models/compute/dr_task.rb
Normal file
17
lib/fog/xenserver/models/compute/dr_task.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/dr_tasks.rb
Normal file
25
lib/fog/xenserver/models/compute/dr_tasks.rb
Normal 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
|
22
lib/fog/xenserver/models/compute/gpu_group.rb
Normal file
22
lib/fog/xenserver/models/compute/gpu_group.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/gpu_groups.rb
Normal file
25
lib/fog/xenserver/models/compute/gpu_groups.rb
Normal 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
|
20
lib/fog/xenserver/models/compute/host_crash_dump.rb
Normal file
20
lib/fog/xenserver/models/compute/host_crash_dump.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/host_crash_dumps.rb
Normal file
25
lib/fog/xenserver/models/compute/host_crash_dumps.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/host_patch.rb
Normal file
25
lib/fog/xenserver/models/compute/host_patch.rb
Normal 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
|
25
lib/fog/xenserver/models/compute/host_patches.rb
Normal file
25
lib/fog/xenserver/models/compute/host_patches.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/xenserver/models/compute/host_patch'
|
||||
|
||||
module Fog
|
||||
module Compute
|
||||
class XenServer
|
||||
class HostPatches < 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
|
Loading…
Reference in a new issue