class Fog::Network::OpenStack::Port

Public Class Methods

new(attributes) click to toggle source
Calls superclass method Fog::Model.new
# File lib/fog/openstack/models/network/port.rb, line 19
def initialize(attributes)
  @connection = attributes[:connection]
  super
end

Public Instance Methods

create() click to toggle source
# File lib/fog/openstack/models/network/port.rb, line 29
def create
  requires :network_id
  merge_attributes(connection.create_port(self.network_id,
                                          self.attributes).body['port'])
  self
end
destroy() click to toggle source
# File lib/fog/openstack/models/network/port.rb, line 43
def destroy
  requires :id
  connection.delete_port(self.id)
  true
end
save() click to toggle source
# File lib/fog/openstack/models/network/port.rb, line 24
def save
  requires :network_id
  identity ? update : create
end
update() click to toggle source
# File lib/fog/openstack/models/network/port.rb, line 36
def update
  requires :id, :network_id
  merge_attributes(connection.update_port(self.id,
                                          self.attributes).body['port'])
  self
end