import { Http } from "@angular/http"; import { Observable } from "rxjs"; import "rxjs/add/observable/of"; import { IServiceConfig } from "../service.config"; import { ReplicationJob, ReplicationRule } from "./interface"; import { RequestQueryParams } from "./RequestQueryParams"; /** * Define the service methods to handle the replication (rule and job) related things. * ** * @abstract * class ReplicationService */ export declare abstract class ReplicationService { /** * Get the replication rules. * Set the argument 'projectId' to limit the data scope to the specified project; * set the argument 'ruleName' to return the rule only match the name pattern; * if pagination needed, use the queryParams to add query parameters. * * @abstract * ** deprecated param {(number | string)} [projectId] * ** deprecated param {string} [ruleName] * ** deprecated param {RequestQueryParams} [queryParams] * returns {(Observable | Promise | ReplicationRule[])} * * @memberOf ReplicationService */ abstract getReplicationRules(projectId?: number | string, ruleName?: string, queryParams?: RequestQueryParams): Observable | Promise | ReplicationRule[]; /** * Get the specified replication rule. * * @abstract * ** deprecated param {(number | string)} ruleId * returns {(Observable | Promise | ReplicationRule)} * * @memberOf ReplicationService */ abstract getReplicationRule(ruleId: number | string): Observable | Promise | ReplicationRule; /** * Create new replication rule. * * @abstract * ** deprecated param {ReplicationRule} replicationRule * returns {(Observable | Promise | any)} * * @memberOf ReplicationService */ abstract createReplicationRule(replicationRule: ReplicationRule): Observable | Promise | any; /** * Update the specified replication rule. * * @abstract * ** deprecated param {ReplicationRule} replicationRule * returns {(Observable | Promise | any)} * * @memberOf ReplicationService */ abstract updateReplicationRule(id: number, rep: ReplicationRule): Observable | Promise | any; /** * Delete the specified replication rule. * * @abstract * ** deprecated param {(number | string)} ruleId * returns {(Observable | Promise | any)} * * @memberOf ReplicationService */ abstract deleteReplicationRule(ruleId: number | string): Observable | Promise | any; /** * Enable the specified replication rule. * * @abstract * ** deprecated param {(number | string)} ruleId * returns {(Observable | Promise | any)} * * @memberOf ReplicationService */ abstract enableReplicationRule(ruleId: number | string, enablement: number): Observable | Promise | any; /** * Disable the specified replication rule. * * @abstract * ** deprecated param {(number | string)} ruleId * returns {(Observable | Promise | any)} * * @memberOf ReplicationService */ abstract disableReplicationRule(ruleId: number | string): Observable | Promise | any; abstract replicateRule(ruleId: number | string): Observable | Promise | any; /** * Get the jobs for the specified replication rule. * Set query parameters through 'queryParams', support: * - status * - repository * - startTime and endTime * - page * - pageSize * * @abstract * ** deprecated param {(number | string)} ruleId * ** deprecated param {RequestQueryParams} [queryParams] * returns {(Observable | Promise | ReplicationJob)} * * @memberOf ReplicationService */ abstract getJobs(ruleId: number | string, queryParams?: RequestQueryParams): Observable | Promise | ReplicationJob; /** * Get the log of the specified job. * * @abstract * ** deprecated param {(number | string)} jobId * returns {(Observable | Promise | string)} * @memberof ReplicationService */ abstract getJobLog(jobId: number | string): Observable | Promise | string; abstract stopJobs(jobId: number | string): Observable | Promise | string; } /** * Implement default service for replication rule and job. * ** * class ReplicationDefaultService * extends {ReplicationService} */ export declare class ReplicationDefaultService extends ReplicationService { private http; _ruleBaseUrl: string; _jobBaseUrl: string; _replicateUrl: string; constructor(http: Http, config: IServiceConfig); _isValidRule(rule: ReplicationRule): boolean; getReplicationRules(projectId?: number | string, ruleName?: string, queryParams?: RequestQueryParams): Observable | Promise | ReplicationRule[]; getReplicationRule(ruleId: number | string): Observable | Promise | ReplicationRule; createReplicationRule(replicationRule: ReplicationRule): Observable | Promise | any; updateReplicationRule(id: number, rep: ReplicationRule): Observable | Promise | any; deleteReplicationRule(ruleId: number | string): Observable | Promise | any; replicateRule(ruleId: number | string): Observable | Promise | any; enableReplicationRule(ruleId: number | string, enablement: number): Observable | Promise | any; disableReplicationRule(ruleId: number | string): Observable | Promise | any; getJobs(ruleId: number | string, queryParams?: RequestQueryParams): Observable | Promise | ReplicationJob; getJobLog(jobId: number | string): Observable | Promise | string; stopJobs(jobId: number | string): Observable | Promise | any; }