Class: Fog::Network::OpenStack::Port

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/network/openstack/models/port.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

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

Instance Method Details

#createObject


20
21
22
23
24
25
# File 'lib/fog/network/openstack/models/port.rb', line 20

def create
  requires :network_id
  merge_attributes(service.create_port(network_id,
                                       attributes).body['port'])
  self
end

#destroyObject


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

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

#updateObject


27
28
29
30
31
32
# File 'lib/fog/network/openstack/models/port.rb', line 27

def update
  requires :id, :network_id
  merge_attributes(service.update_port(id,
                                       attributes).body['port'])
  self
end