Modifying the way rotation works. (#629)

* Modifying the way rotation works.

* Adding docs.

* Fixing tests.
This commit is contained in:
kevgliss
2016-12-23 13:18:42 -08:00
committed by GitHub
parent f8279d6972
commit 46f8ebd136
6 changed files with 154 additions and 111 deletions

View File

@ -40,14 +40,24 @@ def get(endpoint_id):
return database.get(Endpoint, endpoint_id)
def get_by_dnsname(endpoint_dnsname):
def get_by_name(name):
"""
Retrieves an endpoint given it's name.
:param endpoint_dnsname:
:param name:
:return:
"""
return database.get(Endpoint, endpoint_dnsname, field='dnsname')
return database.get(Endpoint, name, field='name')
def get_by_dnsname(dnsname):
"""
Retrieves an endpoint given it's name.
:param dnsname:
:return:
"""
return database.get(Endpoint, dnsname, field='dnsname')
def get_by_source(source_label):
@ -59,6 +69,15 @@ def get_by_source(source_label):
return Endpoint.query.filter(Endpoint.source.label == source_label).all() # noqa
def get_all_pending_rotation():
"""
Retrieves all endpoints which have certificates deployed
that have been replaced.
:return:
"""
return Endpoint.query.filter(Endpoint.replaced.any()).all()
def create(**kwargs):
"""
Creates a new endpoint.