Class: Occi::Infrastructure::Compute

Inherits:
Core::Resource show all
Defined in:
lib/occi/infrastructure/compute.rb

Instance Attribute Summary

Attributes inherited from Core::Resource

#links

Attributes inherited from Core::Entity

#actions, #attributes, #id, #kind, #location, #mixins, #model

Instance Method Summary collapse

Methods inherited from Core::Resource

#as_json, #initialize, #link, #model=, #summary, #summary=, #to_header, #to_text

Methods inherited from Core::Entity

#as_json, check, #check, #initialize, new, #title, #title=, #to_header, #to_s, #to_text, type_identifier

Methods included from Helpers::Inspect

#inspect

Constructor Details

This class inherits a constructor from Occi::Core::Resource

Instance Method Details

#architectureObject


56
57
58
# File 'lib/occi/infrastructure/compute.rb', line 56

def architecture
  @attributes.occi.compute.architecture if @attributes.occi.compute if @attributes.occi
end

#architecture=(architecture) ⇒ Object


60
61
62
# File 'lib/occi/infrastructure/compute.rb', line 60

def architecture=(architecture)
  @attributes.occi!.compute!.architecture = architecture
end

#coresObject


64
65
66
# File 'lib/occi/infrastructure/compute.rb', line 64

def cores
  @attributes.occi.compute.cores if @attributes.occi.compute if @attributes.occi
end

#cores=(cores) ⇒ Object


68
69
70
# File 'lib/occi/infrastructure/compute.rb', line 68

def cores=(cores)
  @attributes.occi!.compute!.cores = cores
end

#hostnameObject


72
73
74
# File 'lib/occi/infrastructure/compute.rb', line 72

def hostname
  @attributes.occi.compute.hostname if @attributes.occi.compute if @attributes.occi
end

#hostname=(hostname) ⇒ Object


76
77
78
# File 'lib/occi/infrastructure/compute.rb', line 76

def hostname=(hostname)
  @attributes.occi!.compute!.hostname = hostname
end

#memoryObject


88
89
90
# File 'lib/occi/infrastructure/compute.rb', line 88

def memory
  @attributes.occi.compute.memory if @attributes.occi.compute if @attributes.occi
end

#memory=(memory) ⇒ Object


92
93
94
# File 'lib/occi/infrastructure/compute.rb', line 92

def memory=(memory)
  @attributes.occi!.compute!.memory = memory
end

#networkinterface(target, mixins = [], attributes = Occi::Core::Attributes.new) ⇒ Object


108
109
110
# File 'lib/occi/infrastructure/compute.rb', line 108

def networkinterface(target, mixins=[], attributes=Occi::Core::Attributes.new)
  link(target, Occi::Infrastructure::Networkinterface.kind, mixins, attributes)
end

#networkinterfacesObject


116
117
118
# File 'lib/occi/infrastructure/compute.rb', line 116

def networkinterfaces
  @links.select { |link| link.kind == Occi::Infrastructure::Networkinterface.kind }
end

#speedObject


80
81
82
# File 'lib/occi/infrastructure/compute.rb', line 80

def speed
  @attributes.occi.compute.speed if @attributes.occi.compute if @attributes.occi
end

#speed=(speed) ⇒ Object


84
85
86
# File 'lib/occi/infrastructure/compute.rb', line 84

def speed=(speed)
  @attributes.occi!.compute!.speed = speed
end

#stateObject


96
97
98
# File 'lib/occi/infrastructure/compute.rb', line 96

def state
  @attributes.occi.compute.state if @attributes.occi.compute if @attributes.occi
end

#state=(state) ⇒ Object


100
101
102
# File 'lib/occi/infrastructure/compute.rb', line 100

def state=(state)
  @attributes.occi!.compute!.state = state
end

104
105
106
# File 'lib/occi/infrastructure/compute.rb', line 104

def storagelink(target, mixins=[], attributes=Occi::Core::Attributes.new)
  link(target, Occi::Infrastructure::Storagelink.kind, mixins, attributes, rel=Occi::Infrastructure::Storage.type_identifier)
end

112
113
114
# File 'lib/occi/infrastructure/compute.rb', line 112

def storagelinks
  @links.select { |link| link.kind == Occi::Infrastructure::Storagelink.kind }
end