aboutsummaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/onboard.service.ts
blob: 6ab1e2821f37e91f3ffc6b8e6b7499719ff94427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { onboardTableData, onboardDataVNF, onboardDataPNF } from './dataInterface';

@Injectable()
export class onboardService {
  constructor(private http: HttpClient) { }
  /* location */
  // baseUrl = "./assets/json";
  // url = {
  //   // 数据列表
  //   onboardTableData: this.baseUrl + "/onboard-vnf-mf/onboardTableData.json",
  //   onboardDataVNF: this.baseUrl + "/onboard-vnf-mf/onboardDataVNF.json",
  //   onboardDataPNF: this.baseUrl + "/onboard-vnf-mf/onboardDataPNF.json",
  //   //ns sdc
  //   sdc_nsListData: this.baseUrl + "/onboard-vnf-mf/listData/SDC_NS.json",
  //   // vnf sdc
  //   sdc_vnfListData: this.baseUrl + "/onboard-vnf-mf/listData/SDC_VNF.json",


  //   //创建nspackages
  //   creatensData: this.baseUrl + "/onboard-vnf-mf/_jsonData.json",

  //   //onboard ns sdc data 
  //   onboardNs: this.baseUrl + "/onboard-vnf-mf/listData/onboardNs.json",
  //   //onboard VNF sdc data 
  //   onboardVNF: this.baseUrl + "/onboard-vnf-mf/listData/onboardVNF.json",

  //   // Delete ns package
  //   deleteNspack: this.baseUrl + "/onboard-vnf-mf/listData/deleteNspack.json",
  //   // Delete ns sdc package
  //   // deleteNssdcData: this.baseUrl + "/onboard-vnf-mf/listData/deleteNssdcData.json",

  //   // Delete Vnf vfc package 
  //   deleteVnfPack: this.baseUrl + "/onboard-vnf-mf/listData/deleteVnfPack.json",
  //   // Delete Vnf sdc package
  //   // deleteVnfsdcData: this.baseUrl + "/onboard-vnf-mf/listData/deleteVnfsdcData.json",

  //   // Delete Pnf package
  //   deletePnfPack: this.baseUrl + "/onboard-vnf-mf/listData/deletePnfPack.json",

  //   // // download ns package
  //   // downloadNsData: this.baseUrl + "/downloadData.json",
  //   // //download vnf package 
  //   // downloadVnfData: this.baseUrl + "/listData/downloadVnfData.json"

  // }

  //---------------------------------------------------------------------------------------
  /* line up 线上*/
  baseUrl = "/api/usecaseui-server/v1/uui-lcm/";
  url = {
    // 数据列表Data
    onboardTableData: this.baseUrl + "ns-packages",
    onboardDataVNF: this.baseUrl + "vnf-packages",
    onboardDataPNF: this.baseUrl + "pnf-packages",
    //ns sdc
    sdc_nsListData: this.baseUrl + "sdc-ns-packages", // GET
    // vnf sdc
    sdc_vnfListData: this.baseUrl + "sdc-vf-packages", // GET

    // createnspackages ? TODO
    creatensData: this.baseUrl + "_jsonData", //POST

    // onboard ns sdc data 
    onboardNs: this.baseUrl + "ns-packages", //POST
    //onboard VNF sdc data 
    onboardVNF: this.baseUrl + "vf-packages", //POST

    //Delete ns package
    deleteNspack: this.baseUrl + "deleteNsdPackage?nsdInfoId=",  
    // Delete Vnf vfc package 
    deleteVnfPack: this.baseUrl + "deleteVnfPackage?vnfPkgId=",  
    // Delete Pnf package
    deletePnfPack: this.baseUrl + "deletePnfPackage?pnfdInfoId=",

    //进度接口
    progress: this.baseUrl + "jobs/" + "_jobId" + "?responseId="


    // // download ns package
    // downloadNsData: this.baseUrl + "downLoadNsPackage?nsdInfoId=XXXXX",
    // //download vnf package 
    // downloadVnfData: this.baseUrl + "downLoadVnfPackage?vnfPkgId=XXXXX"

  }

  //-----------------------------------Function-local-start------------------------------------------------------
  /* Query data list */
  // NS Data
  getOnboardTableData() {
    // return this.http.get<any>(this.url.onboardTableData);
    return this.http.get<any>(this.url["onboardTableData"]);
  }
  // NS SDC Data
  getSDC_NSTableData(){
    // return this.http.get<any>(this.url.sdc_nsListData);
    return this.http.get<any>(this.url["sdc_nsListData"]);
  }
  // VNF Data
  getOnboardTableVnfData() {
    return this.http.get<any>(this.url.onboardDataVNF);
  }
  // onboard VNF sdc Data
  getSDC_VNFTableData() {
    return this.http.get<any>(this.url["sdc_vnfListData"]);
  }
  
  // PNF Data
  getOnboardTablePnfData() {
    return this.http.get<any>(this.url.onboardDataPNF);
  }
  //-------------------------------------------------------------------------------------

  //create--Get the id after dragging the file before uploading   //on-line post
  getCreatensData(url_upId,requestBody) {
    return this.http.post<any>(this.url.creatensData.replace("_jsonData",url_upId),requestBody);  //on-line
  }

  //create--Get the id after dragging the file before uploading  //local json get
  // getCreatensData(url_upId) {
  //   return this.http.get<any>(this.url.creatensData.replace("_jsonData", url_upId));
  // }

  //------------------------------------------------------------------------------
  //onboard sdc ns 
  getNsonboard(requestBody) {
    return this.http.post<any>(this.url["onboardNs"], requestBody);
  }
  //onboard sdc vnf
  getVnfonboard(requestBody) {
    return this.http.post<any>(this.url["onboardVNF"], requestBody);
  }

  //onboard progress
  getProgress(jobid, responseId) {
    let url = this.url.progress.replace("_jobId", jobid) + responseId;
    return this.http.get<any>(url);
  }
  //--------------------------------------------------------------------------
  // Delete ns vfc package
  deleteNsIdData(paramsObj) {
    // local test 
    // return this.http.get<any>(this.url.deleteNspack);
    // Online test
    return this.http.delete<any>(this.url.deleteNspack + paramsObj);
  }

  // Delete Vnf vfc package
  deleteVnfIdData(paramsObj) {
    // return this.http.get<any>(this.url.deleteVnfPack);
    //online test
    return this.http.delete<any>(this.url.deleteVnfPack + paramsObj);
  }

  // Delete Pnf package
  deletePnfIdData(paramsObj){
    //Local test
    // return this.http.get<any>(this.url.deletePnfPack); 
    //online test
    return this.http.delete<any>(this.url.deletePnfPack + paramsObj);
  }

  //---------------------------------Function-end-------------------------------------------  

}