def delete_security_group(self): # TODO this should raise an error if there are instances in the group. See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteSecurityGroup.html name = self.querystring.get('GroupName') sg_id = self.querystring.get('GroupId') if name: ec2_backend.delete_security_group(name[0]) elif sg_id: ec2_backend.delete_security_group(group_id=sg_id[0]) return DELETE_GROUP_RESPONSE
def delete_security_group(self): # TODO this should raise an error if there are instances in the group. See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteSecurityGroup.html name = self.querystring.get('GroupName') sg_id = self.querystring.get('GroupId') if name: group = ec2_backend.delete_security_group(name[0]) elif sg_id: group = ec2_backend.delete_security_group(group_id=sg_id[0]) return DELETE_GROUP_RESPONSE
def delete_security_group(self): # TODO this should raise an error if there are instances in the group. See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteSecurityGroup.html name = self.querystring.get('GroupName') sg_id = self.querystring.get('GroupId') if name: group = ec2_backend.delete_security_group(name[0]) elif sg_id: group = ec2_backend.delete_security_group(group_id=sg_id[0]) # needs name or group now if not group: # There was no such group return "There was no security group with name {0}".format(name), dict(status=404) return DELETE_GROUP_RESPONSE
def delete_security_group(self): # TODO this should raise an error if there are instances in the group. See http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteSecurityGroup.html name = self.querystring.get('GroupName') sg_id = self.querystring.get('GroupId') if name: group = ec2_backend.delete_security_group(name[0]) elif sg_id: group = ec2_backend.delete_security_group(group_id=sg_id[0]) # needs name or group now if not group: # There was no such group return "There was no security group with name {0}".format( name), dict(status=404) return DELETE_GROUP_RESPONSE