Refactor create/start job

This commit is contained in:
Andrew Shumway
2024-05-14 09:11:19 -06:00
parent 8a6802be8f
commit 013154d5cf
4 changed files with 49 additions and 38 deletions

View File

@@ -37,11 +37,10 @@ class NotificationApiClient(NotifyAdminAPIClient):
# we do not want in our logs, so we do a POST request instead of a GET
method = self.post if to else self.get
kwargs = {"data": params} if to else {"params": params}
if job_id:
return method(
url="/service/{}/job/{}/notifications".format(service_id, job_id),
**kwargs
**kwargs,
)
else:
if limit_days is not None:
@@ -100,5 +99,8 @@ class NotificationApiClient(NotifyAdminAPIClient):
url="/service/{}/job/{}/notification_count".format(service_id, job_id)
)["count"]
def get_total_notification_message_parts_by_job_id(self, job_id):
return self.get(url="/notifications/{}".format(job_id))
notification_api_client = NotificationApiClient()