Class: Fog::OpenStack::NFV::Vnfs

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/openstack/nfv/models/vnfs.rb

Instance Attribute Summary

Attributes inherited from Collection

#response

Instance Method Summary collapse

Methods inherited from Collection

#find_by_id, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
# File 'lib/fog/openstack/nfv/models/vnfs.rb', line 10

def all(options = {})
  load_response(service.list_vnfs(options), 'vnfs')
end

#destroy(uuid) ⇒ Object



21
22
23
24
# File 'lib/fog/openstack/nfv/models/vnfs.rb', line 21

def destroy(uuid)
  vnf = get(uuid)
  vnf.destroy
end

#get(uuid) ⇒ Object



14
15
16
17
18
19
# File 'lib/fog/openstack/nfv/models/vnfs.rb', line 14

def get(uuid)
  data = service.get_vnf(uuid).body['vnf']
  new(data)
rescue Fog::OpenStack::NFV::NotFound
  nil
end