Class: Fog::NFV::OpenStack::Vnf
Instance Attribute Summary
#project
Instance Method Summary
collapse
#initialize
Instance Method Details
#create(options = {}) ⇒ Object
21
22
23
24
|
# File 'lib/fog/nfv/openstack/models/vnf.rb', line 21
def create(options = {})
merge_attributes(service.create_vnf(default_options.merge(options)).body['vnf'])
self
end
|
#default_options ⇒ Object
41
42
43
44
45
46
|
# File 'lib/fog/nfv/openstack/models/vnf.rb', line 41
def default_options
{
:vnf => vnf,
:auth => auth
}
end
|
#destroy ⇒ Object
35
36
37
38
39
|
# File 'lib/fog/nfv/openstack/models/vnf.rb', line 35
def destroy
requires :id
service.delete_vnf(id)
true
end
|
#ready? ⇒ Boolean
52
53
54
|
# File 'lib/fog/nfv/openstack/models/vnf.rb', line 52
def ready?
status == 'ACTIVE'
end
|
#save(options = {}) ⇒ Object
31
32
33
|
# File 'lib/fog/nfv/openstack/models/vnf.rb', line 31
def save(options = {})
identity ? update(options) : create(options)
end
|
#update(options = {}) ⇒ Object
26
27
28
29
|
# File 'lib/fog/nfv/openstack/models/vnf.rb', line 26
def update(options = {})
merge_attributes(service.update_vnf(identity, default_options.merge(options)).body['vnf'])
self
end
|
#vnf_attributes ⇒ Object
48
49
50
|
# File 'lib/fog/nfv/openstack/models/vnf.rb', line 48
def vnf_attributes
attributes['attributes']
end
|