src/app/workflow/shared/workflow.service.ts
Methods |
|
Public get |
get(clusterName: string, workflowName: string)
|
Returns :
any
|
Public getAll | ||||||
getAll(clusterName: string)
|
||||||
Parameters :
Returns :
any
|
Public resume |
resume(clusterName: string, workflowName: string)
|
Returns :
any
|
Public stop |
stop(clusterName: string, workflowName: string)
|
Returns :
any
|
Public can |
can()
|
Inherited from
HelixService
|
Defined in
HelixService:14
|
Returns :
Observable<any>
|
Protected delete | ||||||
delete(path: string)
|
||||||
Inherited from
HelixService
|
||||||
Defined in
HelixService:48
|
||||||
Parameters :
Returns :
Observable<any>
|
Protected errorHandler | ||||||
errorHandler(error: any)
|
||||||
Inherited from
HelixService
|
||||||
Defined in
HelixService:68
|
||||||
Parameters :
Returns :
any
|
Protected getHeaders |
getHeaders()
|
Inherited from
HelixService
|
Defined in
HelixService:61
|
Returns :
any
|
Protected getHelixKey |
getHelixKey()
|
Inherited from
HelixService
|
Defined in
HelixService:56
|
Returns :
string
|
Protected post |
post(path: string, data: any)
|
Inherited from
HelixService
|
Defined in
HelixService:32
|
Returns :
Observable<any>
|
Protected put |
put(path: string, data: string)
|
Inherited from
HelixService
|
Defined in
HelixService:40
|
Returns :
Observable<any>
|
Protected request |
request(path: string, helix?: string)
|
Inherited from
HelixService
|
Defined in
HelixService:20
|
Returns :
Observable<any>
|
import { map } from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { Workflow } from './workflow.model';
import { HelixService } from '../../core/helix.service';
@Injectable()
export class WorkflowService extends HelixService {
public getAll(clusterName: string) {
return this.request(`/clusters/${clusterName}/workflows`).pipe(
map((data) => data.Workflows.sort())
);
}
public get(clusterName: string, workflowName: string) {
return this.request(
`/clusters/${clusterName}/workflows/${workflowName}`
).pipe(map((data) => new Workflow(data, clusterName)));
}
public stop(clusterName: string, workflowName: string) {
return this.post(
`/clusters/${clusterName}/workflows/${workflowName}?command=stop`,
null
);
}
public resume(clusterName: string, workflowName: string) {
return this.post(
`/clusters/${clusterName}/workflows/${workflowName}?command=resume`,
null
);
}
}