import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { RPCService } from '@loafer/ng-rpc';
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
import { Domain } from '@overflow/commons-typescript/model/domain';


@Injectable()
export class ProbeHostService {

  public constructor(
    private rpcService: RPCService,
  ) {

  }

  public read(id: number): Observable<ProbeHost> {
    return this.rpcService.call<ProbeHost>('ProbeHostService.read', id);
  }

  public readByProbeID(probeID: number): Observable<Probe> {
    return this.rpcService.call<ProbeHost>('ProbeHostService.readByProbeID', probeID);
  }

  public readAllByDomainID(domainID: number): Observable<ProbeHost[]> {
    return this.rpcService.call<ProbeHost[]>('ProbeHostService.readAllByDomainID', domainID);
  }

}
