def create(**kwargs):
    """
    Creates a new endpoint.
    :param kwargs:
    :return:
    """
    aliases = []
    if "aliases" in kwargs:
        aliases = [EndpointDnsAlias(alias=name) for name in kwargs.pop("aliases")]
    endpoint = Endpoint(**kwargs)
    endpoint.aliases = aliases
    database.create(endpoint)
    metrics.send(
        "endpoint_added", "counter", 1,
        metric_tags={"source": endpoint.source.label, "type": endpoint.type}
    )
    return endpoint

    Creates a new endpoint.
    :param kwargs:
    :return:
    
lemur/endpoints/service.py