Class: Fog::OpenStack::NFV::Vnfd

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

Instance Attribute Summary

Attributes inherited from Model

#project

Instance Method Summary collapse

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#create(options = {}) ⇒ Object



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

def create(options = {})
  merge_attributes(service.create_vnfd(default_options.merge(options)).body['vnfd'])
  self
end

#default_optionsObject



40
41
42
43
44
45
# File 'lib/fog/openstack/nfv/models/vnfd.rb', line 40

def default_options
  {
    :vnfd => vnfd,
    :auth => auth
  }
end

#destroyObject



34
35
36
37
38
# File 'lib/fog/openstack/nfv/models/vnfd.rb', line 34

def destroy
  requires :id
  service.delete_vnfd(id)
  true
end

#save(options = {}) ⇒ Object



30
31
32
# File 'lib/fog/openstack/nfv/models/vnfd.rb', line 30

def save(options = {})
  identity ? update(options) : create(options)
end

#update(_options = {}) ⇒ Object



26
27
28
# File 'lib/fog/openstack/nfv/models/vnfd.rb', line 26

def update(_options = {})
  raise Fog::OpenStack::Errors::InterfaceNotImplemented, "Method 'update' is not supported"
end

#vnf_attributesObject



47
48
49
# File 'lib/fog/openstack/nfv/models/vnfd.rb', line 47

def vnf_attributes
  attributes['attributes']
end