Class: Fog::Compute::XenServer::Pool

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/xenserver/models/compute/pool.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#default_srObject



25
26
27
# File 'lib/fog/xenserver/models/compute/pool.rb', line 25

def default_sr
  service.storage_repositories.get __default_sr
end

#default_sr=(sr) ⇒ Object Also known as: default_storage_repository=



29
30
31
# File 'lib/fog/xenserver/models/compute/pool.rb', line 29

def default_sr=(sr)
  service.set_attribute( 'pool', reference, 'default_SR', sr.reference )
end

#default_storage_repositoryObject



34
35
36
# File 'lib/fog/xenserver/models/compute/pool.rb', line 34

def default_storage_repository
  default_sr
end

#masterObject



46
47
48
# File 'lib/fog/xenserver/models/compute/pool.rb', line 46

def master
  service.hosts.get __master
end

#set_attribute(name, *val) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/fog/xenserver/models/compute/pool.rb', line 50

def set_attribute(name, *val)
  data = service.set_attribute( 'pool', reference, name, *val )
  # Do not reload automatically for performance reasons
  # We can set multiple attributes at the same time and
  # then reload manually
  #reload
end

#suspend_image_srObject



42
43
44
# File 'lib/fog/xenserver/models/compute/pool.rb', line 42

def suspend_image_sr
  service.storage_repositories.get __suspend_image_sr
end

#suspend_image_sr=(sr) ⇒ Object



38
39
40
# File 'lib/fog/xenserver/models/compute/pool.rb', line 38

def suspend_image_sr=(sr)
  service.set_attribute( 'pool', reference, 'suspend_image_SR', sr.reference )
end