Class: Fog::Cloudstack::Compute::NetworkOfferings

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

Instance Method Summary collapse

Instance Method Details

#all(filters = {}) ⇒ Object



12
13
14
15
16
# File 'lib/fog/cloudstack/models/compute/network_offerings.rb', line 12

def all(filters={})
  options = get_filter_options(filters)
  data = service.list_network_offerings(options)["listnetworkofferingsresponse"]["networkoffering"] || []
  load(data)
end

#get(network_offering_id, filters = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/fog/cloudstack/models/compute/network_offerings.rb', line 18

def get(network_offering_id, filters={})
  filter_option = get_filter_options(filters)
  options = filter_option.merge('id' => network_offering_id)
  if data = service.list_network_offerings(options)["listnetworkofferingsresponse"]["networkoffering"].first
    new(data)
  end
rescue Fog::Cloudstack::Compute::BadRequest
  nil
end