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/shared/components/genericForm | |
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/shared/components/genericForm')
17 files changed, 10065 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts new file mode 100644 index 000000000..4189fba05 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.spec.ts @@ -0,0 +1,48 @@ +import {getTestBed, TestBed} from '@angular/core/testing'; +import {AaiService} from "../../../services/aaiService/aai.service"; +import {FormControlModel, ValidatorModel, ValidatorOptions} from "../../../models/formControlModels/formControl.model"; +import {FeatureFlagsService} from "../../../services/featureFlag/feature-flags.service"; +import {BasicControlGenerator} from "./basic.control.generator"; +import {NgRedux} from '@angular-redux/store'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; + +class MockAppStore<T> {} + +class MockFeatureFlagsService {} + +describe('Basic Control Generator', () => { + let injector; + let service: BasicControlGenerator; + let httpMock: HttpTestingController; + + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [BasicControlGenerator, + AaiService, + {provide:FeatureFlagsService, useClass: MockFeatureFlagsService}, + {provide: NgRedux, useClass: MockAppStore}] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(BasicControlGenerator); + httpMock = injector.get(HttpTestingController); + + })().then(done).catch(done.fail)); + + + test('getlegacyRegion with JANET25 - isVisible true', () => { + const instance = {lcpCloudRegionId : 'JANET25'}; + const legacyRegionControl: FormControlModel = service.getLegacyRegion(instance); + expect(legacyRegionControl.isVisible).toBeTruthy(); + }); + + test('getlegacyRegion without JANET25 - isVisible false', () => { + const instance = {lcpCloudRegionId : 'olson3'}; + const legacyRegionControl: FormControlModel = service.getLegacyRegion(instance); + expect(legacyRegionControl.isVisible).toBeFalsy(); + }); +}); + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.ts new file mode 100644 index 000000000..cbbff3c39 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/basic.control.generator.ts @@ -0,0 +1,240 @@ +import {Injectable} from "@angular/core"; +import {DropdownFormControl} from "../../../models/formControlModels/dropdownFormControl.model"; +import {FormGroup} from "@angular/forms"; +import { + CustomValidatorOptions, + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../models/formControlModels/formControl.model"; +import {InputFormControl} from "../../../models/formControlModels/inputFormControl.model"; +import {AppState} from "../../../store/reducers"; +import {NgRedux} from "@angular-redux/store"; +import {NumberFormControl} from "../../../models/formControlModels/numberFormControl.model"; +import {FormControlType} from "../../../models/formControlModels/formControlTypes.enum"; +import {FileFormControl} from "../../../models/formControlModels/fileFormControl.model"; +import {SelectOption} from "../../../models/selectOption"; +import * as _ from 'lodash'; +import {DynamicInputLabelPipe} from "../../../pipes/dynamicInputLabel/dynamic-input-label.pipe"; +import {AaiService} from "../../../services/aaiService/aai.service"; +import {FormGeneralErrorsService} from "../../formGeneralErrors/formGeneralErrors.service"; +import {Observable, of} from "rxjs"; +import {NodeModel} from "../../../models/nodeModel"; +import {Constants} from "../../../utils/constants"; + + +@Injectable() +export class BasicControlGenerator { + + public static readonly INSTANCE_NAME_REG_EX:RegExp = /^[a-zA-Z0-9._-]*$/; + public static readonly GENERATED_NAME_REG_EX:RegExp = /[^a-zA-Z0-9._-]/g; + + constructor(private _store : NgRedux<AppState>, + private _aaiService : AaiService){} + getSubscribeResult(subscribeFunction : Function, control : DropdownFormControl) : Observable<any>{ + return subscribeFunction(this).subscribe((res) => { + control.options$ = res; + control.hasEmptyOptions = res.length === 0; + FormGeneralErrorsService.checkForErrorTrigger.next(); + return of(res); + }); + } + + getSubscribeInitResult(subscribeFunction : Function, control : DropdownFormControl, form : FormGroup) : Observable<any>{ + return subscribeFunction(this).subscribe((res) => { + if(!_.isNil(control['onInitSelectedField'])){ + let result = res; + for(let key of control['onInitSelectedField']){ + result = !_.isNil(result[key]) ? result[key] : []; + } + control.options$ = result; + control.hasEmptyOptions = _.isNil(result) || result.length === 0; + } else{ + control.options$ = !_.isNil(res) ? res : []; + control.hasEmptyOptions = _.isNil(res) || res.length === 0; + } + + FormGeneralErrorsService.checkForErrorTrigger.next(); + return of(res); + }); + } + + getInstanceNameController(instance: any, serviceId: string, isEcompGeneratedNaming: boolean, model: NodeModel): FormControlModel { + let validations: ValidatorModel[] = this.createValidationsForInstanceName(instance, serviceId, isEcompGeneratedNaming); + return new InputFormControl({ + controlName: 'instanceName', + displayName: 'Instance name', + dataTestId: 'instanceName', + placeHolder: (!isEcompGeneratedNaming) ? 'Instance name' : 'Automatically generated when not provided', + validations: validations, + isVisible : true, + value : (!isEcompGeneratedNaming || (!_.isNil(instance) && !_.isNil(instance.instanceName))) + ? this.getDefaultInstanceName(instance, model) : null, + onKeypress : (event) => { + const pattern:RegExp = BasicControlGenerator.INSTANCE_NAME_REG_EX; + if(pattern){ + if(!pattern.test(event['key'])){ + event.preventDefault(); + } + } + return event; + } + }); + } + + getInstanceName(instance : any, serviceId : string, isEcompGeneratedNaming: boolean): FormControlModel { + let formControlModel:FormControlModel = this.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, new NodeModel()); + formControlModel.value = instance ? instance.instanceName : null; + return formControlModel; + } + + isLegacyRegionShouldBeVisible(instance : any) : boolean { + if(!_.isNil(instance) && !_.isNil(instance.lcpCloudRegionId)) { + return Constants.LegacyRegion.MEGA_REGION.indexOf(instance.lcpCloudRegionId) !== -1; + } + return false; + } + + getLegacyRegion(instance: any): FormControlModel { + return new InputFormControl({ + controlName: 'legacyRegion', + displayName: 'Legacy Region', + dataTestId: 'lcpRegionText', + placeHolder: 'Type Legacy Region', + validations: [], + isVisible: this.isLegacyRegionShouldBeVisible(instance), + isDisabled : _.isNil(instance) ? true : Constants.LegacyRegion.MEGA_REGION.indexOf(instance.lcpCloudRegionId), + value: instance ? instance.legacyRegion : null + }); + } + + private createValidationsForInstanceName(instance: any, serviceId: string, isEcompGeneratedNaming: boolean): ValidatorModel[] { + let validations: ValidatorModel[] = [ + new ValidatorModel(ValidatorOptions.pattern, 'Instance name may include only alphanumeric characters and underscore.', BasicControlGenerator.INSTANCE_NAME_REG_EX), + new ValidatorModel(CustomValidatorOptions.uniqueInstanceNameValidator, 'some error', [this._store, serviceId, instance && instance.instanceName]) + ]; + if (!isEcompGeneratedNaming) { + validations.push(new ValidatorModel(ValidatorOptions.required, 'is required')); + } + return validations; + } + + getInputsOptions = (options: any[]) : Observable<SelectOption[]> =>{ + let optionList: SelectOption[] = []; + options.forEach((option) => { + optionList.push(new SelectOption({ + id: option.id || option.name, + name: option.name + })); + }); + return of(optionList); + }; + + getProductFamilyControl = (instance : any, controls : FormControlModel[], isMandatory?: boolean) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : 'productFamilyId', + displayName : 'Product family', + dataTestId : 'productFamily', + placeHolder : 'Select Product Family', + isDisabled : false, + name : "product-family-select", + value : instance ? instance.productFamilyId : null, + validations : _.isNil(isMandatory) || isMandatory === true ? [new ValidatorModel(ValidatorOptions.required, 'is required')]: [], + onInit : this.getSubscribeResult.bind(this, this._aaiService.getProductFamilies), + }) + }; + + + + getDynamicInputsByType(dynamicInputs : any, serviceModelId : string, storeKey : string, type: string ) : FormControlModel[] { + let result : FormControlModel[] = []; + if(dynamicInputs) { + let nodeInstance = null; + if (_.has(this._store.getState().service.serviceInstance[serviceModelId][type], storeKey)) { + nodeInstance = Object.assign({}, this._store.getState().service.serviceInstance[serviceModelId][type][storeKey]); + } + result = this.getDynamicInputs(dynamicInputs, nodeInstance); + } + return result; + } + + + getServiceDynamicInputs(dynamicInputs : any, serviceModelId : string) : FormControlModel[] { + let result: FormControlModel[] = []; + if (dynamicInputs) { + let serviceInstance = null; + if (_.has(this._store.getState().service.serviceInstance, serviceModelId)) { + serviceInstance = Object.assign({}, this._store.getState().service.serviceInstance[serviceModelId]); + } + result = this.getDynamicInputs(dynamicInputs, serviceInstance); + } + return result; + } + + getDynamicInputs(dynamicInputs : any, instance :any) : FormControlModel[]{ + let result : FormControlModel[] = []; + if(dynamicInputs) { + dynamicInputs.forEach((input)=> { + let validations: ValidatorModel[] = []; + if(input.isRequired) { + validations.push(new ValidatorModel(ValidatorOptions.required, 'is required')) + } + if(input.minLength) { + validations.push(new ValidatorModel(ValidatorOptions.minLength, '', input.minLength)) + } + if(input.maxLength) { + validations.push(new ValidatorModel(ValidatorOptions.maxLength, '', input.maxLength)) + } + + let dynamicInputLabelPipe: DynamicInputLabelPipe = new DynamicInputLabelPipe(); + let data:any = { + controlName: input.name, + displayName: dynamicInputLabelPipe.transform(input.name).slice(0, -1), + dataTestId: input.id, + placeHolder: input.prompt, + tooltip: input.description, + validations: validations, + isVisible: input.isVisible, + value: !_.isNil(instance) && !_.isNil(instance.instanceParams) && instance.instanceParams.length > 0 ? instance.instanceParams[0][input.name] : input.value + }; + + switch (input.type) { + case 'select' : + case 'boolean' :{ + data.value = data.value || input.optionList.filter((option) => option.isDefault ? option.id || option.name: null); + data.onInit = this.getSubscribeInitResult.bind(null, this.getInputsOptions.bind(this, input.optionList)); + result.push(new DropdownFormControl(data)); + break; + } + case 'checkbox': { + data.type = FormControlType.CHECKBOX; + result.push(new FormControlModel(data)); + break; + } + case 'number': { + data.min = input.min; + data.max = input.max; + result.push(new NumberFormControl(data)); + break; + } + case 'file': { + result.push(new FileFormControl(data)); + break; + } + default: { + result.push(new InputFormControl(data)); + } + } + }) + } + + return result; + } + + getDefaultInstanceName(instance: any, model: NodeModel) : string { + const initialInstanceName = (!_.isNil(instance) && instance.instanceName) || (!_.isNil(model.name) ? model.name.replace(BasicControlGenerator.GENERATED_NAME_REG_EX, "") : model.name); + return initialInstanceName; + } + +} diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts new file mode 100644 index 000000000..97c6ddf59 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.spec.ts @@ -0,0 +1,1979 @@ +import {getTestBed, TestBed} from '@angular/core/testing'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; +import {NgRedux} from '@angular-redux/store'; +import {BasicControlGenerator} from "../basic.control.generator"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {GenericFormService} from "../../generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import {LogService} from "../../../../utils/log/log.service"; +import {FormControlNames, NetworkControlGenerator} from "./network.control.generator"; +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service"; + +class MockAppStore<T> { + getState(){ + return { + "global": { + "name": null, + "flags": { + "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false, + "FLAG_SHOW_ASSIGNMENTS": true, + "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, + "FLAG_UNASSIGN_SERVICE": true, + "FLAG_SHOW_VERIFY_SERVICE": false, + "FLAG_COLLECTION_RESOURCE_SUPPORT": true, + "FLAG_DUPLICATE_VNF": true, + "FLAG_SERVICE_MODEL_CACHE": true, + "CREATE_INSTANCE_TEST": false, + "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false, + "FLAG_ASYNC_INSTANTIATION": true, + "FLAG_ASYNC_JOBS": true, + "EMPTY_DRAWING_BOARD_TEST": false, + "FLAG_ADD_MSO_TESTAPI_FIELD": true + }, + "type": "[FLAGS] Update" + }, + "service": { + "serviceHierarchy": { + "6e59c5de-f052-46fa-aa7e-2fca9d674c44": { + "service": { + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "ComplexService", + "version": "1.0", + "toscaModelURL": null, + "category": "Emanuel", + "serviceType": "", + "serviceRole": "", + "description": "ComplexService", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": {} + }, + "vnfs": { + "VF_vMee 0": { + "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60", + "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e", + "description": "VSP_vMee", + "name": "VF_vMee", + "version": "2.0", + "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9", + "inputs": {}, + "commands": {}, + "properties": { + "max_instances": 10, + "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", + "sctp-b-IPv6_ethertype": "IPv6", + "sctp-a-egress_rule_application": "any", + "sctp-b-ingress_action": "pass", + "sctp-b-ingress_rule_protocol": "icmp", + "ncb2_Internal1_mac": "00:11:22:EF:AC:DF", + "sctp-b-ipv6-ingress-src_start_port": "0.0", + "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", + "sctp-a-ipv6-ingress-dst_start_port": "0", + "sctp-b-ipv6-ingress_rule_application": "any", + "domain_name": "default-domain", + "sctp-a-ingress_rule_protocol": "icmp", + "sctp-b-egress-src_start_port": "0.0", + "sctp-a-egress_src_addresses": "local", + "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group", + "sctp-a-egress-src_start_port": "0.0", + "sctp-a-ingress_ethertype": "IPv4", + "sctp-b-ipv6-ingress-dst_end_port": "65535", + "sctp-b-dst_subnet_prefix_v6": "::", + "nf_naming": "{ecomp_generated_naming=true}", + "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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix_len": "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:11:22:EF:AC:DF", + "sctp-a-egress_ethertype": "IPv4", + "vlc_st_service_mode": "in-network-nat", + "sctp-a-ipv6-egress_ethertype": "IPv4", + "sctp-a-egress-src_end_port": "65535.0", + "sctp-b-ipv6-egress_rule_application": "any", + "sctp-b-egress_action": "pass", + "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:11:22:EF:AC:DF", + "sctp-a-ipv6-ingress-src_start_port": "0.0", + "sctp-b-ipv6-egress_ethertype": "IPv4", + "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", + "ecomp_generated_naming": "false", + "sctp-a-IPv6_ethertype": "IPv6", + "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", + "sctp-a-ipv6-ingress-src_end_port": "65535.0", + "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-b-ingress_rule_application": "any", + "int2_sec_group_name": "int2-sec-group", + "vlc_flavor_name": "nd.c16r64d1", + "sctp-b-ipv6-egress_src_addresses": "local", + "vlc_st_interface_type_int1": "other1", + "sctp-b-egress-src_end_port": "65535.0", + "sctp-a-ipv6-egress-dst_start_port": "0", + "vlc_st_interface_type_int2": "other2", + "sctp-a-ipv6-egress_rule_protocol": "any", + "Internal2_shared": "false", + "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0", + "Internal2_rpf": "disable", + "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", + "sctp-a-ipv6-egress_src_end_port": "65535", + "Internal1_forwarding_mode": "l2", + "Internal2_dhcp": "false", + "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: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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix": "0.0.0.0", + "Internal1_net_cidr_len": "17", + "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: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: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:11:22:EF:AC:DF", + "vlc_st_interface_type_oam": "management", + "multi_stage_design": "true", + "oam_sec_group_name": "oam-sec-group", + "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": "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", + "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0", + "sctp-a-ipv6-ingress_dst_addresses": "local", + "sctp-a-egress_rule_protocol": "icmp", + "sctp-b-ipv6-egress_action": "pass", + "sctp-a-ipv6-egress_action": "pass", + "Internal1_shared": "false", + "sctp-b-ipv6-ingress_rule_protocol": "any", + "Internal2_net_cidr_len": "17", + "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-a-ingress-src_end_port": "65535.0", + "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0", + "sctp-a-egress-dst_end_port": "65535.0", + "sctp-a-ingress_action": "pass", + "sctp-b-egress_rule_protocol": "icmp", + "sctp-b-ipv6-ingress_action": "pass", + "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: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", + "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0", + "Internal1_allow_transit": "true", + "gpb_flavor_name": "nv.c20r64d1", + "availability_zone_max_count": "1", + "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2", + "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:11:22:EF:AC:DF", + "sctp-a-ingress-src_subnet_prefix": "0.0.0.0", + "sctp-a-ipv6-ingress_action": "pass", + "Internal1_rpf": "disable", + "sctp-b-ingress_ethertype": "IPv4", + "sctp-b-egress_rule_application": "any", + "sctp-b-ingress-src_end_port": "65535.0", + "sctp-a-ipv6-ingress_rule_protocol": "any", + "sctp-a-ingress-src_start_port": "0.0", + "sctp-b-egress-dst_end_port": "65535.0" + }, + "type": "VF", + "modelCustomizationName": "VF_vMee 0", + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "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": { + "ecomp_generated_naming" : "false", + "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" + }, + "ExtVL 1": { + "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b987", + "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c", + "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks", + "name": "ExtVL1", + "version": "37.0", + "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f", + "inputs": {}, + "commands": {}, + "properties": { + "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": { + "Port Mirroring Configuration By Policy 0": { + "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50", + "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7", + "description": "A port mirroring configuration by policy object", + "name": "Port Mirroring Configuration By Policy", + "version": "27.0", + "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Configuration", + "modelCustomizationName": "Port Mirroring Configuration By Policy 0", + "sourceNodes": [], + "collectorNodes": null, + "configurationByPolicy": false + } + }, + "serviceProxies": {}, + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {} + } + }, + "pnfs": {} + } + }, + "serviceInstance": { + "6e59c5de-f052-46fa-aa7e-2fca9d674c44": { + "networks" : {}, + "vnfs": { + "VF_vMee 0": { + "rollbackOnFailure": "true", + "vfModules": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "vf_vmee0..VfVmee..base_vmme..module-0vmvzo": { + "isMissingData": false, + "sdncPreReload": null, + "modelInfo": { + "modelType": "VFmodule", + "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "modelName": "VfVmee..base_vmme..module-0", + "modelVersion": "2", + "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "modelCustomizationName": "VfVmee..base_vmme..module-0" + }, + "instanceParams": [ + {} + ], + "trackById": "wmtm6sy2uj" + } + } + }, + "isMissingData": true, + "originalName": "VF_vMee 0", + "vnfStoreKey": "VF_vMee 0", + "trackById": "p3wk448m5do", + "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60", + "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "lcpCloudRegionId": null, + "tenantId": null, + "lineOfBusiness": null, + "platformName": null, + "modelInfo": { + "modelType": "VF", + "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e", + "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "modelName": "VF_vMee", + "modelVersion": "2.0", + "modelCustomizationName": "VF_vMee 0" + } + } + }, + "instanceParams": [ + {} + ], + "validationCounter": 1, + "existingNames": {}, + "existingVNFCounterMap": { + "d6557200-ecf2-4641-8094-5393ae3aae60": 1 + }, + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "lcpCloudRegionId": "hvf6", + "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e", + "aicZoneId": "JAG1", + "projectName": "x1", + "rollbackOnFailure": "true", + "bulkSize": 1, + "modelInfo": { + "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "modelName": "ComplexService", + "modelVersion": "1.0", + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44" + }, + "isALaCarte": false, + "name": "ComplexService", + "version": "1.0", + "description": "ComplexService", + "category": "Emanuel", + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "serviceType": "", + "serviceRole": "", + "isMultiStepDesign": false + } + }, + "lcpRegionsAndTenants": { + "lcpRegionList": [ + { + "id": "JANET25", + "name": "JANET25", + "isPermitted": true + }, + { + "id": "hvf6", + "name": "hvf6", + "isPermitted": true + } + ], + "lcpRegionsTenantsMap": { + "JANET25": [ + { + "id": "092eb9e8e4b7412e8787dd091bc58e86", + "name": "USP-SIP-IC-24335-T-01", + "isPermitted": true + } + ], + "hvf6": [ + { + "id": "bae71557c5bb4d5aac6743a4e5f1d054", + "name": "AIN Web Tool-15-D-testalexandria", + "isPermitted": true + }, + { + "id": "229bcdc6eaeb4ca59d55221141d01f8e", + "name": "AIN Web Tool-15-D-STTest2", + "isPermitted": true + }, + { + "id": "1178612d2b394be4834ad77f567c0af2", + "name": "AIN Web Tool-15-D-SSPtestcustome", + "isPermitted": true + }, + { + "id": "19c5ade915eb461e8af52fb2fd8cd1f2", + "name": "AIN Web Tool-15-D-UncheckedEcopm", + "isPermitted": true + }, + { + "id": "de007636e25249238447264a988a927b", + "name": "AIN Web Tool-15-D-dfsdf", + "isPermitted": true + }, + { + "id": "62f29b3613634ca6a3065cbe0e020c44", + "name": "AIN/SMS-16-D-Multiservices1", + "isPermitted": true + }, + { + "id": "649289e30d3244e0b48098114d63c2aa", + "name": "AIN Web Tool-15-D-SSPST66", + "isPermitted": true + }, + { + "id": "3f21eeea6c2c486bba31dab816c05a32", + "name": "AIN Web Tool-15-D-ASSPST47", + "isPermitted": true + }, + { + "id": "f60ce21d3ee6427586cff0d22b03b773", + "name": "CESAR-100-D-sspjg67246", + "isPermitted": true + }, + { + "id": "8774659e425f479895ae091bb5d46560", + "name": "CESAR-100-D-sspjg68359", + "isPermitted": true + }, + { + "id": "624eb554b0d147c19ff8885341760481", + "name": "AINWebTool-15-D-iftach", + "isPermitted": true + }, + { + "id": "214f55f5fc414c678059c383b03e4962", + "name": "CESAR-100-D-sspjg612401", + "isPermitted": true + }, + { + "id": "c90666c291664841bb98e4d981ff1db5", + "name": "CESAR-100-D-sspjg621340", + "isPermitted": true + }, + { + "id": "ce5b6bc5c7b348e1bf4b91ac9a174278", + "name": "sspjg621351cloned", + "isPermitted": true + }, + { + "id": "b386b768a3f24c8e953abbe0b3488c02", + "name": "AINWebTool-15-D-eteancomp", + "isPermitted": true + }, + { + "id": "dc6c4dbfd225474e9deaadd34968646c", + "name": "AINWebTool-15-T-SPFET", + "isPermitted": true + }, + { + "id": "02cb5030e9914aa4be120bd9ed1e19eb", + "name": "AINWebTool-15-X-eeweww", + "isPermitted": true + }, + { + "id": "f2f3830e4c984d45bcd00e1a04158a79", + "name": "CESAR-100-D-spjg61909", + "isPermitted": true + }, + { + "id": "05b91bd5137f4929878edd965755c06d", + "name": "CESAR-100-D-sspjg621512cloned", + "isPermitted": true + }, + { + "id": "7002fbe8482d4a989ddf445b1ce336e0", + "name": "AINWebTool-15-X-vdr", + "isPermitted": true + }, + { + "id": "4008522be43741dcb1f5422022a2aa0b", + "name": "AINWebTool-15-D-ssasa", + "isPermitted": true + }, + { + "id": "f44e2e96a1b6476abfda2fa407b00169", + "name": "AINWebTool-15-D-PFNPT", + "isPermitted": true + }, + { + "id": "b69a52bec8a84669a37a1e8b72708be7", + "name": "AINWebTool-15-X-vdre", + "isPermitted": true + }, + { + "id": "fac7d9fd56154caeb9332202dcf2969f", + "name": "AINWebTool-15-X-NONPODECOMP", + "isPermitted": true + }, + { + "id": "2d34d8396e194eb49969fd61ffbff961", + "name": "DN5242-Nov16-T5", + "isPermitted": true + }, + { + "id": "cb42a77ff45b48a8b8deb83bb64acc74", + "name": "ro-T11", + "isPermitted": true + }, + { + "id": "fa45ca53c80b492fa8be5477cd84fc2b", + "name": "ro-T112", + "isPermitted": true + }, + { + "id": "4914ab0ab3a743e58f0eefdacc1dde77", + "name": "DN5242-Nov21-T1", + "isPermitted": true + }, + { + "id": "d0a3e3f2964542259d155a81c41aadc3", + "name": "test-hvf6-09", + "isPermitted": true + }, + { + "id": "cbb99fe4ada84631b7baf046b6fd2044", + "name": "DN5242-Nov16-T3", + "isPermitted": true + } + ] + } + }, + "productFamilies": [ + { + "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", + "name": "SCOTTIE", + "isPermitted": true + }, + { + "id": "17cc1042-527b-11e6-beb8-9e71128cae77", + "name": "IGNACIO", + "isPermitted": true + }, + { + "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "name": "Christie", + "isPermitted": true + }, + { + "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7", + "name": "Enhanced Services", + "isPermitted": true + }, + { + "id": "vTerrance", + "name": "vTerrance", + "isPermitted": true + }, + { + "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f", + "name": "vSCP", + "isPermitted": true + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": true + }, + { + "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "name": "BVOIP", + "isPermitted": true + }, + { + "id": "db171b8f-115c-4992-a2e3-ee04cae357e0", + "name": "LINDSEY", + "isPermitted": true + }, + { + "id": "LRSI-OSPF", + "name": "LRSI-OSPF", + "isPermitted": true + }, + { + "id": "vRosemarie", + "name": "HNGATEWAY", + "isPermitted": true + }, + { + "id": "vHNPaas", + "name": "WILKINS", + "isPermitted": true + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce", + "name": "VROUTER", + "isPermitted": true + }, + { + "id": "Cisneros", + "name": "vMuriel", + "isPermitted": true + }, + { + "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1", + "name": "CARA Griffin", + "isPermitted": true + }, + { + "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "name": "DARREN MCGEE", + "isPermitted": true + }, + { + "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1", + "name": "Transport", + "isPermitted": true + }, + { + "id": "vSalvatore", + "name": "vSalvatore", + "isPermitted": true + }, + { + "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "name": "Josefina", + "isPermitted": true + }, + { + "id": "vHubbard", + "name": "vHubbard", + "isPermitted": true + }, + { + "id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "name": "DARREN MCGEE", + "isPermitted": true + } + ], + "serviceTypes": { + "e433710f-9217-458d-a79d-1c7aff376d89": [ + { + "id": "0", + "name": "vRichardson", + "isPermitted": false + }, + { + "id": "1", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "2", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "3", + "name": "vJamie", + "isPermitted": false + }, + { + "id": "4", + "name": "vVoiceMail", + "isPermitted": false + }, + { + "id": "5", + "name": "Kennedy", + "isPermitted": false + }, + { + "id": "6", + "name": "vSEGW", + "isPermitted": false + }, + { + "id": "7", + "name": "vVM", + "isPermitted": false + }, + { + "id": "8", + "name": "vOTA", + "isPermitted": false + }, + { + "id": "9", + "name": "vMME", + "isPermitted": false + }, + { + "id": "10", + "name": "vMNS", + "isPermitted": false + }, + { + "id": "11", + "name": "vSCP", + "isPermitted": false + }, + { + "id": "12", + "name": "VPMS", + "isPermitted": false + }, + { + "id": "13", + "name": "vMMSC", + "isPermitted": false + }, + { + "id": "14", + "name": "SSD", + "isPermitted": false + }, + { + "id": "15", + "name": "vMOG", + "isPermitted": false + }, + { + "id": "16", + "name": "LINDSEY", + "isPermitted": false + }, + { + "id": "17", + "name": "JOHANNA_SANTOS", + "isPermitted": false + }, + { + "id": "18", + "name": "vCarroll", + "isPermitted": false + } + ] + }, + "aicZones": [ + { + "id": "NFT1", + "name": "NFTJSSSS-NFT1" + }, + { + "id": "JAG1", + "name": "YUDFJULP-JAG1" + }, + { + "id": "YYY1", + "name": "UUUAIAAI-YYY1" + }, + { + "id": "BAN1", + "name": "VSDKYUTP-BAN1" + }, + { + "id": "DKJ1", + "name": "DKJSJDKA-DKJ1" + }, + { + "id": "MCS1", + "name": "ASACMAMS-MCS1" + }, + { + "id": "UIO1", + "name": "uioclli1-UIO1" + }, + { + "id": "RAJ1", + "name": "YGBIJNLQ-RAJ1" + }, + { + "id": "OPA1", + "name": "opaclli1-OPA1" + }, + { + "id": "SDE1", + "name": "ZXCVBNMA-SDE1" + }, + { + "id": "VEN2", + "name": "FGHJUHIL-VEN2" + }, + { + "id": "ORL1", + "name": "ORLDFLMA-ORL1" + }, + { + "id": "JAD1", + "name": "JADECLLI-JAD1" + }, + { + "id": "ZXL1", + "name": "LWLWCANN-ZXL1" + }, + { + "id": "CKL1", + "name": "CLKSKCKK-CKL1" + }, + { + "id": "SDF1", + "name": "sdfclli1-SDF1" + }, + { + "id": "RAD1", + "name": "RADICAL1-RAD1" + }, + { + "id": "KIT1", + "name": "BHYJFGLN-KIT1" + }, + { + "id": "REL1", + "name": "INGERFGT-REL1" + }, + { + "id": "JNL1", + "name": "CJALSDAC-JNL1" + }, + { + "id": "OLK1", + "name": "OLKOLKLS-OLK1" + }, + { + "id": "CHI1", + "name": "CHILLIWE-CHI1" + }, + { + "id": "UUU4", + "name": "UUUAAAUU-UUU4" + }, + { + "id": "TUF1", + "name": "TUFCLLI1-TUF1" + }, + { + "id": "KJN1", + "name": "CKALDKSA-KJN1" + }, + { + "id": "SAM1", + "name": "SNDGCA64-SAN1" + }, + { + "id": "SCK1", + "name": "SCKSCKSK-SCK1" + }, + { + "id": "HJH1", + "name": "AOEEQQQD-HJH1" + }, + { + "id": "HGD1", + "name": "SDFQWHGD-HGD1" + }, + { + "id": "KOR1", + "name": "HYFLNBVT-KOR1" + }, + { + "id": "ATL43", + "name": "AICLOCID-ATL43" + }, + { + "id": "ATL54", + "name": "AICFTAAI-ATL54" + }, + { + "id": "ATL66", + "name": "CLLIAAII-ATL66" + }, + { + "id": "VEL1", + "name": "BNMLKUIK-VEL1" + }, + { + "id": "ICC1", + "name": "SANJITAT-ICC1" + }, + { + "id": "MNT11", + "name": "WSXEFBTH-MNT11" + }, + { + "id": "DEF2", + "name": "WSBHGTYL-DEF2" + }, + { + "id": "MAD11", + "name": "SDFQWGKL-MAD11" + }, + { + "id": "OLG1", + "name": "OLHOLHOL-OLG1" + }, + { + "id": "GAR1", + "name": "NGFVSJKO-GAR1" + }, + { + "id": "SAN22", + "name": "GNVLSCTL-SAN22" + }, + { + "id": "HRG1", + "name": "HRGHRGGS-HRG1" + }, + { + "id": "JCS1", + "name": "JCSJSCJS-JCS1" + }, + { + "id": "DHA12", + "name": "WSXEDECF-DHA12" + }, + { + "id": "HJE1", + "name": "AOEEWWWD-HJE1" + }, + { + "id": "NCA1", + "name": "NCANCANN-NCA1" + }, + { + "id": "IOP1", + "name": "iopclli1-IOP1" + }, + { + "id": "RTY1", + "name": "rtyclli1-RTY1" + }, + { + "id": "KAP1", + "name": "HIOUYTRQ-KAP1" + }, + { + "id": "ZEN1", + "name": "ZENCLLI1-ZEN1" + }, + { + "id": "HKA1", + "name": "JAKHLASS-HKA1" + }, + { + "id": "CQK1", + "name": "CQKSCAKK-CQK1" + }, + { + "id": "SAI1", + "name": "UBEKQLPD-SAI1" + }, + { + "id": "ERT1", + "name": "ertclli1-ERT1" + }, + { + "id": "IBB1", + "name": "PLMKOIJU-IBB1" + }, + { + "id": "TIR2", + "name": "PLKINHYI-TIR2" + }, + { + "id": "HSD1", + "name": "CHASKCDS-HSD1" + }, + { + "id": "SLF78", + "name": "SDCTLFN1-SLF78" + }, + { + "id": "SEE78", + "name": "SDCTEEE4-SEE78" + }, + { + "id": "SAN13", + "name": "TOKYJPFA-SAN13" + }, + { + "id": "SAA78", + "name": "SDCTAAA1-SAA78" + }, + { + "id": "LUC1", + "name": "ATLDFGYC-LUC1" + }, + { + "id": "AMD13", + "name": "MEMATLAN-AMD13" + }, + { + "id": "TOR1", + "name": "TOROONXN-TOR1" + }, + { + "id": "QWE1", + "name": "QWECLLI1-QWE1" + }, + { + "id": "ZOG1", + "name": "ZOGASTRO-ZOG1" + }, + { + "id": "CAL33", + "name": "CALIFORN-CAL33" + }, + { + "id": "SHH78", + "name": "SDIT1HHH-SHH78" + }, + { + "id": "DSA1", + "name": "LKJHGFDS-DSA1" + }, + { + "id": "CLG1", + "name": "CLGRABAD-CLG1" + }, + { + "id": "BNA1", + "name": "BNARAGBK-BNA1" + }, + { + "id": "ATL84", + "name": "CANTTCOC-ATL84" + }, + { + "id": "APP1", + "name": "WBHGTYUI-APP1" + }, + { + "id": "RJN1", + "name": "RJNRBZAW-RJN1" + }, + { + "id": "EHH78", + "name": "SDCSHHH5-EHH78" + }, + { + "id": "mac10", + "name": "PKGTESTF-mac10" + }, + { + "id": "SXB78", + "name": "SDCTGXB1-SXB78" + }, + { + "id": "SAX78", + "name": "SDCTAXG1-SAX78" + }, + { + "id": "SYD1", + "name": "SYDNAUBV-SYD1" + }, + { + "id": "TOK1", + "name": "TOKYJPFA-TOK1" + }, + { + "id": "KGM2", + "name": "KGMTNC20-KGM2" + }, + { + "id": "DCC1b", + "name": "POIUYTGH-DCC1b" + }, + { + "id": "SKK78", + "name": "SDCTKKK1-SKK78" + }, + { + "id": "SGG78", + "name": "SDCTGGG1-SGG78" + }, + { + "id": "SJJ78", + "name": "SDCTJJJ1-SJJ78" + }, + { + "id": "SBX78", + "name": "SDCTBXG1-SBX78" + }, + { + "id": "LAG1", + "name": "LARGIZON-LAG1" + }, + { + "id": "IAA1", + "name": "QAZXSWED-IAA1" + }, + { + "id": "POI1", + "name": "PLMNJKIU-POI1" + }, + { + "id": "LAG1a", + "name": "LARGIZON-LAG1a" + }, + { + "id": "PBL1", + "name": "PBLAPBAI-PBL1" + }, + { + "id": "LAG45", + "name": "LARGIZON-LAG1a" + }, + { + "id": "MAR1", + "name": "MNBVCXZM-MAR1" + }, + { + "id": "HST70", + "name": "HSTNTX70-HST70" + }, + { + "id": "DCC1a", + "name": "POIUYTGH-DCC1a" + }, + { + "id": "TOL1", + "name": "TOLDOH21-TOL1" + }, + { + "id": "LON1", + "name": "LONEENCO-LON1" + }, + { + "id": "SJU78", + "name": "SDIT1JUB-SJU78" + }, + { + "id": "STN27", + "name": "HSTNTX01-STN27" + }, + { + "id": "SSW56", + "name": "ss8126GT-SSW56" + }, + { + "id": "SBB78", + "name": "SDIT1BBB-SBB78" + }, + { + "id": "DCC3", + "name": "POIUYTGH-DCC3" + }, + { + "id": "GNV1", + "name": "GNVLSCTL-GNV1" + }, + { + "id": "WAS1", + "name": "WASHDCSW-WAS1" + }, + { + "id": "TOY1", + "name": "TORYONNZ-TOY1" + }, + { + "id": "STT1", + "name": "STTLWA02-STT1" + }, + { + "id": "STG1", + "name": "STTGGE62-STG1" + }, + { + "id": "SLL78", + "name": "SDCTLLL1-SLL78" + }, + { + "id": "SBU78", + "name": "SDIT1BUB-SBU78" + }, + { + "id": "ATL2", + "name": "ATLNGANW-ATL2" + }, + { + "id": "BOT1", + "name": "BOTHWAKY-BOT1" + }, + { + "id": "SNG1", + "name": "SNGPSIAU-SNG1" + }, + { + "id": "NYC1", + "name": "NYCMNY54-NYC1" + }, + { + "id": "LAG1b", + "name": "LARGIZON-LAG1b" + }, + { + "id": "AMD15", + "name": "AMDFAA01-AMD15" + }, + { + "id": "SNA1", + "name": "SNANTXCA-SNA1" + }, + { + "id": "PLT1", + "name": "PLTNCA60-PLT1" + }, + { + "id": "TLP1", + "name": "TLPNXM18-TLP1" + }, + { + "id": "SDD81", + "name": "SAIT1DD6-SDD81" + }, + { + "id": "DCC1", + "name": "POIUYTGH-DCC1" + }, + { + "id": "DCC2", + "name": "POIUYTGH-DCC2" + }, + { + "id": "OKC1", + "name": "OKCBOK55-OKC1" + }, + { + "id": "PAR1", + "name": "PARSFRCG-PAR1" + }, + { + "id": "TES36", + "name": "ABCEETES-TES36" + }, + { + "id": "COM1", + "name": "PLMKOPIU-COM1" + }, + { + "id": "ANI1", + "name": "ATLNGTRE-ANI1" + }, + { + "id": "SDG78", + "name": "SDIT1BDG-SDG78" + }, + { + "id": "mac20", + "name": "PKGTESTF-mac20" + }, + { + "id": "DSF45", + "name": "DSFBG123-DSF45" + }, + { + "id": "HST25", + "name": "HSTNTX01-HST25" + }, + { + "id": "AMD18", + "name": "AUDIMA01-AMD18" + }, + { + "id": "SAA80", + "name": "SAIT9AA3-SAA80" + }, + { + "id": "SSA56", + "name": "SSIT2AA7-SSA56" + }, + { + "id": "SDD82", + "name": "SAIT1DD9-SDD82" + }, + { + "id": "JCV1", + "name": "JCVLFLBW-JCV1" + }, + { + "id": "SUL2", + "name": "WERTYUJK-SUL2" + }, + { + "id": "PUR1", + "name": "purelyde-PUR1" + }, + { + "id": "FDE55", + "name": "FDERT555-FDE55" + }, + { + "id": "SITE", + "name": "LONEENCO-SITE" + }, + { + "id": "ATL1", + "name": "ATLNGAMA-ATL1" + }, + { + "id": "JUL1", + "name": "ZXCVBNMM-JUL1" + }, + { + "id": "TAT34", + "name": "TESAAISB-TAT34" + }, + { + "id": "XCP12", + "name": "CHKGH123-XCP12" + }, + { + "id": "RAI1", + "name": "poiuytre-RAI1" + }, + { + "id": "HPO1", + "name": "ATLNGAUP-HPO1" + }, + { + "id": "KJF12", + "name": "KJFDH123-KJF12" + }, + { + "id": "SCC80", + "name": "SAIT9CC3-SCC80" + }, + { + "id": "SAA12", + "name": "SAIT9AF8-SAA12" + }, + { + "id": "SAA14", + "name": "SAIT1AA9-SAA14" + }, + { + "id": "ATL35", + "name": "TTESSAAI-ATL35" + }, + { + "id": "CWY1", + "name": "CWYMOWBS-CWY1" + }, + { + "id": "ATL76", + "name": "TELEPAAI-ATL76" + }, + { + "id": "DSL12", + "name": "DSLFK242-DSL12" + }, + { + "id": "ATL53", + "name": "AAIATLTE-ATL53" + }, + { + "id": "SAA11", + "name": "SAIT9AA2-SAA11" + }, + { + "id": "ATL62", + "name": "TESSASCH-ATL62" + }, + { + "id": "AUG1", + "name": "ASDFGHJK-AUG1" + }, + { + "id": "POI22", + "name": "POIUY123-POI22" + }, + { + "id": "SAA13", + "name": "SAIT1AA9-SAA13" + }, + { + "id": "BHY17", + "name": "BHYTFRF3-BHY17" + }, + { + "id": "LIS1", + "name": "HOSTPROF-LIS1" + }, + { + "id": "SIP1", + "name": "ZXCVBNMK-SIP1" + }, + { + "id": "ATL99", + "name": "TEESTAAI-ATL43" + }, + { + "id": "ATL64", + "name": "FORLOAAJ-ATL64" + }, + { + "id": "TAT33", + "name": "TESAAISA-TAT33" + }, + { + "id": "RAD10", + "name": "INDIPUNE-RAD10" + }, + { + "id": "RTW5", + "name": "BHYTFRY4-RTW5" + }, + { + "id": "JGS1", + "name": "KSJKKKKK-JGS1" + }, + { + "id": "ATL98", + "name": "TEESTAAI-ATL43" + }, + { + "id": "WAN1", + "name": "LEIWANGW-WAN1" + }, + { + "id": "ATL44", + "name": "ATLSANAB-ATL44" + }, + { + "id": "RTD2", + "name": "BHYTFRk4-RTD2" + }, + { + "id": "NIR1", + "name": "ORFLMANA-NIR1" + }, + { + "id": "ATL75", + "name": "SANAAIRE-ATL75" + }, + { + "id": "NUM1", + "name": "QWERTYUI-NUM1" + }, + { + "id": "MTN32", + "name": "MDTWNJ21-MTN32" + }, + { + "id": "RTZ4", + "name": "BHYTFRZ6-RTZ4" + }, + { + "id": "ATL56", + "name": "ATLSANAC-ATL56" + }, + { + "id": "AMS1", + "name": "AMSTNLBW-AMS1" + }, + { + "id": "RCT1", + "name": "AMSTERNL-RCT1" + }, + { + "id": "JAN1", + "name": "ORFLMATT-JAN1" + }, + { + "id": "ABC14", + "name": "TESAAISA-ABC14" + }, + { + "id": "TAT37", + "name": "TESAAISD-TAT37" + }, + { + "id": "MIC54", + "name": "MICHIGAN-MIC54" + }, + { + "id": "ABC11", + "name": "ATLSANAI-ABC11" + }, + { + "id": "AMF11", + "name": "AMDOCS01-AMF11" + }, + { + "id": "ATL63", + "name": "ATLSANEW-ATL63" + }, + { + "id": "ABC12", + "name": "ATLSECIA-ABC12" + }, + { + "id": "MTN20", + "name": "MDTWNJ21-MTN20" + }, + { + "id": "ABC15", + "name": "AAITESAN-ABC15" + }, + { + "id": "AVT1", + "name": "AVTRFLHD-AVT1" + }, + { + "id": "ATL34", + "name": "ATLSANAI-ATL34" + } + ], + "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": "[LCP_REGIONS_AND_TENANTS] Update", + "subscribers": [ + { + "id": "CAR_2020_ER", + "name": "CAR_2020_ER", + "isPermitted": true + }, + { + "id": "21014aa2-526b-11e6-beb8-9e71128cae77", + "name": "JULIO ERICKSON", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-2", + "name": "DALE BRIDGES", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-1", + "name": "LLOYD BRIDGES", + "isPermitted": false + }, + { + "id": "jimmy-example", + "name": "JimmyExampleCust-20161102", + "isPermitted": false + }, + { + "id": "jimmy-example2", + "name": "JimmyExampleCust-20161103", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-102", + "name": "ERICA5779-TestSub-PWT-102", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-101", + "name": "ERICA5779-TestSub-PWT-101", + "isPermitted": false + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-4", + "name": "ERICA5779-Subscriber-5", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-103", + "name": "ERICA5779-TestSub-PWT-103", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-2", + "name": "ERICA5779-Subscriber-2", + "isPermitted": false + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "SILVIA ROBBINS", + "isPermitted": true + }, + { + "id": "ERICA5779-Subscriber-3", + "name": "ERICA5779-Subscriber-3", + "isPermitted": false + }, + { + "id": "31739f3e-526b-11e6-beb8-9e71128cae77", + "name": "CRAIG/ROBERTS", + "isPermitted": false + } + ] + } +} +} +} + +class MockFeatureFlagsService {} + +describe('Network Control Generator', () => { + let injector; + let service: NetworkControlGenerator; + let httpMock: HttpTestingController; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [NetworkControlGenerator, + GenericFormService, + BasicControlGenerator, + AaiService, + FormBuilder, + LogService, + {provide:FeatureFlagsService, useClass: MockFeatureFlagsService}, + {provide: NgRedux, useClass: MockAppStore}] + }); + + injector = getTestBed(); + service = injector.get(NetworkControlGenerator); + httpMock = injector.get(HttpTestingController); + }); + + test('getMacroFormControls check for mandatory controls', () => { + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const networkName : string = "ExtVL 0"; + const networkStoreKey : string = "ExtVL 0"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, networkStoreKey, networkName, false); + + const mandatoryControls : string[] = [ + FormControlNames.LCPCLOUD_REGION_ID, + 'tenantId', + 'platformName' + ]; + for(let i = 0 ; i < mandatoryControls.length ; i++){ + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + + test('getMacroFormControls should return instance name if isEcompName is true', () => { + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const networkName : string = "ExtVL 1"; + const networkStoreKey : string = "ExtVL 1"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, networkStoreKey, networkName, false); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.PRODUCT_FAMILY_ID, + FormControlNames.LCPCLOUD_REGION_ID , + 'legacyRegion', + 'tenantId', + 'platformName', + 'lineOfBusiness']; + + + + expect(controls.length).toEqual(7); + for(let i = 0 ; i < controls.length ; i++){ + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + test('getMacroFormControls should return the correct order of controls', () => { + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const networkName : string = "ExtVL 0"; + const networkStoreKey : string = "ExtVL 0"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, networkStoreKey, networkName, false); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.PRODUCT_FAMILY_ID, + FormControlNames.LCPCLOUD_REGION_ID , + 'legacyRegion', + 'tenantId', + 'platformName', + 'lineOfBusiness']; + + + + expect(controls.length).toEqual(7); + for(let i = 0 ; i < controls.length ; i++){ + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + test('getMacroFormControls should not return the rollback status', () => { + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const networkName : string = "ExtVL 0"; + const networkStoreKey : string = "ExtVL 0"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, networkStoreKey, networkName, false); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.PRODUCT_FAMILY_ID, + FormControlNames.LCPCLOUD_REGION_ID , + 'legacyRegion', + 'tenantId', + 'platformName', + 'lineOfBusiness', + FormControlNames.ROLLBACK_ON_FAILURE + ]; + + + + expect(controls.length).toEqual(7); + for(let i = 0 ; i < controls.length ; i++){ + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + test('getAlacartFormControls should return the correct order of controls', () => { + const controls:FormControlModel[] = getAlaCarteFormControls(); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.PRODUCT_FAMILY_ID, + FormControlNames.LCPCLOUD_REGION_ID, + 'legacyRegion', + 'tenantId', + 'platformName', + 'lineOfBusiness', + 'rollbackOnFailure']; + expect(controls.length).toEqual(8); + for(let i = 0 ; i < controls.length ; i++) { + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + function getAlaCarteFormControls(): FormControlModel[] { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const networkName: string = "ExtVL 0"; + const networkStoreKey: string = "ExtVL 0"; + const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, networkStoreKey, networkName, false); + return controls; + } + + test('getAlacartFormControls instance name control validator shall have the expected regex', () => { + const controls:FormControlModel[] = getAlaCarteFormControls(); + + const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME); + const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern); + expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/); + }); + + test('getAlacartFormControls check for mandatory controls', () => { + const controls:FormControlModel[] = getAlaCarteFormControls(); + + const mandatoryControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.LCPCLOUD_REGION_ID, + 'tenantId', + 'platformName', + 'rollbackOnFailure' + ]; + for(let i = 0 ; i < mandatoryControls.length ; i++){ + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); +}); + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts new file mode 100644 index 000000000..c3a622338 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts @@ -0,0 +1,247 @@ +import {Injectable} from "@angular/core"; +import {GenericFormService} from "../../generic-form.service"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {NgRedux} from "@angular-redux/store"; +import {HttpClient} from "@angular/common/http"; +import {BasicControlGenerator} from "../basic.control.generator"; +import * as _ from 'lodash'; +import {Observable, of} from "rxjs"; + +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {LogService} from "../../../../utils/log/log.service"; +import {AppState} from "../../../../store/reducers"; +import {FormGroup} from "@angular/forms"; +import {DropdownFormControl} from "../../../../models/formControlModels/dropdownFormControl.model"; +import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum"; +import {InputFormControl} from "../../../../models/formControlModels/inputFormControl.model"; +import {SelectOption} from "../../../../models/selectOption"; +import {NetworkInstance} from "../../../../models/networkInstance"; +import {NetworkModel} from "../../../../models/networkModel"; +import {Constants} from "../../../../utils/constants"; + +export enum FormControlNames { + INSTANCE_NAME = 'instanceName', + GLOBAL_SUBSCRIBER_ID = 'globalSubscriberId', + PRODUCT_FAMILY_ID = 'productFamilyId', + LCPCLOUD_REGION_ID = 'lcpCloudRegionId', + TENANT_ID = 'tenantId', + AICZONE_ID = 'aicZoneId', + ROLLBACK_ON_FAILURE = 'rollbackOnFailure', + LEGACY_REGION = 'legacyRegion' +} + + +enum InputType { + LCP_REGION = "lcpCloudRegionId", + TENANT = "tenantId", + LOB = "lineOfBusiness", + PLATFORM = "platformName", + ROLLBACK = "rollbackOnFailure", + PRODUCT_FAMILY = "productFamilyId", + VG = "volumeGroupName" +} + +@Injectable() +export class NetworkControlGenerator { + aaiService: AaiService; + + constructor(private genericFormService: GenericFormService, + private _basicControlGenerator: BasicControlGenerator, + private store: NgRedux<AppState>, + private http: HttpClient, + private _aaiService: AaiService, + private _logService: LogService) { + this.aaiService = _aaiService; + } + + getNetworkInstance = (serviceId: string, networkName: string, isUpdateMode : boolean): NetworkInstance => { + let networkInstance : NetworkInstance = null; + if (isUpdateMode && this.store.getState().service.serviceInstance[serviceId] && _.has(this.store.getState().service.serviceInstance[serviceId].networks, networkName)) { + networkInstance = Object.assign({}, this.store.getState().service.serviceInstance[serviceId].networks[networkName]); + } + return networkInstance; + }; + + + getMacroFormControls(serviceId: string, networkStoreKey: string, networkName: string, isUpdateMode : boolean): FormControlModel[] { + networkStoreKey = _.isNil(networkStoreKey) ? networkName : networkStoreKey; + + if (_.isNil(serviceId) || _.isNil(networkStoreKey) || _.isNil(networkName)) { + this._logService.error('should provide serviceId, networkName, networkStoreKey', serviceId); + return []; + } + + const networkInstance = this.getNetworkInstance(serviceId, networkStoreKey, isUpdateMode); + const networkModel = new NetworkModel(this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]); + let result: FormControlModel[] = []; + + if (!_.isNil(networkModel)) { + result.push(this.getInstanceName(networkInstance, serviceId, networkName, networkModel.isEcompGeneratedNaming)); + result.push(this._basicControlGenerator.getProductFamilyControl(networkInstance, result, false)); + result.push(this.getLcpRegionControl(serviceId, networkInstance, result)); + result.push(this._basicControlGenerator.getLegacyRegion(networkInstance)); + result.push(this.getTenantControl(serviceId, networkInstance, result)); + result.push(this.getPlatformControl(networkInstance, result)); + result.push(this.getLineOfBusinessControl(networkInstance, result)); + } + return result; + + } + + getAlaCarteFormControls(serviceId: string, networkStoreKey: string, networkName: string, isUpdateMode : boolean): FormControlModel[] { + networkStoreKey = _.isNil(networkStoreKey) ? networkName : networkStoreKey; + if (_.isNil(serviceId) || _.isNil(networkStoreKey) || _.isNil(networkName)) { + this._logService.error('should provide serviceId, networkName, networkStoreKey', serviceId); + return []; + } + + let result: FormControlModel[] = []; + const networkInstance = this.getNetworkInstance(serviceId, networkStoreKey, isUpdateMode); + const networkModel = new NetworkModel(this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]); + + if (!_.isNil(networkModel)) { + result.push(this.getInstanceName(networkInstance, serviceId, networkName, networkModel.isEcompGeneratedNaming)); + result.push(this._basicControlGenerator.getProductFamilyControl(networkInstance, result, false)); + result.push(this.getLcpRegionControl(serviceId, networkInstance, result)); + result.push(this._basicControlGenerator.getLegacyRegion(networkInstance)); + result.push(this.getTenantControl(serviceId, networkInstance, result)); + result.push(this.getPlatformControl(networkInstance, result)); + result.push(this.getLineOfBusinessControl(networkInstance, result)); + result.push(this.getRollbackOnFailureControl(networkInstance, result)); + } + return result; + + } + + isInputShouldBeShown = (inputType: any): boolean => { + let networkInputs = [InputType.LCP_REGION, InputType.LOB, InputType.TENANT, InputType.PRODUCT_FAMILY, InputType.PLATFORM, InputType.ROLLBACK]; + return networkInputs.indexOf(inputType) > -1; + }; + + getInstanceName(instance : any, serviceId : string, networkName : string, isEcompGeneratedNaming: boolean): FormControlModel { + const networkModel : NetworkModel = this.store.getState().service.serviceHierarchy[serviceId].networks[networkName]; + return this._basicControlGenerator.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, networkModel); + } + + getLineOfBusinessControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: 'lineOfBusiness', + displayName: 'Line of business', + dataTestId: 'lineOfBusiness', + placeHolder: 'Select Line Of Business', + isDisabled: false, + name: "lineOfBusiness", + value: instance ? instance.lineOfBusiness : null, + validations: [], + onInitSelectedField: ['lineOfBusinessList'], + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters) + }) + }; + + getPlatformControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: 'platformName', + displayName: 'Platform', + dataTestId: 'platform', + placeHolder: 'Select Platform', + isDisabled: false, + name: "platform", + value: instance ? instance.platformName : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInitSelectedField: ['platformList'], + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters) + }) + }; + + getTenantControl = (serviceId: string, instance: any, controls: FormControlModel[]): DropdownFormControl => { + const service = this.store.getState().service.serviceInstance[serviceId]; + const globalCustomerId: string = service.globalSubscriberId; + const serviceType: string = service.subscriptionServiceType; + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: FormControlNames.TENANT_ID, + displayName: 'Tenant', + dataTestId: 'tenant', + placeHolder: 'Select Tenant', + name: "tenant", + isDisabled: _.isNil(instance) || _.isNil(instance.lcpCloudRegionId), + onInitSelectedField: instance ? ['lcpRegionsTenantsMap', instance.lcpCloudRegionId] : null, + value: instance ? instance.tenantId : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInit : instance ? this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this.aaiService.getLcpRegionsAndTenants.bind(this, globalCustomerId, serviceType)) : ()=>{}, + }) + }; + + getLcpRegionControl = (serviceId: string, instance: any, controls: FormControlModel[]): DropdownFormControl => { + const service = this.store.getState().service.serviceInstance[serviceId]; + const globalCustomerId: string = service.globalSubscriberId; + const serviceType: string = service.subscriptionServiceType; + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: 'lcpCloudRegionId', + displayName: 'LCP region', + dataTestId: 'lcpRegion', + placeHolder: 'Select LCP Region', + name: "lcpRegion", + isDisabled: false, + value: instance ? instance.lcpCloudRegionId : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInitSelectedField: ['lcpRegionList'], + onInit: this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this._aaiService.getLcpRegionsAndTenants.bind(this, globalCustomerId, serviceType)), + onChange: (param: string, form: FormGroup) => { + form.controls[FormControlNames.TENANT_ID].enable(); + form.controls[FormControlNames.TENANT_ID].reset(); + if (!_.isNil(globalCustomerId) && !_.isNil(serviceType)) { + this._basicControlGenerator.getSubscribeResult.bind(this, this._aaiService.getLcpRegionsAndTenants(globalCustomerId, serviceType).subscribe(res => { + controls.find(item => item.controlName === FormControlNames.TENANT_ID)['options$'] = res.lcpRegionsTenantsMap[param]; + if(res.lcpRegionsTenantsMap[param]){ + controls.find(item => item.controlName === FormControlNames.TENANT_ID)['hasEmptyOptions'] = res.lcpRegionsTenantsMap[param].length === 0; + } + })); + } + + if (Constants.LegacyRegion.MEGA_REGION.indexOf(param) !== -1) { + form.controls['legacyRegion'].enable(); + controls.find(item => item.controlName === 'legacyRegion').isVisible = true; + + } else { + controls.find(item => item.controlName === 'legacyRegion').isVisible = false; + form.controls['legacyRegion'].setValue(null); + form.controls['legacyRegion'].reset(); + form.controls['legacyRegion'].disable(); + } + } + }) + }; + + getRollbackOnFailureControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: FormControlNames.ROLLBACK_ON_FAILURE, + displayName: 'Rollback on failure', + dataTestId: 'rollback', + placeHolder: 'Rollback on failure', + isDisabled: false, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + value: instance ? instance.rollbackOnFailure : 'true', + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this.getRollBackOnFailureOptions) + }) + }; + + getRollBackOnFailureOptions = (): Observable<SelectOption[]> => { + return of([ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]); + }; +} diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/service.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/service.control.generator.spec.ts new file mode 100644 index 000000000..b7a728c6d --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/service.control.generator.spec.ts @@ -0,0 +1,1859 @@ +import {getTestBed, TestBed} from '@angular/core/testing'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; +import {NgRedux} from '@angular-redux/store'; +import {FormControlNames, ServiceControlGenerator} from "./service.control.generator"; +import {BasicControlGenerator} from "./basic.control.generator"; +import {AaiService} from "../../../services/aaiService/aai.service"; +import {GenericFormService} from "../generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import {FormControlModel, ValidatorModel, ValidatorOptions} from "../../../models/formControlModels/formControl.model"; +import {LogService} from "../../../utils/log/log.service"; +import {FormControlType} from "../../../models/formControlModels/formControlTypes.enum"; +import {DropdownFormControl} from "../../../models/formControlModels/dropdownFormControl.model"; +import {FeatureFlagsService} from "../../../services/featureFlag/feature-flags.service"; + +class MockAppStore<T> { + getState(){ + return { + "global": { + "name": null, + "flags": { + "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false, + "FLAG_SHOW_ASSIGNMENTS": true, + "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, + "FLAG_UNASSIGN_SERVICE": true, + "FLAG_SHOW_VERIFY_SERVICE": false, + "FLAG_COLLECTION_RESOURCE_SUPPORT": true, + "FLAG_DUPLICATE_VNF": true, + "FLAG_SERVICE_MODEL_CACHE": true, + "CREATE_INSTANCE_TEST": false, + "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false, + "FLAG_ASYNC_INSTANTIATION": true, + "FLAG_ASYNC_JOBS": true, + "EMPTY_DRAWING_BOARD_TEST": false, + "FLAG_ADD_MSO_TESTAPI_FIELD": true + }, + "type": "[FLAGS] Update" + }, + "service": { + "serviceHierarchy": { + "6e59c5de-f052-46fa-aa7e-2fca9d674c44": { + "service": { + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "ComplexService", + "version": "1.0", + "toscaModelURL": null, + "category": "Emanuel", + "serviceType": "", + "serviceRole": "", + "description": "ComplexService", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": {} + }, + "vnfs": { + "VF_vMee 0": { + "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60", + "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e", + "description": "VSP_vMee", + "name": "VF_vMee", + "version": "2.0", + "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9", + "inputs": {}, + "commands": {}, + "properties": { + "max_instances": 10, + "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", + "sctp-b-IPv6_ethertype": "IPv6", + "sctp-a-egress_rule_application": "any", + "sctp-b-ingress_action": "pass", + "sctp-b-ingress_rule_protocol": "icmp", + "ncb2_Internal1_mac": "00:11:22:EF:AC:DF", + "sctp-b-ipv6-ingress-src_start_port": "0.0", + "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", + "sctp-a-ipv6-ingress-dst_start_port": "0", + "sctp-b-ipv6-ingress_rule_application": "any", + "domain_name": "default-domain", + "sctp-a-ingress_rule_protocol": "icmp", + "sctp-b-egress-src_start_port": "0.0", + "sctp-a-egress_src_addresses": "local", + "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group", + "sctp-a-egress-src_start_port": "0.0", + "sctp-a-ingress_ethertype": "IPv4", + "sctp-b-ipv6-ingress-dst_end_port": "65535", + "sctp-b-dst_subnet_prefix_v6": "::", + "nf_naming": "{ecomp_generated_naming=true}", + "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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix_len": "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:11:22:EF:AC:DF", + "sctp-a-egress_ethertype": "IPv4", + "vlc_st_service_mode": "in-network-nat", + "sctp-a-ipv6-egress_ethertype": "IPv4", + "sctp-a-egress-src_end_port": "65535.0", + "sctp-b-ipv6-egress_rule_application": "any", + "sctp-b-egress_action": "pass", + "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:11:22:EF:AC:DF", + "sctp-a-ipv6-ingress-src_start_port": "0.0", + "sctp-b-ipv6-egress_ethertype": "IPv4", + "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", + "ecomp_generated_naming": "false", + "sctp-a-IPv6_ethertype": "IPv6", + "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", + "sctp-a-ipv6-ingress-src_end_port": "65535.0", + "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-b-ingress_rule_application": "any", + "int2_sec_group_name": "int2-sec-group", + "vlc_flavor_name": "nd.c16r64d1", + "sctp-b-ipv6-egress_src_addresses": "local", + "vlc_st_interface_type_int1": "other1", + "sctp-b-egress-src_end_port": "65535.0", + "sctp-a-ipv6-egress-dst_start_port": "0", + "vlc_st_interface_type_int2": "other2", + "sctp-a-ipv6-egress_rule_protocol": "any", + "Internal2_shared": "false", + "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0", + "Internal2_rpf": "disable", + "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", + "sctp-a-ipv6-egress_src_end_port": "65535", + "Internal1_forwarding_mode": "l2", + "Internal2_dhcp": "false", + "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: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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix": "0.0.0.0", + "Internal1_net_cidr_len": "17", + "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: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: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:11:22:EF:AC:DF", + "vlc_st_interface_type_oam": "management", + "multi_stage_design": "true", + "oam_sec_group_name": "oam-sec-group", + "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": "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", + "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0", + "sctp-a-ipv6-ingress_dst_addresses": "local", + "sctp-a-egress_rule_protocol": "icmp", + "sctp-b-ipv6-egress_action": "pass", + "sctp-a-ipv6-egress_action": "pass", + "Internal1_shared": "false", + "sctp-b-ipv6-ingress_rule_protocol": "any", + "Internal2_net_cidr_len": "17", + "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-a-ingress-src_end_port": "65535.0", + "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0", + "sctp-a-egress-dst_end_port": "65535.0", + "sctp-a-ingress_action": "pass", + "sctp-b-egress_rule_protocol": "icmp", + "sctp-b-ipv6-ingress_action": "pass", + "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: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", + "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0", + "Internal1_allow_transit": "true", + "gpb_flavor_name": "nv.c20r64d1", + "availability_zone_max_count": "1", + "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2", + "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:11:22:EF:AC:DF", + "sctp-a-ingress-src_subnet_prefix": "0.0.0.0", + "sctp-a-ipv6-ingress_action": "pass", + "Internal1_rpf": "disable", + "sctp-b-ingress_ethertype": "IPv4", + "sctp-b-egress_rule_application": "any", + "sctp-b-ingress-src_end_port": "65535.0", + "sctp-a-ipv6-ingress_rule_protocol": "any", + "sctp-a-ingress-src_start_port": "0.0", + "sctp-b-egress-dst_end_port": "65535.0" + }, + "type": "VF", + "modelCustomizationName": "VF_vMee 0", + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "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": { + "Port Mirroring Configuration By Policy 0": { + "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50", + "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7", + "description": "A port mirroring configuration by policy object", + "name": "Port Mirroring Configuration By Policy", + "version": "27.0", + "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Configuration", + "modelCustomizationName": "Port Mirroring Configuration By Policy 0", + "sourceNodes": [], + "collectorNodes": null, + "configurationByPolicy": false + } + }, + "serviceProxies": {}, + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {} + } + }, + "pnfs": {} + } + }, + "serviceInstance": {}, + "lcpRegionsAndTenants": { + "lcpRegionList": [ + { + "id": "JANET25", + "name": "JANET25", + "isPermitted": true + }, + { + "id": "hvf6", + "name": "hvf6", + "isPermitted": true + } + ], + "lcpRegionsTenantsMap": { + "JANET25": [ + { + "id": "092eb9e8e4b7412e8787dd091bc58e86", + "name": "USP-SIP-IC-24335-T-01", + "isPermitted": true + } + ], + "hvf6": [ + { + "id": "bae71557c5bb4d5aac6743a4e5f1d054", + "name": "AIN Web Tool-15-D-testalexandria", + "isPermitted": true + }, + { + "id": "229bcdc6eaeb4ca59d55221141d01f8e", + "name": "AIN Web Tool-15-D-STTest2", + "isPermitted": true + }, + { + "id": "1178612d2b394be4834ad77f567c0af2", + "name": "AIN Web Tool-15-D-SSPtestcustome", + "isPermitted": true + }, + { + "id": "19c5ade915eb461e8af52fb2fd8cd1f2", + "name": "AIN Web Tool-15-D-UncheckedEcopm", + "isPermitted": true + }, + { + "id": "de007636e25249238447264a988a927b", + "name": "AIN Web Tool-15-D-dfsdf", + "isPermitted": true + }, + { + "id": "62f29b3613634ca6a3065cbe0e020c44", + "name": "AIN/SMS-16-D-Multiservices1", + "isPermitted": true + }, + { + "id": "649289e30d3244e0b48098114d63c2aa", + "name": "AIN Web Tool-15-D-SSPST66", + "isPermitted": true + }, + { + "id": "3f21eeea6c2c486bba31dab816c05a32", + "name": "AIN Web Tool-15-D-ASSPST47", + "isPermitted": true + }, + { + "id": "f60ce21d3ee6427586cff0d22b03b773", + "name": "CESAR-100-D-sspjg67246", + "isPermitted": true + }, + { + "id": "8774659e425f479895ae091bb5d46560", + "name": "CESAR-100-D-sspjg68359", + "isPermitted": true + }, + { + "id": "624eb554b0d147c19ff8885341760481", + "name": "AINWebTool-15-D-iftach", + "isPermitted": true + }, + { + "id": "214f55f5fc414c678059c383b03e4962", + "name": "CESAR-100-D-sspjg612401", + "isPermitted": true + }, + { + "id": "c90666c291664841bb98e4d981ff1db5", + "name": "CESAR-100-D-sspjg621340", + "isPermitted": true + }, + { + "id": "ce5b6bc5c7b348e1bf4b91ac9a174278", + "name": "sspjg621351cloned", + "isPermitted": true + }, + { + "id": "b386b768a3f24c8e953abbe0b3488c02", + "name": "AINWebTool-15-D-eteancomp", + "isPermitted": true + }, + { + "id": "dc6c4dbfd225474e9deaadd34968646c", + "name": "AINWebTool-15-T-SPFET", + "isPermitted": true + }, + { + "id": "02cb5030e9914aa4be120bd9ed1e19eb", + "name": "AINWebTool-15-X-eeweww", + "isPermitted": true + }, + { + "id": "f2f3830e4c984d45bcd00e1a04158a79", + "name": "CESAR-100-D-spjg61909", + "isPermitted": true + }, + { + "id": "05b91bd5137f4929878edd965755c06d", + "name": "CESAR-100-D-sspjg621512cloned", + "isPermitted": true + }, + { + "id": "7002fbe8482d4a989ddf445b1ce336e0", + "name": "AINWebTool-15-X-vdr", + "isPermitted": true + }, + { + "id": "4008522be43741dcb1f5422022a2aa0b", + "name": "AINWebTool-15-D-ssasa", + "isPermitted": true + }, + { + "id": "f44e2e96a1b6476abfda2fa407b00169", + "name": "AINWebTool-15-D-PFNPT", + "isPermitted": true + }, + { + "id": "b69a52bec8a84669a37a1e8b72708be7", + "name": "AINWebTool-15-X-vdre", + "isPermitted": true + }, + { + "id": "fac7d9fd56154caeb9332202dcf2969f", + "name": "AINWebTool-15-X-NONPODECOMP", + "isPermitted": true + }, + { + "id": "2d34d8396e194eb49969fd61ffbff961", + "name": "DN5242-Nov16-T5", + "isPermitted": true + }, + { + "id": "cb42a77ff45b48a8b8deb83bb64acc74", + "name": "ro-T11", + "isPermitted": true + }, + { + "id": "fa45ca53c80b492fa8be5477cd84fc2b", + "name": "ro-T112", + "isPermitted": true + }, + { + "id": "4914ab0ab3a743e58f0eefdacc1dde77", + "name": "DN5242-Nov21-T1", + "isPermitted": true + }, + { + "id": "d0a3e3f2964542259d155a81c41aadc3", + "name": "test-hvf6-09", + "isPermitted": true + }, + { + "id": "cbb99fe4ada84631b7baf046b6fd2044", + "name": "DN5242-Nov16-T3", + "isPermitted": true + } + ] + } + }, + "productFamilies": [ + { + "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", + "name": "SCOTTIE", + "isPermitted": true + }, + { + "id": "17cc1042-527b-11e6-beb8-9e71128cae77", + "name": "IGNACIO", + "isPermitted": true + }, + { + "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "name": "Christie", + "isPermitted": true + }, + { + "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7", + "name": "Enhanced Services", + "isPermitted": true + }, + { + "id": "vTerrance", + "name": "vTerrance", + "isPermitted": true + }, + { + "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f", + "name": "vSCP", + "isPermitted": true + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": true + }, + { + "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "name": "BVOIP", + "isPermitted": true + }, + { + "id": "db171b8f-115c-4992-a2e3-ee04cae357e0", + "name": "LINDSEY", + "isPermitted": true + }, + { + "id": "LRSI-OSPF", + "name": "LRSI-OSPF", + "isPermitted": true + }, + { + "id": "vRosemarie", + "name": "HNGATEWAY", + "isPermitted": true + }, + { + "id": "vHNPaas", + "name": "WILKINS", + "isPermitted": true + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce", + "name": "VROUTER", + "isPermitted": true + }, + { + "id": "Cisneros", + "name": "vMuriel", + "isPermitted": true + }, + { + "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1", + "name": "CARA Griffin", + "isPermitted": true + }, + { + "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "name": "DARREN MCGEE", + "isPermitted": true + }, + { + "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1", + "name": "Transport", + "isPermitted": true + }, + { + "id": "vSalvatore", + "name": "vSalvatore", + "isPermitted": true + }, + { + "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "name": "Josefina", + "isPermitted": true + }, + { + "id": "vHubbard", + "name": "vHubbard", + "isPermitted": true + }, + { + "id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "name": "DARREN MCGEE", + "isPermitted": true + } + ], + "serviceTypes": { + "e433710f-9217-458d-a79d-1c7aff376d89": [ + { + "id": "0", + "name": "vRichardson", + "isPermitted": false + }, + { + "id": "1", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "2", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "3", + "name": "vJamie", + "isPermitted": false + }, + { + "id": "4", + "name": "vVoiceMail", + "isPermitted": false + }, + { + "id": "5", + "name": "Kennedy", + "isPermitted": false + }, + { + "id": "6", + "name": "vSEGW", + "isPermitted": false + }, + { + "id": "7", + "name": "vVM", + "isPermitted": false + }, + { + "id": "8", + "name": "vOTA", + "isPermitted": false + }, + { + "id": "9", + "name": "vMME", + "isPermitted": false + }, + { + "id": "10", + "name": "vMNS", + "isPermitted": false + }, + { + "id": "11", + "name": "vSCP", + "isPermitted": false + }, + { + "id": "12", + "name": "VPMS", + "isPermitted": false + }, + { + "id": "13", + "name": "vMMSC", + "isPermitted": false + }, + { + "id": "14", + "name": "SSD", + "isPermitted": false + }, + { + "id": "15", + "name": "vMOG", + "isPermitted": false + }, + { + "id": "16", + "name": "LINDSEY", + "isPermitted": false + }, + { + "id": "17", + "name": "JOHANNA_SANTOS", + "isPermitted": false + }, + { + "id": "18", + "name": "vCarroll", + "isPermitted": false + } + ] + }, + "aicZones": [ + { + "id": "NFT1", + "name": "NFTJSSSS-NFT1" + }, + { + "id": "JAG1", + "name": "YUDFJULP-JAG1" + }, + { + "id": "YYY1", + "name": "UUUAIAAI-YYY1" + }, + { + "id": "BAN1", + "name": "VSDKYUTP-BAN1" + }, + { + "id": "DKJ1", + "name": "DKJSJDKA-DKJ1" + }, + { + "id": "MCS1", + "name": "ASACMAMS-MCS1" + }, + { + "id": "UIO1", + "name": "uioclli1-UIO1" + }, + { + "id": "RAJ1", + "name": "YGBIJNLQ-RAJ1" + }, + { + "id": "OPA1", + "name": "opaclli1-OPA1" + }, + { + "id": "SDE1", + "name": "ZXCVBNMA-SDE1" + }, + { + "id": "VEN2", + "name": "FGHJUHIL-VEN2" + }, + { + "id": "ORL1", + "name": "ORLDFLMA-ORL1" + }, + { + "id": "JAD1", + "name": "JADECLLI-JAD1" + }, + { + "id": "ZXL1", + "name": "LWLWCANN-ZXL1" + }, + { + "id": "CKL1", + "name": "CLKSKCKK-CKL1" + }, + { + "id": "SDF1", + "name": "sdfclli1-SDF1" + }, + { + "id": "RAD1", + "name": "RADICAL1-RAD1" + }, + { + "id": "KIT1", + "name": "BHYJFGLN-KIT1" + }, + { + "id": "REL1", + "name": "INGERFGT-REL1" + }, + { + "id": "JNL1", + "name": "CJALSDAC-JNL1" + }, + { + "id": "OLK1", + "name": "OLKOLKLS-OLK1" + }, + { + "id": "CHI1", + "name": "CHILLIWE-CHI1" + }, + { + "id": "UUU4", + "name": "UUUAAAUU-UUU4" + }, + { + "id": "TUF1", + "name": "TUFCLLI1-TUF1" + }, + { + "id": "KJN1", + "name": "CKALDKSA-KJN1" + }, + { + "id": "SAM1", + "name": "SNDGCA64-SAN1" + }, + { + "id": "SCK1", + "name": "SCKSCKSK-SCK1" + }, + { + "id": "HJH1", + "name": "AOEEQQQD-HJH1" + }, + { + "id": "HGD1", + "name": "SDFQWHGD-HGD1" + }, + { + "id": "KOR1", + "name": "HYFLNBVT-KOR1" + }, + { + "id": "ATL43", + "name": "AICLOCID-ATL43" + }, + { + "id": "ATL54", + "name": "AICFTAAI-ATL54" + }, + { + "id": "ATL66", + "name": "CLLIAAII-ATL66" + }, + { + "id": "VEL1", + "name": "BNMLKUIK-VEL1" + }, + { + "id": "ICC1", + "name": "SANJITAT-ICC1" + }, + { + "id": "MNT11", + "name": "WSXEFBTH-MNT11" + }, + { + "id": "DEF2", + "name": "WSBHGTYL-DEF2" + }, + { + "id": "MAD11", + "name": "SDFQWGKL-MAD11" + }, + { + "id": "OLG1", + "name": "OLHOLHOL-OLG1" + }, + { + "id": "GAR1", + "name": "NGFVSJKO-GAR1" + }, + { + "id": "SAN22", + "name": "GNVLSCTL-SAN22" + }, + { + "id": "HRG1", + "name": "HRGHRGGS-HRG1" + }, + { + "id": "JCS1", + "name": "JCSJSCJS-JCS1" + }, + { + "id": "DHA12", + "name": "WSXEDECF-DHA12" + }, + { + "id": "HJE1", + "name": "AOEEWWWD-HJE1" + }, + { + "id": "NCA1", + "name": "NCANCANN-NCA1" + }, + { + "id": "IOP1", + "name": "iopclli1-IOP1" + }, + { + "id": "RTY1", + "name": "rtyclli1-RTY1" + }, + { + "id": "KAP1", + "name": "HIOUYTRQ-KAP1" + }, + { + "id": "ZEN1", + "name": "ZENCLLI1-ZEN1" + }, + { + "id": "HKA1", + "name": "JAKHLASS-HKA1" + }, + { + "id": "CQK1", + "name": "CQKSCAKK-CQK1" + }, + { + "id": "SAI1", + "name": "UBEKQLPD-SAI1" + }, + { + "id": "ERT1", + "name": "ertclli1-ERT1" + }, + { + "id": "IBB1", + "name": "PLMKOIJU-IBB1" + }, + { + "id": "TIR2", + "name": "PLKINHYI-TIR2" + }, + { + "id": "HSD1", + "name": "CHASKCDS-HSD1" + }, + { + "id": "SLF78", + "name": "SDCTLFN1-SLF78" + }, + { + "id": "SEE78", + "name": "SDCTEEE4-SEE78" + }, + { + "id": "SAN13", + "name": "TOKYJPFA-SAN13" + }, + { + "id": "SAA78", + "name": "SDCTAAA1-SAA78" + }, + { + "id": "LUC1", + "name": "ATLDFGYC-LUC1" + }, + { + "id": "AMD13", + "name": "MEMATLAN-AMD13" + }, + { + "id": "TOR1", + "name": "TOROONXN-TOR1" + }, + { + "id": "QWE1", + "name": "QWECLLI1-QWE1" + }, + { + "id": "ZOG1", + "name": "ZOGASTRO-ZOG1" + }, + { + "id": "CAL33", + "name": "CALIFORN-CAL33" + }, + { + "id": "SHH78", + "name": "SDIT1HHH-SHH78" + }, + { + "id": "DSA1", + "name": "LKJHGFDS-DSA1" + }, + { + "id": "CLG1", + "name": "CLGRABAD-CLG1" + }, + { + "id": "BNA1", + "name": "BNARAGBK-BNA1" + }, + { + "id": "ATL84", + "name": "CANTTCOC-ATL84" + }, + { + "id": "APP1", + "name": "WBHGTYUI-APP1" + }, + { + "id": "RJN1", + "name": "RJNRBZAW-RJN1" + }, + { + "id": "EHH78", + "name": "SDCSHHH5-EHH78" + }, + { + "id": "mac10", + "name": "PKGTESTF-mac10" + }, + { + "id": "SXB78", + "name": "SDCTGXB1-SXB78" + }, + { + "id": "SAX78", + "name": "SDCTAXG1-SAX78" + }, + { + "id": "SYD1", + "name": "SYDNAUBV-SYD1" + }, + { + "id": "TOK1", + "name": "TOKYJPFA-TOK1" + }, + { + "id": "KGM2", + "name": "KGMTNC20-KGM2" + }, + { + "id": "DCC1b", + "name": "POIUYTGH-DCC1b" + }, + { + "id": "SKK78", + "name": "SDCTKKK1-SKK78" + }, + { + "id": "SGG78", + "name": "SDCTGGG1-SGG78" + }, + { + "id": "SJJ78", + "name": "SDCTJJJ1-SJJ78" + }, + { + "id": "SBX78", + "name": "SDCTBXG1-SBX78" + }, + { + "id": "LAG1", + "name": "LARGIZON-LAG1" + }, + { + "id": "IAA1", + "name": "QAZXSWED-IAA1" + }, + { + "id": "POI1", + "name": "PLMNJKIU-POI1" + }, + { + "id": "LAG1a", + "name": "LARGIZON-LAG1a" + }, + { + "id": "PBL1", + "name": "PBLAPBAI-PBL1" + }, + { + "id": "LAG45", + "name": "LARGIZON-LAG1a" + }, + { + "id": "MAR1", + "name": "MNBVCXZM-MAR1" + }, + { + "id": "HST70", + "name": "HSTNTX70-HST70" + }, + { + "id": "DCC1a", + "name": "POIUYTGH-DCC1a" + }, + { + "id": "TOL1", + "name": "TOLDOH21-TOL1" + }, + { + "id": "LON1", + "name": "LONEENCO-LON1" + }, + { + "id": "SJU78", + "name": "SDIT1JUB-SJU78" + }, + { + "id": "STN27", + "name": "HSTNTX01-STN27" + }, + { + "id": "SSW56", + "name": "ss8126GT-SSW56" + }, + { + "id": "SBB78", + "name": "SDIT1BBB-SBB78" + }, + { + "id": "DCC3", + "name": "POIUYTGH-DCC3" + }, + { + "id": "GNV1", + "name": "GNVLSCTL-GNV1" + }, + { + "id": "WAS1", + "name": "WASHDCSW-WAS1" + }, + { + "id": "TOY1", + "name": "TORYONNZ-TOY1" + }, + { + "id": "STT1", + "name": "STTLWA02-STT1" + }, + { + "id": "STG1", + "name": "STTGGE62-STG1" + }, + { + "id": "SLL78", + "name": "SDCTLLL1-SLL78" + }, + { + "id": "SBU78", + "name": "SDIT1BUB-SBU78" + }, + { + "id": "ATL2", + "name": "ATLNGANW-ATL2" + }, + { + "id": "BOT1", + "name": "BOTHWAKY-BOT1" + }, + { + "id": "SNG1", + "name": "SNGPSIAU-SNG1" + }, + { + "id": "NYC1", + "name": "NYCMNY54-NYC1" + }, + { + "id": "LAG1b", + "name": "LARGIZON-LAG1b" + }, + { + "id": "AMD15", + "name": "AMDFAA01-AMD15" + }, + { + "id": "SNA1", + "name": "SNANTXCA-SNA1" + }, + { + "id": "PLT1", + "name": "PLTNCA60-PLT1" + }, + { + "id": "TLP1", + "name": "TLPNXM18-TLP1" + }, + { + "id": "SDD81", + "name": "SAIT1DD6-SDD81" + }, + { + "id": "DCC1", + "name": "POIUYTGH-DCC1" + }, + { + "id": "DCC2", + "name": "POIUYTGH-DCC2" + }, + { + "id": "OKC1", + "name": "OKCBOK55-OKC1" + }, + { + "id": "PAR1", + "name": "PARSFRCG-PAR1" + }, + { + "id": "TES36", + "name": "ABCEETES-TES36" + }, + { + "id": "COM1", + "name": "PLMKOPIU-COM1" + }, + { + "id": "ANI1", + "name": "ATLNGTRE-ANI1" + }, + { + "id": "SDG78", + "name": "SDIT1BDG-SDG78" + }, + { + "id": "mac20", + "name": "PKGTESTF-mac20" + }, + { + "id": "DSF45", + "name": "DSFBG123-DSF45" + }, + { + "id": "HST25", + "name": "HSTNTX01-HST25" + }, + { + "id": "AMD18", + "name": "AUDIMA01-AMD18" + }, + { + "id": "SAA80", + "name": "SAIT9AA3-SAA80" + }, + { + "id": "SSA56", + "name": "SSIT2AA7-SSA56" + }, + { + "id": "SDD82", + "name": "SAIT1DD9-SDD82" + }, + { + "id": "JCV1", + "name": "JCVLFLBW-JCV1" + }, + { + "id": "SUL2", + "name": "WERTYUJK-SUL2" + }, + { + "id": "PUR1", + "name": "purelyde-PUR1" + }, + { + "id": "FDE55", + "name": "FDERT555-FDE55" + }, + { + "id": "SITE", + "name": "LONEENCO-SITE" + }, + { + "id": "ATL1", + "name": "ATLNGAMA-ATL1" + }, + { + "id": "JUL1", + "name": "ZXCVBNMM-JUL1" + }, + { + "id": "TAT34", + "name": "TESAAISB-TAT34" + }, + { + "id": "XCP12", + "name": "CHKGH123-XCP12" + }, + { + "id": "RAI1", + "name": "poiuytre-RAI1" + }, + { + "id": "HPO1", + "name": "ATLNGAUP-HPO1" + }, + { + "id": "KJF12", + "name": "KJFDH123-KJF12" + }, + { + "id": "SCC80", + "name": "SAIT9CC3-SCC80" + }, + { + "id": "SAA12", + "name": "SAIT9AF8-SAA12" + }, + { + "id": "SAA14", + "name": "SAIT1AA9-SAA14" + }, + { + "id": "ATL35", + "name": "TTESSAAI-ATL35" + }, + { + "id": "CWY1", + "name": "CWYMOWBS-CWY1" + }, + { + "id": "ATL76", + "name": "TELEPAAI-ATL76" + }, + { + "id": "DSL12", + "name": "DSLFK242-DSL12" + }, + { + "id": "ATL53", + "name": "AAIATLTE-ATL53" + }, + { + "id": "SAA11", + "name": "SAIT9AA2-SAA11" + }, + { + "id": "ATL62", + "name": "TESSASCH-ATL62" + }, + { + "id": "AUG1", + "name": "ASDFGHJK-AUG1" + }, + { + "id": "POI22", + "name": "POIUY123-POI22" + }, + { + "id": "SAA13", + "name": "SAIT1AA9-SAA13" + }, + { + "id": "BHY17", + "name": "BHYTFRF3-BHY17" + }, + { + "id": "LIS1", + "name": "HOSTPROF-LIS1" + }, + { + "id": "SIP1", + "name": "ZXCVBNMK-SIP1" + }, + { + "id": "ATL99", + "name": "TEESTAAI-ATL43" + }, + { + "id": "ATL64", + "name": "FORLOAAJ-ATL64" + }, + { + "id": "TAT33", + "name": "TESAAISA-TAT33" + }, + { + "id": "RAD10", + "name": "INDIPUNE-RAD10" + }, + { + "id": "RTW5", + "name": "BHYTFRY4-RTW5" + }, + { + "id": "JGS1", + "name": "KSJKKKKK-JGS1" + }, + { + "id": "ATL98", + "name": "TEESTAAI-ATL43" + }, + { + "id": "WAN1", + "name": "LEIWANGW-WAN1" + }, + { + "id": "ATL44", + "name": "ATLSANAB-ATL44" + }, + { + "id": "RTD2", + "name": "BHYTFRk4-RTD2" + }, + { + "id": "NIR1", + "name": "ORFLMANA-NIR1" + }, + { + "id": "ATL75", + "name": "SANAAIRE-ATL75" + }, + { + "id": "NUM1", + "name": "QWERTYUI-NUM1" + }, + { + "id": "MTN32", + "name": "MDTWNJ21-MTN32" + }, + { + "id": "RTZ4", + "name": "BHYTFRZ6-RTZ4" + }, + { + "id": "ATL56", + "name": "ATLSANAC-ATL56" + }, + { + "id": "AMS1", + "name": "AMSTNLBW-AMS1" + }, + { + "id": "RCT1", + "name": "AMSTERNL-RCT1" + }, + { + "id": "JAN1", + "name": "ORFLMATT-JAN1" + }, + { + "id": "ABC14", + "name": "TESAAISA-ABC14" + }, + { + "id": "TAT37", + "name": "TESAAISD-TAT37" + }, + { + "id": "MIC54", + "name": "MICHIGAN-MIC54" + }, + { + "id": "ABC11", + "name": "ATLSANAI-ABC11" + }, + { + "id": "AMF11", + "name": "AMDOCS01-AMF11" + }, + { + "id": "ATL63", + "name": "ATLSANEW-ATL63" + }, + { + "id": "ABC12", + "name": "ATLSECIA-ABC12" + }, + { + "id": "MTN20", + "name": "MDTWNJ21-MTN20" + }, + { + "id": "ABC15", + "name": "AAITESAN-ABC15" + }, + { + "id": "AVT1", + "name": "AVTRFLHD-AVT1" + }, + { + "id": "ATL34", + "name": "ATLSANAI-ATL34" + } + ], + "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": "[LCP_REGIONS_AND_TENANTS] Update", + "subscribers": [ + { + "id": "CAR_2020_ER", + "name": "CAR_2020_ER", + "isPermitted": true + }, + { + "id": "21014aa2-526b-11e6-beb8-9e71128cae77", + "name": "JULIO ERICKSON", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-2", + "name": "DALE BRIDGES", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-1", + "name": "LLOYD BRIDGES", + "isPermitted": false + }, + { + "id": "jimmy-example", + "name": "JimmyExampleCust-20161102", + "isPermitted": false + }, + { + "id": "jimmy-example2", + "name": "JimmyExampleCust-20161103", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-102", + "name": "ERICA5779-TestSub-PWT-102", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-101", + "name": "ERICA5779-TestSub-PWT-101", + "isPermitted": false + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-4", + "name": "ERICA5779-Subscriber-5", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-103", + "name": "ERICA5779-TestSub-PWT-103", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-2", + "name": "ERICA5779-Subscriber-2", + "isPermitted": false + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "SILVIA ROBBINS", + "isPermitted": true + }, + { + "id": "ERICA5779-Subscriber-3", + "name": "ERICA5779-Subscriber-3", + "isPermitted": false + }, + { + "id": "31739f3e-526b-11e6-beb8-9e71128cae77", + "name": "CRAIG/ROBERTS", + "isPermitted": false + } + ] + } + } + } +} + +class MockFeatureFlagsService {} + +describe('Service Control Generator', () => { + let injector; + let service: ServiceControlGenerator; + let httpMock: HttpTestingController; + + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [ServiceControlGenerator, + GenericFormService, + BasicControlGenerator, + AaiService, + FormBuilder, + LogService, + {provide:FeatureFlagsService, useClass: MockFeatureFlagsService}, + {provide: NgRedux, useClass: MockAppStore}] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(ServiceControlGenerator); + httpMock = injector.get(HttpTestingController); + + })().then(done).catch(done.fail)); + + + test('ServiceControlGenerator should return the correct controls with correct order', () => { + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId); + const globalSubscriberIdControl : DropdownFormControl = <DropdownFormControl>controls.find(item => item.controlName === FormControlNames.GLOBAL_SUBSCRIBER_ID); + + expect(globalSubscriberIdControl.validations.find(val => val.validatorName === ValidatorOptions.required)).toBeDefined(); + expect(globalSubscriberIdControl.dataTestId).toEqual('subscriberName'); + expect(globalSubscriberIdControl.type).toEqual(FormControlType.DROPDOWN); + expect(globalSubscriberIdControl.isDisabled).toBeFalsy(); + expect(globalSubscriberIdControl.placeHolder).toEqual('Select Subscriber Name'); + expect(globalSubscriberIdControl.displayName).toEqual('Subscriber name'); + expect(globalSubscriberIdControl.onInit).toBeDefined(); + expect(globalSubscriberIdControl.onChange).toBeDefined(); + + const serviceTypeControl : DropdownFormControl = <DropdownFormControl>controls.find(item => item.controlName === FormControlNames.SUBSCRIPTION_SERVICE_TYPE); + expect(serviceTypeControl.validations.find(val => val.validatorName === ValidatorOptions.required)).toBeDefined(); + expect(serviceTypeControl.dataTestId).toEqual('serviceType'); + expect(serviceTypeControl.type).toEqual(FormControlType.DROPDOWN); + expect(serviceTypeControl.isDisabled).toBeTruthy(); + expect(serviceTypeControl.placeHolder).toEqual('Select Service Type'); + expect(serviceTypeControl.displayName).toEqual('Service type'); + expect(serviceTypeControl.onInit).toBeDefined(); + expect(serviceTypeControl.onChange).toBeDefined(); + + const productFamilyControl : DropdownFormControl = <DropdownFormControl>controls.find(item => item.controlName === FormControlNames.PRODUCT_FAMILY_ID); + expect(productFamilyControl.validations.find(val => val.validatorName === ValidatorOptions.required)).toBeDefined(); + expect(productFamilyControl.dataTestId).toEqual('productFamily'); + expect(productFamilyControl.type).toEqual(FormControlType.DROPDOWN); + expect(productFamilyControl.isDisabled).toBeFalsy(); + expect(productFamilyControl.placeHolder).toEqual('Select Product Family'); + expect(productFamilyControl.displayName).toEqual('Product family'); + expect(productFamilyControl.onInit).toBeDefined(); + + const lcpRegionControl : DropdownFormControl = <DropdownFormControl>controls.find(item => item.controlName === FormControlNames.LCPCLOUD_REGION_ID); + expect(lcpRegionControl.validations.find(val => val.validatorName === ValidatorOptions.required)).toBeDefined(); + expect(lcpRegionControl.dataTestId).toEqual('lcpRegion'); + expect(lcpRegionControl.type).toEqual(FormControlType.DROPDOWN); + expect(lcpRegionControl.isDisabled).toBeTruthy(); + expect(lcpRegionControl.placeHolder).toEqual('Select LCP Region'); + expect(lcpRegionControl.displayName).toEqual('LCP region'); + expect(lcpRegionControl.onInit).toBeDefined(); + expect(lcpRegionControl.onChange).toBeDefined(); + + const tenantControl : DropdownFormControl = <DropdownFormControl>controls.find(item => item.controlName === FormControlNames.TENANT_ID); + expect(tenantControl.validations.find(val => val.validatorName === ValidatorOptions.required)).toBeDefined(); + expect(tenantControl.dataTestId).toEqual('tenant'); + expect(tenantControl.type).toEqual(FormControlType.DROPDOWN); + expect(tenantControl.isDisabled).toBeTruthy(); + expect(tenantControl.placeHolder).toEqual('Select Tenant'); + expect(tenantControl.displayName).toEqual('Tenant'); + expect(tenantControl.onInit).toBeDefined(); + expect(tenantControl.onChange).toBeDefined(); + + const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME); + const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern); + expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/); + }); + + + test('getMacroFormControls should return the correct order of controls', () => { + // Order the fields + // 1. Instance name + // 2. Subscriber name + // 3. Service type + // 4. Owning entity (fix Entity to entity) + // 5. Product family + // 6. LCP region + // 7. Tenant + // 8. AIC zone (fix Zone to zone) + // 9. Pause on pause points + // 10. Project + // 11. Rollback on failure + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId); + + + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.GLOBAL_SUBSCRIBER_ID, + FormControlNames.SUBSCRIPTION_SERVICE_TYPE , + FormControlNames.OWNING_ENTITY_ID , + FormControlNames.PRODUCT_FAMILY_ID , + FormControlNames.LCPCLOUD_REGION_ID , + FormControlNames.TENANT_ID , + FormControlNames.AICZONE_ID , + FormControlNames.PAUSE, + FormControlNames.PROJECT_NAME , + FormControlNames.ROLLBACK_ON_FAILURE]; + expect(controls.length).toEqual(11); + for(let i = 0 ; i < controls.length ; i++){ + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + test('getAlacartFormControls should return the correct order of controls', () => { + // Order the fields + // 1. Instance name + // 2. Subscriber name + // 3. Service type + // 4. Owning entity (fix Entity to entity) + // 5. Project + // 6. Rollback on failure + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const controls :FormControlModel[] = service.getAlaCartControls(serviceId); + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.GLOBAL_SUBSCRIBER_ID, + FormControlNames.SUBSCRIPTION_SERVICE_TYPE , + FormControlNames.OWNING_ENTITY_ID , + FormControlNames.PROJECT_NAME , + FormControlNames.ROLLBACK_ON_FAILURE]; + + expect(controls.length).toEqual(6); + for(let i = 0 ; i < controls.length ; i++){ + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + +}); + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/service.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/service.control.generator.ts new file mode 100644 index 000000000..539f848d5 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/service.control.generator.ts @@ -0,0 +1,331 @@ +import {Injectable} from "@angular/core"; +import {GenericFormService} from "../generic-form.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../store/reducers"; +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../models/formControlModels/formControl.model"; +import {DropdownFormControl} from "../../../models/formControlModels/dropdownFormControl.model"; +import * as _ from 'lodash'; +import {BasicControlGenerator} from "./basic.control.generator"; +import {AaiService} from "../../../services/aaiService/aai.service"; +import {FormGroup} from "@angular/forms"; +import {FormControlType} from "../../../models/formControlModels/formControlTypes.enum"; +import {HttpClient} from "@angular/common/http"; +import {SelectOption} from "../../../models/selectOption"; +import {Observable} from "rxjs"; +import {LogService} from "../../../utils/log/log.service"; +import {ServiceModel} from "../../../models/serviceModel"; +import {of} from "rxjs"; + +import {CheckboxFormControl} from "../../../models/formControlModels/checkboxFormControl.model"; + +export enum FormControlNames { + INSTANCE_NAME = 'instanceName', + GLOBAL_SUBSCRIBER_ID = 'globalSubscriberId', + SUBSCRIPTION_SERVICE_TYPE = 'subscriptionServiceType', + PRODUCT_FAMILY_ID = 'productFamilyId', + LCPCLOUD_REGION_ID = 'lcpCloudRegionId', + TENANT_ID = 'tenantId', + AICZONE_ID = 'aicZoneId', + PROJECT_NAME = 'projectName', + OWNING_ENTITY_ID = 'owningEntityId', + ROLLBACK_ON_FAILURE = 'rollbackOnFailure', + PAUSE = 'pause' +} + +@Injectable() +export class ServiceControlGenerator { + aaiService : AaiService; + constructor(private genericFormService : GenericFormService, + private _basicControlGenerator : BasicControlGenerator, + private store: NgRedux<AppState>, + private http: HttpClient, + private _aaiService : AaiService, + private _logService : LogService){ + this.aaiService = _aaiService; + } + + getServiceInstance = (serviceId : string) : any => { + let serviceInstance = null; + if (_.has(this.store.getState().service.serviceInstance, serviceId)) { + serviceInstance = Object.assign({}, this.store.getState().service.serviceInstance[serviceId]); + } + + return serviceInstance; + }; + + getAlaCartControls(serviceId: string, dynamicInputs?: any[]) : FormControlModel[] { + if(_.isNil(serviceId)){ + this._logService.error('should provide serviceId', serviceId); + return []; + } + const serviceInstance = this.getServiceInstance(serviceId); + + let result : FormControlModel[] = []; + + const serviceModel = new ServiceModel(this.store.getState().service.serviceHierarchy[serviceId]); + if(!_.isNil(serviceModel)){ + result.push(this._basicControlGenerator.getInstanceName(serviceInstance, serviceId, serviceModel.isEcompGeneratedNaming)); + result.push(this.getGlobalSubscriberControl(serviceInstance, result)); + result.push(this.getServiceTypeControl(serviceInstance, result, false)); + result.push(this.getOwningEntityControl(serviceInstance, result)); + result.push(this.getProjectControl(serviceInstance, result)); + result.push(this.getRollbackOnFailureControl(serviceInstance, result)); + } + + this._logService.info('Generate dynamic service controls, is edit mode: ' + serviceInstance != null , result); + return result; + } + + getMacroFormControls(serviceId: string, dynamicInputs?: any[]) : FormControlModel[] { + if(_.isNil(serviceId)){ + this._logService.error('should provide serviceId', serviceId); + return []; + } + + const serviceInstance = this.getServiceInstance(serviceId); + + let result : FormControlModel[] = []; + const serviceModel = new ServiceModel(this.store.getState().service.serviceHierarchy[serviceId]); + if(!_.isNil(serviceModel)){ + result.push(this._basicControlGenerator.getInstanceName(serviceInstance, serviceId, serviceModel.isEcompGeneratedNaming)); + result.push(this.getGlobalSubscriberControl(serviceInstance, result)); + result.push(this.getServiceTypeControl(serviceInstance, result, true)); + result.push(this.getOwningEntityControl(serviceInstance, result)); + result.push(this.getProductFamilyControl(serviceInstance, result)); + result.push(this.getLcpRegionControl(serviceInstance, result)); + result.push(this.getTenantControl(serviceInstance, result),); + result.push(this.getAICZoneControl(serviceInstance, result)); + + if(serviceModel.isMultiStepDesign){ + result.push(new CheckboxFormControl({ + controlName : FormControlNames.PAUSE, + displayName : 'Pause on pause points', + dataTestId : 'Pause', + isDisabled : false, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required')], + value : serviceInstance ? serviceInstance.pause : null, + })); + } + + result.push(this.getProjectControl(serviceInstance, result)); + result.push(this.getRollbackOnFailureControl(serviceInstance, result)); + } + + + this._logService.info('Generate dynamic service controls, is edit mode: ' + serviceInstance != null , result); + return result; + } + + getRollBackOnFailureOptions = () : Observable<SelectOption[]> =>{ + return of([ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]); + }; + + getGlobalSubscriberControl = (serviceInstance : any, controls : FormControlModel[]) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.GLOBAL_SUBSCRIBER_ID, + displayName : 'Subscriber name', + dataTestId : 'subscriberName', + placeHolder : 'Select Subscriber Name', + isDisabled : false, + name : "subscriber-name-select", + value : serviceInstance ? serviceInstance.globalSubscriberId : null, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInit : this._basicControlGenerator.getSubscribeInitResult.bind(this._aaiService, this.aaiService.getSubscribers), + onChange : (param: string, form : FormGroup) => { + form.controls[FormControlNames.SUBSCRIPTION_SERVICE_TYPE].reset(); + if(!_.isNil(param)){ + form.controls[FormControlNames.SUBSCRIPTION_SERVICE_TYPE].enable(); + this._basicControlGenerator.getSubscribeResult.bind(this, this._aaiService.getServiceTypes(param).subscribe(res =>{ + controls.find(item => item.controlName === FormControlNames.SUBSCRIPTION_SERVICE_TYPE)['options$'] = res; + })); + } + else { + form.controls[FormControlNames.SUBSCRIPTION_SERVICE_TYPE].disable(); + } + } + }) + }; + + getServiceTypeControl = (serviceInstance : any, controls : FormControlModel[], isMacro?: boolean) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.SUBSCRIPTION_SERVICE_TYPE, + displayName : 'Service type', + dataTestId : 'serviceType', + placeHolder : 'Select Service Type', + selectedField : 'name', + name : "service-type", + isDisabled : _.isNil(serviceInstance), + value : serviceInstance ? serviceInstance.subscriptionServiceType : null, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInit : serviceInstance ? this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this.aaiService.getServiceTypes.bind(this, serviceInstance.globalSubscriberId)) : ()=>{}, + onChange : (param: string, form : FormGroup) => { + if(isMacro){ + form.controls[FormControlNames.LCPCLOUD_REGION_ID].reset(); + if(!_.isNil(param)) { + form.controls[FormControlNames.LCPCLOUD_REGION_ID].enable(); + const globalCustomerId: string = form.controls[FormControlNames.GLOBAL_SUBSCRIBER_ID].value; + if (!_.isNil(globalCustomerId)) { + this._basicControlGenerator.getSubscribeResult.bind(this, this._aaiService.getLcpRegionsAndTenants(globalCustomerId, param).subscribe(res => { + controls.find(item => item.controlName === FormControlNames.LCPCLOUD_REGION_ID)['options$'] = res.lcpRegionList; + })); + } + } + else { + form.controls[FormControlNames.LCPCLOUD_REGION_ID].disable(); + } + } + + } + }) + }; + + getOwningEntityControl = (serviceInstance : any, controls : FormControlModel[]) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.OWNING_ENTITY_ID, + displayName : 'Owning entity', + dataTestId : 'owningEntity', + placeHolder : 'Select Owning Entity', + name :"owningEntity", + isDisabled : false, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required'),], + onInitSelectedField : ['owningEntityList'], + value : serviceInstance ? serviceInstance.owningEntityId : null, + onInit : this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters) + }) + }; + + getProductFamilyControl = (serviceInstance : any, controls : FormControlModel[]) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.PRODUCT_FAMILY_ID, + displayName : 'Product family', + dataTestId : 'productFamily', + placeHolder : 'Select Product Family', + isDisabled : false, + name : "product-family-select", + value : serviceInstance ? serviceInstance.productFamilyId : null, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInit : this._basicControlGenerator.getSubscribeResult.bind(this, this._aaiService.getProductFamilies), + }) + }; + + getLcpRegionControl = (serviceInstance : any, controls : FormControlModel[]) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.LCPCLOUD_REGION_ID, + displayName : 'LCP region', + dataTestId : 'lcpRegion', + placeHolder : 'Select LCP Region', + name : "lcpRegion", + isDisabled : _.isNil(serviceInstance), + value : serviceInstance ? serviceInstance.lcpCloudRegionId : null, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInitSelectedField : ['lcpRegionList'], + onInit : serviceInstance ? this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this.aaiService.getLcpRegionsAndTenants.bind(this, serviceInstance.globalSubscriberId, serviceInstance.subscriptionServiceType)) : ()=>{}, + onChange : (param: string, form : FormGroup) => { + form.controls[FormControlNames.TENANT_ID].reset(); + if(param) { + form.controls[FormControlNames.TENANT_ID].enable(); + } + else { + form.controls[FormControlNames.TENANT_ID].disable(); + } + const globalCustomerId : string = form.controls[FormControlNames.GLOBAL_SUBSCRIBER_ID].value; + const serviceType : string = form.controls[FormControlNames.SUBSCRIPTION_SERVICE_TYPE].value; + if(!_.isNil(globalCustomerId) && !_.isNil(serviceType)){ + this._basicControlGenerator.getSubscribeResult.bind(this, this._aaiService.getLcpRegionsAndTenants(globalCustomerId, serviceType).subscribe(res =>{ + controls.find(item => item.controlName === FormControlNames.TENANT_ID)['options$'] = res.lcpRegionsTenantsMap[param]; + })); + } + } + }) + }; + + getTenantControl = (serviceInstance : any, controls : FormControlModel[]) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.TENANT_ID, + displayName : 'Tenant', + dataTestId : 'tenant', + placeHolder : 'Select Tenant', + name : "tenant", + isDisabled : _.isNil(serviceInstance), + onInitSelectedField :serviceInstance ? ['lcpRegionsTenantsMap', serviceInstance.lcpCloudRegionId] : null, + onInit : serviceInstance ? this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this.aaiService.getLcpRegionsAndTenants.bind(this, serviceInstance.globalSubscriberId, serviceInstance.subscriptionServiceType)) : ()=>{}, + value : serviceInstance ? serviceInstance.tenantId : null, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required')], + }) + }; + + getAICZoneControl = (serviceInstance : any, controls : FormControlModel[]) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.AICZONE_ID, + displayName : 'AIC zone', + dataTestId : 'aic_zone', + placeHolder : 'Select AIC zone', + name : "aicZone", + value : serviceInstance ? serviceInstance.aicZoneId : null, + isDisabled : false, + validations : [], + onInit : this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getAicZones) + }) + }; + + getPauseControl = (serviceInstance : any, controls : FormControlModel[]) :CheckboxFormControl => { + return new CheckboxFormControl({ + controlName : FormControlNames.PAUSE, + displayName : 'Pause on pause points', + dataTestId : 'Pause', + isDisabled : false, + value : serviceInstance ? serviceInstance.pause : null, + }) + }; + + getProjectControl = (serviceInstance : any, controls : FormControlModel[]) :DropdownFormControl =>{ + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.PROJECT_NAME, + displayName : 'Project', + dataTestId : 'project', + placeHolder : 'Select Project', + name : "project", + isDisabled : false, + validations : [], + value : serviceInstance ? serviceInstance.projectName : null, + onInitSelectedField : ['projectList'], + onInit : this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters) + }) + }; + + getRollbackOnFailureControl = (serviceInstance : any, controls : FormControlModel[]) : DropdownFormControl => { + return new DropdownFormControl({ + type : FormControlType.DROPDOWN, + controlName : FormControlNames.ROLLBACK_ON_FAILURE, + displayName : 'Rollback on failure', + dataTestId : 'rollback', + isDisabled : false, + validations : [new ValidatorModel(ValidatorOptions.required, 'is required')], + value : serviceInstance ? serviceInstance.rollbackOnFailure : 'true', + onInit : this._basicControlGenerator.getSubscribeInitResult.bind(null, this.getRollBackOnFailureOptions) + }) + }; +} + + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts new file mode 100644 index 000000000..36be1bdfa --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.spec.ts @@ -0,0 +1,2008 @@ +import {getTestBed, TestBed} from '@angular/core/testing'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; +import {NgRedux} from '@angular-redux/store'; +import {BasicControlGenerator} from "../basic.control.generator"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {GenericFormService} from "../../generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import {LogService} from "../../../../utils/log/log.service"; +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {FormControlNames, VfModuleControlGenerator} from "./vfModule.control.generator"; +import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service"; + +class MockAppStore<T> { + getState() { + return { + "global": { + "name": null, + "flags": { + "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false, + "FLAG_SHOW_ASSIGNMENTS": true, + "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, + "FLAG_UNASSIGN_SERVICE": true, + "FLAG_SHOW_VERIFY_SERVICE": false, + "FLAG_COLLECTION_RESOURCE_SUPPORT": true, + "FLAG_DUPLICATE_VNF": true, + "FLAG_SERVICE_MODEL_CACHE": true, + "CREATE_INSTANCE_TEST": false, + "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false, + "FLAG_ASYNC_INSTANTIATION": true, + "FLAG_ASYNC_JOBS": true, + "EMPTY_DRAWING_BOARD_TEST": false, + "FLAG_ADD_MSO_TESTAPI_FIELD": true + }, + "type": "[FLAGS] Update" + }, + "service": { + "serviceHierarchy": { + "6e59c5de-f052-46fa-aa7e-2fca9d674c44": { + "service": { + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "ComplexService", + "version": "1.0", + "toscaModelURL": null, + "category": "Emanuel", + "serviceType": "", + "serviceRole": "", + "description": "ComplexService", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": {} + }, + "vnfs": { + "VF_vMee 0": { + "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60", + "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e", + "description": "VSP_vMee", + "name": "VF_vMee", + "version": "2.0", + "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9", + "inputs": {}, + "commands": {}, + "serviceEcompNaming" : "true", + "properties": { + "ecomp_generated_naming": "false", + "max_instances": 10, + "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", + "sctp-b-IPv6_ethertype": "IPv6", + "sctp-a-egress_rule_application": "any", + "sctp-b-ingress_action": "pass", + "sctp-b-ingress_rule_protocol": "icmp", + "ncb2_Internal1_mac": "00:11:22:EF:AC:DF", + "sctp-b-ipv6-ingress-src_start_port": "0.0", + "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", + "sctp-a-ipv6-ingress-dst_start_port": "0", + "sctp-b-ipv6-ingress_rule_application": "any", + "domain_name": "default-domain", + "sctp-a-ingress_rule_protocol": "icmp", + "sctp-b-egress-src_start_port": "0.0", + "sctp-a-egress_src_addresses": "local", + "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group", + "sctp-a-egress-src_start_port": "0.0", + "sctp-a-ingress_ethertype": "IPv4", + "sctp-b-ipv6-ingress-dst_end_port": "65535", + "sctp-b-dst_subnet_prefix_v6": "::", + "nf_naming": "{ecomp_generated_naming=true}", + "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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix_len": "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:11:22:EF:AC:DF", + "sctp-a-egress_ethertype": "IPv4", + "vlc_st_service_mode": "in-network-nat", + "sctp-a-ipv6-egress_ethertype": "IPv4", + "sctp-a-egress-src_end_port": "65535.0", + "sctp-b-ipv6-egress_rule_application": "any", + "sctp-b-egress_action": "pass", + "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:11:22:EF:AC:DF", + "sctp-a-ipv6-ingress-src_start_port": "0.0", + "sctp-b-ipv6-egress_ethertype": "IPv4", + "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: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", + "sctp-a-ipv6-ingress-src_end_port": "65535.0", + "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-b-ingress_rule_application": "any", + "int2_sec_group_name": "int2-sec-group", + "vlc_flavor_name": "nd.c16r64d1", + "sctp-b-ipv6-egress_src_addresses": "local", + "vlc_st_interface_type_int1": "other1", + "sctp-b-egress-src_end_port": "65535.0", + "sctp-a-ipv6-egress-dst_start_port": "0", + "vlc_st_interface_type_int2": "other2", + "sctp-a-ipv6-egress_rule_protocol": "any", + "Internal2_shared": "false", + "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0", + "Internal2_rpf": "disable", + "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", + "sctp-a-ipv6-egress_src_end_port": "65535", + "Internal1_forwarding_mode": "l2", + "Internal2_dhcp": "false", + "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: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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix": "0.0.0.0", + "Internal1_net_cidr_len": "17", + "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: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: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:11:22:EF:AC:DF", + "vlc_st_interface_type_oam": "management", + "multi_stage_design": "true", + "oam_sec_group_name": "oam-sec-group", + "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": "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", + "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0", + "sctp-a-ipv6-ingress_dst_addresses": "local", + "sctp-a-egress_rule_protocol": "icmp", + "sctp-b-ipv6-egress_action": "pass", + "sctp-a-ipv6-egress_action": "pass", + "Internal1_shared": "false", + "sctp-b-ipv6-ingress_rule_protocol": "any", + "Internal2_net_cidr_len": "17", + "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-a-ingress-src_end_port": "65535.0", + "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0", + "sctp-a-egress-dst_end_port": "65535.0", + "sctp-a-ingress_action": "pass", + "sctp-b-egress_rule_protocol": "icmp", + "sctp-b-ipv6-ingress_action": "pass", + "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: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", + "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0", + "Internal1_allow_transit": "true", + "gpb_flavor_name": "nv.c20r64d1", + "availability_zone_max_count": "1", + "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2", + "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:11:22:EF:AC:DF", + "sctp-a-ingress-src_subnet_prefix": "0.0.0.0", + "sctp-a-ipv6-ingress_action": "pass", + "Internal1_rpf": "disable", + "sctp-b-ingress_ethertype": "IPv4", + "sctp-b-egress_rule_application": "any", + "sctp-b-ingress-src_end_port": "65535.0", + "sctp-a-ipv6-ingress_rule_protocol": "any", + "sctp-a-ingress-src_start_port": "0.0", + "sctp-b-egress-dst_end_port": "65535.0" + }, + "type": "VF", + "modelCustomizationName": "VF_vMee 0", + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "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": { + "ecomp_generated_naming": "false", + "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": { + "Port Mirroring Configuration By Policy 0": { + "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50", + "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7", + "description": "A port mirroring configuration by policy object", + "name": "Port Mirroring Configuration By Policy", + "version": "27.0", + "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Configuration", + "modelCustomizationName": "Port Mirroring Configuration By Policy 0", + "sourceNodes": [], + "collectorNodes": null, + "configurationByPolicy": false + } + }, + "serviceProxies": {}, + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {} + } + }, + "pnfs": {} + } + }, + "serviceInstance": { + "6e59c5de-f052-46fa-aa7e-2fca9d674c44": { + "networks": {}, + "vnfs": { + "VF_vMee 0": { + "rollbackOnFailure": "true", + "vfModules": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "vf_vmee0..VfVmee..base_vmme..module-0vmvzo": { + "isMissingData": false, + "sdncPreReload": null, + "modelInfo": { + "modelType": "VFmodule", + "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "modelName": "VfVmee..base_vmme..module-0", + "modelVersion": "2", + "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "modelCustomizationName": "VfVmee..base_vmme..module-0" + }, + "instanceParams": [ + {} + ], + "trackById": "wmtm6sy2uj" + } + } + }, + "isMissingData": true, + "originalName": "VF_vMee 0", + "vnfStoreKey": "VF_vMee 0", + "trackById": "p3wk448m5do", + "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60", + "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "lcpCloudRegionId": null, + "tenantId": null, + "lineOfBusiness": null, + "platformName": null, + "modelInfo": { + "modelType": "VF", + "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e", + "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "modelName": "VF_vMee", + "modelVersion": "2.0", + "modelCustomizationName": "VF_vMee 0" + } + } + }, + "instanceParams": [ + {} + ], + "validationCounter": 1, + "existingNames": {}, + "existingVNFCounterMap": { + "d6557200-ecf2-4641-8094-5393ae3aae60": 1 + }, + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "lcpCloudRegionId": "hvf6", + "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e", + "aicZoneId": "JAG1", + "projectName": "x1", + "rollbackOnFailure": "true", + "bulkSize": 1, + "modelInfo": { + "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "modelName": "ComplexService", + "modelVersion": "1.0", + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44" + }, + "isALaCarte": false, + "name": "ComplexService", + "version": "1.0", + "description": "ComplexService", + "category": "Emanuel", + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "serviceType": "", + "serviceRole": "", + "isEcompGeneratedNaming": true, + "isMultiStepDesign": false + } + }, + "lcpRegionsAndTenants": { + "lcpRegionList": [ + { + "id": "JANET25", + "name": "JANET25", + "isPermitted": true + }, + { + "id": "hvf6", + "name": "hvf6", + "isPermitted": true + } + ], + "lcpRegionsTenantsMap": { + "JANET25": [ + { + "id": "092eb9e8e4b7412e8787dd091bc58e86", + "name": "USP-SIP-IC-24335-T-01", + "isPermitted": true + } + ], + "hvf6": [ + { + "id": "bae71557c5bb4d5aac6743a4e5f1d054", + "name": "AIN Web Tool-15-D-testalexandria", + "isPermitted": true + }, + { + "id": "229bcdc6eaeb4ca59d55221141d01f8e", + "name": "AIN Web Tool-15-D-STTest2", + "isPermitted": true + }, + { + "id": "1178612d2b394be4834ad77f567c0af2", + "name": "AIN Web Tool-15-D-SSPtestcustome", + "isPermitted": true + }, + { + "id": "19c5ade915eb461e8af52fb2fd8cd1f2", + "name": "AIN Web Tool-15-D-UncheckedEcopm", + "isPermitted": true + }, + { + "id": "de007636e25249238447264a988a927b", + "name": "AIN Web Tool-15-D-dfsdf", + "isPermitted": true + }, + { + "id": "62f29b3613634ca6a3065cbe0e020c44", + "name": "AIN/SMS-16-D-Multiservices1", + "isPermitted": true + }, + { + "id": "649289e30d3244e0b48098114d63c2aa", + "name": "AIN Web Tool-15-D-SSPST66", + "isPermitted": true + }, + { + "id": "3f21eeea6c2c486bba31dab816c05a32", + "name": "AIN Web Tool-15-D-ASSPST47", + "isPermitted": true + }, + { + "id": "f60ce21d3ee6427586cff0d22b03b773", + "name": "CESAR-100-D-sspjg67246", + "isPermitted": true + }, + { + "id": "8774659e425f479895ae091bb5d46560", + "name": "CESAR-100-D-sspjg68359", + "isPermitted": true + }, + { + "id": "624eb554b0d147c19ff8885341760481", + "name": "AINWebTool-15-D-iftach", + "isPermitted": true + }, + { + "id": "214f55f5fc414c678059c383b03e4962", + "name": "CESAR-100-D-sspjg612401", + "isPermitted": true + }, + { + "id": "c90666c291664841bb98e4d981ff1db5", + "name": "CESAR-100-D-sspjg621340", + "isPermitted": true + }, + { + "id": "ce5b6bc5c7b348e1bf4b91ac9a174278", + "name": "sspjg621351cloned", + "isPermitted": true + }, + { + "id": "b386b768a3f24c8e953abbe0b3488c02", + "name": "AINWebTool-15-D-eteancomp", + "isPermitted": true + }, + { + "id": "dc6c4dbfd225474e9deaadd34968646c", + "name": "AINWebTool-15-T-SPFET", + "isPermitted": true + }, + { + "id": "02cb5030e9914aa4be120bd9ed1e19eb", + "name": "AINWebTool-15-X-eeweww", + "isPermitted": true + }, + { + "id": "f2f3830e4c984d45bcd00e1a04158a79", + "name": "CESAR-100-D-spjg61909", + "isPermitted": true + }, + { + "id": "05b91bd5137f4929878edd965755c06d", + "name": "CESAR-100-D-sspjg621512cloned", + "isPermitted": true + }, + { + "id": "7002fbe8482d4a989ddf445b1ce336e0", + "name": "AINWebTool-15-X-vdr", + "isPermitted": true + }, + { + "id": "4008522be43741dcb1f5422022a2aa0b", + "name": "AINWebTool-15-D-ssasa", + "isPermitted": true + }, + { + "id": "f44e2e96a1b6476abfda2fa407b00169", + "name": "AINWebTool-15-D-PFNPT", + "isPermitted": true + }, + { + "id": "b69a52bec8a84669a37a1e8b72708be7", + "name": "AINWebTool-15-X-vdre", + "isPermitted": true + }, + { + "id": "fac7d9fd56154caeb9332202dcf2969f", + "name": "AINWebTool-15-X-NONPODECOMP", + "isPermitted": true + }, + { + "id": "2d34d8396e194eb49969fd61ffbff961", + "name": "DN5242-Nov16-T5", + "isPermitted": true + }, + { + "id": "cb42a77ff45b48a8b8deb83bb64acc74", + "name": "ro-T11", + "isPermitted": true + }, + { + "id": "fa45ca53c80b492fa8be5477cd84fc2b", + "name": "ro-T112", + "isPermitted": true + }, + { + "id": "4914ab0ab3a743e58f0eefdacc1dde77", + "name": "DN5242-Nov21-T1", + "isPermitted": true + }, + { + "id": "d0a3e3f2964542259d155a81c41aadc3", + "name": "test-hvf6-09", + "isPermitted": true + }, + { + "id": "cbb99fe4ada84631b7baf046b6fd2044", + "name": "DN5242-Nov16-T3", + "isPermitted": true + } + ] + } + }, + "productFamilies": [ + { + "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", + "name": "SCOTTIE", + "isPermitted": true + }, + { + "id": "17cc1042-527b-11e6-beb8-9e71128cae77", + "name": "IGNACIO", + "isPermitted": true + }, + { + "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "name": "Christie", + "isPermitted": true + }, + { + "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7", + "name": "Enhanced Services", + "isPermitted": true + }, + { + "id": "vTerrance", + "name": "vTerrance", + "isPermitted": true + }, + { + "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f", + "name": "vSCP", + "isPermitted": true + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": true + }, + { + "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "name": "BVOIP", + "isPermitted": true + }, + { + "id": "db171b8f-115c-4992-a2e3-ee04cae357e0", + "name": "LINDSEY", + "isPermitted": true + }, + { + "id": "LRSI-OSPF", + "name": "LRSI-OSPF", + "isPermitted": true + }, + { + "id": "vRosemarie", + "name": "HNGATEWAY", + "isPermitted": true + }, + { + "id": "vHNPaas", + "name": "WILKINS", + "isPermitted": true + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce", + "name": "VROUTER", + "isPermitted": true + }, + { + "id": "Cisneros", + "name": "vMuriel", + "isPermitted": true + }, + { + "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1", + "name": "CARA Griffin", + "isPermitted": true + }, + { + "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "name": "DARREN MCGEE", + "isPermitted": true + }, + { + "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1", + "name": "Transport", + "isPermitted": true + }, + { + "id": "vSalvatore", + "name": "vSalvatore", + "isPermitted": true + }, + { + "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "name": "Josefina", + "isPermitted": true + }, + { + "id": "vHubbard", + "name": "vHubbard", + "isPermitted": true + }, + { + "id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "name": "DARREN MCGEE", + "isPermitted": true + } + ], + "serviceTypes": { + "e433710f-9217-458d-a79d-1c7aff376d89": [ + { + "id": "0", + "name": "vRichardson", + "isPermitted": false + }, + { + "id": "1", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "2", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "3", + "name": "vJamie", + "isPermitted": false + }, + { + "id": "4", + "name": "vVoiceMail", + "isPermitted": false + }, + { + "id": "5", + "name": "Kennedy", + "isPermitted": false + }, + { + "id": "6", + "name": "vSEGW", + "isPermitted": false + }, + { + "id": "7", + "name": "vVM", + "isPermitted": false + }, + { + "id": "8", + "name": "vOTA", + "isPermitted": false + }, + { + "id": "9", + "name": "vMME", + "isPermitted": false + }, + { + "id": "10", + "name": "vMNS", + "isPermitted": false + }, + { + "id": "11", + "name": "vSCP", + "isPermitted": false + }, + { + "id": "12", + "name": "VPMS", + "isPermitted": false + }, + { + "id": "13", + "name": "vMMSC", + "isPermitted": false + }, + { + "id": "14", + "name": "SSD", + "isPermitted": false + }, + { + "id": "15", + "name": "vMOG", + "isPermitted": false + }, + { + "id": "16", + "name": "LINDSEY", + "isPermitted": false + }, + { + "id": "17", + "name": "JOHANNA_SANTOS", + "isPermitted": false + }, + { + "id": "18", + "name": "vCarroll", + "isPermitted": false + } + ] + }, + "aicZones": [ + { + "id": "NFT1", + "name": "NFTJSSSS-NFT1" + }, + { + "id": "JAG1", + "name": "YUDFJULP-JAG1" + }, + { + "id": "YYY1", + "name": "UUUAIAAI-YYY1" + }, + { + "id": "BAN1", + "name": "VSDKYUTP-BAN1" + }, + { + "id": "DKJ1", + "name": "DKJSJDKA-DKJ1" + }, + { + "id": "MCS1", + "name": "ASACMAMS-MCS1" + }, + { + "id": "UIO1", + "name": "uioclli1-UIO1" + }, + { + "id": "RAJ1", + "name": "YGBIJNLQ-RAJ1" + }, + { + "id": "OPA1", + "name": "opaclli1-OPA1" + }, + { + "id": "SDE1", + "name": "ZXCVBNMA-SDE1" + }, + { + "id": "VEN2", + "name": "FGHJUHIL-VEN2" + }, + { + "id": "ORL1", + "name": "ORLDFLMA-ORL1" + }, + { + "id": "JAD1", + "name": "JADECLLI-JAD1" + }, + { + "id": "ZXL1", + "name": "LWLWCANN-ZXL1" + }, + { + "id": "CKL1", + "name": "CLKSKCKK-CKL1" + }, + { + "id": "SDF1", + "name": "sdfclli1-SDF1" + }, + { + "id": "RAD1", + "name": "RADICAL1-RAD1" + }, + { + "id": "KIT1", + "name": "BHYJFGLN-KIT1" + }, + { + "id": "REL1", + "name": "INGERFGT-REL1" + }, + { + "id": "JNL1", + "name": "CJALSDAC-JNL1" + }, + { + "id": "OLK1", + "name": "OLKOLKLS-OLK1" + }, + { + "id": "CHI1", + "name": "CHILLIWE-CHI1" + }, + { + "id": "UUU4", + "name": "UUUAAAUU-UUU4" + }, + { + "id": "TUF1", + "name": "TUFCLLI1-TUF1" + }, + { + "id": "KJN1", + "name": "CKALDKSA-KJN1" + }, + { + "id": "SAM1", + "name": "SNDGCA64-SAN1" + }, + { + "id": "SCK1", + "name": "SCKSCKSK-SCK1" + }, + { + "id": "HJH1", + "name": "AOEEQQQD-HJH1" + }, + { + "id": "HGD1", + "name": "SDFQWHGD-HGD1" + }, + { + "id": "KOR1", + "name": "HYFLNBVT-KOR1" + }, + { + "id": "ATL43", + "name": "AICLOCID-ATL43" + }, + { + "id": "ATL54", + "name": "AICFTAAI-ATL54" + }, + { + "id": "ATL66", + "name": "CLLIAAII-ATL66" + }, + { + "id": "VEL1", + "name": "BNMLKUIK-VEL1" + }, + { + "id": "ICC1", + "name": "SANJITAT-ICC1" + }, + { + "id": "MNT11", + "name": "WSXEFBTH-MNT11" + }, + { + "id": "DEF2", + "name": "WSBHGTYL-DEF2" + }, + { + "id": "MAD11", + "name": "SDFQWGKL-MAD11" + }, + { + "id": "OLG1", + "name": "OLHOLHOL-OLG1" + }, + { + "id": "GAR1", + "name": "NGFVSJKO-GAR1" + }, + { + "id": "SAN22", + "name": "GNVLSCTL-SAN22" + }, + { + "id": "HRG1", + "name": "HRGHRGGS-HRG1" + }, + { + "id": "JCS1", + "name": "JCSJSCJS-JCS1" + }, + { + "id": "DHA12", + "name": "WSXEDECF-DHA12" + }, + { + "id": "HJE1", + "name": "AOEEWWWD-HJE1" + }, + { + "id": "NCA1", + "name": "NCANCANN-NCA1" + }, + { + "id": "IOP1", + "name": "iopclli1-IOP1" + }, + { + "id": "RTY1", + "name": "rtyclli1-RTY1" + }, + { + "id": "KAP1", + "name": "HIOUYTRQ-KAP1" + }, + { + "id": "ZEN1", + "name": "ZENCLLI1-ZEN1" + }, + { + "id": "HKA1", + "name": "JAKHLASS-HKA1" + }, + { + "id": "CQK1", + "name": "CQKSCAKK-CQK1" + }, + { + "id": "SAI1", + "name": "UBEKQLPD-SAI1" + }, + { + "id": "ERT1", + "name": "ertclli1-ERT1" + }, + { + "id": "IBB1", + "name": "PLMKOIJU-IBB1" + }, + { + "id": "TIR2", + "name": "PLKINHYI-TIR2" + }, + { + "id": "HSD1", + "name": "CHASKCDS-HSD1" + }, + { + "id": "SLF78", + "name": "SDCTLFN1-SLF78" + }, + { + "id": "SEE78", + "name": "SDCTEEE4-SEE78" + }, + { + "id": "SAN13", + "name": "TOKYJPFA-SAN13" + }, + { + "id": "SAA78", + "name": "SDCTAAA1-SAA78" + }, + { + "id": "LUC1", + "name": "ATLDFGYC-LUC1" + }, + { + "id": "AMD13", + "name": "MEMATLAN-AMD13" + }, + { + "id": "TOR1", + "name": "TOROONXN-TOR1" + }, + { + "id": "QWE1", + "name": "QWECLLI1-QWE1" + }, + { + "id": "ZOG1", + "name": "ZOGASTRO-ZOG1" + }, + { + "id": "CAL33", + "name": "CALIFORN-CAL33" + }, + { + "id": "SHH78", + "name": "SDIT1HHH-SHH78" + }, + { + "id": "DSA1", + "name": "LKJHGFDS-DSA1" + }, + { + "id": "CLG1", + "name": "CLGRABAD-CLG1" + }, + { + "id": "BNA1", + "name": "BNARAGBK-BNA1" + }, + { + "id": "ATL84", + "name": "CANTTCOC-ATL84" + }, + { + "id": "APP1", + "name": "WBHGTYUI-APP1" + }, + { + "id": "RJN1", + "name": "RJNRBZAW-RJN1" + }, + { + "id": "EHH78", + "name": "SDCSHHH5-EHH78" + }, + { + "id": "mac10", + "name": "PKGTESTF-mac10" + }, + { + "id": "SXB78", + "name": "SDCTGXB1-SXB78" + }, + { + "id": "SAX78", + "name": "SDCTAXG1-SAX78" + }, + { + "id": "SYD1", + "name": "SYDNAUBV-SYD1" + }, + { + "id": "TOK1", + "name": "TOKYJPFA-TOK1" + }, + { + "id": "KGM2", + "name": "KGMTNC20-KGM2" + }, + { + "id": "DCC1b", + "name": "POIUYTGH-DCC1b" + }, + { + "id": "SKK78", + "name": "SDCTKKK1-SKK78" + }, + { + "id": "SGG78", + "name": "SDCTGGG1-SGG78" + }, + { + "id": "SJJ78", + "name": "SDCTJJJ1-SJJ78" + }, + { + "id": "SBX78", + "name": "SDCTBXG1-SBX78" + }, + { + "id": "LAG1", + "name": "LARGIZON-LAG1" + }, + { + "id": "IAA1", + "name": "QAZXSWED-IAA1" + }, + { + "id": "POI1", + "name": "PLMNJKIU-POI1" + }, + { + "id": "LAG1a", + "name": "LARGIZON-LAG1a" + }, + { + "id": "PBL1", + "name": "PBLAPBAI-PBL1" + }, + { + "id": "LAG45", + "name": "LARGIZON-LAG1a" + }, + { + "id": "MAR1", + "name": "MNBVCXZM-MAR1" + }, + { + "id": "HST70", + "name": "HSTNTX70-HST70" + }, + { + "id": "DCC1a", + "name": "POIUYTGH-DCC1a" + }, + { + "id": "TOL1", + "name": "TOLDOH21-TOL1" + }, + { + "id": "LON1", + "name": "LONEENCO-LON1" + }, + { + "id": "SJU78", + "name": "SDIT1JUB-SJU78" + }, + { + "id": "STN27", + "name": "HSTNTX01-STN27" + }, + { + "id": "SSW56", + "name": "ss8126GT-SSW56" + }, + { + "id": "SBB78", + "name": "SDIT1BBB-SBB78" + }, + { + "id": "DCC3", + "name": "POIUYTGH-DCC3" + }, + { + "id": "GNV1", + "name": "GNVLSCTL-GNV1" + }, + { + "id": "WAS1", + "name": "WASHDCSW-WAS1" + }, + { + "id": "TOY1", + "name": "TORYONNZ-TOY1" + }, + { + "id": "STT1", + "name": "STTLWA02-STT1" + }, + { + "id": "STG1", + "name": "STTGGE62-STG1" + }, + { + "id": "SLL78", + "name": "SDCTLLL1-SLL78" + }, + { + "id": "SBU78", + "name": "SDIT1BUB-SBU78" + }, + { + "id": "ATL2", + "name": "ATLNGANW-ATL2" + }, + { + "id": "BOT1", + "name": "BOTHWAKY-BOT1" + }, + { + "id": "SNG1", + "name": "SNGPSIAU-SNG1" + }, + { + "id": "NYC1", + "name": "NYCMNY54-NYC1" + }, + { + "id": "LAG1b", + "name": "LARGIZON-LAG1b" + }, + { + "id": "AMD15", + "name": "AMDFAA01-AMD15" + }, + { + "id": "SNA1", + "name": "SNANTXCA-SNA1" + }, + { + "id": "PLT1", + "name": "PLTNCA60-PLT1" + }, + { + "id": "TLP1", + "name": "TLPNXM18-TLP1" + }, + { + "id": "SDD81", + "name": "SAIT1DD6-SDD81" + }, + { + "id": "DCC1", + "name": "POIUYTGH-DCC1" + }, + { + "id": "DCC2", + "name": "POIUYTGH-DCC2" + }, + { + "id": "OKC1", + "name": "OKCBOK55-OKC1" + }, + { + "id": "PAR1", + "name": "PARSFRCG-PAR1" + }, + { + "id": "TES36", + "name": "ABCEETES-TES36" + }, + { + "id": "COM1", + "name": "PLMKOPIU-COM1" + }, + { + "id": "ANI1", + "name": "ATLNGTRE-ANI1" + }, + { + "id": "SDG78", + "name": "SDIT1BDG-SDG78" + }, + { + "id": "mac20", + "name": "PKGTESTF-mac20" + }, + { + "id": "DSF45", + "name": "DSFBG123-DSF45" + }, + { + "id": "HST25", + "name": "HSTNTX01-HST25" + }, + { + "id": "AMD18", + "name": "AUDIMA01-AMD18" + }, + { + "id": "SAA80", + "name": "SAIT9AA3-SAA80" + }, + { + "id": "SSA56", + "name": "SSIT2AA7-SSA56" + }, + { + "id": "SDD82", + "name": "SAIT1DD9-SDD82" + }, + { + "id": "JCV1", + "name": "JCVLFLBW-JCV1" + }, + { + "id": "SUL2", + "name": "WERTYUJK-SUL2" + }, + { + "id": "PUR1", + "name": "purelyde-PUR1" + }, + { + "id": "FDE55", + "name": "FDERT555-FDE55" + }, + { + "id": "SITE", + "name": "LONEENCO-SITE" + }, + { + "id": "ATL1", + "name": "ATLNGAMA-ATL1" + }, + { + "id": "JUL1", + "name": "ZXCVBNMM-JUL1" + }, + { + "id": "TAT34", + "name": "TESAAISB-TAT34" + }, + { + "id": "XCP12", + "name": "CHKGH123-XCP12" + }, + { + "id": "RAI1", + "name": "poiuytre-RAI1" + }, + { + "id": "HPO1", + "name": "ATLNGAUP-HPO1" + }, + { + "id": "KJF12", + "name": "KJFDH123-KJF12" + }, + { + "id": "SCC80", + "name": "SAIT9CC3-SCC80" + }, + { + "id": "SAA12", + "name": "SAIT9AF8-SAA12" + }, + { + "id": "SAA14", + "name": "SAIT1AA9-SAA14" + }, + { + "id": "ATL35", + "name": "TTESSAAI-ATL35" + }, + { + "id": "CWY1", + "name": "CWYMOWBS-CWY1" + }, + { + "id": "ATL76", + "name": "TELEPAAI-ATL76" + }, + { + "id": "DSL12", + "name": "DSLFK242-DSL12" + }, + { + "id": "ATL53", + "name": "AAIATLTE-ATL53" + }, + { + "id": "SAA11", + "name": "SAIT9AA2-SAA11" + }, + { + "id": "ATL62", + "name": "TESSASCH-ATL62" + }, + { + "id": "AUG1", + "name": "ASDFGHJK-AUG1" + }, + { + "id": "POI22", + "name": "POIUY123-POI22" + }, + { + "id": "SAA13", + "name": "SAIT1AA9-SAA13" + }, + { + "id": "BHY17", + "name": "BHYTFRF3-BHY17" + }, + { + "id": "LIS1", + "name": "HOSTPROF-LIS1" + }, + { + "id": "SIP1", + "name": "ZXCVBNMK-SIP1" + }, + { + "id": "ATL99", + "name": "TEESTAAI-ATL43" + }, + { + "id": "ATL64", + "name": "FORLOAAJ-ATL64" + }, + { + "id": "TAT33", + "name": "TESAAISA-TAT33" + }, + { + "id": "RAD10", + "name": "INDIPUNE-RAD10" + }, + { + "id": "RTW5", + "name": "BHYTFRY4-RTW5" + }, + { + "id": "JGS1", + "name": "KSJKKKKK-JGS1" + }, + { + "id": "ATL98", + "name": "TEESTAAI-ATL43" + }, + { + "id": "WAN1", + "name": "LEIWANGW-WAN1" + }, + { + "id": "ATL44", + "name": "ATLSANAB-ATL44" + }, + { + "id": "RTD2", + "name": "BHYTFRk4-RTD2" + }, + { + "id": "NIR1", + "name": "ORFLMANA-NIR1" + }, + { + "id": "ATL75", + "name": "SANAAIRE-ATL75" + }, + { + "id": "NUM1", + "name": "QWERTYUI-NUM1" + }, + { + "id": "MTN32", + "name": "MDTWNJ21-MTN32" + }, + { + "id": "RTZ4", + "name": "BHYTFRZ6-RTZ4" + }, + { + "id": "ATL56", + "name": "ATLSANAC-ATL56" + }, + { + "id": "AMS1", + "name": "AMSTNLBW-AMS1" + }, + { + "id": "RCT1", + "name": "AMSTERNL-RCT1" + }, + { + "id": "JAN1", + "name": "ORFLMATT-JAN1" + }, + { + "id": "ABC14", + "name": "TESAAISA-ABC14" + }, + { + "id": "TAT37", + "name": "TESAAISD-TAT37" + }, + { + "id": "MIC54", + "name": "MICHIGAN-MIC54" + }, + { + "id": "ABC11", + "name": "ATLSANAI-ABC11" + }, + { + "id": "AMF11", + "name": "AMDOCS01-AMF11" + }, + { + "id": "ATL63", + "name": "ATLSANEW-ATL63" + }, + { + "id": "ABC12", + "name": "ATLSECIA-ABC12" + }, + { + "id": "MTN20", + "name": "MDTWNJ21-MTN20" + }, + { + "id": "ABC15", + "name": "AAITESAN-ABC15" + }, + { + "id": "AVT1", + "name": "AVTRFLHD-AVT1" + }, + { + "id": "ATL34", + "name": "ATLSANAI-ATL34" + } + ], + "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": "[LCP_REGIONS_AND_TENANTS] Update", + "subscribers": [ + { + "id": "CAR_2020_ER", + "name": "CAR_2020_ER", + "isPermitted": true + }, + { + "id": "21014aa2-526b-11e6-beb8-9e71128cae77", + "name": "JULIO ERICKSON", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-2", + "name": "DALE BRIDGES", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-1", + "name": "LLOYD BRIDGES", + "isPermitted": false + }, + { + "id": "jimmy-example", + "name": "JimmyExampleCust-20161102", + "isPermitted": false + }, + { + "id": "jimmy-example2", + "name": "JimmyExampleCust-20161103", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-102", + "name": "ERICA5779-TestSub-PWT-102", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-101", + "name": "ERICA5779-TestSub-PWT-101", + "isPermitted": false + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-4", + "name": "ERICA5779-Subscriber-5", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-103", + "name": "ERICA5779-TestSub-PWT-103", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-2", + "name": "ERICA5779-Subscriber-2", + "isPermitted": false + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "SILVIA ROBBINS", + "isPermitted": true + }, + { + "id": "ERICA5779-Subscriber-3", + "name": "ERICA5779-Subscriber-3", + "isPermitted": false + }, + { + "id": "31739f3e-526b-11e6-beb8-9e71128cae77", + "name": "CRAIG/ROBERTS", + "isPermitted": false + } + ] + } + } + } +} + +class MockFeatureFlagsService {} + +describe('VFModule Control Generator', () => { + let injector; + let service: VfModuleControlGenerator; + let httpMock: HttpTestingController; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [VfModuleControlGenerator, + GenericFormService, + BasicControlGenerator, + AaiService, + FormBuilder, + LogService, + {provide:FeatureFlagsService, useClass: MockFeatureFlagsService}, + {provide: NgRedux, useClass: MockAppStore}] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(VfModuleControlGenerator); + httpMock = injector.get(HttpTestingController); + jest.spyOn(console, 'error'); + + })().then(done).catch(done.fail)); + + test(' getMacroFormControls gets vnfStoreKey === null', () => { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfStoreKey: string = null; + const vfModuleStoreKey: string = 'vf_vmee0..VfVmee..base_vmme..module-0'; + const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830"; + const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, vfModuleUUID, true); + + expect(controls).toEqual([]); + expect(console.error).toHaveBeenCalled(); + }); + + test('getAlaCarteFormControls check for mandatory controls', () => { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfStoreKey: string = 'VF_vMee 0'; + const vfModuleStoreKey: string = 'vf_vmee0..VfVmee..base_vmme..module-0'; + const uuidData: Object = { + modelId : "522159d5-d6e0-4c2a-aa44-5a542a12a830", + modelName : "vf_vmee0..VfVmee..base_vmme..module-0", + serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + type : "VFmodule", + vFModuleStoreKey : "vf_vmee0..VfVmee..base_vmme..module-0vmvzo", + vnfStoreKey : "VF_vMee 0" + }; + const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, uuidData, true); + + const mandatoryControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.LCPCLOUD_REGION_ID, + FormControlNames.TENANT_ID, + FormControlNames.ROLLBACK_ON_FAILURE, + ]; + + for(let i = 0 ; i < mandatoryControls.length ; i++) { + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + test('getMacroFormControls check for mandatory controls', () => { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfStoreKey: string = 'VF_vMee 0'; + const uuidData: Object = { + modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + modelName : "vf_vmee0..VfVmee..base_vmme..module-0", + serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + type : "VFmodule", + vFModuleStoreKey : "vf_vmee0..VfVmee..base_vmme..module-0vmvzo", + vnfStoreKey : "VF_vMee 0" + }; + const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfStoreKey, uuidData, true); + + const mandatoryControls : string[] = [ + 'instanceName' + ]; + + for(let i = 0 ; i < mandatoryControls.length ; i++) { + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + test(' getMacroFormControls gets null vnfStoreKey', () => { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfStoreKey: string = null; + const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830"; + const uuidData: Object = {}; + const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData,true); + + expect(controls).toEqual([]); + expect(console.error).toHaveBeenCalled(); + }); + + test('getAlaCarteFormControls should return the correct order of controls', () => { + const controls:FormControlModel[] = getAlaCarteFormControls(); + + const orderedControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.VOLUME_GROUP_NAME, + FormControlNames.LCPCLOUD_REGION_ID, + FormControlNames.LEGACY_REGION, + FormControlNames.TENANT_ID, + FormControlNames.ROLLBACK_ON_FAILURE, + FormControlNames.SDN_C_PRE_LOAD + ]; + + expect(controls.length).toEqual(7); + for(let i = 0 ; i < orderedControls.length ; i++) { + expect(controls[i].controlName).toEqual(orderedControls[i]); + } + }); + + function getAlaCarteFormControls():FormControlModel[] { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfStoreKey: string = 'VF_vMee 0'; + const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830"; + const uuidData: Object = { + modelId: "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + modelName: "vf_vmee0..VfVmee..base_vmme..module-0", + serviceId: "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + type: "VFmodule", + vFModuleStoreKey: "vf_vmee0..VfVmee..base_vmme..module-0vmvzo", + vnfStoreKey: "VF_vMee 0" + }; + const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true); + return controls; + } + + test('getAlaCarteFormControls responce with wrong order of controls', () => { + const controls:FormControlModel[] = getAlaCarteFormControls(); + + const orderedControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.VOLUME_GROUP_NAME, + FormControlNames.LCPCLOUD_REGION_ID, + FormControlNames.TENANT_ID, // TENANT_ID must be after LEGACY_REGION + FormControlNames.LEGACY_REGION, + FormControlNames.ROLLBACK_ON_FAILURE, + FormControlNames.SDN_C_PRE_LOAD + ]; + + for(let i = 0 ; i < orderedControls.length ; i++) { + if (controls[i].controlName === 'legacyRegion') { + expect(orderedControls[i]).toEqual('tenantId'); + } + } + }); + + test('getMacroFormControls should return the correct order of controls', () => { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfStoreKey: string = 'VF_vMee 0'; + const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830"; + const uuidData: Object = { + modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + modelName : "vf_vmee0..VfVmee..base_vmme..module-0", + serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + type : "VFmodule", + vFModuleStoreKey : "vf_vmee0..VfVmee..base_vmme..module-0vmvzo", + vnfStoreKey : "VF_vMee 0" + }; + const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true); + + const orderedControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.VOLUME_GROUP_NAME + ]; + + for(let i = 0 ; i < orderedControls.length ; i++) { + expect(controls[i].controlName).toEqual(orderedControls[i]); + } + }); + + test.each` + controllerName + ${'instanceName'} + ${'volumeGroupName'} + `('getAlacartFormControls $controllerName control validator shall have the expected regex', ({controllerName}) => { + const controls:FormControlModel[] = getAlaCarteFormControls(); + + const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName == controllerName); + const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern); + expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/); + }); + + test(' getAlaCarteFormControls gets null service', () => { + const controls:FormControlModel[] = getAlaCarteFormControls(); + expect(controls.length).toEqual(7); + + const orderedControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.VOLUME_GROUP_NAME, + FormControlNames.LCPCLOUD_REGION_ID, + FormControlNames.LEGACY_REGION, + FormControlNames.TENANT_ID, + FormControlNames.ROLLBACK_ON_FAILURE, + FormControlNames.SDN_C_PRE_LOAD + ]; + + for(let i = 0 ; i < orderedControls.length ; i++) { + expect(controls[i].controlName).toEqual(orderedControls[i]); + } + }); +}); + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts new file mode 100644 index 000000000..3012c139c --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator.ts @@ -0,0 +1,349 @@ +import {Injectable} from "@angular/core"; +import {GenericFormService} from "../../generic-form.service"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {NgRedux} from "@angular-redux/store"; +import {HttpClient} from "@angular/common/http"; +import {BasicControlGenerator} from "../basic.control.generator"; +import * as _ from 'lodash'; +import {Observable, of} from "rxjs"; + +import { + CustomValidatorOptions, + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {LogService} from "../../../../utils/log/log.service"; +import {AppState} from "../../../../store/reducers"; +import {FormGroup} from "@angular/forms"; +import {DropdownFormControl} from "../../../../models/formControlModels/dropdownFormControl.model"; +import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum"; +import {InputFormControl} from "../../../../models/formControlModels/inputFormControl.model"; +import {SelectOption} from "../../../../models/selectOption"; +import {VfModuleInstance} from "../../../../models/vfModuleInstance"; +import {VfModule} from "../../../../models/vfModule"; +import {VNFModel} from "../../../../models/vnfModel"; +import {VnfInstance} from "../../../../models/vnfInstance"; +import {FileFormControl} from "../../../../models/formControlModels/fileFormControl.model"; +import {CheckboxFormControl} from "../../../../models/formControlModels/checkboxFormControl.model"; +import {FileUnit} from "../../../formControls/component/file/fileUnit.enum"; +import {Constants} from "../../../../utils/constants"; + + +export enum FormControlNames { + INSTANCE_NAME = 'instanceName', + VOLUME_GROUP_NAME = 'volumeGroupName', + LCPCLOUD_REGION_ID = 'lcpCloudRegionId', + LEGACY_REGION = 'legacyRegion', + TENANT_ID = 'tenantId', + ROLLBACK_ON_FAILURE = 'rollbackOnFailure', + SDN_C_PRE_LOAD = 'sdncPreLoad', + SUPPLEMENTARY_FILE = 'supplementaryFile' +} + + +@Injectable() +export class VfModuleControlGenerator { + aaiService: AaiService; + vfModuleModel: VfModule; + vfModuleName : string; + isUpdateMode : boolean; + + constructor(private genericFormService: GenericFormService, + private _basicControlGenerator: BasicControlGenerator, + private store: NgRedux<AppState>, + private http: HttpClient, + private _aaiService: AaiService, + private _logService: LogService) { + this.aaiService = _aaiService; + } + + setVFModuleStoreKey = (serviceId: string, vfModuleUuid: string) => { + const vfModules = this.store.getState().service.serviceHierarchy[serviceId].vfModules; + const vfModulesKeys = Object.keys(vfModules); + for(let key of vfModulesKeys){ + if(vfModules[key].uuid === vfModuleUuid){ + this.vfModuleName = key; + return; + } + } + }; + + + getVfModuleInstance = (serviceId: string, vnfStoreKey: string, UUIDData: Object, isUpdateMode: boolean): VfModuleInstance => { + let vfModuleInstance: VfModuleInstance = null; + if (isUpdateMode && this.store.getState().service.serviceInstance[serviceId] && + _.has(this.store.getState().service.serviceInstance[serviceId].vnfs, vnfStoreKey) && + _.has(this.store.getState().service.serviceInstance[serviceId].vnfs[vnfStoreKey].vfModules, UUIDData['modelName'])) { + vfModuleInstance = Object.assign({},this.store.getState().service.serviceInstance[serviceId].vnfs[vnfStoreKey].vfModules[UUIDData['modelName']][UUIDData['vFModuleStoreKey']]); + } + return vfModuleInstance; + }; + + extractVfAccordingToVfModuleUuid(serviceId: string, UUIDData: Object): VfModule { + const vfModule = this.store.getState().service.serviceHierarchy[serviceId].vfModules[UUIDData['modelName']]; + this.vfModuleModel = vfModule; + return vfModule; + } + + getMacroFormControls(serviceId: string, vnfStoreKey: string, vfModuleStoreKey: string, uuidData : Object, isUpdateMode: boolean): FormControlModel[] { + this.isUpdateMode = isUpdateMode; + this.extractVfAccordingToVfModuleUuid(serviceId, uuidData); + if (_.isNil(serviceId) || _.isNil(vnfStoreKey) || _.isNil(vfModuleStoreKey)) { + if(isUpdateMode){ + this._logService.error('should provide serviceId, vfModuleStoreKey, vnfStoreKey', serviceId); + return []; + } + } + + const vfModuleInstance = this.getVfModuleInstance(serviceId, vnfStoreKey, uuidData, isUpdateMode); + const vfModuleModel = this.vfModuleModel; + const vnf: VnfInstance = this.store.getState().service.serviceInstance[serviceId].vnfs[vnfStoreKey]; + const vnfModelName: string = vnf.originalName; + const vnfModel = new VNFModel(this.store.getState().service.serviceHierarchy[serviceId].vnfs[vnfModelName]); + + let result: FormControlModel[] = []; + + if (!_.isNil(vfModuleModel)) { + result.push(this.getInstanceName(vfModuleInstance, serviceId, vnfModel.isEcompGeneratedNaming)); + if (this.vfModuleModel.volumeGroupAllowed) { + result.push(this.getVolumeGroupName(vfModuleInstance, serviceId, vnfStoreKey, vfModuleInstance && vfModuleInstance.volumeGroupName, vnfModel.isEcompGeneratedNaming)); + } + } + if(this.store.getState().global.flags['FLAG_SUPPLEMENTARY_FILE']) { + let suppFileInput:FileFormControl = <FileFormControl>(this.getSupplementaryFile(vfModuleInstance)); + result.push(suppFileInput); + result = result.concat(suppFileInput.hiddenFile); + } + return result; + } + + getAlaCarteFormControls(serviceId: string, vnfStoreKey: string, vfModuleStoreKey: string, uuidData : Object, isUpdateMode: boolean): FormControlModel[] { + this.isUpdateMode = isUpdateMode; + this.extractVfAccordingToVfModuleUuid(serviceId, uuidData); + if (_.isNil(serviceId) || _.isNil(vnfStoreKey) || _.isNil(vfModuleStoreKey)) { + if(isUpdateMode){ + this._logService.error('should provide serviceId, vfModuleStoreKey, vnfStoreKey', serviceId); + return []; + } + } + const vnf: VnfInstance = this.store.getState().service.serviceInstance[serviceId].vnfs[vnfStoreKey]; + const vnfModelName: string = vnf.originalName; + const vnfModel = new VNFModel(this.store.getState().service.serviceHierarchy[serviceId].vnfs[vnfModelName]); + + const vfModuleInstance = this.getVfModuleInstance(serviceId, vnfStoreKey, uuidData, isUpdateMode); + let result: FormControlModel[] = []; + result.push(this.getInstanceName(vfModuleInstance, serviceId, vnfModel.isEcompGeneratedNaming)); + + if (this.vfModuleModel.volumeGroupAllowed) { + result.push(this.getVolumeGroupName(vfModuleInstance, serviceId, vnfStoreKey, this.vfModuleName, vnfModel.isEcompGeneratedNaming)); + } + result.push(this.getLcpRegionControl(serviceId, vfModuleInstance, result)); + result.push(this._basicControlGenerator.getLegacyRegion(vfModuleInstance)); + result.push(this.getTenantControl(serviceId, vfModuleInstance, result)); + result.push(this.getRollbackOnFailureControl(vfModuleInstance, result)); + result.push(this.getSDNCControl(vfModuleInstance, result)); + if(this.store.getState().global.flags['FLAG_SUPPLEMENTARY_FILE']) { + let suppFileInput:FileFormControl = <FileFormControl>(this.getSupplementaryFile(vfModuleInstance)); + result.push(suppFileInput); + result = result.concat(suppFileInput.hiddenFile); + } + return result; + + } + + getInstanceName(instance: any, serviceId: string, isEcompGeneratedNaming: boolean): FormControlModel { + let formControlModel:FormControlModel = this._basicControlGenerator.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, this.vfModuleModel); + formControlModel.onBlur = (event, form : FormGroup) => { + if(!_.isNil(form.controls['volumeGroupName'])&& event.target.value.length > 0){ + form.controls['volumeGroupName'].setValue(event.target.value + "_vol"); + } + }; + + return formControlModel; + } + + getDefaultVolumeGroupName(instance: any, vfModuleName: string, isEcompGeneratedNaming: boolean): string { + if ((!_.isNil(instance) && instance.volumeGroupName)) { + return instance.volumeGroupName; + } + if (isEcompGeneratedNaming) { + return null; + } + return this._basicControlGenerator.getDefaultInstanceName(instance, this.vfModuleModel) + "_vol"; + } + + getVolumeGroupName(instance: any, serviceId: string, vnfStoreKey: string, vfModuleName: string, isEcompGeneratedNaming: boolean): FormControlModel { + let validations: ValidatorModel[] = [ + new ValidatorModel(ValidatorOptions.pattern, 'Instance name may include only alphanumeric characters and underscore.', BasicControlGenerator.INSTANCE_NAME_REG_EX), + new ValidatorModel(CustomValidatorOptions.uniqueInstanceNameValidator, 'Volume Group instance name is already in use, please pick another name', [this.store, serviceId, instance && instance.volumeGroupName]) + ]; + // comment out because if not provided vid won't create VG + // if (!isEcompGeneratedNaming) { + // validations.push(new ValidatorModel(ValidatorOptions.required, 'is required')); + // } + return new InputFormControl({ + controlName: 'volumeGroupName', + displayName: 'Volume Group Name', + dataTestId: 'volumeGroupName', + // placeHolder: (!isEcompGeneratedNaming) ? 'Volume Group Name' : 'Automatically generated when not provided', + validations: validations, + tooltip : 'When filled, VID will create a Volume Group by this name and associate with this module.\n' + + 'When empty, the module is created without a Volume Group.', + isVisible: true, + value: this.getDefaultVolumeGroupName(instance, vfModuleName, isEcompGeneratedNaming), + onKeypress: (event) => { + const pattern:RegExp = BasicControlGenerator.INSTANCE_NAME_REG_EX; + if (pattern) { + if (!pattern.test(event['key'])) { + event.preventDefault(); + } + } + return event; + } + }); + } + + getSupplementaryFile(instance: any): FormControlModel { + return new FileFormControl({ + controlName: FormControlNames.SUPPLEMENTARY_FILE, + displayName: 'Supplementary Data File (JSON format)', + dataTestId: 'SupplementaryFile', + placeHolder: 'Choose file', + selectedFile: !_.isNil(instance) ? instance.supplementaryFileName: null, + isVisible: true, + acceptedExtentions: "application/json", + hiddenFile : [new InputFormControl({ + controlName: FormControlNames.SUPPLEMENTARY_FILE + "_hidden", + isVisible: false, + validations: [new ValidatorModel(CustomValidatorOptions.isFileTooBig, "File size exceeds 5MB.", [FileUnit.MB, 5])] + }), + new InputFormControl({ + controlName: FormControlNames.SUPPLEMENTARY_FILE + "_hidden_content", + isVisible: false, + validations: [new ValidatorModel(CustomValidatorOptions.isValidJson, + "File is invalid, please make sure a legal JSON file is uploaded using name:value pairs.",[]), + new ValidatorModel(CustomValidatorOptions.isStringContainTags, + "File is invalid, please remove tags <>.",[])], + value: !_.isNil(instance) ? (instance.supplementaryFile_hidden_content): null, + }) + ], + onDelete : (form : FormGroup) => { + form.controls[FormControlNames.SUPPLEMENTARY_FILE + "_hidden"].setValue(null); + form.controls[FormControlNames.SUPPLEMENTARY_FILE + "_hidden_content"].setValue(null); + }, + onChange : (files: FileList, form : FormGroup) => { + if (files.length > 0) { + const file = files.item(0); + let reader = new FileReader(); + reader.onload = function(event) { + form.controls[FormControlNames.SUPPLEMENTARY_FILE + "_hidden_content"].setValue(reader.result); + form.controls[FormControlNames.SUPPLEMENTARY_FILE + "_hidden"].setValue(file); + }; + reader.readAsText(file); + } + else { + form.controls[FormControlNames.SUPPLEMENTARY_FILE + "_hidden"].setValue(null); + form.controls[FormControlNames.SUPPLEMENTARY_FILE + "_hidden_content"].setValue(null); + } + } + }) + }; + + getTenantControl = (serviceId: string, instance: any, controls: FormControlModel[]): DropdownFormControl => { + const service = this.store.getState().service.serviceInstance[serviceId]; + const globalCustomerId: string = service.globalSubscriberId; + const serviceType: string = service.subscriptionServiceType; + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: FormControlNames.TENANT_ID, + displayName: 'Tenant', + dataTestId: 'tenant', + placeHolder: 'Select Tenant', + name: "tenant", + isDisabled: _.isNil(instance) || _.isNil(instance.lcpCloudRegionId), + onInitSelectedField: instance ? ['lcpRegionsTenantsMap', instance.lcpCloudRegionId] : null, + value: instance ? instance.tenantId : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInit: instance ? this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this.aaiService.getLcpRegionsAndTenants.bind(this, globalCustomerId, serviceType)) : () => { + }, + }) + }; + + getLcpRegionControl = (serviceId: string, instance: any, controls: FormControlModel[]): DropdownFormControl => { + const service = this.store.getState().service.serviceInstance[serviceId]; + const globalCustomerId: string = service.globalSubscriberId; + const serviceType: string = service.subscriptionServiceType; + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: 'lcpCloudRegionId', + displayName: 'LCP region', + dataTestId: 'lcpRegion', + placeHolder: 'Select LCP Region', + name: "lcpRegion", + isDisabled: false, + value: instance ? instance.lcpCloudRegionId : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInitSelectedField: ['lcpRegionList'], + onInit: this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this._aaiService.getLcpRegionsAndTenants.bind(this, globalCustomerId, serviceType)), + onChange: (param: string, form: FormGroup) => { + form.controls[FormControlNames.TENANT_ID].enable(); + form.controls[FormControlNames.TENANT_ID].reset(); + if (!_.isNil(globalCustomerId) && !_.isNil(serviceType)) { + this._basicControlGenerator.getSubscribeResult.bind(this, this._aaiService.getLcpRegionsAndTenants(globalCustomerId, serviceType).subscribe(res => { + controls.find(item => item.controlName === FormControlNames.TENANT_ID)['options$'] = res.lcpRegionsTenantsMap[param]; + if (res.lcpRegionsTenantsMap[param]) { + controls.find(item => item.controlName === FormControlNames.TENANT_ID)['hasEmptyOptions'] = res.lcpRegionsTenantsMap[param].length === 0; + } + })); + } + + if (Constants.LegacyRegion.MEGA_REGION.indexOf(param) !== -1) { + form.controls['legacyRegion'].enable(); + controls.find(item => item.controlName === 'legacyRegion').isVisible = true; + + } else { + controls.find(item => item.controlName === 'legacyRegion').isVisible = false; + form.controls['legacyRegion'].setValue(null); + form.controls['legacyRegion'].reset(); + form.controls['legacyRegion'].disable(); + } + } + }) + }; + + getSDNCControl = (instance: any, controls: FormControlModel[]): CheckboxFormControl => { + return new CheckboxFormControl({ + type: FormControlType.CHECKBOX, + controlName: 'sdncPreLoad', + displayName: 'SDN-C pre-load', + dataTestId: 'sdncPreLoad', + value: instance ? instance.sdncPreLoad : false, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')] + }) + }; + + getRollbackOnFailureControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: FormControlNames.ROLLBACK_ON_FAILURE, + displayName: 'Rollback on failure', + dataTestId: 'rollback', + isDisabled: false, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + value: instance ? instance.rollbackOnFailure : 'true', + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this.getRollBackOnFailureOptions) + }) + }; + + getRollBackOnFailureOptions = (): Observable<SelectOption[]> => { + return of([ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]); + }; +} diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts new file mode 100644 index 000000000..d15a57bcf --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.spec.ts @@ -0,0 +1,1943 @@ +import {getTestBed, TestBed} from '@angular/core/testing'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; +import {NgRedux} from '@angular-redux/store'; +import {FormControlNames} from "../service.control.generator"; +import {BasicControlGenerator} from "../basic.control.generator"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {GenericFormService} from "../../generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {LogService} from "../../../../utils/log/log.service"; +import {VnfControlGenerator} from "./vnf.control.generator"; +import {Observable} from "rxjs"; +import {SelectOption} from "../../../../models/selectOption"; +import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service"; + +class MockAppStore<T> { + getState(){ + return { + "global": { + "name": null, + "flags": { + "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false, + "FLAG_SHOW_ASSIGNMENTS": true, + "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, + "FLAG_UNASSIGN_SERVICE": true, + "FLAG_SHOW_VERIFY_SERVICE": false, + "FLAG_COLLECTION_RESOURCE_SUPPORT": true, + "FLAG_DUPLICATE_VNF": true, + "FLAG_SERVICE_MODEL_CACHE": true, + "CREATE_INSTANCE_TEST": false, + "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false, + "FLAG_ASYNC_INSTANTIATION": true, + "FLAG_ASYNC_JOBS": true, + "EMPTY_DRAWING_BOARD_TEST": false, + "FLAG_ADD_MSO_TESTAPI_FIELD": true + }, + "type": "[FLAGS] Update" + }, + "service": { + "serviceHierarchy": { + "6e59c5de-f052-46fa-aa7e-2fca9d674c44": { + "service": { + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "name": "ComplexService", + "version": "1.0", + "toscaModelURL": null, + "category": "Emanuel", + "serviceType": "", + "serviceRole": "", + "description": "ComplexService", + "serviceEcompNaming": "false", + "instantiationType": "Macro", + "inputs": {} + }, + "vnfs": { + "VF_vMee 0": { + "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60", + "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e", + "description": "VSP_vMee", + "name": "VF_vMee", + "version": "2.0", + "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9", + "inputs": {}, + "commands": {}, + "properties": { + "max_instances": 10, + "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", + "sctp-b-IPv6_ethertype": "IPv6", + "sctp-a-egress_rule_application": "any", + "sctp-b-ingress_action": "pass", + "sctp-b-ingress_rule_protocol": "icmp", + "ncb2_Internal1_mac": "00:11:22:EF:AC:DF", + "sctp-b-ipv6-ingress-src_start_port": "0.0", + "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", + "sctp-a-ipv6-ingress-dst_start_port": "0", + "sctp-b-ipv6-ingress_rule_application": "any", + "domain_name": "default-domain", + "sctp-a-ingress_rule_protocol": "icmp", + "sctp-b-egress-src_start_port": "0.0", + "sctp-a-egress_src_addresses": "local", + "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group", + "sctp-a-egress-src_start_port": "0.0", + "sctp-a-ingress_ethertype": "IPv4", + "sctp-b-ipv6-ingress-dst_end_port": "65535", + "sctp-b-dst_subnet_prefix_v6": "::", + "nf_naming": "{ecomp_generated_naming=true}", + "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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix_len": "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:11:22:EF:AC:DF", + "sctp-a-egress_ethertype": "IPv4", + "vlc_st_service_mode": "in-network-nat", + "sctp-a-ipv6-egress_ethertype": "IPv4", + "sctp-a-egress-src_end_port": "65535.0", + "sctp-b-ipv6-egress_rule_application": "any", + "sctp-b-egress_action": "pass", + "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:11:22:EF:AC:DF", + "sctp-a-ipv6-ingress-src_start_port": "0.0", + "sctp-b-ipv6-egress_ethertype": "IPv4", + "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", + "ecomp_generated_naming": "false", + "sctp-a-IPv6_ethertype": "IPv6", + "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", + "sctp-a-ipv6-ingress-src_end_port": "65535.0", + "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-b-ingress_rule_application": "any", + "int2_sec_group_name": "int2-sec-group", + "vlc_flavor_name": "nd.c16r64d1", + "sctp-b-ipv6-egress_src_addresses": "local", + "vlc_st_interface_type_int1": "other1", + "sctp-b-egress-src_end_port": "65535.0", + "sctp-a-ipv6-egress-dst_start_port": "0", + "vlc_st_interface_type_int2": "other2", + "sctp-a-ipv6-egress_rule_protocol": "any", + "Internal2_shared": "false", + "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0", + "Internal2_rpf": "disable", + "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", + "sctp-a-ipv6-egress_src_end_port": "65535", + "Internal1_forwarding_mode": "l2", + "Internal2_dhcp": "false", + "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: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:11:22:EF:AC:DF", + "sctp-b-egress_dst_subnet_prefix": "0.0.0.0", + "Internal1_net_cidr_len": "17", + "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: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: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:11:22:EF:AC:DF", + "vlc_st_interface_type_oam": "management", + "multi_stage_design": "true", + "oam_sec_group_name": "oam-sec-group", + "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": "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", + "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0", + "sctp-a-ipv6-ingress_dst_addresses": "local", + "sctp-a-egress_rule_protocol": "icmp", + "sctp-b-ipv6-egress_action": "pass", + "sctp-a-ipv6-egress_action": "pass", + "Internal1_shared": "false", + "sctp-b-ipv6-ingress_rule_protocol": "any", + "Internal2_net_cidr_len": "17", + "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group", + "sctp-a-ingress-src_end_port": "65535.0", + "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0", + "sctp-a-egress-dst_end_port": "65535.0", + "sctp-a-ingress_action": "pass", + "sctp-b-egress_rule_protocol": "icmp", + "sctp-b-ipv6-ingress_action": "pass", + "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: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", + "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0", + "Internal1_allow_transit": "true", + "gpb_flavor_name": "nv.c20r64d1", + "availability_zone_max_count": "1", + "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2", + "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:11:22:EF:AC:DF", + "sctp-a-ingress-src_subnet_prefix": "0.0.0.0", + "sctp-a-ipv6-ingress_action": "pass", + "Internal1_rpf": "disable", + "sctp-b-ingress_ethertype": "IPv4", + "sctp-b-egress_rule_application": "any", + "sctp-b-ingress-src_end_port": "65535.0", + "sctp-a-ipv6-ingress_rule_protocol": "any", + "sctp-a-ingress-src_start_port": "0.0", + "sctp-b-egress-dst_end_port": "65535.0" + }, + "type": "VF", + "modelCustomizationName": "VF_vMee 0", + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "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": { + "Port Mirroring Configuration By Policy 0": { + "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50", + "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7", + "description": "A port mirroring configuration by policy object", + "name": "Port Mirroring Configuration By Policy", + "version": "27.0", + "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2", + "inputs": {}, + "commands": {}, + "properties": {}, + "type": "Configuration", + "modelCustomizationName": "Port Mirroring Configuration By Policy 0", + "sourceNodes": [], + "collectorNodes": null, + "configurationByPolicy": false + } + }, + "serviceProxies": {}, + "vfModules": { + "vf_vmee0..VfVmee..vmme_vlc..module-1": { + "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" + }, + "inputs": {}, + "volumeGroupAllowed": true + }, + "vf_vmee0..VfVmee..vmme_gpb..module-2": { + "uuid": "41708296-e443-4c71-953f-d9a010f059e1", + "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9", + "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c", + "description": null, + "name": "VfVmee..vmme_gpb..module-2", + "version": "2", + "modelCustomizationName": "VfVmee..vmme_gpb..module-2", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "vmme_gpb" + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {}, + "volumeGroupAllowed": true + } + }, + "volumeGroups": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "description": null, + "name": "VfVmee..base_vmme..module-0", + "version": "2", + "modelCustomizationName": "VfVmee..base_vmme..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_vmme" + }, + "inputs": {} + } + }, + "pnfs": {} + } + }, + "serviceInstance": { + "6e59c5de-f052-46fa-aa7e-2fca9d674c44": { + "vnfs": { + "VF_vMee 0": { + "rollbackOnFailure": "true", + "vfModules": { + "vf_vmee0..VfVmee..base_vmme..module-0": { + "vf_vmee0..VfVmee..base_vmme..module-0vmvzo": { + "isMissingData": false, + "sdncPreReload": null, + "modelInfo": { + "modelType": "VFmodule", + "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d", + "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87", + "modelName": "VfVmee..base_vmme..module-0", + "modelVersion": "2", + "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861", + "modelCustomizationName": "VfVmee..base_vmme..module-0" + }, + "instanceParams": [ + {} + ], + "trackById": "wmtm6sy2uj" + } + } + }, + "isMissingData": true, + "originalName": "VF_vMee 0", + "vnfStoreKey": "VF_vMee 0", + "trackById": "p3wk448m5do", + "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60", + "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "lcpCloudRegionId": null, + "tenantId": null, + "lineOfBusiness": null, + "platformName": null, + "modelInfo": { + "modelType": "VF", + "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e", + "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "modelName": "VF_vMee", + "modelVersion": "2.0", + "modelCustomizationName": "VF_vMee 0" + } + } + }, + "instanceParams": [ + {} + ], + "validationCounter": 1, + "existingNames": {}, + "existingVNFCounterMap": { + "d6557200-ecf2-4641-8094-5393ae3aae60": 1 + }, + "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89", + "subscriptionServiceType": "TYLER SILVIA", + "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc", + "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "lcpCloudRegionId": "hvf6", + "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e", + "aicZoneId": "JAG1", + "projectName": "x1", + "rollbackOnFailure": "true", + "bulkSize": 1, + "modelInfo": { + "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "modelName": "ComplexService", + "modelVersion": "1.0", + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44" + }, + "isALaCarte": false, + "name": "ComplexService", + "version": "1.0", + "description": "ComplexService", + "category": "Emanuel", + "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44", + "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "serviceType": "", + "serviceRole": "", + "isMultiStepDesign": false + } + }, + "lcpRegionsAndTenants": { + "lcpRegionList": [ + { + "id": "JANET25", + "name": "JANET25", + "isPermitted": true + }, + { + "id": "hvf6", + "name": "hvf6", + "isPermitted": true + } + ], + "lcpRegionsTenantsMap": { + "JANET25": [ + { + "id": "092eb9e8e4b7412e8787dd091bc58e86", + "name": "USP-SIP-IC-24335-T-01", + "isPermitted": true + } + ], + "hvf6": [ + { + "id": "bae71557c5bb4d5aac6743a4e5f1d054", + "name": "AIN Web Tool-15-D-testalexandria", + "isPermitted": true + }, + { + "id": "229bcdc6eaeb4ca59d55221141d01f8e", + "name": "AIN Web Tool-15-D-STTest2", + "isPermitted": true + }, + { + "id": "1178612d2b394be4834ad77f567c0af2", + "name": "AIN Web Tool-15-D-SSPtestcustome", + "isPermitted": true + }, + { + "id": "19c5ade915eb461e8af52fb2fd8cd1f2", + "name": "AIN Web Tool-15-D-UncheckedEcopm", + "isPermitted": true + }, + { + "id": "de007636e25249238447264a988a927b", + "name": "AIN Web Tool-15-D-dfsdf", + "isPermitted": true + }, + { + "id": "62f29b3613634ca6a3065cbe0e020c44", + "name": "AIN/SMS-16-D-Multiservices1", + "isPermitted": true + }, + { + "id": "649289e30d3244e0b48098114d63c2aa", + "name": "AIN Web Tool-15-D-SSPST66", + "isPermitted": true + }, + { + "id": "3f21eeea6c2c486bba31dab816c05a32", + "name": "AIN Web Tool-15-D-ASSPST47", + "isPermitted": true + }, + { + "id": "f60ce21d3ee6427586cff0d22b03b773", + "name": "CESAR-100-D-sspjg67246", + "isPermitted": true + }, + { + "id": "8774659e425f479895ae091bb5d46560", + "name": "CESAR-100-D-sspjg68359", + "isPermitted": true + }, + { + "id": "624eb554b0d147c19ff8885341760481", + "name": "AINWebTool-15-D-iftach", + "isPermitted": true + }, + { + "id": "214f55f5fc414c678059c383b03e4962", + "name": "CESAR-100-D-sspjg612401", + "isPermitted": true + }, + { + "id": "c90666c291664841bb98e4d981ff1db5", + "name": "CESAR-100-D-sspjg621340", + "isPermitted": true + }, + { + "id": "ce5b6bc5c7b348e1bf4b91ac9a174278", + "name": "sspjg621351cloned", + "isPermitted": true + }, + { + "id": "b386b768a3f24c8e953abbe0b3488c02", + "name": "AINWebTool-15-D-eteancomp", + "isPermitted": true + }, + { + "id": "dc6c4dbfd225474e9deaadd34968646c", + "name": "AINWebTool-15-T-SPFET", + "isPermitted": true + }, + { + "id": "02cb5030e9914aa4be120bd9ed1e19eb", + "name": "AINWebTool-15-X-eeweww", + "isPermitted": true + }, + { + "id": "f2f3830e4c984d45bcd00e1a04158a79", + "name": "CESAR-100-D-spjg61909", + "isPermitted": true + }, + { + "id": "05b91bd5137f4929878edd965755c06d", + "name": "CESAR-100-D-sspjg621512cloned", + "isPermitted": true + }, + { + "id": "7002fbe8482d4a989ddf445b1ce336e0", + "name": "AINWebTool-15-X-vdr", + "isPermitted": true + }, + { + "id": "4008522be43741dcb1f5422022a2aa0b", + "name": "AINWebTool-15-D-ssasa", + "isPermitted": true + }, + { + "id": "f44e2e96a1b6476abfda2fa407b00169", + "name": "AINWebTool-15-D-PFNPT", + "isPermitted": true + }, + { + "id": "b69a52bec8a84669a37a1e8b72708be7", + "name": "AINWebTool-15-X-vdre", + "isPermitted": true + }, + { + "id": "fac7d9fd56154caeb9332202dcf2969f", + "name": "AINWebTool-15-X-NONPODECOMP", + "isPermitted": true + }, + { + "id": "2d34d8396e194eb49969fd61ffbff961", + "name": "DN5242-Nov16-T5", + "isPermitted": true + }, + { + "id": "cb42a77ff45b48a8b8deb83bb64acc74", + "name": "ro-T11", + "isPermitted": true + }, + { + "id": "fa45ca53c80b492fa8be5477cd84fc2b", + "name": "ro-T112", + "isPermitted": true + }, + { + "id": "4914ab0ab3a743e58f0eefdacc1dde77", + "name": "DN5242-Nov21-T1", + "isPermitted": true + }, + { + "id": "d0a3e3f2964542259d155a81c41aadc3", + "name": "test-hvf6-09", + "isPermitted": true + }, + { + "id": "cbb99fe4ada84631b7baf046b6fd2044", + "name": "DN5242-Nov16-T3", + "isPermitted": true + } + ] + } + }, + "productFamilies": [ + { + "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034", + "name": "SCOTTIE", + "isPermitted": true + }, + { + "id": "17cc1042-527b-11e6-beb8-9e71128cae77", + "name": "IGNACIO", + "isPermitted": true + }, + { + "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e", + "name": "Christie", + "isPermitted": true + }, + { + "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7", + "name": "Enhanced Services", + "isPermitted": true + }, + { + "id": "vTerrance", + "name": "vTerrance", + "isPermitted": true + }, + { + "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f", + "name": "vSCP", + "isPermitted": true + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": true + }, + { + "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c", + "name": "BVOIP", + "isPermitted": true + }, + { + "id": "db171b8f-115c-4992-a2e3-ee04cae357e0", + "name": "LINDSEY", + "isPermitted": true + }, + { + "id": "LRSI-OSPF", + "name": "LRSI-OSPF", + "isPermitted": true + }, + { + "id": "vRosemarie", + "name": "HNGATEWAY", + "isPermitted": true + }, + { + "id": "vHNPaas", + "name": "WILKINS", + "isPermitted": true + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce", + "name": "VROUTER", + "isPermitted": true + }, + { + "id": "Cisneros", + "name": "vMuriel", + "isPermitted": true + }, + { + "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1", + "name": "CARA Griffin", + "isPermitted": true + }, + { + "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d", + "name": "DARREN MCGEE", + "isPermitted": true + }, + { + "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1", + "name": "Transport", + "isPermitted": true + }, + { + "id": "vSalvatore", + "name": "vSalvatore", + "isPermitted": true + }, + { + "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "name": "Josefina", + "isPermitted": true + }, + { + "id": "vHubbard", + "name": "vHubbard", + "isPermitted": true + }, + { + "id": "12a96a9d-4b4c-4349-a950-fe1159602621", + "name": "DARREN MCGEE", + "isPermitted": true + } + ], + "serviceTypes": { + "e433710f-9217-458d-a79d-1c7aff376d89": [ + { + "id": "0", + "name": "vRichardson", + "isPermitted": false + }, + { + "id": "1", + "name": "TYLER SILVIA", + "isPermitted": true + }, + { + "id": "2", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "3", + "name": "vJamie", + "isPermitted": false + }, + { + "id": "4", + "name": "vVoiceMail", + "isPermitted": false + }, + { + "id": "5", + "name": "Kennedy", + "isPermitted": false + }, + { + "id": "6", + "name": "vSEGW", + "isPermitted": false + }, + { + "id": "7", + "name": "vVM", + "isPermitted": false + }, + { + "id": "8", + "name": "vOTA", + "isPermitted": false + }, + { + "id": "9", + "name": "vMME", + "isPermitted": false + }, + { + "id": "10", + "name": "vMNS", + "isPermitted": false + }, + { + "id": "11", + "name": "vSCP", + "isPermitted": false + }, + { + "id": "12", + "name": "VPMS", + "isPermitted": false + }, + { + "id": "13", + "name": "vMMSC", + "isPermitted": false + }, + { + "id": "14", + "name": "SSD", + "isPermitted": false + }, + { + "id": "15", + "name": "vMOG", + "isPermitted": false + }, + { + "id": "16", + "name": "LINDSEY", + "isPermitted": false + }, + { + "id": "17", + "name": "JOHANNA_SANTOS", + "isPermitted": false + }, + { + "id": "18", + "name": "vCarroll", + "isPermitted": false + } + ] + }, + "aicZones": [ + { + "id": "NFT1", + "name": "NFTJSSSS-NFT1" + }, + { + "id": "JAG1", + "name": "YUDFJULP-JAG1" + }, + { + "id": "YYY1", + "name": "UUUAIAAI-YYY1" + }, + { + "id": "BAN1", + "name": "VSDKYUTP-BAN1" + }, + { + "id": "DKJ1", + "name": "DKJSJDKA-DKJ1" + }, + { + "id": "MCS1", + "name": "ASACMAMS-MCS1" + }, + { + "id": "UIO1", + "name": "uioclli1-UIO1" + }, + { + "id": "RAJ1", + "name": "YGBIJNLQ-RAJ1" + }, + { + "id": "OPA1", + "name": "opaclli1-OPA1" + }, + { + "id": "SDE1", + "name": "ZXCVBNMA-SDE1" + }, + { + "id": "VEN2", + "name": "FGHJUHIL-VEN2" + }, + { + "id": "ORL1", + "name": "ORLDFLMA-ORL1" + }, + { + "id": "JAD1", + "name": "JADECLLI-JAD1" + }, + { + "id": "ZXL1", + "name": "LWLWCANN-ZXL1" + }, + { + "id": "CKL1", + "name": "CLKSKCKK-CKL1" + }, + { + "id": "SDF1", + "name": "sdfclli1-SDF1" + }, + { + "id": "RAD1", + "name": "RADICAL1-RAD1" + }, + { + "id": "KIT1", + "name": "BHYJFGLN-KIT1" + }, + { + "id": "REL1", + "name": "INGERFGT-REL1" + }, + { + "id": "JNL1", + "name": "CJALSDAC-JNL1" + }, + { + "id": "OLK1", + "name": "OLKOLKLS-OLK1" + }, + { + "id": "CHI1", + "name": "CHILLIWE-CHI1" + }, + { + "id": "UUU4", + "name": "UUUAAAUU-UUU4" + }, + { + "id": "TUF1", + "name": "TUFCLLI1-TUF1" + }, + { + "id": "KJN1", + "name": "CKALDKSA-KJN1" + }, + { + "id": "SAM1", + "name": "SNDGCA64-SAN1" + }, + { + "id": "SCK1", + "name": "SCKSCKSK-SCK1" + }, + { + "id": "HJH1", + "name": "AOEEQQQD-HJH1" + }, + { + "id": "HGD1", + "name": "SDFQWHGD-HGD1" + }, + { + "id": "KOR1", + "name": "HYFLNBVT-KOR1" + }, + { + "id": "ATL43", + "name": "AICLOCID-ATL43" + }, + { + "id": "ATL54", + "name": "AICFTAAI-ATL54" + }, + { + "id": "ATL66", + "name": "CLLIAAII-ATL66" + }, + { + "id": "VEL1", + "name": "BNMLKUIK-VEL1" + }, + { + "id": "ICC1", + "name": "SANJITAT-ICC1" + }, + { + "id": "MNT11", + "name": "WSXEFBTH-MNT11" + }, + { + "id": "DEF2", + "name": "WSBHGTYL-DEF2" + }, + { + "id": "MAD11", + "name": "SDFQWGKL-MAD11" + }, + { + "id": "OLG1", + "name": "OLHOLHOL-OLG1" + }, + { + "id": "GAR1", + "name": "NGFVSJKO-GAR1" + }, + { + "id": "SAN22", + "name": "GNVLSCTL-SAN22" + }, + { + "id": "HRG1", + "name": "HRGHRGGS-HRG1" + }, + { + "id": "JCS1", + "name": "JCSJSCJS-JCS1" + }, + { + "id": "DHA12", + "name": "WSXEDECF-DHA12" + }, + { + "id": "HJE1", + "name": "AOEEWWWD-HJE1" + }, + { + "id": "NCA1", + "name": "NCANCANN-NCA1" + }, + { + "id": "IOP1", + "name": "iopclli1-IOP1" + }, + { + "id": "RTY1", + "name": "rtyclli1-RTY1" + }, + { + "id": "KAP1", + "name": "HIOUYTRQ-KAP1" + }, + { + "id": "ZEN1", + "name": "ZENCLLI1-ZEN1" + }, + { + "id": "HKA1", + "name": "JAKHLASS-HKA1" + }, + { + "id": "CQK1", + "name": "CQKSCAKK-CQK1" + }, + { + "id": "SAI1", + "name": "UBEKQLPD-SAI1" + }, + { + "id": "ERT1", + "name": "ertclli1-ERT1" + }, + { + "id": "IBB1", + "name": "PLMKOIJU-IBB1" + }, + { + "id": "TIR2", + "name": "PLKINHYI-TIR2" + }, + { + "id": "HSD1", + "name": "CHASKCDS-HSD1" + }, + { + "id": "SLF78", + "name": "SDCTLFN1-SLF78" + }, + { + "id": "SEE78", + "name": "SDCTEEE4-SEE78" + }, + { + "id": "SAN13", + "name": "TOKYJPFA-SAN13" + }, + { + "id": "SAA78", + "name": "SDCTAAA1-SAA78" + }, + { + "id": "LUC1", + "name": "ATLDFGYC-LUC1" + }, + { + "id": "AMD13", + "name": "MEMATLAN-AMD13" + }, + { + "id": "TOR1", + "name": "TOROONXN-TOR1" + }, + { + "id": "QWE1", + "name": "QWECLLI1-QWE1" + }, + { + "id": "ZOG1", + "name": "ZOGASTRO-ZOG1" + }, + { + "id": "CAL33", + "name": "CALIFORN-CAL33" + }, + { + "id": "SHH78", + "name": "SDIT1HHH-SHH78" + }, + { + "id": "DSA1", + "name": "LKJHGFDS-DSA1" + }, + { + "id": "CLG1", + "name": "CLGRABAD-CLG1" + }, + { + "id": "BNA1", + "name": "BNARAGBK-BNA1" + }, + { + "id": "ATL84", + "name": "CANTTCOC-ATL84" + }, + { + "id": "APP1", + "name": "WBHGTYUI-APP1" + }, + { + "id": "RJN1", + "name": "RJNRBZAW-RJN1" + }, + { + "id": "EHH78", + "name": "SDCSHHH5-EHH78" + }, + { + "id": "mac10", + "name": "PKGTESTF-mac10" + }, + { + "id": "SXB78", + "name": "SDCTGXB1-SXB78" + }, + { + "id": "SAX78", + "name": "SDCTAXG1-SAX78" + }, + { + "id": "SYD1", + "name": "SYDNAUBV-SYD1" + }, + { + "id": "TOK1", + "name": "TOKYJPFA-TOK1" + }, + { + "id": "KGM2", + "name": "KGMTNC20-KGM2" + }, + { + "id": "DCC1b", + "name": "POIUYTGH-DCC1b" + }, + { + "id": "SKK78", + "name": "SDCTKKK1-SKK78" + }, + { + "id": "SGG78", + "name": "SDCTGGG1-SGG78" + }, + { + "id": "SJJ78", + "name": "SDCTJJJ1-SJJ78" + }, + { + "id": "SBX78", + "name": "SDCTBXG1-SBX78" + }, + { + "id": "LAG1", + "name": "LARGIZON-LAG1" + }, + { + "id": "IAA1", + "name": "QAZXSWED-IAA1" + }, + { + "id": "POI1", + "name": "PLMNJKIU-POI1" + }, + { + "id": "LAG1a", + "name": "LARGIZON-LAG1a" + }, + { + "id": "PBL1", + "name": "PBLAPBAI-PBL1" + }, + { + "id": "LAG45", + "name": "LARGIZON-LAG1a" + }, + { + "id": "MAR1", + "name": "MNBVCXZM-MAR1" + }, + { + "id": "HST70", + "name": "HSTNTX70-HST70" + }, + { + "id": "DCC1a", + "name": "POIUYTGH-DCC1a" + }, + { + "id": "TOL1", + "name": "TOLDOH21-TOL1" + }, + { + "id": "LON1", + "name": "LONEENCO-LON1" + }, + { + "id": "SJU78", + "name": "SDIT1JUB-SJU78" + }, + { + "id": "STN27", + "name": "HSTNTX01-STN27" + }, + { + "id": "SSW56", + "name": "ss8126GT-SSW56" + }, + { + "id": "SBB78", + "name": "SDIT1BBB-SBB78" + }, + { + "id": "DCC3", + "name": "POIUYTGH-DCC3" + }, + { + "id": "GNV1", + "name": "GNVLSCTL-GNV1" + }, + { + "id": "WAS1", + "name": "WASHDCSW-WAS1" + }, + { + "id": "TOY1", + "name": "TORYONNZ-TOY1" + }, + { + "id": "STT1", + "name": "STTLWA02-STT1" + }, + { + "id": "STG1", + "name": "STTGGE62-STG1" + }, + { + "id": "SLL78", + "name": "SDCTLLL1-SLL78" + }, + { + "id": "SBU78", + "name": "SDIT1BUB-SBU78" + }, + { + "id": "ATL2", + "name": "ATLNGANW-ATL2" + }, + { + "id": "BOT1", + "name": "BOTHWAKY-BOT1" + }, + { + "id": "SNG1", + "name": "SNGPSIAU-SNG1" + }, + { + "id": "NYC1", + "name": "NYCMNY54-NYC1" + }, + { + "id": "LAG1b", + "name": "LARGIZON-LAG1b" + }, + { + "id": "AMD15", + "name": "AMDFAA01-AMD15" + }, + { + "id": "SNA1", + "name": "SNANTXCA-SNA1" + }, + { + "id": "PLT1", + "name": "PLTNCA60-PLT1" + }, + { + "id": "TLP1", + "name": "TLPNXM18-TLP1" + }, + { + "id": "SDD81", + "name": "SAIT1DD6-SDD81" + }, + { + "id": "DCC1", + "name": "POIUYTGH-DCC1" + }, + { + "id": "DCC2", + "name": "POIUYTGH-DCC2" + }, + { + "id": "OKC1", + "name": "OKCBOK55-OKC1" + }, + { + "id": "PAR1", + "name": "PARSFRCG-PAR1" + }, + { + "id": "TES36", + "name": "ABCEETES-TES36" + }, + { + "id": "COM1", + "name": "PLMKOPIU-COM1" + }, + { + "id": "ANI1", + "name": "ATLNGTRE-ANI1" + }, + { + "id": "SDG78", + "name": "SDIT1BDG-SDG78" + }, + { + "id": "mac20", + "name": "PKGTESTF-mac20" + }, + { + "id": "DSF45", + "name": "DSFBG123-DSF45" + }, + { + "id": "HST25", + "name": "HSTNTX01-HST25" + }, + { + "id": "AMD18", + "name": "AUDIMA01-AMD18" + }, + { + "id": "SAA80", + "name": "SAIT9AA3-SAA80" + }, + { + "id": "SSA56", + "name": "SSIT2AA7-SSA56" + }, + { + "id": "SDD82", + "name": "SAIT1DD9-SDD82" + }, + { + "id": "JCV1", + "name": "JCVLFLBW-JCV1" + }, + { + "id": "SUL2", + "name": "WERTYUJK-SUL2" + }, + { + "id": "PUR1", + "name": "purelyde-PUR1" + }, + { + "id": "FDE55", + "name": "FDERT555-FDE55" + }, + { + "id": "SITE", + "name": "LONEENCO-SITE" + }, + { + "id": "ATL1", + "name": "ATLNGAMA-ATL1" + }, + { + "id": "JUL1", + "name": "ZXCVBNMM-JUL1" + }, + { + "id": "TAT34", + "name": "TESAAISB-TAT34" + }, + { + "id": "XCP12", + "name": "CHKGH123-XCP12" + }, + { + "id": "RAI1", + "name": "poiuytre-RAI1" + }, + { + "id": "HPO1", + "name": "ATLNGAUP-HPO1" + }, + { + "id": "KJF12", + "name": "KJFDH123-KJF12" + }, + { + "id": "SCC80", + "name": "SAIT9CC3-SCC80" + }, + { + "id": "SAA12", + "name": "SAIT9AF8-SAA12" + }, + { + "id": "SAA14", + "name": "SAIT1AA9-SAA14" + }, + { + "id": "ATL35", + "name": "TTESSAAI-ATL35" + }, + { + "id": "CWY1", + "name": "CWYMOWBS-CWY1" + }, + { + "id": "ATL76", + "name": "TELEPAAI-ATL76" + }, + { + "id": "DSL12", + "name": "DSLFK242-DSL12" + }, + { + "id": "ATL53", + "name": "AAIATLTE-ATL53" + }, + { + "id": "SAA11", + "name": "SAIT9AA2-SAA11" + }, + { + "id": "ATL62", + "name": "TESSASCH-ATL62" + }, + { + "id": "AUG1", + "name": "ASDFGHJK-AUG1" + }, + { + "id": "POI22", + "name": "POIUY123-POI22" + }, + { + "id": "SAA13", + "name": "SAIT1AA9-SAA13" + }, + { + "id": "BHY17", + "name": "BHYTFRF3-BHY17" + }, + { + "id": "LIS1", + "name": "HOSTPROF-LIS1" + }, + { + "id": "SIP1", + "name": "ZXCVBNMK-SIP1" + }, + { + "id": "ATL99", + "name": "TEESTAAI-ATL43" + }, + { + "id": "ATL64", + "name": "FORLOAAJ-ATL64" + }, + { + "id": "TAT33", + "name": "TESAAISA-TAT33" + }, + { + "id": "RAD10", + "name": "INDIPUNE-RAD10" + }, + { + "id": "RTW5", + "name": "BHYTFRY4-RTW5" + }, + { + "id": "JGS1", + "name": "KSJKKKKK-JGS1" + }, + { + "id": "ATL98", + "name": "TEESTAAI-ATL43" + }, + { + "id": "WAN1", + "name": "LEIWANGW-WAN1" + }, + { + "id": "ATL44", + "name": "ATLSANAB-ATL44" + }, + { + "id": "RTD2", + "name": "BHYTFRk4-RTD2" + }, + { + "id": "NIR1", + "name": "ORFLMANA-NIR1" + }, + { + "id": "ATL75", + "name": "SANAAIRE-ATL75" + }, + { + "id": "NUM1", + "name": "QWERTYUI-NUM1" + }, + { + "id": "MTN32", + "name": "MDTWNJ21-MTN32" + }, + { + "id": "RTZ4", + "name": "BHYTFRZ6-RTZ4" + }, + { + "id": "ATL56", + "name": "ATLSANAC-ATL56" + }, + { + "id": "AMS1", + "name": "AMSTNLBW-AMS1" + }, + { + "id": "RCT1", + "name": "AMSTERNL-RCT1" + }, + { + "id": "JAN1", + "name": "ORFLMATT-JAN1" + }, + { + "id": "ABC14", + "name": "TESAAISA-ABC14" + }, + { + "id": "TAT37", + "name": "TESAAISD-TAT37" + }, + { + "id": "MIC54", + "name": "MICHIGAN-MIC54" + }, + { + "id": "ABC11", + "name": "ATLSANAI-ABC11" + }, + { + "id": "AMF11", + "name": "AMDOCS01-AMF11" + }, + { + "id": "ATL63", + "name": "ATLSANEW-ATL63" + }, + { + "id": "ABC12", + "name": "ATLSECIA-ABC12" + }, + { + "id": "MTN20", + "name": "MDTWNJ21-MTN20" + }, + { + "id": "ABC15", + "name": "AAITESAN-ABC15" + }, + { + "id": "AVT1", + "name": "AVTRFLHD-AVT1" + }, + { + "id": "ATL34", + "name": "ATLSANAI-ATL34" + } + ], + "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": "[LCP_REGIONS_AND_TENANTS] Update", + "subscribers": [ + { + "id": "CAR_2020_ER", + "name": "CAR_2020_ER", + "isPermitted": true + }, + { + "id": "21014aa2-526b-11e6-beb8-9e71128cae77", + "name": "JULIO ERICKSON", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-2", + "name": "DALE BRIDGES", + "isPermitted": false + }, + { + "id": "DHV1707-TestSubscriber-1", + "name": "LLOYD BRIDGES", + "isPermitted": false + }, + { + "id": "jimmy-example", + "name": "JimmyExampleCust-20161102", + "isPermitted": false + }, + { + "id": "jimmy-example2", + "name": "JimmyExampleCust-20161103", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-102", + "name": "ERICA5779-TestSub-PWT-102", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-101", + "name": "ERICA5779-TestSub-PWT-101", + "isPermitted": false + }, + { + "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "name": "Emanuel", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-4", + "name": "ERICA5779-Subscriber-5", + "isPermitted": false + }, + { + "id": "ERICA5779-TestSub-PWT-103", + "name": "ERICA5779-TestSub-PWT-103", + "isPermitted": false + }, + { + "id": "ERICA5779-Subscriber-2", + "name": "ERICA5779-Subscriber-2", + "isPermitted": false + }, + { + "id": "e433710f-9217-458d-a79d-1c7aff376d89", + "name": "SILVIA ROBBINS", + "isPermitted": true + }, + { + "id": "ERICA5779-Subscriber-3", + "name": "ERICA5779-Subscriber-3", + "isPermitted": false + }, + { + "id": "31739f3e-526b-11e6-beb8-9e71128cae77", + "name": "CRAIG/ROBERTS", + "isPermitted": false + } + ] + } + } + } +} + +class MockFeatureFlagsService {} + +describe('VNF Control Generator', () => { + let injector; + let service: VnfControlGenerator; + let httpMock: HttpTestingController; + + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [VnfControlGenerator, + GenericFormService, + BasicControlGenerator, + AaiService, + FormBuilder, + LogService, + {provide:FeatureFlagsService, useClass: MockFeatureFlagsService}, + {provide: NgRedux, useClass: MockAppStore}] + }); + await TestBed.compileComponents(); + + + injector = getTestBed(); + service = injector.get(VnfControlGenerator); + httpMock = injector.get(HttpTestingController); + + })().then(done).catch(done.fail)); + + + test('getMacroFormControls check for mandatory controls', () => { + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfName : string = "VF_vMee 0"; + const vnfStoreKey : string = "VF_vMee 0"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []); + + const mandatoryControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.LCPCLOUD_REGION_ID, + FormControlNames.TENANT_ID, + 'platformName' + ]; + + for(let i = 0 ; i < mandatoryControls.length ; i++){ + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + test('should provide empty array on getMacroFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => { + + let vnfStoreKey = null; + const serviceId = null; + const vnfName : string = null; + const result:FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []); + expect(result).toEqual([]); + }); + + test('should provide empty array on getAlaCarteFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => { + let vnfStoreKey = null; + const serviceId = null; + const vnfName : string = null; + const result:FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []); + expect(result).toEqual([]); + }); + + function getALaCarteFormControls(vnfStoreKey: string): FormControlModel[] { + const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfName: string = "VF_vMee 0"; + const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []); + return controls; + } + + test('getMacroFormControls should return the correct order of controls', () => { + const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44"; + const vnfName : string = "VF_vMee 0"; + const vnfStoreKey : string = null; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.PRODUCT_FAMILY_ID, + FormControlNames.LCPCLOUD_REGION_ID , + 'legacyRegion', + 'tenantId', + 'platformName', + 'lineOfBusiness']; + + expect(controls.length).toEqual(7); + for(let i = 0 ; i < controls.length ; i++){ + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + test('getAlacartFormControls should return the correct order of controls', () => { + const controls = getALaCarteFormControls(null); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.PRODUCT_FAMILY_ID, + FormControlNames.LCPCLOUD_REGION_ID, + 'legacyRegion', + 'tenantId', + 'platformName', + 'lineOfBusiness', + 'rollbackOnFailure']; + expect(controls.length).toEqual(8); + for(let i = 0 ; i < controls.length ; i++) { + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + + test('getAlacartFormControls check for mandatory controls', () => { + const controls = getALaCarteFormControls("VF_vMee 0"); + const mandatoryControls : string[] = [ + FormControlNames.INSTANCE_NAME, + FormControlNames.LCPCLOUD_REGION_ID, + 'tenantId', + 'platformName', + 'rollbackOnFailure' + ]; + for(let i = 0 ; i < mandatoryControls.length ; i++){ + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + test('getAlacartFormControls instance name control validator shall have the expected regex', () => { + const controls:FormControlModel[] = getALaCarteFormControls("VF_vMee 0"); + + const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME); + const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern); + expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/); + }); + + test('rollback should return observable of true, false', () => { + let result : Observable<SelectOption[]> = service.getRollBackOnFailureOptions(); + result.subscribe((val)=>{ + expect(val).toEqual([ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]); + }); + }); +}); + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts new file mode 100644 index 000000000..3484038b1 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGenerator/vnf.control.generator.ts @@ -0,0 +1,243 @@ +import {Injectable} from "@angular/core"; +import {GenericFormService} from "../../generic-form.service"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {NgRedux} from "@angular-redux/store"; +import {HttpClient} from "@angular/common/http"; +import {BasicControlGenerator} from "../basic.control.generator"; +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {LogService} from "../../../../utils/log/log.service"; +import {VNFModel} from "../../../../models/vnfModel"; +import {AppState} from "../../../../store/reducers"; +import {FormGroup} from "@angular/forms"; +import {DropdownFormControl} from "../../../../models/formControlModels/dropdownFormControl.model"; +import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum"; +import {InputFormControl} from "../../../../models/formControlModels/inputFormControl.model"; +import {Observable, of} from "rxjs"; +import {SelectOption} from "../../../../models/selectOption"; +import * as _ from 'lodash'; +import {Constants} from "../../../../utils/constants"; + +export enum FormControlNames { + INSTANCE_NAME = 'instanceName', + GLOBAL_SUBSCRIBER_ID = 'globalSubscriberId', + SUBSCRIPTION_SERVICE_TYPE = 'subscriptionServiceType', + PRODUCT_FAMILY_ID = 'productFamilyId', + LCPCLOUD_REGION_ID = 'lcpCloudRegionId', + TENANT_ID = 'tenantId', + AICZONE_ID = 'aicZoneId', + PROJECT_NAME = 'projectName', + OWNING_ENTITY_ID = 'owningEntityId', + ROLLBACK_ON_FAILURE = 'rollbackOnFailure', + PAUSE = 'pause' +} + +enum InputType { + LCP_REGION = "lcpCloudRegionId", + TENANT = "tenantId", + LOB = "lineOfBusiness", + PLATFORM = "platformName", + ROLLBACK = "rollbackOnFailure", + PRODUCT_FAMILY = "productFamilyId", + VG = "volumeGroupName" +} + +@Injectable() +export class VnfControlGenerator { + aaiService: AaiService; + constructor(private genericFormService: GenericFormService, + private _basicControlGenerator: BasicControlGenerator, + private store: NgRedux<AppState>, + private http: HttpClient, + private _aaiService: AaiService, + private _logService: LogService) { + this.aaiService = _aaiService; + } + + getVnfInstance = (serviceId: string, vnfStoreKey: string): any => { + let vnfInstance = null; + if (this.store.getState().service.serviceInstance[serviceId] && _.has(this.store.getState().service.serviceInstance[serviceId].vnfs, vnfStoreKey)) { + vnfInstance = Object.assign({}, this.store.getState().service.serviceInstance[serviceId].vnfs[vnfStoreKey]); + } + return vnfInstance; + }; + + getMacroFormControls(serviceId: string, vnfStoreKey: string, vnfName: string, dynamicInputs?: any[]): FormControlModel[] { + vnfStoreKey = _.isNil(vnfStoreKey) ? vnfName : vnfStoreKey; + + if (_.isNil(serviceId) || _.isNil(vnfStoreKey) || _.isNil(vnfName)) { + this._logService.error('should provide serviceId, vnfName, vnfStoreKey', serviceId); + return []; + } + + const vnfInstance = this.getVnfInstance(serviceId, vnfStoreKey); + const vnfModel = new VNFModel(this.store.getState().service.serviceHierarchy[serviceId].vnfs[vnfName]); + let result: FormControlModel[] = []; + + if (!_.isNil(vnfModel)) { + result.push(this.getInstanceName(vnfInstance, serviceId, vnfName, vnfModel.isEcompGeneratedNaming)); + result.push(this._basicControlGenerator.getProductFamilyControl(vnfInstance, result, false)); + result.push(this.getLcpRegionControl(serviceId, vnfInstance, result)); + result.push(this._basicControlGenerator.getLegacyRegion(vnfInstance)); + result.push(this.getTenantControl(serviceId, vnfInstance, result)); + result.push(this.getPlatformControl(vnfInstance, result)); + result.push(this.getLineOfBusinessControl(vnfInstance, result)); + } + return result; + } + + getAlaCarteFormControls(serviceId: string, vnfStoreKey: string, vnfName: string, dynamicInputs?: any[]): FormControlModel[] { + vnfStoreKey = _.isNil(vnfStoreKey) ? vnfName : vnfStoreKey; + if (_.isNil(serviceId) || _.isNil(vnfStoreKey) || _.isNil(vnfName)) { + this._logService.error('should provide serviceId, vnfName, vnfStoreKey', serviceId); + return []; + } + + let result: FormControlModel[] = []; + const vnfInstance = this.getVnfInstance(serviceId, vnfStoreKey); + const vnfModel = new VNFModel(this.store.getState().service.serviceHierarchy[serviceId].vnfs[vnfName]); + + if (!_.isNil(vnfModel)) { + result.push(this.getInstanceName(vnfInstance, serviceId, vnfName, vnfModel.isEcompGeneratedNaming)); + result.push(this._basicControlGenerator.getProductFamilyControl(vnfInstance, result, false)); + result.push(this.getLcpRegionControl(serviceId, vnfInstance, result)); + result.push(this._basicControlGenerator.getLegacyRegion(vnfInstance)); + result.push(this.getTenantControl(serviceId, vnfInstance, result)); + result.push(this.getPlatformControl(vnfInstance, result)); + result.push(this.getLineOfBusinessControl(vnfInstance, result)); + result.push(this.getRollbackOnFailureControl(vnfInstance, result)); + } + return result; + } + + isInputShouldBeShown = (inputType: any): boolean => { + let vnfInputs = [InputType.LCP_REGION, InputType.LOB, InputType.TENANT, InputType.PRODUCT_FAMILY, InputType.PLATFORM, InputType.ROLLBACK]; + return vnfInputs.indexOf(inputType) > -1; + }; + + getInstanceName(instance : any, serviceId : string, vnfName : string, isEcompGeneratedNaming: boolean): FormControlModel { + const vnfModel : VNFModel = this.store.getState().service.serviceHierarchy[serviceId].vnfs[vnfName]; + return this._basicControlGenerator.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, vnfModel); + } + + getLineOfBusinessControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: 'lineOfBusiness', + displayName: 'Line of business', + dataTestId: 'lineOfBusiness', + placeHolder: 'Select Line Of Business', + isDisabled: false, + name: "lineOfBusiness", + value: instance ? instance.lineOfBusiness : null, + validations: [], + onInitSelectedField: ['lineOfBusinessList'], + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters) + }) + }; + + getPlatformControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: 'platformName', + displayName: 'Platform', + dataTestId: 'platform', + placeHolder: 'Select Platform', + isDisabled: false, + name: "platform", + value: instance ? instance.platformName : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInitSelectedField: ['platformList'], + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this._aaiService.getCategoryParameters) + }) + }; + + getTenantControl = (serviceId: string, instance: any, controls: FormControlModel[]): DropdownFormControl => { + const service = this.store.getState().service.serviceInstance[serviceId]; + const globalCustomerId: string = service.globalSubscriberId; + const serviceType: string = service.subscriptionServiceType; + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: FormControlNames.TENANT_ID, + displayName: 'Tenant', + dataTestId: 'tenant', + placeHolder: 'Select Tenant', + name: "tenant", + isDisabled: _.isNil(instance) || _.isNil(instance.lcpCloudRegionId), + onInitSelectedField: instance ? ['lcpRegionsTenantsMap', instance.lcpCloudRegionId] : null, + value: instance ? instance.tenantId : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInit : instance ? this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this.aaiService.getLcpRegionsAndTenants.bind(this, globalCustomerId, serviceType)) : ()=>{}, + }) + }; + + getLcpRegionControl = (serviceId: string, instance: any, controls: FormControlModel[]): DropdownFormControl => { + const service = this.store.getState().service.serviceInstance[serviceId]; + const globalCustomerId: string = service.globalSubscriberId; + const serviceType: string = service.subscriptionServiceType; + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: 'lcpCloudRegionId', + displayName: 'LCP region', + dataTestId: 'lcpRegion', + placeHolder: 'Select LCP Region', + name: "lcpRegion", + isDisabled: false, + value: instance ? instance.lcpCloudRegionId : null, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + onInitSelectedField: ['lcpRegionList'], + onInit: this._basicControlGenerator.getSubscribeInitResult.bind( + this._aaiService, + this._aaiService.getLcpRegionsAndTenants.bind(this, globalCustomerId, serviceType)), + onChange: (param: string, form: FormGroup) => { + form.controls[FormControlNames.TENANT_ID].enable(); + form.controls[FormControlNames.TENANT_ID].reset(); + if (!_.isNil(globalCustomerId) && !_.isNil(serviceType)) { + this._basicControlGenerator.getSubscribeResult.bind(this, this._aaiService.getLcpRegionsAndTenants(globalCustomerId, serviceType).subscribe(res => { + controls.find(item => item.controlName === FormControlNames.TENANT_ID)['options$'] = res.lcpRegionsTenantsMap[param]; + if(res.lcpRegionsTenantsMap[param]){ + controls.find(item => item.controlName === FormControlNames.TENANT_ID)['hasEmptyOptions'] = res.lcpRegionsTenantsMap[param].length === 0; + } + })); + } + + if (Constants.LegacyRegion.MEGA_REGION.indexOf(param) !== -1) { + form.controls['legacyRegion'].enable(); + controls.find(item => item.controlName === 'legacyRegion').isVisible = true; + + } else { + controls.find(item => item.controlName === 'legacyRegion').isVisible = false; + form.controls['legacyRegion'].setValue(null); + form.controls['legacyRegion'].reset(); + form.controls['legacyRegion'].disable(); + } + } + }) + }; + + getRollbackOnFailureControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: FormControlNames.ROLLBACK_ON_FAILURE, + displayName: 'Rollback on failure', + dataTestId: 'rollback', + placeHolder: 'Rollback on failure', + isDisabled: false, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + value: instance ? instance.rollbackOnFailure : 'true', + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this.getRollBackOnFailureOptions) + }) + }; + + getRollBackOnFailureOptions = (): Observable<SelectOption[]> => { + return of([ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]); + }; +} diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator.spec.ts new file mode 100644 index 000000000..6dcaa8235 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator.spec.ts @@ -0,0 +1,364 @@ +import {getTestBed, TestBed} from '@angular/core/testing'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; +import {NgRedux} from '@angular-redux/store'; +import {FormControlNames} from "../service.control.generator"; +import {BasicControlGenerator} from "../basic.control.generator"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {GenericFormService} from "../../generic-form.service"; +import {FormBuilder} from "@angular/forms"; +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {LogService} from "../../../../utils/log/log.service"; +import {VnfGroupControlGenerator} from "./vnfGroup.control.generator"; +import {Observable} from "rxjs"; +import {SelectOption} from "../../../../models/selectOption"; +import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service"; + +class MockAppStore<T> { + getState(){ + return { + "global": { + "name": null, + "type": "UPDATE_DRAWING_BOARD_STATUS", + "drawingBoardStatus": "CREATE", + "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": false, + "FLAG_SERVICE_MODEL_CACHE": false, + "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 + } + }, + "service": { + "serviceHierarchy": { + "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc": { + "service": { + "vidNotions": { + "instantiationUI": "serviceWithVnfGrouping", + "modelCategory": "other", + "viewEditUI": "serviceWithVnfGrouping" + }, + "uuid": "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc", + "invariantUuid": "7ee41ce4-4827-44b0-a48e-2707a59905d2", + "name": "Grouping Service for Test", + "version": "1.0", + "toscaModelURL": null, + "category": "Network L4+", + "serviceType": "INFRASTRUCTURE", + "serviceRole": "GROUPING", + "description": "xxx", + "serviceEcompNaming": "false", + "instantiationType": "A-La-Carte", + "inputs": {} + }, + "vnfs": {}, + "networks": {}, + "collectionResource": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": { + "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" + }, + "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" + } + }, + "vfModules": {}, + "volumeGroups": {}, + "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": { + "ecomp_generated_naming": "false", + "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" + } + } + }, + "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": { + "ecomp_generated_naming": "true", + "contained_resource_type": "VF", + "role": "SERVICE-ACCESS", + "function": "SIGNALING", + "description": "DDD1", + "type": "LOAD-GROUP" + }, + "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" + } + } + } + } + } + }, + "serviceInstance": { + "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc": { + "existingVNFCounterMap": {}, + "existingVnfGroupCounterMap": { + "daeb6568-cef8-417f-9075-ed259ce59f48": 1, + "c2b300e6-45de-4e5e-abda-3032bee2de56": 0 + }, + "existingNetworksCounterMap": {}, + "vnfs": {}, + "vnfGroups": { + "groupingservicefortest..ResourceInstanceGroup..0": { + "inMaint": false, + "rollbackOnFailure": "true", + "originalName": "groupingservicefortest..ResourceInstanceGroup..0", + "isMissingData": false, + "trackById": "johjmxpmrlk", + "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" + } + }, + "isEcompGeneratedNaming": false, + "existingNames": {} + } + } + } + } + } +} + +class MockFeatureFlagsService {} + +describe('VNF Group Control Generator', () => { + let injector; + let service: VnfGroupControlGenerator; + let httpMock: HttpTestingController; + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [VnfGroupControlGenerator, + GenericFormService, + BasicControlGenerator, + AaiService, + FormBuilder, + LogService, + {provide:FeatureFlagsService, useClass: MockFeatureFlagsService}, + {provide: NgRedux, useClass: MockAppStore}] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(VnfGroupControlGenerator); + httpMock = injector.get(HttpTestingController); + + })().then(done).catch(done.fail)); + + + + test('getMacroFormControls check for mandatory controls', () => { + const serviceId : string = "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc"; + const vnfGroupName : string = "groupingservicefortest..ResourceInstanceGroup..0"; + const vnfGroupStoreKey : string = "groupingservicefortest..ResourceInstanceGroup..0"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfGroupStoreKey, vnfGroupName, []); + + const mandatoryControls : string[] = [ + FormControlNames.INSTANCE_NAME + ]; + + for(let i = 0 ; i < mandatoryControls.length ; i++){ + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + test('getMacroFormControls should return the correct order of controls', () => { + const serviceId : string = "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc"; + const vnfGroupName : string = "groupingservicefortest..ResourceInstanceGroup..0"; + const vnfGroupStoreKey : string = "groupingservicefortest..ResourceInstanceGroup..0"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfGroupStoreKey, vnfGroupName, []); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + 'rollbackOnFailure']; + + expect(controls.length).toEqual(1); + for(let i = 0 ; i < controls.length ; i++){ + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + test('getMacroFormControls check for mandatory controls when ecomp naming = true', () => { + const serviceId : string = "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc"; + const vnfGroupName : string = "groupingservicefortest..ResourceInstanceGroup..1"; + const vnfGroupStoreKey : string = "groupingservicefortest..ResourceInstanceGroup..1"; + const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfGroupStoreKey, vnfGroupName, []); + + let isOptional = controls.find(ctrl => ctrl.controlName === 'instanceName').validations.find(item => item.validatorName !== 'required'); + expect(isOptional).toBeTruthy(); + }); + + test('getAlacartFormControls should return the correct order of controls', () => { + const controls:FormControlModel[] = getALaCarteFormControls(); + + const controlsOrderNames = [ + FormControlNames.INSTANCE_NAME, + 'rollbackOnFailure']; + expect(controls.length).toEqual(2); + for(let i = 0 ; i < controls.length ; i++) { + expect(controls[i].controlName).toEqual(controlsOrderNames[i]); + } + }); + + + test('getAlacartFormControls check for mandatory controls', () => { + const controls:FormControlModel[] = getALaCarteFormControls(); + + const mandatoryControls : string[] = [ + FormControlNames.INSTANCE_NAME, + 'rollbackOnFailure' + ]; + for(let i = 0 ; i < mandatoryControls.length ; i++){ + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + test('getAlacartFormControls with ecomp_naming true check for mandatory controls', () => { + const controls:FormControlModel[] = getALaCarteFormControls(); + + const mandatoryControls : string[] = [ + 'rollbackOnFailure' + ]; + for(let i = 0 ; i < mandatoryControls.length ; i++){ + let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required'); + expect(requiredExist).toBeDefined(); + } + }); + + test('default instanceName', () => { + const serviceId : string = "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc"; + const vnfGroupName : string = "groupingservicefortest..ResourceInstanceGroup..0"; + let result:FormControlModel = service.getInstanceName(null, serviceId, vnfGroupName, false); + expect(result.value).toEqual("groupingservicefortest..ResourceInstanceGroup..0"); + }); + + test('rollbackOnFailure', () => { + let result : Observable<SelectOption[]> = service.getRollBackOnFailureOptions(); + result.subscribe((val)=>{ + expect(val).toEqual([ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]); + }); + }); + + test('getAlacartFormControls instance name control validator shall have the expected regex', () => { + const controls:FormControlModel[] = getALaCarteFormControls(); + + const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME); + const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern); + expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/); + }); + + function getALaCarteFormControls():FormControlModel[] { + const serviceId: string = "4117a0b6-e234-467d-b5b9-fe2f68c8b0fc"; + const vnfGroupName: string = "groupingservicefortest..ResourceInstanceGroup..0"; + const vnfGroupStoreKey: string = "groupingservicefortest..ResourceInstanceGroup..0"; + const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfGroupStoreKey, vnfGroupName, []); + return controls; + } +}); + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator.ts new file mode 100644 index 000000000..e503f4d2a --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator.ts @@ -0,0 +1,118 @@ +import {Injectable} from "@angular/core"; +import {AaiService} from "../../../../services/aaiService/aai.service"; +import {NgRedux} from "@angular-redux/store"; +import {BasicControlGenerator} from "../basic.control.generator"; +import { + FormControlModel, + ValidatorModel, + ValidatorOptions +} from "../../../../models/formControlModels/formControl.model"; +import {LogService} from "../../../../utils/log/log.service"; +import {AppState} from "../../../../store/reducers"; +import {DropdownFormControl} from "../../../../models/formControlModels/dropdownFormControl.model"; +import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum"; +import {SelectOption} from "../../../../models/selectOption"; +import {VnfGroupModel} from "../../../../models/vnfGroupModel"; +import * as _ from 'lodash'; +import {Observable, of} from "rxjs"; + + +export enum FormControlNames { + INSTANCE_NAME = 'instanceName', + ROLLBACK_ON_FAILURE = 'rollbackOnFailure', +} + +enum InputType { + ROLLBACK = "rollbackOnFailure" +} + +@Injectable() +export class VnfGroupControlGenerator { + aaiService: AaiService; + constructor(private _basicControlGenerator: BasicControlGenerator, + private store: NgRedux<AppState>, + private _aaiService: AaiService, + private _logService: LogService) { + this.aaiService = _aaiService; + } + + getVnfGroupInstance = (serviceId: string, vnfGroupStoreKey: string): any => { + let vnfGroupInstance = null; + if (this.store.getState().service.serviceInstance[serviceId] && _.has(this.store.getState().service.serviceInstance[serviceId].vnfGroups, vnfGroupStoreKey)) { + vnfGroupInstance = Object.assign({}, this.store.getState().service.serviceInstance[serviceId].vnfGroups[vnfGroupStoreKey]); + } + return vnfGroupInstance; + }; + + getMacroFormControls(serviceId: string, vnfGroupStoreKey: string, vnfGroupName: string, dynamicInputs?: Array<any>): Array<FormControlModel> { + vnfGroupStoreKey = _.isNil(vnfGroupStoreKey) ? vnfGroupName : vnfGroupStoreKey; + + if (_.isNil(serviceId) || _.isNil(vnfGroupStoreKey) || _.isNil(vnfGroupName)) { + this._logService.error('should provide serviceId, vnfGroupName, vnfGroupStoreKey', serviceId); + return []; + } + + const vnfGroupInstance = this.getVnfGroupInstance(serviceId, vnfGroupStoreKey); + const vnfGroupModel = new VnfGroupModel(this.store.getState().service.serviceHierarchy[serviceId].vnfGroups[vnfGroupName]); + let result: FormControlModel[] = []; + + if (!_.isNil(vnfGroupModel)) { + result.push(this.getInstanceName(vnfGroupInstance, serviceId, vnfGroupName, vnfGroupModel.isEcompGeneratedNaming)); + } + return result; + } + + getAlaCarteFormControls(serviceId: string, vnfGroupStoreKey: string, vnfGroupName: string, dynamicInputs?: any[]): FormControlModel[] { + vnfGroupStoreKey = _.isNil(vnfGroupStoreKey) ? vnfGroupName : vnfGroupStoreKey; + if (_.isNil(serviceId) || _.isNil(vnfGroupStoreKey) || _.isNil(vnfGroupName)) { + this._logService.error('should provide serviceId, vnfGroupName, vnfGroupStoreKey', serviceId); + return []; + } + + let result: FormControlModel[] = []; + const vnfGroupInstance = this.getVnfGroupInstance(serviceId, vnfGroupStoreKey); + const vnfGroupModel = new VnfGroupModel(this.store.getState().service.serviceHierarchy[serviceId].vnfGroups[vnfGroupName]); + + if (!_.isNil(vnfGroupModel)) { + result.push(this.getInstanceName(vnfGroupInstance, serviceId, vnfGroupName, vnfGroupModel.isEcompGeneratedNaming)); + result.push(this.getRollbackOnFailureControl(vnfGroupInstance, result)); + } + return result; + } + + isInputShouldBeShown = (inputType: any): boolean => { + let vnfGroupInputs = [InputType.ROLLBACK]; + return vnfGroupInputs.indexOf(inputType) > -1; + }; + + getDefaultInstanceName(instance : any, serviceId : string, vnfGroupName : string) : string { + const vnfGroupModel: VnfGroupModel = this.store.getState().service.serviceHierarchy[serviceId].vnfGroups[vnfGroupName]; + return this._basicControlGenerator.getDefaultInstanceName(instance, vnfGroupModel); + } + + getInstanceName(instance : any, serviceId : string, vnfGroupName : string, isEcompGeneratedNaming: boolean): FormControlModel { + const vnfGroupModel : VnfGroupModel = this.store.getState().service.serviceHierarchy[serviceId].vnfGroups[vnfGroupName]; + return this._basicControlGenerator.getInstanceNameController(instance, serviceId, isEcompGeneratedNaming, vnfGroupModel); + } + + getRollbackOnFailureControl = (instance: any, controls: FormControlModel[]): DropdownFormControl => { + return new DropdownFormControl({ + type: FormControlType.DROPDOWN, + controlName: FormControlNames.ROLLBACK_ON_FAILURE, + displayName: 'Rollback on failure', + dataTestId: 'rollback', + placeHolder: 'Rollback on failure', + isDisabled: false, + validations: [new ValidatorModel(ValidatorOptions.required, 'is required')], + value: instance ? instance.rollbackOnFailure : 'true', + onInit: this._basicControlGenerator.getSubscribeInitResult.bind(null, this.getRollBackOnFailureOptions) + }) + }; + + getRollBackOnFailureOptions = (): Observable<SelectOption[]> => { + return of([ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]); + }; +} diff --git a/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.html b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.html new file mode 100644 index 000000000..d4c5118b3 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.html @@ -0,0 +1,29 @@ +<div id="form-details" *ngIf="formControls != null && dynamicFormGroup != null"> + <form [formGroup]="dynamicFormGroup"> + <div *ngFor="let formControl of formControls" class="form-conrtols"> + <div [ngSwitch]="formControl.type"> + <form-control-input *ngSwitchCase="'INPUT'" [data]="formControl" [form]="dynamicFormGroup"></form-control-input> + <checkbox-form-control *ngSwitchCase="'CHECKBOX'" [data]="formControl" [form]="dynamicFormGroup" ></checkbox-form-control> + <dropdown-form-control *ngSwitchCase="'DROPDOWN'" [data]="formControl" [form]="dynamicFormGroup" ></dropdown-form-control> + <file-form-control *ngSwitchCase="'FILE'" [data]="formControl" [form]="dynamicFormGroup"></file-form-control> + </div> + <div *ngIf="dynamicFormGroup != null && formControl != null && dynamicFormGroup.controls[formControl.controlName]?.errors"> + <div *ngFor="let validatorModel of formControl?.validations"> + <form-control-error *ngIf="validatorModel?.validatorName != 'required' && dynamicFormGroup.controls[formControl?.controlName]?.errors[validatorModel?.validatorName]" [message]="validatorModel?.errorMsg"></form-control-error> + </div> + </div> + </div> + <div *ngFor="let dynamicInputs of dynamicInputs" class="form-conrtols"> + <div [ngSwitch]="dynamicInputs.type"> + <form-control-input *ngSwitchCase="'INPUT'" [data]="dynamicInputs" [form]="dynamicFormGroup.controls['instanceParams']"></form-control-input> + <checkbox-form-control *ngSwitchCase="'CHECKBOX'" [data]="dynamicInputs" [form]="dynamicFormGroup.controls['instanceParams']" ></checkbox-form-control> + <dropdown-form-control *ngSwitchCase="'DROPDOWN'" [data]="dynamicInputs" [form]="dynamicFormGroup.controls['instanceParams']" ></dropdown-form-control> + </div> + <div *ngIf="dynamicFormGroup?.controls['instanceParams'] != null && dynamicInputs != null && dynamicFormGroup.controls['instanceParams'].controls[dynamicInputs.controlName]?.errors"> + <div *ngFor="let validatorModel of dynamicInputs?.validations"> + <form-control-error *ngIf="validatorModel?.validatorName != 'required' && dynamicFormGroup.controls['instanceParams'].controls[dynamicInputs?.controlName]?.errors[validatorModel?.validatorName]" [message]="validatorModel?.errorMsg"></form-control-error> + </div> + </div> + </div> + </form> +</div> diff --git a/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.scss b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.scss new file mode 100644 index 000000000..b8f26d8b3 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.scss @@ -0,0 +1,68 @@ +#form-details { + position: relative; + + #notification-area { + color: #959595; + font-size: 12px; + position: absolute; + top: 3px; + left: 30px; + } + + height: 100%; + overflow: auto; + padding: 30px; + + /deep/ { + .form-control { + border-radius: 2px; + box-shadow: none; + border-color: #D2D2D2; + } + + label { + font-family: OpenSans-Semibold; + font-size: 12px; + } + + select { + @extend .form-control; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: url('../../../../assets/img/chevron.svg') 0 0 no-repeat; + background-size: 24px; + background-position-x: right; + background-position-y: center; + font-family: OpenSans-Italic; + font-size: 14px; + color: #959595; + height: 38px; + } + + input:not([type='checkbox']) { + @extend .form-control; + height: 38px; + } + + .form-control[disabled], fieldset[disabled] .form-control { + opacity: 0.5; + } + .input-text { + border: 1px solid #D2D2D2; + border-radius: 2px; + color: black; + } + + .form-conrtols { + margin-top: 20px; + &:first-child{ + margin-top: 0px; + } + } + } + + .checkbox-label { + font-family: OpenSans-Regular; + } +} diff --git a/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.ts b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.ts new file mode 100644 index 000000000..6febd66d6 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.component.ts @@ -0,0 +1,45 @@ +import {Component, EventEmitter, Input, OnChanges, Output, SimpleChanges} from '@angular/core'; +import {GenericFormService} from "./generic-form.service"; +import {FormControlModel} from "../../models/formControlModels/formControl.model"; +import {FormGroup} from "@angular/forms"; +import * as _ from 'lodash'; + +@Component({ + selector : 'generic-form', + templateUrl : './generic-form.component.html', + styleUrls : ['./generic-form.component.scss'] +}) + +export class GenericFormComponent implements OnChanges{ + genericFormService: GenericFormService = null; + dynamicFormGroup: FormGroup = null; + + @Input() formControls : FormControlModel[] = null; + @Input() dynamicInputs : FormControlModel[] = null; + @Input() isValidForm : boolean = false; + @Output() onFormChanged = new EventEmitter(); + + constructor(private _genericFormService: GenericFormService){ + this.genericFormService = _genericFormService; + } + + ngOnChanges(changes: SimpleChanges): void { + if (changes["formControls"] !== undefined && changes["formControls"].currentValue !== changes["formControls"].previousValue) { + this.dynamicFormGroup = this._genericFormService.generateFormBuilder(this.formControls, this.dynamicInputs); + this.onFormChanged.next(this.dynamicFormGroup); + this.dynamicFormGroup.valueChanges.subscribe(() => { + this.onFormChanged.next(this.dynamicFormGroup); + }) + } + } + + hasApiError(controlName: string, data: any[], form: FormGroup) { + if (!_.isNil(data)) { + if (!form.controls[controlName].disabled && data.length === 0) { + return true; + } + } + return false; + } +} + diff --git a/vid-webpack-master/src/app/shared/components/genericForm/generic-form.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.service.spec.ts new file mode 100644 index 000000000..7a993cfa1 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.service.spec.ts @@ -0,0 +1,140 @@ + +import { TestBed, getTestBed} from '@angular/core/testing'; +import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing'; +import {GenericFormService} from './generic-form.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {FormControlModel, ValidatorModel, ValidatorOptions} from "../../models/formControlModels/formControl.model"; +import {FormControlType} from "../../models/formControlModels/formControlTypes.enum"; + +describe('Generic Form Service', () => { + + let injector; + let service: GenericFormService; + let httpMock: HttpTestingController; + let form : FormGroup; + let fb : FormBuilder; + + + beforeAll(done => (async () => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [GenericFormService, FormBuilder] + }); + await TestBed.compileComponents(); + + injector = getTestBed(); + service = injector.get(GenericFormService); + httpMock = injector.get(HttpTestingController); + fb = injector.get(FormBuilder); + + })().then(done).catch(done.fail)); + + let controls : FormControlModel[] = [ + generateFormControlModel(FormControlType.INPUT, 'InputControlName','Test Value', false, generateFormValidators([ValidatorOptions.required])), + generateFormControlModel(FormControlType.INPUT, 'InputControlName_1', 'Test InputControlName_1', true, generateFormValidators([ValidatorOptions.required])), + generateFormControlModel(FormControlType.INPUT, 'InputControlName_2', 'Test InputControlName_2', false, [generateFormValidatorWithArg(ValidatorOptions.minLength, 4)]), + generateFormControlModel(FormControlType.INPUT, 'InputControlName_3', 'Exact 14 chars', false, [generateFormValidatorWithArg(ValidatorOptions.maxLength, 14)]), + generateFormControlModel(FormControlType.INPUT, 'InputControlName_4', 'Test pattern', false, [generateFormValidatorWithArg(ValidatorOptions.pattern, '^[a-zA-Z]+$')]) + ]; + + describe('generateFormBuilder', ()=> { + test('validators should work correct', () => { + const controlName: string = 'InputControlName'; + let form : FormGroup = service.generateFormBuilder(controls, []); + + expect(form instanceof FormGroup).toBeTruthy(); + expect(form.controls[controlName]).toBeDefined(); + expect(form.controls[controlName].value).toEqual('Test Value'); + expect(form.controls[controlName].disabled).toBeFalsy(); + expect(form.controls[controlName].valid).toBeTruthy(); + expect(form.controls[controlName].errors).toBeNull(); + + form.controls[controlName].setValue(''); + expect(form.controls[controlName].valid).toBeFalsy(); + expect(form.controls[controlName].errors.required).toBeTruthy(); + }); + + test('validators should prevent the value to appear', () => { + const controlName: string = 'InputControlName_1'; + let form : FormGroup = service.generateFormBuilder(controls, []); + + expect(form instanceof FormGroup).toBeTruthy(); + expect(form.controls[controlName]).toBeDefined(); + expect(form.controls[controlName].disabled).toBeTruthy(); + expect(form.controls[controlName].value).toEqual('Test InputControlName_1'); + expect(form.controls[controlName].errors).toBeNull(); + }); + + test('validators with minimum length args', () => { + const controlName: string = 'InputControlName_2'; + let form : FormGroup = service.generateFormBuilder(controls, []); + + expect(form instanceof FormGroup).toBeTruthy(); + expect(form.controls[controlName]).toBeDefined(); + expect(form.controls[controlName].disabled).toBeFalsy(); + expect(form.controls[controlName].value).toEqual('Test InputControlName_2'); + expect(form.controls[controlName].errors).toBeNull(); + + form.controls[controlName].setValue('123'); // less then 4 characters. -> error + expect(form.controls[controlName].errors.minlength).toBeDefined(); + form.controls[controlName].setValue('1234'); + expect(form.controls[controlName].errors).toBeNull(); + }); + + test('validators with maximum length args', () => { + const controlName: string = 'InputControlName_3'; + let form : FormGroup = service.generateFormBuilder(controls, []); + + expect(form instanceof FormGroup).toBeTruthy(); + expect(form.controls[controlName]).toBeDefined(); + expect(form.controls[controlName].disabled).toBeFalsy(); + expect(form.controls[controlName].value).toEqual('Exact 14 chars'); + expect(form.controls[controlName].errors).toBeNull(); + + form.controls[controlName].setValue('More than max length'); // more than max characters. -> error + expect(form.controls[controlName].errors.maxlength).toBeDefined(); + form.controls[controlName].setValue('Exact 14 chars'); + expect(form.controls[controlName].errors).toBeNull(); + }); + + test('pattern validator letters only', () => { + const controlName: string = 'InputControlName_4'; + let form : FormGroup = service.generateFormBuilder(controls, []); + + + expect(form.controls[controlName].errors.pattern).toBeDefined(); + form.controls[controlName].setValue('AAAAAAAA'); + expect(form.controls[controlName].errors).toBeNull(); + }); + }); + + + + function generateFormValidators(validatorsNames :ValidatorOptions[]){ + let validators : ValidatorModel[] = []; + for(let validatorName of validatorsNames){ + validators.push(new ValidatorModel(validatorName, 'error ' + validatorName)); + } + return validators; + } + + function generateFormValidatorWithArg(validatorName :ValidatorOptions, arg : any){ + return new ValidatorModel(validatorName, 'error ' + validatorName, arg); + } + + function generateFormControlModel(type : FormControlType, + controlName: string, + value: any, + isDisabled: boolean, + validations: ValidatorModel[]){ + let data : any = { + type : type, + isDisabled : isDisabled, + validations : validations, + value : value, + controlName :controlName + }; + + return new FormControlModel(data); + } +}); diff --git a/vid-webpack-master/src/app/shared/components/genericForm/generic-form.service.ts b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.service.ts new file mode 100644 index 000000000..15089cafe --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/genericForm/generic-form.service.ts @@ -0,0 +1,54 @@ +import {Injectable} from '@angular/core'; +import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms'; +import {FormControlModel} from "../../models/formControlModels/formControl.model"; +import * as _ from 'lodash'; + +@Injectable() +export class GenericFormService { + constructor(private _formBuilder: FormBuilder){} + + generateFormBuilder(controls : FormControlModel[], dynamicInputs : FormControlModel[]) : FormGroup { + let controlsList = {}; + if(!_.isNil(controls)){ + for(let control of controls){ + controlsList[control.controlName] = new FormControl( + { + value: _.isNil(control.value) ? null :control.value, + disabled: control.isDisabled + }, Validators.compose(control.validations.map(item => item.validator))); + } + } + + if(!_.isNil(dynamicInputs)){ + let dynamicControlsList = {}; + if(!_.isNil(dynamicInputs)){ + for(let control of dynamicInputs){ + dynamicControlsList[control.controlName] = new FormControl( + { + value: control.value ? control.value : null, + disabled: control.isDisabled + }, Validators.compose(control.validations.map(item => item.validator))); + } + } + controlsList['instanceParams'] = this._formBuilder.group(dynamicControlsList); + } + + + return this._formBuilder.group(controlsList); + } + + shouldDisplayValidationError(form: FormGroup, controlName : string): boolean{ + if(!_.isNil(form) && !_.isNil(form.controls[controlName])){ + if(!form.controls[controlName].touched){ + return false; + } else if(form.controls[controlName].disabled) { + return false + }else if(_.isNil(form.controls[controlName].errors)){ + return false; + }else { + return true; + } + } + return false; + } +} |