Method: Fog::Compute::AWS::Real#delete_security_group

Defined in:
lib/fog/aws/requests/compute/delete_security_group.rb

#delete_security_group(name, id = nil) ⇒ Object

Delete a security group that you own

Parameters

  • group_name<~String> - Name of the security group, must be nil if id is specified

  • group_id<~String> - Id of the security group, must be nil if name is specified

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • ‘return’<~Boolean> - success?

Amazon API Reference

[View source]

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fog/aws/requests/compute/delete_security_group.rb', line 21

def delete_security_group(name, id = nil)
  if name && id
    raise Fog::Compute::AWS::Error.new("May not specify both group_name and group_id")
  end
  if name
    type_id    = 'GroupName'
    identifier = name
  else
    type_id    = 'GroupId'
    identifier = id
  end
  request(
    'Action'    => 'DeleteSecurityGroup',
    type_id     => identifier,
    :idempotent => true,
    :parser     => Fog::Parsers::Compute::AWS::Basic.new
  )
end