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