1 import { Injectable } from '@angular/core';
2 import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
3 import { Observable,throwError } from 'rxjs'
4 import { timer, Subscription, pipe } from 'rxjs';
5 import { switchMap } from 'rxjs/operators';
7 import { delay } from 'rxjs/operators';
8 import { Serverroom } from './serverroom';
10 import { nodeDetails, podDetails, nodesDropDownDetails, serviceDetails } from './../app/datainterface';
13 import { retry,catchError } from 'rxjs/operators';
14 import { Edgeserver } from './edgeserver';
15 import { v4 as uuid } from 'uuid';
22 export class MyserviceService {
25 private baseUrl = 'http://localhost:8080/';
27 private _url = './../assets/data/post.json';
28 private nodes_url = './../assets/data/nodes.json';
29 private pods_url = './../assets/data/pods.json';
31 private nodes_array_url = './../assets/data/nodesdrop.json';
33 private services_url = './../assets/data/services.json';
35 private rooomDataUrl= this.baseUrl+'tempstatus';
36 private uuidUrl= this.baseUrl+'uuid';
37 private nodesUrl = this.baseUrl+'getnodes';
38 private podsUrl = this.baseUrl+'getpods';
39 private servicesUrl = this.baseUrl+'getservices';
40 private postRoom= this.baseUrl+'settemplimit';
43 constructor(private http:HttpClient) {
47 headers: new HttpHeaders({
48 'Content-Type':'application/json'
56 return this.http.get<any>(this.uuidUrl);
59 getRoomData(): Observable<any> {
60 return this.http.get<any>(this.rooomDataUrl);
63 getRoomDa(): Observable<any> {
66 switchMap(_ => this.http.get(this.rooomDataUrl)),
70 getNodesInfoo(): Observable<nodeDetails> {
71 return this.http.get<nodeDetails>(this.nodesUrl);
74 getPodsInfo(selectedVal: any): Observable<podDetails> {
75 return this.http.get<podDetails>(this.podsUrl, {params: selectedVal} );
78 getNodesArray(): Observable<nodesDropDownDetails> {
79 return this.http.get<nodesDropDownDetails>(this.nodes_array_url);
82 getServicesInfo(): Observable<serviceDetails> {
83 return this.http.get<serviceDetails>(this.servicesUrl );