Adding pending certificate metric. (#473)
This commit is contained in:
@ -188,6 +188,25 @@ class VerisignIssuerPlugin(IssuerPlugin):
|
||||
response = self.session.post(url, headers={'content-type': 'application/x-www-form-urlencoded'})
|
||||
return handle_response(response.content)['Response']['Order']
|
||||
|
||||
def get_pending_certificates(self):
|
||||
"""
|
||||
Uses Verisign to fetch the number of certificate awaiting approval.
|
||||
|
||||
:return:
|
||||
"""
|
||||
url = current_app.config.get("VERISIGN_URL") + '/reportingws'
|
||||
|
||||
end = arrow.now()
|
||||
start = end.replace(days=-7)
|
||||
data = {
|
||||
'reportType': 'summary',
|
||||
'certProductType': 'Server',
|
||||
'startDate': start.format("MM/DD/YYYY"),
|
||||
'endDate': end.format("MM/DD/YYYY"),
|
||||
}
|
||||
response = self.session.post(url, data=data)
|
||||
return response.json()['certificateSummary'][0]['Pending']
|
||||
|
||||
|
||||
class VerisignSourcePlugin(SourcePlugin):
|
||||
title = 'Verisign'
|
||||
|
Reference in New Issue
Block a user