2018-04-25 09:04:47 +00:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { Observable } from 'rxjs/Observable';
|
|
|
|
import 'rxjs/add/operator/map';
|
2018-05-24 06:44:13 +00:00
|
|
|
import { RPCService } from '@loafer/ng-rpc';
|
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,
|
|
|
|
) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-05-24 10:50:43 +00:00
|
|
|
public readByProbeID(probeID: number): Observable<Probe> {
|
|
|
|
return this.rpcService.call<ProbeHost>('ProbeHostService.readByProbeID', probeID);
|
2018-04-25 09:04:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-24 10:50:43 +00:00
|
|
|
public readAllByDomainID(domainID: number): Observable<ProbeHost[]> {
|
|
|
|
return this.rpcService.call<ProbeHost[]>('ProbeHostService.readAllByDomainID', domainID);
|
|
|
|
}
|
|
|
|
|
|
|
|
public read(id: number): Observable<ProbeHost> {
|
|
|
|
return this.rpcService.call<ProbeHost>('ProbeHostService.read', id);
|
2018-04-25 09:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|