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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#find_by_id, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object


10
11
12
# File 'lib/fog/nfv/openstack/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/nfv/openstack/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/nfv/openstack/models/vnfs.rb', line 14

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