Fixing Prometheus Backup path 97/10797/2
authorsousaedu <eduardo.sousa@canonical.com>
Thu, 13 May 2021 12:30:25 +0000 (14:30 +0200)
committersousaedu <eduardo.sousa@canonical.com>
Thu, 13 May 2021 12:49:25 +0000 (14:49 +0200)
Change-Id: I8781f059506c31e37b5f3134e2230d21aced5719
Signed-off-by: sousaedu <eduardo.sousa@canonical.com>
installers/charm/prometheus/src/charm.py

index e71d949..5fdee72 100755 (executable)
@@ -112,13 +112,13 @@ class PrometheusCharm(CharmedOsmBase):
         self.prometheus.publish_info(self.app.name, PORT)
 
     def _on_backup_action(self, event: EventBase) -> NoReturn:
-        url = f"http://{self.model.app.name}:{PORT}/api/v2/admin/tsdb/snapshot"
+        url = f"http://{self.model.app.name}:{PORT}/api/v1/admin/tsdb/snapshot"
         result = requests.post(url)
 
         if result.status_code == 200:
             event.set_results({"backup-name": result.json()["name"]})
         else:
-            event.fail(f"status-code: {result.status_code}, result: {result.json()}")
+            event.fail(f"status-code: {result.status_code}")
 
     def _build_files(self, config: ConfigModel):
         files_builder = FilesV3Builder()