diff options
author | Ittay Stern <ittay.stern@att.com> | 2018-08-29 17:01:32 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-02-18 18:35:30 +0200 |
commit | 6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch) | |
tree | 936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/src/app/drawingBoard | |
parent | 67d99f816cc583643c35193197594cf78d8ce60a (diff) |
merge from ecomp a88f0072 - Modern UI
Issue-ID: VID-378
Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard')
79 files changed, 19648 insertions, 1247 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.html b/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.html deleted file mode 100644 index 5eb977325..000000000 --- a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.html +++ /dev/null @@ -1,35 +0,0 @@ -<div class="available-models-tree"> - <h5> - <span>SERVICE MODEL:</span> - <span id="service-model-name">{{service | serviceInfo: _store: serviceModelId : 'name'}}</span> - </h5> - <div class="available-models-content-wrapper"> - <div class="search-container"> - <input [attr.data-tests-id]="'search-left-tree'" #filter (keyup)="searchTree(filter.value, $event)" placeholder="Filter..."/> - <span class="icon-search"></span> - </div> - - <tree-root #tree [attr.data-tests-id]="'available-models-tree'" [nodes]="nodes" [options]="options"> - <ng-template #treeNodeTemplate let-node let-index="index"> - <div [attr.data-tests-id]="'node-'+node.data.name" (click)="selectNode(node)" [ngClass]="{'selected': index , 'isParent': node.data.type !== 'VFmodule' , 'isChild': node.data.type === 'VFmodule' }"> - <span class="vf-type">{{node.data.type.substring(0,1)}}</span> - <span class="span-name" [innerHTML]=" isFilterEnabled ? (node.data.name | highlight : filter.value) : (node.data.name)"></span> - <span class="actions"> - <span class="number-button" *ngIf="isShowNodeCount(node)"> - <span>{{getNodeCount(node)}}</span> - </span> - <span class="icon-v" *ngIf="isShowIconV(node)"> - <span ></span> - </span> - <span class="icon-plus" *ngIf="isShowIconAdd(node)"> - <span tooltip="Add" [attr.data-tests-id]="'node-'+node.data.name+'-add-btn'" (click)="onClickAdd($event,node)"> - <i class="fa fa-plus-circle" aria-hidden="true"></i> - </span> - </span> - </span> - </div> - </ng-template> - </tree-root> - - </div> -</div> diff --git a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.scss b/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.scss deleted file mode 100644 index 44f94109a..000000000 --- a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.scss +++ /dev/null @@ -1,398 +0,0 @@ -available-models-tree { - .available-models-tree { - height: 100%; - display: flex; - flex-direction: column; - line-height: 14px; - border-right: #D2D2D2 1.5px solid; - min-width: 340px; - h5 { - font-family: OpenSans-Semibold; - color: #5A5A5A; - background-color: #F2F2F2; - margin: 0; - padding: 15px; - padding-left: 20px; - span { - vertical-align: middle; - &:first-child { - font-size: 12px; - color: #191919; - } - } - } - .available-models-content-wrapper { - flex: 1; - display: flex; - flex-direction: column; - padding: 20px; - background-color: #F2F2F2; - .search-container { - margin-bottom: 30px; - width: 100%; - display: flex; - background: #FFFFFF; - border: 1px solid #D2D2D2; - border-radius: 2px; - height: 40px; - min-width: 40px; - font-family: OpenSans-Italic; - color: #959595; - input { - flex: 1; - border: 0; - padding-left: 10px; - outline: 0; - } - .icon-search { - display: flex; - width: 40px; - &:after { - content: "\e92e"; - cursor: pointer; - font-size: 20px; - font-weight: 600; - text-align: center; - display: inline-block; - flex: auto; - align-self: center; - } - } - } - tree-root { - flex: 1; - display: flex; - } - tree-viewport { - flex: 1; - height: auto; - overflow: auto; - padding-top: 5px; - .tree-node { - color: #5A5A5A; - font-size: 13px; - white-space: normal; - word-break: break-all; - tree-node-drop-slot { - .node-drop-slot { - display: none; - } - } - &.tree-node-disabled { - color: #D2D2D2; - cursor: default; - pointer-events: none; - } - &:not(.tree-node-disabled) { - >tree-node-wrapper { - .node-wrapper:hover { - color: #009FDB; - .node-content-wrapper { - tree-node-content { - > div { - span.actions { - .number-button { - span { - //background-color: #009FDB; - } - } - .icon-plus span:before { - display: inline-block; - color: #5A5A5A; - } - } - } - } - } - } - } - } - &.tree-node-focused:not(.tree-node-disabled) { - & > tree-node-wrapper { - .node-wrapper { - color: #009FDB; - .node-content-wrapper-focused, - .node-content-wrapper:hover { - background: none; - box-shadow: none; - tree-node-content { - > div { - span.actions { - .number-button { - span { - //background-color: #009FDB; - } - } - } - } - } - } - } - } - } - tree-node-wrapper { - .node-wrapper { - height: 36px; - tree-node-expander { - font-family: 'icomoon' !important; - height: 100%; - .toggle-children-wrapper { - padding: 0; - display: block; - height: 100%; - span.toggle-children { - display: flex; - width: 20px; - top: 0; - height: inherit; - background-image: none; - &:before { - content: "\e900"; - font-weight: 600; - text-align: center; - display: inline-block; - flex: auto; - align-self: center; - font-size: 20px; - } - } - } - .toggle-children-wrapper-expanded { - span.toggle-children { - transform: none; - &:before { - content: "\e930"; - } - } - } - .toggle-children-placeholder { - width: 20px; - } - } - .node-content-wrapper { - padding: 0; - background: none; - box-shadow: none; - height: 100%; - flex: 1; - min-width: 0; - border-left: 1px solid #D2D2D2; - tree-node-content { - > div { - height: 100%; - display: flex; - align-items: center; - justify-content: space-between; - padding-left: 10px; - span { - &.actions { - height: 100%; - display: flex; - justify-content: space-between; - align-items: center; - >span { - width: 45px; - max-width: 45px; - text-align: center; - } - .number-button { - width: 30px; - padding-left: 0; - text-align: center; - span { - display: block; - font-size: 11px; - } - } - .icon-v { - width: 45px; - span:before { - content: "\e932"; - color: #5A5A5A; - font-size: 16px; - text-align: center; - display: inline-block; - vertical-align: baseline; - } - } - .icon-plus { - width: 45px; - span { - &:before { - //content: "\e901"; - //fill:#009FDB; - //color: #009FDB; - //font-size: 16px; - //text-align: center; - //display: none; - //vertical-align: baseline; - } - &:hover:before { - //color: #009FDB !important; - - } - } - } - } - } - } - } - } - - } - } - tree-node-children { - .tree-children { - padding-left: 20px; - } - } - } - } - - } - } -} -.highlight { - background-color: #9DD9EF; -} - -#drawing-board-tree{ - .tree-node.tree-node-expanded.tree-node-focused { - border: 1px solid #009FDB; - } - -} - -available-models-tree { - - .tree-root { - margin-top: 35px; - } - - tree-node-expander { - background: #FFFFFF; - border: 1px solid #D2D2D2; - border-right: none; - width: 45px; - padding-left: 12px; - } - - .node-content-wrapper { - border: none; - } - - tree-node-wrapper tree-node-expander{ - background: none !important; - border: none !important; - } - - tree-node-content div { - background: white; - } - - .node-wrapper { - height: 45px !important; - background: #FFFFFF; - border: 1px solid #D2D2D2; - } - - tree-node-collection div { - margin-top: 0px; - } - - .tree-node-leaf .node-wrapper tree-node-expander { - display: none; - } - - .tree-children { - padding: 20px; - } - - .tree-node.tree-node-expanded.tree-node-focused { - border: 1px solid #009FDB; - } - - .tree-node.tree-node-expanded { - border: 1px solid rgba(128, 128, 128, 0.72); - margin-bottom: 10px; - } - - .tree-children { - padding-left: 0; - } - - tree-node-content .actions .number-button { - height: 45px; - padding-top: 14px; - border: 1px solid #D2D2D2; - padding-left: 0; - span { - background: none; - font-size: 11px; - color: #5A5A5A; - } - } - - - - .node-content-wrapper.node-content-wrapper-focused tree-node-content div{ - background: #009FDB !important; - color: white; - - .isParent { - border-left: 1px solid #009FDB; - } - - .number-button span{ - color: white !important; - } - - .icon-v span:before{ - color: white !important; - } - } - - .vf-type { - width: 20px; - height: 45px; - padding-top: 16px; - border-right: 1px solid #D2D2D2; - - } - - .isParent { - width: 100%; - padding-left: 5px; - } - - .tree-node-expanded .isChild .vf-type { - display: none; - } - - .isParent .span-name { - width: 100%; - padding-left: 10px; - } - - .toggle-children-wrapper.toggle-children-wrapper-expanded { - .toggle-children:before { - color: #009FDB; - } - } - - .tree-node.tree-node-expanded .tree-children { - border: 1px solid rgba(128, 128, 128, 0.72); - } - - .tree-node.tree-node-expanded.tree-node-focused .tree-children { - border: 1px solid #009fdb; - } - - .tree-node-leaf .node-wrapper{ - margin-left: 45px; - border-left: none; - } -} - - - diff --git a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.ts deleted file mode 100644 index 4e5819e4c..000000000 --- a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.component.ts +++ /dev/null @@ -1,166 +0,0 @@ -import {Component, EventEmitter, Output, ViewChild} from '@angular/core'; -import {ITreeOptions, TreeComponent} from 'angular-tree-component'; -import '../../../../node_modules/angular-tree-component/dist/angular-tree-component.css'; -import {IDType, ITreeNode} from 'angular-tree-component/dist/defs/api'; -import {DialogService} from 'ng2-bootstrap-modal'; -import {AvailableModelsTreeService} from './available-models-tree.service'; -import {NgRedux} from "@angular-redux/store"; -import {ActivatedRoute} from '@angular/router'; -import {AppState} from '../../store/reducers'; -import {AaiService} from '../../services/aaiService/aai.service'; -import {ServicePlanningService} from '../../services/service-planning.service'; -import {VnfPopupComponent} from '../../components/vnf-popup/vnf-popup.components'; -import {ServiceNodeTypes} from '../../shared/models/ServiceNodeTypes'; -import {VfModuleMap} from '../../shared/models/vfModulesMap'; -import {IframeService} from "../../shared/utils/iframe.service"; -import {createVFModuleInstance} from "../../service.actions"; -import {DefaultDataGeneratorService} from "../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; - - -@Component({ - selector: 'available-models-tree', - templateUrl: './available-models-tree.component.html', - styleUrls: ['./available-models-tree.component.scss'] -}) - - -export class AvailableModelsTreeComponent{ - - serviceModelId: string; - serviceHierarchy; - parentElementClassName = 'content'; - _store : NgRedux<AppState>; - constructor(private _servicePlanningService: ServicePlanningService, - private _iframeService: IframeService, - private _aaiService: AaiService, - private route: ActivatedRoute, - private dialogService: DialogService, - private _availableModelsTreeService: AvailableModelsTreeService, - private _defaultDataGeneratorService: DefaultDataGeneratorService, - private store: NgRedux<AppState>) { - this._store = store; - this.route - .queryParams - .subscribe(params => { - this.serviceModelId = params['serviceModelId']; - this._aaiService.getServiceModelById(this.serviceModelId).subscribe( - value => { - this.serviceHierarchy = value; - this.nodes = this._servicePlanningService.convertServiceModelToTreeNodes(this.serviceHierarchy); - }, - error => { - console.log('error is ', error) - } - ); - }); - - } - - @Output() - highlightInstances: EventEmitter<number> = new EventEmitter<number>(); - @ViewChild('tree') tree: TreeComponent; - - nodes = []; - service = {name: ''}; - isFilterEnabled: boolean = false; - - options: ITreeOptions = { - nodeHeight: 36, - dropSlotHeight: 0, - nodeClass: (node: ITreeNode) => { - if(node.data.type === ServiceNodeTypes.VFmodule && !this.getNodeCount(node.parent)) - { - node.data.disabled = true; - return 'tree-node tree-node-disabled'; - } - node.data.disabled = false; - return 'tree-node'; - } - }; - - expandParentByNodeId(id: IDType): void { - this.tree.treeModel.getNodeById(id).parent.expand(); - } - - searchTree(searchText: string, event: KeyboardEvent): void { - if (searchText === '') { - return; - } - this.isFilterEnabled = event.key === 'Delete' || event.key === 'Backspace' || searchText.length > 1; - if (this.isFilterEnabled) { - let __this = this; - let results: ITreeNode[] = []; - this.nodes.forEach(function (node) { - __this.searchTreeNode(node, searchText, results); - }); - results.forEach(function (result) { - __this.expandParentByNodeId(result.id) - }); - } - } - - searchTreeNode(node, searchText: string, results): void { - if (node.name.toLowerCase().indexOf(searchText.toLowerCase()) != -1) { - results.push(node); - } - if (node.children != null) { - for (let i = 0; i < node.children.length; i++) { - this.searchTreeNode(node.children[i], searchText, results); - } - } - } - - selectNode(node: ITreeNode): void { - node.expand(); - this.highlightInstances.emit(node.data.id); - } - - onClickAdd(e: MouseEvent, node: ITreeNode): void { - let data = node.data; - let dynamicInputs = data.dynamicInputs; - let userProvidedNaming:boolean = data.userProvidedNaming; - let type:string = data.type; - if(!this.store.getState().global.flags['FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD']|| node.data.type === ServiceNodeTypes.VF || this._availableModelsTreeService.shouldOpenDialog(type, dynamicInputs, userProvidedNaming)) { - this._iframeService.addClassOpenModal(this.parentElementClassName); - this.dialogService.addDialog(VnfPopupComponent, { - serviceModelId: this.serviceModelId, - parentModelName: node.parent && node.parent.data.name, - modelName: data.name, - modelType: type, - dynamicInputs: dynamicInputs, - userProvidedNaming: userProvidedNaming, - isNewVfModule : true - }); - } - else { - let vfModule = this._defaultDataGeneratorService.generateVFModule(this.serviceHierarchy, node.parent.data.name, node.data.name); - this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId)); - } - e.preventDefault(); - e.stopPropagation(); - } - - getNodeCount(node: ITreeNode): number { - let modelName: string = node.data.name; - if (ServicePlanningService.isVfModule(node)) { - let parentVnfModelName = node.parent.data.name; - let vfModuleMap: VfModuleMap = this._servicePlanningService.getVfModuleMap(this.serviceModelId, parentVnfModelName, modelName); - return vfModuleMap ? Object.keys(vfModuleMap).length : 0; - } else if (ServicePlanningService.isVnf(node)) { - let vnfInstance = this._servicePlanningService.getVnfInstance(this.serviceModelId, modelName); - return vnfInstance ? 1 : 0; - } - } - - isShowIconV(node: ITreeNode): boolean { - return this.getNodeCount(node) > 0; - } - - isShowNodeCount(node: ITreeNode): boolean { - return this.getNodeCount(node) > 0; - } - - isShowIconAdd(node: ITreeNode): boolean { - return this._availableModelsTreeService.shouldShowAddIcon(node, this.store.getState().service.serviceHierarchy, this.serviceModelId, this.getNodeCount(node)); - } -} diff --git a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.service.ts b/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.service.ts deleted file mode 100644 index 57dc4b409..000000000 --- a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.service.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Injectable} from '@angular/core'; -import * as _ from "lodash"; -import {ServicePlanningService} from "../../services/service-planning.service"; - -@Injectable() -export class AvailableModelsTreeService { - constructor(private _servicePlanningService: ServicePlanningService) { - } - - shouldShowAddIcon(node: any, serviceHierarchy: any, serviceModelId: string, currentNodeCount: number): boolean { - let maxNodes: number = 1; - if (node.data.children !== null && node.data.children.length == 0) { - let vnfModules = serviceHierarchy[serviceModelId].vfModules; - if (vnfModules[node.data.name]) { - maxNodes = vnfModules[node.data.name].properties.maxCountInstances || 1; - } - } - return !node.data.disabled && currentNodeCount < maxNodes - } - - shouldOpenDialog(type: string, dynamicInputs: any, userProvidedNaming: boolean): boolean { - if (userProvidedNaming || this._servicePlanningService.requiredFields[type].length > 0) { - return true; - } - - if (dynamicInputs) { - for(let input of dynamicInputs) { - if (input.isRequired && _.isEmpty(input.value)) { - return true; - } - } - } - return false; - } - -} diff --git a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.html b/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.html deleted file mode 100644 index 7d0f7f456..000000000 --- a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.html +++ /dev/null @@ -1,33 +0,0 @@ -<div class="drawing-board-header"> - <div class="left-header"> - <span [attr.data-tests-id]="'backBtn'" class="icon-back" (click)="closePage()"></span> - <span [attr.data-tests-id]="'serviceInstance'" class="service-instance-label">Service instance:</span> - <span [attr.data-tests-id]="'serviceName'" class="service-instance-name">{{serviceName}}</span> - <span class="quantity-container" style=" padding: 10px;font-size: 13px;" tooltip="Number of services to instantiate including all their objects as defined below"> - <span [attr.data-tests-id]="'quantityLabel'" class="quantity-label" >Scale Times:</span> - <span [attr.data-tests-id]="'servicesQuantity'" class="quantity" style="font-family: OpenSans-Semibold;font-size: 14px;"> {{numServicesToDeploy}} </span> - </span> - <span class="service-instance-label">status:</span> - <span [attr.data-tests-id]="'serviceStatus'" class="status">{{status}}</span> - </div> - <div class="right-header"> - <span class="menu-container"> - <span [attr.data-tests-id]="'openMenuBtn'" class="icon-browse" (click)="onContextMenu($event)"></span> - <context-menu> - <ng-template contextMenuItem (execute)="editService()"> - <div [attr.data-tests-id]="'context-menu-header-edit-item'"> - <span class="icon-edit"></span> - Edit - </div> - </ng-template> - <ng-template contextMenuItem (execute)="closePage()"> - <div [attr.data-tests-id]="'context-menu-header-delete-item'"> - <span class="icon-trash"></span> - Delete - </div> - </ng-template> - </context-menu> - </span> - <button [disabled]="false" [attr.data-tests-id]="'deployBtn'" (click)="deployMacroservice()" class="deploy-btn">DEPLOY</button> - </div> -</div> diff --git a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.scss b/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.scss deleted file mode 100644 index 29b7711bc..000000000 --- a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.scss +++ /dev/null @@ -1,95 +0,0 @@ -.drawing-board-header { - height: 56px; - margin-bottom: 4px; - position: relative; - font-family: OpenSans-Regular; - display: flex; - justify-content: space-between; - font-size: 14px; - box-shadow: 2px 2px 6px #D2D2D2; - color: #191919; - [class^="icon-"] { - height: 56px; - width: 56px; - display: flex; - align-items: center; - text-align: center; - color: #5A5A5A; - cursor: pointer; - &:before { - font-size: 18px; - width: 100%; - } - &:hover:before { - color: #009FDB; - } - } - .left-header { - display: flex; - align-items: center; - .icon-back { - border-right: 1px solid #EAEAEA; - &:before { - content: "\e906"; - font-size: 24px; - } - } - .service-instance-label { - padding: 0 5px; - font-family: OpenSans-Regular; - font-size: 13px; - color: #191919; - } - .service-instance-name { - padding-right: 20px; - color: #191919; - font-family: OpenSans-Semibold; - background-color: white; - font-size: 16px - } - .status { - font-family: OpenSans-Semibold; - line-height: 14px; - font-size: 14px; - } - } - .right-header { - display: flex; - align-items: center; - .quantity-container { - .quantity-label { - padding-left: 10px; - font-family: OpenSans-Semibold; - font-size: 12px; - } - .quantity { - padding: 5px 10px 5px 0; - font-family: OpenSans-Semibold; - font-size: 18px; - } - } - [class^="icon-"] { - border-left: 1px solid #EAEAEA; - } - .menu-container { - height: 100%; - display: flex; - background: none; - border: none; - padding: 0; - outline: none; - } - .icon-browse:before { - content: '\e924'; - display: inline-block; - font-size: 24px; - } - .deploy-btn { - color: #FFFFFF ; - background: #009fdb; - width: 128px; - height: 100%; - border: none; - } - } -} diff --git a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.ts b/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.ts deleted file mode 100644 index 38284e214..000000000 --- a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/drawing-board-header.component.ts +++ /dev/null @@ -1,119 +0,0 @@ -import {Component, ViewChild} from '@angular/core'; -import {ContextMenuComponent, ContextMenuService} from 'ngx-contextmenu'; -import {DialogService} from 'ng2-bootstrap-modal'; -import {ServicePopupComponent} from '../../components/service-popup/service-popup.component'; -import {MsoService} from '../../services/msoService/mso.service' -import * as _ from 'lodash'; -import {ActivatedRoute} from '@angular/router'; -import {ServiceInstance} from "../../shared/models/serviceInstance"; -import {OwningEntity} from "../../shared/models/owningEntity"; -import {MessageBoxData, ModalSize, ModalType} from "../../shared/components/messageBox/messageBox.data"; -import {MessageBoxService} from "../../shared/components/messageBox/messageBox.service"; -import {NgRedux} from "@angular-redux/store"; -import {AppState} from "../../store/reducers"; -import {IframeService} from "../../shared/utils/iframe.service"; - -@Component({ - selector: 'drawing-board-header', - providers: [MsoService], - templateUrl: './drawing-board-header.component.html', - styleUrls: ['./drawing-board-header.component.scss'] -}) - -export class DrawingBoardHeader { - serviceName: string; - numServicesToDeploy: number; - status: string = 'Designing a new service'; - serviceModelId: string; - parentElementClassName = 'content'; - - constructor(private _contextMenuService: ContextMenuService, private dialogService: DialogService, - private _iframeService : IframeService, - private route: ActivatedRoute, private msoService: MsoService, - private store: NgRedux<AppState>) { - this.route - .queryParams - .subscribe(params => { - this.serviceModelId = params['serviceModelId']; - if (_.has(this.store.getState().service.serviceHierarchy, this.serviceModelId)) { - this.setValuesFromStore(); - this.store.subscribe(() => { - this.setValuesFromStore(); - }); - } - }); - } - - - @ViewChild(ContextMenuComponent) public contextMenu: ContextMenuComponent; - - public onContextMenu($event: MouseEvent, item: any): void { - this._contextMenuService.show.next({ - contextMenu: this.contextMenu, - event: $event, - item: item, - }); - $event.preventDefault(); - $event.stopPropagation(); - } - - private setValuesFromStore() { - const serviceInstance = this.store.getState().service.serviceInstance[this.serviceModelId]; - this.numServicesToDeploy = serviceInstance.bulkSize; - this.serviceName = serviceInstance.instanceName || '<Automatically Assigned>'; - - } - - public editService(): void { - this._iframeService.addClassOpenModal(this.parentElementClassName); - this.dialogService.addDialog(ServicePopupComponent, {}) - - } - - - extractOwningEntityNameAccordingtoId(id:String): string { - let owningEntityName; - _.forEach(this.store.getState().service.categoryParameters.owningEntityList,function(owningEntity: OwningEntity) { - if (owningEntity.id === id) { - owningEntityName = owningEntity.name; - - }}) - - return owningEntityName; - } - - extractServiceFields(): any { - let instanceFields : ServiceInstance; - instanceFields = this.store.getState().service.serviceInstance[Object.keys(this.store.getState().service.serviceInstance)[0]]; - instanceFields.subscriberName = this.store.getState().service.subscribers.find(sub => sub.id === instanceFields.globalSubscriberId).name; - instanceFields.owningEntityName = this.extractOwningEntityNameAccordingtoId(instanceFields.owningEntityId); - return instanceFields; - } - - public deployMacroservice(): void { - var instanceFields = this.extractServiceFields(); - instanceFields.rollbackOnFailure = instanceFields.rollbackOnFailure === 'true'; - this.msoService.submitMsoTask(instanceFields).subscribe((result) => { - window.parent.postMessage("navigateToInstantiationStatus", '*'); - }) - } - - closePage() { - let messageBoxData : MessageBoxData = new MessageBoxData( - "Delete Instantiation", // modal title - "You are about to stop the instantiation process of this service. \nAll data will be lost. Are you sure you want to stop?", - - ModalType.alert, - ModalSize.medium, - [ - {text:"Stop Instantiation", size:"large", callback: this.navigate.bind(this), closeModal:true}, - {text:"Cancel", size:"medium", closeModal:true} - ]); - - MessageBoxService.openModal.next(messageBoxData); - } - - navigate(){ - window.parent.postMessage("navigateTo", "*"); - } -} diff --git a/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.component.ts deleted file mode 100644 index 6b717a930..000000000 --- a/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.component.ts +++ /dev/null @@ -1,133 +0,0 @@ -import {AfterViewInit, Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core'; -import { ContextMenuService } from 'ngx-contextmenu'; -import { Constants } from '../../shared/utils/constants'; -import {ServicePlanningService} from "../../services/service-planning.service"; -import {ITreeNode} from "angular-tree-component/dist/defs/api"; -import {ITreeOptions, TreeComponent} from "angular-tree-component"; -import {VnfPopupComponent} from "../../components/vnf-popup/vnf-popup.components"; -import {DialogService} from "ng2-bootstrap-modal"; -import {ActivatedRoute} from "@angular/router"; -import {NgRedux} from "@angular-redux/store"; -import {AppState} from "../../store/reducers"; -import { MessageBoxData, ModalSize, ModalType } from '../../shared/components/messageBox/messageBox.data'; -import { MessageBoxService } from '../../shared/components/messageBox/messageBox.service'; -import { deleteVnfInstance, deleteVfModuleInstance } from '../../service.actions'; -import { isNullOrUndefined } from 'util'; -import {IframeService} from "../../shared/utils/iframe.service"; - - -@Component({ - selector: 'drawing-board-tree', - templateUrl: './drawing-board-tree.html', - styleUrls : ['./drawing-board-tree.scss'] -}) - - -export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { - constructor(private _contextMenuService: ContextMenuService, - private _servicePlanningService: ServicePlanningService, - private _iframeService : IframeService, - private dialogService: DialogService, - private store: NgRedux<AppState>, - private route: ActivatedRoute) { - this.route - .queryParams - .subscribe(params => { - this.serviceModelId = params['serviceModelId']; - }); - } - - @Output() - highlightNode : EventEmitter<number> = new EventEmitter<number>(); - - @ViewChild('tree') tree: TreeComponent; - missingDataTooltip: string = Constants.Error.MISSING_VNF_DETAILS; - currentNode: ITreeNode = null; // - nodes = []; - serviceModelId: string; - options: ITreeOptions = { - nodeHeight: 45, - dropSlotHeight: 1 - }; - parentElementClassName = 'content'; - - ngOnInit(): void { - this.store.subscribe(() => {this.updateTree()}); - this.updateTree() - } - - updateTree() { - const serviceInstance = this.store.getState().service.serviceInstance[this.serviceModelId]; - this.nodes = this._servicePlanningService.convertServiceInstanceToTreeData(serviceInstance, this.serviceModelId); - } - - ngAfterViewInit():void { - // Expand drawing tree on init. - this.tree.treeModel.expandAll(); - } - - public onContextMenu($event: MouseEvent, node: ITreeNode): void { - this.currentNode = node; - node.focus(); - node.setActiveAndVisible(false); - this.selectNode(node); - this._contextMenuService.show.next({ - event: <any>$event, - item: node, - }); - $event.preventDefault(); - $event.stopPropagation(); - } - - public editItem(node: ITreeNode): void { - node = this.currentNode; - this._iframeService.addClassOpenModal(this.parentElementClassName); - this.dialogService.addDialog(VnfPopupComponent, { - serviceModelId: this.serviceModelId, - modelName: node.data.modelName, - modelType: node.data.type, - parentModelName: node.parent.data.modelName, - isNewVfModule : false - }) - } - - public deleteItem(node: ITreeNode): void { - if(this.currentNode.data.type === 'VF'){ - if(!isNullOrUndefined(this.currentNode.data.children) && this.currentNode.data.children.length === 0){ - this.store.dispatch(deleteVnfInstance(this.currentNode.data.modelName, this.serviceModelId)); - }else { - let messageBoxData : MessageBoxData = new MessageBoxData( - "Remove VNF", // modal title - "You are about to remove this VNF and all its children from this service. Are you sure you want to remove it?", - - ModalType.alert, - ModalSize.medium, - [ - {text:"Remove VNF", size:"large", callback: this.removeVnf.bind(this), closeModal:true}, - {text:"Don’t Remove", size:"medium", closeModal:true} - ]); - - MessageBoxService.openModal.next(messageBoxData); - } - }else { - this.store.dispatch(deleteVfModuleInstance(this.currentNode.data.modelName, this.serviceModelId, node.parent.data.modelName)); - } - } - - removeVnf() { - this.store.dispatch(deleteVnfInstance(this.currentNode.data.modelName, this.serviceModelId)); - } - - public selectNode(node: ITreeNode): void { - node.expand(); - this.highlightNode.emit(node.data.modelId); - } - - isDataMissing(node: ITreeNode) { - //todo: currently not showing the alert icon. will be implemented in upcoming story. - return false; - } - -} - - diff --git a/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.html b/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.html deleted file mode 100644 index c4061db9e..000000000 --- a/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.html +++ /dev/null @@ -1,42 +0,0 @@ -<div class="drawing-board-tree"> - <div *ngIf="nodes?.length == 0" style="text-align: center; margin-top: 50px;"> - <no-content-message-and-icon class="span-over" - data-title="Please add objects (VNFs, network, modules etc.) from the left tree to design the service instance" - subtitle="Once done, click Deploy to start instantiation" - iconPath="./assets/img/UPLOAD.svg" - iconClass="upload-icon-service-planing"></no-content-message-and-icon> - </div> - <tree-root [attr.data-tests-id]="'drawing-board-tree'" #tree [nodes]="nodes" [options]="options" id="drawing-board-tree"> - <ng-template #treeNodeTemplate let-node let-index="index"> - <div [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName" (click)="selectNode(node)"> - <div class="model-info"> - <span> - <span class="property-name">{{node.data.type}}{{node.data.name ? ': ': ''}}<span class="auto-name">{{node.data.name? node.data.name: ''}}</span></span> - </span> - </div> - <div class="model-actions"> - <span class="icon-browse" [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-menu-btn'" (click)="onContextMenu($event, node)" > - <context-menu> - <ng-template contextMenuItem (execute)="editItem(node)"> - <div [attr.data-tests-id]="'context-menu-item'"> - <span class="icon-edit"></span> - Edit - </div> - </ng-template> - <ng-template contextMenuItem (execute)="deleteItem(node)"> - <div> - <span class="icon-trash"></span> - Remove - </div> - </ng-template> - </context-menu> - </span> - <span *ngIf="isDataMissing(node)" class="icon-alert" tooltip="{{ missingDataTooltip }}" tooltipPlacement="left" [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-alert-icon'"></span> - </div> - </div> - - </ng-template> - </tree-root> -</div> - - diff --git a/vid-webpack-master/src/app/drawingBoard/drawingBoard.module.ts b/vid-webpack-master/src/app/drawingBoard/drawingBoard.module.ts index 41efbe0e8..6a3574f23 100644 --- a/vid-webpack-master/src/app/drawingBoard/drawingBoard.module.ts +++ b/vid-webpack-master/src/app/drawingBoard/drawingBoard.module.ts @@ -1,41 +1,86 @@ -import { AvailableModelsTreeService } from './available-models-tree/available-models-tree.service'; -import { NgModule } from '@angular/core'; -import { HighlightPipe } from '../shared/pipes/highlight-filter.pipe'; -import { TreeModule } from 'angular-tree-component'; -import { BrowserModule } from '@angular/platform-browser'; -import { TooltipModule } from 'ngx-tooltip'; -import { AvailableModelsTreeComponent } from './available-models-tree/available-models-tree.component'; -import { ServicePlanningService } from '../services/service-planning.service'; -import { AaiService } from '../services/aaiService/aai.service'; -import { DrawingBoardTreeComponent } from './drawing-board-tree/drawing-board-tree.component'; -import { SharedModule } from '../shared/shared.module'; -import { ContextMenuModule, ContextMenuService } from 'ngx-contextmenu'; -import { CommonModule } from '@angular/common'; -import { DrawingBoardHeader } from './drawing-board-header/drawing-board-header.component'; -import { ServicePlanningComponent, ServicePlanningEmptyComponent } from './service-planning/service-planning.component'; +import {AvailableModelsTreeService} from './service-planning/available-models-tree/available-models-tree.service'; +import {HighlightPipe} from '../shared/pipes/highlight/highlight-filter.pipe'; +import {TreeModule} from 'angular-tree-component'; +import {BrowserModule} from '@angular/platform-browser'; +import {TooltipModule} from 'ngx-tooltip'; +import {AvailableModelsTreeComponent} from './service-planning/available-models-tree/available-models-tree.component'; +import {AaiService} from '../shared/services/aaiService/aai.service'; +import {DrawingBoardTreeComponent} from './service-planning/drawing-board-tree/drawing-board-tree.component'; +import {SharedModule} from '../shared/shared.module'; +import {ContextMenuModule, ContextMenuService} from 'ngx-contextmenu'; +import {CommonModule} from '@angular/common'; +import {DrawingBoardHeader} from './service-planning/drawing-board-header/drawing-board-header.component'; +import {ServicePlanningComponent, ServicePlanningEmptyComponent} from './service-planning/service-planning.component'; +import {DuplicateVnfComponent} from './service-planning/duplicate/duplicate-vnf.component'; +import {DuplicateService} from './service-planning/duplicate/duplicate.service'; +import {FormsModule} from '@angular/forms'; +import {DrawingBoardTreeService} from "./service-planning/drawing-board-tree/drawing-board-tree.service"; +import {DrawingBoardHeaderService} from "./service-planning/drawing-board-header/drawing-board-header.service"; +import {TreeNodeHeaderPropertiesComponent} from "./service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component"; +import {SafePipe} from "../shared/pipes/safe/safe.pipe"; +import {FeatureFlagModule} from "../featureFlag/featureFlag.module"; +import {DynamicInputsService} from "./service-planning/objectsToTree/dynamicInputs.service"; +import {InstanceTreeGenerator} from "./service-planning/drawing-board-tree/instance.tree.generator"; +import {SharedTreeService} from "./service-planning/objectsToTree/shared.tree.service"; +import {ObjectToModelTreeService} from "./service-planning/objectsToTree/objectToModelTree/objectToModelTree.service"; +import {ObjectToInstanceTreeService} from "./service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service"; +import {ObjectToTreeService} from "./service-planning/objectsToTree/objectToTree.service"; +import {SearchComponent} from "./service-planning/search/search.component"; +import {SdcUiComponentsModule} from "onap-ui-angular"; +import {DrawingBoardPermissions} from "./guards/servicePlanningGuard/drawingBoardGuard"; +import {NgModule} from '@angular/core'; +import {DragAndDropService} from "./service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.service"; +import {SdcUiServices} from "onap-ui-angular/dist"; +import {CreateDynamicComponentService} from "onap-ui-angular/dist/utils/create-dynamic-component.service"; +import {ComponentInfoComponent} from './service-planning/component-info/component-info.component'; +import {ComponentInfoService} from "./service-planning/component-info/component-info.service"; + @NgModule({ imports: [ TreeModule, BrowserModule, ContextMenuModule, + FormsModule, TooltipModule, CommonModule, - SharedModule.forRoot()], + SdcUiComponentsModule, + SharedModule.forRoot(), + FeatureFlagModule.forRoot()], providers: [ - ServicePlanningService, AaiService, - AvailableModelsTreeService , + ObjectToTreeService, + AvailableModelsTreeService, ContextMenuService, - ServicePlanningService], + DuplicateService, + DrawingBoardTreeService, + DrawingBoardHeaderService, + DrawingBoardPermissions, + SafePipe, + ObjectToInstanceTreeService, + ObjectToModelTreeService, + DynamicInputsService, + InstanceTreeGenerator, + SharedTreeService, + SdcUiServices.ModalService, + SdcUiServices.LoaderService, + CreateDynamicComponentService, + ComponentInfoService, + DragAndDropService], declarations: [ AvailableModelsTreeComponent, HighlightPipe, DrawingBoardTreeComponent, DrawingBoardHeader, ServicePlanningComponent, - ServicePlanningEmptyComponent], - exports: [ AvailableModelsTreeComponent, DrawingBoardTreeComponent, DrawingBoardHeader] + ServicePlanningEmptyComponent, + DuplicateVnfComponent, + TreeNodeHeaderPropertiesComponent, + SearchComponent, + ComponentInfoComponent], + entryComponents: [DuplicateVnfComponent], + exports: [AvailableModelsTreeComponent, DrawingBoardTreeComponent, DrawingBoardHeader, TreeNodeHeaderPropertiesComponent, SearchComponent] }) -export class DrawingBoardModule { } +export class DrawingBoardModule { +} diff --git a/vid-webpack-master/src/app/drawingBoard/drawingBoard.routing.ts b/vid-webpack-master/src/app/drawingBoard/drawingBoard.routing.ts new file mode 100644 index 000000000..0c1fa700c --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/drawingBoard.routing.ts @@ -0,0 +1,63 @@ +import {Route} from '@angular/router'; +import {ServicePlanningComponent, ServicePlanningEmptyComponent} from "./service-planning/service-planning.component"; +import {FlagsResolve} from "../shared/resolvers/flag/flag.resolver"; +import {ViewEditResolver} from "../shared/resolvers/viewEdit/viewEdit.resolver"; +import {DrawingBoardGuard} from "./guards/servicePlanningGuard/drawingBoardGuard"; +import {RetryResolver} from "../shared/resolvers/retry/retry.resolver"; + +export const DrawingBoardRoutes: Route[] = [ + { + path: 'servicePlanning', + children: [ + { + path: 'EDIT', + component: ServicePlanningComponent, + resolve: { + flags: FlagsResolve, + viewEditResolver: ViewEditResolver + }, + canActivate: [DrawingBoardGuard] + }, + { + path: 'VIEW', + component: ServicePlanningComponent, + resolve: { + flags: FlagsResolve, + viewEditResolver: ViewEditResolver + } + }, + { + path: 'RETRY_EDIT', + component: ServicePlanningComponent, + resolve: { + flags: FlagsResolve, + viewEditResolver: RetryResolver + }, + canActivate: [DrawingBoardGuard] + }, + { + path: 'RETRY', + component: ServicePlanningComponent, + resolve: { + flags: FlagsResolve, + viewEditResolver: RetryResolver + } + }, + { + path: '', + component: ServicePlanningComponent, + resolve: { + flags: FlagsResolve + }, + } + ] + }, + { + path: 'servicePlanningEmpty', + component: ServicePlanningEmptyComponent, + resolve: { + flags: FlagsResolve, + } + }, +]; + diff --git a/vid-webpack-master/src/app/drawingBoard/guards/servicePlanningGuard/drawingBoardGuard.ts b/vid-webpack-master/src/app/drawingBoard/guards/servicePlanningGuard/drawingBoardGuard.ts new file mode 100644 index 000000000..4a305b193 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/guards/servicePlanningGuard/drawingBoardGuard.ts @@ -0,0 +1,56 @@ +import {Injectable} from "@angular/core"; +import {CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router} from "@angular/router"; +import {NgRedux} from "@angular-redux/store"; +import {Observable} from "rxjs"; +import {HttpClient} from "@angular/common/http"; +import {AppState} from "../../../shared/store/reducers"; +import {updateDrawingBoardStatus} from "../../../shared/storeUtil/utils/global/global.actions"; +import {DrawingBoardModes} from "../../service-planning/drawing-board.modes"; +import {of} from "rxjs"; + +@Injectable() +export class DrawingBoardGuard implements CanActivate { + constructor(private store: NgRedux<AppState>, private _http: HttpClient, private _router : Router) { } + canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> { + let url : string = `/vid/roles/service_permissions?subscriberId=${next.queryParams['subscriberId']}&serviceType=${next.queryParams['serviceType']}`; + const viewMode = state.url.includes(DrawingBoardModes.RETRY_EDIT)? DrawingBoardModes.RETRY: DrawingBoardModes.VIEW; + return this._http.get(url) + .map((result : DrawingBoardPermissions) => { + if(!result.isEditPermitted){ + this.navigateToNewViewEdit(next.queryParams, viewMode); + return false; + }else { + return true; + } + }).catch(err => { + this.navigateToNewViewEdit(next.queryParams, viewMode); + return of(false); + }); + } + + navigateToNewViewEdit(queryParams: any, mode: DrawingBoardModes): void{ + this.store.dispatch(updateDrawingBoardStatus(mode)); + const viewEditUrlTree = this.getNewViewEditUrlTree(queryParams, mode); + this._router.navigateByUrl(viewEditUrlTree); + window.parent.location.assign('../../serviceModels.htm#'+viewEditUrlTree.toString()); + } + + getNewViewEditUrlTree(queryParams: any, mode: DrawingBoardModes) { + return this._router.createUrlTree( + ['/servicePlanning/' + mode], + { + queryParams: + { + serviceModelId: queryParams['serviceModelId'], + serviceInstanceId: queryParams['serviceInstanceId'], + serviceType : queryParams['serviceType'], + subscriberId : queryParams['subscriberId'], + jobId : queryParams['jobId'], + } + }); + } +} + +export class DrawingBoardPermissions { + isEditPermitted : boolean +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.html b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.html new file mode 100644 index 000000000..91acca0d1 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.html @@ -0,0 +1,47 @@ +<div class="available-models-tree" style="height: calc(100vh - 55px);"> + <div class="models-tree-header"> + <h5> + <span class="main" >MODEL <span class="sub-title">(from SDC)</span>:</span> + <span id="service-model-name">{{service | serviceInfo: _store: serviceModelId : 'name'}}</span> + </h5> + <search-component (updateNodes)="updateNodes($event)" + [nodes]="nodes" [tree]="tree? tree: {}" + [inputTestId]="'search-left-tree'" + *ngIf="nodes?.length > 0"></search-component> + </div> + <div class="available-models-content-wrapper" *ngIf="nodes?.length > 0" > + <tree-root #tree [attr.data-tests-id]="'available-models-tree'" [nodes]="nodes" [options]="options" id="available-models-tree"> + <ng-template #treeNodeTemplate let-node let-index="index"> + <div [attr.data-tests-id]="'node-'+node.data.name" (click)="selectNode(node)" [ngClass]="{'selected': index , 'isParent': node.data.type !== 'VFmodule' , 'isChild': node.data.type === 'VFmodule' }"> + <span class="vf-type" title="{{node.data.type}}" [attr.data-tests-id]="'node-type-indicator'" >{{node?.data?.typeName}}</span> + <div class="model-info"> + <span class="header-info"> + <span class="property-name"> + <span class="auto-name" + [innerHtml]="getNodeName(node, filterValue) | safe : 'html'" + [attr.data-tests-id]="'node-name'" + ></span> + </span> + </span> + </div> + <span class="actions"> + <span class="number-button" *ngIf="node.data.getNodeCount(node, serviceModelId) > 0"> + <span [attr.data-tests-id]="'numberButton'">{{node.data.getNodeCount(node, this.serviceModelId)}}</span> + </span> + <span class="icon-v" *ngIf="node?.data?.showNodeIcons(node, serviceModelId)?.vIcon"> + <svg-icon + [mode]="'secondary'" + [name]="'maximum'"> + </svg-icon> + </span> + <span class="icon-plus" *ngIf="node?.data?.showNodeIcons(node, serviceModelId)?.addIcon"> + <span tooltip="Add" [attr.data-tests-id]="'node-'+node.data.name+'-add-btn'" (click)="onClickAdd(node, serviceModelId)"> + <i class="fa fa-plus-circle" aria-hidden="true"></i> + </span> + </span> + </span> + </div> + </ng-template> + </tree-root> + </div> +</div> diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.scss new file mode 100644 index 000000000..90c2cd878 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.scss @@ -0,0 +1,506 @@ +.tree-children.tree-children-no-padding { padding-left: 0 } +.tree-children { padding-left: 20px; overflow: hidden } +.node-drop-slot { display: block; height: 2px } +.node-drop-slot.is-dragging-over { background: #ddffee; height: 20px; border: 2px dotted #888; } +.toggle-children-wrapper-expanded .toggle-children { transform: rotate(90deg) } +.toggle-children-wrapper-collapsed .toggle-children { transform: rotate(0); } +.toggle-children-wrapper { + padding: 2px 3px 5px 1px; +} +/* tslint:disable */ +.toggle-children { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABAhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ1dWlkOjY1RTYzOTA2ODZDRjExREJBNkUyRDg4N0NFQUNCNDA3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkYzRkRFQjcxODUzNTExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkYzRkRFQjcwODUzNTExRTU4RTQwRkQwODFEOUZEMEE3IiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTk5NzA1OGEtZDI3OC00NDZkLWE4ODgtNGM4MGQ4YWI1NzNmIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YzRkZmQxMGMtY2NlNS0xMTc4LWE5OGQtY2NkZmM5ODk5YWYwIi8+IDxkYzp0aXRsZT4gPHJkZjpBbHQ+IDxyZGY6bGkgeG1sOmxhbmc9IngtZGVmYXVsdCI+Z2x5cGhpY29uczwvcmRmOmxpPiA8L3JkZjpBbHQ+IDwvZGM6dGl0bGU+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+5iogFwAAAGhJREFUeNpiYGBgKABigf///zOQg0EARH4A4gZyDIIZ8B/JoAJKDIDhB0CcQIkBRBtEyABkgxwoMQCGD6AbRKoBGAYxQgXIBRuZGKgAKPIC3QLxArnRSHZCIjspk52ZKMrOFBUoAAEGAKnq593MQAZtAAAAAElFTkSuQmCC'); + height: 8px; + width: 9px; + background-size: contain; + display: inline-block; + position: relative; + top: 1px; + background-repeat: no-repeat; + background-position: center; +} +.toggle-children-placeholder { + display: inline-block; + height: 10px; + width: 10px; + position: relative; + top: 1px; + padding-right: 3px; +} +.node-content-wrapper { + display: inline-block; + padding: 2px 5px; + border-radius: 2px; + transition: background-color .15s,box-shadow .15s; +} +.node-wrapper {display: flex; align-items: flex-start;} +.node-content-wrapper-active, +.node-content-wrapper.node-content-wrapper-active:hover, +.node-content-wrapper-active.node-content-wrapper-focused { + background: #beebff; +} +.node-content-wrapper-focused { background: #e7f4f9 } +.node-content-wrapper:hover { background: #f7fbff } +.node-content-wrapper-active, .node-content-wrapper-focused, .node-content-wrapper:hover { + box-shadow: inset 0 0 1px #999; +} +.node-content-wrapper.is-dragging-over { background: #ddffee; box-shadow: inset 0 0 1px #999; } +.node-content-wrapper.is-dragging-over-disabled { opacity: 0.5 } + +tree-viewport { + height: 100%; + overflow: auto; + display: block; +} +.tree-children { padding-left: 20px } +.empty-tree-drop-slot .node-drop-slot { height: 20px; min-width: 100px } +.angular-tree-component { + width: 100%; + position:relative; + display: inline-block; + cursor: pointer; + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Chrome/Safari/Opera */ + -khtml-user-select: none; /* Konqueror */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE/Edge */ + user-select: none; /* non-prefixed version, currently not supported by any browser */ +} + +tree-root .angular-tree-component-rtl { + direction: rtl; +} +tree-root .angular-tree-component-rtl .toggle-children-wrapper-collapsed .toggle-children { + transform: rotate(180deg) !important; +} +tree-root .angular-tree-component-rtl .tree-children { + padding-right: 20px; + padding-left: 0; +} + +tree-node-checkbox { + padding: 1px; +} + + +available-models-tree { + height: 100%; + &.left-side{ + background: #F2F2F2; + padding: 0; + border-right: #D2D2D2 1px solid; + max-width: 690px; + } + + .available-models-tree { + display: flex; + flex-direction: column; + line-height: 14px; + min-width: 340px; + padding: 30px; + height: 100%; + .models-tree-header { + display: flex; + justify-content: space-between; + + h5 { + margin: 0; + font-family: OpenSans-Semibold; + color: #191919; + font-size: 16px; + + span { + vertical-align: middle; + display: inline-block; + font-size: 16px; + color: #191919; + line-height: 16px; + &.sub-title { + font-family: OpenSans-Regular; + font-size: 14px; + color: #0D0D0D; + } + } + + #service-model-name { + padding-top: 5px; + display: block; + font-size: 14px; + } + } + + .search-container { + width: 275px; + } + } + .available-models-content-wrapper { + flex: 1; + display: flex; + flex-direction: column; + margin-top: 20px; + + + tree-root { + flex: 1; + display: flex; + } + tree-viewport { + flex: 1; + .tree-node { + color: #5A5A5A; + font-size: 13px; + white-space: normal; + word-break: break-all; + tree-node-drop-slot { + .node-drop-slot { + display: none; + } + } + &.tree-node-disabled { + color: #D2D2D2; + cursor: default; + pointer-events: none; + } + &:not(.tree-node-disabled) { + >tree-node-wrapper { + .node-wrapper:hover { + color: #191919; + .node-content-wrapper.node-content-wrapper-focused { + tree-node-content { + > div { + background: #009FDB; + color: white; + } + } + } + .node-content-wrapper { + tree-node-content { + > div { + background: #F2F2F2; + &.tree-node-focused:not(.tree-node-disabled) { + background: #009FDB; + color: white; + } + span.actions { + .icon-plus{ + display: block; + color: #009FDB; + span:before { + display: inline-block; + color: #5A5A5A; + } + } + } + } + } + } + } + } + } + &.tree-node-focused:not(.tree-node-disabled) { + & > tree-node-wrapper { + .node-wrapper { + border-color: #1EB9F3; + .node-content-wrapper{ + background: #009FDB; + border-color: #1EB9F3; + } + .node-content-wrapper-focused{ + box-shadow: none; + tree-node-content { + + .vf-type{ + color: #ffffff; + border-color: #1EB9F3; + } + > div { + span.actions { + .icon-plus { + color: #ffffff; + } + } + } + } + } + } + } + } + tree-node-wrapper { + .node-wrapper { + height: 36px; + tree-node-expander { + font-family: 'icomoon' !important; + height: 100%; + .toggle-children-wrapper { + padding: 0; + display: block; + height: 100%; + span.toggle-children { + display: flex; + width: 20px; + top: 0; + height: inherit; + background-image: none; + &:before { + content: "\e900"; + font-weight: 600; + text-align: center; + display: inline-block; + flex: auto; + align-self: center; + font-size: 20px; + } + } + } + .toggle-children-wrapper-expanded { + span.toggle-children { + transform: none; + &:before { + content: "\e930"; + } + } + } + .toggle-children-placeholder { + width: 20px; + } + } + .node-content-wrapper { + padding: 0; + background: none; + box-shadow: none; + height: 100%; + flex: 1; + min-width: 0; + border-left: 1px solid #D2D2D2; + tree-node-content { + > div { + height: 100%; + display: flex; + align-items: center; + justify-content: space-between; + span { + &.actions { + height: 100%; + display: flex; + justify-content: space-between; + align-items: center; + >span { + width: 45px; + max-width: 45px; + text-align: center; + } + .number-button { + width: 30px; + padding-left: 0; + text-align: center; + span { + display: block; + font-family: OpenSans-SemiBold; + font-size: 13px; + color: #5A5A5A; + line-height: 16px; + } + } + .icon-plus { + display: none; + width: 45px; + font-size: 22px; + } + } + } + } + } + } + + } + } + } + & > tree-node-collection > tree-node > .node-wrapper{ + //border-top: 1px solid #D2D2D2; + } + } + + } + } +} +.highlight { + background-color: #9DD9EF; +} + +#drawing-board-tree{ + .tree-node.tree-node-expanded.tree-node-focused { + } +} + +available-models-tree { + + .tree-root { + margin-top: 35px; + } + + tree-node-expander { + background: #FFFFFF; + border: 1px solid #D2D2D2; + border-right: none; + width: 45px; + padding-left: 12px; + } + + .node-content-wrapper { + border: none; + } + + tree-node-wrapper tree-node-expander{ + background: none !important; + border: none !important; + } + + + .node-wrapper { + height: 45px !important; + background: #FFFFFF; + border: 1px solid #D2D2D2; + } + + tree-node-collection div { + margin-top: 0px; + } + + .tree-node-leaf .node-wrapper tree-node-expander { + display: none; + } + + .tree-node.tree-node-expanded { + margin-bottom: 10px; + } + .tree-node-collapsed { + margin-bottom: 10px; + } + .tree-children { + padding-left: 0; + } + + tree-node-content .actions .number-button { + height: 45px; + padding-top: 14px; + border-right: 1px solid #D2D2D2; + border-left: 1px solid #D2D2D2; + padding-left: 0; + span { + background: none; + font-size: 11px; + color: #5A5A5A; + } + } + + .node-content-wrapper.node-content-wrapper-focused{ + border-color:#1EB9F3 ; + tree-node-content > div{ + .vf-type,.model-info,.model-info .property-name { + color: white; + } + .number-button{ + border-color: #1EB9F3 ; + span{ + color: white !important; + } + } + + } + } + + + + .vf-type { + width: 40px; + height: 45px; + padding-top: 16px; + border-right: 1px solid #D2D2D2; + color: #959595; + font-size: 13px; + font-family: OpenSans-SemiBold; + text-transform: uppercase; + text-align: center; + flex-basis: 40px; + flex-grow: 0; + flex-shrink: 0; + } + + .isParent { + width: 100%; + padding-left: 0 !important; + } + .model-info { + padding-left: 16px; + width: 100%; + .property-name { + font-family: OpenSans-Regular; + font-size: 12px; + line-height: 12px; + color: #191919; + //text-transform: capitalize; problematic with search + .auto-name{ + display: inline-flex;//required for search more then one sub highlight + } + } + + tree-node-header-properties { + display: none; + } + } + + .span-name { + margin-right: auto; + padding-left: 10px; + } + + .toggle-children-wrapper.toggle-children-wrapper-expanded { + .toggle-children:before { + color: #009FDB; + } + } + + .tree-node.tree-node-expanded .tree-children { + } + + .tree-node.tree-node-expanded.tree-node-focused .tree-children { + + } + + .tree-node.tree-node-expanded > tree-node-wrapper{ + box-shadow: 0 2px 2px 0 rgba(0,0,0,.1); + position: relative; + z-index: 1; + display: block; + } + + .tree-node-leaf .node-wrapper{ + margin-left: 46px; + border-left: none; + } + .tree-children .tree-node-leaf .node-wrapper{ + margin-left: 86px; + } +} + +@media (max-width: 992px) { + available-models-tree{ + //width: 40%; + max-width: 690px; + } + drawing-board-tree{ + //width: 60%; + } +} + +@media (min-width: 992px) { + available-models-tree{ + //width: 50%; + max-width: 650px; + } + drawing-board-tree{ + //width: 50%; + } +} + + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts new file mode 100644 index 000000000..31d7b03b8 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts @@ -0,0 +1,167 @@ +import {Component, EventEmitter, Output, ViewChild} from '@angular/core'; +import {ITreeOptions, TreeComponent} from 'angular-tree-component'; +import {IDType, ITreeNode} from 'angular-tree-component/dist/defs/api'; +import {DialogService} from 'ng2-bootstrap-modal'; +import {AvailableModelsTreeService} from './available-models-tree.service'; +import {NgRedux} from "@angular-redux/store"; +import {ActivatedRoute} from '@angular/router'; +import {AppState} from '../../../shared/store/reducers'; +import {AaiService} from '../../../shared/services/aaiService/aai.service'; +import {ServiceNodeTypes} from '../../../shared/models/ServiceNodeTypes'; +import {IframeService} from "../../../shared/utils/iframe.service"; +import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {VfModulePopuopService} from "../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {NetworkPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import {createVFModuleInstance} from "../../../shared/storeUtil/utils/vfModule/vfModule.actions"; +import {VnfPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {DrawingBoardModes} from "../drawing-board.modes"; +import {DrawingBoardTreeService} from "../drawing-board-tree/drawing-board-tree.service"; +import {ObjectToModelTreeService} from "../objectsToTree/objectToModelTree/objectToModelTree.service"; +import {VnfGroupPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; +import {changeInstanceCounter} from "../../../shared/storeUtil/utils/general/general.actions"; +import {createVnfGroupInstance} from "../../../shared/storeUtil/utils/vnfGroup/vnfGroup.actions"; +import {VnfGroupControlGenerator} from "../../../shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator"; +import {HighlightPipe} from "../../../shared/pipes/highlight/highlight-filter.pipe"; +import * as _ from 'lodash'; +import {DrawingBoardTreeComponent} from "../drawing-board-tree/drawing-board-tree.component"; + + +@Component({ + selector: 'available-models-tree', + templateUrl: './available-models-tree.component.html', + styleUrls: ['./available-models-tree.component.scss'], + providers : [HighlightPipe] +}) + +export class AvailableModelsTreeComponent { + filterValue : string = ''; + serviceModelId: string; + serviceHierarchy; + parentElementClassName = 'content'; + _store: NgRedux<AppState>; + isNewObject: boolean; + availableModelsTreeService: AvailableModelsTreeService; + drawingBoardTreeService: DrawingBoardTreeService; + + constructor(private _iframeService: IframeService, + private _aaiService: AaiService, + private route: ActivatedRoute, + private dialogService: DialogService, + private _availableModelsTreeService: AvailableModelsTreeService, + private _drawingBoardTreeService: DrawingBoardTreeService, + private _defaultDataGeneratorService: DefaultDataGeneratorService, + private _vnfGroupControlGenerator: VnfGroupControlGenerator, + private _vfModulePopuopService: VfModulePopuopService, + private _vnfGroupPopupService: VnfGroupPopupService, + private _vnfPopupService: VnfPopupService, + private _networkPopupService: NetworkPopupService, + private store: NgRedux<AppState>, + private _objectToModelTreeService : ObjectToModelTreeService, + private _sharedTreeService : SharedTreeService, + private _highlightPipe : HighlightPipe) { + this.availableModelsTreeService = _availableModelsTreeService; + this.drawingBoardTreeService = _drawingBoardTreeService; + + this._store = store; + this.route + .queryParams + .subscribe(params => { + this.serviceModelId = params['serviceModelId']; + this._aaiService.getServiceModelById(this.serviceModelId).subscribe( + value => { + this.serviceHierarchy = value; + this.nodes = this._objectToModelTreeService.convertServiceHierarchyModelToTreeNodes(this.serviceHierarchy); + }, + error => { + console.log('error is ', error) + } + ); + }); + + } + + @Output() + highlightInstances: EventEmitter<number> = new EventEmitter<number>(); + @ViewChild('tree') tree: TreeComponent; + + nodes = []; + service = {name: ''}; + + options: ITreeOptions = { + nodeHeight: 36, + dropSlotHeight: 0, + nodeClass: (node: ITreeNode) => { + if (node.data.type === ServiceNodeTypes.VFmodule && ! node.parent.data['getNodeCount'](node.parent, this.serviceModelId) && this.store.getState().global.drawingBoardStatus !== DrawingBoardModes.VIEW) { + node.data.disabled = true; + return 'tree-node tree-node-disabled'; + } + node.data.disabled = false; + return 'tree-node'; + } + }; + + + getNodeName(node : ITreeNode, filter : string) { + return this._highlightPipe.transform(node.data.name ,filter ? filter : ''); + } + + expandParentByNodeId(id: IDType): void { + this.tree.treeModel.getNodeById(id).parent.expand(); + } + + updateNodes(updateData : {nodes : any, filterValue : string}) : void { + this.nodes = updateData.nodes; + this.filterValue = updateData.filterValue; + } + + selectNode(node: ITreeNode): void { + node.expand(); + this._sharedTreeService.setSelectedVNF(null); + this.highlightInstances.emit(node.data.modelUniqueId); + } + + + + onClickAdd(node: ITreeNode, serviceId: string , isNewObject: boolean = false): void { + this.isNewObject = isNewObject; + let data = node.data; + let dynamicInputs = data.dynamicInputs; + let isAlaCarte: boolean = this.serviceHierarchy.service.instantiationType == "A-La-Carte"; + let isEcompGeneratedNaming: boolean = data.isEcompGeneratedNaming; + let type: string = data.type; + if (!this.store.getState().global.flags['FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD'] || node.data.type === ServiceNodeTypes.VF || + this._availableModelsTreeService.shouldOpenDialog(type, dynamicInputs, isEcompGeneratedNaming)) { + this._iframeService.addClassOpenModal(this.parentElementClassName); + node.data.onAddClick(node, serviceId); + } else { + if (node.data.type === ServiceNodeTypes.VnfGroup) { + let instanceName = this._vnfGroupControlGenerator.getDefaultInstanceName(null, serviceId, node.data.name); + let vnfGroup = this._defaultDataGeneratorService.generateVnfGroupInstance(this.serviceHierarchy.vnfGroups[node.data.name], isEcompGeneratedNaming, isAlaCarte, instanceName); + this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId, serviceId, 1 , <any> {data: {type: 'VnfGroup'}})); + this._store.dispatch(createVnfGroupInstance(vnfGroup, node.data.name, serviceId, node.data.name)); + DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); + } else { + let vfModule = this._defaultDataGeneratorService.generateVFModule(this.serviceHierarchy.vnfs[node.parent.data.name].vfModules[node.data.name], dynamicInputs, isEcompGeneratedNaming, isAlaCarte); + if (this._sharedTreeService.selectedVNF) { + this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, this._sharedTreeService.selectedVNF)); + DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); + } else if (this._availableModelsTreeService.getOptionalVNFs(this.serviceModelId, node.parent.data.name).length === 1) { + let existVnf = this._store.getState().service.serviceInstance[this.serviceModelId].vnfs; + if(!_.isNil(existVnf)){ + for(let vnfKey in existVnf){ + if(existVnf[vnfKey]['modelInfo'].modelUniqueId === node.parent.data.id){ + this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, vnfKey)); + DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); + } + } + } + + + } else { + this._availableModelsTreeService.addingAlertAddingNewVfModuleModal(); + } + } + } + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.spec.ts index 10cbb0d8f..cf9d04aae 100644 --- a/vid-webpack-master/src/app/drawingBoard/available-models-tree/available-models-tree.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.spec.ts @@ -3,85 +3,62 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; -import {AvailableModelsTreeService} from './available-models-tree.service'; -import {ServicePlanningService} from "../../services/service-planning.service"; -import {ServiceNodeTypes} from "../../shared/models/ServiceNodeTypes"; -import {NgRedux} from "@angular-redux/store"; -import {MockAppStore} from "../../services/service-planning.service.spec"; +import {AvailableModelsTreeService, AvailableNodeIcons} from './available-models-tree.service'; +import {ServiceNodeTypes} from "../../../shared/models/ServiceNodeTypes"; +import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {MessageBoxService} from "../../../shared/components/messageBox/messageBox.service"; +import {MessageBoxData} from "../../../shared/components/messageBox/messageBox.data"; +import {SdcUiCommon} from "onap-ui-angular"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; describe('Available Models Tree Service', () => { + let injector; let service: AvailableModelsTreeService; let httpMock: HttpTestingController; - beforeEach(() => { - + beforeAll(done => (async () => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], + imports: [HttpClientTestingModule, NgReduxTestingModule], providers: [AvailableModelsTreeService, - ServicePlanningService, - {provide: NgRedux, useClass: MockAppStore}] + DefaultDataGeneratorService, + SharedTreeService, + MockNgRedux] }); + await TestBed.compileComponents(); + injector = getTestBed(); + service = injector.get(AvailableModelsTreeService); + httpMock = injector.get(HttpTestingController); + })().then(done).catch(done.fail)); - injector = getTestBed(); - service = injector.get(AvailableModelsTreeService); - httpMock = injector.get(HttpTestingController); - }); - - describe('#shouldShowAddIcon', () => { - it('should return true if number of current vnf modules is under the max', (done: DoneFn) => { - let treeNode = { - data: { - children: [], - name: 'vf_vmee0..VfVmee..base_vmme..module-0' - } - }; - let serviceHierarchy = getSericeServiceHierarchy(); - let result = service.shouldShowAddIcon(treeNode, serviceHierarchy, '6e59c5de-f052-46fa-aa7e-2fca9d674c44', 0); - expect(result).toBeTruthy(); - done(); - }); - - it('should return false if number of current vnf modules are more than max', (done: DoneFn) => { - let treeNode = { - data: { - children: [], - name: 'vf_vmee0..VfVmee..base_vmme..module-0' - } - }; + test('addingAlertAddingNewVfModuleModal should open message modal', () => { + jest.spyOn(MessageBoxService.openModal, 'next'); + service.addingAlertAddingNewVfModuleModal(); - let serviceHierarchy = getSericeServiceHierarchy(); - let result = service.shouldShowAddIcon(treeNode, serviceHierarchy, '6e59c5de-f052-46fa-aa7e-2fca9d674c44', 2); - expect(result).toBeFalsy(); - done(); - }); + expect(MessageBoxService.openModal.next).toHaveBeenCalledWith(new MessageBoxData( + "Select a parent", // modal title + "There are multiple instances on the right side that can contain this vf-module Please select the VNF instance, to add this vf-module to, on the right side and then click the + sign", + SdcUiCommon.ModalType.warning, + SdcUiCommon.ModalSize.medium, + [ + {text: "Close", size: "medium", closeModal: true} + ])); + }); - it('should return true if number of current vnf modules are more than max and max is null', (done: DoneFn) => { - let treeNode = { - data: { - children: [], - name: 'vf_vmee0..VfVmee..base_vmme..module-0' - } - }; - let serviceHierarchy = getSericeServiceHierarchy(); - let result = service.shouldShowAddIcon(treeNode, serviceHierarchy, '6e59c5de-f052-46fa-aa7e-2fca9d674c44', 0); - expect(result).toBeTruthy(); - done(); - }); - }); describe('#shouldOpenModalDialogOnAddInstance', () => { - let serviceHierarchy = getSericeServiceHierarchy(); + let serviceHierarchy = getServiceServiceHierarchy(); - it('should open popup on add instance', (done: DoneFn) => { + test('should open popup on add instance', () => { // add vnf should return true - let result = service.shouldOpenDialog(ServiceNodeTypes.VF, [], false); + let result = service.shouldOpenDialog(ServiceNodeTypes.VF, [], true); expect(result).toBeTruthy(); // add vfModule with user provided naming should return true - result = service.shouldOpenDialog(ServiceNodeTypes.VFmodule, [], true); + result = service.shouldOpenDialog(ServiceNodeTypes.VFmodule, [], false); expect(result).toBeTruthy(); // add vfModule with dynamicInputs without defaultValues should return true @@ -91,7 +68,7 @@ describe('Available Models Tree Service', () => { name: '2017488_adiodvpe0_vnf_config_template_version', isRequired: true, description: 'VPE Software Version' - }], false); + }], true); expect(result).toBeTruthy(); // add vfModule with dynamicInputs with defaultValues should return false @@ -102,13 +79,12 @@ describe('Available Models Tree Service', () => { value: '17.2', isRequired: true, description: 'VPE Software Version' - }], false); + }], true); expect(result).toBeFalsy(); - done(); }); }); - function getSericeServiceHierarchy() { + function getServiceServiceHierarchy() { return JSON.parse(JSON.stringify( { '6e59c5de-f052-46fa-aa7e-2fca9d674c44': { @@ -118,7 +94,7 @@ describe('Available Models Tree Service', () => { 'name': 'ComplexService', 'version': '1.0', 'toscaModelURL': null, - 'category': 'Mobility', + 'category': 'Emanuel', 'serviceType': '', 'serviceRole': '', 'description': 'ComplexService', @@ -137,7 +113,9 @@ describe('Available Models Tree Service', () => { 'inputs': {}, 'commands': {}, 'properties': { - 'gpb2_Internal2_mac': '00:80:37:0E:02:22', + 'max_instances': '3', + 'min_instances': '1', + 'gpb2_Internal2_mac': '00:11:22:EF:AC:DF', 'sctp-b-ipv6-egress_src_start_port': '0', 'sctp-a-ipv6-egress_rule_application': 'any', 'Internal2_allow_transit': 'true', @@ -145,9 +123,9 @@ describe('Available Models Tree Service', () => { 'sctp-a-egress_rule_application': 'any', 'sctp-b-ingress_action': 'pass', 'sctp-b-ingress_rule_protocol': 'icmp', - 'ncb2_Internal1_mac': '00:80:37:0E:0F:12', + 'ncb2_Internal1_mac': '00:11:22:EF:AC:DF', 'sctp-b-ipv6-ingress-src_start_port': '0.0', - 'ncb1_Internal2_mac': '00:80:37:0E:09:12', + 'ncb1_Internal2_mac': '00:11:22:EF:AC:DF', 'fsb_volume_size_0': '320.0', 'sctp-b-egress_src_addresses': 'local', 'sctp-a-ipv6-ingress_ethertype': 'IPv4', @@ -166,12 +144,12 @@ describe('Available Models Tree Service', () => { 'sctp-a-ipv6-ingress_src_subnet_prefix': '0.0.0.0', 'sctp-b-egress-dst_start_port': '0.0', 'ncb_flavor_name': 'nv.c20r64d1', - 'gpb1_Internal1_mac': '00:80:37:0E:01:22', + 'gpb1_Internal1_mac': '00:11:22:EF:AC:DF', 'sctp-b-egress_dst_subnet_prefix_len': '0.0', - 'Internal2_net_cidr': '169.255.0.0', + 'Internal2_net_cidr': '10.0.0.10', 'sctp-a-ingress-dst_start_port': '0.0', 'sctp-a-egress-dst_start_port': '0.0', - 'fsb1_Internal2_mac': '00:80:37:0E:0B:12', + 'fsb1_Internal2_mac': '00:11:22:EF:AC:DF', 'sctp-a-egress_ethertype': 'IPv4', 'vlc_st_service_mode': 'in-network-nat', 'sctp-a-ipv6-egress_ethertype': 'IPv4', @@ -181,17 +159,17 @@ describe('Available Models Tree Service', () => { 'sctp-a-ingress-src_subnet_prefix_len': '0.0', 'sctp-b-ipv6-ingress-src_end_port': '65535.0', 'sctp-b-name': 'epc-sctp-b-ipv4v6-sec-group', - 'fsb2_Internal1_mac': '00:80:37:0E:0D:12', + 'fsb2_Internal1_mac': '00:11:22:EF:AC:DF', 'sctp-a-ipv6-ingress-src_start_port': '0.0', 'sctp-b-ipv6-egress_ethertype': 'IPv4', - 'Internal1_net_cidr': '169.253.0.0', + 'Internal1_net_cidr': '10.0.0.10', 'sctp-a-egress_dst_subnet_prefix': '0.0.0.0', 'fsb_flavor_name': 'nv.c20r64d1', 'sctp_rule_protocol': '132', 'sctp-b-ipv6-ingress_src_subnet_prefix_len': '0', 'sctp-a-ipv6-ingress_rule_application': 'any', 'sctp-a-IPv6_ethertype': 'IPv6', - 'vlc2_Internal1_mac': '00:80:37:0E:02:12', + 'vlc2_Internal1_mac': '00:11:22:EF:AC:DF', 'vlc_st_virtualization_type': 'virtual-machine', 'sctp-b-ingress-dst_start_port': '0.0', 'sctp-b-ingress-dst_end_port': '65535.0', @@ -209,7 +187,7 @@ describe('Available Models Tree Service', () => { 'Internal2_shared': 'false', 'sctp-a-ipv6-egress_dst_subnet_prefix_len': '0', 'Internal2_rpf': 'disable', - 'vlc1_Internal1_mac': '00:80:37:0E:01:12', + 'vlc1_Internal1_mac': '00:11:22:EF:AC:DF', 'sctp-b-ipv6-egress_src_end_port': '65535', 'sctp-a-ipv6-egress_src_addresses': 'local', 'sctp-a-ingress-dst_end_port': '65535.0', @@ -219,41 +197,41 @@ describe('Available Models Tree Service', () => { 'sctp-a-dst_subnet_prefix_v6': '::', 'pxe_image_name': 'MME_PXE-Boot_16ACP04_GA.qcow2', 'vlc_st_interface_type_gtp': 'other0', - 'ncb1_Internal1_mac': '00:80:37:0E:09:12', + 'ncb1_Internal1_mac': '00:11:22:EF:AC:DF', 'sctp-b-src_subnet_prefix_v6': '::', 'sctp-a-egress_dst_subnet_prefix_len': '0.0', 'int1_sec_group_name': 'int1-sec-group', 'Internal1_dhcp': 'false', 'sctp-a-ipv6-egress_dst_end_port': '65535', 'Internal2_forwarding_mode': 'l2', - 'fsb2_Internal2_mac': '00:80:37:0E:0D:12', + 'fsb2_Internal2_mac': '00:11:22:EF:AC:DF', 'sctp-b-egress_dst_subnet_prefix': '0.0.0.0', 'Internal1_net_cidr_len': '17', - 'gpb2_Internal1_mac': '00:80:37:0E:02:22', + 'gpb2_Internal1_mac': '00:11:22:EF:AC:DF', 'sctp-b-ingress-src_subnet_prefix_len': '0.0', 'sctp-a-ingress_dst_addresses': 'local', 'sctp-a-egress_action': 'pass', 'fsb_volume_type_0': 'SF-Default-SSD', - 'ncb2_Internal2_mac': '00:80:37:0E:0F:12', + 'ncb2_Internal2_mac': '00:11:22:EF:AC:DF', 'vlc_st_interface_type_sctp_a': 'left', 'vlc_st_interface_type_sctp_b': 'right', 'sctp-a-src_subnet_prefix_v6': '::', 'vlc_st_version': '2', 'sctp-b-egress_ethertype': 'IPv4', 'sctp-a-ingress_rule_application': 'any', - 'gpb1_Internal2_mac': '00:80:37:0E:01:22', + 'gpb1_Internal2_mac': '00:11:22:EF:AC:DF', 'instance_ip_family_v6': 'v6', 'sctp-a-ipv6-egress_src_start_port': '0', 'sctp-b-ingress-src_start_port': '0.0', 'sctp-b-ingress_dst_addresses': 'local', - 'fsb1_Internal1_mac': '00:80:37:0E:0B:12', + 'fsb1_Internal1_mac': '00:11:22:EF:AC:DF', 'vlc_st_interface_type_oam': 'management', 'multi_stage_design': 'false', 'oam_sec_group_name': 'oam-sec-group', - 'Internal2_net_gateway': '169.255.0.3', + 'Internal2_net_gateway': '10.0.0.10', 'sctp-a-ipv6-ingress-dst_end_port': '65535', 'sctp-b-ipv6-egress-dst_start_port': '0', - 'Internal1_net_gateway': '169.253.0.3', + 'Internal1_net_gateway': '10.0.0.10', 'sctp-b-ipv6-egress_rule_protocol': 'any', 'gtp_sec_group_name': 'gtp-sec-group', 'sctp-a-ipv6-egress_dst_subnet_prefix': '0.0.0.0', @@ -275,7 +253,7 @@ describe('Available Models Tree Service', () => { 'vlc_st_service_type': 'firewall', 'sctp-b-ipv6-egress_dst_end_port': '65535', 'sctp-b-ipv6-ingress-dst_start_port': '0', - 'vlc2_Internal2_mac': '00:80:37:0E:02:12', + 'vlc2_Internal2_mac': '00:11:22:EF:AC:DF', 'vlc_st_availability_zone': 'true', 'fsb_volume_image_name_1': 'MME_FSB2_16ACP04_GA.qcow2', 'sctp-b-ingress-src_subnet_prefix': '0.0.0.0', @@ -287,7 +265,7 @@ describe('Available Models Tree Service', () => { 'sctp-b-ipv6-ingress_dst_addresses': 'local', 'sctp-b-ipv6-egress_dst_subnet_prefix': '0.0.0.0', 'sctp-b-ipv6-ingress_ethertype': 'IPv4', - 'vlc1_Internal2_mac': '00:80:37:0E:01:12', + 'vlc1_Internal2_mac': '00:11:22:EF:AC:DF', 'sctp-a-ingress-src_subnet_prefix': '0.0.0.0', 'sctp-a-ipv6-ingress_action': 'pass', 'Internal1_rpf': 'disable', @@ -446,5 +424,4 @@ describe('Available Models Tree Service', () => { } )); } - }); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.ts new file mode 100644 index 000000000..dc72f8f12 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.ts @@ -0,0 +1,76 @@ +import {Injectable} from '@angular/core'; +import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../shared/store/reducers"; +import {MessageBoxData} from "../../../shared/components/messageBox/messageBox.data"; +import {MessageBoxService} from "../../../shared/components/messageBox/messageBox.service"; +import * as _ from "lodash"; +import { SdcUiCommon} from "onap-ui-angular"; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; + +export class AvailableNodeIcons { + addIcon: boolean; + vIcon: boolean; + + constructor(addIcon: boolean, vIcon: boolean) { + this.addIcon = addIcon; + this.vIcon = vIcon; + } +} + +@Injectable() +export class AvailableModelsTreeService { + constructor(private _defaultDataGeneratorService: DefaultDataGeneratorService, + private store: NgRedux<AppState>, + public _shareTreeService : SharedTreeService) { + } + + + + shouldOpenDialog(type: string, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean { + if (!isEcompGeneratedNaming || this._defaultDataGeneratorService.requiredFields[type].length > 0) { + return true; + } + + if (dynamicInputs) { + for(let input of dynamicInputs) { + if (input.isRequired && _.isEmpty(input.value)) { + return true; + } + } + } + return false; + } + + getOptionalVNFs(serviceUUID: string, vnfOriginalModelName : string) : any[] { + let result = []; + if(!_.isNil(this.store.getState().service.serviceInstance) && !_.isNil(this.store.getState().service.serviceInstance[serviceUUID])){ + const serviceVNFsInstances = this.store.getState().service.serviceInstance[serviceUUID].vnfs; + for(let vnfKey in serviceVNFsInstances){ + if(serviceVNFsInstances[vnfKey].originalName === vnfOriginalModelName){ + serviceVNFsInstances[vnfKey].vnfStoreKey = vnfKey; + result.push(serviceVNFsInstances[vnfKey]); + } + } + } + + + return result; + } + + + + addingAlertAddingNewVfModuleModal() : void { + let messageBoxData : MessageBoxData = new MessageBoxData( + "Select a parent", // modal title + "There are multiple instances on the right side that can contain this vf-module Please select the VNF instance, to add this vf-module to, on the right side and then click the + sign", + SdcUiCommon.ModalType.warning, + SdcUiCommon.ModalSize.medium, + [ + {text:"Close", size:"medium", closeModal:true} + ]); + + MessageBoxService.openModal.next(messageBoxData); + } + +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info-model.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info-model.ts new file mode 100644 index 000000000..4c5bf6747 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info-model.ts @@ -0,0 +1,26 @@ +import {ModelInformationItem} from "../../../shared/components/model-information/model-information.component"; + +export class ComponentInfoModel { + type: ComponentInfoType; + modelInfoItems: ModelInformationItem[]; + additionalInfoItems: ModelInformationItem[]; + title: string; + + + constructor(type: ComponentInfoType, modelInfoItems: ModelInformationItem[], additionalInfoItems: ModelInformationItem[], isInstance:boolean=true) { + this.type = type; + this.modelInfoItems = modelInfoItems; + this.additionalInfoItems = additionalInfoItems; + this.title=this.type+(isInstance ? " Instance" : ""); + } +} + + +export enum ComponentInfoType { + SERVICE = "Service", + VNF = "VNF", + NETWORK = "Network", + VFMODULE = "VFModule", + VNFGROUP = "Group", + VNFMEMBER = "VNF" +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.html b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.html new file mode 100644 index 000000000..8f08de076 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.html @@ -0,0 +1,20 @@ +<div *ngIf="componentInfoModel"> + <div class="component-info-wrapper" [attr.data-tests-id]="'component-info-wrapper'"> + <div class="component-info-section" [attr.data-tests-id]="'component-info-section'"> + <div class="title" [attr.data-tests-id]="'component-info-section-title'">{{componentInfoModel?.title}} INFO</div> + <div class="component-info-list" [attr.data-tests-id]="'component-info-section-list'"> + <model-information [modelInformationItems]="componentInfoModel?.modelInfoItems" [itemClass]="'componentInfoItem'"></model-information> + </div> + </div> + </div> + <!-- commented out till we will have a data to show in additional info + <div class="component-info-wrapper" [attr.data-tests-id]="'additional-info-wrapper'">--> + <!--<div class="component-info-section" [attr.data-tests-id]="'additional-info-section'">--> + <!--<div class="title" [attr.data-tests-id]="'additional-info-section-title'">ADDITIONAL INFO</div>--> + <!--<div class="component-info-list" [attr.data-tests-id]="'additional-info-section-title'">--> + <!--<model-information [modelInformationItems]="componentInfoModel.additionalInfoItems" [itemClass]="'componentInfoItem'"></model-information>--> + <!--</div>--> + <!--</div>--> + <!--</div> + --> +</div> diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.scss new file mode 100644 index 000000000..2d7735678 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.scss @@ -0,0 +1,40 @@ +.component-info-wrapper { + + &:first-child { + border-bottom: 1px solid #D2D2D2; + } + .component-info-section { + margin: 15px 25px 0 25px; + + .title { + font-family: OpenSans-SemiBold; + font-size: 14px; + color: #191919; + text-transform: uppercase; + margin-bottom: 15px; + } + } + +} + +:host ::ng-deep .componentInfoItem { + border-top: 1px solid #D2D2D2; + padding-top: 10px; + margin-bottom: 10px; + + label { + font-family: OpenSans-Regular; + font-size: 12px; + color: #5A5A5A; + text-transform: capitalize; + } + + .model-item-value { + font-family: OpenSans-SemiBold; + font-size: 14px; + color: #191919; + line-height: 16px; + } +} + + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts new file mode 100644 index 000000000..c69ab52e1 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts @@ -0,0 +1,40 @@ +import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core'; +import {ComponentInfoService} from "./component-info.service"; +import {ComponentInfoModel, ComponentInfoType} from "./component-info-model"; +import {ActivatedRoute} from "@angular/router"; + + +@Component({ + selector: 'component-info', + templateUrl: './component-info.component.html', + styleUrls: ['./component-info.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class ComponentInfoComponent implements OnInit { + componentInfoModel: ComponentInfoModel = null; + + constructor(private _componentInfoService:ComponentInfoService, private route: ActivatedRoute) {} + + ngOnInit() { + ComponentInfoService.triggerComponentInfoChange.subscribe((input : ComponentInfoModel) => { + if(input.type === ComponentInfoType.SERVICE){ + this.getServiceInformation(); + }else { + this.componentInfoModel = input; + } + }); + + this.getServiceInformation(); + } + + + + getServiceInformation() : void { + this.route + .queryParams + .subscribe(params => { + let serviceModelId = params['serviceModelId']; + this.componentInfoModel = this._componentInfoService.getInfoForService(serviceModelId); + }); + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.spec.ts new file mode 100644 index 000000000..8b0da409b --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.spec.ts @@ -0,0 +1,93 @@ +import {ComponentInfoService} from './component-info.service'; +import {getTestBed, TestBed} from '@angular/core/testing'; +import {MockNgRedux, NgReduxTestingModule} from '@angular-redux/store/testing'; +import {NgRedux} from '@angular-redux/store'; +import {AaiService} from '../../../shared/services/aaiService/aai.service'; +import {HttpClient, HttpHandler} from '@angular/common/http'; +import {FeatureFlagsService} from '../../../shared/services/featureFlag/feature-flags.service'; +import {ModelInformationItem} from "../../../shared/components/model-information/model-information.component"; +import {ComponentInfoModel, ComponentInfoType} from "./component-info-model"; + +class MockAppStore<T> { + getState() { + return { + global: { + }, + service : { + serviceHierarchy : { + '1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd' : { + service:{ + serviceRole: 'Testing', + serviceType: 'pnf', + uuid: '1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd', + version: '1.0', + customizationUuid: '' + } + } + }, + serviceInstance : { + '1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd' : { + globalSubscriberId: 'e433710f-9217-458d-a79d-1c7aff376d89', + subscriptionServiceType:'TYLER SILVIA', + instanceId: '2f7130e8-27d6-4c01-8988-60ca67e8dae4' + } + }, + subscribers: [ + { + 'id': 'CAR_2020_ER', + 'name': 'CAR_2020_ER', + 'isPermitted': true + }, + { + 'id': 'e433710f-9217-458d-a79d-1c7aff376d89', + 'name': 'SILVIA ROBBINS', + 'isPermitted': true + } + ] + } + } + } +} + +beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [NgReduxTestingModule], + providers: [ + AaiService, + HttpClient, + HttpHandler, + FeatureFlagsService, + ComponentInfoService, + {provide: NgRedux, useClass: MockAppStore}, + MockNgRedux] + }); + await TestBed.compileComponents(); + let injector = getTestBed(); + service = injector.get(ComponentInfoService); + })().then(done).catch(done.fail)); + +let service: ComponentInfoService; +describe('Service Info Data', () => { + + test('ComponentInfoService should be defined', () => { + expect(service).toBeDefined(); + }); + + test('Info for service should be correct', () => { + let actualServiceInfo = service.getInfoForService('1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); + let expectedServiceInfo = [ + ModelInformationItem.createInstance('Type', 'pnf'), + ModelInformationItem.createInstance('Model Version', '1.0'), + ModelInformationItem.createInstance('Model Customization ID', ''), + ModelInformationItem.createInstance('Instance ID', '2f7130e8-27d6-4c01-8988-60ca67e8dae4'), + ModelInformationItem.createInstance('Subscriber Name', 'SILVIA ROBBINS'), + ModelInformationItem.createInstance('Service Type', 'TYLER SILVIA'), + ModelInformationItem.createInstance('Service Role', 'Testing'), + ]; + expect(actualServiceInfo).toEqual(new ComponentInfoModel(ComponentInfoType.SERVICE, expectedServiceInfo, [])); + + + }); + +}); + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts new file mode 100644 index 000000000..9318b3aa7 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts @@ -0,0 +1,41 @@ +import {Injectable} from "@angular/core"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../shared/store/reducers"; +import {AaiService} from "../../../shared/services/aaiService/aai.service"; +import {Subject} from "rxjs"; +import {ComponentInfoModel, ComponentInfoType} from "./component-info-model"; +import {ModelInformationItem} from "../../../shared/components/model-information/model-information.component"; +import * as _ from 'lodash'; +@Injectable() +export class ComponentInfoService { + static triggerComponentInfoChange: Subject<ComponentInfoModel> = new Subject<ComponentInfoModel>(); + constructor( private _store: NgRedux<AppState>, private _aaiService : AaiService){ } + + getInfoForService(serviceModelId):ComponentInfoModel { + if(_.isNil(this._store.getState().service.serviceHierarchy[serviceModelId])) return null; + + let serviceHierarchy = this._store.getState().service.serviceHierarchy[serviceModelId].service; + const serviceInstance = this._store.getState().service.serviceInstance[serviceModelId]; + const modelInfoItems: ModelInformationItem[] = [ + ModelInformationItem.createInstance("Subscriber Name",this._aaiService.extractSubscriberNameBySubscriberId(serviceInstance.globalSubscriberId)), + ModelInformationItem.createInstance("Service Type",serviceInstance.subscriptionServiceType), + ModelInformationItem.createInstance("Service Role",serviceHierarchy.serviceRole), + ]; + serviceHierarchy.type = serviceHierarchy.serviceType; + return this.addGeneralInfoItems(modelInfoItems, ComponentInfoType.SERVICE, serviceHierarchy, serviceInstance ); + } + + + addGeneralInfoItems(modelInfoSpecificItems: ModelInformationItem[], type: ComponentInfoType, model, instance) { + let modelInfoItems: ModelInformationItem[] = [ + ModelInformationItem.createInstance("Type", (model && model.type) ? model.type : ((instance && instance.modelInfo) ? instance.modelInfo.modelType : null)), + ModelInformationItem.createInstance("Model Version", model ? model.version : null), + ModelInformationItem.createInstance("Model Customization ID", model ? model.customizationUuid : null), + ModelInformationItem.createInstance("Instance ID", instance ? instance.instanceId : null), + ModelInformationItem.createInstance("In Maintenance", instance? instance.inMaint : null), + ]; + modelInfoItems = modelInfoItems.concat(modelInfoSpecificItems); + const modelInfoItemsWithoutEmpty = _.filter(modelInfoItems, function(item){ return !item.values.every(_.isNil)}); + return new ComponentInfoModel(type, modelInfoItemsWithoutEmpty, []); + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.html b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.html new file mode 100644 index 000000000..f02ed6293 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.html @@ -0,0 +1,78 @@ +<div class="drawing-board-header"> + <div class="left-header"> + <span class="vid-logo-small"></span> + <span class="icon-back"> + <svg-icon + (click)="closePage()" + [testId]="'backBtn'" + [size]="'large'" + [name]="'navigation-arrow-back'"> + </svg-icon> + </span> + + <div class="header-col middleDetails" style="padding-top: 5px;padding-left: 13px;line-height: 100%;" *ngIf="isServiceFailed"> + <custom-popover class="failed-popover-wrap" [value]= "serviceStatusMessage" [placement]="'bottom'" [popoverType]="'error'"> + <span [attr.data-tests-id]="'service-failed-msg'" class="failed-msg labelPosition" >Failed</span> + </custom-popover> + </div> + <div class="header-col middleDetails" style="padding-top: 0px;padding-left: 13px;line-height: 100%;padding-right: 50px;"> + <span [attr.data-tests-id]="'serviceInstance'" class="service-instance-label labelPosition">Service instance:</span> + <span [attr.data-tests-id]="'serviceName'" [ngClass]="{'deleted' : isDeleted}" class="service-instance-name">{{serviceName}}</span> + </div> + <div class="header-col middleDetails notShowOnCreateMode" + style="padding-top: 0px;padding-left: 13px;line-height: 100%;"> + <span [attr.data-tests-id]="'orchStatusLabel'" class="service-instance-label labelPosition">Orch Status:</span> + <span [attr.data-tests-id]="'orchStatusValue'" class="orch-status-value">{{serviceOrchStatus}}</span> + </div> + <div class="quantity-container header-col middleDetails" + style="padding-top: 0px;padding-left: 13px;line-height: 100%;" + tooltip="Number of services to instantiate including all their objects as defined below"> + <span [attr.data-tests-id]="'quantityLabel'" class="quantity-instance-label labelPosition">Scale Times:</span> + <span [attr.data-tests-id]="'servicesQuantity'" class="scale-value" + style="font-family: OpenSans-Semibold;font-size: 13px;"> {{numServicesToDeploy}} </span> + </div> + + <span [attr.data-tests-id]="'serviceStatus'" class="status" tooltip="{{status}}"></span> + <span [attr.data-tests-id]="'isViewOnly-status-test'" class="service-instance-label purple">{{getModeName()}}</span> + </div> + + + <div class="right-header"> + <span class="menu-container notShowOnViewMode notShowOnRetryMode"> + <span [attr.data-tests-id]="'openMenuBtn'" class="icon-browse" (click)="onContextMenu($event)"></span> + <context-menu> + <ng-template *ngIf="drawingBoardHeaderService?.showEditService(mode, serviceModelId)" contextMenuItem (execute)="editService()"> + <div [attr.data-tests-id]="'context-menu-header-edit-item'"> + <span class="icon-edit"></span>Edit</div> + </ng-template> + <ng-template *ngIf="mode === 'EDIT'" contextMenuItem + (execute)="isDeleted=!isDeleted; drawingBoardHeaderService.deleteService(serviceModelId,isDeleted)"> + <div [attr.data-tests-id]="'context-menu-header-delete-item'"><span class="icon-trash"></span>{{isDeleted ? 'Undo delete': 'Delete'}}</div> + </ng-template> + <ng-template *ngIf="mode !== 'CREATE'" contextMenuItem + (execute)="drawingBoardHeaderService.showAuditInfo(serviceModelId)"> + <div [attr.data-tests-id]="'context-menu-header-audit-item'" style="float: left;margin-top: 8px;"> + <svg-icon + [ngClass]="'eye-o'" + class="eye-o" + [size]="'small'" + [name]="'eye-o'"> + </svg-icon></div> + <div style="padding-left: 12px;">Show Audit Info</div> + </ng-template> + </context-menu> + </span> + <button [disabled]="drawingBoardHeaderService?.deployShouldBeDisabled(serviceModelId, mode)" + *ngIf="mode !== 'VIEW' && mode !== 'RETRY'; else viewEditButton" + [attr.data-tests-id]="'deployBtn'" + (click)="deployService()" + class="deploy-btn">{{drawingBoardHeaderService?.getModeButton(mode)}}</button> + <ng-template #viewEditButton> + <button [disabled]="!isPermitted()" + [attr.data-tests-id]="'editBtn'" + (click)="editViewEdit()" + class="deploy-btn">{{drawingBoardHeaderService?.getButtonText(mode)}} + </button> + </ng-template> + </div> +</div> diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.scss new file mode 100644 index 000000000..1242f9429 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.scss @@ -0,0 +1,176 @@ +.drawing-board-header { + height: 60px; + font-family: OpenSans-Regular; + display: flex; + justify-content: space-between; + font-size: 14px; + box-shadow: 2px 2px 6px #D2D2D2; + color: #191919; + z-index: 1; + position: relative; + [class^="icon-"] { + height: 60px; + width: 60px; + display: flex; + align-items: center; + text-align: center; + color: #5A5A5A; + cursor: pointer; + &:before { + font-size: 18px; + width: 100%; + } + &:hover:before { + color: #009FDB; + } + } + .left-header { + display: flex; + align-items: center; + .icon-back { + justify-content: center; + border-right: 1px solid #EAEAEA; + } + .vid-logo-small{ + background: url('../../../../assets/img/vid-logo.jpg') no-repeat; + width: 60px; + height: 60px; + } + .status{ + background: url('../../../../assets/img/indesign.svg') no-repeat center; + width: 24px; + height: 24px; + margin-left: 20px; + } + .header-col { + border-right: 1px solid #d2d2d2; + padding-right: 15px; + margin-left: 15px; + span{ + display: block; + } + &:after{ + content: ""; + background: #D2D2D2; + height: 35px; + width: 1px; + } + } + .service-instance-label { + font-family: OpenSans-Semibold; + font-size: 13px; + color: #5A5A5A; + } + .quantity-instance-label { + font-family: OpenSans-Regular; + font-size: 13px; + color: #5A5A5A; + } + + .labelPosition { + margin-top: 4px; + margin-bottom: 6px; + font-size: 12px; + } + .service-instance-name { + font-family: OpenSans-Semibold; + color: #191919; + background-color: white; + font-size: 14px; + &.deleted{ + text-decoration: line-through; + } + } + .orch-status-value { + font-family: OpenSans-Regular; + font-size: 14px; + color: #191919; + } + .scale-value { + font-family: OpenSans-Regular; + font-size: 14px; + color: #191919; + } + .status { + font-family: OpenSans-Semibold; + line-height: 14px; + font-size: 14px; + text-align: center; + width: 30px; + margin-left: 13px; + margin-right: 3px; + } + + .purple { + color: #9063CD; + } + + .middleDetails { + border-right: 1px solid #EAEAEA; + margin-left: 0; + height: 45px; + } + } + .right-header { + display: flex; + align-items: center; + .quantity-container { + .quantity-label { + padding-left: 10px; + font-family: OpenSans-Semibold; + font-size: 12px; + } + .quantity { + padding: 5px 10px 5px 0; + font-family: OpenSans-Semibold; + font-size: 18px; + } + } + .scale-container { + .scale-label { + padding-left: 10px; + font-family: OpenSans-Semibold; + font-size: 12px; + } + .scale { + padding: 5px 10px 5px 0; + font-family: OpenSans-Semibold; + font-size: 18px; + } + } + [class^="icon-"] { + border-left: 1px solid #EAEAEA; + } + .menu-container { + height: 100%; + display: flex; + background: none; + border: none; + padding: 0; + outline: none; + justify-content: center; + flex-direction: column; + text-align: center; + cursor: pointer; + } + .icon-browse:before { + content: '\e924'; + display: inline-block; + font-size: 24px; + } + .deploy-btn { + color: #FFFFFF ; + background: #009fdb; + width: 128px; + height: 100%; + border: none; + &[disabled] { + cursor: not-allowed; + opacity: .65; + color: #99d6ec; + } + } + } + } + + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.ts new file mode 100644 index 000000000..6e4391572 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.component.ts @@ -0,0 +1,187 @@ +import {Component, ViewChild} from '@angular/core'; +import {ContextMenuComponent, ContextMenuService} from 'ngx-contextmenu'; +import {DialogService} from 'ng2-bootstrap-modal'; +import {MsoService} from '../../../shared/services/msoService/mso.service' +import * as _ from 'lodash'; +import {ActivatedRoute} from '@angular/router'; +import {ServiceInstance} from "../../../shared/models/serviceInstance"; +import {OwningEntity} from "../../../shared/models/owningEntity"; +import {MessageBoxData} from "../../../shared/components/messageBox/messageBox.data"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../shared/store/reducers"; +import {IframeService} from "../../../shared/utils/iframe.service"; +import { + GenericFormPopupComponent, + PopupType +} from "../../../shared/components/genericFormPopup/generic-form-popup.component"; +import {ServicePopupService} from "../../../shared/components/genericFormPopup/genericFormServices/service/service.popup.service"; +import {SdcUiCommon} from "onap-ui-angular"; +import {DrawingBoardModes} from "../drawing-board.modes"; +import {DrawingBoardHeaderService} from "./drawing-board-header.service"; +import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; +import {DrawingBoardPermissions} from "../../guards/servicePlanningGuard/drawingBoardGuard"; +import {MessageBoxService} from "../../../shared/components/messageBox/messageBox.service"; + +@Component({ + selector: 'drawing-board-header', + providers: [MsoService], + templateUrl: './drawing-board-header.component.html', + styleUrls: ['./drawing-board-header.component.scss'] +}) + +export class DrawingBoardHeader { + serviceName: string; + numServicesToDeploy: number; + status: string = 'Designing a new service'; + serviceModelId: string; + jobId: string; + parentElementClassName = 'content'; + mode : DrawingBoardModes = DrawingBoardModes.CREATE; + serviceOrchStatus: string; + isDeleted: boolean = false; + store : NgRedux<AppState>; + drawingBoardPermissions : DrawingBoardPermissions; + drawingBoardHeaderService : DrawingBoardHeaderService; + isServiceFailed: boolean; + serviceStatusMessage: string; + constructor(private _contextMenuService: ContextMenuService, private dialogService: DialogService, + private _iframeService : IframeService, + private route: ActivatedRoute, private msoService: MsoService, + private _servicePopupService : ServicePopupService, + private _drawingBoardHeaderService : DrawingBoardHeaderService, + private _store: NgRedux<AppState>, + private _drawingBoardPermissions : DrawingBoardPermissions) { + this.store = _store; + this.drawingBoardPermissions = _drawingBoardPermissions; + this.drawingBoardHeaderService = _drawingBoardHeaderService; + this.mode = (!_.isNil(this.route.routeConfig.path) && this.route.routeConfig.path !== "") ? this.route.routeConfig.path as DrawingBoardModes : DrawingBoardModes.CREATE; + this.route + .queryParams + .subscribe((params) => { + this.serviceModelId = params['serviceModelId']; + this.jobId = params['jobId']; + if (_.has(this.store.getState().service.serviceHierarchy, this.serviceModelId)) { + this.setValuesFromStore(); + this.store.subscribe(() => { + this.setValuesFromStore(); + }); + } + }); + } + + + @ViewChild(ContextMenuComponent) public contextMenu: ContextMenuComponent; + + editViewEdit(): void { + window.parent.location.assign(this._drawingBoardHeaderService.generateOldViewEditPath()); + } + + isPermitted() : boolean { + return this.drawingBoardPermissions.isEditPermitted; +} + + getModeName():string { + switch (this.mode) { + case DrawingBoardModes.CREATE: + return 'IN DESIGN'; + case DrawingBoardModes.VIEW: + case DrawingBoardModes.RETRY: + return 'VIEW ONLY'; + case DrawingBoardModes.EDIT: + case DrawingBoardModes.RETRY_EDIT: + return 'IN EDITING'; + default: + return 'IN DESIGN'; + } + + } + public onContextMenu($event: MouseEvent, item: any): void { + this._contextMenuService.show.next({ + contextMenu: this.contextMenu, + event: $event, + item: item, + }); + $event.preventDefault(); + $event.stopPropagation(); + } + + private setValuesFromStore() { + if(!_.isNil(this.store.getState().service.serviceInstance) && !_.isNil(this.store.getState().service.serviceInstance[this.serviceModelId])){ + const serviceInstance = this.store.getState().service.serviceInstance[this.serviceModelId]; + this.numServicesToDeploy = serviceInstance.bulkSize; + this.serviceName = serviceInstance.instanceName || '<Automatically Assigned>'; + this.serviceOrchStatus = serviceInstance.orchStatus || ""; + this.isServiceFailed = serviceInstance.isFailed; + this.serviceStatusMessage = serviceInstance.statusMessage; + } + } + + public editService(): void { + this._iframeService.addClassOpenModal(this.parentElementClassName); + this.dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.SERVICE, + uuidData: <any>{ + type : PopupType.SERVICE, + isMacro : this.store.getState().service.serviceHierarchy[this.serviceModelId].service.instantiationType === 'Macro', + serviceId: this.serviceModelId, + popupService: this._servicePopupService + }, + isUpdateMode: true + }); + } + + extractOwningEntityNameAccordingtoId(id:String): string { + let owningEntityName; + _.forEach(this.store.getState().service.categoryParameters.owningEntityList,(owningEntity: OwningEntity) => { + if (owningEntity.id === id) { + owningEntityName = owningEntity.name; + + }}); + return owningEntityName; + } + + extractServiceFields(): any { + let instanceFields : ServiceInstance; + instanceFields = this.store.getState().service.serviceInstance[this.serviceModelId]; + if (instanceFields.action === ServiceInstanceActions.Create) { + instanceFields.subscriberName = this.store.getState().service.subscribers.find(sub => sub.id === instanceFields.globalSubscriberId).name; + instanceFields.owningEntityName = this.extractOwningEntityNameAccordingtoId(instanceFields.owningEntityId); + } + return _.omit(instanceFields,'optionalGroupMembersMap'); + } + + + public deployService(): void { + let instanceFields = this.extractServiceFields(); + if (this.mode !== DrawingBoardModes.RETRY_EDIT) { + instanceFields.rollbackOnFailure = instanceFields.rollbackOnFailure === 'true'; + this.msoService.submitMsoTask(instanceFields).subscribe((result) => { + window.parent.postMessage("navigateToInstantiationStatus", '*'); + }); + } else { + this.msoService.retryBulkMsoTask(this.jobId, instanceFields).subscribe((result) => { + window.parent.postMessage("navigateToInstantiationStatus", '*'); + }); + } + } + + closePage() { + let messageBoxData : MessageBoxData = new MessageBoxData( + "Delete Instantiation", // modal title + "You are about to stop the instantiation process of this service. \nAll data will be lost. Are you sure you want to stop?", + SdcUiCommon.ModalType.warning, + SdcUiCommon.ModalSize.medium, + [ + {text:"Stop Instantiation", size:"large", callback: this.navigate.bind(this), closeModal:true}, + {text:"Cancel", size:"medium", closeModal:true} + ]); + + MessageBoxService.openModal.next(messageBoxData); + } + + + + navigate(){ + window.parent.postMessage("navigateTo", "*"); + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts new file mode 100644 index 000000000..bcf6753b9 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.spec.ts @@ -0,0 +1,184 @@ +import {getTestBed, TestBed} from '@angular/core/testing'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; +import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {DrawingBoardHeaderService} from "./drawing-board-header.service"; +import {ActivatedRoute} from '@angular/router'; +import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; +import {AppState} from "../../../shared/store/reducers"; +import {NgRedux} from "@angular-redux/store"; +import {addServiceAction} from "../../../shared/storeUtil/utils/service/service.actions"; +import {ErrorMsgService} from "../../../shared/components/error-msg/error-msg.service"; +import {DrawingBoardModes} from "../drawing-board.modes"; +import each from "jest-each"; + +class MockAppStore<T>{ + getState() { + return { + service : { + serviceInstance : { + "serviceInstanceId" : { + action: 'None' + } + } + } + } + } +} + +describe('Generate path to old View/Edit ', () => { + let injector; + let service: DrawingBoardHeaderService; + let httpMock: HttpTestingController; + let store : NgRedux<AppState>; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule], + providers: [ + DrawingBoardHeaderService, + DefaultDataGeneratorService, + MockNgRedux, + ErrorMsgService, + { + provide: ActivatedRoute, + useValue: { + snapshot : { + queryParams:{ + 'subscriberId' : 'subscriberId', + 'subscriberName' : 'subscriberName', + 'serviceType' : 'serviceType', + 'serviceInstanceId' : 'serviceInstanceId' + } + } + }, + }] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(DrawingBoardHeaderService); + httpMock = injector.get(HttpTestingController); + store = injector.get(NgRedux); + + })().then(done).catch(done.fail)); + + + test('should generate url to old view/edit ', () => { + const query: string = 'subscriberId=subscriberId&subscriberName=subscriberName&serviceType=serviceType&serviceInstanceId=serviceInstanceId'; + const path = '../../serviceModels.htm#/instantiate?' + query; + let result = service.generateOldViewEditPath(); + expect(result).toEqual(path); + }); + + test('should call update action for Delete',()=>{ + + jest.spyOn(store, 'dispatch'); + service.deleteService("serviceInstanceId", true); + expect(store.dispatch).toHaveBeenCalledWith(addServiceAction("serviceInstanceId", ServiceInstanceActions.Delete)); + }); + + test('should call update action for undo delete',()=>{ + jest.spyOn(store, 'dispatch'); + service.deleteService("serviceInstanceId", false); + expect(store.dispatch).toHaveBeenCalledWith(addServiceAction("serviceInstanceId", ServiceInstanceActions.None)); + }); + + test('deployShouldBeDisabled with validationCounter greater then 0',()=>{ + jest.spyOn(store, 'getState').mockReturnValue({ + service: { + serviceInstance : { + 'serviceInstanceId' : { + validationCounter : 1 + } + } + } + }); + let result = service.deployShouldBeDisabled("serviceInstanceId"); + expect(result).toBeTruthy(); + }); + + test('deployShouldBeDisabled with validationCounter is 0 and not dirty',()=>{ + jest.spyOn(store, 'getState').mockReturnValue({ + service: { + serviceInstance : { + 'serviceInstanceId' : { + validationCounter : 0, + isDirty : false + } + } + } + }); + let result = service.deployShouldBeDisabled("serviceInstanceId"); + expect(result).toBeFalsy(); + }); + + test('deployShouldBeDisabled with validationCounter is 0 and dirty',()=>{ + jest.spyOn(store, 'getState').mockReturnValue({ + service: { + serviceInstance : { + 'serviceInstanceId' : { + validationCounter : 0, + action : 'None', + isDirty : true + } + } + } + }); + let result = service.deployShouldBeDisabled("serviceInstanceId"); + expect(result).not.toBeTruthy(); + }); + + test('deployShouldBeDisabled with validationCounter is 0 and not and action is None and dirty',()=>{ + jest.spyOn(store, 'getState').mockReturnValue({ + service: { + serviceInstance : { + 'serviceInstanceId' : { + validationCounter : 0, + action : ServiceInstanceActions.None, + isDirty : true + } + } + } + }); + let result = service.deployShouldBeDisabled("serviceInstanceId"); + expect(result).not.toBeTruthy(); + }); + + + test('getModeButton',()=>{ + let result : string = service.getModeButton("EDIT"); + expect(result).toEqual('UPDATE'); + + result = service.getModeButton(""); + expect(result).toEqual('DEPLOY'); + + result = service.getModeButton("RETRY_EDIT"); + expect(result).toEqual('REDEPLOY'); + }); + test('getButtonText',()=>{ + expect(service.getButtonText("VIEW")).toEqual('EDIT'); + expect(service.getButtonText("RETRY")).toEqual('REDEPLOY'); + + }); + const showEditServiceDataProvider = [ + ['Create action CREATE mode', DrawingBoardModes.CREATE ,ServiceInstanceActions.Create, true], + ['Create action RETRY_EDIT mode',DrawingBoardModes.RETRY_EDIT, ServiceInstanceActions.Create, true], + ['Create action EDIT mode',DrawingBoardModes.EDIT, ServiceInstanceActions.Create, true], + ['Create action RETRY mode',DrawingBoardModes.RETRY, ServiceInstanceActions.Create, false], + ['None action EDIT mode',DrawingBoardModes.EDIT, ServiceInstanceActions.None, false], + ['None action RETRY_EDIT mode', DrawingBoardModes.RETRY_EDIT, ServiceInstanceActions.None, false]]; + each(showEditServiceDataProvider).test('showEditService service with %s', (description, mode, action, enabled) => { + jest.spyOn(store, 'getState').mockReturnValue({ + service: { + serviceInstance : { + 'serviceInstanceId' : { + action : action + } + } + } + }); + expect(service.showEditService(mode, 'serviceInstanceId')).toBe(enabled); + + }); +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts new file mode 100644 index 000000000..946c5cab5 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/drawing-board-header.service.ts @@ -0,0 +1,86 @@ +import {Injectable} from "@angular/core"; +import {ActivatedRoute} from "@angular/router"; +import {addServiceAction} from "../../../shared/storeUtil/utils/service/service.actions"; +import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; +import {AppState} from "../../../shared/store/reducers"; +import {DrawingBoardTreeComponent} from "../drawing-board-tree/drawing-board-tree.component"; +import {AuditInfoModalComponent} from "../../../shared/components/auditInfoModal/auditInfoModal.component"; +import {ServiceModel} from "../../../shared/models/serviceModel"; +import {NgRedux} from "@angular-redux/store"; +import * as _ from 'lodash'; +import {ErrorMsgService} from "../../../shared/components/error-msg/error-msg.service"; +import {DrawingBoardModes} from "../drawing-board.modes"; +import {ServiceInstance} from "../../../shared/models/serviceInstance"; + +@Injectable() +export class DrawingBoardHeaderService{ + + constructor(private route: ActivatedRoute, private store: NgRedux<AppState>, private errorMsgService: ErrorMsgService){} + generateOldViewEditPath(): string{ + let query: string = + `subscriberId=${this.route.snapshot.queryParams['subscriberId']}&` + + `subscriberName=${this.route.snapshot.queryParams['subscriberName']}&` + + `serviceType=${this.route.snapshot.queryParams['serviceType']}&` + + `serviceInstanceId=${this.route.snapshot.queryParams['serviceInstanceId']}`; + return '../../serviceModels.htm#/instantiate?' + query; + } + + deleteService(serviceModelId: string, isDeleted: boolean ) { + if(isDeleted){ + this.store.dispatch(addServiceAction(serviceModelId, ServiceInstanceActions.Delete)); + DrawingBoardTreeComponent.triggerDeleteActionService.next(serviceModelId); + } else{ + this.store.dispatch(addServiceAction(serviceModelId, ServiceInstanceActions.None)); + DrawingBoardTreeComponent.triggerUndoDeleteActionService.next(serviceModelId); + } + } + + showAuditInfo(serviceModelId) : void { + let instance: ServiceInstance = this.store.getState().service.serviceInstance[serviceModelId]; + let model = new ServiceModel(this.store.getState().service.serviceHierarchy[serviceModelId]); + AuditInfoModalComponent.openInstanceAuditInfoModal.next({instanceId : serviceModelId , type : 'SERVICE', model : model , instance : instance, trackById: instance.trackById}); + } + + + /************************************************* + should return true if deploy should be disabled + *************************************************/ + deployShouldBeDisabled(serviceInstanceId: string, mode : string) : boolean { + const serviceInstance = this.store.getState().service.serviceInstance[serviceInstanceId]; + if(!_.isNil(serviceInstance)){ + const validationCounter = serviceInstance.validationCounter; + if (!_.isNil(this.errorMsgService.errorMsgObject)&& mode !== DrawingBoardModes.RETRY_EDIT) return true; + if(validationCounter > 0) return true; + if(serviceInstance.action !== ServiceInstanceActions.None) return false; + if(mode === DrawingBoardModes.RETRY_EDIT) return false; + return !serviceInstance.isDirty; + } + return true; + } + + getModeButton(mode : string) : string { + switch (mode) { + case DrawingBoardModes.EDIT: + return 'UPDATE'; + case DrawingBoardModes.RETRY_EDIT: + return 'REDEPLOY'; + default: return 'DEPLOY'; + } + } + getButtonText(mode : DrawingBoardModes) : string { + switch (mode) { + case DrawingBoardModes.EDIT: + case DrawingBoardModes.VIEW: + return 'EDIT'; + case DrawingBoardModes.RETRY_EDIT: + case DrawingBoardModes.RETRY: + return 'REDEPLOY'; + } + } + + showEditService(mode: DrawingBoardModes, serviceModelId: string): boolean{ + const serviceInstance = this.store.getState().service.serviceInstance; + return mode === DrawingBoardModes.CREATE || ((mode === DrawingBoardModes.RETRY_EDIT || mode === DrawingBoardModes.EDIT)&& + !_.isNil(serviceInstance) && !_.isNil(serviceInstance[serviceModelId])&& serviceInstance[serviceModelId].action === ServiceInstanceActions.Create); + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/tmp_instansiate_request.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/tmp_instansiate_request.ts index 7accc3a9c..d57e0202f 100644 --- a/vid-webpack-master/src/app/drawingBoard/drawing-board-header/tmp_instansiate_request.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-header/tmp_instansiate_request.ts @@ -8,7 +8,7 @@ export default "modelVersion": "10.0" }, "owningEntityId": "038d99af-0427-42c2-9d15-971b99b9b489", - "owningEntityName": "PACKET CORE", + "owningEntityName": "JULIO ERICKSON", "projectName": "{some project name}", "globalSubscriberId": "{some subscriber id}", "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.model.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.model.ts new file mode 100644 index 000000000..a8e9b435a --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.model.ts @@ -0,0 +1,15 @@ +/****************************************** + type - node type + isFirstLevel : node is first level + ******************************************/ + +export class DragAndDropModel { + type : string; + isFirstLevel : boolean; + + constructor(type : string, isFirstLevel : boolean){ + this.type = type; + this.isFirstLevel = isFirstLevel; + } + +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.service.spec.ts new file mode 100644 index 000000000..1221cef5f --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.service.spec.ts @@ -0,0 +1,227 @@ +import {TestBed, getTestBed} from '@angular/core/testing'; +import { + HttpClientTestingModule, + HttpTestingController +} from '@angular/common/http/testing'; +import {NgRedux} from "@angular-redux/store"; +import {DragAndDropService} from "./dragAndDrop.service"; +import {AppState} from "../../../../shared/store/reducers"; + +class MockAppStore<T> { + dispatch(){ + + } + getState() { + return { + global: { + flags: { + "DRAG_AND_DROP_OPERATION" : true + } + }, + service: { + serviceInstance: { + "serviceInstanceId": { + vnfs: { + "vnfStoreKey": { + isMissingData: true, + vfModules: { + "vfModulesName": { + "vfModulesName": { + isMissingData: true + } + } + } + }, + + "vnfStoreKey1": { + isMissingData: false, + vfModules: { + "vfModulesName": { + "vfModulesName": { + isMissingData: false + } + } + } + } + } + } + } + } + } + } +} + +describe('Drag and drop service', () => { + let injector; + let service: DragAndDropService; + let httpMock: HttpTestingController; + let store: NgRedux<AppState>; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [ + DragAndDropService, + {provide: NgRedux, useClass: MockAppStore}] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(DragAndDropService); + httpMock = injector.get(HttpTestingController); + store = injector.get(NgRedux); + })().then(done).catch(done.fail)); + + + test('drag should move element position', () => { + let nodes = [{ + "modelCustomizationId": "91415b44-753d-494c-926a-456a9172bbb9", + "modelId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "modelUniqueId": "91415b44-753d-494c-926a-456a9172bbb9", + "missingData": false, + "id": "tjjongy92jn", + "action": "Create", + "inMaint": false, + "name": "yoav2_001", + "modelName": "VF_vMee 0", + "type": "VF", + "isEcompGeneratedNaming": true, + "networkStoreKey": "VF_vMee 0:0001", + "vnfStoreKey": "VF_vMee 0:0001", + "typeName": "VNF", + "menuActions": {"edit": {}, "showAuditInfo": {}, "duplicate": {}, "remove": {}, "delete": {}, "undoDelete": {}}, + "isFailed": false, + "statusProperties": [{"key": "Prov Status:", "testId": "provStatus"}, { + "key": "Orch Status:", + "testId": "orchStatus" + }], + "trackById": "di9khuolht", + "parentType": "", + "position": 0, + "children": [{ + "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "modelId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "modelUniqueId": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "missingData": false, + "id": 6654971919519, + "action": "Create", + "name": "VFModule1", + "modelName": "vf_vmee0..VfVmee..base_vmme..module-0", + "type": "VFmodule", + "isEcompGeneratedNaming": true, + "dynamicInputs": [], + "dynamicModelName": "vf_vmee0..VfVmee..base_vmme..module-0bykqx", + "typeName": "M", + "menuActions": {"edit": {}, "showAuditInfo": {}, "remove": {}, "delete": {}, "undoDelete": {}}, + "isFailed": false, + "statusProperties": [{"key": "Prov Status:", "testId": "provStatus"}, { + "key": "Orch Status:", + "testId": "orchStatus" + }], + "trackById": "5pfyfah820h", + "parentType": "VNF", + "position": 0, + "errors": {} + }, { + "modelCustomizationId": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "modelId": "41708296-e443-4c71-953f-d9a010f059e1", + "modelUniqueId": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "missingData": false, + "id": 987761655742, + "action": "Create", + "name": "VNFModule3", + "modelName": "vf_vmee0..VfVmee..vmme_gpb..module-2", + "type": "VFmodule", + "isEcompGeneratedNaming": true, + "dynamicInputs": [], + "dynamicModelName": "vf_vmee0..VfVmee..vmme_gpb..module-2fjrrc", + "typeName": "M", + "menuActions": {"edit": {}, "showAuditInfo": {}, "remove": {}, "delete": {}, "undoDelete": {}}, + "isFailed": false, + "statusProperties": [{"key": "Prov Status:", "testId": "provStatus"}, { + "key": "Orch Status:", + "testId": "orchStatus" + }], + "trackById": "i3dllio31bb", + "parentType": "VNF", + "position": 1, + "errors": {} + }, { + "modelCustomizationId": "55b1be94-671a-403e-a26c-667e9c47d091", + "modelId": "522159d5-d6e0-4c2a-aa44-5a542a12a830", + "modelUniqueId": "55b1be94-671a-403e-a26c-667e9c47d091", + "missingData": false, + "id": 873798901625, + "action": "Create", + "name": "VFModule2", + "modelName": "vf_vmee0..VfVmee..vmme_vlc..module-1", + "type": "VFmodule", + "isEcompGeneratedNaming": true, + "dynamicInputs": [], + "dynamicModelName": "vf_vmee0..VfVmee..vmme_vlc..module-1djjni", + "typeName": "M", + "menuActions": {"edit": {}, "showAuditInfo": {}, "remove": {}, "delete": {}, "undoDelete": {}}, + "isFailed": false, + "statusProperties": [{"key": "Prov Status:", "testId": "provStatus"}, { + "key": "Orch Status:", + "testId": "orchStatus" + }], + "trackById": "w7bvw1nh47s", + "parentType": "VNF", + "position": 2, + "errors": {} + }], + "errors": {} + }, { + "modelCustomizationId": "91415b44-753d-494c-926a-456a9172bbb9", + "modelId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "modelUniqueId": "91415b44-753d-494c-926a-456a9172bbb9", + "missingData": false, + "id": "dywch8hkomi", + "action": "Create", + "inMaint": false, + "name": "yoav2", + "modelName": "VF_vMee 0", + "type": "VF", + "isEcompGeneratedNaming": true, + "networkStoreKey": "VF_vMee 0", + "vnfStoreKey": "VF_vMee 0", + "typeName": "VNF", + "menuActions": {"edit": {}, "showAuditInfo": {}, "duplicate": {}, "remove": {}, "delete": {}, "undoDelete": {}}, + "isFailed": false, + "statusProperties": [{"key": "Prov Status:", "testId": "provStatus"}, { + "key": "Orch Status:", + "testId": "orchStatus" + }], + "trackById": "fjczf1urdqo", + "parentType": "", + "position": 1, + "children": [], + "errors": {} + }]; + let from = { + data: { + type: 'VF', + index: 1 + } + }; + + let to = { + parent: { + data: { + type: 'VF', + index: 0 + } + } + }; + jest.spyOn(service, 'array_move'); + + service.drag(store, "serviceInstanceId", nodes, {from, to}); + + + expect(service.array_move).toHaveBeenCalled(); + + }); + + +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.service.ts new file mode 100644 index 000000000..01763c685 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/dragAndDrop/dragAndDrop.service.ts @@ -0,0 +1,78 @@ +import {Injectable} from "@angular/core"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../shared/store/reducers"; +import {DragAndDropModel} from "./dragAndDrop.model"; +import {FeatureFlagsService, Features} from "../../../../shared/services/featureFlag/feature-flags.service"; +import * as _ from 'lodash'; + +@Injectable() +export class DragAndDropService { + + constructor(private store: NgRedux<AppState>){} + + isAllow(): boolean { + return FeatureFlagsService.getFlagState(Features.DRAG_AND_DROP_OPERATION, this.store); + } + /******************************************************************** + * manage drawing-board drag and drop operation + * @param nodes - array with elements data. + * @param tree - tree instance + * @param node - element information + * @param from - element from information + * @param to - element to information + ************************************************************/ + + drag(store, instanceId : string , nodes, {from, to}) :void{ + if (!store.getState().global.flags["DRAG_AND_DROP_OPERATION"]) return; + + let firstLevelNames : DragAndDropModel[] = [ + new DragAndDropModel('VF',true), + new DragAndDropModel('VL',true), + new DragAndDropModel('VFmodule',false) + ]; + + const fromObject = _.find(firstLevelNames, ['type', from.data.type]); + const toObject = _.find(firstLevelNames, ['type', to.parent.data.type]); + + /*********************************************************************************************** + if the type are the same and there in same level + same parent -> then change element position + ***********************************************************************************************/ + if(fromObject.isFirstLevel === toObject.isFirstLevel){ // moving element in the same level and in the first level + if(fromObject.isFirstLevel){ + this.array_move(nodes, from.index , to.parent.index, instanceId); + } else if(fromObject.isFirstLevel === toObject.isFirstLevel){ + /* check if they have the same parent */ + if(from.parent.data.trackById === to.parent.parent.data.trackById){ + let vfModules = nodes.find((parents)=> { + return parents.trackById === to.parent.parent.data.trackById; + }).children; + this.array_move(vfModules, from.index , to.parent.index, instanceId, to.parent.parent.data.vnfStoreKey); + } + } + } + } + + + /******************************************************************** + * move element inside array with elements position + * @param arr - array with elements data. + * @param originalPosition - element original position + * @param destPosition - element dest position + * @param destPinstanceIdosition - instance id + ******************************************************************/ + array_move(arr, originalPosition, destPosition, instanceId : string, parentStoreKey?) { + if (destPosition >= arr.length) { + let k = destPosition - arr.length + 1; + while (k--) { + arr.push(undefined); + } + } + arr.splice(destPosition, 0, arr.splice(originalPosition, 1)[0]); + arr.forEach((item, index) => { + if(item.position !== index){ + item.position = index; + item.updatePoistionFunction(this, item, instanceId, parentStoreKey); + } + }); + }; +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts new file mode 100644 index 000000000..d0715982c --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts @@ -0,0 +1,207 @@ +import {AfterViewInit, Component, EventEmitter, OnInit, Output, ViewChild,} from '@angular/core'; +import {ContextMenuComponent, ContextMenuService} from 'ngx-contextmenu'; +import {Constants} from '../../../shared/utils/constants'; +import {IDType, ITreeNode} from "angular-tree-component/dist/defs/api"; +import {TreeComponent, TreeModel, TreeNode} from "angular-tree-component"; +import {DialogService} from "ng2-bootstrap-modal"; +import {ActivatedRoute} from "@angular/router"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../shared/store/reducers"; +import {IframeService} from "../../../shared/utils/iframe.service"; +import {DuplicateService} from '../duplicate/duplicate.service'; +import {DrawingBoardTreeService, TreeNodeContextMenuModel} from "./drawing-board-tree.service"; +import {NetworkPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import {VfModulePopuopService} from "../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {VnfPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {SdcUiServices} from "onap-ui-angular"; +import {HighlightPipe} from "../../../shared/pipes/highlight/highlight-filter.pipe"; +import {VnfGroupPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import {ObjectToInstanceTreeService} from "../objectsToTree/objectToInstanceTree/objectToInstanceTree.service"; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; +import {Subject} from "rxjs/Subject"; +import {changeServiceIsDirty} from "../../../shared/storeUtil/utils/service/service.actions"; +import * as _ from 'lodash'; +import {ErrorMsgService} from "../../../shared/components/error-msg/error-msg.service"; +import {DragAndDropService} from "./dragAndDrop/dragAndDrop.service"; +import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service"; +import {PopoverPlacement} from "../../../shared/components/popover/popover.component"; + +@Component({ + selector: 'drawing-board-tree', + templateUrl: './drawing-board-tree.html', + styleUrls: ['./drawing-board-tree.scss'], + providers: [HighlightPipe] +}) + +export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { + _store: NgRedux<AppState>; + duplicateService: DuplicateService; + drawingBoardTreeService: DrawingBoardTreeService; + errorMsgService: ErrorMsgService; + isFilterEnabled: boolean = false; + filterValue: string = ''; + contextMenuOptions: TreeNodeContextMenuModel[]; + static triggerDeleteActionService: Subject<string> = new Subject<string>(); + static triggerUndoDeleteActionService: Subject<string> = new Subject<string>(); + static triggerreCalculateIsDirty: Subject<string> = new Subject<string>(); + @ViewChild(ContextMenuComponent) public contextMenu: ContextMenuComponent; + + constructor(private _contextMenuService: ContextMenuService, + private _iframeService: IframeService, + private dialogService: DialogService, + private store: NgRedux<AppState>, + private route: ActivatedRoute, + private _duplicateService: DuplicateService, + private modalService: SdcUiServices.ModalService, + private _drawingBoardTreeService: DrawingBoardTreeService, + private _networkPopupService: NetworkPopupService, + private _vfModulePopuopService: VfModulePopuopService, + private _vnfPopupService: VnfPopupService, + private _vnfGroupPopupService: VnfGroupPopupService, + private _errorMsgService: ErrorMsgService, + private _highlightPipe: HighlightPipe, + private _objectToInstanceTreeService: ObjectToInstanceTreeService, + private _sharedTreeService: SharedTreeService, + private _dragAndDropService : DragAndDropService) { + + this.errorMsgService = _errorMsgService; + this.duplicateService = _duplicateService; + this.drawingBoardTreeService = _drawingBoardTreeService; + this.contextMenuOptions = _drawingBoardTreeService.generateContextMenuOptions(); + + DrawingBoardTreeComponent.triggerDeleteActionService.subscribe((serviceModelId) => { + this._sharedTreeService.shouldShowDeleteInstanceWithChildrenModal(this.nodes, serviceModelId, (node, serviceModelId)=>{ + this.drawingBoardTreeService.deleteActionService(this.nodes, serviceModelId); + this.store.dispatch(changeServiceIsDirty(this.nodes, serviceModelId)); + }); + }); + + DrawingBoardTreeComponent.triggerUndoDeleteActionService.subscribe((serviceModelId) => { + this.drawingBoardTreeService.undoDeleteActionService(this.nodes, serviceModelId); + this.store.dispatch(changeServiceIsDirty(this.nodes, serviceModelId)); + }); + + DrawingBoardTreeComponent.triggerreCalculateIsDirty.subscribe((serviceModelId) => { + this.store.dispatch(changeServiceIsDirty(this.nodes, serviceModelId)); + }); + + this._store = store; + this.route + .queryParams + .subscribe(params => { + this.serviceModelId = params['serviceModelId']; + }); + } + + getNodeId(node: ITreeNode): string { + return (node.data.parentType !== "" ? (node.data.parentType + "_") : "") + node.data.typeName; + } + + updateNodes(updateData: { nodes: any, filterValue: string }): void { + this.nodes = updateData.nodes; + this.filterValue = updateData.filterValue; + } + + @Output() + highlightNode: EventEmitter<number> = new EventEmitter<number>(); + + @ViewChild('tree') tree: TreeComponent; + missingDataTooltip: string = Constants.Error.MISSING_VNF_DETAILS; + currentNode: ITreeNode = null; + flags: any; + nodes = []; + serviceModelId: string; + options = { + allowDrag: this._dragAndDropService.isAllow(), + actionMapping: { + mouse: { + drop: (tree:TreeModel, node:TreeNode, $event:any, {from, to}) => { + this._dragAndDropService.drag(this.store, this.serviceModelId, this.nodes, {from, to}); + } + } + }, + nodeHeight: 45, + dropSlotHeight: 1 + }; + parentElementClassName = 'content'; + + ngOnInit(): void { + this.store.subscribe(() => { + this.updateTree(); + }); + this.updateTree() + } + + getNodeName(node: ITreeNode, filter: string) { + return this._highlightPipe.transform(node.data.name, filter ? filter : ''); + } + + updateTree() { + const serviceInstance = this.store.getState().service.serviceInstance[this.serviceModelId]; + this.nodes = this._objectToInstanceTreeService.convertServiceInstanceToTreeData(serviceInstance, this.store.getState().service.serviceHierarchy[this.serviceModelId]); + console.log('right nodes', this.nodes); + + } + + + ngAfterViewInit(): void { + this.tree.treeModel.expandAll(); + } + + public onContextMenu($event: MouseEvent, node: ITreeNode): void { + this.flags = this.store.getState().global.flags; + + this.currentNode = node; + node.focus(); + node.setActiveAndVisible(false); + this.selectNode(node); + setTimeout(() => { + this._contextMenuService.show.next({ + contextMenu: this.contextMenu, + event: <any>$event, + item: node, + }); + $event.preventDefault(); + $event.stopPropagation(); + }, 250); + + } + + + executeMenuAction(methodName: string): void { + if (!_.isNil(this.currentNode.data.menuActions) && !_.isNil(this.currentNode.data.menuActions[methodName])) { + this.currentNode.data.menuActions[methodName]['method'](this.currentNode, this.serviceModelId); + this.store.dispatch(changeServiceIsDirty(this.nodes, this.serviceModelId)); + } + } + + isEnabled(node: ITreeNode, serviceModelId: string, methodName: string): boolean { + if (!_.isNil(this.currentNode) && !_.isNil(this.currentNode.data.menuActions) && !_.isNil(this.currentNode.data.menuActions[methodName])) { + return this.currentNode.data.menuActions[methodName]['enable'](this.currentNode, this.serviceModelId); + } + return false; + } + + isVisible(node: ITreeNode, methodName: string): boolean { + if (!_.isNil(this.currentNode) && !_.isNil(this.currentNode.data.menuActions) && !_.isNil(this.currentNode.data.menuActions[methodName])) { + return this.currentNode.data.menuActions[methodName]['visible'](this.currentNode, this.serviceModelId); + } + return false; + } + + public selectNode(node: ITreeNode): void { + node.expand(); + this._sharedTreeService.setSelectedVNF(node); + this.highlightNode.emit(node.data.modelUniqueId); + if (FeatureFlagsService.getFlagState(Features.FLAG_1906_COMPONENT_INFO, this.store)) { + node.data.onSelectedNode(node); + } + } + + expandParentByNodeId(id: IDType): void { + this.tree.treeModel.getNodeById(id).parent.expand(); + } + +} + + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.html b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.html new file mode 100644 index 000000000..8af909ffc --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.html @@ -0,0 +1,96 @@ +<error-msg></error-msg> +<div class="drawing-board-tree" style="height: calc(100vh - 55px);"> + <div *ngIf="nodes?.length == 0" style="text-align: center; margin-top: 50px;"> + <no-content-message-and-icon class="span-over" + data-title="Please add objects (VNFs, network, modules etc.)" + title2="from the left tree to design the service instance" + subtitle="Once done, click Deploy to start instantiation" + iconPath="./assets/img/UPLOAD.svg" + iconClass="upload-icon-service-planing"></no-content-message-and-icon> + </div> + <div class="tree-header" *ngIf="nodes?.length > 0"> + <div class="title-tree">Instance:</div> + <search-component (updateNodes)="updateNodes($event)" + [nodes]="nodes" [tree]="tree" + [inputTestId]="'search-right-tree'" + *ngIf="drawingBoardTreeService.isViewEditFlagTrue()"></search-component> + </div> + <tree-root [attr.data-tests-id]="'drawing-board-tree'" #tree [nodes]="nodes" [options]="options" + id="drawing-board-tree"> + + <ng-template #treeNodeTemplate let-node let-index="index" > + <div [attr.id]="getNodeId(node)" [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName" (click)="selectNode(node)" > + <custom-popover class="failed-popover-wrap" *ngIf= "node?.data?.isFailed" [value]= "node?.data?.statusMessage" [placement]="'left'" [popoverType]="'error'"> + <div class="failed-msg" [attr.data-tests-id]="'failed-error-message'" *ngIf= "node?.data?.isFailed">Failed</div> + </custom-popover> + <div class="instance-type" style="position: relative;"> + <div *ngIf="node?.data?.action == 'Create'" class="notShowOnViewMode notShowOnCreateMode newIcon"></div> + <div><span title="{{node.data.type}}" [attr.data-tests-id]="'node-type-indicator'">{{node?.data?.typeName}}</span></div> + </div> + <div class="model-info"> + <span class="header-info"> + <span class="property-name"> + <span class="auto-name" + [ngClass]="{'text_decoration' : drawingBoardTreeService.isTextDecoration(node)}" + [innerHtml]="getNodeName(node, filterValue) | safe : 'html'" + [attr.data-tests-id]="'node-name'" + ></span> + </span> + </span> + <tree-node-header-properties + *ngIf="(node?.data?.action !== 'Create' || node?.data?.parentType === 'VnfGroup') && !node?.data?.isFailed" + [properties]="node.data.statusProperties"></tree-node-header-properties> + </div> + <div class="scaling invalid" *ngIf="node?.data?.errors?.scalingError" [attr.data-tests-id]="'scaling-policy'"> + <span>Limit</span><span>{{node?.data?.limitMembers}}</span> + </div> + <div class="model-actions notShowOnViewMode"> + <span class="icon-browse" + [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-menu-btn'" + (click)="onContextMenu($event, node)"> + <context-menu> + <ng-template *ngFor="let contextMenuOption of contextMenuOptions" + contextMenuItem (execute)="executeMenuAction(contextMenuOption.methodName)" + [visible]="isVisible(currentNode, contextMenuOption.methodName)" + [enabled]="isEnabled(currentNode, serviceModelId, contextMenuOption.methodName)"> + <div [attr.data-tests-id]="contextMenuOption.dataTestId"> + <div style="float: left;margin-top: 3px;"> + <svg-icon + [ngClass]="contextMenuOption.iconClass" + class="icon-edit" + [size]="'small'" + [name]="contextMenuOption.iconClass"> + </svg-icon></div> + <div style="padding-left: 25px;">{{contextMenuOption.label}}</div> + </div> + </ng-template> + </context-menu> + </span> + <span + *ngIf="drawingBoardTreeService.isVNFMissingData(node, serviceModelId)" + tooltip="{{ missingDataTooltip }}" + tooltipPlacement="left" + [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-alert-icon'" + class="icon-alert" > + <svg-icon + [mode]="'warning'" + [testId]="'icon-alert'" + [size]="'medium'" + [name]="'alert-triangle-o'"> + </svg-icon> + </span> + + <!--<span *ngIf="drawingBoardTreeService.isVNFMissingData(node, serviceModelId)" class="icon-alert"--> + <!--tooltip="{{ missingDataTooltip }}" tooltipPlacement="left"--> + <!--[attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-alert-icon'"></span>--> + <span *ngIf="drawingBoardTreeService.isVFModuleMissingData(node, serviceModelId)" class="icon-alert" + tooltip="{{ missingDataTooltip }}" tooltipPlacement="left" + [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-alert-icon'"></span> + </div> + </div > + </ng-template> + </tree-root> +</div> + + + diff --git a/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.scss index fed9ead10..be9f9f2d4 100644 --- a/vid-webpack-master/src/app/drawingBoard/drawing-board-tree/drawing-board-tree.scss +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.scss @@ -11,11 +11,19 @@ span.toggle-children { @include highlight(white, #009FDB); border-right: none; + .isFailed { + left: 0px !important; + } } } + } } +#VNF > node-content-wrapper { + border: 1px dashed #D2D2D2 !important; +} + @mixin highlight-tree-node-content { tree-node-content { > div { @@ -28,23 +36,55 @@ } } +#RETRY_EDIT drawing-board-tree tree-node-collection > div, +#RETRY drawing-board-tree tree-node-collection > div { + margin-top: 0px; + width: calc(100% - 50px); + margin-left: auto; + } + drawing-board-tree { + flex: 1; + color: #5A5A5A; + line-height: 14px; + flex-direction:column; + + &.col-md-6,&.col-md-5{ + padding: 0; + } + .tree-header { + display: flex; + justify-content: space-between; + .title-tree { + font-family: OpenSans-SemiBold; + font-size: 16px; + color: #191919; + text-align: left; + text-transform: uppercase; + padding-bottom: 48px; + } + .search-container { + width: 275px; + } + } + .highlight { + background-color: #9DD9EF; + } .toggle-children-wrapper.toggle-children-wrapper-expanded { .toggle-children:before { color: #009FDB; } } - - overflow: auto; - flex: 1; - color: #5A5A5A; - line-height: 14px; .drawing-board-tree { width: 100%; + padding: 30px 45px; + } + + .tree-node-level-1 { + margin-bottom: 10px; } tree-viewport { - padding: 50px 3.5% 1% 6%; tree-node { tree-node-drop-slot { .node-drop-slot { @@ -57,14 +97,17 @@ drawing-board-tree { .node-wrapper { @include highlight-toggle-children; .node-content-wrapper-focused, - .node-content-wrapper-active - { + .node-content-wrapper-active { + @include highlight-toggle-children; @include highlight(#E6F6FB, #009FDB); - .property-name { - color: #009FDB; + .property-name,.instance-type { + color: #009FDB !important; + position: relative; } - .auto-name { - font-family: OpenSans-Regular !important; + .status-properties { + .status-property-value,.status-property-name { + color: #009FDB; + } } .icon-browse:before { color: #5A5A5A; @@ -81,30 +124,29 @@ drawing-board-tree { } .tree-node-active .tree-children { - border: 1px solid #009FDB; - padding: 20px; + //border: 1px solid #009FDB; + padding-left: 45px; } - - .tree-node.tree-node-active.tree-node-expanded { - border: 1px solid #009FDB; } - .tree-node-leaf .node-wrapper{ - margin-left: -45px; + .tree-children .tree-node-leaf .node-wrapper{ + margin-left: -5px; } + .tree-node.tree-node-expanded > tree-node-wrapper{ + box-shadow: 0 2px 2px 0 rgba(0,0,0,.1); + position: relative; + z-index: 1; + display: block; + } tree-node-wrapper { .node-wrapper { height: 45px; &:hover { - @include highlight-toggle-children; - .node-content-wrapper { - @include highlight(#E6F6FB, #009FDB); - .property-name { - color: #009FDB; - } + .node-content-wrapper:not(.node-content-wrapper-focused) { + background: #F2F2F2; .icon-browse:before { color: #5A5A5A; } @@ -114,6 +156,9 @@ drawing-board-tree { tree-node-expander { font-family: 'icomoon' !important; height: 100%; + .failed-msg { + + } .toggle-children-wrapper { padding: 0; display: block; @@ -151,6 +196,7 @@ drawing-board-tree { width:45px; } } + .node-content-wrapper { padding: 0; background: none; @@ -159,33 +205,93 @@ drawing-board-tree { border: 1px solid #D2D2D2; height: 100%; flex: 1; + .resourceGroup { + border: 1px dashed #D2D2D2 !important; + } tree-node-content { > div { height: 100%; display: flex; align-items: center; - justify-content: space-between; - .model-info { + + .instance-type { + width: 40px; + height: 100%; + padding-top: 16px; + text-transform: uppercase; + text-align: center; + border-right: 1px solid #D2D2D2; + word-break: break-all; + color: #959595; + font-size: 13px; + font-family: OpenSans-SemiBold; + .newIcon { + background: #45B16D; + position: absolute; + top: 5%; + width: 90%; + left: 5%; + right: 5%; + border-radius: 2px; + height: 5px; + } + span { + width: 40px; + display: block; + } + } > span { flex: 1; - display: flex; - justify-content: space-between; - align-items: center; - padding-left: 8px; - > span { - flex: 1; - padding: 0 8px; - span:nth-child(2) { - display: block; + display: block; + + span:nth-child(2) { + display: block; + } + } + .model-info { + padding-left: 16px; + width: 100%; + .property-name { + font-family: OpenSans-SemiBold; + font-size: 13px; + color: #191919; + //text-transform: capitalize; problematic with search + .auto-name{ + display: inline-flex;//required for search more then one sub highlight, + font-size: 13px; + } + .text_decoration{ + text-decoration: line-through; + } + + .text_decoration:after { + height: 10px; } } + tree-node-header-properties{ + display: block; + } + } + .scaling { + background: #4ca90c; + padding: 5px; + border-radius: 3px; + font-family: OpenSans-SemiBold; + font-size: 12px; + color: #FFF9F9; + &.invalid{ + background: #cf2a2a; + } + span:first-child{ + margin-right: 3px; + } } .model-actions { display: flex; align-items: center; - padding-right: 12px; .icon-browse { padding: 0; width: 30px; + height: 24px; &:before { content: "\e924"; font-size: 24px; @@ -201,31 +307,17 @@ drawing-board-tree { } .icon-alert { - padding-left: 10px; - &:before { - content: "\e904"; - font-size: 16px; - color: #ffb81c; - } + padding-right: 10px; } } } } - .property-name { - font-family: OpenSans-Semibold; - font-size: 12px; - line-height: 12px; - color: #191919; - text-transform: capitalize; - } } - - } } tree-node-children { .tree-children { - padding: 20px; + padding-left: 45px; .model-info span:first-child { flex: 1.1 !important; } @@ -234,6 +326,44 @@ drawing-board-tree { } } } + + +.tree-node-level-1.tree-node.tree-node-expanded { + .failed-popover-wrap { + left: -50px !important; + position: absolute; + } +} +.tree-node-level-1 { + .failed-popover-wrap { + left: 45px !important; + position: absolute; + } +} + +.tree-node-level-2.tree-node.tree-node-leaf { + .failed-popover-wrap { + left: 135px !important; + position: absolute; + } +} + +.tree-node-level-1.tree-node.tree-node-collapsed { + .failed-popover-wrap{ + left: 0px !important; + position: absolute; + } +} + +.failed-msg{ + background: #cf2a2a; + padding: 5px; + border-radius: 3px; + font-family: OpenSans-SemiBold; + font-size: 12px; + color: #FFF9F9; +} + .cdk-overlay-pane.ngx-contextmenu { ul.dropdown-menu { width: 200px; @@ -272,3 +402,4 @@ drawing-board-tree { } } + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.spec.ts new file mode 100644 index 000000000..1b913cfe9 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.spec.ts @@ -0,0 +1,147 @@ +import {TestBed, getTestBed} from '@angular/core/testing'; +import { + HttpClientTestingModule, + HttpTestingController +} from '@angular/common/http/testing'; +import {NgRedux} from "@angular-redux/store"; +import {DrawingBoardTreeService, TreeNodeContextMenuModel} from "./drawing-board-tree.service"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; + + class MockAppStore<T>{ + getState() { + return { + service : { + serviceInstance : { + "serviceInstanceId" : { + vnfs : { + "vnfStoreKey" : { + isMissingData : true, + vfModules : { + "vfModulesName" : { + "vfModulesName" : { + isMissingData : true + } + } + } + }, + + "vnfStoreKey1" : { + isMissingData : false, + vfModules : { + "vfModulesName" : { + "vfModulesName" : { + isMissingData : false + } + } + } + } + } + } + } + } + } + } +} + +describe('Drawing board tree Service', () => { + let injector; + let service: DrawingBoardTreeService; + let httpMock: HttpTestingController; + + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [ + DrawingBoardTreeService, + {provide: NgRedux, useClass: MockAppStore}] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(DrawingBoardTreeService); + httpMock = injector.get(HttpTestingController); + + })().then(done).catch(done.fail)); + + + + + test('generateContextMenuOptions should return list of optional context menu', () => { + const options : TreeNodeContextMenuModel[] = service.generateContextMenuOptions(); + const expected : TreeNodeContextMenuModel[] = [ + new TreeNodeContextMenuModel('edit', 'context-menu-edit', 'Edit', 'edit-file-o'), + new TreeNodeContextMenuModel('duplicate', 'context-menu-duplicate', 'Duplicate', 'copy-o'), + new TreeNodeContextMenuModel('showAuditInfo', 'context-menu-showAuditInfo', 'Show audit info', 'eye-o'), + new TreeNodeContextMenuModel('addGroupMember', 'context-menu-addGroupMember', 'Add group members', 'plus'), + new TreeNodeContextMenuModel('delete', 'context-menu-delete', 'Delete', 'trash-o'), + new TreeNodeContextMenuModel('remove', 'context-menu-remove', 'Remove', 'trash-o'), + new TreeNodeContextMenuModel('undoDelete', 'context-menu-undoDelete', 'Undo Delete', 'undo-delete') + ]; + expect(options.length).toEqual(7); + expect(options).toEqual(expected); + }); + + test('isVNFMissingData should return true if vnf isMissingData = true', () => { + let node : ITreeNode = <any>{ + data : { + type : 'VF', + vnfStoreKey : "vnfStoreKey" + } + }; + let result : boolean = service.isVNFMissingData(node, "serviceInstanceId"); + expect(result).toBeTruthy(); + }); + + + test('isVNFMissingData should return false if vnf has isMissingData = false', () => { + let node : ITreeNode = <any>{ + data : { + type : 'VFModule', + modelName : "vfModulesName", + dynamicModelName : "vfModulesName", + parent : { + vnfStoreKey : "vnfStoreKey1", + type : 'VF' + } + } + }; + let result : boolean = service.isVNFMissingData(node, "serviceInstanceId"); + expect(result).toBeFalsy(); + }); + + + test('isVFModuleMissingData should return true if vnfModule has isMissingData = true', () => { + let node : ITreeNode = <any>{ + data : { + type : 'VFModule', + modelName : "vfModulesName", + dynamicModelName : "vfModulesName", + parent : { + vnfStoreKey : "vnfStoreKey", + type : 'VF' + } + } + }; + let result : boolean = service.isVFModuleMissingData(node, "serviceInstanceId"); + expect(result).toBeFalsy(); + }); + + + test('isVFModuleMissingData should return false if vnfModule has isMissingData = false', () => { + let node : ITreeNode = <any>{ + data : { + type : 'VFModule', + modelName : "vfModulesName", + dynamicModelName : "vfModulesName", + parent : { + vnfStoreKey : "vnfStoreKey1", + type : 'VF' + } + } + }; + let result : boolean = service.isVFModuleMissingData(node, "serviceInstanceId"); + expect(result).toBeFalsy(); + }); + +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts new file mode 100644 index 000000000..17f761c41 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts @@ -0,0 +1,129 @@ +import {Injectable} from "@angular/core"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import * as _ from 'lodash'; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../shared/store/reducers"; +import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service"; +import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; + +@Injectable() +export class DrawingBoardTreeService { + constructor(private store: NgRedux<AppState>){} + isVFModuleMissingData(node: ITreeNode, serviceModelId : string): boolean { + if(node.data.type === 'VFmodule' &&!_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs) && !_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.parent.data.vnfStoreKey])){ + if(!_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.parent.data.vnfStoreKey].vfModules) + && !_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.parent.data.vnfStoreKey].vfModules[node.data.modelName]) + && !_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.parent.data.vnfStoreKey].vfModules[node.data.modelName][node.data.dynamicModelName])){ + + return this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.parent.data.vnfStoreKey].vfModules[node.data.modelName][node.data.dynamicModelName].isMissingData; + } + } + return false; + } + + isVNFMissingData(node : ITreeNode, serviceModelId : string) : boolean { + if(node.data.type == 'VF' && !_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.data.vnfStoreKey])){ + return this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.data.vnfStoreKey].isMissingData; + } + } + + isViewEditFlagTrue():boolean{ + return FeatureFlagsService.getFlagState(Features.FLAG_1902_NEW_VIEW_EDIT, this.store); + } + + /********************************************** + return all drawing board context menu options + ***********************************************/ + generateContextMenuOptions() : TreeNodeContextMenuModel[]{ + return [ + new TreeNodeContextMenuModel('edit', 'context-menu-edit', 'Edit', 'edit-file-o'), + new TreeNodeContextMenuModel('duplicate', 'context-menu-duplicate', 'Duplicate', 'copy-o'), + new TreeNodeContextMenuModel('showAuditInfo', 'context-menu-showAuditInfo', 'Show audit info', 'eye-o'), + new TreeNodeContextMenuModel('addGroupMember', 'context-menu-addGroupMember', 'Add group members', 'plus'), + new TreeNodeContextMenuModel('delete', 'context-menu-delete', 'Delete', 'trash-o'), + new TreeNodeContextMenuModel('remove', 'context-menu-remove', 'Remove', 'trash-o'), + new TreeNodeContextMenuModel('undoDelete', 'context-menu-undoDelete', 'Undo Delete', 'undo-delete') + ]; + } + + + /******************************************************************* + delete or remove all service child's on delete existing service + *******************************************************************/ + deleteActionService(nodes : ITreeNode[], serviceModelId : string){ + if(!_.isNil(nodes)){ + for(let node of nodes){ + node.data = node; + if(!_.isNil(node.children)){ + node.children.map((child)=>{ + child.data = child; + child.parent = node; + }); + } + + let menuActionsName : string = node.data.action === ServiceInstanceActions.Create ? 'remove' : 'delete'; + if(!_.isNil(node.data.menuActions) && !_.isNil(node.data.menuActions[menuActionsName])){ + node.data.menuActions[menuActionsName]['method'](node, serviceModelId) + } + + } + } + } + /******************************************************************* + undo delete all service child's on undo delete existing service + *******************************************************************/ + undoDeleteActionService(nodes : ITreeNode[], serviceModelId : string){ + if(!_.isNil(nodes)){ + for(let node of nodes){ + node.data = node; + if(!_.isNil(node.children)){ + node.children.map((child)=>{ + child.data = child; + child.parent = node; + }); + } + + if(!_.isNil(node.data.menuActions) && !_.isNil(node.data.menuActions['undoDelete'])){ + node.data.menuActions['undoDelete']['method'](node, serviceModelId) + } + } + } + } + + /*********************************************************** + return true if should add line hover the instance name + ***********************************************************/ + isTextDecoration(node) : boolean{ + return !_.isNil(node.data) && !_.isNil(node.data.action) && node.data.action.split('_').pop() === 'Delete'; + } + + + /****************************************** + should create object of instances action + ******************************************/ + generateServiceActionObject(nodes){ + let obj = {}; + let index = 0; + for(let node of nodes){ + obj[index] = {}; + index++; + } + } +} + +export class TreeNodeContextMenuModel { + methodName: string; + dataTestId: string; + label: string; + iconClass: string; + + constructor(methodName: string, + dataTestId: string, + label: string, + iconClass: string) { + this.methodName = methodName; + this.dataTestId = dataTestId; + this.label = label; + this.iconClass = iconClass; + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/instance.tree.generator.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/instance.tree.generator.ts new file mode 100644 index 000000000..188feaaba --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/instance.tree.generator.ts @@ -0,0 +1,8 @@ +import {Injectable} from "@angular/core"; + +@Injectable() +export class InstanceTreeGenerator { + convertServiceInstanceToTreeData(serviceInstance, serviceModelId : string) { + + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.html b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.html new file mode 100644 index 000000000..dae6762e0 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.html @@ -0,0 +1,5 @@ +<div class="status-properties" *ngFor="let prop of properties"> + <span class="status-property-name" [ngClass]="{'mark': prop.key=='In-maintenance'}">{{ prop.key }}</span> + <span class="status-property-value" [attr.data-tests-id]="'status-property-'+prop?.testId" >{{ prop.value }}</span> + <span class="separator">|</span> +</div> diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.scss new file mode 100644 index 000000000..305de8cd7 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.scss @@ -0,0 +1,24 @@ +.status-properties{ + display: inline-block; + font-family: OpenSans-Regular; + font-size: 12px; + padding-top: 3px; + .status-property-name{ + color: #5A5A5A; + &.mark{ + background-color: #959595; + color: #ffffff; + } + } + .status-property-value{ + color: #191919; + } + .separator{ + padding: 0 8px; + } + &:last-child .separator{ + display: none; + } + +} + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.spec.ts new file mode 100644 index 000000000..047f2e89d --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.spec.ts @@ -0,0 +1,25 @@ +import {ComponentFixture, TestBed } from '@angular/core/testing'; +import { TreeNodeHeaderPropertiesComponent } from './tree-node-header-properties.component'; + +describe('TreeNodeHeaderPropertiesComponent', () => { + let component: TreeNodeHeaderPropertiesComponent; + let fixture: ComponentFixture<TreeNodeHeaderPropertiesComponent>; + + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + declarations: [ TreeNodeHeaderPropertiesComponent ] + }); + await TestBed.compileComponents(); + + fixture = TestBed.createComponent(TreeNodeHeaderPropertiesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + + })().then(done).catch(done.fail)); + + + test('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.ts new file mode 100644 index 000000000..535d7ea52 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/tree-node-header-properties/tree-node-header-properties.component.ts @@ -0,0 +1,10 @@ +import {Component, Input} from '@angular/core'; + +@Component({ + selector: 'tree-node-header-properties', + templateUrl: './tree-node-header-properties.component.html', + styleUrls: ['./tree-node-header-properties.component.scss'] +}) +export class TreeNodeHeaderPropertiesComponent { + @Input() properties : object[] = []; +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board.modes.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board.modes.ts new file mode 100644 index 000000000..452666f91 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board.modes.ts @@ -0,0 +1,8 @@ +export enum DrawingBoardModes { + RETRY = 'RETRY', + RETRY_EDIT = 'RETRY_EDIT', + VIEW = 'VIEW', + EDIT = 'EDIT', + OLD_VIEW_EDIT = 'OLD_VIEW_EDIT', + CREATE = 'CREATE' +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.html b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.html new file mode 100644 index 000000000..c5f43b9c8 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.html @@ -0,0 +1,19 @@ +<div> + <div> + <span style="font-weight: bold;"> + Please select the number of additional instances you want to add of this node. + </span> + </div> + <div> + <span style="font-weight: bold;"> + Important: VID will duplicate this node including its children. + </span> + </div> + + <div class="duplicate-number"> + <select class="quantity-select" [(ngModel)]="duplicateNumber" name="duplicate" [attr.data-tests-id]="'duplicate-amount-vfmodules'" id="duplicate-select" (change)="onDuplicateNumberChange()"> + <option *ngFor="let item of duplicateOptions" [value]="item">{{item}}</option> + </select> + </div> + <!--TODO max --> +</div> diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.scss new file mode 100644 index 000000000..f5b566d0b --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.scss @@ -0,0 +1,9 @@ +.quantity-select { + width: 100%; + font-family: inherit; + font-size: inherit; + border: 1px solid #009FDB; + margin-top: 10px; + padding-left: 7px; + height: 30px; +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.ts new file mode 100644 index 000000000..e1c5d7296 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate-vnf.component.ts @@ -0,0 +1,25 @@ +import { Component } from '@angular/core'; +import * as _ from 'lodash'; +import {DuplicateService} from "./duplicate.service"; + +@Component({ + selector: 'duplicate-vnf', + templateUrl : './duplicate-vnf.component.html', + styleUrls : ['./duplicate-vnf.component.scss'] +}) +export class DuplicateVnfComponent { + duplicateNumber : number = 1; + duplicateOptions : number[] = []; + duplicateService:DuplicateService; + constructor( private _duplicateService: DuplicateService ){ + this.duplicateService = _duplicateService; + this.duplicateOptions = _.range(1, this._duplicateService.maxNumberOfDuplicate + 1); + this.onDuplicateNumberChange(); + } + + onDuplicateNumberChange() { + this.duplicateService.setNumberOfDuplicates(+this.duplicateNumber); + } + + +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts new file mode 100644 index 000000000..81251cb1a --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts @@ -0,0 +1,449 @@ +import { DuplicateService } from './duplicate.service'; +import { LogService } from '../../../shared/utils/log/log.service'; +import { NgRedux } from '@angular-redux/store'; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import { SdcUiServices} from "onap-ui-angular"; +import {IModalConfig} from "onap-ui-angular/dist/components/common"; +import {AppState} from "../../../shared/store/reducers"; +import {getTestBed, TestBed} from "@angular/core/testing"; + +class MockAppStore<T> { + getState(){ + return { + getState() { + return { + service : { + serviceHierarchy: { + "serviceId" : { + vnfs : { + "vnfModelName" : { + properties : { + max_instances : 2 + } + }, + "vnfModelName2" : { + properties : { + max_instances : 2 + } + }, + "vnfModelName3" : { + properties : { + } + } + } + } + }, + serviceInstance : { + "serviceId" : { + existingVNFCounterMap : { + "vnfModelId" : 1, + "vnfModelId2" : 2, + "vnfModelId3" : 0 + } + } + + } + } + } + } + } + } +} + +class MockModalService<T> {} + +describe('Drawing board tree service', () => { + let injector; + let service: DuplicateService; + let store : NgRedux<AppState>; + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + providers : [ + DuplicateService, + LogService, + {provide: NgRedux, useClass: MockAppStore}, + {provide: SdcUiServices.ModalService, useClass: MockModalService} + ] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(DuplicateService); + store = injector.get(NgRedux); + + })().then(done).catch(done.fail)); + + + test('setNumberOfDuplicates should set number of duplicates', ()=>{ + service.setNumberOfDuplicates(10); + expect(service.numberOfDuplicates).toEqual(10); + }); + + test('isEnabled should return false if type is VNF and has missing data', ()=>{ + let node = { + data : { + type : 'VF', + menuActions : { + duplicate : () => { + + } + } + } + }; + spyOn(node.data.menuActions, 'duplicate').and.returnValue(true); + spyOn(service, 'hasMissingData').and.returnValue(true); + let result : boolean = service.isEnabled(<any>node, null, null); + expect(result).toBeFalsy(); + }); + + test('openDuplicateModal', ()=>{ + spyOn(service, 'getRemainsInstance').and.returnValue(1); + let result : IModalConfig = service.openDuplicateModal( + 'currentServiceId', + 'currentServiceId', + 'currentId', + 'storeKey', + 2, + null,null); + expect(result.title).toEqual('Duplicate Node'); + }); + + test('openDuplicateModal should call getRemainsInstance with correct parameters', ()=>{ + spyOn(service, 'getRemainsInstance'); + service.openDuplicateModal( + 'currentServiceId', + 'currentServiceId', + 'currentId', + 'storeKey', + 2, + null,null); + expect(service.getRemainsInstance).toHaveBeenCalledWith('currentServiceId', 'currentId', 'currentServiceId', null, null); + }); + + test('canDuplicate VNF should return true', () => { + sessionStorage.setItem('reduxState' , JSON.stringify({global : { flags : {FLAG_DUPLICATE_VNF : true}}})); + let node : ITreeNode = <any> {data : {type : 'VF'}}; + + let result = service.canDuplicate(node); + expect(result).toBeTruthy(); + }); + + test('canDuplicate Network should return true', () => { + sessionStorage.setItem('reduxState' , JSON.stringify({global : { flags : {FLAG_DUPLICATE_VNF : true}}})); + let node : ITreeNode = <any> {data : {type : 'VL'}}; + + let result = service.canDuplicate(node); + expect(result).toBeTruthy(); + }); + + test('canDuplicate VFModule should return false', () => { + sessionStorage.setItem('reduxState' , JSON.stringify({global : { flags : {FLAG_DUPLICATE_VNF : true}}})); + let node : ITreeNode = <any> {data : {type : 'VFModule'}}; + + let result = service.canDuplicate(node); + expect(result).toBeFalsy(); + }); + + test('Drawing board tree service should be defined', () => { + expect(service).toBeDefined(); + }); + + test('DrawingBoardDuplicateService should be defined', () => { + expect(service).toBeDefined(); + }); + + test('Duplicate multi vnfs should save multi vnfs in redux', () => { + service.existingNames = { + "2017488_adiodvpe": "", + "rrr": "", + "ttt": "" + }; + let newVnfs = service.cloneVnf(<any>{ + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2mtlfi": { + "instanceName": "rrr", + "volumeGroupName": "ttt" + } + } + }, + "originalName": null, + "trackById": "pfs1f0len3", + "instanceName": "2017488_ADIODvPE" + }, "2017-488_ADIOD-vPE 0"); + + expect(newVnfs.instanceName).toBe("2017488_ADIODvPE_001"); + expect(newVnfs.vfModules['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2']['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2mtlfi'].instanceName).toBe("rrr_001"); + expect(newVnfs.vfModules['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2']['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2mtlfi'].volumeGroupName).toBe("ttt_001"); + + newVnfs = service.cloneVnf(<any>{ + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2mtlfi": { + "instanceName": "rrr", + "volumeGroupName": "ttt" + } + } + }, + "originalName": null, + "trackById": "pfs1f0len3", + "instanceName": "2017488_ADIODvPE" + }, "2017-488_ADIOD-vPE 0"); + + expect(newVnfs.instanceName).toBe("2017488_ADIODvPE_002"); + expect(newVnfs.vfModules['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2']['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2mtlfi'].instanceName).toBe("rrr_002"); + expect(newVnfs.vfModules['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2']['2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2mtlfi'].volumeGroupName).toBe("ttt_002"); + }); + + test('ensure name is unique - send new name - shouldn\'t change name', () => { + service.existingNames = { + "2017488_adiodvpe": "", + "uniqueinstancename": "" + }; + const name = "uniqueInstanceName-1"; + let uniqueName: string = service.ensureUniqueNameOrGenerateOne(name); + expect(uniqueName).toEqual(name); + }); + + test('ensure name is unique send existing name should change name', () => { + service.existingNames = { + "2017488_adiodvpe": "", + "uniqueinstancename-1": "" + }; + const name = "uniqueInstanceName-1"; + let uniqueName: string = service.ensureUniqueNameOrGenerateOne(name); + expect(uniqueName).toEqual(name + "_001"); + }); + + test('isAlreadyExist - send new name should return false', () => { + service.existingNames = { + "2017488_adiodvpe": "", + "uniqueinstancename": "" + }; + const name = "uniqueinstancename-1"; + let isExist: boolean = service.isAlreadyExists(name, service.existingNames); + expect(isExist).toBeFalsy(); + }); + + test('isAlreadyExist - send existing name should return true', () => { + service.existingNames = { + "2017488_adiodvpe": "", + "uniqueinstancename-1": "" + }; + const name = "uniqueinstancename-1"; + let isExist: boolean = service.isAlreadyExists(name, service.existingNames); + expect(isExist).toBeTruthy(); + }); + + test('isAlreadyExist - send existing name case insensitive should return true', () => { + service.existingNames = { + "2017488_adiodvpe": "", + "uniqueinstancename-1": "" + }; + const name = "uniqueInstanceName-1"; + let isExist: boolean = service.isAlreadyExists(name, service.existingNames); + expect(isExist).toBeTruthy(); + }); + + test('getNumberAsPaddingString should return 001 if padding is 000 and val is 1 string', () => { + let paddingNumber: string = service.getNumberAsPaddingString(1, '0000'); + expect(paddingNumber).toEqual('0001'); + }); + + test('getNumberAsPaddingString should return 010 if padding is 000 and val is 10 string', () => { + let paddingNumber: string = service.getNumberAsPaddingString(10, '0000'); + expect(paddingNumber).toEqual('0010'); + }); + + test('generateVNFUniqueName should return the next free number', () => { + const vnfName: string = "VF_vMee 0"; + let result: string = service.generateUniqueStoreKey( + "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + vnfName, + getExistingVNFs(), + {} + ); + + expect(result).toEqual(vnfName + ":0003"); + }); + + test('generateVNFUniqueName on duplicate multi vnfs should return the next free number', () => { + spyOn(service, 'openDuplicateModal'); + service.openDuplicateModal(null, null, null,null, 2, null, null); + + expect(service.openDuplicateModal).toHaveBeenCalledWith(null, null, null,null, 2, null, null); + }); + + + test('isEnabled should return false if node has missing data', () => { + let node = { + data : { + missingData: true, + menuActions : { + duplicate : () => { + + } + } + } + }; + let result : boolean = service.isEnabled(<any>node, null, null); + expect(result).toBeFalsy(); + }); + + test('isEnabled should return true if not reach to max', () => { + let node = { + data : { + missingData: false, modelName : "vnfModelName" , modelId : "vnfModelId", type : "VF", children: [], modelCustomizationId : "vnfModelId",modelUniqueId: "vnfModelId", + menuActions : { + duplicate : () => { + + } + } + } + }; + let result : boolean = service.isEnabled(<any>node, <any>getStoreState(), "serviceId"); + expect(result).toBeTruthy(); + }); + + test('isEnabled should return false if reach to max', () => { + let node = { + data : { + missingData: false, modelName : "vnfModelName2" , modelId : "vnfModelId2", type : "VF" ,children: [], + menuActions : { + duplicate : () => { + + } + } + } + }; + let result : boolean = service.isEnabled(<any>node, <any>getStoreState(), "serviceId"); + expect(result).toBeFalsy(); + }); + + test('isEnabled should return true if max is null', () => { + let node = { + data : { + missingData: false, modelName : "vnfModelName3" , modelId : "vnfModelId3",type : "VF", children: [], modelUniqueId: "vnfModelId3", + menuActions : { + duplicate : () => { + + } + } + } + }; + let result : boolean = service.isEnabled(<any>node, <any>getStoreState(), "serviceId"); + expect(result).toBeTruthy(); + }); + + test('isEnabled should return false if type is vf module', () => { + let node = { + data : { + missingData: false, modelName : "vnfModelName3" , modelId : "vnfModelId3",type : "VFModule", children: [], + menuActions : { + } + } + }; + let result : boolean = service.isEnabled(<any>node, <any>getStoreState(), "serviceId"); + expect(result).toBeFalsy(); + }); + + test('getRemainsVNFinstance should return the remains 1 VNF', () => { + let result : number = service.getRemainsInstance("vnfModelId", "vnfModelName" , "serviceId" , <any>getStoreState(), <any>{data : {type : 'VF'}}); + expect(result).toBe(1); + }); + + test('getRemainsVNFinstance should return the remains 0 VNF', () => { + let result : number = service.getRemainsInstance("vnfModelId2", "vnfModelName2" , "serviceId" , <any>getStoreState(),<any>{data : {type : 'VF'}}); + expect(result).toBe(0); + }); + + test('isVNFChildrensHasMissingData should return true if vnf missing data = true', () => { + let result : boolean = service.hasMissingData(<any>getTreeNode(true,false)); + expect(result).toBeTruthy(); + }); + + test('isVNFChildrensHasMissingData return should false if vnf missing data = false', () => { + let result : boolean = service.hasMissingData(<any>getTreeNode(false,false)); + expect(result).toBeFalsy(); + }); + + test('isVNFChildrensHasMissingData should return true if vfModule missing data = true', () => { + let result : boolean = service.hasMissingData(<any>getTreeNode(false,true)); + expect(result).toBeTruthy(); + }); + + test('isVNFChildrensHasMissingData should return false if no children and vfModule missing data = false', () => { + let node = <any>getTreeNode(false,false); + node.data.children = []; + let result : boolean = service.hasMissingData(node); + expect(result).toBeFalsy(); + }); + + function getExistingVNFs(){ + return {"VF_vMee 0":{"rollbackOnFailure":"true","vfModules":{"vf_vmee0..VfVmee..vmme_vlc..module-1":{"vf_vmee0..VfVmee..vmme_vlc..module-1dgbxq":{"modelInfo":{"modelInvariantId":"98a7c88b-b577-476a-90e4-e25a5871e02b","modelVersionId":"522159d5-d6e0-4c2a-aa44-5a542a12a830","modelName":"VfVmee..vmme_vlc..module-1","modelVersion":"2","modelCustomizationId":"55b1be94-671a-403e-a26c-667e9c47d091","modelCustomizationName":"VfVmee..vmme_vlc..module-1"},"instanceParams":[{}]}}},"productFamilyId":"17cc1042-527b-11e6-beb8-9e71128cae77","lcpCloudRegionId":"hvf6","tenantId":"bae71557c5bb4d5aac6743a4e5f1d054","lineOfBusiness":"ONAP","platformName":"platform","modelInfo":{"modelInvariantId":"4160458e-f648-4b30-a176-43881ffffe9e","modelVersionId":"d6557200-ecf2-4641-8094-5393ae3aae60","modelName":"VF_vMee","modelVersion":"2.0","modelCustomizationId":"91415b44-753d-494c-926a-456a9172bbb9","modelCustomizationName":"VF_vMee 0"}},"VF_vMee 0:0001":{"rollbackOnFailure":"true","vfModules":{"vf_vmee0..VfVmee..vmme_vlc..module-1":{"vf_vmee0..VfVmee..vmme_vlc..module-1dgbxq":{"modelInfo":{"modelInvariantId":"98a7c88b-b577-476a-90e4-e25a5871e02b","modelVersionId":"522159d5-d6e0-4c2a-aa44-5a542a12a830","modelName":"VfVmee..vmme_vlc..module-1","modelVersion":"2","modelCustomizationId":"55b1be94-671a-403e-a26c-667e9c47d091","modelCustomizationName":"VfVmee..vmme_vlc..module-1"},"instanceParams":[{}]}}},"productFamilyId":"17cc1042-527b-11e6-beb8-9e71128cae77","lcpCloudRegionId":"hvf6","tenantId":"bae71557c5bb4d5aac6743a4e5f1d054","lineOfBusiness":"ONAP","platformName":"platform","modelInfo":{"modelInvariantId":"4160458e-f648-4b30-a176-43881ffffe9e","modelVersionId":"d6557200-ecf2-4641-8094-5393ae3aae60","modelName":"VF_vMee","modelVersion":"2.0","modelCustomizationId":"91415b44-753d-494c-926a-456a9172bbb9","modelCustomizationName":"VF_vMee 0"},"originalName":"VF_vMee 0"},"VF_vMee 0:0002":{"rollbackOnFailure":"true","vfModules":{"vf_vmee0..VfVmee..vmme_vlc..module-1":{"vf_vmee0..VfVmee..vmme_vlc..module-1dgbxq":{"modelInfo":{"modelInvariantId":"98a7c88b-b577-476a-90e4-e25a5871e02b","modelVersionId":"522159d5-d6e0-4c2a-aa44-5a542a12a830","modelName":"VfVmee..vmme_vlc..module-1","modelVersion":"2","modelCustomizationId":"55b1be94-671a-403e-a26c-667e9c47d091","modelCustomizationName":"VfVmee..vmme_vlc..module-1"},"instanceParams":[{}]}}},"productFamilyId":"17cc1042-527b-11e6-beb8-9e71128cae77","lcpCloudRegionId":"hvf6","tenantId":"bae71557c5bb4d5aac6743a4e5f1d054","lineOfBusiness":"ONAP","platformName":"platform","modelInfo":{"modelInvariantId":"4160458e-f648-4b30-a176-43881ffffe9e","modelVersionId":"d6557200-ecf2-4641-8094-5393ae3aae60","modelName":"VF_vMee","modelVersion":"2.0","modelCustomizationId":"91415b44-753d-494c-926a-456a9172bbb9","modelCustomizationName":"VF_vMee 0"},"originalName":"VF_vMee 0"}} + } + + function getStoreState(){ + return { + getState() { + return { + service : { + serviceHierarchy: { + "serviceId" : { + vnfs : { + "vnfModelName" : { + properties : { + ecomp_generated_naming: "false", + max_instances : 2 + } + }, + "vnfModelName2" : { + properties : { + ecomp_generated_naming: "false", + max_instances : 2 + } + }, + "vnfModelName3" : { + properties : { + ecomp_generated_naming: "false", + } + } + } + } + }, + serviceInstance : { + "serviceId" : { + existingVNFCounterMap : { + "vnfModelId" : 1, + "vnfModelId2" : 2, + "vnfModelId3" : 0 + } + } + + } + } + } + } + } + } + + + function getTreeNode(VNfMissingData : boolean, vfModuleMissingData : boolean){ + return { + data : { + children : vfModuleMissingData ? + [{ + missingData : true + }] : + [{ + missingData : false + } + ], + missingData : VNfMissingData + } + } + } +}); + + + diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts new file mode 100644 index 000000000..e695edf86 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts @@ -0,0 +1,189 @@ +import { Injectable } from '@angular/core'; +import { ITreeNode } from 'angular-tree-component/dist/defs/api'; +import { AppState } from '../../../shared/store/reducers'; +import { LogService } from '../../../shared/utils/log/log.service'; +import { NgRedux } from '@angular-redux/store'; +import {VnfInstance} from "../../../shared/models/vnfInstance"; +import {VfModuleMap} from "../../../shared/models/vfModulesMap"; +import * as _ from "lodash"; +import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {TypeNodeInformation} from "../typeNodeInformation.model"; +import { SdcUiServices} from "onap-ui-angular"; +import { SdcUiCommon} from "onap-ui-angular"; +import {changeInstanceCounter, duplicateBulkInstances} from "../../../shared/storeUtil/utils/general/general.actions"; +import {IModalConfig} from "onap-ui-angular/dist/modals/models/modal-config"; + +@Injectable() +export class DuplicateService { + + constructor(private _logService : LogService, private _store: NgRedux<AppState>, modalService: SdcUiServices.ModalService) { + this.modalService = modalService; + } + + numberOfDuplicates:number; + setNumberOfDuplicates(numberOfDuplicates: number) { + this.numberOfDuplicates = numberOfDuplicates; + } + + currentInstanceId: string = null; + currentServiceId: string = null; + maxNumberOfDuplicate: number = 0; + storeKey: string = null; + padding = '0000'; + modalService: SdcUiServices.ModalService; + store : NgRedux<AppState>; + existingNames : {[key: string] : any}; + currentNode : ITreeNode = null; + + + + canDuplicate(node: ITreeNode): boolean { + let reduxState = <AppState>JSON.parse(sessionStorage.getItem('reduxState')); + return reduxState.global.flags['FLAG_DUPLICATE_VNF'] && (node.data.type === 'VF' || node.data.type === 'VL'); + } + + isEnabled(node: ITreeNode, store: NgRedux<AppState>, serviceId : string): boolean { + if(!_.isNil(node) && !_.isNil(node.data.menuActions['duplicate'])){ + if(this.hasMissingData(node)) return false; + const typeNodeInformation : TypeNodeInformation = new TypeNodeInformation(node); + const max : number = store.getState().service.serviceHierarchy[serviceId][typeNodeInformation.hierarchyName][node.data.modelName].properties['max_instances'] || 1; + const currentExisting: number = store.getState().service.serviceInstance[serviceId][typeNodeInformation.existingMappingCounterName][node.data.modelUniqueId]; + + return max - currentExisting > 0; + }else { + return false; + } + } + + hasMissingData(node : ITreeNode): boolean { + if(!_.isNil(node)){ + if(node.data.missingData) return true; + if(!_.isNil(node.data.children)){ + for(let child of node.data.children) { + if(child.missingData){ + return true; + } + } + } + + } + return false; + } + + getRemainsInstance(modelId : string, modelName : string, serviceId : string, store: NgRedux<AppState>, node : ITreeNode) : number { + const typeNodeInformation : TypeNodeInformation = new TypeNodeInformation(node); + const properties = store.getState().service.serviceHierarchy[serviceId][typeNodeInformation.hierarchyName][modelName].properties; + const currentExisting : number = store.getState().service.serviceInstance[serviceId][typeNodeInformation.existingMappingCounterName][modelId]; + return (!_.isNil(properties) && !_.isNil(properties['max_instances'])) ? properties['max_instances'] - currentExisting : null; + } + + + + openDuplicateModal(currentServiceId: string, currentUuid: string, currentId: string, storeKey : string, numberOfDuplicate: number, _store : NgRedux<AppState>, node: ITreeNode): IModalConfig { + this.currentInstanceId = currentId; + this.currentServiceId = currentServiceId; + this.maxNumberOfDuplicate = this.getRemainsInstance(currentUuid, currentId, currentServiceId, _store, node); + this.storeKey = storeKey; + this.store = _store; + this.currentNode = node; + + + return { + size: SdcUiCommon.ModalSize.medium, + title: 'Duplicate Node', + type: SdcUiCommon.ModalType.custom, + buttons: [ + {text: 'Duplicate', callback: this.duplicate.bind(this, this.currentNode), closeModal: true}, + {text: 'Cancel', closeModal: true} + ] + }; + } + + duplicate(node : ITreeNode): void { + const typeNodeInformation : TypeNodeInformation = new TypeNodeInformation(node); + this.existingNames = this.store.getState().service.serviceInstance[this.currentServiceId].existingNames; + const toClone = this.store.getState().service.serviceInstance[this.currentServiceId][typeNodeInformation.hierarchyName][this.storeKey]; + let newObjects = {}; + for(let i = 0; i < this.numberOfDuplicates; i++) { + const uniqueStoreKey = this.generateUniqueStoreKey(this.currentServiceId, this.currentInstanceId, this.store.getState().service.serviceInstance[this.currentServiceId][typeNodeInformation.hierarchyName], newObjects); + const clone = this.cloneVnf(toClone, this.currentInstanceId); + newObjects[uniqueStoreKey] = clone; + } + this.store.dispatch(duplicateBulkInstances(this.currentServiceId, newObjects, this.existingNames, node)); + this.store.dispatch(changeInstanceCounter(toClone.modelInfo.modelUniqueId, this.currentServiceId, this.numberOfDuplicates, node)); + this._logService.info("Duplicate " + this.storeKey + " serviceId: " + this.currentServiceId + "number of duplicate: " + this.numberOfDuplicates, toClone); + } + + + cloneVnf(vnf : VnfInstance, originalName: string): VnfInstance { + let newUniqueVnf : VnfInstance = _.cloneDeep(vnf); + + newUniqueVnf.originalName = originalName; + newUniqueVnf.trackById = DefaultDataGeneratorService.createRandomTrackById(); + if (!_.isNil(vnf.instanceName)){ + newUniqueVnf.instanceName = this.ensureUniqueNameOrGenerateOne(vnf.instanceName); + } + + for (let vf_module_model_name in vnf.vfModules) { + const vfModuleModel: VfModuleMap = vnf.vfModules[vf_module_model_name]; + for (let vfModule in vfModuleModel) { + newUniqueVnf.vfModules[vf_module_model_name][vfModule].trackById = DefaultDataGeneratorService.createRandomTrackById(); + if (!_.isNil(vfModuleModel[vfModule].instanceName)){ + newUniqueVnf.vfModules[vf_module_model_name][vfModule].instanceName = this.ensureUniqueNameOrGenerateOne(vfModuleModel[vfModule].instanceName); + } + if (!_.isNil(vfModuleModel[vfModule].volumeGroupName)){ + newUniqueVnf.vfModules[vf_module_model_name][vfModule].volumeGroupName = this.ensureUniqueNameOrGenerateOne(vfModuleModel[vfModule].volumeGroupName); + } + } + } + return newUniqueVnf; + } + + ensureUniqueNameOrGenerateOne(instanceName){ + let uniqueInstanceName = instanceName; + if (this.isAlreadyExists(instanceName, this.existingNames)) { + uniqueInstanceName = this.generateNextUniqueName(instanceName, this.existingNames); + this.existingNames[uniqueInstanceName.toLowerCase()] = ""; + } + return uniqueInstanceName; + } + + + isAlreadyExists(name : string, existingNames : {[key: string] : any}){ + return _.has(existingNames, name.toLowerCase()); + } + + generateNextUniqueName(name : string, existingNames : {[key: string] : any}) :string{ + let suffix = "000"; + let counter = 1; + if (name.match(/^.*_[\d]{3}$/)){ + name = name.substring(0, name.length - 4); + } + + while(true){ + let paddingNumber : string = this.getNumberAsPaddingString(counter, suffix); + let candidateUniqueName = name + '_' + paddingNumber; + if(!this.isAlreadyExists(candidateUniqueName, existingNames)){ + return candidateUniqueName; + } + counter++; + } + } + + generateUniqueStoreKey(serviceId : string, objectName : string, existing : any, newObjects: any) : string { + let counter = 1; + while(true){ + let paddingNumber : string = this.getNumberAsPaddingString(counter, this.padding); + const name = objectName + ':' + paddingNumber; + if(_.isNil(existing[name]) && _.isNil(newObjects[name])){ + return name; + } + counter++; + } + } + + getNumberAsPaddingString(val: number, padding: string): string { + const str = "" + val; + return padding.substring(0, padding.length - str.length) + str; + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/dynamicInputs.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/dynamicInputs.service.spec.ts new file mode 100644 index 000000000..56bf94f48 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/dynamicInputs.service.spec.ts @@ -0,0 +1,24 @@ +import {DynamicInputsService} from "./dynamicInputs.service"; +import {HttpClientTestingModule} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {NgReduxTestingModule} from "@angular-redux/store/testing"; +describe('DynamicInputs service', () => { + let injector; + let service: DynamicInputsService; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule], + providers: [ + DynamicInputsService + ] + }); + await TestBed.compileComponents(); + injector = getTestBed(); + service = injector.get(DynamicInputsService); + })().then(done).catch(done.fail)); + + test('DynamicInputs should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/dynamicInputs.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/dynamicInputs.service.ts new file mode 100644 index 000000000..cb0e7cf5d --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/dynamicInputs.service.ts @@ -0,0 +1,143 @@ +import {Injectable} from "@angular/core"; +import {Utils} from "../../../shared/utils/utils"; +import {Constants} from "../../../shared/utils/constants"; +import Parameter = Constants.Parameter; + +@Injectable() +export class DynamicInputsService { + public getArbitraryInputs(inputs) { + let parameter; + let parameterList = []; + for (let key in inputs) { + parameter = { + id: key, + type: Parameter.STRING, + name: key, + value: inputs[key][Parameter.DEFAULT], + isRequired: inputs[key][Parameter.REQUIRED], + description: inputs[key][Parameter.DESCRIPTION] + }; + switch (inputs[key][Parameter.TYPE]) { + case Parameter.INTEGER: + parameter.type = Parameter.NUMBER; + break; + case Parameter.BOOLEAN: + parameter.type = Parameter.BOOLEAN; + break; + case Parameter.RANGE: + break; + case Parameter.LIST: + parameter.type = Parameter.LIST; + break; + case Parameter.MAP: + parameter.type = Parameter.MAP; + break; + } + if (Utils.hasContents(inputs[key][Parameter.CONSTRAINTS]) + && ( inputs[key][Parameter.CONSTRAINTS].length > 0 )) { + let constraintsArray = inputs[key][Parameter.CONSTRAINTS]; + this.addConstraintParameters(parameterList, constraintsArray, key, inputs, parameter); + } + else { + + parameterList.push(parameter); + } + } + return parameterList; + } + + private addConstraintParameters(parameterList, constraintsArray, key, inputs, parameter) { + // If there are constraints and the operator is "valid_values", + // use a select parameter type. + let i: number = constraintsArray.length; + let parameterPushed: boolean = false; + if (i > 0) { + while ((i--) && (!parameterPushed)) { + let keys = Object.keys(constraintsArray[i]); + for (let operator in keys) { + switch (keys[operator]) { + case Parameter.VALID_VALUES: + let j: number = constraintsArray[i][Parameter.VALID_VALUES].length; + if (j > 0) { + let oList = []; + let option; + while (j--) { + option = { + name: constraintsArray[i][Parameter.VALID_VALUES][j], + isDefault: false + }; + if ((Utils.hasContents(inputs[key][Parameter.DEFAULT]) ) + && (inputs[key][Parameter.DEFAULT] === constraintsArray[i][Parameter.VALID_VALUES][j] )) { + option = { + name: constraintsArray[i][Parameter.VALID_VALUES][j], + isDefault: true + } + } + oList.push(option); + } + parameter.type = Parameter.SELECT; + parameter.optionList = oList; + parameterList.push(parameter); + parameterPushed = true; + } + break; + + case Parameter.EQUAL: + if (constraintsArray[i][Parameter.EQUAL] != null) { + parameter.type = Parameter.STRING; + parameter.isReadOnly = true; + parameter.value = constraintsArray[i][Parameter.EQUAL]; + parameterList.push(parameter); + parameterPushed = true; + } + break; + + case Parameter.LENGTH: + if (constraintsArray[i][Parameter.LENGTH] != null) { + parameter.minLength = constraintsArray[i][Parameter.LENGTH]; + parameter.maxLength = constraintsArray[i][Parameter.LENGTH]; + parameterList.push(parameter); + parameterPushed = true; + } + break; + case Parameter.MAX_LENGTH: + if (constraintsArray[i][Parameter.MAX_LENGTH] != null) { + parameter.maxLength = constraintsArray[i][Parameter.MAX_LENGTH]; + parameterList.push(parameter); + parameterPushed = true; + } + break; + case Parameter.MIN_LENGTH: + if (constraintsArray[i][Parameter.MIN_LENGTH] != null) { + parameter.minLength = constraintsArray[i][Parameter.MIN_LENGTH]; + parameterList.push(parameter); + parameterPushed = true; + } + break; + case Parameter.IN_RANGE: + if (constraintsArray[i][Parameter.IN_RANGE] != null) { + if (constraintsArray[i][Parameter.IN_RANGE].length > 1) { + parameter.min = constraintsArray[i][Parameter.IN_RANGE][0]; + parameter.max = constraintsArray[i][Parameter.IN_RANGE][1]; + parameter.type = Parameter.NUMBER; + parameter.value = inputs[key][Parameter.DEFAULT]; + parameterList.push(parameter); + parameterPushed = true; + } + } + break; + case Parameter.GREATER_THAN: + if (constraintsArray[i][Parameter.GREATER_THAN] != null) { + parameter.type = Parameter.NUMBER; + parameter.min = constraintsArray[i][Parameter.GREATER_THAN]; + parameter.value = inputs[key][Parameter.DEFAULT]; + parameterList.push(parameter); + parameterPushed = true; + } + break; + } + } + } + } + }; +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts new file mode 100644 index 000000000..51b6cfacb --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts @@ -0,0 +1,121 @@ +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import {AvailableNodeIcons} from "../../available-models-tree/available-models-tree.service"; + +export interface ILevelNodeInfo { + /** Name of the key inside the serviceHierarchy object **/ + name: string; + + /** Type of the object**/ + type: string; + + /** Child name inside the of the serviceHierarchy object (if exist) **/ + childName?: string; + + /** Child type the of object (if exist) **/ + childType?: string; + + /** model type name **/ + typeName?: string; + + /** is instance failed **/ + isFailed?: boolean; + + /** number of failed **/ + numberOfFailed?: number; + + /*********************************************************** + * return node position + * @param instance - instance + ************************************************************/ + getNodePosition(instance, deepNodeName? : string) : number; + + /*********************************************************** + * return if user should provide instance name or not + * @param currentModel - The model of current object + * @param parentModel - The parent model of current object. + ************************************************************/ + isEcompGeneratedNaming(currentModel, parentModel?): boolean; + + + /*********************** + * update node position + ***********************/ + updatePosition(node, that, instanceId, parentStoreKey?) : void; + + /*********************************************************** + * return object instance + * @param modelId - The model id + * @param serviceHierarchy - The serviceHierarchy store + * @param instance - existing instance details + ************************************************************/ + getModel(modelId: string, instance: any, serviceHierarchy): any; + + /*********************************************************** + * return dynamic inputs of current model + * @param currentModel - The model of current object + ************************************************************/ + updateDynamicInputsDataFromModel(currentModel): any; + + /*********************************************************** + * return tree node instance + * @param instance - The model of current object + * @param model - The model of current object + * @param parentModel + * @param storeKey - instance storeKey if exist (for duplicate) + ************************************************************/ + createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string): any + + /*********************************************************** + * return if instance has some missing data + * @param instance - The instance of current object + * @param dynamicInputs + * @param isEcompGeneratedNaming - boolean + ************************************************************/ + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean; + + /************************ + * return object tooltip + ************************/ + getTooltip(): string; + + /************************ + * return object type + ************************/ + getType(): string; + + /************************************ + * return child model option object + ***********************************/ + getNextLevelObject(): any; + + /*********************************************************** + * open popup + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + onClickAdd(node: ITreeNode, serviceModelId: string): void; + + /*********************************************************** + * get number of existing node instance + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + getNodeCount(node: ITreeNode, serviceModelId: string): number; + + /*********************************************************** + * should show node icon + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons; + + /*********************************************************** + * should return list of actions and there methods + * @param node - current ITrees node + * @param serviceModelId + ************************************************************/ + getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } }; + + + onSelectedNode(node : ITreeNode): void +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.spec.ts new file mode 100644 index 000000000..d99ec3bc6 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.spec.ts @@ -0,0 +1,1500 @@ +import {HttpClientTestingModule} from "@angular/common/http/testing"; +import {TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {ConfigurationModelInfo} from "./configuration.model.info"; +import {SharedTreeService} from "../../shared.tree.service"; + +describe('Vnf Model Info', () => { + let _dynamicInputsService : DynamicInputsService; + let _sharedTreeService : SharedTreeService; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule], + providers: [ + MockNgRedux, + SharedTreeService, + DynamicInputsService] + }); + await TestBed.compileComponents(); + })().then(done).catch(done.fail)); + + test('ConfigurationModelInfo should be defined', () => { + expect(ConfigurationModelInfo).toBeDefined(); + }); + + test('ConfigurationModelInfo should defined extra details', () => { + let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService); + expect(configurationModelInfo.name).toEqual('configurations'); + expect(configurationModelInfo.type).toEqual('Configuration'); + }); + + test('isEcompGeneratedNaming should return false', () => { + let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService); + let isEcompGeneratedNaming: boolean = configurationModelInfo.isEcompGeneratedNaming(); + expect(isEcompGeneratedNaming).toBeTruthy(); + }); + + test('getTooltip should return "Configuration"', () => { + let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService); + let tooltip: string = configurationModelInfo.getTooltip(); + expect(tooltip).toEqual('Configuration'); + }); + + test('getType should return "Configuration"', () => { + let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService); + let tooltip: string = configurationModelInfo.getType(); + expect(tooltip).toEqual('Configuration'); + }); + + test('getModel should return Configuration model', () => { + let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService); + let model = configurationModelInfo.getModel('2017-388_ADIOD-vPE 1__configuration', getServiceHierarchy()); + expect(model.uuid).toEqual('0903e1c0-8e03-4936-b5c2-260653b96413'); + }); + + + function getServiceHierarchy(){ + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + }, + "vidNotions": { + "instantiationUI": "legacy", + "modelCategory": "other" + } + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "max_instances": "3", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + } + }, + "collectionResource": {}, + "configurations": { + "2017-388_ADIOD-vPE 1__configuration": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + } + + }, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {} + } + } +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts new file mode 100644 index 000000000..dd85ea110 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts @@ -0,0 +1,87 @@ +import {ILevelNodeInfo} from "../basic.model.info"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import * as _ from 'lodash'; +import {SharedTreeService} from "../../shared.tree.service"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; + +export class ConfigurationModelInfo implements ILevelNodeInfo{ + constructor(private _dynamicInputsService : DynamicInputsService, + private _sharedTreeService : SharedTreeService){} + name: string = 'configurations'; + type : string = 'Configuration'; + typeName : string = 'C'; + + isEcompGeneratedNaming = () : boolean => true; + + updateDynamicInputsDataFromModel = () : any => []; + + getNextLevelObject = (): any => null; + + getTooltip = () : string => 'Configuration'; + + getType = () : string => "Configuration"; + + /*********************************************************** + * return configuration model + * @param configurationModelId - current Model id + * @param serviceHierarchy - serviceHierarchy + ************************************************************/ + getModel = (configurationModelId : string, serviceHierarchy) : any =>{ + if(!_.isNil(serviceHierarchy)){ + if(!_.isNil(serviceHierarchy[this.name]) && !_.isNil(serviceHierarchy[this.name][configurationModelId])){ + return serviceHierarchy[this.name][configurationModelId]; + } + } + return {}; + }; + + createInstanceTreeNode(instance: any, model: any, storeKey: string): any {return null;} + + childName: string; + childType: string; + + /*********************************************************** + * return if instance has missing data + * @param instance - vnf instance + * @param dynamicInputs + * @param isEcompGeneratedNaming + ************************************************************/ + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean { + return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, []); + } + + onClickAdd(node: ITreeNode, serviceModelId: string): void { + } + + getNodeCount(node: ITreeNode, serviceModelId: string): number { + return 0; + } + + /*********************************************************** + * should show node icon + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons { + return null; + } + + getMenuAction(node: ITreeNode, serviceModelId : string){ + return { + + } + } + + updatePosition(that , node, instanceId): void { + // TODO + } + + getNodePosition(instance): number { + return null; + } + + onSelectedNode(node: ITreeNode): void { + } + +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts new file mode 100644 index 000000000..206adb6d1 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.spec.ts @@ -0,0 +1,1553 @@ +import {HttpClientTestingModule, HttpTestingController} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {NetworkModelInfo} from "./network.model.info"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {SharedTreeService} from "../../shared.tree.service"; +import {NgRedux} from "@angular-redux/store"; +import {NetworkPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import {DialogService} from "ng2-bootstrap-modal"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {DrawingBoardModes} from "../../../drawing-board.modes"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import {DuplicateService} from "../../../duplicate/duplicate.service"; +class MockAppStore<T> { + getState() { + return { + global: { + 'drawingBoardStatus': DrawingBoardModes.CREATE + }, + service : { + serviceHierarchy : { + 'servicedId' : { + 'networks' : { + 'networkName' : { + 'properties' : { + 'max_instances' : 1 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingNetworksCounterMap' : { + 'networkId' : 1 + }, + 'networks' : { + 'networkName' :{ + 'action': 'Create', + 'originalName' : 'networkName' + } + } + } + } + } + } + } +} +describe('Network Model Info', () => { + let injector; + let _dynamicInputsService : DynamicInputsService; + let _sharedTreeService : SharedTreeService; + let networkModel: NetworkModelInfo; + let _dialogService : DialogService; + let _networkPopupService : NetworkPopupService; + let _duplicateService : DuplicateService; + let _iframeService : IframeService; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule], + providers: [ + DynamicInputsService, + SharedTreeService, + DialogService, + NetworkPopupService, + IframeService, + DuplicateService, + {provide: NgRedux, useClass: MockAppStore}, + MockNgRedux] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + _sharedTreeService = injector.get(SharedTreeService); + networkModel = new NetworkModelInfo(_dynamicInputsService, _sharedTreeService, _dialogService, _networkPopupService, _duplicateService, null, _iframeService, MockNgRedux.getInstance()); + })().then(done).catch(done.fail)); + + test('NetworkModelInfo should be defined', () => { + expect(NetworkModelInfo).toBeDefined(); + }); + + test('NetworkModelInfo should defined extra details', () => { + expect(networkModel.name).toEqual('networks'); + expect(networkModel.type).toEqual('Network'); + }); + + test('isEcompGeneratedNaming should return true if = isEcompGeneratedNaming is "true" ', () => { + let isEcompGeneratedNaming: boolean = networkModel.isEcompGeneratedNaming({ + properties: { + ecomp_generated_naming: 'true' + } + }); + expect(isEcompGeneratedNaming).toBeTruthy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is "false"', () => { + let isEcompGeneratedNaming: boolean = networkModel.isEcompGeneratedNaming({ + properties: { + ecomp_generated_naming: 'false' + } + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is not defined', () => { + let isEcompGeneratedNaming: boolean = networkModel.isEcompGeneratedNaming({ + properties: {} + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + test('getTooltip should return "VF"', () => { + let tooltip: string = networkModel.getTooltip(); + expect(tooltip).toEqual('Network'); + }); + + test('getType should return "VF"', () => { + let tooltip: string = networkModel.getType(); + expect(tooltip).toEqual('Network'); + }); + + test('getNextLevelObject should return null', () => { + let nextLevel = networkModel.getNextLevelObject(); + expect(nextLevel).toBeNull(); + }); + + test('updateDynamicInputsDataFromModel should return empty array', () => { + let dynamicInputs = networkModel.updateDynamicInputsDataFromModel({}); + expect(dynamicInputs).toEqual([]); + }); + + test('getModel should return Network model', () => { + let model = networkModel.getModel('2017-388_ADIOD-vPE 1_1', <any>{}, getServiceHierarchy()); + expect(model.type).toEqual('VL'); + }); + + test('showNodeIcons should return false if reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + data : { + id : 'networkId', + name : 'networkName', + modelCustomizationId : 'modelCustomizationId' + } + }; + jest.spyOn(_sharedTreeService, 'getExistingInstancesWithDeleteMode').mockReturnValue(0); + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'networks' : { + 'networkName' : { + 'properties' : { + 'max_instances' : 1 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingNetworksCounterMap' : { + 'modelCustomizationId' : 1 + }, + 'networks' : { + 'networkName' :{ + + } + } + } + } + } + }); + + let result = networkModel.showNodeIcons(<any>node, serviceId); + expect(result).toEqual(new AvailableNodeIcons(true , false)); + }); + + test('showNodeIcons should return true if not reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + data : { + id : 'networkId', + name : 'networkName' + } + }; + jest.spyOn(_sharedTreeService, 'getExistingInstancesWithDeleteMode').mockReturnValue(0); + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'networks' : { + 'networkName' : { + 'properties' : { + 'max_instances' : 2 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingNetworksCounterMap' : { + 'networkId' : 1 + }, + 'networks' : { + 'networkName' :{ + + } + } + } + } + } + }); + + let result = networkModel.showNodeIcons(<any>node, serviceId); + expect(result).toEqual(new AvailableNodeIcons(true , false)); + }); + + test('getNodeCount should return number of nodes', ()=>{ + let serviceId : string = 'servicedId'; + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'networks' : { + 'networkName' : { + 'properties' : { + 'max_instances' : 1 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingNetworksCounterMap' : { + 'modelCustomizationId' : 1 + }, + 'networks' : { + 'networkName' :{ + 'action': 'Create', + 'originalName' : 'networkName' + } + } + } + } + } + }); + + let node = { + data : { + id : 'networkId', + name : 'networkName', + action: 'Create', + modelCustomizationId : "modelCustomizationId", + modelUniqueId: "modelCustomizationId" + } + }; + let result = networkModel.getNodeCount(<any>node , serviceId); + expect(result).toEqual(1); + + node.data.modelCustomizationId = 'networkId_notExist'; + node.data.modelUniqueId = 'networkId_notExist'; + result = networkModel.getNodeCount(<any>node , serviceId); + expect(result).toEqual(0); + }); + + test('getMenuAction: showAuditInfoNetwork', ()=>{ + + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global: { + "drawingBoardStatus": DrawingBoardModes.RETRY + } + }); + jest.spyOn(_sharedTreeService, 'isRetryMode').mockReturnValue(true); + let node = { + data : { + "modelId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "action": "Create", + "isFailed": true, + } + }; + let serviceModelId = "6b528779-44a3-4472-bdff-9cd15ec93450"; + let result = networkModel.getMenuAction(<any>node, serviceModelId); + spyOn(result['showAuditInfo'], 'method'); + expect(result['showAuditInfo']).toBeDefined(); + expect(result['showAuditInfo'].visible(node)).toBeTruthy(); + expect(result['showAuditInfo'].enable(node)).toBeTruthy(); + result['showAuditInfo']['method'](node, serviceModelId); + expect(result['showAuditInfo']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + + function getServiceHierarchy(){ + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + }, + "vidNotions": { + "instantiationUI": "legacy", + "modelCategory": "other" + } + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "max_instances": "3", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": { + "2017-388_ADIOD-vPE 1_1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VL", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + } + }, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {} + } + } +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts new file mode 100644 index 000000000..3d99750ae --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts @@ -0,0 +1,264 @@ +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {ILevelNodeInfo} from "../basic.model.info"; +import {NetworkInstance} from "../../../../../shared/models/networkInstance"; +import {NetworkModel} from "../../../../../shared/models/networkModel"; +import {NetworkTreeNode} from "../../../../../shared/models/networkTreeNode"; +import {SharedTreeService} from "../../shared.tree.service"; +import {InputType} from "../../../../../shared/models/inputTypes"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../../shared/store/reducers"; +import { + GenericFormPopupComponent, + PopupType +} from "../../../../../shared/components/genericFormPopup/generic-form-popup.component"; +import {DialogService} from "ng2-bootstrap-modal"; +import {NetworkPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import * as _ from "lodash"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {DuplicateVnfComponent} from "../../../duplicate/duplicate-vnf.component"; +import {changeInstanceCounter, removeInstance} from "../../../../../shared/storeUtil/utils/general/general.actions"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import {SdcUiServices} from "onap-ui-angular"; +import {DuplicateService} from "../../../duplicate/duplicate.service"; +import {ServiceInstanceActions} from "../../../../../shared/models/serviceInstanceActions"; +import { + deleteActionNetworkInstance, + undoDeleteActionNetworkInstance, + updateNetworkPosition +} from "../../../../../shared/storeUtil/utils/network/network.actions"; +import {IModalConfig} from "onap-ui-angular/dist/modals/models/modal-config"; + +export class NetworkModelInfo implements ILevelNodeInfo { + constructor(private _dynamicInputsService: DynamicInputsService, + private _sharedTreeService: SharedTreeService, + private _dialogService: DialogService, + private _networkPopupService: NetworkPopupService, + private _duplicateService: DuplicateService, + private modalService: SdcUiServices.ModalService, + private _iframeService: IframeService, + private _store: NgRedux<AppState>) { + } + + name: string = 'networks'; + type: string = 'Network'; + typeName: string = 'N'; + + /*********************************************************** + * return model dynamic inputs + * @param currentModel - current Model object + ************************************************************/ + isEcompGeneratedNaming(currentModel): boolean { + const ecompGeneratedNaming = currentModel.properties.ecomp_generated_naming; + return ecompGeneratedNaming === "true"; + } + + updateDynamicInputsDataFromModel = (currentModel): any => { + let displayInputs; + return _.isEmpty(displayInputs) ? [] : this._dynamicInputsService.getArbitraryInputs(displayInputs); + }; + + /*********************************************************** + * return network model + * @param networkModelId - current Model id + * @param instance + * @param serviceHierarchy - serviceHierarchy + ************************************************************/ + getModel = (networkModelId: string, instance: NetworkInstance, serviceHierarchy): NetworkModel => { + const originalModelName = instance.originalName ? instance.originalName : networkModelId; + return new NetworkModel(serviceHierarchy[this.name][originalModelName]); + }; + + + /*********************************************************** + * return network instance tree node + * @param instance - network instance + * @param model - network model + * @param parentModel + * @param storeKey - store key if exist + ************************************************************/ + createInstanceTreeNode = (instance: NetworkInstance, model: NetworkModel, parentModel, storeKey: string): NetworkTreeNode => { + let node = new NetworkTreeNode(instance, model, storeKey); + node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); + node.typeName = this.typeName; + node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; + node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage: ""; + node = this._sharedTreeService.addingStatusProperty(node); + return node; + }; + + /*********************************************************** + * return next level object (null because is last level) + ************************************************************/ + getNextLevelObject(): any { + return null; + } + + getTooltip = (): string => 'Network'; + + getType = (): string => 'Network'; + + /*********************************************************** + * return if instance has missing data + * @param instance - vnf instance + * @param dynamicInputs + * @param isEcompGeneratedNaming + ************************************************************/ + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean { + return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, [InputType.LCP_REGION, InputType.TENANT, InputType.PLATFORM]); + } + + + /*********************************************************** + * return if instance has missing data + * @param node - Network node + * @param serviceModelId - current service id + ************************************************************/ + onClickAdd(node, serviceModelId: string): void { + this._dialogService.addDialog(GenericFormPopupComponent, <any>{ + type: PopupType.NETWORK, + uuidData: { + serviceId: serviceModelId, + networkId: node.data.name, + networkStoreKey: null, + type: 'VL', + popupService: this._networkPopupService + }, + node: node, + isUpdateMode: false + }); + } + + /*********************************************************** + * return number of existing instances + * @param node - Network node + * @param serviceModelId - current service id + ************************************************************/ + getNodeCount(node: ITreeNode, serviceModelId: string): number { + let map = null; + if (!_.isNil(this._store.getState().service.serviceInstance[serviceModelId])) { + map = this._store.getState().service.serviceInstance[serviceModelId].existingNetworksCounterMap || 0; + if (!_.isNil(map)) { + let count = map[node.data.modelUniqueId] || 0; + count -= this._sharedTreeService.getExistingInstancesWithDeleteMode(node, serviceModelId , 'networks'); + return count; + } + } + return 0; + } + + /*********************************************************** + * should show node icon + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons { + let counter: number = !_.isNil(this._store.getState().service.serviceInstance[serviceModelId]) ? + (this._store.getState().service.serviceInstance[serviceModelId].existingNetworksCounterMap[node.data.modelUniqueId] || 0) : 0; + + counter -= this._sharedTreeService.getExistingInstancesWithDeleteMode(node, serviceModelId , 'networks'); + + const properties = this._store.getState().service.serviceHierarchy[serviceModelId].networks[node.data.name].properties; + const maxInstances: number = !_.isNil(properties) ? (properties.max_instances || 1) : 1; + const isReachedLimit = !(maxInstances > counter); + const showAddIcon = this._sharedTreeService.shouldShowAddIcon() && !isReachedLimit; + + return new AvailableNodeIcons(showAddIcon, isReachedLimit) + } + + getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function }} { + const mode = this._store.getState().global.drawingBoardStatus; + return { + edit: { + method: (node, serviceModelId) => { + this._iframeService.addClassOpenModal('content'); + this._dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.NETWORK, + uuidData: <any>{ + serviceId: serviceModelId, + networkId: node.data.modelName, + networkStoreKey: node.data.networkStoreKey, + type: node.data.type, + popupService: this._networkPopupService + }, + node: node, + isUpdateMode: true + }); + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node) + }, + showAuditInfo: { + method: (node, serviceModelId) => { + let instance = this._store.getState().service.serviceInstance[serviceModelId].networks[node.data.networkStoreKey]; + this._sharedTreeService.openAuditInfoModal(node, serviceModelId, instance, 'NETWORK', this); + }, + visible: (node) => this._sharedTreeService.shouldShowAuditInfo(node), + enable: (node) => this._sharedTreeService.shouldShowAuditInfo(node) + }, + duplicate: { + method: (node, serviceModelId) => { + if (this._store.getState().global.flags['FLAG_DUPLICATE_VNF']) { + const storeKey = node.data.networkStoreKey; + let modalConfig: IModalConfig = this._duplicateService.openDuplicateModal(serviceModelId, node.data.modelUniqueId, node.data.modelName, storeKey, 1, this._store, node); + this.modalService.openCustomModal(modalConfig, DuplicateVnfComponent); + } + }, + visible: (node) => this._sharedTreeService.shouldShowDuplicate(node) && !_.isNil(node.data) && !_.isNil(node.data.action) && node.data.action === ServiceInstanceActions.Create && this._duplicateService.canDuplicate(node), + enable: (node, serviceModelId) => this._duplicateService.isEnabled(node, this._store, serviceModelId) + }, + remove: { + method: (node, serviceModelId) => { + let storeKey: string = node.data.networkStoreKey; + this._store.dispatch(removeInstance(node.data.networkStoreKey, serviceModelId, storeKey, node)); + this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId , serviceModelId, -1, node)); + this._sharedTreeService.selectedVNF = null; + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + }, + delete : { + method : (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + this._store.dispatch(deleteActionNetworkInstance(node.data.networkStoreKey, serviceModelId)); + }else { + this._sharedTreeService.removeDeleteAllChild(node, serviceModelId, (node, serviceModelId)=>{ + this._store.dispatch(deleteActionNetworkInstance(node.data.networkStoreKey, serviceModelId)); + }); + } + }, + visible: (node) => this._sharedTreeService.shouldShowDelete(node), + enable: (node) => this._sharedTreeService.shouldShowDelete(node) + }, + undoDelete : { + method : (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + this._store.dispatch(undoDeleteActionNetworkInstance(node.data.networkStoreKey, serviceModelId)); + }else { + this._sharedTreeService.undoDeleteAllChild(node, serviceModelId, (node, serviceModelId)=>{ + this._store.dispatch(undoDeleteActionNetworkInstance(node.data.networkStoreKey, serviceModelId)); + }); + } + }, + visible: (node) => this._sharedTreeService.shouldShowUndoDelete(node), + enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) + } + }; + } + + /*********************************************************** + * should update node position inside the tree + * @param node - current ITrees node + ************************************************************/ + updatePosition(that , node, instanceId): void { + that.store.dispatch(updateNetworkPosition(node)); + } + + getNodePosition(instance): number { + return !_.isNil(instance) ? instance.position : null; + } + + onSelectedNode(node: ITreeNode): void { + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.spec.ts new file mode 100644 index 000000000..dcf25f579 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.spec.ts @@ -0,0 +1,1211 @@ +import {HttpClientTestingModule, HttpTestingController} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {VNFModel} from "../../../../../shared/models/vnfModel"; +import {SharedTreeService} from "../../shared.tree.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../../shared/store/reducers"; +import {DefaultDataGeneratorService} from "../../../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {DialogService} from "ng2-bootstrap-modal"; +import {VfModulePopuopService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {VnfPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {DuplicateService} from "../../../duplicate/duplicate.service"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import {RelatedVnfMemberInfoModel} from "./relatedVnfMember.info.model"; + + +class MockAppStore<T> { + getState() { + return {} + } +} + + +describe('Related Vnf member Model Info', () => { + let injector; + let httpMock: HttpTestingController; + let _dynamicInputsService : DynamicInputsService; + let _sharedTreeService : SharedTreeService; + + let _store : NgRedux<AppState>; + let relatedVnfMemeber: RelatedVnfMemberInfoModel; + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule], + providers: [ + MockNgRedux, + DynamicInputsService, + DialogService, + VfModulePopuopService, + VnfPopupService, + DefaultDataGeneratorService, + SharedTreeService, + DuplicateService, + IframeService] + }).compileComponents(); + + injector = getTestBed(); + _sharedTreeService = injector.get(SharedTreeService); + _store = injector.get(NgRedux); + + relatedVnfMemeber = new RelatedVnfMemberInfoModel( + _sharedTreeService, + _dynamicInputsService, + _store); + }); + + test('relatedVnfMemeber should be defined', () => { + expect(relatedVnfMemeber).toBeDefined(); + }); + + test('RelatedVnfMemeber should defined extra details', () => { + expect(relatedVnfMemeber.name).toEqual('vnfs'); + expect(relatedVnfMemeber.type).toEqual('relatedVnfMember'); + }); + + test('isEcompGeneratedNaming should return true if isEcompGeneratedNaming is "true" ', () => { + let isEcompGeneratedNaming: boolean = relatedVnfMemeber.isEcompGeneratedNaming(<any>{ + properties: { + ecomp_generated_naming: 'true' + } + }); + expect(isEcompGeneratedNaming).toBeTruthy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is "false"', () => { + let isEcompGeneratedNaming: boolean = relatedVnfMemeber.isEcompGeneratedNaming({ + properties: { + ecomp_generated_naming: 'false' + } + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is not defined', () => { + let isEcompGeneratedNaming: boolean = relatedVnfMemeber.isEcompGeneratedNaming({ + properties: { + } + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + + test('getTooltip should return "VF"', () => { + let tooltip: string = relatedVnfMemeber.getTooltip(); + expect(tooltip).toEqual('VF'); + }); + + test('getType should return "VF"', () => { + let tooltip: string = relatedVnfMemeber.getType(); + expect(tooltip).toEqual('VF'); + }); + + test('getNextLevelObject should be null', () => { + let nextLevel = relatedVnfMemeber.getNextLevelObject(); + expect(nextLevel).toBeNull(); + }); + + test('getModel should return VNF model', () => { + let model: VNFModel = relatedVnfMemeber.getModel('2017-388_ADIOD-vPE 1', <any>{ + originalName : '2017-388_ADIOD-vPE 1' + }, getServiceHierarchy()); + expect(model.type).toEqual('VF'); + }); + + + test('getMenuAction: delete', ()=>{ + let node = {"modelId":"d6557200-ecf2-4641-8094-5393ae3aae60","missingData":true,"action":"None","inMaint":true,"name":"jlfBwIks283yKlCD8","modelName":"VF_vMee 0","type":"VF","isEcompGeneratedNaming":true,"networkStoreKey":"VF_vMee 0:004","vnfStoreKey":"VF_vMee 0:004","typeName":"VNF"}; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + let result = relatedVnfMemeber.getMenuAction(<any>node, serviceModelId); + spyOn(result['delete'], 'method'); + expect(result['delete']).toBeDefined(); + expect(result['delete'].visible).toBeTruthy(); + expect(result['delete'].enable).toBeTruthy(); + result['delete']['method'](node, serviceModelId); + expect(result['delete']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + + test('getMenuAction: undoDelete', ()=>{ + let node = {"modelId":"d6557200-ecf2-4641-8094-5393ae3aae60","missingData":true,"action":"None","inMaint":true,"name":"jlfBwIks283yKlCD8","modelName":"VF_vMee 0","type":"VF","isEcompGeneratedNaming":true,"networkStoreKey":"VF_vMee 0:004","vnfStoreKey":"VF_vMee 0:004","typeName":"VNF"}; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + let result = relatedVnfMemeber.getMenuAction(<any>node, serviceModelId); + spyOn(result['undoDelete'], 'method'); + expect(result['undoDelete']).toBeDefined(); + expect(result['undoDelete'].visible).toBeDefined(); + expect(result['undoDelete'].enable).toBeDefined(); + result['undoDelete']['method'](node, serviceModelId); + expect(result['undoDelete']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + + + function getServiceHierarchy(){ + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + }, + "vidNotions": { + "instantiationUI": "legacy", + "modelCategory": "other" + } + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "max_instances": "3", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": {}, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {} + } + } +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.ts new file mode 100644 index 000000000..b1eb10937 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.ts @@ -0,0 +1,158 @@ +import {ILevelNodeInfo} from "../basic.model.info"; +import {SharedTreeService} from "../../shared.tree.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../../shared/store/reducers"; +import * as _ from "lodash"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import { + deleteActionRelatedVnfMemberInstance, + removeRelatedVnfMemberInstance, + undoDeleteActionRelatedVnfMemberInstance +} from "../../../../../shared/storeUtil/utils/relatedVnfMember/relatedVnfMember.actions"; +import {VnfInstance} from "../../../../../shared/models/vnfInstance"; +import {VNFModel} from "../../../../../shared/models/vnfModel"; +import {VnfTreeNode} from "../../../../../shared/models/vnfTreeNode"; +import {InputType} from "../../../../../shared/models/inputTypes"; + +export class RelatedVnfMemberInfoModel implements ILevelNodeInfo { + constructor(private _sharedTreeService: SharedTreeService, + private _dynamicInputsService : DynamicInputsService, + private _store: NgRedux<AppState>) { + } + + name: string = 'vnfs'; + type: string = 'relatedVnfMember'; + typeName: string = 'VNF'; + + /*********************************************************** + * return if user should provide instance name or not. + * @param currentModel - current Model object + ************************************************************/ + isUserProvidedNaming = (currentModel): boolean => { + const ecompGeneratedNaming = currentModel.properties.ecomp_generated_naming; + return ecompGeneratedNaming !== undefined && ecompGeneratedNaming === "false"; + }; + + /*********************************************************** + * return model dynamic inputs + * @param currentModel - current Model object + ************************************************************/ + updateDynamicInputsDataFromModel = (currentModel): any => { + let displayInputs; + return _.isEmpty(displayInputs) ? [] : this._dynamicInputsService.getArbitraryInputs(displayInputs); + }; + + /*********************************************************** + * return vnf model + * @param vnfModelId - current Model id + * @param instance - vnf instance + * @param serviceHierarchy - serviceHierarchy + ************************************************************/ + getModel = (vnfModelId: string, instance: VnfInstance, serviceHierarchy): VNFModel => { + const originalModelName = instance.originalName ? instance.originalName : vnfModelId; + return new VNFModel(serviceHierarchy[this.name][originalModelName]); + }; + + + /*********************************************************** + * return vnf instance tree node + * @param instance - vnf instance + * @param model - vnf model + * @param parentModel + * @param storeKey - store key if exist + ************************************************************/ + createInstanceTreeNode = (instance: VnfInstance, model: VNFModel, parentModel, storeKey: string): VnfTreeNode => { + let node = new VnfTreeNode(instance, model, storeKey); + node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); + node.typeName = this.typeName; + node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; + node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage: ""; + node = this._sharedTreeService.addingStatusProperty(node); + return node; + }; + + /*********************************************************** + * return next level object (null because is last level) + ************************************************************/ + getNextLevelObject(): any { + return null; + } + + /*********************************************************** + * return if instance has missing data + * @param instance - vnf instance + * @param dynamicInputs + * @param isUserProvidedNaming + ************************************************************/ + hasMissingData(instance, dynamicInputs: any, isUserProvidedNaming: boolean): boolean { + return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isUserProvidedNaming, [InputType.LCP_REGION, InputType.TENANT, InputType.PLATFORM]); + } + + getTooltip = (): string => 'VF'; + + getType = (): string => 'VF'; + + /*********************************************************** + * doesn't have option from DrawingBoard model tree + ************************************************************/ + onClickAdd(node, serviceModelId: string): void {} + + /*********************************************************** + * doesn't have option from DrawingBoard model tree + ************************************************************/ + getNodeCount(node: ITreeNode, serviceModelId: string): number {return 0;} + + /*********************************************************** + * doesn't have option from DrawingBoard model tree + ************************************************************/ + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons { + return new AvailableNodeIcons(false, false); + } + + getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function }} { + return <any>{ + remove: { + method: (node, serviceModelId) => { + this._store.dispatch(removeRelatedVnfMemberInstance(node.parent.data.vnfGroupStoreKey, node.data.vnfStoreKey, serviceModelId)); + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node) + }, + delete : { + method : (node, serviceModelId) => { + this._store.dispatch(deleteActionRelatedVnfMemberInstance(node.parent.data.vnfGroupStoreKey, node.data.vnfStoreKey, serviceModelId)); + }, + visible: (node) => this._sharedTreeService.shouldShowDelete(node), + enable: (node) => this._sharedTreeService.shouldShowDelete(node) + }, + undoDelete : { + method : (node, serviceModelId) => { + this._store.dispatch(undoDeleteActionRelatedVnfMemberInstance(node.parent.data.vnfGroupStoreKey , node.data.vnfStoreKey, serviceModelId)); + + }, + visible: (node) => this._sharedTreeService.shouldShowUndoDelete(node), + enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && this._sharedTreeService.shouldShowDelete(node.parent) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) + } + } + } + + isEcompGeneratedNaming = (currentModel): boolean => { + const ecompGeneratedNaming = currentModel.properties.ecomp_generated_naming; + return ecompGeneratedNaming === "true"; + }; + + + updatePosition(that , node, instanceId): void { + // TODO + } + + getNodePosition(instance): number { + return null; + } + + onSelectedNode(node: ITreeNode): void { + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts new file mode 100644 index 000000000..dc7452516 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.spec.ts @@ -0,0 +1,1596 @@ + +import {HttpClientTestingModule, HttpTestingController} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {VFModuleModelInfo} from "./vfModule.model.info"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {SharedTreeService} from "../../shared.tree.service"; +import {VfModulePopuopService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {DialogService} from "ng2-bootstrap-modal"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../../shared/store/reducers"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {MessageBoxService} from "../../../../../shared/components/messageBox/messageBox.service"; +import {DrawingBoardModes} from "../../../drawing-board.modes"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import {ComponentInfoService} from "../../../component-info/component-info.service"; +import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component"; +import {ComponentInfoModel, ComponentInfoType} from "../../../component-info/component-info-model"; +import {AaiService} from "../../../../../shared/services/aaiService/aai.service"; +import {HttpClient, HttpHandler} from "@angular/common/http"; +import {FeatureFlagsService} from "../../../../../shared/services/featureFlag/feature-flags.service"; +class MockAppStore<T> { + getState() { + return { + global: { + 'drawingBoardStatus': DrawingBoardModes.CREATE + } + } + } +} + +describe('VFModule Model Info', () => { + let injector; + let _dynamicInputsService : DynamicInputsService; + let _sharedTreeService : SharedTreeService; + let vfModuleModel: VFModuleModelInfo; + let _dialogService : DialogService; + let _vfModulePopupService : VfModulePopuopService; + let _iframeService : IframeService; + let _componentInfoService : ComponentInfoService; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule], + providers: [ + DynamicInputsService, + DialogService, + VfModulePopuopService, + SharedTreeService, + IframeService, + {provide: NgRedux, useClass: MockAppStore}, + MockNgRedux, + AaiService, + HttpClient, + HttpHandler, + FeatureFlagsService, + ComponentInfoService + ] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + _sharedTreeService = injector.get(SharedTreeService); + _componentInfoService = injector.get(ComponentInfoService) + vfModuleModel = new VFModuleModelInfo(_dynamicInputsService, _sharedTreeService, _dialogService, _vfModulePopupService, _iframeService, MockNgRedux.getInstance(),_componentInfoService); + + })().then(done).catch(done.fail)); + + + + test('VFModuleModelInfo should be defined', () => { + expect(VFModuleModelInfo).toBeDefined(); + }); + + test('VnfModelInfo should defined extra details', () => { + expect(vfModuleModel.name).toEqual('vfModules'); + expect(vfModuleModel.type).toEqual('Module'); + }); + + test('isEcompGeneratedNaming should return true if vnf has isEcompGeneratedNaming is "true" ', () => { + let isEcompGeneratedNaming : boolean = vfModuleModel.isEcompGeneratedNaming({}, { + properties: { + ecomp_generated_naming: 'true' + } + }); + expect(isEcompGeneratedNaming).toBeTruthy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is "false"', () => { + let isEcompGeneratedNaming : boolean = vfModuleModel.isEcompGeneratedNaming({}, { + properties: { + ecomp_generated_naming: 'false' + } + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is not defined', () => { + let isEcompGeneratedNaming : boolean = vfModuleModel.isEcompGeneratedNaming({}, { + properties: { + } + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + + test('getTooltip should return "VFModule"', () => { + let tooltip: string = vfModuleModel.getTooltip(); + expect(tooltip).toEqual('VFmodule'); + }); + + test('getType should return "VFModule"', () => { + let tooltip: string = vfModuleModel.getType(); + expect(tooltip).toEqual('VFmodule'); + }); + + test('getNextLevelObject should return null', () => { + let nextLevel = vfModuleModel.getNextLevelObject(); + expect(nextLevel).toBeNull(); + }); + + test('getModel should return Module model', () => { + let model = vfModuleModel.getModel('2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1',{}, getServiceHierarchy()); + expect(model.uuid).toEqual('25284168-24bb-4698-8cb4-3f509146eca5'); + }); + + test('showNodeIcons should return false false if reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + parent : { + data : { + id : 'vnfId', + name : 'vnfName' + } + }, + data : { + id : 'vnfId', + name : 'vnfName' + } + }; + _sharedTreeService.setSelectedVNF({ + data : { + id : 'vfModuleId', + name : 'VfModuleName' + } + }); + jest.spyOn(vfModuleModel, 'getOptionalVNFs').mockReturnValue([]); + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + 'vnfName' : { + 'properties' : { + 'max_instances' : 1 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'vnfId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + + } + } + } + } + } + }); + + let result = vfModuleModel.showNodeIcons(<any>node, serviceId); + expect(result).toEqual(new AvailableNodeIcons(false , false)); + }); + + test('showNodeIcons should return true, false if reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + data : { + id : 'vfModuleId', + name : 'vfModuleName' + }, + parent : { + data : { + id : 'vnfId', + name : 'vnfName' + } + } + }; + jest.spyOn(_sharedTreeService, 'getSelectedVNF').mockReturnValue('vnfName'); + jest.spyOn(vfModuleModel, 'getOptionalVNFs').mockReturnValue(['vnfName']); + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + 'vnfName' : { + 'properties' : { + 'max_instances' : 1 + } + } + }, + 'vfModules' : { + 'vfModuleName' : { + 'properties' : { + maxCountInstances : 1 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'vnfId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + 'originalName' : 'vnfName', + 'vfModules' : { + 'vfModuleName' : { + + } + } + } + } + } + } + } + }); + + let result = vfModuleModel.showNodeIcons(<any>node, 'servicedId'); + expect(result).toEqual(new AvailableNodeIcons(true , false)); + }); + + + test('showNodeIcons should return false, true if reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + data : { + id : 'vfModuleId', + name : 'vfModuleName' + }, + parent : { + data : { + id : 'vnfId', + name : 'vnfName' + } + } + }; + jest.spyOn(_sharedTreeService, 'getSelectedVNF').mockReturnValue('vnfName'); + jest.spyOn(vfModuleModel, 'getOptionalVNFs').mockReturnValue(['vnfName']); + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + 'vnfName' : { + 'properties' : { + 'max_instances' : 1 + } + } + }, + 'vfModules' : { + 'vfModuleName' : { + 'properties' : { + maxCountInstances : 2 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'vnfId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + 'originalName' : 'vnfName', + 'vfModules' : { + 'vfModuleName' : { + + } + } + } + } + } + } + } + }); + + let result = vfModuleModel.showNodeIcons(<any>node, 'servicedId'); + expect(result).toEqual(new AvailableNodeIcons(true , false)); + }); + + + test('getOptionalVNFs should instance if exist', ()=>{ + let serviceId : string = 'servicedId'; + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + 'vnfName' : { + 'properties' : { + 'max_instances' : 1 + } + } + }, + 'vfModules' : { + 'vfModuleName' : { + 'properties' : { + maxCountInstances : 2 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'vnfId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + 'originalName' : 'vnfName', + 'vfModules' : { + 'vfModuleName' : { + + } + } + } + } + } + } + } + }); + + let node = { + data : { + id : 'vfModuleId', + name : 'vfModuleName' + }, + parent : { + data : { + id : 'vnfId', + name : 'vnfName' + } + } + }; + let result = vfModuleModel.getOptionalVNFs(serviceId , 'vnfName'); + expect(result.length).toEqual(1); + }); + + test('getNodeCount should return number of nodes', ()=>{ + let serviceId : string = 'servicedId'; + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + 'vnfName' : { + 'properties' : { + 'max_instances' : 1 + } + } + }, + 'vfModules' : { + 'vfModuleName' : { + 'properties' : { + maxCountInstances : 2 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'vnfId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + 'action': 'Create', + 'originalName' : 'vnfName', + 'vfModules' : { + 'vfModuleName' : { + 'vnfModuleName_111': { + 'action': 'Create', + 'modelInfo' : { + modelVersionId : 'vfModuleId' + } + } + } + } + } + } + } + } + } + }); + + let node = { + data : { + id : 'vfModuleId', + name : 'vfModuleName', + 'action': 'Create', + }, + parent : { + data : { + id : 'vnfId', + name : 'vnfName', + 'action': 'Create', + } + } + }; + let result = vfModuleModel.getNodeCount(<any>node , serviceId); + expect(result).toEqual(1); + }); + + + test('onClickAdd should open message box if no vnfStoreKey', ()=>{ + jest.spyOn(_sharedTreeService, 'getSelectedVNF').mockReturnValue(null); + jest.spyOn(vfModuleModel, 'getDefaultVNF').mockReturnValue(null); + jest.spyOn(MessageBoxService.openModal, 'next'); + vfModuleModel.onClickAdd(<any>{}, 'serviceId'); + expect(MessageBoxService.openModal.next).toHaveBeenCalled(); + }); + + test('getMenuAction: showAuditInfoVfModule', ()=>{ + jest.spyOn(_sharedTreeService, 'isRetryMode').mockReturnValue(true); + + let node = { + data : { + "modelId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "action": "Create", + "isFailed": true, + } + }; + let serviceModelId = "6b528779-44a3-4472-bdff-9cd15ec93450"; + let result = vfModuleModel.getMenuAction(<any>node, serviceModelId); + spyOn(result['showAuditInfo'], 'method'); + expect(result['showAuditInfo']).toBeDefined(); + expect(result['showAuditInfo'].visible(node)).toBeTruthy(); + expect(result['showAuditInfo'].enable(node)).toBeTruthy(); + result['showAuditInfo']['method'](node, serviceModelId); + expect(result['showAuditInfo']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + test('Info for vfModule should be correct', () => { + const model = getVFModule(); + const instance = getVFModuleInstance(); + let actualVNFInfo = vfModuleModel.getInfoForVFModule(model,instance); + let expectedVNFInfo = [ + ModelInformationItem.createInstance('Type', 'vfModule'), + ModelInformationItem.createInstance('Model Version', '2'), + ModelInformationItem.createInstance('Model Customization ID','55b1be94-671a-403e-a26c-667e9c47d091'), + ModelInformationItem.createInstance('Instance ID', '2c1ca484-cbc2-408b-ab86-25a2c15ce280'), + ModelInformationItem.createInstance('In Maintenance', true), + ModelInformationItem.createInstance('Base Module', false), + ModelInformationItem.createInstance('Min Instances', 0), + ModelInformationItem.createInstance('Initial Instances Count',0) + ]; + expect(actualVNFInfo).toEqual(new ComponentInfoModel(ComponentInfoType.VFMODULE, expectedVNFInfo, [])); + }); + + function getVFModule(){ + return { + "uuid":"522159d5-d6e0-4c2a-aa44-5a542a12a830", + "invariantUuid":"98a7c88b-b577-476a-90e4-e25a5871e02b", + "customizationUuid":"55b1be94-671a-403e-a26c-667e9c47d091", + "description":null, + "name":"VfVmee..vmme_vlc..module-1", + "version":"2", + "modelCustomizationName":"VfVmee..vmme_vlc..module-1", + "properties":{ + "minCountInstances":0, + "maxCountInstances":null, + "initialCount":0, + "vfModuleLabel":"vmme_vlc", + "baseModule":false + }, + "inputs":{}, + "volumeGroupAllowed":false + }; + } + + function getVFModuleInstance() { + return { + "action":"None", + "instanceName":"ss820f_0918_db", + "instanceId":"2c1ca484-cbc2-408b-ab86-25a2c15ce280", + "orchStatus":"deleted", + "productFamilyId":null, + "lcpCloudRegionId":null, + "tenantId":null, + "modelInfo":{ + "modelCustomizationName":"VfVmee..vmme_vlc..module-1", + "modelCustomizationId":"b200727a-1bf9-4e7c-bd06-b5f4c9d920b9", + "modelInvariantId":"09edc9ef-85d0-4b26-80de-1f569d49e750", + "modelVersionId":"522159d5-d6e0-4c2a-aa44-5a542a12a830", + "modelType":"vfModule" + }, + "instanceType":null, + "provStatus":null, + "inMaint":true, + "uuid":"522159d5-d6e0-4c2a-aa44-5a542a12a830", + "originalName":"VfVmee..vmme_vlc..module-1", + "legacyRegion":null, + "lineOfBusiness":null, + "platformName":null, + "trackById":"vf_vmee0..VfVmee..vmme_vlc..module-1:008", + "isBase":false, + "volumeGroupName":null + }; + } + + + function getServiceHierarchy(){ + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + }, + "vidNotions": { + "instantiationUI": "legacy", + "modelCategory": "other" + } + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "max_instances": "3", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": {}, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {} + } + } +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts new file mode 100644 index 000000000..7db3d906e --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts @@ -0,0 +1,388 @@ +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {ILevelNodeInfo} from "../basic.model.info"; +import * as _ from "lodash"; +import {VNFModel} from "../../../../../shared/models/vnfModel"; +import {SharedTreeService} from "../../shared.tree.service"; +import {VfModuleTreeNode} from "../../../../../shared/models/vfModuleTreeNode"; +import {VfModuleInstance} from "../../../../../shared/models/vfModuleInstance"; +import {VfModule} from "../../../../../shared/models/vfModule"; +import {NgRedux} from "@angular-redux/store"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import { + GenericFormPopupComponent, + PopupType +} from "../../../../../shared/components/genericFormPopup/generic-form-popup.component"; +import {DialogService} from "ng2-bootstrap-modal"; +import {VfModulePopuopService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {AppState} from "../../../../../shared/store/reducers"; +import {MessageBoxData} from "../../../../../shared/components/messageBox/messageBox.data"; +import {MessageBoxService} from "../../../../../shared/components/messageBox/messageBox.service"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import { + deleteActionVfModuleInstance, + removeVfModuleInstance, + undoDeleteVfModuleInstance, + updateVFModulePosition +} from "../../../../../shared/storeUtil/utils/vfModule/vfModule.actions"; +import {ComponentInfoService} from "../../../component-info/component-info.service"; +import {ComponentInfoModel, ComponentInfoType} from "../../../component-info/component-info-model"; +import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component"; + +export class VFModuleModelInfo implements ILevelNodeInfo { + constructor(private _dynamicInputsService: DynamicInputsService, + private _sharedTreeService: SharedTreeService, + private _dialogService: DialogService, + private _vfModulePopupService: VfModulePopuopService, + private _iframeService: IframeService, + private _store: NgRedux<AppState>, + private _componentInfoService: ComponentInfoService) { + } + + name: string = 'vfModules'; + type: string = 'Module'; + typeName: string = 'M'; + + /*********************************************************** + * return if user should provide instance name or not. + * get info from parent (VNF) + * @param currentModel - current Model object + * @param parentModel - current parent Model object + ************************************************************/ + isEcompGeneratedNaming(currentModel, parentModel): boolean { + const ecompGeneratedNaming = !_.isNil(parentModel.properties) ? parentModel.properties.ecomp_generated_naming : undefined; + return ecompGeneratedNaming === "true"; + } + + /*********************************************************** + * return model dynamic inputs + * @param currentModel - current Model object + ************************************************************/ + updateDynamicInputsDataFromModel = (currentModel): any => { + let displayInputs = _.isNil(currentModel) ? [] : currentModel.inputs; + return _.isEmpty(displayInputs) ? [] : this._dynamicInputsService.getArbitraryInputs(displayInputs); + }; + + /*********************************************************** + * return vfModule model + * @param vfModuleModelId - current Model id + * @param instance + * @param serviceHierarchy - serviceHierarchy + ************************************************************/ + getModel = (vfModuleModelId: string, instance, serviceHierarchy): any => { + if (!_.isNil(serviceHierarchy)) { + if (!_.isNil(serviceHierarchy[this.name]) && !_.isNil(serviceHierarchy[this.name][vfModuleModelId])) { + return serviceHierarchy[this.name][vfModuleModelId]; + } + } + return {}; + }; + + createNode(instance: VfModuleInstance, currentModel: VfModule, parentModel: VNFModel, modelName: string, index: number): VfModuleTreeNode { + let dynamicModelName = Object.keys(instance)[index]; + instance = instance[Object.keys(instance)[index]]; + const isEcompGeneratedNaming: boolean = this.isEcompGeneratedNaming(currentModel, parentModel); + + const dynamicInputs = this.updateDynamicInputsDataFromModel(currentModel); + let newVfModule: VfModuleTreeNode = new VfModuleTreeNode(instance, currentModel, modelName, dynamicInputs, isEcompGeneratedNaming, dynamicModelName); + + newVfModule.missingData = this._sharedTreeService.hasMissingData(instance, newVfModule.dynamicInputs, isEcompGeneratedNaming, []); + newVfModule.typeName = this.typeName; + newVfModule.menuActions = this.getMenuAction(<any>newVfModule, currentModel.uuid); + newVfModule.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; + newVfModule.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage: ""; + + newVfModule = this._sharedTreeService.addingStatusProperty(newVfModule); + return newVfModule; + } + + createInstanceTreeNode(instance: VfModuleInstance, currentModel: VfModule, parentModel: VNFModel, modelName: string): VfModuleTreeNode | VfModuleTreeNode[] { + let numberOfChilds = Object.keys(instance).length; + if (numberOfChilds > 1) { + let result: VfModuleTreeNode[] = []; + for (let i = 0; i < numberOfChilds; i++) { + result.push(this.createNode(instance, currentModel, parentModel, modelName, i)); + } + return result; + } else { + return this.createNode(instance, currentModel, parentModel, modelName, 0); + } + } + + /*********************************************************** + * return next level object (null because is last level) + ************************************************************/ + getNextLevelObject(): any { + return null; + } + + getTooltip = (): string => 'VFmodule'; + + getType = (): string => 'VFmodule'; + + /*********************************************************** + * return if instance has missing data + * @param instance - vnf instance + * @param dynamicInputs + * @param isEcompGeneratedNaming + ************************************************************/ + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean { + return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, []); + } + + + /*********************************************************** + * return if instance has missing data + * @param node - VFModule node + * @param serviceModelId - current service id + ************************************************************/ + onClickAdd(node: ITreeNode, serviceModelId: string): void { + const vnfStoreKey = this._sharedTreeService.getSelectedVNF() || this.getDefaultVNF(node.parent, serviceModelId); + if (vnfStoreKey) { + this._dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.VF_MODULE, + uuidData: <any>{ + serviceId: serviceModelId, + modelName: node.data.name, + vFModuleStoreKey: null, + vnfStoreKey: vnfStoreKey, + modelId: node.data.modelId, + type: node.data.type, + popupService: this._vfModulePopupService + }, + node: node, + isUpdateMode: false + }); + } else { + let messageBoxData: MessageBoxData = new MessageBoxData( + "Select a parent", // modal title + "There are multiple instances on the right side that can contain this vf-module Please select the VNF instance, to add this vf-module to, on the right side and then click the + sign", + <any>"warning", + <any>"md", + [ + {text: "Close", size: "medium", closeModal: true} + ]); + MessageBoxService.openModal.next(messageBoxData); + } + } + + getDefaultVNF(node: ITreeNode, serviceModelId: string): string { + let keys = _.keys(_.pickBy(this._store.getState().service.serviceInstance[serviceModelId].vnfs, vnf => { + return (vnf.originalName == node.data.name); + })); + return keys.length === 1 ? this._store.getState().service.serviceInstance[serviceModelId].vnfs[keys[0]].vnfStoreKey : null; + } + + /*********************************************************** + * return number of existing instances (in all VNF's) + * @param node - VfModule node + * @param serviceModelId - current service id + ************************************************************/ + getNodeCount(node: ITreeNode, serviceModelId: string): number { + let count: number = 0; + if (!_.isNil(this._store.getState().service.serviceInstance) && !_.isNil(this._store.getState().service.serviceInstance[serviceModelId])) { + const vnfs = this._store.getState().service.serviceInstance[serviceModelId].vnfs; + + for (let vnfKey in vnfs) { + count += this.countNumberOfVFModule(vnfs[vnfKey], node); + } + return count; + } + return count; + } + + + countNumberOfVFModule(vnf, node): number { + let count = 0; + for (let vfModuleKey in vnf['vfModules']) { + for (let vfModule in vnf['vfModules'][vfModuleKey]) { + if (vnf['vfModules'][vfModuleKey][vfModule]['modelInfo'].modelCustomizationId === node.data.modelUniqueId) { + const vfModuleObj = vnf['vfModules'][vfModuleKey][vfModule]; + if (!(!_.isNil(vfModuleObj) && !_.isNil(vfModuleObj.action) && vfModuleObj.action.split('_').pop() === 'Delete')) count++; + } + } + } + return count; + } + + getCountVFModuleOfSelectedVNF(node: ITreeNode, vnfStoreKey: string, serviceModelId: string): number { + let count: number = 0; + if (!_.isNil(this._store.getState().service.serviceInstance) && !_.isNil(this._store.getState().service.serviceInstance[serviceModelId])) { + const vnfs = this._store.getState().service.serviceInstance[serviceModelId].vnfs; + + for (let vnfKey in vnfs) { + count += this.countNumberOfVFModule(vnfs[vnfKey], node); + } + return count; + } + return count; + } + + + /*********************************************************** + * should show node icon + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons { + const selectedVNF: string = this._sharedTreeService.getSelectedVNF(); + if (selectedVNF) { + return this.showVFModuleOnSelectedVNF(node, selectedVNF, serviceModelId); + } else { + const optionalSelected = this.getOptionalVNFs(serviceModelId, node.parent.data.name); + if (optionalSelected.length === 1) { + return this.showVFModuleOnSelectedVNF(node, optionalSelected[0].vnfStoreKey, serviceModelId); + } else { + return new AvailableNodeIcons(false, false); + } + } + } + + + showVFModuleOnSelectedVNF(node: ITreeNode, selectedVNF: string, serviceModelId: string): AvailableNodeIcons { + + if (!_.isNil(this._store.getState().service.serviceInstance[serviceModelId].vnfs[selectedVNF]) && node.parent.data.name === this._store.getState().service.serviceInstance[serviceModelId].vnfs[selectedVNF].originalName) { + const existingVFModules = this.getCountVFModuleOfSelectedVNF(node, selectedVNF, serviceModelId); + const reachedLimit = this.isVFModuleReachedLimit(node, this._store.getState().service.serviceHierarchy, serviceModelId, existingVFModules); + const showAddIcon = this._sharedTreeService.shouldShowAddIcon()&& !reachedLimit; + return new AvailableNodeIcons(showAddIcon, reachedLimit); + } + return new AvailableNodeIcons(false, false); + + } + + getOptionalVNFs(serviceUUID: string, vnfOriginalModelName: string): any[] { + let result = []; + if (!_.isNil(this._store.getState().service.serviceInstance) && !_.isNil(this._store.getState().service.serviceInstance[serviceUUID])) { + const serviceVNFsInstances = this._store.getState().service.serviceInstance[serviceUUID].vnfs; + for (let vnfKey in serviceVNFsInstances) { + if (serviceVNFsInstances[vnfKey].originalName === vnfOriginalModelName) { + serviceVNFsInstances[vnfKey].vnfStoreKey = vnfKey; + result.push(serviceVNFsInstances[vnfKey]); + } + } + } + return result; + } + + + /************************************************ + return number of instances with action Delete + @type: vnfs networks, vngGroups (only vfModule) + @node : node model from the left tree + ************************************************/ + getExistingInstancesWithDeleteMode(node, serviceModelId: string, selectedVNF: string): number { + const existingInstances = this._store.getState().service.serviceInstance[serviceModelId].vnfs[selectedVNF].vfModules; + let counter = 0; + const modelUuid = node.data.uuid; + + if (!_.isNil(existingInstances)) { + for (let instanceKey in existingInstances) { + let size = Object.keys(existingInstances[instanceKey]).length; + for (let i = 0; i < size; i++) { + let vfModuleDynamicKey = Object.keys(existingInstances[instanceKey])[i]; + if (!_.isNil(existingInstances[instanceKey][vfModuleDynamicKey].action)) { + if (existingInstances[instanceKey][vfModuleDynamicKey]['uuid'] === modelUuid && existingInstances[instanceKey][vfModuleDynamicKey].action.split('_').pop() === 'Delete') { + counter++; + } + } + } + + } + } + return counter; + } + + isVFModuleReachedLimit(node: any, serviceHierarchy: any, serviceModelId: string, currentNodeCount: number): boolean { + let maxNodes: number = 1; + let vnfModules = serviceHierarchy[serviceModelId].vfModules; + if (vnfModules[node.data.name]) { + maxNodes = vnfModules[node.data.name].properties.maxCountInstances || 1; + } + return !(maxNodes > currentNodeCount); + + } + + getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } } { + return { + edit: { + method: (node, serviceModelId) => { + this._iframeService.addClassOpenModal('content'); + this._dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.VF_MODULE, + uuidData: <any>{ + serviceId: serviceModelId, + modelName: node.data.modelName, + vFModuleStoreKey: node.data.dynamicModelName, + vnfStoreKey: node.parent.data.vnfStoreKey, + modelId: node.data.modelId, + type: node.data.type, + popupService: this._vfModulePopupService + }, + node: node, + isUpdateMode: true + }); + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + }, + showAuditInfo: { + method: (node, serviceModelId) => { + let instance = this._store.getState().service.serviceInstance[serviceModelId].vnfs[node.parent.data.vnfStoreKey].vfModules[node.data.modelName][node.data.modelVersionId]; + this._sharedTreeService.openAuditInfoModal(node, serviceModelId, instance, 'VFMODULE', this); + }, + visible: (node) => this._sharedTreeService.shouldShowAuditInfo(node), + enable: (node) => this._sharedTreeService.shouldShowAuditInfo(node) + }, + remove: { + method: (node, serviceModelId) => this._store.dispatch(removeVfModuleInstance(node.data.modelName, serviceModelId, node.parent.data.modelName, node.parent.data.vnfStoreKey, node.data.dynamicModelName)), + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + }, + delete: { + method: (node, serviceModelId) => { + this._store.dispatch(deleteActionVfModuleInstance(node.data.dynamicModelName, node.parent.data.vnfStoreKey, serviceModelId)) + }, + visible: (node) => this._sharedTreeService.shouldShowDelete(node), + enable: (node) => this._sharedTreeService.shouldShowDelete(node) + }, + undoDelete: { + method: (node, serviceModelId) => { + this._store.dispatch(undoDeleteVfModuleInstance(node.data.dynamicModelName, node.parent.data.vnfStoreKey, serviceModelId)) + }, + visible: (node) => this._sharedTreeService.shouldShowUndoDelete(node), + enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && this._sharedTreeService.shouldShowDelete(node.parent) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) + } + }; + + + } + + updatePosition(that , node, instanceId, parentStoreKey): void { + that.store.dispatch(updateVFModulePosition(node, instanceId, parentStoreKey)); + } + + + getNodePosition(instance, deepDynamicName): number { + return (!_.isNil(instance) && !_.isNil(instance[deepDynamicName])) ? instance[deepDynamicName].position : null; + } + + onSelectedNode(node: ITreeNode): void { + } + + getInfoForVFModule(model, instance): ComponentInfoModel { + let modelInfoItems: ModelInformationItem[] = []; + if (model && !_.isNil(model.properties)) + { + modelInfoItems = [ + ModelInformationItem.createInstance("Base Module", model.properties.baseModule), + ModelInformationItem.createInstance("Min Instances", model.properties.minCountInstances), + ModelInformationItem.createInstance("Max Instances", model.properties.maxCountInstances), + ModelInformationItem.createInstance("Initial Instances Count", model.properties.initialCount) + ]; + } + return this._componentInfoService.addGeneralInfoItems(modelInfoItems, ComponentInfoType.VFMODULE, model, instance); + } + + +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.spec.ts new file mode 100644 index 000000000..10c8e399c --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.spec.ts @@ -0,0 +1,1671 @@ +import {HttpClientTestingModule, HttpTestingController} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {VnfModelInfo} from "./vnf.model.info"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {VFModuleModelInfo} from "../vfModule/vfModule.model.info"; +import {VNFModel} from "../../../../../shared/models/vnfModel"; +import {SharedTreeService} from "../../shared.tree.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../../shared/store/reducers"; +import {DefaultDataGeneratorService} from "../../../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {DialogService} from "ng2-bootstrap-modal"; +import {VfModulePopuopService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {VnfPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {DuplicateService} from "../../../duplicate/duplicate.service"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import {ServiceInfoService} from "../../../../../shared/server/serviceInfo/serviceInfo.service"; +import {AuditInfoModalComponent} from "../../../../../shared/components/auditInfoModal/auditInfoModal.component"; +import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component"; +import {ComponentInfoModel, ComponentInfoType} from "../../../component-info/component-info-model"; +import {ComponentInfoService} from "../../../component-info/component-info.service"; +import {AaiService} from "../../../../../shared/services/aaiService/aai.service"; +import {HttpClient, HttpHandler} from "@angular/common/http"; +import {FeatureFlagsService} from "../../../../../shared/services/featureFlag/feature-flags.service"; + +describe('Vnf Model Info', () => { + let injector; + let httpMock: HttpTestingController; + let _dynamicInputsService : DynamicInputsService; + let _sharedTreeService : SharedTreeService; + let _serviceInfoService: ServiceInfoService; + let _defaultDataGeneratorService : DefaultDataGeneratorService; + let _dialogService : DialogService; + let _vfModulePopupService : VfModulePopuopService; + let _vnfPopupService : VnfPopupService; + let _duplicateService : DuplicateService; + let _iframeService : IframeService; + let _componentInfoService : ComponentInfoService; + + let _store : NgRedux<AppState>; + let vnfModel: VnfModelInfo; + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule], + providers: [ + MockNgRedux, + DynamicInputsService, + DialogService, + VfModulePopuopService, + VnfPopupService, + DefaultDataGeneratorService, + SharedTreeService, + DuplicateService, + AaiService, + HttpClient, + HttpHandler, + FeatureFlagsService, + ComponentInfoService, + IframeService] + }).compileComponents(); + + injector = getTestBed(); + _sharedTreeService = injector.get(SharedTreeService); + _store = injector.get(NgRedux); + _componentInfoService = injector.get(ComponentInfoService); + + vnfModel = new VnfModelInfo( + _dynamicInputsService, + _sharedTreeService, + _defaultDataGeneratorService, + _dialogService, + _vnfPopupService, + _vfModulePopupService, + _duplicateService, + null, + _iframeService, + _componentInfoService, + _store); + + + }); + + test('VnfModelInfo should be defined', () => { + expect(VnfModelInfo).toBeDefined(); + }); + + test('VnfModelInfo should defined extra details', () => { + expect(vnfModel.name).toEqual('vnfs'); + expect(vnfModel.type).toEqual('VNF'); + expect(vnfModel.childName).toEqual('vfModules'); + expect(vnfModel.childType).toEqual('VFModuleModelInfo'); + }); + + test('isEcompGeneratedNaming should return true if isEcompGeneratedNaming is "true" ', () => { + let isEcompGeneratedNaming: boolean = vnfModel.isEcompGeneratedNaming(<any>{ + properties: { + ecomp_generated_naming: 'true' + } + }); + expect(isEcompGeneratedNaming).toBeTruthy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is "false"', () => { + let isEcompGeneratedNaming: boolean = vnfModel.isEcompGeneratedNaming({ + properties: { + ecomp_generated_naming: 'false' + } + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + test('isEcompGeneratedNaming should return false if isEcompGeneratedNaming is not defined', () => { + let isEcompGeneratedNaming: boolean = vnfModel.isEcompGeneratedNaming({ + properties: { + } + }); + expect(isEcompGeneratedNaming).toBeFalsy(); + }); + + + test('getTooltip should return "VF"', () => { + let tooltip: string = vnfModel.getTooltip(); + expect(tooltip).toEqual('VF'); + }); + + test('getType should return "VF"', () => { + let tooltip: string = vnfModel.getType(); + expect(tooltip).toEqual('VF'); + }); + + test('getNextLevelObject should vfModule level object', () => { + let nextLevel: VFModuleModelInfo = vnfModel.getNextLevelObject(); + expect(nextLevel.type).toEqual('Module'); + }); + + test('getModel should return VNF model', () => { + let model: VNFModel = vnfModel.getModel('2017-388_ADIOD-vPE 1', <any>{ + originalName : '2017-388_ADIOD-vPE 1' + }, getServiceHierarchy()); + expect(model.type).toEqual('VF'); + }); + + test('showNodeIcons should return false if reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + data : { + id : 'vnfId', + name : 'vnfName', + modelCustomizationId : "modelCustomizationId", + modelUniqueId: "modelCustomizationId" + } + }; + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global:{}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + modelCustomizationId : "modelCustomizationId", + 'modelInfo': { + modelCustomizationId : "modelCustomizationId" + }, + 'vnfName' : { + 'properties' : { + 'max_instances' : 1 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'modelCustomizationId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + + } + } + } + } + } + }); + + let result = vnfModel.showNodeIcons(<any>node, serviceId); + expect(result).toEqual(new AvailableNodeIcons(false , true)); + }); + + test('showNodeIcons should return true if not reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + data : { + id : 'vnfId', + name : 'vnfName' + } + }; + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global:{ + drawingBoardStatus: "EDIT" + }, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + 'vnfName' : { + 'properties' : { + 'max_instances' : 2 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'vnfId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + + } + } + } + } + } + }); + + let result = vnfModel.showNodeIcons(<any>node, serviceId); + expect(result).toEqual(new AvailableNodeIcons(true , false)); + }); + + test('getNodeCount should return number of nodes', ()=>{ + let serviceId : string = 'servicedId'; + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfs' : { + 'vnfName' : { + 'properties' : { + 'max_instances' : 1 + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVNFCounterMap' : { + 'modelCustomizationId' : 1 + }, + 'vnfs' : { + 'vnfName' :{ + 'originalName' : 'vnfName' + } + } + } + } + } + }); + + let node = { + data : { + id : 'vnfId', + name : 'vnfName', + modelCustomizationId : "modelCustomizationId", + modelUniqueId: "modelCustomizationId" + } + }; + let result = vnfModel.getNodeCount(<any>node , serviceId); + expect(result).toEqual(1); + + node.data.modelCustomizationId = 'vnfId_notExist'; + node.data.modelUniqueId = 'vnfId_notExist'; + result = vnfModel.getNodeCount(<any>node , serviceId); + expect(result).toEqual(0); + + result = vnfModel.getNodeCount(<any>node , serviceId + '_notExist'); + expect(result).toEqual(0); + }); + + test('getMenuAction: edit', ()=>{ + let node = {"modelId":"d6557200-ecf2-4641-8094-5393ae3aae60","missingData":true,"action":"None","inMaint":true,"name":"jlfBwIks283yKlCD8","modelName":"VF_vMee 0","type":"VF","isEcompGeneratedNaming":true,"networkStoreKey":"VF_vMee 0:004","vnfStoreKey":"VF_vMee 0:004","typeName":"VNF"}; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + let result = vnfModel.getMenuAction(<any>node, serviceModelId); + spyOn(result['edit'], 'method'); + expect(result['edit']).toBeDefined(); + expect(result['edit'].visible).toBeTruthy(); + expect(result['edit'].enable).toBeTruthy(); + result['edit']['method'](node, serviceModelId); + expect(result['edit']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + test('member should defined edit method', () => { + let node = { + data : { + "modelId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "missingData": true, + "action": "None", + "inMaint": true, + "name": "jlfBwIks283yKlCD8", + "modelName": "VF_vMee 0", + "type": "VF", + "userProvidedNaming": false, + "networkStoreKey": "VF_vMee 0:004", + "vnfStoreKey": "VF_vMee 0:004", + "typeName": "VNF" + }, + type : 'VNF' + + }; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + + let menuActions = vnfModel.getMenuAction(<any>node, serviceModelId); + spyOn(menuActions['edit'], 'method'); + expect(menuActions['edit']).toBeDefined(); + expect(menuActions['edit'].visible(node)).toBeFalsy(); + menuActions['edit']['method'](node, serviceModelId); + expect(menuActions['edit']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + test('getMenuAction: duplicate', ()=>{ + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + "global": { + "name": null, + "type": "UPDATE_DRAWING_BOARD_STATUS", + "drawingBoardStatus": "CREATE" + } + }); + let node = { + data : { + "modelId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "missingData": true, + "action": "None", + "inMaint": true, + "name": "jlfBwIks283yKlCD8", + "modelName": "VF_vMee 0", + "type": "VF", + "isEcompGeneratedNaming":true, + "networkStoreKey": "VF_vMee 0:004", + "vnfStoreKey": "VF_vMee 0:004", + "typeName": "VNF" + }, + type : 'VNF' + + }; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + let menuActions = vnfModel.getMenuAction(<any>node, serviceModelId); + spyOn(menuActions['duplicate'], 'method'); + expect(menuActions['duplicate']).toBeDefined(); + expect(menuActions['duplicate'].visible(node)).toBeFalsy(); + menuActions['duplicate']['method'](node, serviceModelId); + expect(menuActions['duplicate']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + test('getMenuAction: remove', ()=>{ + let node = { + data : { + "modelId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "missingData": true, + "action": "None", + "inMaint": true, + "name": "jlfBwIks283yKlCD8", + "modelName": "VF_vMee 0", + "type": "VF", + "isEcompGeneratedNaming":true, + "networkStoreKey": "VF_vMee 0:004", + "vnfStoreKey": "VF_vMee 0:004", + "typeName": "VNF" + }, + type : 'VNF' + + }; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + + let menuActions = vnfModel.getMenuAction(<any>node, serviceModelId); + spyOn(menuActions['remove'], 'method'); + expect(menuActions['remove']).toBeDefined(); + expect(menuActions['remove'].visible(node)).toBeFalsy(); + menuActions['remove']['method'](node, serviceModelId); + expect(menuActions['remove']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + test('getMenuAction: delete', ()=>{ + let node = {"modelId":"d6557200-ecf2-4641-8094-5393ae3aae60","missingData":true,"action":"None","inMaint":true,"name":"jlfBwIks283yKlCD8","modelName":"VF_vMee 0","type":"VF","isEcompGeneratedNaming":true,"networkStoreKey":"VF_vMee 0:004","vnfStoreKey":"VF_vMee 0:004","typeName":"VNF"}; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + let result = vnfModel.getMenuAction(<any>node, serviceModelId); + spyOn(result['delete'], 'method'); + expect(result['delete']).toBeDefined(); + expect(result['delete'].visible).toBeTruthy(); + expect(result['delete'].enable).toBeTruthy(); + result['delete']['method'](node, serviceModelId); + expect(result['delete']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + + test('getMenuAction: undoDelete', ()=>{ + let node = {"modelId":"d6557200-ecf2-4641-8094-5393ae3aae60","missingData":true,"action":"None","inMaint":true,"name":"jlfBwIks283yKlCD8","modelName":"VF_vMee 0","type":"VF","isEcompGeneratedNaming":true,"networkStoreKey":"VF_vMee 0:004","vnfStoreKey":"VF_vMee 0:004","typeName":"VNF"}; + let serviceModelId = "d6557200-ecf2-4641-8094-5393ae3aae60"; + let result = vnfModel.getMenuAction(<any>node, serviceModelId); + spyOn(result['undoDelete'], 'method'); + expect(result['undoDelete']).toBeDefined(); + expect(result['undoDelete'].visible).toBeDefined(); + expect(result['undoDelete'].enable).toBeDefined(); + result['undoDelete']['method'](node, serviceModelId); + expect(result['undoDelete']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + test('getMenuAction: showAuditInfo', ()=>{ + jest.spyOn(_sharedTreeService, 'isRetryMode').mockReturnValue(true); + + jest.spyOn(AuditInfoModalComponent.openInstanceAuditInfoModal, 'next'); + let node = { + data : { + "modelId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "action": "Create", + "type": "VF", + "vnfStoreKey": "MSOTEST103a", + "typeName": "VNF", + "isFailed": true, + }, + type : 'VNF' + + }; + let serviceModelId = "6b528779-44a3-4472-bdff-9cd15ec93450"; + let result = vnfModel.getMenuAction(<any>node, serviceModelId); + spyOn(result['showAuditInfo'], 'method'); + expect(result['showAuditInfo']).toBeDefined(); + expect(result['showAuditInfo'].visible(node)).toBeTruthy(); + expect(result['showAuditInfo'].enable(node)).toBeTruthy(); + result['showAuditInfo']['method'](node, serviceModelId); + + // expect(AuditInfoModalComponent.openInstanceAuditInfoModal.next).toBeCalled(); + // expect(result['showAuditInfo'].method) + + }); + + test('Info for vnf should be correct', () => { + const model = getVNFModel(); + const instance = getVNFInstance(); + let actualVNFInfo = vnfModel.getInfoForVnf(model,instance); + let expectedVNFInfo = [ + ModelInformationItem.createInstance('Type', 'VF'), + ModelInformationItem.createInstance('Model Version', '2.0'), + ModelInformationItem.createInstance('Model Customization ID','91415b44-753d-494c-926a-456a9172bbb9'), + ModelInformationItem.createInstance('Instance ID', '66cbb3b5-c823-470c-9520-4e0b85112250'), + ModelInformationItem.createInstance('In Maintenance', true), + ModelInformationItem.createInstance('Min Instances', 0), + ModelInformationItem.createInstance('Max Instances',1) + ]; + expect(actualVNFInfo).toEqual(new ComponentInfoModel(ComponentInfoType.VNF, expectedVNFInfo, [])); + }); + + test('Info for vnf in left side - model only - should be correct', () => { + const model = getVNFModel(); + let actualVNFInfo = vnfModel.getInfoForVnf(model,null); + let expectedVNFInfo = [ + ModelInformationItem.createInstance('Type', 'VF'), + ModelInformationItem.createInstance('Model Version', '2.0'), + ModelInformationItem.createInstance('Model Customization ID','91415b44-753d-494c-926a-456a9172bbb9'), + ModelInformationItem.createInstance('Min Instances', 0), + ModelInformationItem.createInstance('Max Instances',1) + ]; + expect(actualVNFInfo).toEqual(new ComponentInfoModel(ComponentInfoType.VNF, expectedVNFInfo, [])); + }); + + function getVNFModel(){ + return { + "name":"VF_vMee", + "version":"2.0", + "description":"VSP_vMee", + "uuid":"d6557200-ecf2-4641-8094-5393ae3aae60", + "invariantUuid":"4160458e-f648-4b30-a176-43881ffffe9e", + "max":1, + "min":0, + "customizationUuid":"91415b44-753d-494c-926a-456a9172bbb9", + "isEcompGeneratedNaming":true, + "type":"VF", + "modelCustomizationName":"VF_vMee 0", + "vfcInstanceGroups":{}, + "properties":{ + "gpb2_Internal2_mac":"00:11:22:EF:AC:DF", + "sctp-a-ipv6-egress_rule_application":"any", + "sctp-b-ipv6-egress_src_start_port":"0", + "Internal2_allow_transit":"true", + "sctp-b-IPv6_ethertype":"IPv6", + "ncb2_Internal1_mac":"00:11:22:EF:AC:DF", + "sctp-b-ingress_rule_protocol":"icmp","sctp-b-ingress_action":"pass", + "sctp-a-egress_rule_application":"any", + "sctp-b-ipv6-ingress-src_start_port":"0.0", + "ncb1_Internal2_mac":"00:11:22:EF:AC:DF","sctp-b-egress_src_addresses":"local", + "fsb_volume_size_0":"320.0", + "sctp-a-ipv6-ingress-dst_start_port":"0", + "sctp-a-ipv6-ingress_ethertype":"IPv4","sctp-b-ipv6-ingress_rule_application":"any", + "domain_name":"default-domain", + "sctp-a-egress_src_addresses":"local", + "sctp-b-egress-src_start_port":"0.0", + "sctp-a-ingress_rule_protocol":"icmp", + "sctp-b-display_name":"epc-sctp-b-ipv4v6-sec-group", + "sctp-b-ipv6-ingress-dst_end_port":"65535", + "sctp-a-ingress_ethertype":"IPv4", + "sctp-a-egress-src_start_port":"0.0", + "sctp-b-dst_subnet_prefix_v6":"::", + "nf_naming":"{ecomp_generated_naming=true}", + "sctp-a-ipv6-ingress_src_subnet_prefix":"0.0.0.0" + } + }; + + } + + function getVNFInstance(){ + return { + "action":"None", + "instanceName":"4O61SmpFAdCm1oVEs", + "instanceId":"66cbb3b5-c823-470c-9520-4e0b85112250", + "orchStatus":null, + "productFamilyId":null, + "lcpCloudRegionId":null, + "tenantId":null, + "modelInfo":{ + "modelCustomizationName":"VF_vMee 0", + "modelInvariantId":"vnf-instance-model-invariant-id", + "modelVersionId":"d6557200-ecf2-4641-8094-5393ae3aae60", + "modelType":"vnf" + }, + "instanceType":"7538ifdSoTccmbEkr", + "provStatus":null, + "inMaint":true, + "uuid":"d6557200-ecf2-4641-8094-5393ae3aae60", + "originalName":"VF_vMee 0", + "legacyRegion":null, + "lineOfBusiness":null, + "platformName":null, + "trackById":"VF_vMee 0:004", + "vfModules":{ + "vf_vmee0..VfVmee..vmme_vlc..module-1":{ + "vf_vmee0..VfVmee..vmme_vlc..module-1:008":{ + "action":"None", + "instanceName":"ss820f_0918_db", + "instanceId":"2c1ca484-cbc2-408b-ab86-25a2c15ce280", + "orchStatus":"deleted", + "productFamilyId":null, + "lcpCloudRegionId":null, + "tenantId":null, + "modelInfo":{ + "modelCustomizationName":"VfVmee..vmme_vlc..module-1", + "modelCustomizationId":"b200727a-1bf9-4e7c-bd06-b5f4c9d920b9", + "modelInvariantId":"09edc9ef-85d0-4b26-80de-1f569d49e750", + "modelVersionId":"522159d5-d6e0-4c2a-aa44-5a542a12a830", + "modelType":"vfModule" + }, + "instanceType":null, + "provStatus":null, + "inMaint":true, + "uuid":"522159d5-d6e0-4c2a-aa44-5a542a12a830", + "originalName":"VfVmee..vmme_vlc..module-1", + "legacyRegion":null, + "lineOfBusiness":null, + "platformName":null, + "trackById":"vf_vmee0..VfVmee..vmme_vlc..module-1:008", + "isBase":false, + "volumeGroupName":null + } + }, + "dc229cd8-c132-4455-8517-5c1787c18b14":{ + "dc229cd8-c132-4455-8517-5c1787c18b14:009":{ + "action":"None", + "instanceName":"ss820f_0918_base", + "instanceId":"3ef042c4-259f-45e0-9aba-0989bd8d1cc5", + "orchStatus":"Assigned", + "productFamilyId":null, + "lcpCloudRegionId":null, + "tenantId":null, + "modelInfo":{ + "modelCustomizationId":"8ad8670b-0541-4499-8101-275bbd0e8b6a", + "modelInvariantId":"1e463c9c-404d-4056-ba56-28fd102608de", + "modelVersionId":"dc229cd8-c132-4455-8517-5c1787c18b14", + "modelType":"vfModule" + }, + "instanceType":null, + "provStatus":null, + "inMaint":false, + "uuid":"dc229cd8-c132-4455-8517-5c1787c18b14", + "originalName":null, + "legacyRegion":null, + "lineOfBusiness":null, + "platformName":null, + "trackById":"dc229cd8-c132-4455-8517-5c1787c18b14:009", + "isBase":true, + "volumeGroupName":null + } + } + }, + "networks":{ + + } + }; + } + + function getServiceHierarchy(){ + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + }, + "vidNotions": { + "instantiationUI": "legacy", + "modelCategory": "other" + } + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "max_instances": "3", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": {}, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {} + } + } + +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts new file mode 100644 index 000000000..cec3fad1e --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts @@ -0,0 +1,332 @@ +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {ILevelNodeInfo} from "../basic.model.info"; +import {VFModuleModelInfo} from "../vfModule/vfModule.model.info"; +import {VNFModel} from "../../../../../shared/models/vnfModel"; +import {VnfInstance} from "../../../../../shared/models/vnfInstance"; +import {VnfTreeNode} from "../../../../../shared/models/vnfTreeNode"; +import {InputType} from "../../../../../shared/models/inputTypes"; +import {SharedTreeService} from "../../shared.tree.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../../shared/store/reducers"; +import {DefaultDataGeneratorService} from "../../../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import { + GenericFormPopupComponent, + PopupType +} from "../../../../../shared/components/genericFormPopup/generic-form-popup.component"; +import {DialogService} from 'ng2-bootstrap-modal'; +import {VnfPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {VfModulePopuopService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {DuplicateService} from "../../../duplicate/duplicate.service"; +import {DuplicateVnfComponent} from "../../../duplicate/duplicate-vnf.component"; +import {SdcUiServices} from "onap-ui-angular"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import {changeInstanceCounter, removeInstance} from "../../../../../shared/storeUtil/utils/general/general.actions"; +import {MessageBoxData} from "../../../../../shared/components/messageBox/messageBox.data"; +import {MessageBoxService} from "../../../../../shared/components/messageBox/messageBox.service"; +import {ServiceInstanceActions} from "../../../../../shared/models/serviceInstanceActions"; +import { + deleteActionVnfInstance, + undoDeleteActionVnfInstance, + updateVnfPosition +} from "../../../../../shared/storeUtil/utils/vnf/vnf.actions"; +import * as _ from 'lodash'; +import {IModalConfig} from "onap-ui-angular/dist/modals/models/modal-config"; +import {ComponentInfoModel, ComponentInfoType} from "../../../component-info/component-info-model"; +import {ComponentInfoService} from "../../../component-info/component-info.service"; +import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component"; + +export class VnfModelInfo implements ILevelNodeInfo { + constructor(private _dynamicInputsService: DynamicInputsService, + private _sharedTreeService: SharedTreeService, + private _defaultDataGeneratorService: DefaultDataGeneratorService, + private _dialogService: DialogService, + private _vnfPopupService: VnfPopupService, + private _vfModulePopupService: VfModulePopuopService, + private _duplicateService: DuplicateService, + private modalService: SdcUiServices.ModalService, + private _iframeService: IframeService, + private _componentInfoService: ComponentInfoService, + private _store: NgRedux<AppState>) { + } + + name: string = 'vnfs'; + type: string = 'VNF'; + childName: string = 'vfModules'; + childType: string = 'VFModuleModelInfo'; + typeName: string = 'VNF'; + + /*********************************************************** + * return if user should provide instance name or not. + * @param currentModel - current Model object + ************************************************************/ + isEcompGeneratedNaming = (currentModel): boolean => { + const ecompGeneratedNaming = currentModel.properties.ecomp_generated_naming; + return ecompGeneratedNaming === "true"; + }; + + /*********************************************************** + * return model dynamic inputs + * @param currentModel - current Model object + ************************************************************/ + updateDynamicInputsDataFromModel = (currentModel): any => { + let displayInputs; + return _.isEmpty(displayInputs) ? [] : this._dynamicInputsService.getArbitraryInputs(displayInputs); + }; + + /*********************************************************** + * return vnf model + * @param vnfModelId - current Model id + * @param instance - vnf instance + * @param serviceHierarchy - serviceHierarchy + ************************************************************/ + getModel = (vnfModelId: string, instance: VnfInstance, serviceHierarchy): VNFModel => { + const originalModelName = instance.originalName ? instance.originalName : vnfModelId; + return new VNFModel(serviceHierarchy[this.name][originalModelName]); + }; + + + /*********************************************************** + * return vnf instance tree node + * @param instance - vnf instance + * @param model - vnf model + * @param parentModel + * @param storeKey - store key if exist + ************************************************************/ + createInstanceTreeNode = (instance: VnfInstance, model: VNFModel, parentModel, storeKey: string): VnfTreeNode => { + let node = new VnfTreeNode(instance, model, storeKey); + node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); + node.typeName = this.typeName; + node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; + node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage: ""; + node = this._sharedTreeService.addingStatusProperty(node); + return node; + }; + + /*********************************************************** + * return next level object (VFModule) + ************************************************************/ + getNextLevelObject = (): VFModuleModelInfo => { + return new VFModuleModelInfo(this._dynamicInputsService, this._sharedTreeService, this._dialogService, this._vfModulePopupService, this._iframeService, this._store, this._componentInfoService); + }; + + /*********************************************************** + * return if instance has missing data + * @param instance - vnf instance + * @param dynamicInputs + * @param isEcompGeneratedNaming + ************************************************************/ + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean { + return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, [InputType.LCP_REGION, InputType.TENANT, InputType.PLATFORM]); + } + + getTooltip = (): string => 'VF'; + + getType = (): string => 'VF'; + + /*********************************************************** + * return if instance has missing data + * @param node - VNF node + * @param serviceModelId - current service id + ************************************************************/ + onClickAdd(node, serviceModelId: string): void { + this._dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.VNF, + uuidData: <any>{ + serviceId: serviceModelId, + modelName: node.data.name, + vnfStoreKey: null, + modelId: node.data.modelVersionId, + type: node.data.type, + popupService: this._vnfPopupService + }, + node: node, + isUpdateMode: false + }) + } + + /*********************************************************** + * return number of existing instances + * @param node - VNF node + * @param serviceModelId - current service id + ************************************************************/ + getNodeCount(node: ITreeNode, serviceModelId: string): number { + let map = null; + if (!_.isNil(this._store.getState().service.serviceInstance[serviceModelId])) { + map = this._store.getState().service.serviceInstance[serviceModelId].existingVNFCounterMap || 0; + + if (!_.isNil(map)) { + let count = map[node.data.modelUniqueId] || 0; + count -= this._sharedTreeService.getExistingInstancesWithDeleteMode(node, serviceModelId, 'vnfs'); + return count; + } + } + return 0; + } + + /*********************************************************** + * should show node icon + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons { + let counter: number = !_.isNil(this._store.getState().service.serviceInstance[serviceModelId]) ? + (this._store.getState().service.serviceInstance[serviceModelId].existingVNFCounterMap[node.data.modelUniqueId] || 0) : 0; + counter -= this._sharedTreeService.getExistingInstancesWithDeleteMode(node, serviceModelId, 'vnfs'); + + const properties = this._store.getState().service.serviceHierarchy[serviceModelId].vnfs[node.data.name].properties; + const maxInstances: number = !_.isNil(properties) ? (properties.max_instances || 1) : 1; + const isReachedLimit = !(maxInstances > counter); + const showAddIcon = this._sharedTreeService.shouldShowAddIcon() && !isReachedLimit; + return new AvailableNodeIcons(showAddIcon, isReachedLimit) + } + + getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } } { + return <any>{ + edit: { + method: (node, serviceModelId) => { + this._iframeService.addClassOpenModal('content'); + this._dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.VNF, + uuidData: <any>{ + serviceId: serviceModelId, + modelName: node.data.modelName, + vnfStoreKey: node.data.vnfStoreKey, + modelId: node.data.modelId, + type: node.data.type, + popupService: this._vnfPopupService + }, + node: node, + isUpdateMode: true + }); + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + }, + showAuditInfo: { + method: (node, serviceModelId) => { + const instance = this._store.getState().service.serviceInstance[serviceModelId].vnfs[node.data.vnfStoreKey]; + this._sharedTreeService.openAuditInfoModal(node, serviceModelId, instance, 'VNF', this); + }, + visible: (node) => this._sharedTreeService.shouldShowAuditInfo(node), + enable: (node) => this._sharedTreeService.shouldShowAuditInfo(node) + }, + duplicate: { + method: (node, serviceModelId) => { + if (this._store.getState().global.flags['FLAG_DUPLICATE_VNF']) { + const storeKey = node.data.vnfStoreKey; + let modalConfig: IModalConfig = this._duplicateService.openDuplicateModal(serviceModelId, node.data.modelUniqueId, node.data.modelName, storeKey, 1, this._store, node); + this.modalService.openCustomModal(modalConfig, DuplicateVnfComponent); + } + }, + visible: (node) => this._sharedTreeService.shouldShowDuplicate(node) && !_.isNil(node.data) && !_.isNil(node.data.action) && node.data.action === ServiceInstanceActions.Create && this._duplicateService.canDuplicate(node), + enable: (node, serviceModelId) => this._duplicateService.isEnabled(node, this._store, serviceModelId) + }, + remove: { + method: (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + let storeKey: string = node.data.vnfStoreKey; + this._store.dispatch(removeInstance(node.data.vnfStoreKey, serviceModelId, storeKey, node)); + this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId, serviceModelId, -1, node)); + this._sharedTreeService.selectedVNF = null; + } else { + let messageBoxData: MessageBoxData = new MessageBoxData( + "Remove VNF", // modal title + "You are about to remove this VNF and all its children from this service. Are you sure you want to remove it?", + <any>"warning", + <any>"md", + [ + { + text: "Remove VNF", + size: "large", + callback: this.removeVnf.bind(this, node, serviceModelId), + closeModal: true + }, + {text: "Don’t Remove", size: "medium", closeModal: true} + ]); + + MessageBoxService.openModal.next(messageBoxData); + } + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + }, + delete: { + method: (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + this._store.dispatch(deleteActionVnfInstance(node.data.vnfStoreKey, serviceModelId)); + } else { + this._sharedTreeService.shouldShowDeleteInstanceWithChildrenModal(node, serviceModelId, (node, serviceModelId) => { + this._sharedTreeService.removeDeleteAllChild(node, serviceModelId, (node, serviceModelId) => { + this._store.dispatch(deleteActionVnfInstance(node.data.vnfStoreKey, serviceModelId)); + }); + }); + } + }, + visible: (node) => this._sharedTreeService.shouldShowDelete(node), + enable: (node) => this._sharedTreeService.shouldShowDelete(node) + }, + undoDelete: { + method: (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + this._store.dispatch(undoDeleteActionVnfInstance(node.data.vnfStoreKey, serviceModelId)); + } else { + this._sharedTreeService.undoDeleteAllChild(node, serviceModelId, (node, serviceModelId) => { + this._store.dispatch(undoDeleteActionVnfInstance(node.data.vnfStoreKey, serviceModelId)); + }); + } + }, + visible: (node) => this._sharedTreeService.shouldShowUndoDelete(node), + enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) + } + } + } + + removeVnf(this, node, serviceModelId) { + this._store.dispatch(removeInstance(node.data.modelName, serviceModelId, node.data.vnfStoreKey, node)); + this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId, serviceModelId, -1, node)); + this._sharedTreeService.selectedVNF = null; + } + + /*********************************************************** + * should update node position inside the tree + * @param node - current ITrees node + ************************************************************/ + updatePosition(that, node, instanceId): void { + that.store.dispatch(updateVnfPosition(node, instanceId, node.vnfStoreKey)); + } + + /*********************************************************** + * return the position of the current node in the tree + * @param instance - current ITrees node instance + ************************************************************/ + getNodePosition(instance): number { + return !_.isNil(instance) ? instance.position : null; + } + + /*********************************************************** + * When user is click on some nod element + * @param node - current ITrees node + ************************************************************/ + onSelectedNode(node: ITreeNode): void { + ComponentInfoService.triggerComponentInfoChange.next(new ComponentInfoModel(ComponentInfoType.VNF,[], [])); + } + + getInfoForVnf(model, instance): ComponentInfoModel { + let modelInfoItems: ModelInformationItem[] = []; + if (model) { + modelInfoItems.push(ModelInformationItem.createInstance("Min Instances", model.min)); + modelInfoItems.push(ModelInformationItem.createInstance("Max Instances", model.max)); + } + if (instance) { + modelInfoItems.push(ModelInformationItem.createInstance("NF Type", instance.nfType)); + modelInfoItems.push(ModelInformationItem.createInstance("NF Role", instance.nfRole)); + } + return this._componentInfoService.addGeneralInfoItems(modelInfoItems, ComponentInfoType.VNF, model, instance); + + } + + +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.spec.ts new file mode 100644 index 000000000..532a8fe17 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.spec.ts @@ -0,0 +1,291 @@ + +import {HttpClientTestingModule, HttpTestingController} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {VnfGroupingModelInfo} from "./vnfGrouping.model.info"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {SharedTreeService} from "../../shared.tree.service"; +import {VnfGroupPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import {DialogService} from "ng2-bootstrap-modal"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {VnfGroupModel} from "../../../../../shared/models/vnfGroupModel"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import {ActivatedRoute} from "@angular/router"; +import {RouterTestingModule} from "@angular/router/testing"; +import {DrawingBoardModes} from "../../../drawing-board.modes"; + +describe('VnfGroupingModelInfo Model Info', () => { + let injector; + let _dialogService : DialogService; + let _vnfGroupPopupService : VnfGroupPopupService; + let _dynamicInputsService : DynamicInputsService; + let _sharedTreeService : SharedTreeService; + let _iframeService : IframeService; + let vnfGroupModel: VnfGroupingModelInfo; + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule, RouterTestingModule], + providers: [ + DialogService, + VnfGroupPopupService, + DynamicInputsService, + SharedTreeService, + IframeService, + MockNgRedux] + }); + await TestBed.compileComponents(); + injector = getTestBed(); + _sharedTreeService = injector.get(SharedTreeService); + + vnfGroupModel = new VnfGroupingModelInfo(_dynamicInputsService, _sharedTreeService, _dialogService, _vnfGroupPopupService, _iframeService, MockNgRedux.getInstance()); + })().then(done).catch(done.fail)); + + + test('VnfGroupingModelInfo should be defined', () => { + expect(vnfGroupModel).toBeDefined(); + }); + + test('VnfGroupingModelInfo should defined extra details', () => { + expect(vnfGroupModel.name).toEqual('vnfGroups'); + expect(vnfGroupModel.type).toEqual('VnfGroup'); + }); + + test('isEcompGeneratedNaming should return true if vnf group has isEcompGeneratedNaming is "true" ', () => { + let isEcompGeneratedNaming : boolean = vnfGroupModel.isEcompGeneratedNaming({ + properties: { + ecomp_generated_naming: 'true' + } + }); + expect(isEcompGeneratedNaming).toBeTruthy(); + }); + + + test('getTooltip should return "vnfGrouping"', () => { + let tooltip: string = vnfGroupModel.getTooltip(); + expect(tooltip).toEqual('VnfGroup'); + }); + + test('getType should return "vnfGrouping"', () => { + let tooltip: string = vnfGroupModel.getType(); + expect(tooltip).toEqual('VnfGroup'); + }); + + test('getNextLevelObject should return null', () => { + let nextLevel = vnfGroupModel.getNextLevelObject(); + expect(nextLevel).not.toBeNull(); + }); + + + test('showNodeIcons should return true if not reachLimit of max', ()=>{ + let serviceId : string = 'servicedId'; + let node = { + data : { + id : 'vnfGroupId', + name : 'vnfGroupName' + } + }; + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global:{ + drawingBoardStatus: "EDIT" + }, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfGroups' : { + 'vnfGroupName' : { + 'properties' : { + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVnfGroupCounterMap' : { + 'vnfGroupId' : 1 + }, + 'vnfGroups' : { + 'vnfGroupName' :{ + + } + } + } + } + } + }); + + let result = vnfGroupModel.showNodeIcons(<any>node, serviceId); + expect(result).toEqual(new AvailableNodeIcons(true , false)); + }); + + test('getNodeCount should return number of nodes', ()=>{ + let serviceId : string = 'servicedId'; + jest.spyOn(_sharedTreeService, 'getExistingInstancesWithDeleteMode').mockReturnValue(0); + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global : {}, + service : { + serviceHierarchy : { + 'servicedId' : { + 'vnfGroups' : { + 'vnfGroupName' : { + 'properties' : { + } + } + } + } + }, + serviceInstance : { + 'servicedId' : { + 'existingVnfGroupCounterMap' : { + 'vnfGroupId' : 1 + }, + 'vnfGroups' : { + 'vnfGroupName' :{ + 'originalName' : 'vnfGroupName' + } + } + } + } + } + }); + + let node = { + data : { + id : 'vnfGroupId', + name : 'vnfGroupName', + modelUniqueId: 'vnfGroupId', + } + }; + let result = vnfGroupModel.getNodeCount(<any>node , serviceId); + expect(result).toEqual(1); + + node.data.modelUniqueId = 'vnfGroupId_notExist'; + result = vnfGroupModel.getNodeCount(<any>node , serviceId); + expect(result).toEqual(0); + + result = vnfGroupModel.getNodeCount(<any>node , serviceId + '_notExist'); + expect(result).toEqual(0); + }); + + test('getModel should return VnfGroup model', () => { + let model: VnfGroupModel = vnfGroupModel.getModel('ResourceGroup0', <any>{ + originalName : 'ResourceGroup0' + }, getServiceHierarchy()); + expect(model.type).toEqual('VnfGroup'); + }); + + test('getMenuAction: showAuditInfoVnfGroup', ()=>{ + + jest.spyOn(MockNgRedux.getInstance(), 'getState').mockReturnValue({ + global: { + "drawingBoardStatus": DrawingBoardModes.RETRY + } + }); + jest.spyOn(_sharedTreeService, 'isRetryMode').mockReturnValue(true); + let node = { + data : { + "modelId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "action": "Create", + "isFailed": true, + } + }; + let serviceModelId = "6b528779-44a3-4472-bdff-9cd15ec93450"; + let result = vnfGroupModel.getMenuAction(<any>node, serviceModelId); + spyOn(result['showAuditInfo'], 'method'); + expect(result['showAuditInfo']).toBeDefined(); + expect(result['showAuditInfo'].visible(node)).toBeTruthy(); + expect(result['showAuditInfo'].enable(node)).toBeTruthy(); + result['showAuditInfo']['method'](node, serviceModelId); + expect(result['showAuditInfo']['method']).toHaveBeenCalledWith(node, serviceModelId); + }); + + function getServiceHierarchy(){ + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + }, + "vidNotions": { + "instantiationUI": "legacy", + "modelCategory": "other" + } + }, + "vnfGroups": { + "ResourceGroup0": { + "type": "VnfGroup", + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "version": "1", + "name": "ResourceGroup0", + "modelCustomizationName": "ResourceGroup0", + "properties": { + "contained_resource_type": "VF", + "role": "SERVICE-ACCESS", + "function": "DATA", + "description": "DDD0", + "type": "LOAD-GROUP" + }, + "members": { + "vdbe_svc_vprs_proxy 0": { + "uuid": "65fadfa8-a0d9-443f-95ad-836cd044e26c", + "invariantUuid": "f4baae0c-b3a5-4ca1-a777-afbffe7010bc", + "description": "A Proxy for Service vDBE_Svc_vPRS", + "name": "vDBE_Svc_vPRS Service Proxy", + "version": "1.0", + "customizationUuid": "bdb63d23-e132-4ce7-af2c-a493b4cafac9", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Service Proxy", + "sourceModelUuid": "da7827a2-366d-4be6-8c68-a69153c61274", + "sourceModelInvariant": "24632e6b-584b-4f45-80d4-fefd75fd9f14", + "sourceModelName": "vDBE_Svc_vPRS" + }, + "vdbe_svc_vprs_proxy 1": { + "uuid": "111dfa8-a0d9-443f-95ad-836cd044e26c", + "invariantUuid": "111ae0c-b3a5-4ca1-a777-afbffe7010bc", + "description": "A Proxy for Service vDBE_Svc_vPRS", + "name": "111_Svc_vPRS Service Proxy", + "version": "1.0", + "customizationUuid": "1113d23-e132-4ce7-af2c-a493b4cafac9", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Service Proxy", + "sourceModelUuid": "11127a2-366d-4be6-8c68-a69153c61274", + "sourceModelInvariant": "1112e6b-584b-4f45-80d4-fefd75fd9f14", + "sourceModelName": "111_Svc_vPRS" + } + } + } + }, + "networks": {}, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": {}, + "volumeGroups": {}, + "pnfs": {} + } + } +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.ts new file mode 100644 index 000000000..7f2052a0c --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.ts @@ -0,0 +1,272 @@ +import {ILevelNodeInfo} from "../basic.model.info"; +import {DynamicInputsService} from "../../dynamicInputs.service"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {VnfGroupModel} from "../../../../../shared/models/vnfGroupModel"; +import {VnfGroupTreeNode} from "../../../../../shared/models/vnfGroupTreeNode"; +import {SharedTreeService} from "../../shared.tree.service"; +import {VnfGroupPopupService} from "../../../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import { + GenericFormPopupComponent, + PopupType +} from "../../../../../shared/components/genericFormPopup/generic-form-popup.component"; +import {DialogService} from 'ng2-bootstrap-modal'; +import {AppState} from "../../../../../shared/store/reducers"; +import {NgRedux} from "@angular-redux/store"; +import {changeInstanceCounter, removeInstance} from "../../../../../shared/storeUtil/utils/general/general.actions"; +import {IframeService} from "../../../../../shared/utils/iframe.service"; +import { + deleteActionVnfGroupInstance, + undoDeleteActionVnfGroupInstance +} from "../../../../../shared/storeUtil/utils/vnfGroup/vnfGroup.actions"; +import {RelatedVnfMemberInfoModel} from "../relatedVnfMember/relatedVnfMember.info.model"; +import {SearchMembersModalComponent} from "../../../../../shared/components/searchMembersModal/search-members-modal.component"; +import * as _ from "lodash"; +import {MessageBoxData} from "../../../../../shared/components/messageBox/messageBox.data"; +import {MessageBoxService} from "../../../../../shared/components/messageBox/messageBox.service"; + +export class VnfGroupingModelInfo implements ILevelNodeInfo { + constructor(private _dynamicInputsService: DynamicInputsService, + private _sharedTreeService: SharedTreeService, + private _dialogService: DialogService, + private _vnfGroupPopupService: VnfGroupPopupService, + private _iframeService: IframeService, + private _store: NgRedux<AppState>) { + } + + name: string = 'vnfGroups'; + type: string = 'VnfGroup'; + typeName: string = 'G'; + childType: string = 'RelatedVnfMemberInfoModel'; + childName: string = 'vnfs'; + limitMembers : number; + + /*********************************************************** + * return if user should provide instance name or not. + * get info from parent (VNF) + * @param currentModel - current Model object + ************************************************************/ + isEcompGeneratedNaming(currentModel): boolean { + const ecompGeneratedNaming = currentModel.properties.ecomp_generated_naming; + return ecompGeneratedNaming === "true"; + } + + /*********************************************************** + * return model dynamic inputs + * @param currentModel - current Model object + ************************************************************/ + updateDynamicInputsDataFromModel = (currentModel): any => { + let displayInputs = currentModel.inputs; + return _.isEmpty(displayInputs) ? [] : this._dynamicInputsService.getArbitraryInputs(displayInputs); + }; + + /*********************************************************** + * return next level object (null because is last level) + ************************************************************/ + getNextLevelObject = (): RelatedVnfMemberInfoModel => { + return new RelatedVnfMemberInfoModel(this._sharedTreeService, this._dynamicInputsService, this._store); + }; + + getTooltip = (): string => 'VnfGroup'; + + getType = (): string => 'VnfGroup'; + + createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string): any { + let node = new VnfGroupTreeNode(instance, model, storeKey); + node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); + node = this._sharedTreeService.addingStatusProperty(node); + node.typeName = this.typeName; + node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; + node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage: ""; + node.limitMembers = (!_.isNil(model.properties.quantity)) ? model.properties.quantity : null; + return node; + } + + getModel(modelId: string, instance: any, serviceHierarchy): any { + const originalModelName = instance.originalName ? instance.originalName : modelId; + return new VnfGroupModel(serviceHierarchy[this.name][originalModelName]); + } + + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean { + return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, []); + } + + onClickAdd(node: ITreeNode, serviceModelId: string): void { + this._dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.VNF_GROUP, + uuidData: <any>{ + serviceId: serviceModelId, + modelName: node.data.name, + vnfGroupStoreKey: null, + modelId: node.data.modelVersionId, + type: node.data.type, + popupService: this._vnfGroupPopupService + }, + node: node, + isUpdateMode: false + }); + } + + getNodeCount(node: ITreeNode, serviceModelId: string): number { + let map = null; + if (!_.isNil(this._store.getState().service.serviceInstance[serviceModelId])) { + map = this._store.getState().service.serviceInstance[serviceModelId].existingVnfGroupCounterMap || 0; + if (!_.isNil(map)) { + let count = map[node.data.modelUniqueId] || 0; + count -= this._sharedTreeService.getExistingInstancesWithDeleteMode(node, serviceModelId, 'vnfGroups'); + return count; + } + } + return 0; + } + + /*********************************************************** + * should show node icon + * @param node - current ITrees node + * @param serviceModelId - service id + ************************************************************/ + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons { + const showAddIcon = this._sharedTreeService.shouldShowAddIcon(); + return new AvailableNodeIcons(showAddIcon, false); + } + + getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } } { + return { + edit: { + method: (node, serviceModelId) => { + this._iframeService.addClassOpenModal('content'); + this._dialogService.addDialog(GenericFormPopupComponent, { + type: PopupType.VNF_GROUP, + uuidData: <any>{ + serviceId: serviceModelId, + modelName: node.data.modelName, + vnfGroupStoreKey: node.data.vnfGroupStoreKey, + modelId: node.data.modelId, + type: node.data.type, + popupService: this._vnfGroupPopupService + }, + node: node, + isUpdateMode: true + }); + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node) + }, + remove: { + method: (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + let storeKey: string = node.data.vnfGroupStoreKey; + this._store.dispatch(removeInstance(node.data.vnfGroupStoreKey, serviceModelId, storeKey, node)); + this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId, serviceModelId, -1, node)); + this._sharedTreeService.selectedVNF = null; + } else { + let messageBoxData: MessageBoxData = new MessageBoxData( + "Remove VNFGroup", // modal title + "You are about to remove this group and all its children from this service. Are you sure you want to remove it?", + <any>"warning", + <any>"md", + [ + { + text: "Remove Group", + size: "large", + callback: this.removeGroup.bind(this, node, serviceModelId), + closeModal: true + }, + {text: "Don’t Remove", size: "medium", closeModal: true} + ]); + + MessageBoxService.openModal.next(messageBoxData); + } + }, + visible: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node), + enable: (node) => this._sharedTreeService.shouldShowRemoveAndEdit(node) + }, + addGroupMember: { + method: (node, serviceModelId) => { + let serviceHierarchy = this._store.getState().service.serviceHierarchy[serviceModelId]; + let serviceInstance = this._store.getState().service.serviceInstance[serviceModelId]; + let vnfGroupModel = new VnfGroupModel(serviceHierarchy['vnfGroups'][node.data.modelName]); + this._dialogService.addDialog(SearchMembersModalComponent, { + title: 'Add members to group', + description: 'Select VNF instances to associate', + subscriberId: serviceInstance.globalSubscriberId, + serviceType: serviceInstance.subscriptionServiceType, + vnfGroupModel: vnfGroupModel, + serviceModelId: serviceModelId, + node: node.data, + searchFields: [{ + title: 'Service model name', + dataTestId: 'sourceModelName', + value: (Object.values(vnfGroupModel.members))[0].sourceModelName + }, + { + title: 'Service invariant UUID', + dataTestId: 'sourceModelInvariant', + value: (Object.values(vnfGroupModel.members))[0].sourceModelInvariant + }] + } + ); + }, + visible: (node) => !_.isNil(node.data.action) ? node.data.action.split('_').pop() !== 'Delete' : true, + enable: (node) => !_.isNil(node.data.action) ? node.data.action.split('_').pop() !== 'Delete' : true + }, + showAuditInfo: { + method: (node, serviceModelId) => { + let instance = this._store.getState().service.serviceInstance[serviceModelId].vnfGroups[node.data.vnfGroupStoreKey]; + this._sharedTreeService.openAuditInfoModal(node, serviceModelId, instance, 'VNFGROUP', this); + }, + visible: (node) => this._sharedTreeService.shouldShowAuditInfo(node), + enable: (node) => this._sharedTreeService.shouldShowAuditInfo(node) + }, + delete: { + method: (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + this._store.dispatch(deleteActionVnfGroupInstance(node.data.vnfGroupStoreKey, serviceModelId)); + }else { + this._sharedTreeService.shouldShowDeleteInstanceWithChildrenModal(node, serviceModelId, (node, serviceModelId)=>{ + this._sharedTreeService.removeDeleteAllChild(node, serviceModelId, (node, serviceModelId)=>{ + this._store.dispatch(deleteActionVnfGroupInstance(node.data.vnfGroupStoreKey, serviceModelId)); + }); + }); + } + }, + visible: (node) => this._sharedTreeService.shouldShowDelete(node), + enable: (node) => this._sharedTreeService.shouldShowDelete(node) + }, + undoDelete: { + method: (node, serviceModelId) => { + if ((!_.isNil(node.data.children) && node.data.children.length === 0) || _.isNil(node.data.children)) { + this._store.dispatch(undoDeleteActionVnfGroupInstance(node.data.vnfGroupStoreKey, serviceModelId)); + } else { + this._sharedTreeService.undoDeleteAllChild(node, serviceModelId, (node, serviceModelId) => { + this._store.dispatch(undoDeleteActionVnfGroupInstance(node.data.vnfGroupStoreKey, serviceModelId)); + }); + } + }, + visible: (node) => this._sharedTreeService.shouldShowUndoDelete(node), + enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) + } + }; + + + } + + removeGroup(this, node, serviceModelId) { + this._store.dispatch(removeInstance(node.data.modelName, serviceModelId, node.data.vnfGroupStoreKey, node)); + this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId, serviceModelId, -1, node)); + this._sharedTreeService.selectedVNF = null; + } + + updatePosition(that , node, instanceId): void { + // TODO + } + + getNodePosition(instance): number { + return !_.isNil(instance) ? instance.position : null; + } + + onSelectedNode(node: ITreeNode): void { + } + +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts new file mode 100644 index 000000000..fd39ed92a --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts @@ -0,0 +1,2764 @@ +import {HttpClientTestingModule, HttpTestingController} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {NgRedux} from "@angular-redux/store"; +import {ObjectToInstanceTreeService} from "./objectToInstanceTree.service"; +import {SharedTreeService} from "../shared.tree.service"; +import {DynamicInputsService} from "../dynamicInputs.service"; +import {DefaultDataGeneratorService} from "../../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {AvailableModelsTreeService} from "../../available-models-tree/available-models-tree.service"; +import {ObjectToTreeService} from "../objectToTree.service"; +import {DrawingBoardModes} from "../../drawing-board.modes"; +import {DialogService} from "ng2-bootstrap-modal"; +import {VnfPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {BasicControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/basic.control.generator"; +import {AaiService} from "../../../../shared/services/aaiService/aai.service"; +import {FeatureFlagsService} from "../../../../shared/services/featureFlag/feature-flags.service"; +import {VnfControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator"; +import {GenericFormService} from "../../../../shared/components/genericForm/generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import {LogService} from "../../../../shared/utils/log/log.service"; +import {IframeService} from "../../../../shared/utils/iframe.service"; +import {BasicPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/basic.popup.service"; +import {NetworkPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import {NetworkControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator"; +import {VfModulePopuopService} from "../../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {VfModuleControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator"; +import {VnfGroupPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import {VnfGroupControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator"; +import {DuplicateService} from "../../duplicate/duplicate.service"; +import {SdcUiComponentsModule, SdcUiServices} from "onap-ui-angular"; +import {ErrorMsgService} from "../../../../shared/components/error-msg/error-msg.service"; +import {ComponentInfoService} from "../../component-info/component-info.service"; + +class MockAppStore<T> { + getState() { + return { + global: { + 'drawingBoardStatus': DrawingBoardModes.CREATE, + flags : { + DRAG_AND_DROP_OPERATION : false + } + } + } + } +} + +describe('Model Tree Generator service', () => { + let injector; + let service: ObjectToInstanceTreeService; + let httpMock: HttpTestingController; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule, SdcUiComponentsModule], + providers: [ + DuplicateService, + AvailableModelsTreeService, + ObjectToTreeService, + ObjectToInstanceTreeService, + DefaultDataGeneratorService, + DynamicInputsService, + SharedTreeService, + VnfPopupService, + VnfGroupPopupService, + BasicControlGenerator, + GenericFormService, + FormBuilder, + LogService, + IframeService, + BasicPopupService, + NetworkPopupService, + NetworkControlGenerator, + VfModulePopuopService, + VfModuleControlGenerator, + VnfGroupControlGenerator, + DialogService, + FeatureFlagsService, + VnfControlGenerator, + AaiService, + DialogService, + ErrorMsgService, + ComponentInfoService, + SdcUiServices.ModalService, + { provide: NgRedux, useClass: MockAppStore }, + MockNgRedux] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(ObjectToInstanceTreeService); + httpMock = injector.get(HttpTestingController); + + })().then(done).catch(done.fail)); + + test('ObjectToInstanceTreeService should be defined', () => { + expect(service).toBeDefined(); + }); + + + test('should return instance nodes correctly: VNF', () => { + + let convertToNodes = service.convertServiceInstanceToTreeData(getInstanceServiceVNF(), getServiceInstanceHierarchy()); + delete convertToNodes[0].menuActions; + delete convertToNodes[0].errors; + delete convertToNodes[0].isFailed; + delete convertToNodes[0].trackById; + delete convertToNodes[0].updatePoistionFunction; + delete convertToNodes[0].position; + delete convertToNodes[0].onSelectedNode; + delete convertToNodes[1].children[0].isFailed; + delete convertToNodes[1].children[0].menuActions; + delete convertToNodes[1].children[0].trackById; + delete convertToNodes[1].children[0].errors; + delete convertToNodes[1].children[0].updatePoistionFunction; + delete convertToNodes[1].children[0].position; + delete convertToNodes[1].children[0].onSelectedNode; + expect(Object.assign({}, convertToNodes[0])).toEqual(Object.assign({}, expectInstanceNodesResultVNF()[0])); + expect(Object.assign({}, convertToNodes[1].children[0])).toEqual(Object.assign({}, expectInstanceNodesResultVNF()[1].children[0])); + expect(convertToNodes[1].inMaint).toBeFalsy(); + expect(convertToNodes[0].inMaint).toBeTruthy(); + expect(service.numberOfFailed).toBe(0); + expect(service.numberOfElements).toBe(3); + }); + + test('should return instance nodes correctly: VNF and Network', () => { + let convertToNodes = service.convertServiceInstanceToTreeData(getInstanceServiceVNF_Network(), getServiceHeirarchyVNF_Network()); + + delete convertToNodes[1].menuActions; + delete convertToNodes[1].trackById; + delete convertToNodes[1].errors; + delete convertToNodes[1].isFailed; + delete convertToNodes[1].updatePoistionFunction; + delete convertToNodes[1].position; + delete convertToNodes[1].onSelectedNode; + expect(Object.assign({}, convertToNodes[0].children[0].dynamicInputs)).toEqual(Object.assign({}, expectInstanceNodesResultVNF_Network()[0]['children'][0].dynamicInputs)); + expect(Object.assign({}, convertToNodes[0].children[0].missingData)).toEqual(Object.assign({}, expectInstanceNodesResultVNF_Network()[0]['children'][0].missingData)); + expect(Object.assign({}, convertToNodes[1])).toEqual(Object.assign({}, expectInstanceNodesResultVNF_Network()[1])); + expect(service.numberOfFailed).toBe(0); + expect(service.numberOfElements).toBe(5); + }); + + function getServiceInstanceHierarchy() { + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + }, + "vidNotions": { + "instantiationUI": "legacy", + "modelCategory": "other" + } + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "max_instances": "3", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": {}, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "fromInputName": "2017488_adiodvpe0_vnf_config_template_version", + "constraints": null, + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "fromInputName": "adiodvpe0_bandwidth_units", + "constraints": null, + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "fromInputName": "adiodvpe0_bandwidth", + "constraints": null, + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "fromInputName": "2017488_adiodvpe0_AIC_CLLI", + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "fromInputName": "2017488_adiodvpe0_vnf_instance_name", + "constraints": null, + "required": true, + "default": "mtnj309me6" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {} + } + } + + function getServiceHeirarchyVNF_Network() { + return { + "service": { + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "", + "serviceType": "", + "serviceRole": "", + "description": "", + "serviceEcompNaming": "false", + "instantiationType": "A-La-Carte", + "inputs": { + "2017488_adiodvpe0_ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + } + } + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5", + "max_instances": 5 + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": { + "vnf_config_template_version": { + "displayName": "vnf_config_template_version", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_config_template_version" + }, + "bandwidth_units": { + "displayName": "bandwidth_units", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth_units" + }, + "bandwidth": { + "displayName": "bandwidth", + "command": "get_input", + "inputName": "adiodvpe0_bandwidth" + }, + "AIC_CLLI": { + "displayName": "AIC_CLLI", + "command": "get_input", + "inputName": "2017488_adiodvpe0_AIC_CLLI" + }, + "ASN": { + "displayName": "ASN", + "command": "get_input", + "inputName": "2017488_adiodvpe0_ASN" + }, + "vnf_instance_name": { + "displayName": "vnf_instance_name", + "command": "get_input", + "inputName": "2017488_adiodvpe0_vnf_instance_name" + } + }, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=false}", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "max_instances": "3", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "min_instances": "1", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "false", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV" + }, + "inputs": { + "adiodvpe0_bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "constraints": null, + "required": true, + "default": "10" + }, + "2017488_adiodvpe0_vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "constraints": null, + "required": true, + "default": "mtnj309me6" + }, + "2017488_adiodvpe0_vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "constraints": null, + "required": true, + "default": "17.2" + }, + "2017488_adiodvpe0_AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "adiodvpe0_bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "constraints": null, + "required": true, + "default": "Gbps" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV" + }, + "inputs": { + "adiodvpe0_bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "constraints": null, + "required": true, + "default": "10" + }, + "2017488_adiodvpe0_vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "constraints": null, + "required": true, + "default": "mtnj309me6" + }, + "2017488_adiodvpe0_vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "constraints": null, + "required": true, + "default": "17.2" + }, + "2017488_adiodvpe0_AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "adiodvpe0_bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "constraints": null, + "required": true, + "default": "Gbps" + } + } + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV" + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": { + "ExtVL 0": { + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c", + "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks", + "name": "ExtVL", + "version": "37.0", + "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "inputs": { + "vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "17.2" + }, + "bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "Gbps" + }, + "bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "10" + }, + "AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "ATLMY8GA" + }, + "ASN": { + "type": "string", + "description": "AV/PE", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "AV_vPE" + }, + "vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": null, + "constraints": [], + "required": true, + "default": "mtnj309me6" + } + }, + "commands": {}, + "properties": { + "network_role": "network role 1, network role 2", + "min_instances": 1, + "max_instances": 10, + "ecomp_generated_naming": "true", + "network_assignments": "{is_external_network=false, ipv4_subnet_default_assignment={min_subnets_count=1}, ecomp_generated_network_assignment=false, ipv6_subnet_default_assignment={min_subnets_count=1}}", + "exVL_naming": "{ecomp_generated_naming=true}", + "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}", + "network_homing": "{ecomp_selected_instance_node_target=false}" + }, + "type": "VL", + "modelCustomizationName": "ExtVL 0" + } + }, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV" + }, + "inputs": { + "adiodvpe0_bandwidth": { + "type": "string", + "description": "Requested VPE bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth" + }, + "constraints": null, + "required": true, + "default": "10" + }, + "2017488_adiodvpe0_vnf_instance_name": { + "type": "string", + "description": "The hostname assigned to the vpe.", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_instance_name" + }, + "constraints": null, + "required": true, + "default": "mtnj309me6" + }, + "2017488_adiodvpe0_vnf_config_template_version": { + "type": "string", + "description": "VPE Software Version", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "vnf_config_template_version" + }, + "constraints": null, + "required": true, + "default": "17.2" + }, + "2017488_adiodvpe0_AIC_CLLI": { + "type": "string", + "description": "AIC Site CLLI", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "AIC_CLLI" + }, + "constraints": null, + "required": true, + "default": "ATLMY8GA" + }, + "adiodvpe0_bandwidth_units": { + "type": "string", + "description": "Units of bandwidth", + "entry_schema": null, + "inputProperties": { + "sourceType": "HEAT", + "vfModuleLabel": "ADIOD_vRE_BV", + "paramName": "bandwidth_units" + }, + "constraints": null, + "required": true, + "default": "Gbps" + } + }, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + } + } + } + + function getInstanceServiceVNF() { + return { + "vnfs": { + "2017-388_ADIOD-vPE 0": { + "action": 'None', + "inMaint": true, + "orchStatus": "Active", + "provStatus": "prov", + "rollbackOnFailure": "true", + "originalName": "2017-388_ADIOD-vPE 0", + "isMissingData": true, + "trackById": "u5mtsvzmq6p", + "vfModules": {}, + "vnfStoreKey": "2017-388_ADIOD-vPE 0", + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": null, + "tenantId": null, + "lineOfBusiness": null, + "statusMessage": "Failed Vnf Message", + "platformName": null, + "modelInfo": { + "modelType": "VF", + "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "modelVersionId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "modelName": "2017-388_ADIOD-vPE", + "modelVersion": "4.0", + "modelCustomizationName": "2017-388_ADIOD-vPE 0" + } + }, + "2017-488_ADIOD-vPE 0": { + "action": 'None', + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "2017-488_ADIOD-vPE 0", + "isMissingData": false, + "trackById": "1d6dg4fsgbm", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0zssmp": { + "action": 'None', + "isMissingData": true, + "sdncPreReload": null, + "modelInfo": { + "modelType": "VFmodule", + "modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "modelVersionId": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "modelName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "modelVersion": "5", + "modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "modelUniqueId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0" + }, + "instanceParams": [ + {} + ], + "trackById": "v2egx1b8i1l", + "statusMessage": "Failed vfModel message" + } + } + }, + "vnfStoreKey": "2017-488_ADIOD-vPE 0", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "lineOfBusiness": "ONAP", + "platformName": "platform", + "modelInfo": { + "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "modelName": "2017-488_ADIOD-vPE", + "modelVersion": "5.0", + "modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "modelUniqueId": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09" + }, + "instanceName": "2017488_ADIODvPE", + "legacyRegion": "123", + "instanceParams": [ + {} + ] + } + }, + "instanceParams": [ + { + "2017488_adiodvpe0_ASN": "AV_vPE" + } + ], + "validationCounter": 3, + "existingNames": { + "yoav": "" + }, + "existingVNFCounterMap": { + "afacccf6-397d-45d6-b5ae-94c39734b168": 1, + "69e09f68-8b63-4cc9-b9ff-860960b5db09": 1 + }, + "existingNetworksCounterMap": {}, + "networks": {}, + "instanceName": "yoav", + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "aicZoneId": "ABC15", + "projectName": "WATKINS", + "rollbackOnFailure": "true", + "bulkSize": 1, + "aicZoneName": "AAITESAN-ABC15", + "owningEntityName": "WayneHolland", + "testApi": "VNF_API", + "isEcompGeneratedNaming": false, + "tenantName": "USP-SIP-IC-24335-T-01", + "modelInfo": { + "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "modelVersionId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "modelName": "action-data", + "modelVersion": "1.0", + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450" + }, + "isALaCarte": false, + "name": "action-data", + "version": "1.0", + "description": "", + "category": "", + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "serviceType": "", + "serviceRole": "", + "isMultiStepDesign": false + } + } + + function getInstanceServiceVNF_Network() { + return { + "vnfs": { + "2017-488_ADIOD-vPE 0": { + "action": 'None', + "rollbackOnFailure": "true", + "originalName": "2017-488_ADIOD-vPE 0", + "isMissingData": false, + "trackById": "o65b26t2thj", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1sgoqi": { + "action": 'None', + "instanceName": "yoav", + "volumeGroupName": "123", + "modelInfo": { + "modelInvariantId": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "modelVersionId": "25284168-24bb-4698-8cb4-3f509146eca5", + "modelName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "modelVersion": "6", + "modelCustomizationId": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "modelUniqueId": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5" + }, + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "isMissingData": false, + "instanceParams": [ + { + "adiodvpe0_bandwidth": "10", + "2017488_adiodvpe0_vnf_instance_name": "mtnj309me6", + "2017488_adiodvpe0_vnf_config_template_version": "17.2", + "2017488_adiodvpe0_AIC_CLLI": "ATLMY8GA", + "adiodvpe0_bandwidth_units": "Gbps" + } + ] + } + } + }, + "vnfStoreKey": "2017-488_ADIOD-vPE 0", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "productFamilyId": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", + "lcpCloudRegionId": "hvf6", + "tenantId": "bae71557c5bb4d5aac6743a4e5f1d054", + "lineOfBusiness": "ONAP", + "platformName": "platform", + "modelInfo": { + "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "modelName": "2017-488_ADIOD-vPE", + "modelVersion": "5.0", + "modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09" + }, + "instanceName": "2017488_ADIODvPE", + "instanceParams": [ + {} + ] + } + }, + "instanceParams": [ + { + "2017488_adiodvpe0_ASN": "AV_vPE" + } + ], + "validationCounter": 0, + "existingNames": { + "123": "", + "yoav": "", + "instancename": "", + "extvl": "" + }, + "existingVNFCounterMap": { + "69e09f68-8b63-4cc9-b9ff-860960b5db09": 1 + }, + "existingNetworksCounterMap": { + "ddc3f20c-08b5-40fd-af72-c6d14636b986": 3 + }, + "networks": { + "ExtVL 0": { + "action": "None", + "rollbackOnFailure": "true", + "isMissingData": false, + "originalName": "ExtVL 0", + "networkStoreKey": "ExtVL 0", + "trackById": "sf3zth68xjf", + "statusMessage": "Network failed message", + "productFamilyId": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", + "lcpCloudRegionId": "hvf6", + "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e", + "platformName": "xxx1", + "lineOfBusiness": "ONAP", + "instanceParams": [ + {} + ], + "modelInfo": { + "modelInvariantId": "379f816b-a7aa-422f-be30-17114ff50b7c", + "modelVersionId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "modelName": "ExtVL", + "modelVersion": "37.0", + "modelCustomizationId": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "modelCustomizationName": "ExtVL 0", + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + }, + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + }, + "ExtVL 0:0001": { + "action": "None", + "rollbackOnFailure": "true", + "isMissingData": false, + "originalName": "ExtVL 0", + "networkStoreKey": "ExtVL 0", + "trackById": "2mdxioxca9h", + "productFamilyId": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", + "lcpCloudRegionId": "hvf6", + "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e", + "platformName": "xxx1", + "lineOfBusiness": "ONAP", + "instanceParams": [ + {} + ], + "modelInfo": { + "modelInvariantId": "379f816b-a7aa-422f-be30-17114ff50b7c", + "modelVersionId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "modelName": "ExtVL", + "modelVersion": "37.0", + "modelCustomizationId": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "modelCustomizationName": "ExtVL 0", + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + }, + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + }, + "ExtVL 0_1": { + "action": "None", + "rollbackOnFailure": "true", + "isMissingData": false, + "originalName": "ExtVL 0", + "networkStoreKey": "ExtVL 0_1", + "trackById": "z7vd1gmpbs", + "instanceName": "ExtVL", + "productFamilyId": "17cc1042-527b-11e6-beb8-9e71128cae77", + "lcpCloudRegionId": "hvf6", + "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e", + "platformName": "xxx1", + "lineOfBusiness": "zzz1", + "instanceParams": [ + { + "vnf_config_template_version": "17.2", + "bandwidth_units": "Gbps", + "bandwidth": "10", + "AIC_CLLI": "ATLMY8GA", + "ASN": "AV_vPE", + "vnf_instance_name": "yoav" + } + ], + "modelInfo": { + "modelInvariantId": "379f816b-a7aa-422f-be30-17114ff50b7c", + "modelVersionId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "modelName": "ExtVL", + "modelVersion": "37.0", + "modelCustomizationId": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "modelCustomizationName": "ExtVL 0", + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + }, + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + } + }, + "instanceName": "InstanceName", + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "productFamilyId": "17cc1042-527b-11e6-beb8-9e71128cae77", + "lcpCloudRegionId": "JANET25", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "aicZoneId": "JAG1", + "projectName": null, + "rollbackOnFailure": "true", + "bulkSize": 1, + "aicZoneName": "YUDFJULP-JAG1", + "owningEntityName": "WayneHolland", + "testApi": "GR_API", + "isEcompGeneratedNaming": false, + "tenantName": "USP-SIP-IC-24335-T-01", + "modelInfo": { + "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "modelVersionId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "modelName": "action-data", + "modelVersion": "1.0", + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450" + }, + "isALaCarte": false, + "name": "action-data", + "version": "1.0", + "description": "", + "category": "", + "uuid": "6b528779-44a3-4472-bdff-9cd15ec93450", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "serviceType": "", + "serviceRole": "", + "isMultiStepDesign": false + } + } + + function expectInstanceNodesResultVNF() { + return [ + { + "action": 'None', + "modelId": "afacccf6-397d-45d6-b5ae-94c39734b168", + "modelCustomizationId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "modelUniqueId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "missingData": true, + "id": "u5mtsvzmq6p", + "orchStatus": 'Active', + "provStatus": 'prov', + "inMaint": true, + "name": "2017-388_ADIOD-vPE 0", + "modelName": "2017-388_ADIOD-vPE 0", + "type": "VF", + "parentType": '', + "isEcompGeneratedNaming": false, + "networkStoreKey": "2017-388_ADIOD-vPE 0", + "vnfStoreKey": "2017-388_ADIOD-vPE 0", + "typeName": "VNF", + "children": [], + "statusMessage": "Failed Vnf Message", + "statusProperties": [Object({ + key: 'Prov Status:', + value: 'prov', + testId: 'provStatus' + }), Object({ key: 'Orch Status:', value: 'Active', testId: 'orchStatus' }), Object({ + key: 'In-maintenance', + value: '', + testId: 'inMaint' + })] + }, + { + "action": 'None', + "modelId": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "missingData": false, + "id": "1d6dg4fsgbm", + "inMaint": false, + "parentType": '', + "name": "2017-488_ADIOD-vPE 0", + "modelName": "2017-488_ADIOD-vPE 0", + "type": "VF", + "isEcompGeneratedNaming": false, + "networkStoreKey": "2017-488_ADIOD-vPE 0", + "vnfStoreKey": "2017-488_ADIOD-vPE 0", + "typeName": "VNF", + "statusProperties": [Object({ + key: 'Prov Status:', + value: undefined, + testId: 'provStatus' + }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + "children": [{ + "parentType": 'VNF', + "action": 'None', + "modelId": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "modelUniqueId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "missingData": true, + "id": "v2egx1b8i1l", + "statusMessage": "Failed vfModel message", + "name": "<Automatically Assigned>", + "modelName": "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "type": "VFmodule", + "isEcompGeneratedNaming": false, + "dynamicInputs": [], + "dynamicModelName": "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0zssmp", + "typeName": "M", + "statusProperties": [Object({ + key: 'Prov Status:', + value: undefined, + testId: 'provStatus' + }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + }] + }] + } + + function expectInstanceNodesResultVNF_Network() { + return [ + { + "parentType": '', + "action": 'None', + "modelId": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "missingData": false, + "id": "o65b26t2thj", + "name": "2017488_ADIODvPE", + "modelName": "2017-488_ADIOD-vPE 0", + "type": "VF", + "isEcompGeneratedNaming": false, + "vnfStoreKey": "2017-488_ADIOD-vPE 0", + "typeName": "VNF", + "statusProperties": [Object({ + key: 'Prov Status:', + value: undefined, + testId: 'provStatus' + }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + "children": [ + { + "action": 'None', + "modelId": "25284168-24bb-4698-8cb4-3f509146eca5", + "missingData": false, + "name": "yoav", + "modelName": "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "type": "VFmodule", + "isEcompGeneratedNaming": false, + "typeName": "M", + "dynamicInputs": [ + { + "id": "adiodvpe0_bandwidth", + "type": "string", + "name": "adiodvpe0_bandwidth", + "value": "10", + "isRequired": true, + "description": "Requested VPE bandwidth" + }, + { + "id": "2017488_adiodvpe0_vnf_instance_name", + "type": "string", + "name": "2017488_adiodvpe0_vnf_instance_name", + "value": "mtnj309me6", + "isRequired": true, + "description": "The hostname assigned to the vpe." + }, + { + "id": "2017488_adiodvpe0_vnf_config_template_version", + "type": "string", + "name": "2017488_adiodvpe0_vnf_config_template_version", + "value": "17.2", + "isRequired": true, + "description": "VPE Software Version" + }, + { + "id": "2017488_adiodvpe0_AIC_CLLI", + "type": "string", + "name": "2017488_adiodvpe0_AIC_CLLI", + "value": "ATLMY8GA", + "isRequired": true, + "description": "AIC Site CLLI" + }, + { + "id": "adiodvpe0_bandwidth_units", + "type": "string", + "name": "adiodvpe0_bandwidth_units", + "value": "Gbps", + "isRequired": true, + "description": "Units of bandwidth" + } + ], + "dynamicModelName": "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1sgoqi" + } + ] + }, + { + "parentType": '', + "action": 'None', + "modelId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "modelCustomizationId": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "modelUniqueId": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "missingData": false, + "id": "sf3zth68xjf", + "name": "<Automatically Assigned>", + "statusMessage": "Network failed message", + "modelName": "ExtVL 0", + "type": "VL", + "isEcompGeneratedNaming": true, + "networkStoreKey": "ExtVL 0", + "typeName": "N", + "statusProperties": [Object({ + key: 'Prov Status:', + value: undefined, + testId: 'provStatus' + }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + }, + { + "parentType": '', + "action": 'None', + "originalAction": 'None', + "modelId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "missingData": false, + "id": "2mdxioxca9h", + "name": "<Automatically Assigned>", + "modelName": "ExtVL 0", + "type": "VL", + "isEcompGeneratedNaming": true, + "networkStoreKey": "ExtVL 0:0001", + "typeName": "M" + }, + { + "parentType": '', + "action": 'None', + "originalAction": 'None', + "modelId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "missingData": false, + "id": "z7vd1gmpbs", + "name": "ExtVL", + "modelName": "ExtVL 0", + "type": "VL", + "isEcompGeneratedNaming": true, + "networkStoreKey": "ExtVL 0_1", + "typeName": "M" + } + ]; + } +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts new file mode 100644 index 000000000..1fc439ea3 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts @@ -0,0 +1,163 @@ +import {Injectable} from "@angular/core"; +import {ILevelNodeInfo} from "../models/basic.model.info"; +import {ObjectToTreeService} from "../objectToTree.service"; +import {DefaultDataGeneratorService} from "../../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import * as _ from "lodash"; +import {ServiceInstanceActions} from "../../../../shared/models/serviceInstanceActions"; +import {ErrorMsgService} from "../../../../shared/components/error-msg/error-msg.service"; +import {FeatureFlagsService, Features} from "../../../../shared/services/featureFlag/feature-flags.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../shared/store/reducers"; + +@Injectable() +export class ObjectToInstanceTreeService { + constructor(private _objectToTreeService: ObjectToTreeService, private _errorMsgService: ErrorMsgService, private store: NgRedux<AppState>) { + this.numberOfFailed = 0; + this.numberOfElements = 0; + + } + + /** store number of failed ******** ONLY IN RETRY MODE ******** **/ + numberOfFailed: number = 0; + + /** store number of existing elements **/ + numberOfElements: number = 0; + + /***************************************************************** + * return array of first level node with there child's + * @param serviceInstance - The service instance object from store + * @param serviceHierarchy - The service Hierarchy store + ****************************************************************/ + convertServiceInstanceToTreeData(serviceInstance, serviceHierarchy): any[] { + this._errorMsgService.triggerClearError.next(); + let nodes = []; + this.numberOfFailed = 0; + this.numberOfElements = 0; + let _this = this; + const firstLevelOptions: ILevelNodeInfo[] = _this._objectToTreeService.getFirstLevelOptions(); + for (let option of firstLevelOptions) { + _.forOwn(serviceInstance[option.name], function (instance, modelName) { + nodes.push(_this.getNodeInstance(modelName, null, instance, serviceHierarchy, option)); + }); + } + return this.sortElementsByPosition(nodes); + } + + /***************************************************************** + * should increase number of failed + * @param node - the current node + ****************************************************************/ + increaseNumberOfFailed(node) { + if (node.isFailed) { + this.numberOfFailed++; + node['errors'] = !_.isNil(node['errors']) ? node['errors'] : {}; + node['errors']["isFailed"] = true; + this._errorMsgService.triggerShowError.next(this._errorMsgService.getRetryErrorObject(this.numberOfFailed)); + } + } + + /***************************************************************** + * should increase number of existing elements + * @param node - the current node + ****************************************************************/ + increaseNumberOfExcitingElements() { + this.numberOfElements++; + } + + /***************************************************************** + * return array of first level node with there child's + * @param modelName + * @param parentModel + * @param instance + * @param serviceHierarchy - The service Hierarchy store + * @param option + * @param parentType + ****************************************************************/ + getNodeInstance(modelName: string, parentModel: any, instance: any, serviceHierarchy, option: ILevelNodeInfo, parentType ?: string) { + const model = option.getModel(modelName, instance, serviceHierarchy); + + let optionalNodes = option.createInstanceTreeNode(instance, model, parentModel, modelName); + this.increaseNumberOfFailed(optionalNodes); + this.increaseNumberOfExcitingElements(); + let nodes: any[] = _.isArray(optionalNodes) ? optionalNodes : [optionalNodes]; + for (let node of nodes) { + node = this.addingExtraDataToNode(node, modelName, parentModel, instance, serviceHierarchy, option, parentType); + let children = this.addNextInstanceTreeNode(instance, model, option, node, serviceHierarchy); + if (!_.isNil(children) && children.length > 0) { + node.children = this.sortElementsByPosition(children); + } + this.updateScalingPolicy(node); + } + return nodes.length === 1 ? nodes[0] : nodes; + } + + addingExtraDataToNode(node, modelName: string, parentModel: any, instance: any, serviceHierarchy, option: ILevelNodeInfo, parentType ?: string) { + node.trackById = _.isNil(node.trackById) ? DefaultDataGeneratorService.createRandomTrackById() : node['trackById']; + node.parentType = !_.isNil(parentType) ? parentType : ""; + node.updatePoistionFunction = option.updatePosition; + node.position = option.getNodePosition(instance, node.dynamicModelName); + node.onSelectedNode = option.onSelectedNode; + return node; + } + + sortElementsByPosition(nodes: any[]): any[] { + if (!FeatureFlagsService.getFlagState(Features.DRAG_AND_DROP_OPERATION, this.store)) return nodes; + return nodes.sort((nodeA, nodeB) => { + return nodeA.position - nodeB.position; + }); + } + + /***************************************************************** + * return next level node with there child's + * @param parentInstance + * @param parentModel + * @param levelNodeInfo + * @param parentNode + * @param serviceHierarchy - The service Hierarchy store + ****************************************************************/ + addNextInstanceTreeNode(parentInstance, parentModel, levelNodeInfo: ILevelNodeInfo, parentNode, serviceHierarchy): any[] { + if (!_.isNil(levelNodeInfo.childName)) { + parentNode.children = []; + if (!_.isNil(parentInstance[levelNodeInfo.childName])) { + let parentType = levelNodeInfo.type; + let nextLevelNodeInfo = levelNodeInfo.getNextLevelObject.apply(this); + Object.keys(parentInstance[levelNodeInfo.childName]).map((modelName) => { + let nextLevelInstance = parentInstance[levelNodeInfo.childName][modelName]; + let nodes: any[] | any = this.getNodeInstance(modelName, parentModel, nextLevelInstance, serviceHierarchy, nextLevelNodeInfo, parentType); + if (_.isArray(nodes)) { + parentNode.children = parentNode.children.concat(nodes); + } else { + parentNode.children.push(nodes); + } + }); + return this.sortElementsByPosition(parentNode.children); + } + } + return parentNode.children; + } + + + /************************************************************************************ + * update instance scaling policy according to instance limit and existing children + * @param node + *********************************************************************************/ + updateScalingPolicy(node): void { + node['errors'] = !_.isNil(node['errors']) ? node['errors'] : {}; + if (!_.isNil(node['limitMembers']) && !_.isNil(node.children)) { + let effectiveChildren = (node.children).filter(child => [ + ServiceInstanceActions.Create, + ServiceInstanceActions.None, + ServiceInstanceActions.Update + ].includes(child.action)); + + + if (effectiveChildren.length > node.limitMembers) { + node['errors']["scalingError"] = true; + this._errorMsgService.triggerShowError.next(this._errorMsgService.getScalingErrorObject()); + } else { + delete node['errors']["scalingError"]; + } + + } + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToModelTree/objectToModelTree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToModelTree/objectToModelTree.service.spec.ts new file mode 100644 index 000000000..41ad23f07 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToModelTree/objectToModelTree.service.spec.ts @@ -0,0 +1,727 @@ +import {HttpClientTestingModule, HttpTestingController} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {NgRedux} from "@angular-redux/store"; +import {ObjectToTreeService} from "../objectToTree.service"; +import {ObjectToModelTreeService} from "./objectToModelTree.service"; +import {DefaultDataGeneratorService} from "../../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {DynamicInputsService} from "../dynamicInputs.service"; +import {SharedTreeService} from "../shared.tree.service"; +import {DrawingBoardModes} from "../../drawing-board.modes"; +import {AvailableModelsTreeService} from "../../available-models-tree/available-models-tree.service"; +import {DialogService} from "ng2-bootstrap-modal"; +import {VnfPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {BasicControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/basic.control.generator"; +import {GenericFormService} from "../../../../shared/components/genericForm/generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import {LogService} from "../../../../shared/utils/log/log.service"; +import {IframeService} from "../../../../shared/utils/iframe.service"; +import {BasicPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/basic.popup.service"; +import {NetworkPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import {NetworkControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator"; +import {VfModulePopuopService} from "../../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {VfModuleControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator"; +import {FeatureFlagsService} from "../../../../shared/services/featureFlag/feature-flags.service"; +import {VnfControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator"; +import {AaiService} from "../../../../shared/services/aaiService/aai.service"; +import {VnfGroupPopupService} from "../../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import {VnfGroupControlGenerator} from "../../../../shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator"; +import {DuplicateService} from "../../duplicate/duplicate.service"; +import {SdcUiComponentsModule} from "onap-ui-angular"; +import {ComponentInfoService} from "../../component-info/component-info.service"; + +class MockAppStore<T> { + getState() { + return { + global: { + 'drawingBoardStatus': DrawingBoardModes.CREATE + } + } + } +} + +describe('Model Tree Generator service', () => { + let injector; + let service: ObjectToModelTreeService; + let httpMock: HttpTestingController; + + beforeEach(() => { + + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule, SdcUiComponentsModule], + providers: [ + AvailableModelsTreeService, + ObjectToTreeService, + ObjectToModelTreeService, + DefaultDataGeneratorService, + DynamicInputsService, + SharedTreeService, + DialogService, + VnfPopupService, + VnfGroupPopupService, + BasicControlGenerator, + GenericFormService, + FormBuilder, + LogService, + IframeService, + BasicPopupService, + NetworkPopupService, + NetworkControlGenerator, + VfModulePopuopService, + VfModuleControlGenerator, + VnfGroupControlGenerator, + DialogService, + FeatureFlagsService, + VnfControlGenerator, + AaiService, + DialogService, + DuplicateService, + ComponentInfoService, + {provide: NgRedux, useClass: MockAppStore}, + MockNgRedux] + }).compileComponents(); + + injector = getTestBed(); + service = injector.get(ObjectToModelTreeService); + httpMock = injector.get(HttpTestingController); + }); + + test('ObjectToModelTreeService should be defined', () => { + expect(service).toBeDefined(); + }); + + test('should return nodes correctly: VNF', () => { + + let convertToNodes = service.convertServiceHierarchyModelToTreeNodes(getServiceHeirarchyVNF()); + convertToNodes.map((item) => { + delete item['onAddClick']; + delete item['getNodeCount']; + delete item['showNodeIcons']; + delete item['menuActions']; + delete item['getMenuAction']; + delete item['trackById']; + + if (item.children) { + item.children.map((child) => { + delete child['onAddClick']; + delete child['getNodeCount']; + delete child['showNodeIcons']; + delete child['menuActions']; + delete child['getMenuAction']; + delete child['trackById']; + }); + } + }); + + expect(Object.assign({}, convertToNodes)).toEqual(Object.assign({}, expectNodesResultVNF())); + }); + + + function expectNodesResultVNF() { + return [{ + "id": "280dec31-f16d-488b-9668-4aae55d6648a", + "modelVersionId": "0903e1c0-8e03-4936-b5c2-260653b96413", + "name": "2017-388_ADIOD-vPE 1", + "tooltip": "VF", + "type": "VF", + "count": 0, + "max": 1, + "children": [], + "disabled": false, + "modelCustomizationId": "280dec31-f16d-488b-9668-4aae55d6648a", + "modelUniqueId": "280dec31-f16d-488b-9668-4aae55d6648a", + "dynamicInputs": [], + "isEcompGeneratedNaming": true, + "typeName": 'VNF' + }, { + "id": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "modelVersionId": "afacccf6-397d-45d6-b5ae-94c39734b168", + "modelCustomizationId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "modelUniqueId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "name": "2017-388_ADIOD-vPE 0", + "tooltip": "VF", + "type": "VF", + "count": 0, + "max": 1, + "children": [], + "disabled": false, + "dynamicInputs": [], + "isEcompGeneratedNaming": true, + "typeName": 'VNF' + }, { + "id": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "modelUniqueId": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "name": "2017-488_ADIOD-vPE 0", + "tooltip": "VF", + "type": "VF", + "count": 0, + "max": 1, + "children": [{ + "id": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "modelVersionId": "25284168-24bb-4698-8cb4-3f509146eca5", + "modelCustomizationId": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "modelUniqueId": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "name": "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "tooltip": "VFmodule", + "type": "VFmodule", + "count": 0, + "max": 1, + "children": [], + "disabled": false, + "dynamicInputs": [], + "isEcompGeneratedNaming": true, + "typeName": 'M' + }, { + "id": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "modelVersionId": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "modelUniqueId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "name": "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "tooltip": "VFmodule", + "type": "VFmodule", + "count": 0, + "max": 1, + "children": [], + "disabled": false, + "dynamicInputs": [], + "isEcompGeneratedNaming": true, + "typeName": 'M' + }, { + "id": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "modelVersionId": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "modelCustomizationId": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "modelUniqueId": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "name": "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "tooltip": "VFmodule", + "type": "VFmodule", + "count": 0, + "max": 1, + "children": [], + "disabled": false, + "dynamicInputs": [], + "isEcompGeneratedNaming": true, + "typeName": 'M' + }], + "disabled": false, + "dynamicInputs": [], + "isEcompGeneratedNaming": true, + "typeName": 'VNF' + }] + + } + + function getServiceHeirarchyVNF() { + return { + "service": { + "uuid": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", + "invariantUuid": "cdb90b57-ed78-4d44-a5b4-7f43a02ec632", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "Network L1-3", + "serviceType": "pnf", + "serviceRole": "Testing", + "description": "ADIOD vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": {}, + "vidNotions": {"instantiationUI": "legacy", "modelCategory": "other"} + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": {}, + "commands": {}, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "true", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "true", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:2017488_adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:2017488_adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": {}, + "commands": {}, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "true", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "true", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:2017488_adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:2017488_adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": {}, + "commands": {}, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "true", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "true", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:2017488_adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:2017488_adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {} + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": {}, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {} + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {} + } + } +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToModelTree/objectToModelTree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToModelTree/objectToModelTree.service.ts new file mode 100644 index 000000000..e941faad3 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToModelTree/objectToModelTree.service.ts @@ -0,0 +1,98 @@ +import {Injectable} from "@angular/core"; +import {ILevelNodeInfo} from "../models/basic.model.info"; +import {ObjectToTreeService} from "../objectToTree.service"; +import * as _ from "lodash"; + +@Injectable() +export class ObjectToModelTreeService { + constructor(private _objectToTreeService: ObjectToTreeService) { + } + + /*********************************************************** + * return array of first level node with there child's + * @param serviceModel - The serviceHierarchy object + ************************************************************/ + convertServiceHierarchyModelToTreeNodes(serviceModel): any[] { + let _this = this; + const firstLevelOptions: ILevelNodeInfo[] = _this._objectToTreeService.getFirstLevelOptions(); + let nodes = []; + for (let option of firstLevelOptions) { + _.forOwn(serviceModel[option.name], function (item, key) { + nodes.push(_this.addFirstLevelModel(serviceModel.service.uuid, key, item, item.type, serviceModel, option)); + }); + } + console.log('nodes', nodes); + return nodes; + } + + + /*********************************************************** + * return node with all his child's + * @param name - Model name + * @param serviceId - service id + * @param currentModel - current Model object + * @param type - current Model type + * @param parentModel - current parent Model object + * @param levelNodeInfo - current level node information + ************************************************************/ + private addFirstLevelModel(serviceId: string, name, currentModel, type, parentModel, levelNodeInfo: ILevelNodeInfo) { + let node = ObjectToModelTreeService.convertItemToTreeNode(serviceId, name, currentModel, type, null, levelNodeInfo); + node.children = this.addNextLevelNodes(serviceId, currentModel, parentModel, levelNodeInfo, node); + return node; + } + + /*********************************************************** + * return all the child's of node (is child exist) + * else return empty array. + * @param currentModel - current Model object + * @param parentModel - current parent Model object + * @param levelNodeInfo - current level node information + * @param parentNode - parent node. + ************************************************************/ + addNextLevelNodes(serviceId: string, currentModel, parentModel, levelNodeInfo: ILevelNodeInfo, parentNode): any[] { + if (!_.isNil(levelNodeInfo.childName)) { + if (!_.isNil(currentModel[levelNodeInfo.childName])) { + let nextLevelNodeInfo = levelNodeInfo.getNextLevelObject.apply(this); + parentNode.children = Object.keys(currentModel[levelNodeInfo.childName]).map((key) => + ObjectToModelTreeService.convertItemToTreeNode(serviceId, key, currentModel[levelNodeInfo.childName][key], levelNodeInfo.childName, currentModel, nextLevelNodeInfo)); + + } + } + return parentNode.children; + } + + + /*********************************************************** + * return node with his properties + * @param serviceId + * @param name - model name + * @param currentModel - current model from serviceHierarchy + * @param valueType - model type + * @param parentModel - current parent model + * @param levelNodeInfo - current levelNodeInfo object + ************************************************************/ + static convertItemToTreeNode(serviceId: string, name: string, currentModel: any, valueType: string, parentModel: string, levelNodeInfo: ILevelNodeInfo) { + let node = { + id: currentModel.customizationUuid || currentModel.uuid, + modelCustomizationId : currentModel.customizationUuid, + modelVersionId: currentModel.uuid, + modelUniqueId : currentModel.customizationUuid || currentModel.uuid, + name: name, + tooltip: levelNodeInfo.getTooltip(), + type: levelNodeInfo.getType(), + count: currentModel.count || 0, + max: currentModel.max || 1, + children: [], + disabled: false, + dynamicInputs: levelNodeInfo.updateDynamicInputsDataFromModel(currentModel), + isEcompGeneratedNaming: levelNodeInfo.isEcompGeneratedNaming(currentModel, parentModel) + }; + + node['onAddClick'] = (node, serviceId) => levelNodeInfo.onClickAdd(node, serviceId); + node['getNodeCount'] = (node, serviceId) => levelNodeInfo.getNodeCount(node, serviceId); + node['getMenuAction'] = (node, serviceId) => levelNodeInfo.getMenuAction(node, serviceId); + node['showNodeIcons'] = (node, serviceId) => levelNodeInfo.showNodeIcons(node, serviceId); + node['typeName'] = levelNodeInfo['typeName']; + return node; + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToTree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToTree.service.ts new file mode 100644 index 000000000..338964515 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToTree.service.ts @@ -0,0 +1,51 @@ +import {Injectable} from "@angular/core"; +import {ILevelNodeInfo} from "./models/basic.model.info"; +import {VnfModelInfo} from "./models/vnf/vnf.model.info"; +import {NetworkModelInfo} from "./models/network/network.model.info"; +import {ConfigurationModelInfo} from "./models/configuration/configuration.model.info"; +import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {DynamicInputsService} from "./dynamicInputs.service"; +import {SharedTreeService} from "./shared.tree.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../shared/store/reducers"; +import {DialogService} from "ng2-bootstrap-modal"; +import {VnfPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {NetworkPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import {VfModulePopuopService} from "../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {VnfGroupingModelInfo} from "./models/vnfGrouping/vnfGrouping.model.info"; +import {VnfGroupPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import {DuplicateService} from "../duplicate/duplicate.service"; +import {SdcUiServices} from "onap-ui-angular"; +import {IframeService} from "../../../shared/utils/iframe.service"; +import {ComponentInfoService} from "../component-info/component-info.service"; + +@Injectable() +export class ObjectToTreeService { + constructor(private _defaultDataGeneratorService: DefaultDataGeneratorService, + private _dynamicInputsService: DynamicInputsService, + private _sharedTreeService : SharedTreeService, + private _dialogService : DialogService, + private _vnfPopupService : VnfPopupService, + private _networkPopupService : NetworkPopupService, + private _vfModulePopupService : VfModulePopuopService, + private _vnfGroupPopupService : VnfGroupPopupService, + private _duplicateService : DuplicateService, + private _modalService: SdcUiServices.ModalService, + private _iframeService : IframeService, + private _componentInfoService : ComponentInfoService, + private _store : NgRedux<AppState>) { + } + + + + + /*********************************************************** + * return all first optional first level of the model tree + ************************************************************/ + getFirstLevelOptions(): ILevelNodeInfo[] { + return [new VnfModelInfo(this._dynamicInputsService, this._sharedTreeService, this._defaultDataGeneratorService, this._dialogService, this._vnfPopupService, this._vfModulePopupService, this._duplicateService, this._modalService, this._iframeService, this._componentInfoService, this._store) + , new NetworkModelInfo(this._dynamicInputsService, this._sharedTreeService, this._dialogService, this._networkPopupService, this._duplicateService, this._modalService, this._iframeService, this._store), + new ConfigurationModelInfo(this._dynamicInputsService, this._sharedTreeService), + new VnfGroupingModelInfo(this._dynamicInputsService, this._sharedTreeService, this._dialogService, this._vnfGroupPopupService, this._iframeService, this._store)]; + }; +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts new file mode 100644 index 000000000..617a81e1f --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts @@ -0,0 +1,1761 @@ +import {HttpClientTestingModule} from "@angular/common/http/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; +import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; +import {SharedTreeService} from "./shared.tree.service"; +import {ObjectToInstanceTreeService} from "./objectToInstanceTree/objectToInstanceTree.service"; +import {ObjectToTreeService} from "./objectToTree.service"; +import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service"; +import {DynamicInputsService} from "./dynamicInputs.service"; +import {DialogService} from "ng2-bootstrap-modal"; +import {VnfPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service"; +import {BasicControlGenerator} from "../../../shared/components/genericForm/formControlsServices/basic.control.generator"; +import {AaiService} from "../../../shared/services/aaiService/aai.service"; +import {NetworkPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service"; +import {NetworkControlGenerator} from "../../../shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator"; +import {VfModulePopuopService} from "../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popuop.service"; +import {VfModuleControlGenerator} from "../../../shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator"; +import {VnfGroupControlGenerator} from "../../../shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator"; +import {FeatureFlagsService} from "../../../shared/services/featureFlag/feature-flags.service"; +import {VnfControlGenerator} from "../../../shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator"; +import {NgRedux} from "@angular-redux/store"; +import {GenericFormService} from "../../../shared/components/genericForm/generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import {SdcUiComponentsModule} from "onap-ui-angular"; +import {LogService} from "../../../shared/utils/log/log.service"; +import {IframeService} from "../../../shared/utils/iframe.service"; +import {BasicPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/basic.popup.service"; +import {VnfGroupPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service"; +import {DuplicateService} from "../duplicate/duplicate.service"; +import {AppState} from "../../../shared/store/reducers"; +import {MessageBoxService} from "../../../shared/components/messageBox/messageBox.service"; +import {ErrorMsgService} from "../../../shared/components/error-msg/error-msg.service"; +import {AuditInfoModalComponent} from "../../../shared/components/auditInfoModal/auditInfoModal.component"; +import {ILevelNodeInfo} from "./models/basic.model.info"; +import {VnfModelInfo} from "./models/vnf/vnf.model.info"; +import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; +import each from "jest-each"; +import {DrawingBoardModes} from "../drawing-board.modes"; +import {ComponentInfoService} from "../component-info/component-info.service"; + +class MockAppStore<T> { + getState() { + return getStore() + } + + dispatch() { + } +} + +class MockVnfModelInfo<T> { + getModel() { + return {} + } +} + + +describe('Shared Tree Service', () => { + let injector; + let service: SharedTreeService; + let _objectToInstanceTreeService: ObjectToInstanceTreeService; + let store: NgRedux<AppState>; + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, NgReduxTestingModule, SdcUiComponentsModule], + providers: [ + SharedTreeService, + ObjectToTreeService, + DefaultDataGeneratorService, + DialogService, + VnfPopupService, + BasicControlGenerator, + AaiService, + LogService, + BasicPopupService, + VnfGroupPopupService, + DuplicateService, + IframeService, + DynamicInputsService, + NetworkPopupService, + NetworkControlGenerator, + VfModulePopuopService, + VfModuleControlGenerator, + VnfGroupControlGenerator, + DialogService, + FeatureFlagsService, + VnfControlGenerator, + AaiService, + DialogService, + GenericFormService, + FormBuilder, + ErrorMsgService, + ObjectToInstanceTreeService, + ComponentInfoService, + {provide: NgRedux, useClass: MockAppStore} + ] + }); + await TestBed.compileComponents(); + injector = getTestBed(); + service = injector.get(SharedTreeService); + _objectToInstanceTreeService = injector.get(ObjectToInstanceTreeService); + store = injector.get(NgRedux); + })().then(done).catch(done.fail)); + + test('SharedTreeService should be defined', () => { + expect(service).toBeDefined(); + }); + + test('shouldShowDeleteInstanceWithChildrenModal should open modal if child exist with action create', () => { + jest.spyOn(MessageBoxService.openModal, 'next'); + let foo = () => { + + }; + let node = <any>{ + children: [{action: "Create"}, {action: "None"}], + data: { + typeName: 'VNF' + } + }; + service.shouldShowDeleteInstanceWithChildrenModal(node, "serviceModelId", foo); + expect(MessageBoxService.openModal.next).toHaveBeenCalled(); + }); + + test('openAuditInfoModal should open modal for failed instance', () => { + jest.spyOn(AuditInfoModalComponent.openInstanceAuditInfoModal, 'next'); + + let modelInfoServiceMock: ILevelNodeInfo = new VnfModelInfo(null, null, null, null, null, null, null, null, null, null); + const modelMock = {"a": "a"}; + const instanceMock = {"instance": "instance", "trackById": "123456789"}; + const instanceTypeMock = "instanceTypeMock"; + jest.spyOn(modelInfoServiceMock, 'getModel').mockReturnValue(modelMock); + let node = <any>{ + data: { + modelId: '6b528779-44a3-4472-bdff-9cd15ec93450', + trackById: '1245df21', + isFailed: true + } + }; + service.openAuditInfoModal(node, "serviceModelId", instanceMock, instanceTypeMock, <any>modelInfoServiceMock); + expect(AuditInfoModalComponent.openInstanceAuditInfoModal.next).toHaveBeenCalledWith( + { + "instance": instanceMock, + "instanceId": "serviceModelId", + "isInstanceFailed": node.data.isFailed, + "model": modelMock, + "trackById": instanceMock.trackById, + "type": instanceTypeMock + }); + }); + + test('shouldShowDeleteInstanceWithChildrfenModal should not open modal if all childs with action None', () => { + let foo = () => { + }; + spyOn(MessageBoxService.openModal, 'next'); + + let node = <any>{ + children: [{action: "None"}, {action: "None"}], + data: { + typeName: 'VNF' + } + }; + service.shouldShowDeleteInstanceWithChildrenModal(node, "serviceModelId", foo); + expect(MessageBoxService.openModal.next).not.toHaveBeenCalled(); + }); + + test('statusProperties should be prop on node according to node properties', () => { + let node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', inMaint: false}); + expect(node.statusProperties).toBeDefined(); + expect(node.statusProperties).toEqual([Object({ + key: 'Prov Status:', + value: 'inProgress', + testId: 'provStatus' + }), Object({key: 'Orch Status:', value: 'completed', testId: 'orchStatus'})]); + node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', inMaint: true}); + expect(node.statusProperties).toEqual([Object({ + key: 'Prov Status:', + value: 'inProgress', + testId: 'provStatus' + }), Object({key: 'Orch Status:', value: 'completed', testId: 'orchStatus'}), Object({ + key: 'In-maintenance', + value: '', + testId: 'inMaint' + })]); + }); + const enableRemoveAndEditItemsDataProvider = [ + ['Create action CREATE mode', DrawingBoardModes.CREATE ,ServiceInstanceActions.Create, true], + ['Create action VIEW mode',DrawingBoardModes.VIEW , ServiceInstanceActions.Create,false], + ['Create action RETRY_EDIT mode',DrawingBoardModes.RETRY_EDIT, ServiceInstanceActions.Create, true], + ['Create action EDIT mode',DrawingBoardModes.EDIT, ServiceInstanceActions.Create, true], + ['Create action RETRY mode',DrawingBoardModes.RETRY, ServiceInstanceActions.Create, false], + ['None action EDIT mode',DrawingBoardModes.EDIT, ServiceInstanceActions.None, false], + ['None action RETRY_EDIT mode', DrawingBoardModes.RETRY_EDIT, ServiceInstanceActions.None, false]]; + each(enableRemoveAndEditItemsDataProvider).test('shouldShowEditAndDelete if child exist with %s', (description, mode, action, enabled) => { + jest.spyOn(store, 'getState').mockReturnValue({ + global: { + drawingBoardStatus: mode + } + }); + let node = <any>{ + data:{ + action: action + }, + }; + let res = service.shouldShowRemoveAndEdit(node); + expect(res).toBe(enabled); + }); +}); +function generateService() { + return { + "vnfs": { + "2017-488_ADIOD-vPE 0": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "2017-488_ADIOD-vPE 0", + "isMissingData": false, + "trackById": "stigekyxrqi", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0gytfi": { + "isMissingData": false, + "sdncPreReload": null, + "modelInfo": { + "modelType": "VFmodule", + "modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "modelVersionId": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "modelName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "modelVersion": "5", + "modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0" + }, + "instanceParams": [{}], + "trackById": "3oj23o7nupo" + } + } + }, + "vnfStoreKey": "2017-488_ADIOD-vPE 0", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "lineOfBusiness": "ONAP", + "platformName": "xxx1", + "modelInfo": { + "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "modelName": "2017-488_ADIOD-vPE", + "modelVersion": "5.0", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09" + }, + "legacyRegion": "11111111", + "instanceParams": [{}] + }, + "2017-388_ADIOD-vPE 0": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "2017-388_ADIOD-vPE 0", + "isMissingData": false, + "trackById": "nib719t5vca", + "vfModules": {}, + "vnfStoreKey": "2017-388_ADIOD-vPE 0", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "legacyRegion": "11111", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "platformName": "platform", + "lineOfBusiness": "zzz1", + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "modelVersionId": "afacccf6-397d-45d6-b5ae-94c39734b168", + "modelName": "2017-388_ADIOD-vPE", + "modelVersion": "4.0", + "modelCustomizationId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168" + }, + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168" + }, + "2017-388_ADIOD-vPE 1": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "2017-388_ADIOD-vPE 1", + "isMissingData": false, + "trackById": "cv7l1ak8vpe", + "vfModules": {}, + "vnfStoreKey": "2017-388_ADIOD-vPE 1", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "legacyRegion": "123", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "platformName": "platform", + "lineOfBusiness": "ONAP", + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "modelVersionId": "0903e1c0-8e03-4936-b5c2-260653b96413", + "modelName": "2017-388_ADIOD-vPE", + "modelVersion": "1.0", + "modelCustomizationId": "280dec31-f16d-488b-9668-4aae55d6648a", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413" + }, + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413" + } + }, + "instanceParams": [{}], + "validationCounter": 0, + "existingNames": {"yoav": ""}, + "existingVNFCounterMap": { + "69e09f68-8b63-4cc9-b9ff-860960b5db09": 1, + "afacccf6-397d-45d6-b5ae-94c39734b168": 1, + "0903e1c0-8e03-4936-b5c2-260653b96413": 1 + }, + "existingVnfGroupCounterMap": { + "daeb6568-cef8-417f-9075-ed259ce59f48": 0, + "c2b300e6-45de-4e5e-abda-3032bee2de56": -1 + }, + "existingNetworksCounterMap": {"ddc3f20c-08b5-40fd-af72-c6d14636b986": 1}, + "networks": { + "ExtVL 0": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "ExtVL 0", + "isMissingData": false, + "trackById": "s6okajvv2n8", + "networkStoreKey": "ExtVL 0", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "legacyRegion": "12355555", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "platformName": "platform", + "lineOfBusiness": null, + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "379f816b-a7aa-422f-be30-17114ff50b7c", + "modelVersionId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "modelName": "ExtVL", + "modelVersion": "37.0", + "modelCustomizationId": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "modelCustomizationName": "ExtVL 0", + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + }, + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + } + }, + "vnfGroups": { + "groupingservicefortest..ResourceInstanceGroup..0": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "groupingservicefortest..ResourceInstanceGroup..0", + "isMissingData": false, + "trackById": "se0obn93qq", + "vnfGroupStoreKey": "groupingservicefortest..ResourceInstanceGroup..0", + "instanceName": "groupingservicefortestResourceInstanceGroup0", + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "4bb2e27e-ddab-4790-9c6d-1f731bc14a45", + "modelVersionId": "daeb6568-cef8-417f-9075-ed259ce59f48", + "modelName": "groupingservicefortest..ResourceInstanceGroup..0", + "modelVersion": "1", + "modelCustomizationName": "groupingservicefortest..ResourceInstanceGroup..0", + "uuid": "daeb6568-cef8-417f-9075-ed259ce59f48" + }, + "uuid": "daeb6568-cef8-417f-9075-ed259ce59f48" + } + }, + "instanceName": "yoav", + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "aicZoneId": "ATL53", + "pause": null, + "projectName": "WATKINS", + "rollbackOnFailure": "true", + "bulkSize": 1, + "aicZoneName": "AAIATLTE-ATL53", + "owningEntityName": "WayneHolland", + "testApi": "VNF_API", + "isEcompGeneratedNaming": false, + "tenantName": "USP-SIP-IC-24335-T-01", + "modelInfo": { + "modelInvariantId": "cdb90b57-ed78-4d44-a5b4-7f43a02ec632", + "modelVersionId": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", + "modelName": "action-data", + "modelVersion": "1.0", + "uuid": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd" + }, + "isALaCarte": false, + "name": "action-data", + "version": "1.0", + "description": "ADIOD vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM", + "category": "Network L1-3", + "uuid": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", + "invariantUuid": "cdb90b57-ed78-4d44-a5b4-7f43a02ec632", + "serviceType": "pnf", + "serviceRole": "Testing", + "vidNotions": {"instantiationUI": "legacy", "modelCategory": "other", "viewEditUI": "legacy"}, + "isMultiStepDesign": true + }; +} + +function getStore() { + return { + "global": { + "name": null, + "flags": { + "CREATE_INSTANCE_TEST": false, + "EMPTY_DRAWING_BOARD_TEST": false, + "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false, + "FLAG_ASYNC_INSTANTIATION": true, + "FLAG_ASYNC_JOBS": true, + "FLAG_ADD_MSO_TESTAPI_FIELD": true, + "FLAG_UNASSIGN_SERVICE": true, + "FLAG_SERVICE_MODEL_CACHE": true, + "FLAG_COLLECTION_RESOURCE_SUPPORT": true, + "FLAG_SHOW_ASSIGNMENTS": true, + "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, + "FLAG_DUPLICATE_VNF": true, + "FLAG_DEFAULT_VNF": true, + "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": true, + "FLAG_A_LA_CARTE_AUDIT_INFO": true, + "FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST": true, + "FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS": true, + "FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE": true, + "FLAG_1902_NEW_VIEW_EDIT": true, + "FLAG_1810_IDENTIFY_SERVICE_FOR_NEW_UI": false, + "FLAG_1902_VNF_GROUPING": true, + "FLAG_SHOW_VERIFY_SERVICE": true, + "FLAG_ASYNC_ALACARTE_VFMODULE": true, + "FLAG_ASYNC_ALACARTE_VNF": true, + "FLAG_SHIFT_VFMODULE_PARAMS_TO_VNF": true, + "FLAG_1810_AAI_LOCAL_CACHE": true, + "FLAG_EXP_USE_DEFAULT_HOST_NAME_VERIFIER": false, + "FLAG_EXP_ANY_ALACARTE_NEW_INSTANTIATION_UI": false, + "FLAG_SUPPLEMENTARY_FILE": true, + "FLAG_5G_IN_NEW_INSTANTIATION_UI": true, + "FLAG_RESTRICTED_SELECT": false, + "FLAG_1810_CR_LET_SELECTING_COLLECTOR_TYPE_UNCONDITIONALLY": true + }, + "drawingBoardStatus": "VIEW", + "type": "UPDATE_DRAWING_BOARD_STATUS" + }, + "service": { + "serviceHierarchy": { + "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd": { + "service": { + "uuid": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", + "invariantUuid": "cdb90b57-ed78-4d44-a5b4-7f43a02ec632", + "name": "action-data", + "version": "1.0", + "toscaModelURL": null, + "category": "Network L1-3", + "serviceType": "pnf", + "serviceRole": "Testing", + "description": "ADIOD vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": {}, + "vidNotions": {"instantiationUI": "legacy", "modelCategory": "other", "viewEditUI": "legacy"} + }, + "vnfs": { + "2017-388_ADIOD-vPE 1": { + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413", + "invariantUuid": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "1.0", + "customizationUuid": "280dec31-f16d-488b-9668-4aae55d6648a", + "inputs": {}, + "commands": {}, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "true", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "true", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:2017488_adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:2017488_adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-388_ADIOD-vPE 0": { + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-388_ADIOD-vPE", + "version": "4.0", + "customizationUuid": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "inputs": {}, + "commands": {}, + "properties": { + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "true", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "true", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:2017488_adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:2017488_adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "vfModules": {}, + "volumeGroups": {}, + "vfcInstanceGroups": {} + }, + "2017-488_ADIOD-vPE 0": { + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "invariantUuid": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "description": "Name ADIOD vPE Description The provider edge function for the ADIOD service supported by the Junipers VMX product Category Router Vendor Juniper Vendor Release Code 17.2 Owners Mary Fragale. Updated 9-25 to use v8.0 of the Juniper Valid 2 VLM", + "name": "2017-488_ADIOD-vPE", + "version": "5.0", + "customizationUuid": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "inputs": {}, + "commands": {}, + "properties": { + "max_instances": 1, + "vmxvre_retype": "RE-VMX", + "vnf_config_template_version": "get_input:2017488_adiodvpe0_vnf_config_template_version", + "sriov44_net_id": "48d399b3-11ee-48a8-94d2-f0ea94d6be8d", + "int_ctl_net_id": "2f323477-6936-4d01-ac53-d849430281d9", + "vmxvpfe_sriov41_0_port_mac": "00:11:22:EF:AC:DF", + "int_ctl_net_name": "VMX-INTXI", + "vmx_int_ctl_prefix": "10.0.0.10", + "sriov43_net_id": "da349ca1-6de9-4548-be88-2d88e99bfef5", + "sriov42_net_id": "760669ba-013d-4d9b-b0e7-4151fe2e6279", + "sriov41_net_id": "25ad52d5-c165-40f8-b3b0-ddfc2373280a", + "nf_type": "vPE", + "vmxvpfe_int_ctl_ip_1": "10.0.0.10", + "is_AVPN_service": "false", + "vmx_RSG_name": "vREXI-affinity", + "vmx_int_ctl_forwarding": "l2", + "vmxvre_oam_ip_0": "10.0.0.10", + "vmxvpfe_sriov44_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_sriov41_0_port_vlanstrip": "false", + "vmxvpfe_sriov42_0_port_vlanfilter": "4001", + "vmxvpfe_sriov44_0_port_unknownunicastallow": "true", + "vmxvre_image_name_0": "VRE-ENGINE_17.2-S2.1.qcow2", + "vmxvre_instance": "0", + "vmxvpfe_sriov43_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvre_flavor_name": "ns.c1r16d32.v5", + "vmxvpfe_volume_size_0": "40.0", + "vmxvpfe_sriov43_0_port_vlanfilter": "4001", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "true", + "nf_naming_code": "Navneet", + "vmxvre_name_0": "vREXI", + "vmxvpfe_sriov42_0_port_vlanstrip": "false", + "vmxvpfe_volume_name_0": "vPFEXI_FBVolume", + "vmx_RSG_id": "bd89a33c-13c3-4a04-8fde-1a57eb123141", + "vmxvpfe_image_name_0": "VPE_ROUTING-ENGINE_17.2R1-S2.1.qcow2", + "vmxvpfe_sriov43_0_port_unknownunicastallow": "true", + "vmxvpfe_sriov44_0_port_unknownmulticastallow": "true", + "vmxvre_console": "vidconsole", + "vmxvpfe_sriov44_0_port_vlanfilter": "4001", + "vmxvpfe_sriov42_0_port_mac": "00:11:22:EF:AC:DF", + "vmxvpfe_volume_id_0": "47cede15-da2f-4397-a101-aa683220aff3", + "vmxvpfe_sriov42_0_port_unknownmulticastallow": "true", + "vmxvpfe_sriov44_0_port_vlanstrip": "false", + "vf_module_id": "123", + "nf_function": "JAI", + "vmxvpfe_sriov43_0_port_unknownmulticastallow": "true", + "vmxvre_int_ctl_ip_0": "10.0.0.10", + "ecomp_generated_naming": "true", + "AIC_CLLI": "get_input:2017488_adiodvpe0_AIC_CLLI", + "vnf_name": "mtnj309me6vre", + "vmxvpfe_sriov41_0_port_unknownunicastallow": "true", + "vmxvre_volume_type_1": "HITACHI", + "vmxvpfe_sriov44_0_port_broadcastallow": "true", + "vmxvre_volume_type_0": "HITACHI", + "vmxvpfe_volume_type_0": "HITACHI", + "vmxvpfe_sriov43_0_port_broadcastallow": "true", + "bandwidth_units": "get_input:2017488_adiodvpe0_bandwidth_units", + "vnf_id": "123", + "vmxvre_oam_prefix": "24", + "availability_zone_0": "mtpocfo-kvm-az01", + "ASN": "get_input:2017488_adiodvpe0_ASN", + "vmxvre_chassis_i2cid": "161", + "vmxvpfe_name_0": "vPFEXI", + "bandwidth": "get_input:2017488_adiodvpe0_bandwidth", + "availability_zone_max_count": "1", + "vmxvre_volume_size_0": "45.0", + "vmxvre_volume_size_1": "50.0", + "vmxvpfe_sriov42_0_port_broadcastallow": "true", + "vmxvre_oam_gateway": "10.0.0.10", + "vmxvre_volume_name_1": "vREXI_FAVolume", + "vmxvre_ore_present": "0", + "vmxvre_volume_name_0": "vREXI_FBVolume", + "vmxvre_type": "0", + "vnf_instance_name": "get_input:2017488_adiodvpe0_vnf_instance_name", + "vmxvpfe_sriov41_0_port_unknownmulticastallow": "true", + "oam_net_id": "b95eeb1d-d55d-4827-abb4-8ebb94941429", + "vmx_int_ctl_len": "24", + "vmxvpfe_sriov43_0_port_vlanstrip": "false", + "vmxvpfe_sriov41_0_port_broadcastallow": "true", + "vmxvre_volume_id_1": "6e86797e-03cd-4fdc-ba72-2957119c746d", + "vmxvpfe_sriov41_0_port_vlanfilter": "4001", + "nf_role": "Testing", + "vmxvre_volume_id_0": "f4eacb79-f687-4e9d-b760-21847c8bb15a", + "vmxvpfe_sriov42_0_port_unknownunicastallow": "true", + "vmxvpfe_flavor_name": "ns.c20r16d25.v5" + }, + "type": "VF", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {} + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "vfcInstanceGroups": {} + } + }, + "networks": { + "ExtVL 0": { + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c", + "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks", + "name": "ExtVL", + "version": "37.0", + "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "inputs": {}, + "commands": {}, + "properties": { + "network_assignments": "{is_external_network=false, ipv4_subnet_default_assignment={min_subnets_count=1}, ecomp_generated_network_assignment=false, ipv6_subnet_default_assignment={min_subnets_count=1}}", + "exVL_naming": "{ecomp_generated_naming=true}", + "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}", + "network_homing": "{ecomp_selected_instance_node_target=false}" + }, + "type": "VL", + "modelCustomizationName": "ExtVL 0" + } + }, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "uuid": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "invariantUuid": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "customizationUuid": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "description": null, + "name": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "version": "5", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "ADIOD_base_vPE_BV", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vRE_BV..module-1": { + "uuid": "25284168-24bb-4698-8cb4-3f509146eca5", + "invariantUuid": "7253ff5c-97f0-4b8b-937c-77aeb4d79aa1", + "customizationUuid": "f7e7c365-60cf-49a9-9ebf-a1aa11b9d401", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vRE_BV..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vRE_BV", + "baseModule": false + }, + "inputs": {} + }, + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_vPFE_BV..module-2": { + "uuid": "0a0dd9d4-31d3-4c3a-ae89-a02f383e6a9a", + "invariantUuid": "eff8cc59-53a1-4101-aed7-8cf24ecf8339", + "customizationUuid": "3cd946bb-50e0-40d8-96d3-c9023520b557", + "description": null, + "name": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "version": "6", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_vPFE_BV..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "ADIOD_vPFE_BV", + "baseModule": false + }, + "inputs": {} + } + }, + "pnfs": {}, + "vnfGroups": { + "groupingservicefortest..ResourceInstanceGroup..0": { + "type": "VnfGroup", + "invariantUuid": "4bb2e27e-ddab-4790-9c6d-1f731bc14a45", + "uuid": "daeb6568-cef8-417f-9075-ed259ce59f48", + "version": "1", + "name": "groupingservicefortest..ResourceInstanceGroup..0", + "modelCustomizationName": "groupingservicefortest..ResourceInstanceGroup..0", + "properties": { + "contained_resource_type": "VF", + "role": "SERVICE-ACCESS", + "function": "DATA", + "description": "DDD0", + "type": "LOAD-GROUP", + "ecomp_generated_naming": "true" + }, + "members": { + "vdbe_svc_vprs_proxy 0": { + "uuid": "65fadfa8-a0d9-443f-95ad-836cd044e26c", + "invariantUuid": "f4baae0c-b3a5-4ca1-a777-afbffe7010bc", + "description": "A Proxy for Service vDBE_Svc_vPRS", + "name": "vDBE_Svc_vPRS Service Proxy", + "version": "1.0", + "customizationUuid": "bdb63d23-e132-4ce7-af2c-a493b4cafac9", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Service Proxy", + "sourceModelUuid": "da7827a2-366d-4be6-8c68-a69153c61274", + "sourceModelInvariant": "24632e6b-584b-4f45-80d4-fefd75fd9f14", + "sourceModelName": "vDBE_Svc_vPRS" + } + } + }, + "groupingservicefortest..ResourceInstanceGroup..1": { + "type": "VnfGroup", + "invariantUuid": "a704112d-dbc6-4e56-8d4e-aec57e95ef9a", + "uuid": "c2b300e6-45de-4e5e-abda-3032bee2de56", + "version": "1", + "name": "groupingservicefortest..ResourceInstanceGroup..1", + "modelCustomizationName": "groupingservicefortest..ResourceInstanceGroup..1", + "properties": { + "contained_resource_type": "VF", + "role": "SERVICE-ACCESS", + "function": "SIGNALING", + "description": "DDD1", + "type": "LOAD-GROUP", + "ecomp_generated_naming": "true" + }, + "members": { + "tsbc0001vm001_svc_proxy 0": { + "uuid": "65fadfa8-a0d9-443f-95ad-836cd044e26c", + "invariantUuid": "f4baae0c-b3a5-4ca1-a777-afbffe7010bc", + "description": "A Proxy for Service tsbc0001vm001_Svc", + "name": "tsbc0001vm001_Svc Service Proxy", + "version": "1.0", + "customizationUuid": "3d814462-30fb-4c62-b997-9aa360d27ead", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Service Proxy", + "sourceModelUuid": "28aeb8f6-5620-4148-8bfb-a5fb406f0309", + "sourceModelInvariant": "c989ab9a-33c7-46ec-b521-1b2daef5f047", + "sourceModelName": "tsbc0001vm001_Svc" + } + } + } + } + }, + "b75e0d22-05ff-4448-9266-5f0d4e1dbbd6": { + "service": { + "uuid": "b75e0d22-05ff-4448-9266-5f0d4e1dbbd6", + "invariantUuid": "5b9c0f33-eec1-484a-bf77-736a6644d7a8", + "name": "Using VID for VoIP Network Instantiations Shani", + "version": "1.0", + "toscaModelURL": null, + "category": "VoIP Call Control", + "serviceType": "", + "serviceRole": "", + "description": "Using VID for VoIP Network Instantiations Shani", + "serviceEcompNaming": "true", + "instantiationType": "ClientConfig", + "inputs": {}, + "vidNotions": {"instantiationUI": "legacy", "modelCategory": "other", "viewEditUI": "legacy"} + }, + "vnfs": {}, + "networks": { + "AIC30_CONTRAIL_BASIC 0": { + "uuid": "ac815c68-35b7-4ea4-9d04-92d2f844b27c", + "invariantUuid": "de01afb5-532b-451d-aac4-ff9ff0644060", + "description": "Basic contrail 3.0.x L3 network for AIC 3.x sites. ", + "name": "AIC30_CONTRAIL_BASIC", + "version": "3.0", + "customizationUuid": "e94d61f7-b4b2-489a-a4a7-30b1a1a80daf", + "inputs": {}, + "commands": {}, + "properties": { + "network_assignments": "{is_external_network=false, ipv4_subnet_default_assignment={min_subnets_count=1}, ecomp_generated_network_assignment=false, ipv6_subnet_default_assignment={min_subnets_count=1}}", + "exVL_naming": "{ecomp_generated_naming=true}", + "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}", + "network_scope": "Service", + "network_type": "AIC30_CONTRAIL_BASIC", + "network_technology": "Contrail", + "network_homing": "{ecomp_selected_instance_node_target=false}" + }, + "type": "VL", + "modelCustomizationName": "AIC30_CONTRAIL_BASIC 0" + } + }, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": {}, + "volumeGroups": {}, + "pnfs": {}, + "vnfGroups": {} + } + }, + "serviceInstance": { + "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd": { + "vnfs": { + "2017-488_ADIOD-vPE 0": { + "action": "None", + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "2017-488_ADIOD-vPE 0", + "isMissingData": false, + "trackById": "stigekyxrqi", + "vfModules": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0": { + "2017488_adiodvpe0..2017488AdiodVpe..ADIOD_base_vPE_BV..module-0gytfi": { + "isMissingData": false, + "sdncPreReload": null, + "modelInfo": { + "modelType": "VFmodule", + "modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091", + "modelVersionId": "f8360508-3f17-4414-a2ed-6bc71161e8db", + "modelName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0", + "modelVersion": "5", + "modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3", + "modelCustomizationName": "2017488AdiodVpe..ADIOD_base_vPE_BV..module-0" + }, + "instanceParams": [{}], + "trackById": "3oj23o7nupo" + } + } + }, + "vnfStoreKey": "2017-488_ADIOD-vPE 0", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "lineOfBusiness": "ONAP", + "platformName": "xxx1", + "modelInfo": { + "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "modelVersionId": "69e09f68-8b63-4cc9-b9ff-860960b5db09", + "modelName": "2017-488_ADIOD-vPE", + "modelVersion": "5.0", + "modelCustomizationName": "2017-488_ADIOD-vPE 0", + "modelCustomizationId": "1da7b585-5e61-4993-b95e-8e6606c81e45", + "uuid": "69e09f68-8b63-4cc9-b9ff-860960b5db09" + }, + "legacyRegion": "11111111", + "instanceParams": [{}] + }, + "2017-388_ADIOD-vPE 0": { + "action": "Create", + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "2017-388_ADIOD-vPE 0", + "isMissingData": false, + "trackById": "nib719t5vca", + "vfModules": {}, + "vnfStoreKey": "2017-388_ADIOD-vPE 0", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "legacyRegion": "11111", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "platformName": "platform", + "lineOfBusiness": "zzz1", + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "modelVersionId": "afacccf6-397d-45d6-b5ae-94c39734b168", + "modelName": "2017-388_ADIOD-vPE", + "modelVersion": "4.0", + "modelCustomizationId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", + "modelCustomizationName": "2017-388_ADIOD-vPE 0", + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168" + }, + "uuid": "afacccf6-397d-45d6-b5ae-94c39734b168" + }, + "2017-388_ADIOD-vPE 1": { + "action": "None", + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "2017-388_ADIOD-vPE 1", + "isMissingData": false, + "trackById": "cv7l1ak8vpe", + "vfModules": {}, + "vnfStoreKey": "2017-388_ADIOD-vPE 1", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "legacyRegion": "123", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "platformName": "platform", + "lineOfBusiness": "ONAP", + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "modelVersionId": "0903e1c0-8e03-4936-b5c2-260653b96413", + "modelName": "2017-388_ADIOD-vPE", + "modelVersion": "1.0", + "modelCustomizationId": "280dec31-f16d-488b-9668-4aae55d6648a", + "modelCustomizationName": "2017-388_ADIOD-vPE 1", + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413" + }, + "uuid": "0903e1c0-8e03-4936-b5c2-260653b96413" + } + }, + "instanceParams": [{}], + "validationCounter": 0, + "existingNames": {"yoav": ""}, + "existingVNFCounterMap": { + "69e09f68-8b63-4cc9-b9ff-860960b5db09": 1, + "afacccf6-397d-45d6-b5ae-94c39734b168": 1, + "0903e1c0-8e03-4936-b5c2-260653b96413": 1 + }, + "existingVnfGroupCounterMap": { + "daeb6568-cef8-417f-9075-ed259ce59f48": 0, + "c2b300e6-45de-4e5e-abda-3032bee2de56": -1 + }, + "existingNetworksCounterMap": {"ddc3f20c-08b5-40fd-af72-c6d14636b986": 1}, + "networks": { + "ExtVL 0": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "ExtVL 0", + "isMissingData": false, + "trackById": "s6okajvv2n8", + "networkStoreKey": "ExtVL 0", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "legacyRegion": "12355555", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "platformName": "platform", + "lineOfBusiness": null, + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "379f816b-a7aa-422f-be30-17114ff50b7c", + "modelVersionId": "ddc3f20c-08b5-40fd-af72-c6d14636b986", + "modelName": "ExtVL", + "modelVersion": "37.0", + "modelCustomizationId": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "modelCustomizationName": "ExtVL 0", + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + }, + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986" + } + }, + "vnfGroups": { + "groupingservicefortest..ResourceInstanceGroup..0": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "groupingservicefortest..ResourceInstanceGroup..0", + "isMissingData": false, + "trackById": "se0obn93qq", + "vnfGroupStoreKey": "groupingservicefortest..ResourceInstanceGroup..0", + "instanceName": "groupingservicefortestResourceInstanceGroup0", + "instanceParams": [{}], + "modelInfo": { + "modelInvariantId": "4bb2e27e-ddab-4790-9c6d-1f731bc14a45", + "modelVersionId": "daeb6568-cef8-417f-9075-ed259ce59f48", + "modelName": "groupingservicefortest..ResourceInstanceGroup..0", + "modelVersion": "1", + "modelCustomizationName": "groupingservicefortest..ResourceInstanceGroup..0", + "uuid": "daeb6568-cef8-417f-9075-ed259ce59f48" + }, + "uuid": "daeb6568-cef8-417f-9075-ed259ce59f48" + } + }, + "instanceName": "yoav", + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "productFamilyId": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "lcpCloudRegionId": "JANET25", + "tenantId": "092eb9e8e4b7412e8787dd091bc58e86", + "aicZoneId": "ATL53", + "pause": null, + "projectName": "WATKINS", + "rollbackOnFailure": "true", + "bulkSize": 1, + "aicZoneName": "AAIATLTE-ATL53", + "owningEntityName": "WayneHolland", + "testApi": "VNF_API", + "isEcompGeneratedNaming": false, + "tenantName": "USP-SIP-IC-24335-T-01", + "modelInfo": { + "modelInvariantId": "cdb90b57-ed78-4d44-a5b4-7f43a02ec632", + "modelVersionId": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", + "modelName": "action-data", + "modelVersion": "1.0", + "uuid": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd" + }, + "isALaCarte": false, + "name": "action-data", + "version": "1.0", + "description": "ADIOD vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM", + "category": "Network L1-3", + "uuid": "1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd", + "invariantUuid": "cdb90b57-ed78-4d44-a5b4-7f43a02ec632", + "serviceType": "pnf", + "serviceRole": "Testing", + "vidNotions": {"instantiationUI": "legacy", "modelCategory": "other", "viewEditUI": "legacy"}, + "isMultiStepDesign": true + } + }, + "lcpRegionsAndTenants": { + "lcpRegionList": [{ + "id": "JANET25", + "name": "JANET25 (AIC)", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, {"id": "hvf6", "name": "hvf6 (AIC)", "isPermitted": true, "cloudOwner": "irma-aic"}], + "lcpRegionsTenantsMap": { + "JANET25": [{ + "id": "092eb9e8e4b7412e8787dd091bc58e86", + "name": "USP-SIP-IC-24335-T-01", + "isPermitted": true, + "cloudOwner": "irma-aic" + }], + "hvf6": [{ + "id": "bae71557c5bb4d5aac6743a4e5f1d054", + "name": "AIN Web Tool-15-D-testalexandria", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "229bcdc6eaeb4ca59d55221141d01f8e", + "name": "AIN Web Tool-15-D-STTest2", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "1178612d2b394be4834ad77f567c0af2", + "name": "AIN Web Tool-15-D-SSPtestcustome", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "19c5ade915eb461e8af52fb2fd8cd1f2", + "name": "AIN Web Tool-15-D-UncheckedEcopm", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "de007636e25249238447264a988a927b", + "name": "AIN Web Tool-15-D-dfsdf", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "62f29b3613634ca6a3065cbe0e020c44", + "name": "AIN/SMS-16-D-Multiservices1", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "649289e30d3244e0b48098114d63c2aa", + "name": "AIN Web Tool-15-D-SSPST66", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "3f21eeea6c2c486bba31dab816c05a32", + "name": "AIN Web Tool-15-D-ASSPST47", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "f60ce21d3ee6427586cff0d22b03b773", + "name": "CESAR-100-D-sspjg67246", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "8774659e425f479895ae091bb5d46560", + "name": "CESAR-100-D-sspjg68359", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "624eb554b0d147c19ff8885341760481", + "name": "AINWebTool-15-D-iftach", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "214f55f5fc414c678059c383b03e4962", + "name": "CESAR-100-D-sspjg612401", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "c90666c291664841bb98e4d981ff1db5", + "name": "CESAR-100-D-sspjg621340", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "ce5b6bc5c7b348e1bf4b91ac9a174278", + "name": "sspjg621351cloned", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "b386b768a3f24c8e953abbe0b3488c02", + "name": "AINWebTool-15-D-eteancomp", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "dc6c4dbfd225474e9deaadd34968646c", + "name": "AINWebTool-15-T-SPFET", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "02cb5030e9914aa4be120bd9ed1e19eb", + "name": "AINWebTool-15-X-eeweww", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "f2f3830e4c984d45bcd00e1a04158a79", + "name": "CESAR-100-D-spjg61909", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "05b91bd5137f4929878edd965755c06d", + "name": "CESAR-100-D-sspjg621512cloned", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "7002fbe8482d4a989ddf445b1ce336e0", + "name": "AINWebTool-15-X-vdr", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "4008522be43741dcb1f5422022a2aa0b", + "name": "AINWebTool-15-D-ssasa", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "f44e2e96a1b6476abfda2fa407b00169", + "name": "AINWebTool-15-D-PFNPT", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "b69a52bec8a84669a37a1e8b72708be7", + "name": "AINWebTool-15-X-vdre", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "fac7d9fd56154caeb9332202dcf2969f", + "name": "AINWebTool-15-X-NONPODECOMP", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "2d34d8396e194eb49969fd61ffbff961", + "name": "DN5242-Nov16-T5", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "cb42a77ff45b48a8b8deb83bb64acc74", + "name": "ro-T11", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "fa45ca53c80b492fa8be5477cd84fc2b", + "name": "ro-T112", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "4914ab0ab3a743e58f0eefdacc1dde77", + "name": "DN5242-Nov21-T1", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "d0a3e3f2964542259d155a81c41aadc3", + "name": "test-hvf6-09", + "isPermitted": true, + "cloudOwner": "irma-aic" + }, { + "id": "cbb99fe4ada84631b7baf046b6fd2044", + "name": "DN5242-Nov16-T3", + "isPermitted": true, + "cloudOwner": "irma-aic" + }] + } + }, + "subscribers": [{ + "id": "ERICA5779-Subscriber-2", + "name": "ERICA5779-Subscriber-2", + "isPermitted": false + }, { + "id": "ERICA5779-Subscriber-3", + "name": "ERICA5779-Subscriber-3", + "isPermitted": false + }, { + "id": "ERICA5779-Subscriber-4", + "name": "ERICA5779-Subscriber-5", + "isPermitted": false + }, { + "id": "ERICA5779-TestSub-PWT-101", + "name": "ERICA5779-TestSub-PWT-101", + "isPermitted": false + }, { + "id": "ERICA5779-TestSub-PWT-102", + "name": "ERICA5779-TestSub-PWT-102", + "isPermitted": false + }, { + "id": "ERICA5779-TestSub-PWT-103", + "name": "ERICA5779-TestSub-PWT-103", + "isPermitted": false + }, { + "id": "31739f3e-526b-11e6-beb8-9e71128cae77", + "name": "CRAIG/ROBERTS", + "isPermitted": false + }, {"id": "DHV1707-TestSubscriber-2", "name": "DALE BRIDGES", "isPermitted": false}, { + "id": "jimmy-example", + "name": "JimmyExampleCust-20161102", + "isPermitted": false + }, {"id": "jimmy-example2", "name": "JimmyExampleCust-20161103", "isPermitted": false}, { + "id": "CAR_2020_ER", + "name": "CAR_2020_ER", + "isPermitted": true + }, { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": false + }, { + "id": "21014aa2-526b-11e6-beb8-9e71128cae77", + "name": "JULIO ERICKSON", + "isPermitted": false + }, { + "id": "DHV1707-TestSubscriber-1", + "name": "LLOYD BRIDGES", + "isPermitted": false + }, {"id": "e433710f-9217-458d-a79d-1c7aff376d89", "name": "SILVIA ROBBINS", "isPermitted": true}], + "productFamilies": null, + "serviceTypes": { + "e433710f-9217-458d-a79d-1c7aff376d89": [{ + "id": "17", + "name": "JOHANNA_SANTOS", + "isPermitted": false + }, {"id": "16", "name": "LINDSEY", "isPermitted": false}, { + "id": "2", + "name": "Emanuel", + "isPermitted": false + }, {"id": "5", "name": "Kennedy", "isPermitted": false}, { + "id": "14", + "name": "SSD", + "isPermitted": false + }, {"id": "1", "name": "TYLER SILVIA", "isPermitted": true}, { + "id": "12", + "name": "VPMS", + "isPermitted": false + }, {"id": "3", "name": "vJamie", "isPermitted": false}, { + "id": "0", + "name": "vRichardson", + "isPermitted": false + }, {"id": "18", "name": "vCarroll", "isPermitted": false}, { + "id": "9", + "name": "vMME", + "isPermitted": false + }, {"id": "13", "name": "vMMSC", "isPermitted": false}, { + "id": "10", + "name": "vMNS", + "isPermitted": false + }, {"id": "15", "name": "vMOG", "isPermitted": false}, { + "id": "8", + "name": "vOTA", + "isPermitted": false + }, {"id": "11", "name": "vSCP", "isPermitted": false}, { + "id": "6", + "name": "vSEGW", + "isPermitted": false + }, {"id": "7", "name": "vVM", "isPermitted": false}, {"id": "4", "name": "vVoiceMail", "isPermitted": false}] + }, + "aicZones": [{"id": "ATL53", "name": "AAIATLTE-ATL53"}, {"id": "ABC15", "name": "AAITESAN-ABC15"}, { + "id": "TES36", + "name": "ABCEETES-TES36" + }, {"id": "ATL54", "name": "AICFTAAI-ATL54"}, {"id": "ATL43", "name": "AICLOCID-ATL43"}, { + "id": "AMD15", + "name": "AMDFAA01-AMD15" + }, {"id": "AMF11", "name": "AMDOCS01-AMF11"}, {"id": "RCT1", "name": "AMSTERNL-RCT1"}, { + "id": "AMS1", + "name": "AMSTNLBW-AMS1" + }, {"id": "HJH1", "name": "AOEEQQQD-HJH1"}, {"id": "HJE1", "name": "AOEEWWWD-HJE1"}, { + "id": "MCS1", + "name": "ASACMAMS-MCS1" + }, {"id": "AUG1", "name": "ASDFGHJK-AUG1"}, {"id": "LUC1", "name": "ATLDFGYC-LUC1"}, { + "id": "ATL1", + "name": "ATLNGAMA-ATL1" + }, {"id": "ATL2", "name": "ATLNGANW-ATL2"}, {"id": "HPO1", "name": "ATLNGAUP-HPO1"}, { + "id": "ANI1", + "name": "ATLNGTRE-ANI1" + }, {"id": "ATL44", "name": "ATLSANAB-ATL44"}, {"id": "ATL56", "name": "ATLSANAC-ATL56"}, { + "id": "ABC11", + "name": "ATLSANAI-ABC11" + }, {"id": "ATL34", "name": "ATLSANAI-ATL34"}, {"id": "ATL63", "name": "ATLSANEW-ATL63"}, { + "id": "ABC12", + "name": "ATLSECIA-ABC12" + }, {"id": "AMD18", "name": "AUDIMA01-AMD18"}, {"id": "AVT1", "name": "AVTRFLHD-AVT1"}, { + "id": "KIT1", + "name": "BHYJFGLN-KIT1" + }, {"id": "BHY17", "name": "BHYTFRF3-BHY17"}, {"id": "RTW5", "name": "BHYTFRY4-RTW5"}, { + "id": "RTZ4", + "name": "BHYTFRZ6-RTZ4" + }, {"id": "RTD2", "name": "BHYTFRk4-RTD2"}, {"id": "BNA1", "name": "BNARAGBK-BNA1"}, { + "id": "VEL1", + "name": "BNMLKUIK-VEL1" + }, {"id": "BOT1", "name": "BOTHWAKY-BOT1"}, {"id": "CAL33", "name": "CALIFORN-CAL33"}, { + "id": "ATL84", + "name": "CANTTCOC-ATL84" + }, {"id": "HSD1", "name": "CHASKCDS-HSD1"}, {"id": "CHI1", "name": "CHILLIWE-CHI1"}, { + "id": "XCP12", + "name": "CHKGH123-XCP12" + }, {"id": "JNL1", "name": "CJALSDAC-JNL1"}, {"id": "KJN1", "name": "CKALDKSA-KJN1"}, { + "id": "CLG1", + "name": "CLGRABAD-CLG1" + }, {"id": "CKL1", "name": "CLKSKCKK-CKL1"}, {"id": "ATL66", "name": "CLLIAAII-ATL66"}, { + "id": "CQK1", + "name": "CQKSCAKK-CQK1" + }, {"id": "CWY1", "name": "CWYMOWBS-CWY1"}, {"id": "DKJ1", "name": "DKJSJDKA-DKJ1"}, { + "id": "DSF45", + "name": "DSFBG123-DSF45" + }, {"id": "DSL12", "name": "DSLFK242-DSL12"}, {"id": "FDE55", "name": "FDERT555-FDE55"}, { + "id": "VEN2", + "name": "FGHJUHIL-VEN2" + }, {"id": "ATL64", "name": "FORLOAAJ-ATL64"}, {"id": "GNV1", "name": "GNVLSCTL-GNV1"}, { + "id": "SAN22", + "name": "GNVLSCTL-SAN22" + }, {"id": "KAP1", "name": "HIOUYTRQ-KAP1"}, {"id": "LIS1", "name": "HOSTPROF-LIS1"}, { + "id": "HRG1", + "name": "HRGHRGGS-HRG1" + }, {"id": "HST25", "name": "HSTNTX01-HST25"}, {"id": "STN27", "name": "HSTNTX01-STN27"}, { + "id": "HST70", + "name": "HSTNTX70-HST70" + }, {"id": "KOR1", "name": "HYFLNBVT-KOR1"}, {"id": "RAD10", "name": "INDIPUNE-RAD10"}, { + "id": "REL1", + "name": "INGERFGT-REL1" + }, {"id": "JAD1", "name": "JADECLLI-JAD1"}, {"id": "HKA1", "name": "JAKHLASS-HKA1"}, { + "id": "JCS1", + "name": "JCSJSCJS-JCS1" + }, {"id": "JCV1", "name": "JCVLFLBW-JCV1"}, {"id": "KGM2", "name": "KGMTNC20-KGM2"}, { + "id": "KJF12", + "name": "KJFDH123-KJF12" + }, {"id": "JGS1", "name": "KSJKKKKK-JGS1"}, {"id": "LAG1", "name": "LARGIZON-LAG1"}, { + "id": "LAG1a", + "name": "LARGIZON-LAG1a" + }, {"id": "LAG45", "name": "LARGIZON-LAG1a"}, {"id": "LAG1b", "name": "LARGIZON-LAG1b"}, { + "id": "WAN1", + "name": "LEIWANGW-WAN1" + }, {"id": "DSA1", "name": "LKJHGFDS-DSA1"}, {"id": "LON1", "name": "LONEENCO-LON1"}, { + "id": "SITE", + "name": "LONEENCO-SITE" + }, {"id": "ZXL1", "name": "LWLWCANN-ZXL1"}, {"id": "MTN20", "name": "MDTWNJ21-MTN20"}, { + "id": "MTN32", + "name": "MDTWNJ21-MTN32" + }, {"id": "AMD13", "name": "MEMATLAN-AMD13"}, {"id": "MIC54", "name": "MICHIGAN-MIC54"}, { + "id": "MAR1", + "name": "MNBVCXZM-MAR1" + }, {"id": "NCA1", "name": "NCANCANN-NCA1"}, {"id": "NFT1", "name": "NFTJSSSS-NFT1"}, { + "id": "GAR1", + "name": "NGFVSJKO-GAR1" + }, {"id": "NYC1", "name": "NYCMNY54-NYC1"}, {"id": "OKC1", "name": "OKCBOK55-OKC1"}, { + "id": "OLG1", + "name": "OLHOLHOL-OLG1" + }, {"id": "OLK1", "name": "OLKOLKLS-OLK1"}, {"id": "NIR1", "name": "ORFLMANA-NIR1"}, { + "id": "JAN1", + "name": "ORFLMATT-JAN1" + }, {"id": "ORL1", "name": "ORLDFLMA-ORL1"}, {"id": "PAR1", "name": "PARSFRCG-PAR1"}, { + "id": "PBL1", + "name": "PBLAPBAI-PBL1" + }, {"id": "mac10", "name": "PKGTESTF-mac10"}, {"id": "mac20", "name": "PKGTESTF-mac20"}, { + "id": "TIR2", + "name": "PLKINHYI-TIR2" + }, {"id": "IBB1", "name": "PLMKOIJU-IBB1"}, {"id": "COM1", "name": "PLMKOPIU-COM1"}, { + "id": "POI1", + "name": "PLMNJKIU-POI1" + }, {"id": "PLT1", "name": "PLTNCA60-PLT1"}, {"id": "POI22", "name": "POIUY123-POI22"}, { + "id": "DCC1", + "name": "POIUYTGH-DCC1" + }, {"id": "DCC1a", "name": "POIUYTGH-DCC1a"}, {"id": "DCC1b", "name": "POIUYTGH-DCC1b"}, { + "id": "DCC2", + "name": "POIUYTGH-DCC2" + }, {"id": "DCC3", "name": "POIUYTGH-DCC3"}, {"id": "IAA1", "name": "QAZXSWED-IAA1"}, { + "id": "QWE1", + "name": "QWECLLI1-QWE1" + }, {"id": "NUM1", "name": "QWERTYUI-NUM1"}, {"id": "RAD1", "name": "RADICAL1-RAD1"}, { + "id": "RJN1", + "name": "RJNRBZAW-RJN1" + }, {"id": "SAA13", "name": "SAIT1AA9-SAA13"}, {"id": "SAA14", "name": "SAIT1AA9-SAA14"}, { + "id": "SDD81", + "name": "SAIT1DD6-SDD81" + }, {"id": "SDD82", "name": "SAIT1DD9-SDD82"}, {"id": "SAA11", "name": "SAIT9AA2-SAA11"}, { + "id": "SAA80", + "name": "SAIT9AA3-SAA80" + }, {"id": "SAA12", "name": "SAIT9AF8-SAA12"}, {"id": "SCC80", "name": "SAIT9CC3-SCC80"}, { + "id": "ATL75", + "name": "SANAAIRE-ATL75" + }, {"id": "ICC1", "name": "SANJITAT-ICC1"}, {"id": "SCK1", "name": "SCKSCKSK-SCK1"}, { + "id": "EHH78", + "name": "SDCSHHH5-EHH78" + }, {"id": "SAA78", "name": "SDCTAAA1-SAA78"}, {"id": "SAX78", "name": "SDCTAXG1-SAX78"}, { + "id": "SBX78", + "name": "SDCTBXG1-SBX78" + }, {"id": "SEE78", "name": "SDCTEEE4-SEE78"}, {"id": "SGG78", "name": "SDCTGGG1-SGG78"}, { + "id": "SXB78", + "name": "SDCTGXB1-SXB78" + }, {"id": "SJJ78", "name": "SDCTJJJ1-SJJ78"}, {"id": "SKK78", "name": "SDCTKKK1-SKK78"}, { + "id": "SLF78", + "name": "SDCTLFN1-SLF78" + }, {"id": "SLL78", "name": "SDCTLLL1-SLL78"}, {"id": "MAD11", "name": "SDFQWGKL-MAD11"}, { + "id": "HGD1", + "name": "SDFQWHGD-HGD1" + }, {"id": "SBB78", "name": "SDIT1BBB-SBB78"}, {"id": "SDG78", "name": "SDIT1BDG-SDG78"}, { + "id": "SBU78", + "name": "SDIT1BUB-SBU78" + }, {"id": "SHH78", "name": "SDIT1HHH-SHH78"}, {"id": "SJU78", "name": "SDIT1JUB-SJU78"}, { + "id": "SNA1", + "name": "SNANTXCA-SNA1" + }, {"id": "SAM1", "name": "SNDGCA64-SAN1"}, {"id": "SNG1", "name": "SNGPSIAU-SNG1"}, { + "id": "SSA56", + "name": "SSIT2AA7-SSA56" + }, {"id": "STG1", "name": "STTGGE62-STG1"}, {"id": "STT1", "name": "STTLWA02-STT1"}, { + "id": "SYD1", + "name": "SYDNAUBV-SYD1" + }, {"id": "ATL99", "name": "TEESTAAI-ATL43"}, {"id": "ATL98", "name": "TEESTAAI-ATL43"}, { + "id": "ATL76", + "name": "TELEPAAI-ATL76" + }, {"id": "ABC14", "name": "TESAAISA-ABC14"}, {"id": "TAT33", "name": "TESAAISA-TAT33"}, { + "id": "TAT34", + "name": "TESAAISB-TAT34" + }, {"id": "TAT37", "name": "TESAAISD-TAT37"}, {"id": "ATL62", "name": "TESSASCH-ATL62"}, { + "id": "TLP1", + "name": "TLPNXM18-TLP1" + }, {"id": "SAN13", "name": "TOKYJPFA-SAN13"}, {"id": "TOK1", "name": "TOKYJPFA-TOK1"}, { + "id": "TOL1", + "name": "TOLDOH21-TOL1" + }, {"id": "TOR1", "name": "TOROONXN-TOR1"}, {"id": "TOY1", "name": "TORYONNZ-TOY1"}, { + "id": "ATL35", + "name": "TTESSAAI-ATL35" + }, {"id": "TUF1", "name": "TUFCLLI1-TUF1"}, {"id": "SAI1", "name": "UBEKQLPD-SAI1"}, { + "id": "UUU4", + "name": "UUUAAAUU-UUU4" + }, {"id": "YYY1", "name": "UUUAIAAI-YYY1"}, {"id": "BAN1", "name": "VSDKYUTP-BAN1"}, { + "id": "WAS1", + "name": "WASHDCSW-WAS1" + }, {"id": "APP1", "name": "WBHGTYUI-APP1"}, {"id": "SUL2", "name": "WERTYUJK-SUL2"}, { + "id": "DEF2", + "name": "WSBHGTYL-DEF2" + }, {"id": "DHA12", "name": "WSXEDECF-DHA12"}, {"id": "MNT11", "name": "WSXEFBTH-MNT11"}, { + "id": "RAJ1", + "name": "YGBIJNLQ-RAJ1" + }, {"id": "JAG1", "name": "YUDFJULP-JAG1"}, {"id": "ZEN1", "name": "ZENCLLI1-ZEN1"}, { + "id": "ZOG1", + "name": "ZOGASTRO-ZOG1" + }, {"id": "SDE1", "name": "ZXCVBNMA-SDE1"}, {"id": "SIP1", "name": "ZXCVBNMK-SIP1"}, { + "id": "JUL1", + "name": "ZXCVBNMM-JUL1" + }, {"id": "ERT1", "name": "ertclli1-ERT1"}, {"id": "IOP1", "name": "iopclli1-IOP1"}, { + "id": "OPA1", + "name": "opaclli1-OPA1" + }, {"id": "RAI1", "name": "poiuytre-RAI1"}, {"id": "PUR1", "name": "purelyde-PUR1"}, { + "id": "RTY1", + "name": "rtyclli1-RTY1" + }, {"id": "SDF1", "name": "sdfclli1-SDF1"}, {"id": "SSW56", "name": "ss8126GT-SSW56"}, { + "id": "UIO1", + "name": "uioclli1-UIO1" + }], + "categoryParameters": { + "owningEntityList": [{ + "id": "aaa1", + "name": "aaa1" + }, {"id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", "name": "WayneHolland"}, { + "id": "Melissa", + "name": "Melissa" + }], + "projectList": [{"id": "WATKINS", "name": "WATKINS"}, {"id": "x1", "name": "x1"}, {"id": "yyy1", "name": "yyy1"}], + "lineOfBusinessList": [{"id": "ONAP", "name": "ONAP"}, {"id": "zzz1", "name": "zzz1"}], + "platformList": [{"id": "platform", "name": "platform"}, {"id": "xxx1", "name": "xxx1"}] + }, + "type": "UPDATE_LCP_REGIONS_AND_TENANTS" + } + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts new file mode 100644 index 000000000..5a023d55c --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts @@ -0,0 +1,278 @@ +import {Injectable} from "@angular/core"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../shared/store/reducers"; +import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; +import {MessageBoxData} from "../../../shared/components/messageBox/messageBox.data"; +import {MessageBoxService} from "../../../shared/components/messageBox/messageBox.service"; +import * as _ from "lodash"; +import {DrawingBoardModes} from "../drawing-board.modes"; +import {AuditInfoModalComponent} from "../../../shared/components/auditInfoModal/auditInfoModal.component"; +import {VnfModelInfo} from "./models/vnf/vnf.model.info"; +import {ILevelNodeInfo} from "./models/basic.model.info"; + +@Injectable() +export class SharedTreeService { + private _sharedTreeService: SharedTreeService; + constructor(private _store: NgRedux<AppState>) { + } + + /*********************************************************** + * return if instance has missing data + * @param instance - vnf instance + * @param dynamicInputs - from the instance + * @param isEcompGeneratedNaming + ************************************************************/ + selectedVNF: string = null; + + + getSelectedVNF(): string { + return this.selectedVNF; + } + + setSelectedVNF(node): void { + if (_.isNil(node) || node.data.type !== 'VF') { + this.selectedVNF = null; + } else { + this.selectedVNF = node.data.vnfStoreKey; + } + } + + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean, requiredFields: string[]): boolean { + if (!isEcompGeneratedNaming && _.isEmpty(instance.instanceName)) { + return true; + } + + for (let field of requiredFields) { + if (_.isEmpty(instance[field])) { + return true; + } + } + + for (let field of dynamicInputs) { + if (field.isRequired && !_.isNil(instance.instanceParams) && _.isEmpty(instance.instanceParams[0][field.id])) { + return true; + } + } + return false; + } + + + addingStatusProperty(node) { + node['statusProperties'] = []; + node['statusProperties'].push({key: 'Prov Status:', value: node.provStatus, testId: 'provStatus'}); + node['statusProperties'].push({key: 'Orch Status:', value: node.orchStatus, testId: 'orchStatus'}); + if (node.inMaint) { + node['statusProperties'].push({key: 'In-maintenance', value: '', testId: 'inMaint'}); + } + return node; + } + + /********************************************** + * should delete or remove child instance's + "new" -> should remove + !new" -> should change action status + **********************************************/ + removeDeleteAllChild(node, serviceModelId: string, callback): void { + for (let nodeChild of node.children) { + if (nodeChild.data.action === ServiceInstanceActions.Create) { + if (!_.isNil(nodeChild.data) && !_.isNil(nodeChild.data.menuActions) && !_.isNil(nodeChild.data.menuActions['remove'])) { + nodeChild.data.menuActions['remove']['method'](nodeChild, serviceModelId); + } + } else { + if (!_.isNil(nodeChild.data) && !_.isNil(nodeChild.data.menuActions) && !_.isNil(nodeChild.data.menuActions['delete'])) { + nodeChild.data.menuActions['delete']['method'](nodeChild, serviceModelId); + } + } + } + callback(node, serviceModelId); + } + + + /********************************************** + * should undo delete child instance's + **********************************************/ + undoDeleteAllChild(node, serviceModelId: string, callback): void { + for (let nodeChild of node.children) { + if (!_.isNil(nodeChild.data) && !_.isNil(nodeChild.data.menuActions) && !_.isNil(nodeChild.data.menuActions['undoDelete'])) { + nodeChild.data.menuActions['undoDelete']['method'](nodeChild, serviceModelId); + } + } + callback(node, serviceModelId); + } + + /********************************************** + * should return true if can delete + **********************************************/ + shouldShowDelete(node): boolean { + const mode = this._store.getState().global.drawingBoardStatus; + if (!_.isNil(node) && !_.isNil(node.data) && !_.isNil(node.data.action) && !_.isNil(node.data.menuActions['delete'])) { + if (mode !== DrawingBoardModes.EDIT || node.data.action === ServiceInstanceActions.Create) { + return false; + } else if (node.data.action === ServiceInstanceActions.None) { + return true + } + return false; + } + return false; + } + + /********************************************** + * should return true if can undo delete + **********************************************/ + shouldShowUndoDelete(node): boolean { + const mode = this._store.getState().global.drawingBoardStatus; + if (mode === DrawingBoardModes.EDIT && !_.isNil(node.data.action) && !_.isNil(node.data.menuActions['undoDelete'])) { + if (node.data.action === ServiceInstanceActions.Create || node.data.action === ServiceInstanceActions.Delete) { + return false; + } else if (node.data.action.split('_').pop() === 'Delete') { + return true + } + return false; + } + return false; + } + /********************************************** + * should return true if can remove or edit + * enabled only on edit/design mode and for new instances + **********************************************/ + shouldShowRemoveAndEdit(node): boolean { + const mode = this._store.getState().global.drawingBoardStatus; + if (!_.isNil(node) && !_.isNil(node.data) && !_.isNil(node.data.action) && node.data.action === ServiceInstanceActions.Create && + mode !== DrawingBoardModes.VIEW && mode !== DrawingBoardModes.RETRY) { + return true; + } + return false; + } + /********************************************** + * should return true if can duplicate by mode + **********************************************/ + shouldShowDuplicate(node): boolean { + const mode = this._store.getState().global.drawingBoardStatus; + return !mode.includes('RETRY'); + } + + /********************************************** + * should return true if can audit info + **********************************************/ + shouldShowAuditInfo(node): boolean { + return this.isRetryMode() || (!_.isNil(node.data) && !_.isNil(node.data.action) && node.data.action !== ServiceInstanceActions.Create); + } + + + isRetryMode(): boolean { + const mode = this._store.getState().global.drawingBoardStatus; + return mode.includes('RETRY'); + } + + + /********************************************** + * should return true if can add node instances + **********************************************/ + shouldShowAddIcon(): boolean{ + const mode = this._store.getState().global.drawingBoardStatus; + return mode === DrawingBoardModes.EDIT || mode=== DrawingBoardModes.CREATE; + } + /************************************************ + return number of instances with action Delete + @type: vnfs networks, vngGroups (not vfModule) + @node : node model from the left tree + ************************************************/ + getExistingInstancesWithDeleteMode(node, serviceModelId: string, type: string): number { + let counter = 0; + const existingInstances = this._store.getState().service.serviceInstance[serviceModelId][type]; + const modelUniqueId = node.data.modelUniqueId; + if (!_.isNil(existingInstances)) { + for (let instanceKey in existingInstances) { + if (!_.isNil(existingInstances[instanceKey].action)) { + if (existingInstances[instanceKey].modelInfo.modelUniqueId === modelUniqueId && existingInstances[instanceKey].action.split('_').pop() === 'Delete') { + counter++; + } + } + } + } + return counter; + } + + + isServiceOnDeleteMode(serviceId: string): boolean { + return this._store.getState().service.serviceInstance[serviceId].action === ServiceInstanceActions.Delete; + } + + + openModal(node : any | any[] , serviceModelId : string, cb : Function) : void { + let type: string = _.isArray(node) ? 'Service' : node.data.typeName; + let messageBoxData: MessageBoxData = new MessageBoxData( + "Mark for Delete", + `You are about to mark for delete this ${type} this will also mark all its children and remove all new instances just added`, + <any>"warning", + <any>"md", + [ + { + text: "Mark and remove", + size: "large", + callback: cb.bind(this, node, serviceModelId), + closeModal: true + }, + {text: "Don’t Remove", size: "medium", closeModal: true} + ]); + + MessageBoxService.openModal.next(messageBoxData); + } + + someChildHasCreateAction(nodes: any | any[]) : boolean { + let nodesArr = _.isArray(nodes) ? nodes : [nodes]; + for(const node of nodesArr){ + if(node.action === ServiceInstanceActions.Create) {return true;} + if(node.children){ + for (let nodeChild of node.children) { + if (nodeChild.action === ServiceInstanceActions.Create) { + return true; + } + if(nodeChild.children && nodeChild.children.length > 0){ + for(let child of nodeChild.children){ + let hasCreateAction = this.someChildHasCreateAction(child); + if(hasCreateAction) { + return true; + } + } + } + } + } + } + return false; + } + + shouldShowDeleteInstanceWithChildrenModal(node : any | any[] , serviceModelId : string, cb : Function) : void { + if(this.someChildHasCreateAction(node)){ + this.openModal(node , serviceModelId, cb); + }else { + cb(node, serviceModelId) + } + } + + + isFailed(node): boolean { + return !_.isNil(node.data) ? node.data.isFailed : false; + } + + /************************************************ + in a case the node is failed e.g. not instantiated correctly + the function will call to openRetryInstanceAuditInfoModal + @node : node model from the left tree + @serviceModelId : serviceModelId + @instance : instance + @instanceType: instanceType + @modelInfoService : the model (vnf, vfmodule, network, vnfgroup)object that call to the function (this) + ************************************************/ + openAuditInfoModal(node, serviceModelId, instance, instanceType, modelInfoService : ILevelNodeInfo){ + let isInstanceFailed = this.isFailed(node); + AuditInfoModalComponent.openInstanceAuditInfoModal.next({ + instanceId: serviceModelId, + type: instanceType, + model: modelInfoService.getModel(node.data.modelName, instance, this._store.getState().service.serviceHierarchy[serviceModelId]), + instance, + isInstanceFailed, + trackById: instance.trackById + }); + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.html b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.html new file mode 100644 index 000000000..0222b8097 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.html @@ -0,0 +1,8 @@ +<div class="search-container"> + <sdc-filter-bar + [placeHolder]="'Search...'" + [debounceTime]="250" + [testId]="inputTestId" + (valueChange)="searchTree($event)"> + </sdc-filter-bar> +</div> diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.scss new file mode 100644 index 000000000..5d9996256 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.scss @@ -0,0 +1,3 @@ +.search-container { + min-width: 40px; +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.spec.ts new file mode 100644 index 000000000..754dd6690 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.spec.ts @@ -0,0 +1,93 @@ +import {ComponentFixture, TestBed} from '@angular/core/testing'; +import {HttpClientTestingModule} from '@angular/common/http/testing'; +import {CUSTOM_ELEMENTS_SCHEMA} from "@angular/core"; +import {SearchComponent} from "./search.component"; +import {FormsModule, ReactiveFormsModule} from "@angular/forms"; + +describe('Spinner component', () => { + + let component: SearchComponent; + let fixture: ComponentFixture<SearchComponent>; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [FormsModule, ReactiveFormsModule, HttpClientTestingModule], + providers: [], + declarations: [SearchComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] + }); + await TestBed.compileComponents(); + + fixture = TestBed.createComponent(SearchComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + + })().then(done).catch(done.fail)); + + + test('component should be defined', () => { + expect(component).toBeDefined(); + }); + + test('searchTree should return all nodes that include some text: with text', () => { + component.nodes = [ + { + name: 'name_1' + }, + { + name: 'name_2' + }, + { + name: 'name_3' + }, + { + name: 'name_3' + }]; + jest.spyOn(component.updateNodes, 'emit'); + spyOn(component, 'expandParentByNodeId').and.stub(); + component.searchTree('name_1'); + + expect(component.updateNodes.emit).toHaveBeenCalledWith({ + nodes: [ + { + name: 'name_1' + }, + { + name: 'name_2' + }, + { + name: 'name_3' + }, + { + name: 'name_3' + }], + filterValue: 'name_1' + }); + }); + + test('searchTree should return all nodes that include some text: without text', () => { + component.nodes = [ + { + name: 'name_1', + children: [ + { + name: 'name_child_1' + } + ] + }, + { + name: 'name_2' + }, + { + name: 'name_3' + }, + { + name: 'name_4' + }]; + jest.spyOn(component.updateNodes, 'emit'); + spyOn(component, 'expandParentByNodeId').and.stub(); + component.searchTree(''); + + expect(component.updateNodes.emit).toHaveBeenCalled(); + }); +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.ts new file mode 100644 index 000000000..19edbcd09 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/search/search.component.ts @@ -0,0 +1,50 @@ +import {Component, EventEmitter, Input, Output} from "@angular/core"; +import {IDType, ITreeNode} from "angular-tree-component/dist/defs/api"; +import * as _ from 'lodash'; + +@Component({ + selector: 'search-component', + templateUrl: './search.component.html', + styleUrls: ['./search.component.scss'] +}) +export class SearchComponent { + @Input() tree; + @Input() nodes; + @Input() inputTestId: string; + + @Output() updateNodes: EventEmitter<any> = new EventEmitter(); + + searchTree(searchText: string): void { + if(_.isNil(searchText)){ + return; + } + let __this = this; + let results: ITreeNode[] = []; + this.nodes.forEach( (node) => { + __this.searchTreeNode(node, searchText, results); + }); + results.forEach(function (result) { + __this.expandParentByNodeId(result.id) + }); + this.updateNodes.emit({ + nodes: this.nodes, + filterValue: searchText + }); + return; + } + + expandParentByNodeId(id: IDType): void { + this.tree.treeModel.getNodeById(id).parent.expand(); + } + + searchTreeNode(node, searchText: string, results): void { + if (node.name.toLowerCase().indexOf(searchText.toLowerCase()) != -1) { + results.push(node); + } + if (node.children != null) { + for (let i = 0; i < node.children.length; i++) { + this.searchTreeNode(node.children[i], searchText, results); + } + } + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.html b/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.html index 5b2f22d5f..059937f6d 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.html +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.html @@ -1,13 +1,13 @@ -<div class="service-planning-header"> - <drawing-board-header></drawing-board-header> -</div> -<div class="service-planning-content row"> - <available-models-tree class="left-side col-md-6" (highlightInstances)="highlightInstancesBySelectingNode($event)"></available-models-tree> - <!--<no-content-message-and-icon *ngIf="!isShowTree()" class="span-over"--> - <!--data-title="Please add objects (VNFs, network, modules etc.) from the left tree to design the service instance"--> - <!--subtitle="Once done, click Deploy to start instantiation"--> - <!--iconPath="./img/UPLOAD.svg"--> - <!--iconClass="upload-icon-service-planing"></no-content-message-and-icon>--> - <drawing-board-tree *ngIf="isShowTree()" class="span-over col-md-6" (highlightNode)="highlightNodeBySelectingInstance($event)"></drawing-board-tree> +<div [attr.id]="pageMode" clickOutside [classElements]="['angular-tree-component']" (clickOutsideTrigger)="clickOutside();"> + <div class="service-planning-header" > + <drawing-board-header></drawing-board-header> + </div> + <div class="service-planning-content"> + <available-models-tree class="left-side" [ngClass]="isShowComponentInfo() ?'col-md-5':'col-md-6'" + (highlightInstances)="highlightInstancesBySelectingNode($event)"></available-models-tree> + <drawing-board-tree *ngIf="isShowTree()" class="span-over" [ngClass]="isShowComponentInfo() ?'col-md-5':'col-md-6'" (highlightNode)="highlightNodeBySelectingInstance($event)"></drawing-board-tree> + <component-info *ngIf="isShowComponentInfo()" class="col-md-2"></component-info> + </div> + </div> diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.scss index 69546a6c0..641af7acb 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.scss +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.scss @@ -2,6 +2,8 @@ .service-planning-content { display: flex; flex: 1; + position: relative; + z-index: 0; } .span-over { @@ -14,3 +16,13 @@ height: 117px; margin-top: 32px; } + +component-info { + border-left: 1px solid #D2D2D2; + height: calc(100vh - 60px); + overflow: auto; + + &.col-md-2{ + padding: 0; + } +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.ts index 1ce0e8100..cbe8445ca 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/service-planning.component.ts @@ -1,8 +1,17 @@ -import {Component, ViewChild} from '@angular/core'; -import {DrawingBoardTreeComponent} from "../drawing-board-tree/drawing-board-tree.component"; -import {AvailableModelsTreeComponent} from "../available-models-tree/available-models-tree.component"; +import {Component, OnInit, ViewChild} from '@angular/core'; +import {DrawingBoardTreeComponent} from "./drawing-board-tree/drawing-board-tree.component"; +import {AvailableModelsTreeComponent} from "./available-models-tree/available-models-tree.component"; import {ITreeNode} from "angular-tree-component/dist/defs/api"; import {TreeComponent} from 'angular-tree-component'; +import {ActivatedRoute} from "@angular/router"; +import * as _ from 'lodash'; +import {DrawingBoardModes} from "./drawing-board.modes"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../shared/store/reducers"; +import {updateDrawingBoardStatus} from "../../shared/storeUtil/utils/global/global.actions"; +import {FeatureFlagsService, Features} from "../../shared/services/featureFlag/feature-flags.service"; +import {ComponentInfoService} from "./component-info/component-info.service"; +import {ComponentInfoModel, ComponentInfoType} from "./component-info/component-info-model"; @Component({ selector: 'service-planning', @@ -10,8 +19,13 @@ import {TreeComponent} from 'angular-tree-component'; styleUrls: ['./service-planning.component.scss'] }) -export class ServicePlanningComponent { +export class ServicePlanningComponent implements OnInit { + constructor(private route: ActivatedRoute, + private store: NgRedux<AppState>) { + } + + pageMode: DrawingBoardModes = DrawingBoardModes.CREATE; @ViewChild(DrawingBoardTreeComponent) drawingModelTree; @ViewChild(AvailableModelsTreeComponent) availableModelTree; @@ -20,18 +34,23 @@ export class ServicePlanningComponent { } public highlightNodeBySelectingInstance(modelId: number): void { - this.availableModelTree.tree.treeModel.getNodeBy((node: ITreeNode) => node.data.id === modelId) - .setActiveAndVisible().expand(); + // modelId might be undefined, e.g., if selected instance has no source in model + let matchInstance = modelId ? this.availableModelTree.tree.treeModel.getNodeBy((node: ITreeNode) => (node.data.modelUniqueId) === modelId) : undefined; + if (matchInstance) { + matchInstance.setActiveAndVisible().expand(); + } else { + this.clearSelectionInTree(this.availableModelTree.tree); + } } - public highlightInstancesBySelectingNode(id: number): void { - if(this.isShowTree()) { + public highlightInstancesBySelectingNode(uniqueId: string): void { + if (this.isShowTree()) { let _this = this; - let matchInstances = _this.searchTree(id); + let matchInstances = _this.searchTree(uniqueId); if (!matchInstances.length) _this.clearSelectionInTree(_this.drawingModelTree.tree); matchInstances.forEach(function (instance, index) { - let multi : boolean = !!index; + let multi: boolean = !!index; _this.drawingModelTree.tree.treeModel.getNodeById(instance.id) .setActiveAndVisible(multi).expand(); }); @@ -44,34 +63,47 @@ export class ServicePlanningComponent { activateNode ? activateNode.toggleActivated().blur() : null; } - searchTree(modelId: number) { + searchTree(uniqueId: string) { let _this = this; let results = []; let nodes = _this.drawingModelTree.nodes; nodes.forEach(function (node) { - _this.searchTreeNode(node, modelId, results); + _this.searchTreeNode(node, uniqueId, results); }); return results; } - searchTreeNode(node, modelId: number, results): void { - if(node.modelId === modelId){ + searchTreeNode(node, uniqueId: string, results): void { + if ((node.modelUniqueId) === uniqueId) { results.push(node); } - if (node.children != null){ - for(let i = 0; i < node.children.length; i++){ - this.searchTreeNode(node.children[i], modelId, results); + + if (node.children != null) { + for (let i = 0; i < node.children.length; i++) { + this.searchTreeNode(node.children[i], uniqueId, results); } } } + ngOnInit(): void { + this.pageMode = (!_.isNil(this.route.routeConfig.path) && this.route.routeConfig.path !== "") ? this.route.routeConfig.path as DrawingBoardModes : DrawingBoardModes.CREATE; + this.store.dispatch(updateDrawingBoardStatus(this.pageMode)); + } + + isShowComponentInfo():boolean { + return FeatureFlagsService.getFlagState(Features.FLAG_1906_COMPONENT_INFO, this.store) + } + clickOutside(): void{ + this.clearSelectionInTree(this.drawingModelTree.tree); + this.clearSelectionInTree(this.availableModelTree.tree); + ComponentInfoService.triggerComponentInfoChange.next(new ComponentInfoModel(ComponentInfoType.SERVICE, [], [])) + } } export class ServicePlanningEmptyComponent extends ServicePlanningComponent { - isShowTree() : boolean { + isShowTree(): boolean { return false; } } - diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/typeNodeInformation.model.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/typeNodeInformation.model.spec.ts new file mode 100644 index 000000000..a6d3b5398 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/typeNodeInformation.model.spec.ts @@ -0,0 +1,59 @@ +import {TestBed, getTestBed} from '@angular/core/testing'; +import { + HttpClientTestingModule, +} from '@angular/common/http/testing'; +import {TypeNodeInformation} from "./typeNodeInformation.model"; + +describe('Available Models Tree Service', () => { + let injector; + beforeEach(() => { + + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [] + }).compileComponents(); + + injector = getTestBed(); + }); + + + test('TypeNodeInformation VNF', () => { + let type: TypeNodeInformation = new TypeNodeInformation(<any>{ + data: { + type: 'VF' + } + }); + expect(type.hierarchyName).toEqual('vnfs'); + expect(type.existingMappingCounterName).toEqual('existingVNFCounterMap'); + }); + + test('TypeNodeInformation VNF group', () => { + let type: TypeNodeInformation = new TypeNodeInformation(<any>{ + data: { + type: 'VnfGroup' + } + }); + expect(type.hierarchyName).toEqual('vnfGroups'); + expect(type.existingMappingCounterName).toEqual('existingVnfGroupCounterMap'); + }); + + test('TypeNodeInformation VL', () => { + let type: TypeNodeInformation = new TypeNodeInformation(<any>{ + data: { + type: 'VL' + } + }); + expect(type.hierarchyName).toEqual('networks'); + expect(type.existingMappingCounterName).toEqual('existingNetworksCounterMap'); + }); + + test('TypeNodeInformation Network', () => { + let type: TypeNodeInformation = new TypeNodeInformation(<any>{ + data: { + type: 'Network' + } + }); + expect(type.hierarchyName).toEqual('networks'); + expect(type.existingMappingCounterName).toEqual('existingNetworksCounterMap'); + }); +}); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/typeNodeInformation.model.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/typeNodeInformation.model.ts new file mode 100644 index 000000000..e8e22a422 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/typeNodeInformation.model.ts @@ -0,0 +1,39 @@ +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import * as _ from 'lodash'; + +export class TypeNodeInformation { + hierarchyName: string; + existingMappingCounterName: string; + + constructor(node: ITreeNode) { + if (!_.isNil(node)) { + switch (node.data.type) { + case 'VF' : { + this.hierarchyName = 'vnfs'; + this.existingMappingCounterName = 'existingVNFCounterMap'; + break; + } + case 'VnfGroup' : { + this.hierarchyName = 'vnfGroups'; + this.existingMappingCounterName = 'existingVnfGroupCounterMap'; + break; + } + case 'VL' : { + this.hierarchyName = 'networks'; + this.existingMappingCounterName = 'existingNetworksCounterMap'; + break; + } + case 'Network': { + this.hierarchyName = 'networks'; + this.existingMappingCounterName = 'existingNetworksCounterMap'; + break; + } + default : { + console.error("Node type is not recognize"); + } + } + } + } +} + + |