summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/onboard.service.ts
diff options
context:
space:
mode:
authorzhangab <zhanganbing@chinamobile.com>2018-11-07 18:44:26 +0800
committerzhangab <zhanganbing@chinamobile.com>2018-11-07 18:44:51 +0800
commit5068ef4e733342d03d30ad895e5dcbeb4b6390b1 (patch)
tree55d73f8d76485adfad8f28cc95abae1f892dcbc7 /usecaseui-portal/src/app/onboard.service.ts
parent3cc445834dd33209256b32f5643ec6c7e20ad2a4 (diff)
Support NS Package Upload for VF-C
Change-Id: Id5818d125ca7ed54079ae05df93100df9d43da13 Issue-ID: USECASEUI-156 Signed-off-by: zhangab <zhanganbing@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/onboard.service.ts')
-rw-r--r--usecaseui-portal/src/app/onboard.service.ts300
1 files changed, 162 insertions, 138 deletions
diff --git a/usecaseui-portal/src/app/onboard.service.ts b/usecaseui-portal/src/app/onboard.service.ts
index 1cf1e359..5738256e 100644
--- a/usecaseui-portal/src/app/onboard.service.ts
+++ b/usecaseui-portal/src/app/onboard.service.ts
@@ -5,169 +5,193 @@ import { onboardTableData, onboardDataVNF, onboardDataPNF } from './dataInterfac
@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/deleteNspack.json",
+ // Delete Vnf vfc package
+ deleteVnfPack: this.baseUrl + "/deleteVnfPack.json",
+ // Delete Pnf package
+ deletePnfPack: this.baseUrl + "/deletePnfPack.json",
+
+ // // download ns package
+ // downloadNsData: this.baseUrl + "/downloadData.json",
+ // //download vnf package
+ // downloadVnfData: this.baseUrl + "/listData/downloadVnfData.json"
-// baseUrl = "./assets/json";
-// url = {
-
-// // 数据列表
-// onboardTableData: this.baseUrl + "/onboardTableData.json",
-// onboardDataVNF: this.baseUrl + "/onboardDataVNF.json",
-// onboardDataPNF: this.baseUrl + "/onboardDataPNF.json",
-
-// //创建nspackages
-// creatensData: this.baseUrl + "/creatensData.json",
-
-// deleteService: this.baseUrl + "/deleteService.json?",
+ }
-// // Delete ns package
-// deleteNspack: this.baseUrl + "/deleteNspack.json",
-// // download ns package
-// downloadNsData: this.baseUrl + "/downloadData.json",
-// }
+//---------------------------------------------------------------------------------------
+ /* line up 线上*/
+ // baseUrl = "/api/usecaseui/server/v1/uui-lcm/";
+ // baseUrlUp = "/api/usecaseui/server/v1/";
+ // 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",
+ // //vnf sdc
+ // sdc_vnfListData: this.baseUrl + "sdc-vf-packages",
+
+ // //创建 creatensData
+ // creatensData: this.baseUrl + "_jsonData", //本地
+
+ // //onboard
+ // //onboard ns sdc data
+ // onboardNs: this.baseUrl + "ns-packages",
+ // //onboard VNF sdc data
+ // onboardVNF: this.baseUrl + "vf-packages",
+
+ // // Delete ns package
+ // deleteNspack: this.baseUrl + "deleteNsdPackage?nsdInfoId=XXXXX",
+ // // Delete Vnf vfc package
+ // deleteVnfPack: this.baseUrl + "deleteVnfPackage?vnfPkgId=XXXXX",
+ // // Delete Pnf package
+ // deletePnfPack: this.baseUrl + "",
+
+ // // // download ns package
+ // // downloadNsData: this.baseUrl + "downLoadNsPackage?nsdInfoId=XXXXX",
+ // // //download vnf package
+ // // downloadVnfData: this.baseUrl + "downLoadVnfPackage?vnfPkgId=XXXXX"
+
+ // }
+ //-------------------------------------------------------------------------------------
// baseUrl = 'http://172.19.44.223/api/usecaseui-server/v1';
- baseUrl = '/api/usecaseui/server/v1';
- url={
- // allhome:this.baseUrl + "/alarm/getAlarmDataByStatus/0",
- // homeLineData:this.baseUrl + "/...........",
- // serviceSelectList:this.baseUrl + "/xxxxxxxxxxxxx",
- // servicesTableData:this.baseUrl + "/xxxxxxxx.json",
- // onboardTableData:this.baseUrl + "/xxxxxxx.json",
+ // baseUrl = '/api/usecaseui/server/v1';
+ // url={
+ // // allhome:this.baseUrl + "/alarm/getAlarmDataByStatus/0",
+ // // homeLineData:this.baseUrl + "/...........",
+ // // serviceSelectList:this.baseUrl + "/xxxxxxxxxxxxx",
+ // // servicesTableData:this.baseUrl + "/xxxxxxxx.json",
+ // // onboardTableData:this.baseUrl + "/xxxxxxx.json",
- // 数据列表
- onboardTableData: this.baseUrl + "/uui-lcm/ns-packages",
- onboardDataVNF: this.baseUrl + "/uui-lcm/vnf-packages",
- onboardDataPNF: this.baseUrl + "/uui-lcm/pnf-packages",
+ // // 数据列表
+ // onboardTableData: this.baseUrl + "/uui-lcm/ns-packages",
+ // onboardDataVNF: this.baseUrl + "/uui-lcm/vnf-packages",
+ // onboardDataPNF: this.baseUrl + "/uui-lcm/pnf-packages",
- //创建nspackages
- // creatensData: this.baseUrl + "/creatensData.json",
+ // //创建nspackages
+ // // creatensData: this.baseUrl + "/creatensData.json",
- // deleteService: this.baseUrl + "/deleteService.json?",
+ // // deleteService: this.baseUrl + "/deleteService.json?",
- // Delete ns package
- deleteNspack: this.baseUrl + "/uui-lcm/deleteNsdPackage",
- // download ns package
- downloadNsData: this.baseUrl + "/downloadData.json/uui-lcm/downLoadNsPackage",
- }
+ // // Delete ns package
+ // deleteNspack: this.baseUrl + "/uui-lcm/deleteNsdPackage",
+ // // download ns package
+ // downloadNsData: this.baseUrl + "/downloadData.json/uui-lcm/downLoadNsPackage",
+ // }
-// 创建ns数据
-// getCreatensData(paramsObj):Observable<HttpResponse<creatensData>>{
-// let params = new HttpParams({fromObject:paramsObj});
-// return this.http.get<creatensData>(this.url.creatensData,{observe:'response',params});
-// // return this.http.post<any>(this.url.createService,requestBody);
-// }
-
-// getCreatensData() {
-// return this.http.get(this.url.creatensData);
-// }
- // onboard NS Data
- getOnboardTableData(paramsObj): Observable<HttpResponse<onboardTableData>> {
- // let params = new HttpParams({ fromObject: paramsObj });
- // return this.http.get<onboardTableData>(this.url.onboardTableData, { observe: 'response', params });
- return this.http.get<any>(this.url["onboardTableData"]);
- }
- // Ns Id
- getNsIdData(paramsObj): Observable<HttpResponse<onboardDataVNF>> {
- // let params = new HttpParams({ fromObject: paramsObj });
- // return this.http.get<onboardDataVNF>(this.url.onboardDataVNF, { observe: 'response', params });
- return this.http.post<any>(this.url["onboardDataVNF"],{});
+//-----------------------------------Function-start------------------------------------------------------
+ /* 查询数据列表 */
+ // NS Data
+ getOnboardTableData(paramsObj): Observable<HttpResponse<any>> {
+ let params = new HttpParams({ fromObject: paramsObj });
+ return this.http.get<any>(this.url.onboardTableData, { observe: 'response', params });
+ // return this.http.get<any>(this.url["onboardTableData"]);
}
- // Delete ns package
- deleteNsIdData(paramsObj): Observable<HttpResponse<any>> {
+ // NS SDC Data
+ getSDC_NSTableData(paramsObj): Observable<HttpResponse<onboardTableData>> {
let params = new HttpParams({ fromObject: paramsObj });
- // return this.http.get<any>(this.url.deleteNspack, { observe: 'response', params });
- return this.http.delete<any>(this.url["deleteNspack"], { observe: 'response', params });
+ return this.http.get<onboardTableData>(this.url.sdc_nsListData, { observe: 'response', params });
+ // return this.http.get<any>(this.url["onboardTableData"]);
}
- // download
- downloadNsData(paramsObj): Observable<HttpResponse<any>> {
- console.log(66,paramsObj)
+
+ // VNF Data
+ getOnboardTableVnfData(paramsObj): Observable<HttpResponse<onboardDataVNF>> {
let params = new HttpParams({ fromObject: paramsObj });
- return this.http.get<any>(this.url.downloadNsData, { observe: 'response', params });
+ return this.http.get<any>(this.url.onboardDataVNF, { observe: 'response', params });
}
- // onboard VNF Data
- getOnboardTableVnfData(paramsObj): Observable<HttpResponse<onboardDataVNF>> {
- // let params = new HttpParams({ fromObject: paramsObj });
- return this.http.post<any>(this.url.onboardDataVNF, paramsObj);
+ // onboard VNF sdc Data
+ getSDC_VNFTableData(){
+ return this.http.get<any>(this.url["sdc_vnfListData"]);
}
- // onboard PNF Data
+ // PNF Data
getOnboardTablePnfData(paramsObj): Observable<HttpResponse<onboardDataPNF>> {
let params = new HttpParams({ fromObject: paramsObj });
- return this.http.post<any>(this.url.onboardDataPNF, paramsObj);
+ return this.http.get<any>(this.url.onboardDataPNF, { observe: 'response', params });
}
- testObservable() {
- let myObservable = new Observable((observer) => {
- observer.next(1);
- observer.next((n) => {
- console.log(3 + n);
- })
- setTimeout(() => {
- observer.next(66666)
- }, 100)
- observer.next(() => {
- setTimeout((n) => {
- console.log("9999---" + n);
- }, 10)
- })
- // observer.error(2);
- // observer.complete();
- });
-
- myObservable.subscribe((e) => {
- if (typeof e == "function") {
- e(5)
- }
- console.log(e);
- }, (err) => {
- console.log(err);
- }, () => {
- console.log(555);
- })
+//-------------------------------------------------------------------------------------
+
+ //创建--上传前拖拽文件后,获取到id //线上接口 post
+ // getCreatensData(url_upId,requestBody) {
+ // return this.http.post<any>(this.url.creatensData.replace("_jsonData",url_upId),requestBody); //线上
+ // }
+
+ //创建--上传前拖拽文件后,获取到id //本地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);
+ }
- // // 服务详情数据
- // getInstanceDetails(id){
- // let url = this.baseUrl + "/detailsData.json?id=" + id;
- // return this.http.get<instanceDetail>(url);
- // }
+ //--------------------------------------------------------------------------
+ // Delete ns vfc package
+ deleteNsIdData(paramsObj): Observable<HttpResponse<any>> {
+ let params = new HttpParams({ fromObject: paramsObj });
+ console.log(11111,params)
+ return this.http.get<any>(this.url.deleteNspack, { observe: 'response', params });
+ // return this.http.delete<any>(this.url["deleteNspack"], { observe: 'response', params });
+ }
- // 删除接口
-// deleteInstance(obj) {
-// let httpOptions = {
-// headers: new HttpHeaders({
-// 'Content-Type': 'application/json',
-// 'Accept': 'application/json',
-// 'Authorization': 'Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA=='
-// }),
-// body: {
-// 'globalSubscriberId': obj.globalSubscriberId,
-// 'serviceType': obj.serviceType
-// }
-// };
-// return this.http.get<any>(this.url.deleteService); //本地模拟
-// // return this.http.delete<any>(this.url.deleteService + obj.serviceInstanceId, httpOptions);
-// }
-
- // 时间格式化 毫秒转正常值
- dateformater(vmstime) {
- if (!vmstime) {
- return ''
- }
- let mstime = Number((vmstime + '').slice(0, 13));
- let time = new Date(mstime);
- let year = time.getFullYear();
- let month = time.getMonth() + 1;
- let day = time.getDate();
- let hours = time.getHours();
- let minutes = time.getMinutes();
- let seconds = time.getSeconds();
- let formattime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
- return formattime;
+ // Delete Vnf vfc package
+ deleteVnfIdData(paramsObj): Observable<HttpResponse<any>> {
+ let params = new HttpParams({ fromObject: paramsObj });
+ console.log(11111,params)
+ return this.http.get<any>(this.url.deleteVnfPack, { observe: 'response', params });
+ // return this.http.delete<any>(this.url["deleteNspack"], { observe: 'response', params });
}
+
+ // Delete Pnf package
+ deletePnfIdData(paramsObj): Observable<HttpResponse<any>> {
+ let params = new HttpParams({ fromObject: paramsObj });
+ console.log(11111,params)
+ return this.http.get<any>(this.url.deletePnfPack, { observe: 'response', params });
+ // return this.http.delete<any>(this.url["deleteNspack"], { observe: 'response', params });
+ }
+//------------------------------------------------------------------------------
+ // download nspak
+ // downloadNsData(paramsObj): Observable<HttpResponse<any>> {
+ // console.log(66,paramsObj)
+ // let params = new HttpParams({ fromObject: paramsObj });
+ // return this.http.get<any>(this.url.downloadNsData, { observe: 'response', params });
+ // }
+ // // download Vnfpak
+ // downloadVnfData(){
+ // return this.http.get<any>(this.url.downloadVnfData)
+ // }
+//---------------------------------Function-end-------------------------------------------
+
}