From 426aa931a34748ddac79cb13c27de301028b5761 Mon Sep 17 00:00:00 2001 From: Dmitry Duev Date: Thu, 30 Sep 2021 09:50:11 -0700 Subject: [PATCH] update sp annotation endpoint (#146) --- kowalski/alert_broker.py | 7 +++++-- kowalski/performance_reporter.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/kowalski/alert_broker.py b/kowalski/alert_broker.py index 0fca2c74..c199b05b 100644 --- a/kowalski/alert_broker.py +++ b/kowalski/alert_broker.py @@ -1002,7 +1002,9 @@ def alert_post_annotations(self, alert: Mapping, passed_filters: Sequence): self.verbose > 1, ): response = self.api_skyportal( - "POST", "/api/annotation", annotations + "POST", + f"/api/sources/{alert['objectId']}/annotations", + annotations, ) if response.json()["status"] == "success": log(f"Posted {alert['objectId']} annotation to SkyPortal") @@ -1065,7 +1067,8 @@ def alert_put_annotations(self, alert: Mapping, passed_filters: Sequence): ): response = self.api_skyportal( "PUT", - f"/api/annotation/{existing_annotations[origin]['annotation_id']}", + f"/api/sources/{alert['objectId']}" + f"/annotations/{existing_annotations[origin]['annotation_id']}", annotations, ) if response.json()["status"] == "success": diff --git a/kowalski/performance_reporter.py b/kowalski/performance_reporter.py index 2941583c..da62277f 100644 --- a/kowalski/performance_reporter.py +++ b/kowalski/performance_reporter.py @@ -50,7 +50,7 @@ "Alert Submission": "Submitting alert", "Get ZTF Instrument Id": "Getting ZTF instrument_id from SkyPortal", "Get Source Groups Info": "Getting source groups info on", - "Get Group Info": "Getting info on group", + # "Get Group Info": "Getting info on group", } skyportal_actions = [ @@ -65,7 +65,7 @@ "Post Thumbnail", "Get ZTF Instrument Id", "Get Source Groups Info", - "Get Group Info", + # "Get Group Info", ]