Skip to content

Commit

Permalink
update sp annotation endpoint (skyportal#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryduev authored Sep 30, 2021
1 parent fc02229 commit 426aa93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions kowalski/alert_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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":
Expand Down
4 changes: 2 additions & 2 deletions kowalski/performance_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -65,7 +65,7 @@
"Post Thumbnail",
"Get ZTF Instrument Id",
"Get Source Groups Info",
"Get Group Info",
# "Get Group Info",
]


Expand Down

0 comments on commit 426aa93

Please sign in to comment.