<i class="fas fa-times-circle text-danger"></i>
</button>
</div>
-<form [formGroup]="primitiveForm" (ngSubmit)="execNSPrimitive()">
+<form [formGroup]="primitiveForm" (ngSubmit)="execPrimitive()">
<div class="modal-body">
<div class="form-group row">
<label class="col-sm-4 col-form-label">{{'PRIMITIVETYPE' | translate}}*</label>
<div class="col-sm-8">
- <ng-select (change)="primitiveTypeChange($event)" [clearable]="false"
- placeholder="{{'SELECT' | translate}}" [items]="primitiveTypeList" bindLabel="title"
- bindValue="value" [(ngModel)]="primitiveType" id="primitiveType"
- [ngModelOptions]="{standalone: true}"
+ <ng-select (change)="primitiveTypeChange($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="primitiveTypeList" bindLabel="title" bindValue="value" [(ngModel)]="primitiveType" id="primitiveType" [ngModelOptions]="{standalone: true}"
[ngClass]="{ 'is-invalid': submitted && !primitiveType }"></ng-select>
</div>
</div>
- <div class="form-group row" *ngIf="primitiveType === 'VNF_Primitive' || primitiveType === 'VDU_Primitive'">
+ <div class="form-group row" *ngIf="primitiveType === 'VNF_Primitive' || primitiveType === 'VDU_Primitive' || primitiveType === 'KDU_Primitive'">
<label class="col-sm-4 col-form-label">VNF {{'MEMBERINDEX' | translate}}*</label>
<div class="col-sm-3">
- <ng-select (change)="indexChange($event, primitiveType)" [clearable]="false" placeholder="{{'SELECT' | translate}}"
- [items]="params.memberIndex" bindLabel="member-vnf-index" bindValue="member-vnf-index"
- formControlName="vnf_member_index" id="vnf_member_index"
+ <ng-select (change)="indexChange($event, primitiveType)" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="params.memberIndex" bindLabel="member-vnf-index" bindValue="member-vnf-index" formControlName="vnf_member_index" id="vnf_member_index"
[ngClass]="{ 'is-invalid': submitted && f.vnf_member_index.errors }"></ng-select>
</div>
</div>
<div class="form-group row" *ngIf="primitiveType === 'VDU_Primitive'">
<label class="col-sm-4 col-form-label">{{'SELECT' | translate}} VDU *</label>
<div class="col-sm-8">
- <ng-select (change)="getVDUPrimitive($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}"
- [items]="vduList" bindLabel="name" bindValue="id" formControlName="vdu_id" id="vdu_id"
- [ngClass]="{ 'is-invalid': submitted && f.vdu_id.errors }"></ng-select>
+ <ng-select (change)="getPrimitiveList($event, 'vdu')" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="vduList" bindLabel="name" bindValue="id" formControlName="vdu_id" id="vdu_id" [ngClass]="{ 'is-invalid': submitted && f.vdu_id.errors }"></ng-select>
+ </div>
+ </div>
+ <div class="form-group row" *ngIf="primitiveType === 'KDU_Primitive'">
+ <label class="col-sm-4 col-form-label">{{'SELECT' | translate}} KDU *</label>
+ <div class="col-sm-8">
+ <ng-select (change)="getPrimitiveList($event, 'kdu')" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="kduList" bindLabel="name" bindValue="name" formControlName="kdu_name" id="kdu_name" [ngClass]="{ 'is-invalid': submitted && f.kdu_name.errors }"></ng-select>
</div>
</div>
<div class="form-group row" *ngIf="primitiveType">
<label class="col-sm-4 col-form-label">
{{'PAGE.NSPRIMITIVE.PRIMITIVE' | translate}}*</label>
<div class="col-sm-8">
- <ng-select (change)="primitiveChange($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}"
- [items]="primitiveList" bindLabel="name" bindValue="name" formControlName="primitive" id="primitive"
- [ngClass]="{ 'is-invalid': submitted && f.primitive.errors }"></ng-select>
+ <ng-select (change)="primitiveChange($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="primitiveList" bindLabel="name" bindValue="name" formControlName="primitive" id="primitive" [ngClass]="{ 'is-invalid': submitted && f.primitive.errors }"></ng-select>
</div>
</div>
<ng-container *ngIf="primitiveParameter.length > 0">
<div class="form-group row" [formGroupName]="i">
<label class="col-sm-2 col-form-label">{{'NAME' | translate}}:</label>
<div class="col-sm-3">
- <ng-select placeholder="{{'SELECT' | translate}}" [clearable]="false"
- [items]="primitiveParameter" bindLabel="name" bindValue="name"
- formControlName="primitive_params_name" id="parameter{{i}}"
- [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_name.errors }">
+ <ng-select placeholder="{{'SELECT' | translate}}" [clearable]="false" [items]="primitiveParameter" bindLabel="name" bindValue="name" formControlName="primitive_params_name" id="parameter{{i}}" [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_name.errors }">
</ng-select>
</div>
<div class="col-sm-1"></div>
<label class="col-sm-2 col-form-label">{{'VALUE' | translate}}:</label>
<div class="col-sm-3">
- <input type="text" class="form-control" formControlName="primitive_params_value"
- [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_value.errors }">
+ <input type="text" class="form-control" formControlName="primitive_params_value" [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_value.errors }">
</div>
<div class="col-sm-1" [hidden]="i==0">
- <button type="button" class="btn btn-sm btn-danger remove-mapping"
- (click)="removePrimitiveParams(i)">
+ <button type="button" class="btn btn-sm btn-danger remove-mapping" (click)="removePrimitiveParams(i)">
<i class="fas fa-times-circle"></i>
</button>
</div>
import { APIURLHEADER, ERRORDATA, URLPARAMS } from 'CommonModel';
import { DataService } from 'DataService';
import { environment } from 'environment';
-import { NSData, VDUPRIMITIVELEVEL } from 'NSDModel';
+import { KDUPRIMITIVELEVEL, NSData, VDUPRIMITIVELEVEL } from 'NSDModel';
import { NSPrimitiveParams } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
/** Contains list of VDU primitive lists @public */
public vduList: {}[];
+ /** Contains list of KDU primitive lists @public */
+ public kduList: {}[];
+
/** FormBuilder instance added to the formBuilder @private */
private formBuilder: FormBuilder;
{
title: this.translateService.instant('VDUPRIMITIVE'),
value: 'VDU_Primitive'
+ },
+ {
+ title: this.translateService.instant('KDUPRIMITIVE'),
+ value: 'KDU_Primitive'
}
];
}
primitive: [null, [Validators.required]],
vnf_member_index: [null, [Validators.required]],
vdu_id: [null, [Validators.required]],
+ kdu_name: [null, [Validators.required]],
primitive_params: this.formBuilder.array([this.primitiveParamsBuilder()])
});
}
this.primitiveParams.removeAt(index);
}
- /** Execute NS Primitive @public */
- public execNSPrimitive(): void {
+ /** Execute Primitive @public */
+ public execPrimitive(): void {
this.submitted = true;
this.objectPrimitiveParams = {};
this.sharedService.cleanForm(this.primitiveForm);
// tslint:disable-next-line: no-string-literal
primitiveParamsPayLoads['vdu_id'] = this.primitiveForm.value.vdu_id;
}
+ if (this.primitiveType === 'KDU_Primitive') {
+ // tslint:disable-next-line: no-string-literal
+ primitiveParamsPayLoads['vnf_member_index'] = this.primitiveForm.value.vnf_member_index;
+ // tslint:disable-next-line: no-string-literal
+ primitiveParamsPayLoads['kdu_name'] = this.primitiveForm.value.kdu_name;
+ }
const apiURLHeader: APIURLHEADER = {
url: environment.NSDINSTANCES_URL + '/' + this.nsdId + '/action'
};
this.initializeForm();
if (data.value === 'NS_Primitive') {
this.getNSInfo(this.params.name);
- this.getFormControl('vnf_member_index').setValidators([]);
- this.getFormControl('vnf_member_index').updateValueAndValidity();
- this.getFormControl('vdu_id').setValidators([]);
- this.getFormControl('vdu_id').updateValueAndValidity();
- } else if (data.value === 'VNF_Primitive') {
- this.getFormControl('vdu_id').setValidators([]);
- this.getFormControl('vdu_id').updateValueAndValidity();
+ this.setUpdateValueandValidation('vnf_member_index');
+ }
+ if (data.value === 'VNF_Primitive' || data.value === 'KDU_Primitive' || data.value === 'NS_Primitive') {
+ this.setUpdateValueandValidation('vdu_id');
+ }
+ if (data.value === 'VDU_Primitive' || data.value === 'VNF_Primitive' || data.value === 'NS_Primitive') {
+ this.setUpdateValueandValidation('kdu_name');
}
}
/** Member index change event */
public indexChange(data: {}, getType?: string): void {
this.getFormControl('vdu_id').setValue(null);
+ this.getFormControl('kdu_name').setValue(null);
if (data) {
this.getVnfdInfo(data['vnfd-id-ref'], getType);
} else {
this.primitiveParameter = [];
}
}
- /** Get VDU Primitive from selected VDU id/name change event */
- public getVDUPrimitive(data: {}): void {
- this.primitiveList = data['vdu-configuration']['config-primitive'];
+ /** Get VDU/KDU primitive List for the selected event @public */
+ public getPrimitiveList(data: {}, selectedType: string): void {
+ this.primitiveList = data[selectedType + '-configuration']['config-primitive'];
}
/** Primivtive change event */
public primitiveChange(data: { parameter: {}[] }): void {
'vdu-configuration': vduData['vdu-configuration']
};
}
+ /** Generate kdu section @public */
+ public generateKDUData(kduData: KDUPRIMITIVELEVEL): KDUPRIMITIVELEVEL {
+ return {
+ name: kduData.name,
+ 'juju-bundle': kduData['juju-bundle'],
+ 'kdu-configuration': kduData['kdu-configuration']
+ };
+ }
+ /** Used to set the validation and value and update the validation and value @public */
+ public setUpdateValueandValidation(formName: string): void {
+ this.getFormControl(formName).setValidators([]);
+ this.getFormControl(formName).updateValueAndValidity();
+ }
/** Update primitive value based on parameter */
private updatePrimitive(primitive: { parameter: {}[] }): void {
if (primitive.parameter) {
.subscribe((vnfdInfo: {}) => {
if (vnfdInfo[0]['vnf-configuration'] !== undefined && vnfdInfo[0]['vnf-configuration']) {
this.getFormControl('vdu_id').setValidators([]);
+ this.getFormControl('kdu_name').setValidators([]);
this.primitiveList = vnfdInfo[0]['vnf-configuration']['config-primitive'];
}
if (getType === 'VDU_Primitive') {
+ this.kduList = [];
+ this.vduList = [];
+ this.primitiveList = [];
+ if (!isNullOrUndefined(vnfdInfo[0].vdu)) {
+ vnfdInfo[0].vdu.forEach((vduData: VDUPRIMITIVELEVEL) => {
+ if (vduData['vdu-configuration']) {
+ const vduDataObj: VDUPRIMITIVELEVEL = this.generateVDUData(vduData);
+ this.vduList.push(vduDataObj);
+ }
+ });
+ }
+ }
+ if (getType === 'KDU_Primitive') {
+ this.kduList = [];
this.vduList = [];
this.primitiveList = [];
- vnfdInfo[0].vdu.forEach((vduData: VDUPRIMITIVELEVEL) => {
- if (vduData['vdu-configuration']) {
- const vduDataObj: VDUPRIMITIVELEVEL = this.generateVDUData(vduData);
- this.vduList.push(vduDataObj);
- }
- });
+ if (!isNullOrUndefined(vnfdInfo[0].kdu)) {
+ vnfdInfo[0].kdu.forEach((kduData: KDUPRIMITIVELEVEL) => {
+ if (kduData['kdu-configuration']) {
+ const kduDataObj: KDUPRIMITIVELEVEL = this.generateKDUData(kduData);
+ this.kduList.push(kduDataObj);
+ }
+ });
+ }
}
this.isLoadingResults = false;
}, (error: ERRORDATA) => {
.subscribe((nsdInfo: {}) => {
if (!isNullOrUndefined(nsdInfo[0]['ns-configuration'])) {
this.primitiveList = !isNullOrUndefined(nsdInfo[0]['ns-configuration']['config-primitive']) ?
- nsdInfo[0]['ns-configuration']['config-primitive'] : [];
+ nsdInfo[0]['ns-configuration']['config-primitive'] : [];
} else {
this.primitiveList = [];
}
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
-->
<div class="btn-group list action" role="group">
- <button type="button" class="btn btn-primary" (click)="metrics()" placement="top" container="body"
- [disabled]="operationalStatus == 'failed' || configStatus == 'failed'" ngbTooltip="{{'METRICS' | translate}}">
+ <button type="button" class="btn btn-primary" (click)="metrics()" placement="top" container="body" [disabled]="operationalStatus == 'failed' || configStatus == 'failed'" ngbTooltip="{{'METRICS' | translate}}">
<i class="fas fa-chart-bar icons"></i>
</button>
- <button type="button" class="btn btn-primary" [disabled]="operationalStatus != 'running'" (click)="nsTopology()"
- placement="top" container="body" ngbTooltip="{{'TOPOLOGY' | translate}}">
+ <button type="button" class="btn btn-primary" [disabled]="operationalStatus != 'running'" (click)="nsTopology()" placement="top" container="body" ngbTooltip="{{'TOPOLOGY' | translate}}">
<i class="fa fa-sitemap fa-fw icons"></i>
</button>
- <button type="button" class="btn btn-primary" (click)="deleteNSInstance(false)" placement="top" container="body"
- ngbTooltip="{{'DELETE' | translate}}">
+ <button type="button" class="btn btn-primary" (click)="deleteNSInstance(false)" placement="top" container="body" ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons"></i>
</button>
<div class="btn-group" ngbDropdown display="dynamic" container="body">
{{'ACTION' | translate}}
</button>
<div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
- <button type="button" class="btn btn-primary dropdown-item" (click)="infoNs()" placement="left"
- container="body" ngbTooltip="{{'INFO' | translate}}">
+ <button type="button" class="btn btn-primary dropdown-item" (click)="infoNs()" placement="left" container="body" ngbTooltip="{{'INFO' | translate}}">
<i class="fas fa-info icons list" title="info"></i> {{'INFO' | translate}}
</button>
- <button type="button" class="btn btn-primary dropdown-item" (click)="execNSPrimitiveModal()"
- placement="left" container="body" ngbTooltip="{{'EXECNSPRIMITIVE' | translate}}"
- [disabled]="operationalStatus == 'failed' || configStatus == 'failed'">
- <i class="fas fa-magic"></i> {{'EXECNSPRIMITIVE' | translate}}
+ <button type="button" class="btn btn-primary dropdown-item" (click)="execNSPrimitiveModal()" placement="left" container="body" ngbTooltip="{{'EXECPRIMITIVE' | translate}}" [disabled]="operationalStatus == 'failed' || configStatus == 'failed'">
+ <i class="fas fa-magic"></i> {{'EXECPRIMITIVE' | translate}}
</button>
- <button type="button" class="btn btn-primary dropdown-item" (click)="historyOfOperations()" placement="left"
- container="body" ngbTooltip="{{'HISTORYOFOPERATIONS' | translate}}">
+ <button type="button" class="btn btn-primary dropdown-item" (click)="historyOfOperations()" placement="left" container="body" ngbTooltip="{{'HISTORYOFOPERATIONS' | translate}}">
<i class="fas fa-history"></i> {{'HISTORYOFOPERATIONS' | translate}}
</button>
- <button type="button" class="btn btn-primary dropdown-item text-danger" (click)="deleteNSInstance(true)"
- placement="left" container="body" ngbTooltip="{{'FORCEDELETE' | translate}}">
+ <button type="button" class="btn btn-primary dropdown-item text-danger" (click)="deleteNSInstance(true)" placement="left" container="body" ngbTooltip="{{'FORCEDELETE' | translate}}">
<i class="fas fa-trash-alt icons text-danger"></i> {{'FORCEDELETE' | translate}}
</button>
</div>
"VALUE": "Wert",
"PERFORMACTION": "Aktion ausführen",
"EXECUTE": "Execute",
- "EXECNSPRIMITIVE": "Exec NS Primitive",
+ "EXECPRIMITIVE": "Exec Primitive",
"PRIMITIVETYPE": "Primitiver Typ",
"VDUPRIMITIVE": "VDU Level Primitive",
"VNFPRIMITIVE": "VNF Level Primitive",
"NSPRIMITIVE": "NS Level Primitive",
+ "KDUPRIMITIVE": "KDU Level Primitive",
"DESCRIPTOR": "Deskriptor",
"ERROR": "Etwas ist schief gelaufen. Bitte versuche es erneut",
"SHOWGRAPH": "Grafik anzeigen",
"EDITOSMREPO": "Bearbeiten Sie OSM-Repositorys",
"OSMREPOTITLE": "Registriertes OSM-Repository",
"CREATEDSUCCESSFULLY": "OSM-Repository erfolgreich hinzugefügt",
- "UPDATEDSUCCESSFULLY" : "OSM-Repository erfolgreich aktualisiert"
+ "UPDATEDSUCCESSFULLY": "OSM-Repository erfolgreich aktualisiert"
}
},
"HTTPERROR": {
"VALUE": "Value",
"PERFORMACTION": "Perform Action",
"EXECUTE": "Execute",
- "EXECNSPRIMITIVE": "Exec NS Primitive",
+ "EXECPRIMITIVE": "Exec Primitive",
"PRIMITIVETYPE": "Primitive Type",
"VDUPRIMITIVE": "VDU Level Primitive",
"VNFPRIMITIVE": "VNF Level Primitive",
"NSPRIMITIVE": "NS Level Primitive",
+ "KDUPRIMITIVE": "KDU Level Primitive",
"DESCRIPTOR": "Descriptor",
"ERROR": "Something Went wrong please try again",
"SHOWGRAPH": "Show Graph",
"EDITOSMREPO": "Edit OSM Repositories",
"OSMREPOTITLE": "Registered OSM repository",
"CREATEDSUCCESSFULLY": "OSM Repository Added Successfully",
- "UPDATEDSUCCESSFULLY" : "OSM Repository Updated Successfully"
+ "UPDATEDSUCCESSFULLY": "OSM Repository Updated Successfully"
}
},
"HTTPERROR": {
"VALUE": "Valor",
"PERFORMACTION": "Realizar una acción",
"EXECUTE": "Ejecutar",
- "EXECNSPRIMITIVE": "Ejecutar NS Primitiva",
+ "EXECPRIMITIVE": "Ejecutar Primitiva",
"PRIMITIVETYPE": "Tipo primitivo",
"VDUPRIMITIVE": "Primitiva a nivel de VDU",
"VNFPRIMITIVE": "Nivel VNF Primitivo",
"NSPRIMITIVE": "NS Level Primitive",
+ "KDUPRIMITIVE": "Primitiva de nivel KDU",
"DESCRIPTOR": "Descriptora",
"ERROR": "Algo salió mal. Por favor, vuelva a intentarlo",
"SHOWGRAPH": "Mostrar gráfico",
"EDITOSMREPO": "Editar repositorios de OSM",
"OSMREPOTITLE": "Repositorio OSM registrado",
"CREATEDSUCCESSFULLY": "registrado OSM agregado con éxito",
- "UPDATEDSUCCESSFULLY" : "El registrado de OSM se actualizó correctamente"
+ "UPDATEDSUCCESSFULLY": "El registrado de OSM se actualizó correctamente"
}
},
"HTTPERROR": {
"VALUE": "Valor",
"PERFORMACTION": "Executar a ação",
"EXECUTE": "Executar",
- "EXECNSPRIMITIVE": "Exec NS Primitive",
+ "EXECPRIMITIVE": "Exec Primitive",
"PRIMITIVETYPE": "Tipo primitivo",
"VDUPRIMITIVE": "Primitivo de nível VDU",
"VNFPRIMITIVE": "Primitivo de nível VNF",
"NSPRIMITIVE": "NS Level Primitive",
+ "KDUPRIMITIVE": "Nível KDU Primitivo",
"DESCRIPTOR": "Descritora",
"ERROR": "Alguma coisa deu errado. Por favor tente outra vez",
"SHOWGRAPH": "Mostrar gráfico",
"EDITOSMREPO": "Editar repositórios OSM",
"OSMREPOTITLE": "Repositório OSM registrado",
"CREATEDSUCCESSFULLY": "registrado OSM adicionado com sucesso",
- "UPDATEDSUCCESSFULLY" : "registrado OSM atualizado com sucesso"
+ "UPDATEDSUCCESSFULLY": "registrado OSM atualizado com sucesso"
}
},
"HTTPERROR": {
&:focus {
text-decoration: none;
}
+ &:not([href]),
+ &:not([href]):hover {
+ color: inherit;
+ }
}
.badge {
@include line-height(normal);
name: string;
'vdu-configuration': {};
}
+
+/** Interface for the KDU Primitive Levels */
+export interface KDUPRIMITIVELEVEL {
+ name: string;
+ 'juju-bundle': string;
+ 'kdu-configuration': {};
+}
return this.http.delete(getRequest.url, getRequest.httpOptions);
}
}
+
/**
* Handle Error response based on the status.
* @param error The error response reecieved from API call.