2009-08-17 09:45:00 -07:00
|
|
|
unless Fog.mocking?
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class EC2
|
|
|
|
|
|
|
|
# Delete a security group that you own
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * group_name<~String> - Name of the security group.
|
|
|
|
#
|
|
|
|
# ==== Returns
|
2009-11-02 18:48:49 -08:00
|
|
|
# * response<~Excon::Response>:
|
2009-08-17 09:45:00 -07:00
|
|
|
# * body<~Hash>:
|
|
|
|
# * 'requestId'<~String> - Id of request
|
|
|
|
# * 'return'<~Boolean> - success?
|
|
|
|
def delete_security_group(name)
|
|
|
|
request({
|
|
|
|
'Action' => 'DeleteSecurityGroup',
|
|
|
|
'GroupName' => name
|
|
|
|
}, Fog::Parsers::AWS::EC2::Basic.new)
|
|
|
|
end
|
2009-07-13 19:14:59 -07:00
|
|
|
|
|
|
|
end
|
2009-08-17 09:45:00 -07:00
|
|
|
end
|
|
|
|
end
|
2009-07-13 19:14:59 -07:00
|
|
|
|
2009-08-17 09:45:00 -07:00
|
|
|
else
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class EC2
|
|
|
|
def delete_security_group(name)
|
2009-11-20 11:08:08 -08:00
|
|
|
response = Excon::Response.new
|
2009-08-20 19:25:52 -07:00
|
|
|
if Fog::AWS::EC2.data[:security_groups][name]
|
|
|
|
Fog::AWS::EC2.data[:security_groups].delete(name)
|
2009-08-17 09:45:00 -07:00
|
|
|
response.status = 200
|
|
|
|
response.body = {
|
|
|
|
'requestId' => Fog::AWS::Mock.request_id,
|
|
|
|
'return' => true
|
|
|
|
}
|
|
|
|
else
|
|
|
|
response.status = 400
|
2009-11-20 11:08:08 -08:00
|
|
|
raise(Excon::Errors.status_error({:expects => 200}, response))
|
2009-08-17 09:45:00 -07:00
|
|
|
end
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
2009-07-13 19:14:59 -07:00
|
|
|
end
|
|
|
|
end
|
2009-08-17 09:45:00 -07:00
|
|
|
|
2009-07-13 19:14:59 -07:00
|
|
|
end
|