import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { RPCService } from '@loafer/ng-rpc'; import { Infra } from '@overflow/commons-typescript/model/infra'; import { Host, Service } from '@overflow/commons-typescript'; @Injectable() export class InfraService { public constructor( private rpcService: RPCService, ) { } public regist(infra: Infra): Observable { return this.rpcService.call('InfraService.regist', infra); } public registDiscoverd(probeID: number, hosts: Host[], services: Service[]): Observable { return this.rpcService.call('InfraService.registDiscoverd', probeID, hosts, services); } public read(id: string): Observable { return this.rpcService.call('InfraService.read', id); } public readAllByProbeID(probeID: number): Observable { return this.rpcService.call('InfraService.readAllByProbeID', probeID); } public readAllByDomainID(domainID: number): Observable { return this.rpcService.call('InfraService.readAllByDomainID', domainID); } public readAllInfraZoneByProbeDomainID(probeDomainID: number): Observable { return this.rpcService.call('InfraService.readAllInfraZoneByProbeDomainID', probeDomainID); } public readAllByMetaInfraTypeKeyAndProbeID(metaInfraTypeKey: string, probeID: number): Observable { return this.rpcService.call('InfraService.readAllByMetaInfraTypeKeyAndProbeID', metaInfraTypeKey, probeID); } }