File

src/app/workflow/shared/workflow.service.ts

Extends

HelixService

Index

Methods

Methods

Public get
get(clusterName: string, workflowName: string)
Parameters :
Name Type Optional
clusterName string No
workflowName string No
Returns : any
Public getAll
getAll(clusterName: string)
Parameters :
Name Type Optional
clusterName string No
Returns : any
Public resume
resume(clusterName: string, workflowName: string)
Parameters :
Name Type Optional
clusterName string No
workflowName string No
Returns : any
Public stop
stop(clusterName: string, workflowName: string)
Parameters :
Name Type Optional
clusterName string No
workflowName string No
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 :
Name Type Optional
path string No
Returns : Observable<any>
Protected errorHandler
errorHandler(error: any)
Inherited from HelixService
Defined in HelixService:68
Parameters :
Name Type Optional
error any No
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
Parameters :
Name Type Optional
path string No
data any No
Returns : Observable<any>
Protected put
put(path: string, data: string)
Inherited from HelixService
Defined in HelixService:40
Parameters :
Name Type Optional
path string No
data string No
Returns : Observable<any>
Protected request
request(path: string, helix?: string)
Inherited from HelixService
Defined in HelixService:20
Parameters :
Name Type Optional
path string No
helix string Yes
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
    );
  }
}

results matching ""

    No results matching ""