Ensures we can get multiple endpoints with the same name but different ports. (#1011)

This commit is contained in:
kevgliss
2017-12-04 13:13:02 -08:00
committed by GitHub
parent c311c0a221
commit a756a74b49
4 changed files with 14 additions and 4 deletions

View File

@ -60,6 +60,16 @@ def get_by_dnsname(dnsname):
return database.get(Endpoint, dnsname, field='dnsname')
def get_by_dnsname_and_port(dnsname, port):
"""
Retrieves and endpoint by it's dnsname and port.
:param dnsname:
:param port:
:return:
"""
return Endpoint.query.filter(Endpoint.dnsname == dnsname).filter(Endpoint.port == port).scalar()
def get_by_source(source_label):
"""
Retrieves all endpoints for a given source.