mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-23 20:01:01 -05:00
The Notify API client changed in version 4 to take two arguments, not three (service ID was removed in favour of the combined API key). This gets a bit gnarly because the API key has to be at least a certain length so it can be substringed internally.
18 lines
476 B
Python
18 lines
476 B
Python
|
|
from app.notify_client import NotifyAdminAPIClient
|
|
|
|
|
|
class StatusApiClient(NotifyAdminAPIClient):
|
|
def __init__(self):
|
|
super().__init__("a" * 73, "b")
|
|
|
|
def init_app(self, app):
|
|
self.base_url = app.config['API_HOST_NAME']
|
|
self.api_key = '{}-{}'.format(
|
|
app.config['ADMIN_CLIENT_USER_NAME'],
|
|
app.config['ADMIN_CLIENT_SECRET'],
|
|
)
|
|
|
|
def get_status(self, *params):
|
|
return self.get(url='/_status', *params)
|