From 004b24186bd2f0bb5a1ca2ea53648f529c88940c Mon Sep 17 00:00:00 2001 From: Teo Voinea Date: Wed, 8 Feb 2023 18:53:28 +0000 Subject: [PATCH 1/2] Add new command --- src/cli/onefuzz/api.py | 9 +++++++++ src/pytypes/onefuzztypes/requests.py | 1 + 2 files changed, 10 insertions(+) diff --git a/src/cli/onefuzz/api.py b/src/cli/onefuzz/api.py index d241284c8a..a276069cbd 100644 --- a/src/cli/onefuzz/api.py +++ b/src/cli/onefuzz/api.py @@ -859,6 +859,15 @@ def list( data=requests.NotificationSearch(container=container), ) + def get(self, notification_id: UUID_EXPANSION) -> List[models.Notification]: + """Get a notification""" + self.logger.debug("getting notification") + return self._req_model_list( + "GET", + models.Notification, + data=requests.NotificationSearch(notification_id=notification_id), + ) + class Tasks(Endpoint): """Interact with tasks""" diff --git a/src/pytypes/onefuzztypes/requests.py b/src/pytypes/onefuzztypes/requests.py index b2ceba3a44..f11f2255b7 100644 --- a/src/pytypes/onefuzztypes/requests.py +++ b/src/pytypes/onefuzztypes/requests.py @@ -52,6 +52,7 @@ class NotificationCreate(BaseRequest, NotificationConfig): class NotificationSearch(BaseRequest): container: Optional[List[Container]] + notification_id: Optional[UUID] class NotificationGet(BaseRequest): From 58fd2aacebc566c5ed5613d7bebbfda7fb8d82e4 Mon Sep 17 00:00:00 2001 From: Teo Voinea Date: Thu, 9 Feb 2023 14:42:09 +0000 Subject: [PATCH 2/2] lint --- src/cli/onefuzz/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/onefuzz/api.py b/src/cli/onefuzz/api.py index 3274cfb3e8..fe959391a0 100644 --- a/src/cli/onefuzz/api.py +++ b/src/cli/onefuzz/api.py @@ -867,7 +867,7 @@ def get(self, notification_id: UUID_EXPANSION) -> List[models.Notification]: models.Notification, data=requests.NotificationSearch(notification_id=notification_id), ) - + def migrate_jinja_to_scriban( self, dry_run: bool = False ) -> Union[