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



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

def default_sr
  service.storage_repositories.get __default_sr
end

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



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

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

#default_storage_repositoryObject



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

def default_storage_repository
  default_sr
end

#masterObject



63
64
65
# File 'lib/fog/xenserver/models/compute/pool.rb', line 63

def master
  service.hosts.get __master
end

#set_attribute(name, *val) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/fog/xenserver/models/compute/pool.rb', line 67

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



59
60
61
# File 'lib/fog/xenserver/models/compute/pool.rb', line 59

def suspend_image_sr
  service.storage_repositories.get __suspend_image_sr
end

#suspend_image_sr=(sr) ⇒ Object



55
56
57
# File 'lib/fog/xenserver/models/compute/pool.rb', line 55

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