class Fog::OpenStack::Baremetal::Port

Public Instance Methods

create() click to toggle source
# File lib/fog/openstack/baremetal/models/port.rb, line 18
def create
  requires :address, :node_uuid
  merge_attributes(service.create_port(attributes).body)
  self
end
destroy() click to toggle source
# File lib/fog/openstack/baremetal/models/port.rb, line 37
def destroy
  requires :uuid
  service.delete_port(uuid)
  true
end
metadata() click to toggle source
# File lib/fog/openstack/baremetal/models/port.rb, line 43
def metadata
  requires :uuid
  service.get_port(uuid).headers
end
update(patch = nil) click to toggle source
# File lib/fog/openstack/baremetal/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
    # TODO: implement update_node method using PUT method and self.attributes
    # once it is supported by Ironic
    raise ArgumentError,
          'You need to provide patch attribute. Ironic does not support update by hash yet, only by jsonpatch.'
  end
  self
end