Class: Fog::Compute::Softlayer::Flavors

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/softlayer/models/compute/flavors.rb

Instance Method Summary collapse

Instance Method Details

#allObject

Returns an array of all flavors that have been created

Fog::Softlayer.flavors.all



67
68
69
70
# File 'lib/fog/softlayer/models/compute/flavors.rb', line 67

def all
  load(Fog::Compute::Softlayer::FLAVORS)
  self
end

#get(flavor_id) ⇒ Object

Used to retrieve a flavor flavor_id is required to get the associated flavor information. flavors available currently:

m1.tiny

You can run the following command to get the details: Softlayer.flavors.get(“m1.tiny”)

Returns

>> Softlayer.flavors.get(“m1.tiny”) <Fog::Softlayer::Compute::Flavor

id="m1.tiny",
cores=1,
disk=160,
name="Tiny Instance",
ram=1024

>



93
94
95
# File 'lib/fog/softlayer/models/compute/flavors.rb', line 93

def get(flavor_id)
  self.class.new(:service => service).all.detect {|flavor| flavor.id == flavor_id}
end