Add LowCollector & rename Supervisor to Monitoring
[src/xds/xds-agent.git] / webapp / src / app / @core-xds / services / xdsagent.service.ts
index adbee98..35abe46 100644 (file)
@@ -1,6 +1,6 @@
 /**
 * @license
-* Copyright (C) 2017-2018 "IoT.bzh"
+* Copyright (C) 2017-2019 "IoT.bzh"
 * Author Sebastien Douheret <sebastien@iot.bzh>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -665,6 +665,36 @@ export class XDSAgentService {
       { cols: cols, rows: rows });
   }
 
+  /***
+  ** Monitoring
+  ***/
+  getTopoMonitoring(): Observable<any> {
+    return this._get('/monitoring/topo');
+  }
+
+  startTraceMonitoring(cfg: any): Observable<any> {
+    return this._post('/monitoring/trace/start', cfg);
+  }
+
+  stopTraceMonitoring(cfg: any): Observable<any> {
+    return this._post('/monitoring/trace/stop', cfg);
+  }
+
+  /***
+   ** AGL Low Collector
+   ***/
+  startLowCollector(cfg: any): Observable<any> {
+    return this._post('/monitoring/alc/start', cfg);
+  }
+
+  stopLowCollector(): Observable<any> {
+    return this._post('/monitoring/alc/stop', {});
+  }
+
+  resetLowCollector(): Observable<any> {
+    return this._post('/monitoring/alc/reset', {});
+  }
+
   /**
   ** Private functions
   ***/
@@ -677,7 +707,7 @@ export class XDSAgentService {
         error => {
           this.alert.error('ERROR while registering to all events: ' + error);
         },
-    );
+      );
   }
 
   private _getServer(ID: string): IXDServerCfg {