Class: Fog::Compute::Google::Flavors
- Inherits:
-
Fog::Collection
- Object
- Fog::Collection
- Fog::Compute::Google::Flavors
- Defined in:
- lib/fog/compute/google/models/flavors.rb
Instance Method Summary collapse
Instance Method Details
#all(filters = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fog/compute/google/models/flavors.rb', line 7 def all(filters = {}) if filters[:zone] data = service.list_machine_types(filters[:zone]).body["items"] else data = [] service.list_aggregated_machine_types.body["items"].each_value do |zone| data.concat(zone["machineTypes"]) if zone["machineTypes"] end end load(data) end |
#get(identity, zone_name = nil) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/fog/compute/google/models/flavors.rb', line 19 def get(identity, zone_name = nil) data = service.get_machine_type(identity, zone_name).body new(data) rescue Fog::Errors::NotFound nil end |