X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=blueprints%2Fcommon%2Feliot-ui%2Ffrontend-src%2Fsrc%2Fapp%2Feliotservice.service.ts;fp=blueprints%2Fcommon%2Feliot-ui%2Ffrontend-src%2Fsrc%2Fapp%2Feliotservice.service.ts;h=0000000000000000000000000000000000000000;hb=434326c60fb0434bda587102b4746173fe425dea;hp=0695108c0d07f656407f952aa825e0f096a0ca41;hpb=37827e492060182b32df67c2a538a29808fa5e17;p=eliot.git diff --git a/blueprints/common/eliot-ui/frontend-src/src/app/eliotservice.service.ts b/blueprints/common/eliot-ui/frontend-src/src/app/eliotservice.service.ts deleted file mode 100644 index 0695108..0000000 --- a/blueprints/common/eliot-ui/frontend-src/src/app/eliotservice.service.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { Observable,throwError } from 'rxjs' -import { timer, Subscription, pipe } from 'rxjs'; -import { switchMap } from 'rxjs/operators'; -// import {Http, ResponseContentType} from '@angular/http'; - -import { delay } from 'rxjs/operators'; -import { Serverroom } from './serverroom'; - -import { nodeDetails, podDetails, nodesDropDownDetails, - serviceDetails, deploymentData, currentDeployInfo, - currentDeployDetails, dashboardInfo } from './datainterface'; - - -import { retry,catchError } from 'rxjs/operators'; -import { Edgeserver } from './edgeserver'; -import { v4 as uuid } from 'uuid'; - - - -@Injectable({ - providedIn: 'root' -}) -export class EliotserviceService { - - - private baseUrl = 'http://159.138.5.177:8080/'; - - private _url = './../assets/data/post.json'; - private nodes_url = './../assets/data/nodes.json'; - private pods_url = './../assets/data/pods.json'; - - private nodes_array_url = './../assets/data/nodesdrop.json'; - - private services_url = './../assets/data/services.json'; - private history_url = './../assets/data/history-test.json'; - private dashboard_url = './../assets/data/dashboard-test.json'; - - private rooomDataUrl= this.baseUrl+'tempstatus'; - private uuidUrl= this.baseUrl+'uuid'; - private nodesUrl = this.baseUrl+'getnodes'; - private podsUrl = this.baseUrl+'getpods'; - private servicesUrl = this.baseUrl+'getservices'; - private postRoom= this.baseUrl+'settemplimit'; - private packageUploadUrl = this.baseUrl+'upload' - private deployUrl = this.baseUrl+'deploy'; - private historyIdUrl = this.baseUrl+'history/files'; - private nodesArrayUrl = this.baseUrl+'nodesonly'; - - private historyUrl = this.baseUrl+'history'; - private dashboardUrl = this.baseUrl+'dashboard'; - - private roles_url = './../assets/data/roles.json'; - private current_deploy_url = './../assets/data/current-deploy.json'; - - - constructor(private http:HttpClient) { - } - - httpOptions = { - headers: new HttpHeaders({ - 'Content-Type':'application/json' - }) - } - genUUID() { - return uuid(); - } - - getUUID() { - return this.http.get(this.uuidUrl); - } - - getRoomData(): Observable { - return this.http.get(this.rooomDataUrl); - } - - getRoomDa(): Observable { - return timer(0, 4000) - .pipe( - switchMap(_ => this.http.get(this.rooomDataUrl)), - ); - } - - getNodesInfoo(): Observable { - return this.http.get(this.nodes_url); - } - - getPodsInfo(selectedVal: any): Observable { - return this.http.get(this.pods_url, {params: selectedVal} ); - } - - getNodesArray(): Observable { - return this.http.get(this.nodes_array_url); - } - - getServicesInfo(): Observable { - return this.http.get(this.servicesUrl ); - } - - getHistoryInfo(): Observable { - // return this.http.get(this.historyUrl); - return this.http.get(this.history_url); - } - - // removable code - getRoleName(): Observable { - return this.http.get(this.roles_url); - } - - getCurrentDeployInfo(): Observable{ - return this.http.get(this.current_deploy_url) - } - - // postDeploymentYaml(data): Observable { - // return this.http.get(this.servicesUrl ); - // } - - // post - - postHistoryId(data): Observable { - // return this.http.post(this.deployUrl, data); - return this.http.get(this.historyIdUrl, {params: data} ); - } - - postDeploymentPackage(data): Observable { - return this.http.post(this.packageUploadUrl, data); - // return this.http - // .post(this.deployUrl, - // data, { - // headers: { - // 'Content-Type': 'multipart/form-data' - // } - // } - // ); - } - - - postDeployRequest(data,nodeData): Observable { - debugger; - return this.http.post(this.deployUrl, data, nodeData); - } - - getDashboardData(): Observable { - return this.http.get(this.dashboard_url); - } - - - -} -