30 lines
723 B
TypeScript
30 lines
723 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs/Observable';
|
|
|
|
import 'rxjs/add/operator/map';
|
|
|
|
import { RPCClient } from 'packages/core/rpc/client/RPCClient';
|
|
|
|
import { Infra } from '../model';
|
|
import { Page } from '../../../app/commons/model';
|
|
import { Domain } from '../../domain/model';
|
|
import { Probe } from '../../probe/model';
|
|
|
|
@Injectable()
|
|
export class InfraService {
|
|
|
|
public constructor(
|
|
private rpcClient: RPCClient,
|
|
) {
|
|
|
|
}
|
|
|
|
public readByDomain(domain: Domain): Observable<Page> {
|
|
return this.rpcClient.call<Page>('InfraService.', domain);
|
|
}
|
|
|
|
public readByProbe(probe: Probe): Observable<Page> {
|
|
return this.rpcClient.call<Page>('InfraService.', probe);
|
|
}
|
|
}
|