Class: OpenStack::Compute::Flavor

Inherits:
Object
  • Object
show all
Defined in:
lib/openstack/compute/flavor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flavor_info = {}) ⇒ Flavor

This class provides an object for the “Flavor” of a server. The Flavor can generally be taken as the server specification, providing information on things like memory and disk space.

The disk attribute is an integer representing the disk space in GB. The memory attribute is an integer representing the RAM in MB.



15
16
17
18
19
20
21
22
# File 'lib/openstack/compute/flavor.rb', line 15

def initialize(flavor_info = {})
 @id = flavor_info['id']
 @name = flavor_info['name']
 @ram = flavor_info['ram']
 @disk = flavor_info['disk']
 @vcpus = flavor_info['vcpus']
 @disabled = flavor_info['OS-FLV-DISABLED:disabled']
end

Instance Attribute Details

#disabledObject (readonly)

Returns the value of attribute disabled.



9
10
11
# File 'lib/openstack/compute/flavor.rb', line 9

def disabled
  @disabled
end

#diskObject (readonly)

Returns the value of attribute disk.



7
8
9
# File 'lib/openstack/compute/flavor.rb', line 7

def disk
  @disk
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/openstack/compute/flavor.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/openstack/compute/flavor.rb', line 5

def name
  @name
end

#ramObject (readonly)

Returns the value of attribute ram.



6
7
8
# File 'lib/openstack/compute/flavor.rb', line 6

def ram
  @ram
end

#vcpusObject (readonly)

Returns the value of attribute vcpus.



8
9
10
# File 'lib/openstack/compute/flavor.rb', line 8

def vcpus
  @vcpus
end