2018-04-25 09:04:47 +00:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { Observable } from 'rxjs/Observable';
|
|
|
|
import 'rxjs/add/operator/map';
|
|
|
|
import { RPCService } from '@loafer/ng-rpc/service';
|
2018-05-02 08:09:39 +00:00
|
|
|
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
|
|
|
|
import { Domain } from '@overflow/commons-typescript/model/domain';
|
2018-04-25 09:04:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class ProbeHostService {
|
|
|
|
|
|
|
|
public constructor(
|
|
|
|
private rpcService: RPCService,
|
|
|
|
) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public readByProbe(probe: Probe): Observable<Probe> {
|
2018-05-18 08:30:20 +00:00
|
|
|
return this.rpcService.call<ProbeHost>('ProbeHostService.readByProbe', probe);
|
2018-04-25 09:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public readAllByDomain(domain: Domain): Observable<ProbeHost[]> {
|
|
|
|
return this.rpcService.call<ProbeHost[]>('ProbeHostService.readAllByDomain', domain);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|