def _authenticate_security_group_request()

in ec2stack/providers/cloudstack/security_groups.py [0:0]


def _authenticate_security_group_request(rule_type):
    """
    Request to add an egress rule to a security group.

    @param rule_type: The type of rule to add.
    @return: Response.
    """
    args = _parse_security_group_request()

    if rule_type == 'egress':
        args['command'] = 'authorizeSecurityGroupEgress'
    elif rule_type == 'ingress':
        args['command'] = 'authorizeSecurityGroupIngress'

    response = requester.make_request_async(args)

    return response