blob: 7d31c6f7ca77a6ee13051e286dbb00f285ef8f88 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001import {Injectable} from "@angular/core";
2import {HttpClient} from "@angular/common/http";
3import {Observable} from "rxjs";
4import {Constants} from "../../utils/constants";
5import {ServiceInstance} from "../../models/serviceInstance";
6
7@Injectable()
8export class MsoService {
9 httpClient: HttpClient;
10
11 constructor(http: HttpClient) {
12 this.httpClient = http;
13 }
14
15
16 public submitMsoTask(instanceFields): Observable<any> {
17 let path = Constants.Path.SERVICES_JOB_INFO_PATH + '/bulk';
18 return this.httpClient.post(path, instanceFields);
19 }
20
21 public retryMsoTask(jobId: string): Observable<any> {
22 let pathQuery = Constants.Path.SERVICES_JOB_INFO_PATH + '/retry/' + jobId;
23 return this.httpClient.post<any>(pathQuery, null);
24 }
25
26 public retryBulkMsoTask(jobId: string, instanceFields: ServiceInstance): Observable<any> {
27 let pathQuery = Constants.Path.SERVICES_JOB_INFO_PATH + '/retryJobWithChangedData/'+ jobId;
28 return this.httpClient.post<any>(pathQuery, instanceFields);
29 }
30
31 public createVnf(requestDetails, serviceInstanceId): Observable<any> {
32 let pathQuery: string = Constants.Path.MSO_CREATE_VNF_INSTANCE + serviceInstanceId;
33
34 return this.httpClient.post( pathQuery, {
35 requestDetails : requestDetails
36 });
37 }
38}