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/security_group.rb
2015-03-09 16:29:23 -04:00

32 lines
619 B
Ruby

module Fog
module Rackspace
class NetworkingV2
class SecurityGroup < Fog::Model
identity :id
attribute :name
attribute :description
attribute :tenant_id
def save
data = unless self.id.nil?
service.update_security_group(self)
else
service.create_security_group(self)
end
merge_attributes(data.body['security_group'])
true
end
def destroy
requires :identity
service.delete_security_group(identity)
true
end
end
end
end
end