1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/networking_v2/port.rb
2014-12-17 15:01:55 -05:00

39 lines
785 B
Ruby

module Fog
module Rackspace
class NetworkingV2
class Port < Fog::Model
identity :id
attribute :admin_state_up
attribute :device_id
attribute :device_owner
attribute :fixed_ips
attribute :mac_address
attribute :name
attribute :network_id
attribute :security_groups
attribute :status
attribute :tenant_id
def save
data = unless self.id.nil?
service.update_port(self)
else
service.create_port(self)
end
merge_attributes(data.body['port'])
true
end
def destroy
requires :identity
service.delete_port(identity)
true
end
end
end
end
end