* ========================LICENSE_END===================================
*/
import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
+import { HttpClient, HttpParams } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { HttpErrorResponse } from '@angular/common/http';
})
};
+ private basePath = 'api/admin/';
+
constructor(private httpClient: HttpClient) {
// this.loadConfig();
// this.getLoad();
return Math.round((Math.random() * (20 - 0)) + 0);
}
+ // Gets xApp metrics kibana url for the named application
+ getAppMetricsUrl(appName: string) {
+ return this.httpClient.get(this.basePath + 'metrics', {
+ params: new HttpParams()
+ .set('app', appName)
+ });
+ }
+
saveConfig(key: string, value: string) {
if (key === 'jsonURL') {
this.baseJSONServerUrl = value;
this.delayMax = res[5].value;
this.loadMax = res[6].value;
},
- (err: HttpErrorResponse) => {
- console.log (err.message);
+ (her: HttpErrorResponse) => {
+ console.log ('loadConfig failed: ' + her.message);
});
}
}