2018-04-06 11:02:18 +00:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { Observable } from 'rxjs/Observable';
|
|
|
|
|
|
|
|
import 'rxjs/add/operator/map';
|
|
|
|
|
|
|
|
import { RPCService } from '@loafer/ng-rpc/service';
|
|
|
|
|
|
|
|
import { Domain } from 'packages/domain/model';
|
|
|
|
|
|
|
|
import { Probe } from '../model';
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class ProbeService {
|
|
|
|
|
|
|
|
public constructor(
|
|
|
|
private rpcService: RPCService,
|
|
|
|
) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public readAllByDomain(domain: Domain): Observable<Probe[]> {
|
|
|
|
return this.rpcService.call<Probe[]>('ProbeService.readAllByDomain', domain);
|
|
|
|
}
|
|
|
|
|
|
|
|
public read(id: string): Observable<Probe> {
|
|
|
|
return this.rpcService.call<Probe>('ProbeService.read', id);
|
|
|
|
}
|
2018-04-25 09:04:47 +00:00
|
|
|
|
2018-04-27 07:31:27 +00:00
|
|
|
public modify(probe: Probe): Observable<Probe> {
|
|
|
|
return this.rpcService.call<Probe>('ProbeService.modify', probe);
|
|
|
|
}
|
|
|
|
|
2018-04-29 10:43:14 +00:00
|
|
|
public remove(id: string): Observable<boolean> {
|
|
|
|
return this.rpcService.call<boolean>('ProbeService.remove', id);
|
|
|
|
}
|
|
|
|
|
2018-05-02 03:59:45 +00:00
|
|
|
public modifyDisplayName(id: string, displayName: string): Observable<Probe> {
|
|
|
|
return this.rpcService.call<Probe>('ProbeService.modifyDisplayName', id, displayName);
|
|
|
|
}
|
|
|
|
|
2018-04-06 11:02:18 +00:00
|
|
|
}
|