Class: Fog::Baremetal::OpenStack::Port
Instance Attribute Summary
#project
Instance Method Summary
collapse
#initialize, #save
Instance Method Details
#create ⇒ Object
18
19
20
21
22
|
# File 'lib/fog/baremetal/openstack/models/port.rb', line 18
def create
requires :address, :node_uuid
merge_attributes(service.create_port(attributes).body)
self
end
|
#destroy ⇒ Object
37
38
39
40
41
|
# File 'lib/fog/baremetal/openstack/models/port.rb', line 37
def destroy
requires :uuid
service.delete_port(uuid)
true
end
|
43
44
45
46
|
# File 'lib/fog/baremetal/openstack/models/port.rb', line 43
def metadata
requires :uuid
service.get_port(uuid).
end
|
#update(patch = nil) ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/fog/baremetal/openstack/models/port.rb', line 24
def update(patch = nil)
requires :uuid, :address, :node_uuid
if patch
merge_attributes(service.patch_port(uuid, patch).body)
else
raise ArgumentError,
'You need to provide patch attribute. Ironic does not support update by hash yet, only by jsonpatch.'
end
self
end
|