summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmichai Hemli <amichai.hemli@intl.att.com>2020-05-15 01:35:21 +0300
committerAmichai Hemli <amichai.hemli@intl.att.com>2020-05-15 01:35:21 +0300
commit4ac68cef7eac5c56d61626000f43d4e8f686c33d (patch)
treec9d1e62cbef51a540a90c86cfae57684e926e18b
parent6181112a4e5c876499edeba307662ef49995d5f4 (diff)
When opening a service instance from the instantiation status page, the More Actions button should be visible pending user's permissions
Issue-ID: VID-829 Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com> Change-Id: Ia28f2fd9d497e8f7b2f2b4644ec105e5283b2637
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js3130
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm1018
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts2
3 files changed, 2075 insertions, 2075 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
index f2301f582..4a3a5b32e 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
@@ -1,1565 +1,1565 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 IBM.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-/**
- * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
- * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
- */
-(function () {
- "use strict";
-
- appDS2.requires.push('ui.tree');
-
- appDS2.controller("InstantiationController", function ($scope, $route, $location, $timeout, $uibModal, COMPONENT, VIDCONFIGURATION, FIELD, DataService, PropertyService, UtilityService, VnfService, $http, vidService, AaiService, PnfService, CrService, AsdcService, $q, featureFlags, _, CreationService, $window, DeleteResumeService) {
- $scope.popup = new Object();
- $scope.defaultBaseUrl = "";
- $scope.responseTimeoutMsec = 60000;
- $scope.properties = UtilityService.getProperties();
- $scope.resumeStatus = COMPONENT.RESUME_STATUS;
- //isPermitted - returned as string from url and converted into boolean
- $scope.isPermitted = $location.search().isPermitted === "true";
- $scope.STATUS_CONSTANTS = FIELD.STATUS;
- $scope.pnfs = [];// PNF data init;
- $scope.collectionResource = {};
- $scope.collections = [];
- $scope.networks = [];
- $scope.isCR = false;
- $scope.isVFC = false;
- $scope.init = function () {
- /*
- * These 2 statements should be included in non-test code.
- */
- // takes a default value, retrieves the prop value from the file system and sets it
- var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
- PropertyService.setMsoMaxPollingIntervalMsec(msecs);
-
- // takes a default value, retrieves the prop value from the file system and sets it
- var polls = PropertyService.retrieveMsoMaxPolls();
- PropertyService.setMsoMaxPolls(polls);
- };
-
-
- $scope.convertModel = function (asdcModel) {
- if (!asdcModel) return undefined;
- var convertedAsdcModel = UtilityService.convertModel(asdcModel);
- return convertedAsdcModel;
- };
-
- $scope.prepareScopeWithModel = function () {
- // skip if no model
- if (!vidService.getModel()) return;
-
- $scope.service = {
- "model": vidService.getModel(),
- "convertedModel": $scope.convertModel(vidService.getModel()),
- "instance": vidService.getInstance()
- };
-
-
- $scope.isCR = !_.isEmpty($scope.service.model.collectionResources);
- if ($scope.isCR)
- prepareCr();
- else
- preparePnfs();
- };
-
- function preparePnfs() {
- var serviceInstance = {
- globalCustomerId: $location.search().subscriberId,
- serviceType: $location.search().serviceType,
- serviceInstanceId: $location.search().serviceInstanceId
- };
-
- _setPnf(serviceInstance).then(function (data) {
- $scope.pnfs = data;
- });
- }
-
-
- function prepareCr() {
- var serviceInstance = {
- globalCustomerId: $location.search().subscriberId,
- serviceType: $location.search().serviceType,
- serviceInstanceId: $location.search().serviceInstanceId
- };
-
- _setCr(serviceInstance).then(function (data) {
- $scope.collectionResource = data;
- $scope.collections.push($scope.collectionResource.collection);
- $scope.networks.push($scope.collectionResource.networks[0]);
- });
- }
-
- $scope.returnVfModules = function (vnfInstance) {
-
- var svcModel = $scope.service.convertedModel;
- //var vnfModelInvariantUuid = vnfInstance[FIELD.ID.MODEL_INVAR_ID];
- var vnfModelVersionId = vnfInstance[FIELD.ID.MODEL_VERSION_ID]; // model uuid
- var vnfModelCustomizationUuid = vnfInstance[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- var vnfModel = null;
-
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- if (vnfModel !== undefined) {
- if (!($scope.isObjectEmpty(vnfModel.vfModules))) {
- //console.log ("vnfModel.vfModules: "); console.log (JSON.stringify(vnfModel.vfModules, null, 4));
- return (vnfModel.vfModules);
- }
- }
- }
- else {
- // old flow
- if (vnfModelVersionId != null) {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- if (vnfModel !== undefined) {
- if (!($scope.isObjectEmpty(vnfModel.vfModules))) {
- //console.log ("vnfModel.vfModules: "); console.log (JSON.stringify(vnfModel.vfModules, null, 4));
- return (vnfModel.vfModules);
- }
- }
- }
- }
-
- }
- return null;
- };
- $scope.hasVfModules = function (vnfInstance) {
- if ($scope.returnVfModules(vnfInstance) != null) {
- return true;
- }
- return false;
- };
- $scope.returnVolumeGroups = function (vnfInstance) {
-
- var svcModel = $scope.service.convertedModel;
-
- //var vnfModelInvariantUuid = vnfInstance[FIELD.ID.MODEL_INVAR_ID];
- var vnfModelVersionId = vnfInstance[FIELD.ID.MODEL_VERSION_ID];
- var vnfModelCustomizationUuid = vnfInstance[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- var vnfModel = null;
-
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- if (vnfModel !== undefined && !($scope.isObjectEmpty(vnfModel.volumeGroups))) {
- //console.log ("vnfModel.volumeGroups: "); console.log (JSON.stringify(vnfModel.volumeGroups, null, 4));
- return (vnfModel.volumeGroups);
- }
- }
- else {
- // old flow
- if (vnfModelVersionId != null) {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- if (!($scope.isObjectEmpty(vnfModel.volumeGroups))) {
- //console.log ("vnfModel.vfModules: "); console.log (JSON.stringify(vnfModel.volumeGroups, null, 4));
- return (vnfModel.volumeGroups);
- }
- }
- }
-
- }
- return null;
- };
- $scope.hasVolumeGroups = function (vnfInstance) {
- if ($scope.returnVolumeGroups(vnfInstance) != null) {
- return true;
- }
- return false;
- };
- $scope.deleteNetwork = function (serviceObject, network) {
-
- console.log("Removing Network " + network.name);
-
- //Send delete network request to MSO
-
- //var networks = this.service.instance.networks;
-
- //networks.splice(networks.indexOf(network), 1);
-
- //Retrieve updated data from A&AI
- var serviceInstance = serviceObject.object;
-
- setCurrentNetworkModelInfoFromScope(network);
-
- DataService.setInventoryItem(network.object);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
- DataService.setServiceName($scope.service.model.service.name);
- DataService.setServiceUuid($scope.service.model.service.uuid);
- DataService.setNetworkInstanceId(network.object[FIELD.ID.NETWORK_ID]);
-
- $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
- componentId: COMPONENT.NETWORK,
- callbackFunction: deleteOrResumeCallback,
- dialogMethod: COMPONENT.DELETE
- });
- };
-
- $scope.allowTransferToNewScreenAndShowButton = function (){
- if(featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_MORE_ACTIONS_BUTTON_IN_OLD_VIEW_EDIT)) {
- return $scope.isPermitted;
- }
- return false;
- };
-
- $scope.navigateToNewEditViewScreen = function(){
- window.location.href = 'serviceModels.htm#/servicePlanning/EDIT?' +
- 'serviceModelId=' + _.get($scope, 'service.model.service.uuid') +
- '&subscriberId=' + $location.search().subscriberId +
- '&serviceType=' + $location.search().serviceType +
- '&serviceInstanceId=' + $location.search().serviceInstanceId;
- };
-
- $scope.deleteService = function (serviceObject, serviceOrchestrationStatus) {
-
- var serviceInstance = serviceObject.object;
-
- console.log("Removing Service " + $scope.service.instance.name);
-
- if ($scope.isMacro()) {
- DataService.setALaCarte(false);
- }
- else {
- DataService.setALaCarte(true);
- }
- DataService.setMacro($scope.isMacro());
- DataService.setInventoryItem(serviceInstance);
- setCurrentServiceModelInfoFromScope();
-
-
- DataService.setSubscriberName(serviceObject[FIELD.ID.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[COMPONENT.GLOBAL_CUSTOMER_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
-
- DataService.setServiceName($scope.service.model.service.name);
-
- DataService.setServiceUuid($scope.service.model.service.uuid);
-
- $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
- componentId: COMPONENT.SERVICE,
- callbackFunction: deleteServiceInstanceCallbackFunction,
- dialogMethod: COMPONENT.DELETE,
- serviceStatus: serviceOrchestrationStatus
- });
-
- };
-
- function populate_popup_vfModule(serviceObject, vfModule, vnf) {
- var serviceInstance = serviceObject.object;
-
- DataService.setInventoryItem(vfModule.object);
-
- setCurrentVfModuleModelInfoFromScope(vnf, vfModule);
- var vfModuleInstanceID = vfModule.object[FIELD.ID.VF_MODULE_ID];
- if (vfModuleInstanceID == null) {
- vfModuleInstanceID = "";
- }
-
- DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
- DataService.setVfModuleInstanceId(vfModuleInstanceID);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
-
- DataService.setServiceName($scope.service.model.service.name);
-
- DataService.setServiceUuid($scope.service.model.service.uuid);
- }
-
- var modalInstance;
-
- var openMsoModal = function (msoType, requestParams, callbackFunction, configuration) {
- modalInstance = $uibModal.open({
- templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
- controller: "msoCommitModalController",
- backdrop: false,
- resolve: {
- msoType: function () {
- return msoType;
- },
- requestParams: function () {
- requestParams.callbackFunction = callbackFunction;
- return requestParams;
- },
- configuration: function () {
- return configuration;
- }
- }
- });
- };
-
- var openVfModuleWithHomingDataModal = function(action, vfModule) {
- modalInstance = $uibModal.open({
- controller: 'vfModuleActionModalController',
- templateUrl: 'app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.html',
- backdrop: false,
- resolve: {
- action: function () {
- return action;
- },
- vfModule: function() {
- return vfModule;
- }
- }
- });
-
- modalInstance.result.then(function (data) {
- if (data.msoType && data.requestParams) {
- openMsoModal(data.msoType, data.requestParams, deleteOrResumeCallback, null);
- }
- });
- };
-
- function getLcpCloudRegionTenantList() {
- AaiService.getLcpCloudRegionTenantList(DataService
- .getGlobalCustomerId(), DataService.getServiceType(), function(
- response) {
- $scope.lcpAndTenant = response;
- $scope.isFeatureFlagCloudOwner = featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST);
- $scope.lcpRegionList = _.uniqBy(response, 'cloudRegionId');
- });
- }
-
- $scope.deleteVfModule = function (serviceObject, vfModule, vnf) {
- $scope.isSoftDeleteEnabled = true;
-
- populate_popup_vfModule(serviceObject, vfModule, vnf);
-
- if (DataService.getLoggedInUserId()) {
- openVfModuleWithHomingDataModal(COMPONENT.DELETE, vfModule);
- }
- else {
- AaiService.getLoggedInUserID(function (response) {
- var userID = response.data;
- DataService.setLoggedInUserId(userID);
- openVfModuleWithHomingDataModal(COMPONENT.DELETE, vfModule);
- });
- }
- console.log("Removing VF-Module", vfModule);
- };
-
- function setCurrentServiceModelInfoFromScope() {
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": $scope.service.model.service.invariantUuid,
- "modelVersion": $scope.service.model.service.version,
- "modelNameVersionId": $scope.service.model.service.uuid,
- "modelName": $scope.service.model.service.name,
- "inputs": ""
- });
- };
-
- function setCurrentVNFModelInfo(vnf) {
- var svcModel = $scope.service.convertedModel;
- var vnfModel;
- var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
- var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- }
- else {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
- if (!($scope.isObjectEmpty(vnfModel))) {
-
- DataService.setModelInfo(COMPONENT.VNF, {
- "modelInvariantId": vnfModel.invariantUuid,
- "modelVersion": vnfModel.version,
- "modelNameVersionId": vnfModel.uuid,
- "modelCustomizationName": vnfModel.modelCustomizationName,
- "customizationUuid": vnfModel.customizationUuid,
- "modelName": vnfModel.name,
- "inputs": ""
- });
- }
- }
-
-
- }
-
- function setCurrentNetworkModelInfoFromScope(network) {
- var svcModel = $scope.service.convertedModel;
- var netModel;
- // set model default and override later if found
- DataService.setModelInfo(COMPONENT.NETWORK, {});
-
- if (network.object != null) {
-
- //var netModelInvariantUuid = network.object[FIELD.ID.MODEL_INVAR_ID];
- var netModelVersionId = network.object[FIELD.ID.MODEL_VERSION_ID]; // model uuid
- var netModelCustomizationUuid = network.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- if (UtilityService.hasContents(netModelCustomizationUuid)) {
- // set it to what came from a&ai
- DataService.setResCustomizationUuid(netModelCustomizationUuid);
- }
-
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.networks)))) {
- if ((svcModel.isNewFlow) && (UtilityService.hasContents(netModelCustomizationUuid))) {
- netModel = svcModel.networks[netModelCustomizationUuid];
- }
- else {
-
- if (UtilityService.hasContents(netModelVersionId)) {
- netModel = svcModel.networks[netModelVersionId];
- }
-
- }
- }
- }
- if (!($scope.isObjectEmpty(netModel))) {
- DataService.setModelInfo(COMPONENT.NETWORK, {
- "modelInvariantId": netModel.invariantUuid,
- "modelVersion": netModel.version,
- "modelNameVersionId": netModel.uuid,
- "modelCustomizationName": netModel.modelCustomizationName,
- "customizationUuid": netModel.customizationUuid,
- "modelName": netModel.name,
- "inputs": ""
- });
- }
- }
-
- function setCurrentVfModuleModelInfoFromScope(vnf, vfModule) {
-
- var svcModel = $scope.service.convertedModel;
-
- //var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
- var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
- var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
- var vnfModel = null;
- var vfModuleModel = null;
-
- DataService.setModelInfo(COMPONENT.VF_MODULE, {
- "modelInvariantId": "",
- "modelVersion": "",
- "modelNameVersionId": "",
- "modelCustomizationName": "",
- "customizationUuid": "",
- "modelName": "",
- "inputs": ""
- });
-
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
-
- var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
- if (!($scope.isObjectEmpty(vnfModel)) && !($scope.isObjectEmpty(vnfModel.vfModules)) && UtilityService.hasContents(vfModuleCustomizationUuid)) {
-
- vfModuleModel = vnfModel.vfModules[vfModuleCustomizationUuid];
-
- }
- }
- else {
- // old flow
- if (vnfModelVersionId != null) {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
- //var vfModuleInvariantUuid = vfModule.object[FIELD.ID.MODEL_INVAR_ID];
- var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
- if ((!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.vfModules))) &&
- UtilityService.hasContents(vfModuleModelVersionId)) {
- vfModuleModel = vnfModel.vfModules[vfModuleModelVersionId];
- }
- }
- if (!($scope.isObjectEmpty(vfModuleModel))) {
- DataService.setModelInfo(COMPONENT.VF_MODULE, {
- "modelInvariantId": vfModuleModel.invariantUuid,
- "modelVersion": vfModuleModel.version,
- "modelNameVersionId": vfModuleModel.uuid,
- "modelCustomizationName": vfModuleModel.modelCustomizationName,
- "customizationUuid": vfModuleModel.customizationUuid,
- "modelName": vfModuleModel.name,
- "inputs": ""
- });
- }
- }
- }
-
- function setCurrentVolumeGroupModelInfoFromScope(vnf, vfModule) {
- var svcModel = $scope.service.convertedModel;
-
- var vnfModelCustomizationUuid = null;
- var vnfModel = null;
- var vnfModelVersionId = null;
-
- vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
- vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
- "modelInvariantId": "",
- "modelVersion": "",
- "modelNameVersionId": "",
- "modelCustomizationName": "",
- "customizationUuid": "",
- "modelName": "",
- "inputs": ""
- });
-
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- }
- else {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
- }
-
-
- // volume groups don't have model-invariant-id/version in a&ai.
- // Their model-invariant-id/version is the one for the associated vfModule
-
- var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
- var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
- var volGroupModel = null;
-
- if (!($scope.isObjectEmpty(vnfModel)) && !($scope.isObjectEmpty(vnfModel.volumeGroups))) {
- if ((svcModel.isNewFlow) && (UtilityService.hasContents(vfModuleCustomizationUuid))) {
- volGroupModel = vnfModel.volumeGroups[vfModuleCustomizationUuid];
- }
- else {
- volGroupModel = vnfModel.volumeGroups[vfModuleModelVersionId];
- }
- if (!($scope.isObjectEmpty(volGroupModel))) {
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
- "modelInvariantId": volGroupModel.invariantUuid,
- "modelVersion": volGroupModel.version,
- "modelNameVersionId": volGroupModel.uuid,
- "modelCustomizationName": volGroupModel.modelCustomizationName,
- "customizationUuid": volGroupModel.customizationUuid,
- "modelName": volGroupModel.name,
- "inputs": ""
- });
-
- }
- }
- }
-
- function setCurrentVolumeGroupModelInfoByVfModuleFromScope(vnf, volumeGroup) {
- var svcModel = $scope.service.convertedModel;
-
- var vnfModelCustomizationUuid = null;
- var vnfModel = null;
- var vnfModelVersionId = null;
-
- vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
- vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
- "modelInvariantId": "",
- "modelVersion": "",
- "modelNameVersionId": "",
- "modelCustomizationName": "",
- "customizationUuid": "",
- "modelName": "",
- "inputs": ""
- });
-
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- }
- else {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
- }
-
-
- // volume groups don't have model-invariant-id/version in a&ai.
- // Their model-invariant-id/version is the one for the associated vfModule
-
- var vfModuleModelVersionId = volumeGroup.object[FIELD.ID.VF_MODULE_MODEL_VERSION_ID];
- var vfModuleCustomizationUuid = volumeGroup.object[FIELD.ID.VF_MODULE_MODEL_CUSTOMIZATION_ID];
- var volGroupModel = null;
- if ((!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.volumeGroups)))) {
- if ((svcModel.isNewFlow) && (UtilityService.hasContents(vfModuleCustomizationUuid))) {
- volGroupModel = vnfModel.volumeGroups[vfModuleCustomizationUuid];
- }
- else {
- volGroupModel = vnfModel.volumeGroups[vfModuleModelVersionId];
- }
- if (!($scope.isObjectEmpty(volGroupModel))) {
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
- "modelInvariantId": volGroupModel.invariantUuid,
- "modelVersion": volGroupModel.version,
- "modelNameVersionId": volGroupModel.uuid,
- "modelCustomizationName": volGroupModel.modelCustomizationName,
- "customizationUuid": volGroupModel.customizationUuid,
- "modelName": volGroupModel.name,
- "inputs": ""
- });
-
- }
- }
- }
-
- $scope.deleteVnf = function (serviceObject, vnf) {
- console.log("Removing VNF " + vnf.name);
-
- var serviceInstance = serviceObject.object;
- var svcModel = $scope.service.convertedModel;
- DataService.setInventoryItem(vnf.object);
-
- /*var vnftype = vnf.object['vnf-type'];
- if (vnftype == null)
- vnftype = "";
- else
- {
- var n = vnftype.search("/");
- if (n >= 0)
- vnftype = vnftype.substring(n+1);
- }*/
-
- var svcModel = $scope.service.convertedModel;
- var vnfModelInvariantUuid = null;
- var vnfModelVersion = null;
- var vnfModelCustomizationUuid = null;
- var vnfModel = null;
- var vnfModelVersionId = null;
-
- vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
- vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
- vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- DataService.setModelInfo(COMPONENT.VNF, {
- "modelInvariantId": vnfModelInvariantUuid,
- "modelVersion": "",
- "modelNameVersionId": vnfModelVersionId,
- "modelCustomizationName": "",
- "customizationUuid": vnfModelCustomizationUuid,
- "modelName": "",
- "inputs": ""
- });
-
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- }
- else {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
- //console.log ( "vnf models: "); console.log ( JSON.stringify ($scope.service.convertedModel.vnfs, null, 4) );
- if (!($scope.isObjectEmpty(vnfModel))) {
-
- DataService.setModelInfo(COMPONENT.VNF, {
- "modelInvariantId": vnfModel.invariantUuid,
- "modelVersion": vnfModel.version,
- "modelNameVersionId": vnfModel.uuid,
- "modelCustomizationName": vnfModel.modelCustomizationName,
- "customizationUuid": vnfModel.customizationUuid,
- "modelName": vnfModel.name,
- "inputs": ""
- });
- }
- }
-
- DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
-
- DataService.setServiceName($scope.service.model.service.name);
-
- DataService.setServiceUuid($scope.service.model.service.uuid);
-
- $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
- componentId: COMPONENT.VNF,
- callbackFunction: deleteOrResumeCallback,
- dialogMethod: COMPONENT.DELETE
- });
-
- };
-
- $scope.deleteVolumeGroup = function (serviceObject, vnf, vfModule, volumeGroup) {
-
- console.log("Removing Volume Group " + volumeGroup.name);
- var haveModel = false;
-
- var serviceInstance = serviceObject.object;
-
- setCurrentVolumeGroupModelInfoFromScope(vnf, vfModule);
-
- DataService.setInventoryItem(volumeGroup.object);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
-
- DataService.setServiceName($scope.service.model.service.name);
-
- DataService.setServiceUuid($scope.service.model.service.uuid);
- DataService.setVnfInstanceId(vnf.nodeId);
- DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
-
- $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
- componentId: COMPONENT.VOLUME_GROUP,
- dialogMethod: COMPONENT.DELETE
- });
- };
-
- $scope.deleteVnfVolumeGroup = function (serviceObject, vnf, volumeGroup) {
-
- console.log("Removing Volume Group " + volumeGroup.name);
- var serviceInstance = serviceObject.object;
-
- DataService.setInventoryItem(volumeGroup.object);
-
- var svcModel = $scope.service.convertedModel;
-
- var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
- var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
- var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- var volGroupModelInvariantUuid = volumeGroup.object[FIELD.ID.MODEL_INVAR_ID];
- var volGroupModelVersionId = volumeGroup.object[FIELD.ID.MODEL_VERSION_ID];
- var volGroupModelCustomizationUuid = volumeGroup.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- var vnfModel = null;
- var volGroupModel = null;
-
- // send an empty model by default since model is not required for deletes
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {});
-
- if (svcModel.isNewFlow) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- if (UtilityService.hasContents(volGroupModelCustomizationUuid)) {
- volGroupModel = vnfModel.volumeGroups[volGroupModelCustomizationUuid];
- }
- }
- else {
-
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- if (UtilityService.hasContents(volGroupModelVersionId)) {
- volGroupModel = vnfModel.volumeGroups[volGroupModelVersionId];
- }
- }
- if (!($scope.isObjectEmpty(volGroupModel))) {
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
- "modelInvariantId": volGroupModel.invariantUuid,
- "modelVersion": volGroupModel.version,
- "modelNameVersionId": volGroupModel.uuid,
- "modelName": volGroupModel.name,
- "modelCustomizationName": volGroupModel.modelCustomizationName,
- "customizationUuid": volGroupModel.customizationUuid,
- "inputs": ""
- });
- }
-
- DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
-
- DataService.setServiceName($scope.service.model.service.name);
-
- DataService.setServiceUuid($scope.service.model.service.uuid);
- DataService.setVnfInstanceId(vnf.nodeId);
- DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
-
- $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
- componentId: COMPONENT.VOLUME_GROUP,
- callbackFunction: deleteOrResumeCallback,
- dialogMethod: COMPONENT.DELETE
- });
- };
-
- $scope.describeNetwork = function (serviceObject, networkObject) {
- var serviceInstance = serviceObject.object;
- var network = networkObject.object;
- //console.log ("networkObject="); console.log (JSON.stringify(networkObject, null, 4));
-
- DataService.setResCustomizationUuid(" ");
-
- setCurrentServiceModelInfoFromScope();
- setCurrentNetworkModelInfoFromScope(networkObject);
-
- DataService.setNetworkInstanceId(network[FIELD.ID.NETWORK_ID]);
- DataService.setInventoryItem(networkObject);
- DataService.setSubscriberName(serviceObject.subscriberName);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
- componentId: COMPONENT.NETWORK
- });
- };
-
- // for service instance id - no need for this!
- $scope.describeService = function (serviceObject) {
- var serviceInstance = serviceObject.object;
- setCurrentServiceModelInfoFromScope();
-
- DataService.setInventoryItem(serviceInstance);
- //DataService.setModelInfo(serviceInstance['service-instance-id'], serviceInstance);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- //Display popup with additional service information
- $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
- componentId: COMPONENT.SERVICE
- });
-
- };
-
- $scope.describeVfModule = function (serviceObject, vfModuleObject, vnf) {
- var serviceInstance = serviceObject.object;
- var vfModule = vfModuleObject.object;
-
- /*var vfModuleInvariantUuid = vfModule[FIELD.ID.MODEL_INVAR_ID];
- var vfModuleModelVersionId = vfModule[FIELD.ID.MODEL_VERSION_ID];*/
- var vfModuleCustomizationUuid = vfModule[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- setCurrentServiceModelInfoFromScope();
- setCurrentVfModuleModelInfoFromScope(vnf, vfModuleObject);
-
- DataService.setCustomizationUuid(" ");
- if (UtilityService.hasContents(vfModuleCustomizationUuid)) {
- DataService.setCustomizationUuid(vfModuleCustomizationUuid);
- }
-
- //Display popup with additional VF-Module information
- DataService.setVfModuleInstanceId(vfModule[FIELD.ID.VF_MODULE_ID]);
- DataService.setInventoryItem(vfModule);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
- componentId: COMPONENT.VF_MODULE
- });
- };
-
- $scope.getStatusOfVnf = function (serviceObject, vnfObject) {
- var serviceInstance = serviceObject.object;
- var vnf = vnfObject.object;
-
- DataService.setVnfInstanceId(vnf[FIELD.ID.VNF_ID]);
- DataService.setInventoryItem(vnf);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
- DataService.setServiceInstanceName(serviceInstance[FIELD.ID.SERVICE_INSTANCE_NAME]);
-
- $scope.$broadcast(COMPONENT.COMPONENT_STATUS, {
- componentId: COMPONENT.VNF,
- callbackFunction: updateProvStatusVnfCallbackFunction
- });
- };
-
- $scope.describeVnf = function (serviceObject, vnfObject) {
- var serviceInstance = serviceObject.object;
- var vnf = vnfObject.object;
- DataService.setResCustomizationUuid(" ");
-
- //var vnfInvariantUuid = vnf[FIELD.ID.MODEL_INVAR_ID];
- //var vnfVersionId = vnf[FIELD.ID.MODEL_VERSION_ID];
- var vnfCustomizationUuid = vnf[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- if (UtilityService.hasContents(vnfCustomizationUuid)) {
- DataService.setResCustomizationUuid(vnfCustomizationUuid);
- }
-
- setCurrentServiceModelInfoFromScope();
- setCurrentVNFModelInfo(vnfObject);
-
- //Display popup with additional VNF information
- DataService.setVnfInstanceId(vnf[FIELD.ID.VNF_ID]);
- DataService.setInventoryItem(vnf);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
- componentId: COMPONENT.VNF
- });
- };
-
- $scope.describeVolumeGroup = function (serviceObject, vnf, volumeGroupObject) {
-
- var serviceInstance = serviceObject.object;
- var volumeGroup = volumeGroupObject.object;
-
- var volGroupCustomizationUuid = volumeGroup[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- setCurrentServiceModelInfoFromScope();
- setCurrentVolumeGroupModelInfoByVfModuleFromScope(vnf, volumeGroupObject);
-
- DataService.setCustomizationUuid(" ");
- if (UtilityService.hasContents(volGroupCustomizationUuid)) {
- DataService.setCustomizationUuid(volGroupCustomizationUuid);
- }
- DataService.setVolumeGroupInstanceId(volumeGroup[FIELD.ID.VOLUME_GROUP_ID]);
- DataService.setInventoryItem(volumeGroup);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
-
- $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
- componentId: COMPONENT.VOLUME_GROUP
- });
- };
-
- $scope.addNetworkInstance = function (netModel, existingVnfs) {
-
- // For networks we assume that we always follow the new flow
- console.log("Adding network to service instance" + this.service.instance.name);
- if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED && (UtilityService.hasContents(existingVnfs)) && (existingVnfs.length > 0)) {
- var msg = VnfService.isVnfListStatusValid(existingVnfs);
- if (msg != "") {
- alert(msg);
- return;
- }
- }
-
- DataService.setSubscriberName($scope.service.instance.subscriberName);
- DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
- DataService.setServiceType($scope.service.instance.serviceType);
- DataService.setServiceInstanceName($scope.service.instance.name);
- DataService.setServiceInstanceId($scope.service.instance.id);
- DataService.setServiceName($scope.service.model.service.name);
-
- DataService.setModelInfo(COMPONENT.NETWORK, {
- "modelType": "network",
- "modelInvariantId": netModel.invariantUuid,
- "modelVersion": netModel.version,
- "modelNameVersionId": netModel.uuid,
- "modelName": netModel.name,
- "modelCustomizationName": netModel.modelCustomizationName,
- "customizationUuid": netModel.customizationUuid,
- "inputs": "",
- "displayInputs": netModel.displayInputs
- });
- setCurrentServiceModelInfoFromScope();
-
-
- $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
- componentId: COMPONENT.NETWORK,
- callbackFunction: createVnfCallbackFunction
- });
- };
-
- $scope.addVnfInstance = function (vnf, existingVnfs) {
-
- if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED && (UtilityService.hasContents(existingVnfs)) && (existingVnfs.length > 0)) {
- var msg = VnfService.isVnfListStatusValid(existingVnfs);
- if (msg != "") {
- alert(msg);
- return;
- }
- }
-
- var isVfc = false;
-
- _.map($scope.service.model.vnfs, function (value, key) {
- if (value.uuid == vnf.uuid && !_.isEmpty(value.vfcInstanceGroups)) {
- isVfc = true;
- var queryData = {
- serviceModelId: $scope.service.model.service.uuid,
- serviceInstanceID: $scope.service.instance.id,
- globalCustomerId: $scope.service.instance.globalCustomerId,
- serviceType: $scope.service.instance.serviceType,
- serviceInstanceName: $scope.service.instance.name,
- modelCustomizationName: value.modelCustomizationName,
- modelCustomizationId: value.customizationUuid,
- subscriberName: $scope.service.instance.subscriberName
- };
-
- $scope.$broadcast(COMPONENT.IFRAME_DIALOG, queryData);
- return;
- }
- });
-
- DataService.setSubscriberName($scope.service.instance.subscriberName);
- DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
- DataService.setServiceType($scope.service.instance.serviceType);
- DataService.setServiceInstanceName($scope.service.instance.name);
- DataService.setServiceInstanceId($scope.service.instance.id);
- DataService.setServiceName($scope.service.model.service.name);
-
- console.log("existingVnfs: ");
- console.log(JSON.stringify(existingVnfs, null, 4));
- console.log("existingVnfs: ");
- console.log(JSON.stringify(existingVnfs, null, 4));
- var vnf_type = "";
- var vnf_role = "";
- var vnf_function = "";
- var vnf_code = "";
-
- if (UtilityService.hasContents(vnf.nfType)) {
- vnf_type = vnf.nfType;
- }
- if (UtilityService.hasContents(vnf.nfRole)) {
- vnf_role = vnf.nfRole;
- }
- if (UtilityService.hasContents(vnf.nfFunction)) {
- vnf_function = vnf.nfFunction;
- }
- if (UtilityService.hasContents(vnf.nfCode)) {
- vnf_code = vnf.nfCode;
- }
- DataService.setModelInfo(COMPONENT.VNF, {
- "modelType": vnf.isPnf ? "pnf" : "vnf",
- "modelInvariantId": vnf.invariantUuid,
- "modelVersion": vnf.version,
- "modelNameVersionId": vnf.uuid,
- "modelName": vnf.name,
- "modelCustomizationName": vnf.modelCustomizationName,
- "customizationUuid": vnf.customizationUuid,
- "inputs": "",
- "displayInputs": vnf.displayInputs,
- "vnfType": vnf_type,
- "vnfRole": vnf_role,
- "vnfFunction": vnf_function,
- "vnfCode": vnf_code,
- "properties": vnf.properties
- });
-
- DataService.setModelInstanceName($scope.service.model.service.name);
- setCurrentServiceModelInfoFromScope();
-
- if (vnf.isConfig) {
- DataService.setServiceProxies($scope.service.model.serviceProxies);
- DataService.setSourceServiceProxies(vnf.sourceNodes);
- DataService.setCollectorServiceProxies(vnf.collectorNodes);
- DataService.setConfigurationByPolicy(vnf.isConfigurationByPolicy);
- $location.path("/addNetworkNode");
- } else if (vnf.isPnf) {
- $location.path("/pnfSearchAssociation");
- } else if (isVfc) {
- //do nothing
- } else {
- $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
- componentId: COMPONENT.VNF,
- callbackFunction: createVnfCallbackFunction
- });
- }
- };
-
- $scope.addVfModuleInstance = function (vnfInstance, vfModuleModel) {
-
- if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED) {
- var msg = VnfService.isVnfStatusValid(vnfInstance);
- if (msg != "") {
- alert(msg);
- return;
- }
-
- }
- var svcModel = $scope.service.convertedModel;
- DataService.setSubscriberName($scope.service.instance.subscriberName);
- DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
- DataService.setServiceType($scope.service.instance.serviceType);
- DataService.setServiceInstanceName($scope.service.instance.name);
- DataService.setServiceInstanceId($scope.service.instance.id);
- DataService.setServiceName($scope.service.model.service.name);
-
- var vnfModelInvariantUuid = vnfInstance.object[FIELD.ID.MODEL_INVAR_ID];
- var vnfModelVersionId = vnfInstance.object[FIELD.ID.MODEL_VERSION_ID];
- var vnfModelCustomizationUuid = vnfInstance.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
- var vnfModel = null;
- if (svcModel.isNewFlow) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
- }
- else {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
-
- var availableVolumeGroupList = [];
- angular.forEach(vnfInstance[FIELD.ID.AVAILABLEVOLUMEGROUPS], function (volumeGroupInstance, key) {
- availableVolumeGroupList.push({"instance": volumeGroupInstance});
- });
-
- DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
- setCurrentServiceModelInfoFromScope();
-
- DataService.setVnfInstanceId(vnfInstance.object[FIELD.ID.VNF_ID]);
-
- DataService.setModelInfo(COMPONENT.VNF, {
- "modelInvariantId": vnfModel.invariantUuid,
- "modelVersion": vnfModel.version,
- "modelNameVersionId": vnfModel.uuid,
- "modelName": vnfModel.name,
- "modelCustomizationName": vnfModel.modelCustomizationName,
- "customizationUuid": vnfModel.customizationUuid,
- "inputs": ""
- });
-
- DataService.setModelInfo(COMPONENT.VF_MODULE, {
- "modelInvariantId": vfModuleModel.invariantUuid,
- "modelVersion": vfModuleModel.version,
- "modelNameVersionId": vfModuleModel.uuid,
- "customizationUuid": vfModuleModel.customizationUuid,
- "modelCustomizationName": vfModuleModel.modelCustomizationName,
- "modelName": vfModuleModel.name,
- "inputs": ""
- });
-
- $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
- componentId: COMPONENT.VF_MODULE,
- callbackFunction: createVfModuleCallbackFunction
- });
-
- };
-
- $scope.addVolumeGroupInstance = function (vnfInstance, volumeGroupModel) {
- if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED) {
- var msg = VnfService.isVnfStatusValid(vnfInstance);
- if (msg != "") {
- alert(msg);
- return;
- }
- }
- var svcModel = $scope.service.convertedModel;
- DataService.setSubscriberName($scope.service.instance.subscriberName);
- DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
- DataService.setServiceType($scope.service.instance.serviceType);
- DataService.setServiceInstanceName($scope.service.instance.name);
- DataService.setServiceInstanceId($scope.service.instance.id);
- DataService.setServiceName($scope.service.model.service.name);
- setCurrentServiceModelInfoFromScope();
-
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": $scope.service.model.service.invariantUuid,
- "modelVersion": $scope.service.model.service.version,
- "modelNameVersionId": $scope.service.model.service.uuid,
- "modelName": $scope.service.model.service.name,
- "inputs": ""
- });
-
- DataService.setVnfInstanceId(vnfInstance.object[FIELD.ID.VNF_ID]);
-
- var vnfModelInvariantUuid = vnfInstance.object[FIELD.ID.MODEL_INVAR_ID];
- var vnfModelVersionId = vnfInstance.object[FIELD.ID.MODEL_VERSION_ID];
- var vnfCustomizationUuid = vnfInstance.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
- var vnfModel = null;
-
- if (svcModel.isNewFlow) {
- vnfModel = svcModel.vnfs[vnfCustomizationUuid];
- }
- else {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
-
- DataService.setModelInfo(COMPONENT.VNF, {
- "modelInvariantId": vnfModel.invariantUuid,
- "modelVersion": vnfModel.version,
- "modelNameVersionId": vnfModel.uuid,
- "modelName": vnfModel.name,
- "modelCustomizationName": vnfModel.modelCustomizationName,
- "customizationUuid": vnfModel.customizationUuid,
- "inputs": ""
- });
-
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
- "modelInvariantId": volumeGroupModel.invariantUuid,
- "modelVersion": volumeGroupModel.version,
- "modelNameVersionId": volumeGroupModel.uuid,
- "modelName": volumeGroupModel.name,
- "modelCustomizationName": volumeGroupModel.modelCustomizationName,
- "customizationUuid": volumeGroupModel.customizationUuid,
- "inputs": ""
- });
-
- $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
- componentId: COMPONENT.VOLUME_GROUP,
- callbackFunction: createVolumeGroupCallbackFunction
- });
- };
-
- $scope.resume = function (serviceObject, vfModule, vnfModel) {
- populate_popup_vfModule(serviceObject, vfModule, vnfModel);
- setCurrentVNFModelInfo(vnfModel);
-
- var availableVolumeGroupList = [];
- angular.forEach(vfModule.volumeGroups, function (volumeGroupInstance, key) {
- availableVolumeGroupList.push({"instance": volumeGroupInstance});
- });
-
- DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
-
- DataService.setVfModuleInstanceName(vfModule.object[FIELD.ID.VF_MODULE_NAME]);
- setCurrentServiceModelInfoFromScope();
-
- if (DataService.getLoggedInUserId()) {
- openVfModuleWithHomingDataModal(COMPONENT.RESUME, vfModule);
- }
- else {
- AaiService.getLoggedInUserID(function (response) {
- var userID = response.data;
- DataService.setLoggedInUserId(userID);
- openVfModuleWithHomingDataModal(COMPONENT.RESUME, vfModule);
- });
- }
- };
-
- $scope.deleteConfiguration = function (serviceObject, configuration) {
- console.log("Deleting Configuration " + configuration.name);
-
- var serviceInstance = serviceObject.object;
- var svcModel = $scope.service.convertedModel;
- var configModel;
- DataService.setInventoryItem(configuration.object);
- // set model default and override later if found
- DataService.setModelInfo(COMPONENT.CONFIGURATION, {});
-
- if (configuration.object != null) {
-
- //var netModelInvariantUuid = network.object[FIELD.ID.MODEL_INVAR_ID];
- var configModelVersionId = configuration.object[FIELD.ID.MODEL_VERSION_ID]; // model uuid
- var configModelCustomizationUuid = configuration.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-
- //configurations added to vnfs list, in order to be part of the "Add VNF" drop-down list
- if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
- if ((svcModel.isNewFlow) && (UtilityService.hasContents(configModelCustomizationUuid))) {
- configModel = svcModel.vnfs[configModelCustomizationUuid];
- }
- else {
-
- if (UtilityService.hasContents(configModelVersionId)) {
- configModel = svcModel.vnfs[configModelVersionId];
- }
-
- }
- }
- }
- if (!($scope.isObjectEmpty(configModel))) {
- DataService.setModelInfo(COMPONENT.CONFIGURATION, {
- "modelInvariantId": configModel.invariantUuid,
- "modelVersion": configModel.version,
- "modelNameVersionId": configModel.uuid,
- "modelCustomizationName": configModel.modelCustomizationName,
- "customizationUuid": configModel.customizationUuid,
- "modelName": configModel.name,
- "inputs": ""
- });
- }
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
- DataService.setServiceName($scope.service.model.service.name);
- DataService.setServiceUuid($scope.service.model.service.uuid);
- DataService.setConfigurationInstanceId(configuration.object[FIELD.ID.CONFIGURATION_ID]);
-
- $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
- componentId: COMPONENT.CONFIGURATION,
- dialogMethod: COMPONENT.DELETE,
- callbackFunction: deleteCallbackFunction
- });
- };
-
- var deleteCallbackFunction = function () {
- console.log('hi')
- };
-
- $scope.resetProgress = function () {
- $scope.percentProgress = 0;
- $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_INFO;
- };
-
- $scope.setProgress = function (percentProgress) {
- percentProgress = parseInt(percentProgress);
- if (percentProgress >= 100) {
- $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_SUCCESS;
- }
-
- if (percentProgress < $scope.percentProgress) {
- return;
- }
-
- $scope.percentProgress = percentProgress;
- $scope.progressWidth = {width: percentProgress + "%"};
- if (percentProgress >= 5) {
- $scope.progressText = percentProgress + " %";
- } else {
- // Hidden since color combination is barely visible when progress portion is narrow.
- $scope.progressText = "";
- }
- };
- $scope.isObjectEmpty = function (o) {
- var len = 0;
- if (UtilityService.hasContents(o)) {
- var keys = Object.keys(o);
- len = keys.length;
- if (len == 0) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- return true;
- }
- };
- $scope.isMacro = function () {
- return $scope.service && AsdcService.isMacro($scope.service.model);
- };
- $scope.reloadRoute = function () {
- $route.reload();
- };
-
-
- /*
-Private metthods
-*/
-
- /*
- setPnf
- * set the controller pnf param using api call
- * return: void
- */
- function _setPnf(data) { // data is the $scope.service.instance object
- return PnfService.getPnfs(data)
- .then(
- function (response) {
- return response.data;
- // * can add here changes on the data that are needed to the view ( filter, ect..)
- },
- function (error) {
- console.error(error);
- }
- );
- }
-
-
- function _setCr(data) { // data is the $scope.service.instance object
- return CrService.getCr(data)
- .then(
- function (response) {
- return response.data.results;
- // * can add here changes on the data that are needed to the view ( filter, ect..)
- },
- function (error) {
- console.error(error);
- }
- );
- }
-
-
- /*
- Callbaks functions
-
- */
- var updateProvStatusVnfCallbackFunction = function (response) {
- $scope.callbackResults = "";
- var color = FIELD.ID.COLOR_NONE;
- $scope.callbackStyle = {
- "background-color": color
- };
- $scope.reloadRoute();
- /*
- * This 1/2 delay was only added to visually highlight the status
- * change. Probably not needed in the real application code.
- */
- $timeout(function () {
- $scope.callbackResults = UtilityService.getCurrentTime()
- + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
- if (response.isSuccessful) {
- color = FIELD.ID.COLOR_8F8;
-
- } else {
- color = FIELD.ID.COLOR_F88;
- }
- $scope.callbackStyle = {
- "background-color": color
- };
- }, 500);
-
- };
-
- var createVnfCallbackFunction = function (response) {
- $scope.callbackResults = "";
- var color = FIELD.ID.COLOR_NONE;
- $scope.callbackStyle = {
- "background-color": color
- };
-
- /*
- * This 1/2 delay was only added to visually highlight the status
- * change. Probably not needed in the real application code.
- */
- $timeout(function () {
- $scope.callbackResults = UtilityService.getCurrentTime()
- + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
- if (response.isSuccessful) {
- color = FIELD.ID.COLOR_8F8;
- $scope.reloadRoute();
- } else {
- color = FIELD.ID.COLOR_F88;
- }
- $scope.callbackStyle = {
- "background-color": color
- };
- }, 500);
-
-
- };
-
- var deleteOrResumeCallback = function (response) {
- $scope.callbackResults = "";
- var color = FIELD.ID.COLOR_NONE;
- $scope.callbackStyle = {
- "background-color": color
- };
-
- /*
- * This 1/2 delay was only added to visually highlight the status
- * change. Probably not needed in the real application code.
- */
- $timeout(function () {
- $scope.callbackResults = UtilityService.getCurrentTime()
- + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
- if (response.isSuccessful) {
- color = FIELD.ID.COLOR_8F8;
- $scope.reloadRoute();
- } else {
- color = FIELD.ID.COLOR_F88;
- }
- $scope.callbackStyle = {
- "background-color": color
- };
- }, 500);
-
- };
-
- var createVfModuleCallbackFunction = function (response) {
- $scope.callbackResults = "";
- var color = FIELD.ID.COLOR_NONE;
- $scope.callbackStyle = {
- "background-color": color
- };
-
- /*
- * This 1/2 delay was only added to visually highlight the status
- * change. Probably not needed in the real application code.
- */
- $timeout(function () {
- $scope.callbackResults = UtilityService.getCurrentTime()
- + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
- if (response.isSuccessful) {
- color = FIELD.ID.COLOR_8F8;
- $scope.reloadRoute();
- } else {
- color = FIELD.ID.COLOR_F88;
- $scope.reloadRoute();
- }
- $scope.callbackStyle = {
- "background-color": color
- };
- }, 500);
-
- };
-
- var deleteServiceInstanceCallbackFunction = function (response) {
- $scope.callbackResults = "";
- var color = FIELD.ID.COLOR_NONE;
- $scope.callbackStyle = {
- "background-color": color
- };
-
- /*
- * This 1/2 delay was only added to visually highlight the status
- * change. Probably not needed in the real application code.
- */
- $timeout(function () {
- $scope.callbackResults = UtilityService.getCurrentTime()
- + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
- if (response.isSuccessful) {
- color = FIELD.ID.COLOR_8F8;
- $location.path(COMPONENT.SERVICEMODELS_MODELS_SERVICES_PATH);
- } else {
- color = FIELD.ID.COLOR_F88;
- }
- $scope.callbackStyle = {
- "background-color": color
- };
- }, 500);
-
- };
-
- var createVolumeGroupCallbackFunction = function (response) {
- $scope.callbackResults = "";
- var color = FIELD.ID.COLOR_NONE;
- $scope.callbackStyle = {
- "background-color": color
- };
-
- /*
- * This 1/2 delay was only added to visually highlight the status
- * change. Probably not needed in the real application code.
- */
- $timeout(function () {
- $scope.callbackResults = UtilityService.getCurrentTime()
- + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
- if (response.isSuccessful) {
- color = FIELD.ID.COLOR_8F8;
- $scope.reloadRoute();
- } else {
- color = FIELD.ID.COLOR_F88;
- }
- $scope.callbackStyle = {
- "background-color": color
- };
- }, 500);
-
-
- };
-
- });
-})();
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 IBM.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+/**
+ * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
+ * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
+ */
+(function () {
+ "use strict";
+
+ appDS2.requires.push('ui.tree');
+
+ appDS2.controller("InstantiationController", function ($scope, $route, $location, $timeout, $uibModal, COMPONENT, VIDCONFIGURATION, FIELD, DataService, PropertyService, UtilityService, VnfService, $http, vidService, AaiService, PnfService, CrService, AsdcService, $q, featureFlags, _, CreationService, $window, DeleteResumeService) {
+ $scope.popup = new Object();
+ $scope.defaultBaseUrl = "";
+ $scope.responseTimeoutMsec = 60000;
+ $scope.properties = UtilityService.getProperties();
+ $scope.resumeStatus = COMPONENT.RESUME_STATUS;
+ //isPermitted - returned as string from url and converted into boolean
+ $scope.isPermitted = $location.search().isPermitted === "true";
+ $scope.STATUS_CONSTANTS = FIELD.STATUS;
+ $scope.pnfs = [];// PNF data init;
+ $scope.collectionResource = {};
+ $scope.collections = [];
+ $scope.networks = [];
+ $scope.isCR = false;
+ $scope.isVFC = false;
+ $scope.init = function () {
+ /*
+ * These 2 statements should be included in non-test code.
+ */
+ // takes a default value, retrieves the prop value from the file system and sets it
+ var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
+ PropertyService.setMsoMaxPollingIntervalMsec(msecs);
+
+ // takes a default value, retrieves the prop value from the file system and sets it
+ var polls = PropertyService.retrieveMsoMaxPolls();
+ PropertyService.setMsoMaxPolls(polls);
+ };
+
+
+ $scope.convertModel = function (asdcModel) {
+ if (!asdcModel) return undefined;
+ var convertedAsdcModel = UtilityService.convertModel(asdcModel);
+ return convertedAsdcModel;
+ };
+
+ $scope.prepareScopeWithModel = function () {
+ // skip if no model
+ if (!vidService.getModel()) return;
+
+ $scope.service = {
+ "model": vidService.getModel(),
+ "convertedModel": $scope.convertModel(vidService.getModel()),
+ "instance": vidService.getInstance()
+ };
+
+
+ $scope.isCR = !_.isEmpty($scope.service.model.collectionResources);
+ if ($scope.isCR)
+ prepareCr();
+ else
+ preparePnfs();
+ };
+
+ function preparePnfs() {
+ var serviceInstance = {
+ globalCustomerId: $location.search().subscriberId,
+ serviceType: $location.search().serviceType,
+ serviceInstanceId: $location.search().serviceInstanceId
+ };
+
+ _setPnf(serviceInstance).then(function (data) {
+ $scope.pnfs = data;
+ });
+ }
+
+
+ function prepareCr() {
+ var serviceInstance = {
+ globalCustomerId: $location.search().subscriberId,
+ serviceType: $location.search().serviceType,
+ serviceInstanceId: $location.search().serviceInstanceId
+ };
+
+ _setCr(serviceInstance).then(function (data) {
+ $scope.collectionResource = data;
+ $scope.collections.push($scope.collectionResource.collection);
+ $scope.networks.push($scope.collectionResource.networks[0]);
+ });
+ }
+
+ $scope.returnVfModules = function (vnfInstance) {
+
+ var svcModel = $scope.service.convertedModel;
+ //var vnfModelInvariantUuid = vnfInstance[FIELD.ID.MODEL_INVAR_ID];
+ var vnfModelVersionId = vnfInstance[FIELD.ID.MODEL_VERSION_ID]; // model uuid
+ var vnfModelCustomizationUuid = vnfInstance[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ var vnfModel = null;
+
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ if (vnfModel !== undefined) {
+ if (!($scope.isObjectEmpty(vnfModel.vfModules))) {
+ //console.log ("vnfModel.vfModules: "); console.log (JSON.stringify(vnfModel.vfModules, null, 4));
+ return (vnfModel.vfModules);
+ }
+ }
+ }
+ else {
+ // old flow
+ if (vnfModelVersionId != null) {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ if (vnfModel !== undefined) {
+ if (!($scope.isObjectEmpty(vnfModel.vfModules))) {
+ //console.log ("vnfModel.vfModules: "); console.log (JSON.stringify(vnfModel.vfModules, null, 4));
+ return (vnfModel.vfModules);
+ }
+ }
+ }
+ }
+
+ }
+ return null;
+ };
+ $scope.hasVfModules = function (vnfInstance) {
+ if ($scope.returnVfModules(vnfInstance) != null) {
+ return true;
+ }
+ return false;
+ };
+ $scope.returnVolumeGroups = function (vnfInstance) {
+
+ var svcModel = $scope.service.convertedModel;
+
+ //var vnfModelInvariantUuid = vnfInstance[FIELD.ID.MODEL_INVAR_ID];
+ var vnfModelVersionId = vnfInstance[FIELD.ID.MODEL_VERSION_ID];
+ var vnfModelCustomizationUuid = vnfInstance[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ var vnfModel = null;
+
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ if (vnfModel !== undefined && !($scope.isObjectEmpty(vnfModel.volumeGroups))) {
+ //console.log ("vnfModel.volumeGroups: "); console.log (JSON.stringify(vnfModel.volumeGroups, null, 4));
+ return (vnfModel.volumeGroups);
+ }
+ }
+ else {
+ // old flow
+ if (vnfModelVersionId != null) {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ if (!($scope.isObjectEmpty(vnfModel.volumeGroups))) {
+ //console.log ("vnfModel.vfModules: "); console.log (JSON.stringify(vnfModel.volumeGroups, null, 4));
+ return (vnfModel.volumeGroups);
+ }
+ }
+ }
+
+ }
+ return null;
+ };
+ $scope.hasVolumeGroups = function (vnfInstance) {
+ if ($scope.returnVolumeGroups(vnfInstance) != null) {
+ return true;
+ }
+ return false;
+ };
+ $scope.deleteNetwork = function (serviceObject, network) {
+
+ console.log("Removing Network " + network.name);
+
+ //Send delete network request to MSO
+
+ //var networks = this.service.instance.networks;
+
+ //networks.splice(networks.indexOf(network), 1);
+
+ //Retrieve updated data from A&AI
+ var serviceInstance = serviceObject.object;
+
+ setCurrentNetworkModelInfoFromScope(network);
+
+ DataService.setInventoryItem(network.object);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+ DataService.setServiceName($scope.service.model.service.name);
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+ DataService.setNetworkInstanceId(network.object[FIELD.ID.NETWORK_ID]);
+
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId: COMPONENT.NETWORK,
+ callbackFunction: deleteOrResumeCallback,
+ dialogMethod: COMPONENT.DELETE
+ });
+ };
+
+ $scope.allowTransferToNewScreenAndShowButton = function (isPermitted){
+ if(featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_MORE_ACTIONS_BUTTON_IN_OLD_VIEW_EDIT)) {
+ return isPermitted;
+ }
+ return false;
+ };
+
+ $scope.navigateToNewEditViewScreen = function(){
+ window.location.href = 'serviceModels.htm#/servicePlanning/EDIT?' +
+ 'serviceModelId=' + _.get($scope, 'service.model.service.uuid') +
+ '&subscriberId=' + $location.search().subscriberId +
+ '&serviceType=' + $location.search().serviceType +
+ '&serviceInstanceId=' + $location.search().serviceInstanceId;
+ };
+
+ $scope.deleteService = function (serviceObject, serviceOrchestrationStatus) {
+
+ var serviceInstance = serviceObject.object;
+
+ console.log("Removing Service " + $scope.service.instance.name);
+
+ if ($scope.isMacro()) {
+ DataService.setALaCarte(false);
+ }
+ else {
+ DataService.setALaCarte(true);
+ }
+ DataService.setMacro($scope.isMacro());
+ DataService.setInventoryItem(serviceInstance);
+ setCurrentServiceModelInfoFromScope();
+
+
+ DataService.setSubscriberName(serviceObject[FIELD.ID.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[COMPONENT.GLOBAL_CUSTOMER_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+
+ DataService.setServiceName($scope.service.model.service.name);
+
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId: COMPONENT.SERVICE,
+ callbackFunction: deleteServiceInstanceCallbackFunction,
+ dialogMethod: COMPONENT.DELETE,
+ serviceStatus: serviceOrchestrationStatus
+ });
+
+ };
+
+ function populate_popup_vfModule(serviceObject, vfModule, vnf) {
+ var serviceInstance = serviceObject.object;
+
+ DataService.setInventoryItem(vfModule.object);
+
+ setCurrentVfModuleModelInfoFromScope(vnf, vfModule);
+ var vfModuleInstanceID = vfModule.object[FIELD.ID.VF_MODULE_ID];
+ if (vfModuleInstanceID == null) {
+ vfModuleInstanceID = "";
+ }
+
+ DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
+ DataService.setVfModuleInstanceId(vfModuleInstanceID);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+
+ DataService.setServiceName($scope.service.model.service.name);
+
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+ }
+
+ var modalInstance;
+
+ var openMsoModal = function (msoType, requestParams, callbackFunction, configuration) {
+ modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
+ controller: "msoCommitModalController",
+ backdrop: false,
+ resolve: {
+ msoType: function () {
+ return msoType;
+ },
+ requestParams: function () {
+ requestParams.callbackFunction = callbackFunction;
+ return requestParams;
+ },
+ configuration: function () {
+ return configuration;
+ }
+ }
+ });
+ };
+
+ var openVfModuleWithHomingDataModal = function(action, vfModule) {
+ modalInstance = $uibModal.open({
+ controller: 'vfModuleActionModalController',
+ templateUrl: 'app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.html',
+ backdrop: false,
+ resolve: {
+ action: function () {
+ return action;
+ },
+ vfModule: function() {
+ return vfModule;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (data) {
+ if (data.msoType && data.requestParams) {
+ openMsoModal(data.msoType, data.requestParams, deleteOrResumeCallback, null);
+ }
+ });
+ };
+
+ function getLcpCloudRegionTenantList() {
+ AaiService.getLcpCloudRegionTenantList(DataService
+ .getGlobalCustomerId(), DataService.getServiceType(), function(
+ response) {
+ $scope.lcpAndTenant = response;
+ $scope.isFeatureFlagCloudOwner = featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST);
+ $scope.lcpRegionList = _.uniqBy(response, 'cloudRegionId');
+ });
+ }
+
+ $scope.deleteVfModule = function (serviceObject, vfModule, vnf) {
+ $scope.isSoftDeleteEnabled = true;
+
+ populate_popup_vfModule(serviceObject, vfModule, vnf);
+
+ if (DataService.getLoggedInUserId()) {
+ openVfModuleWithHomingDataModal(COMPONENT.DELETE, vfModule);
+ }
+ else {
+ AaiService.getLoggedInUserID(function (response) {
+ var userID = response.data;
+ DataService.setLoggedInUserId(userID);
+ openVfModuleWithHomingDataModal(COMPONENT.DELETE, vfModule);
+ });
+ }
+ console.log("Removing VF-Module", vfModule);
+ };
+
+ function setCurrentServiceModelInfoFromScope() {
+ DataService.setModelInfo(COMPONENT.SERVICE, {
+ "modelInvariantId": $scope.service.model.service.invariantUuid,
+ "modelVersion": $scope.service.model.service.version,
+ "modelNameVersionId": $scope.service.model.service.uuid,
+ "modelName": $scope.service.model.service.name,
+ "inputs": ""
+ });
+ };
+
+ function setCurrentVNFModelInfo(vnf) {
+ var svcModel = $scope.service.convertedModel;
+ var vnfModel;
+ var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ }
+ else {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+ if (!($scope.isObjectEmpty(vnfModel))) {
+
+ DataService.setModelInfo(COMPONENT.VNF, {
+ "modelInvariantId": vnfModel.invariantUuid,
+ "modelVersion": vnfModel.version,
+ "modelNameVersionId": vnfModel.uuid,
+ "modelCustomizationName": vnfModel.modelCustomizationName,
+ "customizationUuid": vnfModel.customizationUuid,
+ "modelName": vnfModel.name,
+ "inputs": ""
+ });
+ }
+ }
+
+
+ }
+
+ function setCurrentNetworkModelInfoFromScope(network) {
+ var svcModel = $scope.service.convertedModel;
+ var netModel;
+ // set model default and override later if found
+ DataService.setModelInfo(COMPONENT.NETWORK, {});
+
+ if (network.object != null) {
+
+ //var netModelInvariantUuid = network.object[FIELD.ID.MODEL_INVAR_ID];
+ var netModelVersionId = network.object[FIELD.ID.MODEL_VERSION_ID]; // model uuid
+ var netModelCustomizationUuid = network.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ if (UtilityService.hasContents(netModelCustomizationUuid)) {
+ // set it to what came from a&ai
+ DataService.setResCustomizationUuid(netModelCustomizationUuid);
+ }
+
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.networks)))) {
+ if ((svcModel.isNewFlow) && (UtilityService.hasContents(netModelCustomizationUuid))) {
+ netModel = svcModel.networks[netModelCustomizationUuid];
+ }
+ else {
+
+ if (UtilityService.hasContents(netModelVersionId)) {
+ netModel = svcModel.networks[netModelVersionId];
+ }
+
+ }
+ }
+ }
+ if (!($scope.isObjectEmpty(netModel))) {
+ DataService.setModelInfo(COMPONENT.NETWORK, {
+ "modelInvariantId": netModel.invariantUuid,
+ "modelVersion": netModel.version,
+ "modelNameVersionId": netModel.uuid,
+ "modelCustomizationName": netModel.modelCustomizationName,
+ "customizationUuid": netModel.customizationUuid,
+ "modelName": netModel.name,
+ "inputs": ""
+ });
+ }
+ }
+
+ function setCurrentVfModuleModelInfoFromScope(vnf, vfModule) {
+
+ var svcModel = $scope.service.convertedModel;
+
+ //var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
+ var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ var vnfModel = null;
+ var vfModuleModel = null;
+
+ DataService.setModelInfo(COMPONENT.VF_MODULE, {
+ "modelInvariantId": "",
+ "modelVersion": "",
+ "modelNameVersionId": "",
+ "modelCustomizationName": "",
+ "customizationUuid": "",
+ "modelName": "",
+ "inputs": ""
+ });
+
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+
+ var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ if (!($scope.isObjectEmpty(vnfModel)) && !($scope.isObjectEmpty(vnfModel.vfModules)) && UtilityService.hasContents(vfModuleCustomizationUuid)) {
+
+ vfModuleModel = vnfModel.vfModules[vfModuleCustomizationUuid];
+
+ }
+ }
+ else {
+ // old flow
+ if (vnfModelVersionId != null) {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+ //var vfModuleInvariantUuid = vfModule.object[FIELD.ID.MODEL_INVAR_ID];
+ var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
+ if ((!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.vfModules))) &&
+ UtilityService.hasContents(vfModuleModelVersionId)) {
+ vfModuleModel = vnfModel.vfModules[vfModuleModelVersionId];
+ }
+ }
+ if (!($scope.isObjectEmpty(vfModuleModel))) {
+ DataService.setModelInfo(COMPONENT.VF_MODULE, {
+ "modelInvariantId": vfModuleModel.invariantUuid,
+ "modelVersion": vfModuleModel.version,
+ "modelNameVersionId": vfModuleModel.uuid,
+ "modelCustomizationName": vfModuleModel.modelCustomizationName,
+ "customizationUuid": vfModuleModel.customizationUuid,
+ "modelName": vfModuleModel.name,
+ "inputs": ""
+ });
+ }
+ }
+ }
+
+ function setCurrentVolumeGroupModelInfoFromScope(vnf, vfModule) {
+ var svcModel = $scope.service.convertedModel;
+
+ var vnfModelCustomizationUuid = null;
+ var vnfModel = null;
+ var vnfModelVersionId = null;
+
+ vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
+ "modelInvariantId": "",
+ "modelVersion": "",
+ "modelNameVersionId": "",
+ "modelCustomizationName": "",
+ "customizationUuid": "",
+ "modelName": "",
+ "inputs": ""
+ });
+
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ }
+ else {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+ }
+
+
+ // volume groups don't have model-invariant-id/version in a&ai.
+ // Their model-invariant-id/version is the one for the associated vfModule
+
+ var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
+ var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ var volGroupModel = null;
+
+ if (!($scope.isObjectEmpty(vnfModel)) && !($scope.isObjectEmpty(vnfModel.volumeGroups))) {
+ if ((svcModel.isNewFlow) && (UtilityService.hasContents(vfModuleCustomizationUuid))) {
+ volGroupModel = vnfModel.volumeGroups[vfModuleCustomizationUuid];
+ }
+ else {
+ volGroupModel = vnfModel.volumeGroups[vfModuleModelVersionId];
+ }
+ if (!($scope.isObjectEmpty(volGroupModel))) {
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
+ "modelInvariantId": volGroupModel.invariantUuid,
+ "modelVersion": volGroupModel.version,
+ "modelNameVersionId": volGroupModel.uuid,
+ "modelCustomizationName": volGroupModel.modelCustomizationName,
+ "customizationUuid": volGroupModel.customizationUuid,
+ "modelName": volGroupModel.name,
+ "inputs": ""
+ });
+
+ }
+ }
+ }
+
+ function setCurrentVolumeGroupModelInfoByVfModuleFromScope(vnf, volumeGroup) {
+ var svcModel = $scope.service.convertedModel;
+
+ var vnfModelCustomizationUuid = null;
+ var vnfModel = null;
+ var vnfModelVersionId = null;
+
+ vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
+ "modelInvariantId": "",
+ "modelVersion": "",
+ "modelNameVersionId": "",
+ "modelCustomizationName": "",
+ "customizationUuid": "",
+ "modelName": "",
+ "inputs": ""
+ });
+
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ }
+ else {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+ }
+
+
+ // volume groups don't have model-invariant-id/version in a&ai.
+ // Their model-invariant-id/version is the one for the associated vfModule
+
+ var vfModuleModelVersionId = volumeGroup.object[FIELD.ID.VF_MODULE_MODEL_VERSION_ID];
+ var vfModuleCustomizationUuid = volumeGroup.object[FIELD.ID.VF_MODULE_MODEL_CUSTOMIZATION_ID];
+ var volGroupModel = null;
+ if ((!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.volumeGroups)))) {
+ if ((svcModel.isNewFlow) && (UtilityService.hasContents(vfModuleCustomizationUuid))) {
+ volGroupModel = vnfModel.volumeGroups[vfModuleCustomizationUuid];
+ }
+ else {
+ volGroupModel = vnfModel.volumeGroups[vfModuleModelVersionId];
+ }
+ if (!($scope.isObjectEmpty(volGroupModel))) {
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
+ "modelInvariantId": volGroupModel.invariantUuid,
+ "modelVersion": volGroupModel.version,
+ "modelNameVersionId": volGroupModel.uuid,
+ "modelCustomizationName": volGroupModel.modelCustomizationName,
+ "customizationUuid": volGroupModel.customizationUuid,
+ "modelName": volGroupModel.name,
+ "inputs": ""
+ });
+
+ }
+ }
+ }
+
+ $scope.deleteVnf = function (serviceObject, vnf) {
+ console.log("Removing VNF " + vnf.name);
+
+ var serviceInstance = serviceObject.object;
+ var svcModel = $scope.service.convertedModel;
+ DataService.setInventoryItem(vnf.object);
+
+ /*var vnftype = vnf.object['vnf-type'];
+ if (vnftype == null)
+ vnftype = "";
+ else
+ {
+ var n = vnftype.search("/");
+ if (n >= 0)
+ vnftype = vnftype.substring(n+1);
+ }*/
+
+ var svcModel = $scope.service.convertedModel;
+ var vnfModelInvariantUuid = null;
+ var vnfModelVersion = null;
+ var vnfModelCustomizationUuid = null;
+ var vnfModel = null;
+ var vnfModelVersionId = null;
+
+ vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
+ vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ DataService.setModelInfo(COMPONENT.VNF, {
+ "modelInvariantId": vnfModelInvariantUuid,
+ "modelVersion": "",
+ "modelNameVersionId": vnfModelVersionId,
+ "modelCustomizationName": "",
+ "customizationUuid": vnfModelCustomizationUuid,
+ "modelName": "",
+ "inputs": ""
+ });
+
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (vnfModelCustomizationUuid != null)) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ }
+ else {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+ //console.log ( "vnf models: "); console.log ( JSON.stringify ($scope.service.convertedModel.vnfs, null, 4) );
+ if (!($scope.isObjectEmpty(vnfModel))) {
+
+ DataService.setModelInfo(COMPONENT.VNF, {
+ "modelInvariantId": vnfModel.invariantUuid,
+ "modelVersion": vnfModel.version,
+ "modelNameVersionId": vnfModel.uuid,
+ "modelCustomizationName": vnfModel.modelCustomizationName,
+ "customizationUuid": vnfModel.customizationUuid,
+ "modelName": vnfModel.name,
+ "inputs": ""
+ });
+ }
+ }
+
+ DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+
+ DataService.setServiceName($scope.service.model.service.name);
+
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId: COMPONENT.VNF,
+ callbackFunction: deleteOrResumeCallback,
+ dialogMethod: COMPONENT.DELETE
+ });
+
+ };
+
+ $scope.deleteVolumeGroup = function (serviceObject, vnf, vfModule, volumeGroup) {
+
+ console.log("Removing Volume Group " + volumeGroup.name);
+ var haveModel = false;
+
+ var serviceInstance = serviceObject.object;
+
+ setCurrentVolumeGroupModelInfoFromScope(vnf, vfModule);
+
+ DataService.setInventoryItem(volumeGroup.object);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+
+ DataService.setServiceName($scope.service.model.service.name);
+
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+ DataService.setVnfInstanceId(vnf.nodeId);
+ DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
+
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId: COMPONENT.VOLUME_GROUP,
+ dialogMethod: COMPONENT.DELETE
+ });
+ };
+
+ $scope.deleteVnfVolumeGroup = function (serviceObject, vnf, volumeGroup) {
+
+ console.log("Removing Volume Group " + volumeGroup.name);
+ var serviceInstance = serviceObject.object;
+
+ DataService.setInventoryItem(volumeGroup.object);
+
+ var svcModel = $scope.service.convertedModel;
+
+ var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
+ var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ var volGroupModelInvariantUuid = volumeGroup.object[FIELD.ID.MODEL_INVAR_ID];
+ var volGroupModelVersionId = volumeGroup.object[FIELD.ID.MODEL_VERSION_ID];
+ var volGroupModelCustomizationUuid = volumeGroup.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ var vnfModel = null;
+ var volGroupModel = null;
+
+ // send an empty model by default since model is not required for deletes
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {});
+
+ if (svcModel.isNewFlow) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ if (UtilityService.hasContents(volGroupModelCustomizationUuid)) {
+ volGroupModel = vnfModel.volumeGroups[volGroupModelCustomizationUuid];
+ }
+ }
+ else {
+
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ if (UtilityService.hasContents(volGroupModelVersionId)) {
+ volGroupModel = vnfModel.volumeGroups[volGroupModelVersionId];
+ }
+ }
+ if (!($scope.isObjectEmpty(volGroupModel))) {
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
+ "modelInvariantId": volGroupModel.invariantUuid,
+ "modelVersion": volGroupModel.version,
+ "modelNameVersionId": volGroupModel.uuid,
+ "modelName": volGroupModel.name,
+ "modelCustomizationName": volGroupModel.modelCustomizationName,
+ "customizationUuid": volGroupModel.customizationUuid,
+ "inputs": ""
+ });
+ }
+
+ DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+
+ DataService.setServiceName($scope.service.model.service.name);
+
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+ DataService.setVnfInstanceId(vnf.nodeId);
+ DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
+
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId: COMPONENT.VOLUME_GROUP,
+ callbackFunction: deleteOrResumeCallback,
+ dialogMethod: COMPONENT.DELETE
+ });
+ };
+
+ $scope.describeNetwork = function (serviceObject, networkObject) {
+ var serviceInstance = serviceObject.object;
+ var network = networkObject.object;
+ //console.log ("networkObject="); console.log (JSON.stringify(networkObject, null, 4));
+
+ DataService.setResCustomizationUuid(" ");
+
+ setCurrentServiceModelInfoFromScope();
+ setCurrentNetworkModelInfoFromScope(networkObject);
+
+ DataService.setNetworkInstanceId(network[FIELD.ID.NETWORK_ID]);
+ DataService.setInventoryItem(networkObject);
+ DataService.setSubscriberName(serviceObject.subscriberName);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
+ componentId: COMPONENT.NETWORK
+ });
+ };
+
+ // for service instance id - no need for this!
+ $scope.describeService = function (serviceObject) {
+ var serviceInstance = serviceObject.object;
+ setCurrentServiceModelInfoFromScope();
+
+ DataService.setInventoryItem(serviceInstance);
+ //DataService.setModelInfo(serviceInstance['service-instance-id'], serviceInstance);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ //Display popup with additional service information
+ $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
+ componentId: COMPONENT.SERVICE
+ });
+
+ };
+
+ $scope.describeVfModule = function (serviceObject, vfModuleObject, vnf) {
+ var serviceInstance = serviceObject.object;
+ var vfModule = vfModuleObject.object;
+
+ /*var vfModuleInvariantUuid = vfModule[FIELD.ID.MODEL_INVAR_ID];
+ var vfModuleModelVersionId = vfModule[FIELD.ID.MODEL_VERSION_ID];*/
+ var vfModuleCustomizationUuid = vfModule[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ setCurrentServiceModelInfoFromScope();
+ setCurrentVfModuleModelInfoFromScope(vnf, vfModuleObject);
+
+ DataService.setCustomizationUuid(" ");
+ if (UtilityService.hasContents(vfModuleCustomizationUuid)) {
+ DataService.setCustomizationUuid(vfModuleCustomizationUuid);
+ }
+
+ //Display popup with additional VF-Module information
+ DataService.setVfModuleInstanceId(vfModule[FIELD.ID.VF_MODULE_ID]);
+ DataService.setInventoryItem(vfModule);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
+ componentId: COMPONENT.VF_MODULE
+ });
+ };
+
+ $scope.getStatusOfVnf = function (serviceObject, vnfObject) {
+ var serviceInstance = serviceObject.object;
+ var vnf = vnfObject.object;
+
+ DataService.setVnfInstanceId(vnf[FIELD.ID.VNF_ID]);
+ DataService.setInventoryItem(vnf);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+ DataService.setServiceInstanceName(serviceInstance[FIELD.ID.SERVICE_INSTANCE_NAME]);
+
+ $scope.$broadcast(COMPONENT.COMPONENT_STATUS, {
+ componentId: COMPONENT.VNF,
+ callbackFunction: updateProvStatusVnfCallbackFunction
+ });
+ };
+
+ $scope.describeVnf = function (serviceObject, vnfObject) {
+ var serviceInstance = serviceObject.object;
+ var vnf = vnfObject.object;
+ DataService.setResCustomizationUuid(" ");
+
+ //var vnfInvariantUuid = vnf[FIELD.ID.MODEL_INVAR_ID];
+ //var vnfVersionId = vnf[FIELD.ID.MODEL_VERSION_ID];
+ var vnfCustomizationUuid = vnf[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ if (UtilityService.hasContents(vnfCustomizationUuid)) {
+ DataService.setResCustomizationUuid(vnfCustomizationUuid);
+ }
+
+ setCurrentServiceModelInfoFromScope();
+ setCurrentVNFModelInfo(vnfObject);
+
+ //Display popup with additional VNF information
+ DataService.setVnfInstanceId(vnf[FIELD.ID.VNF_ID]);
+ DataService.setInventoryItem(vnf);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
+ componentId: COMPONENT.VNF
+ });
+ };
+
+ $scope.describeVolumeGroup = function (serviceObject, vnf, volumeGroupObject) {
+
+ var serviceInstance = serviceObject.object;
+ var volumeGroup = volumeGroupObject.object;
+
+ var volGroupCustomizationUuid = volumeGroup[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ setCurrentServiceModelInfoFromScope();
+ setCurrentVolumeGroupModelInfoByVfModuleFromScope(vnf, volumeGroupObject);
+
+ DataService.setCustomizationUuid(" ");
+ if (UtilityService.hasContents(volGroupCustomizationUuid)) {
+ DataService.setCustomizationUuid(volGroupCustomizationUuid);
+ }
+ DataService.setVolumeGroupInstanceId(volumeGroup[FIELD.ID.VOLUME_GROUP_ID]);
+ DataService.setInventoryItem(volumeGroup);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+
+ $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
+ componentId: COMPONENT.VOLUME_GROUP
+ });
+ };
+
+ $scope.addNetworkInstance = function (netModel, existingVnfs) {
+
+ // For networks we assume that we always follow the new flow
+ console.log("Adding network to service instance" + this.service.instance.name);
+ if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED && (UtilityService.hasContents(existingVnfs)) && (existingVnfs.length > 0)) {
+ var msg = VnfService.isVnfListStatusValid(existingVnfs);
+ if (msg != "") {
+ alert(msg);
+ return;
+ }
+ }
+
+ DataService.setSubscriberName($scope.service.instance.subscriberName);
+ DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
+ DataService.setServiceType($scope.service.instance.serviceType);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+ DataService.setServiceInstanceId($scope.service.instance.id);
+ DataService.setServiceName($scope.service.model.service.name);
+
+ DataService.setModelInfo(COMPONENT.NETWORK, {
+ "modelType": "network",
+ "modelInvariantId": netModel.invariantUuid,
+ "modelVersion": netModel.version,
+ "modelNameVersionId": netModel.uuid,
+ "modelName": netModel.name,
+ "modelCustomizationName": netModel.modelCustomizationName,
+ "customizationUuid": netModel.customizationUuid,
+ "inputs": "",
+ "displayInputs": netModel.displayInputs
+ });
+ setCurrentServiceModelInfoFromScope();
+
+
+ $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
+ componentId: COMPONENT.NETWORK,
+ callbackFunction: createVnfCallbackFunction
+ });
+ };
+
+ $scope.addVnfInstance = function (vnf, existingVnfs) {
+
+ if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED && (UtilityService.hasContents(existingVnfs)) && (existingVnfs.length > 0)) {
+ var msg = VnfService.isVnfListStatusValid(existingVnfs);
+ if (msg != "") {
+ alert(msg);
+ return;
+ }
+ }
+
+ var isVfc = false;
+
+ _.map($scope.service.model.vnfs, function (value, key) {
+ if (value.uuid == vnf.uuid && !_.isEmpty(value.vfcInstanceGroups)) {
+ isVfc = true;
+ var queryData = {
+ serviceModelId: $scope.service.model.service.uuid,
+ serviceInstanceID: $scope.service.instance.id,
+ globalCustomerId: $scope.service.instance.globalCustomerId,
+ serviceType: $scope.service.instance.serviceType,
+ serviceInstanceName: $scope.service.instance.name,
+ modelCustomizationName: value.modelCustomizationName,
+ modelCustomizationId: value.customizationUuid,
+ subscriberName: $scope.service.instance.subscriberName
+ };
+
+ $scope.$broadcast(COMPONENT.IFRAME_DIALOG, queryData);
+ return;
+ }
+ });
+
+ DataService.setSubscriberName($scope.service.instance.subscriberName);
+ DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
+ DataService.setServiceType($scope.service.instance.serviceType);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+ DataService.setServiceInstanceId($scope.service.instance.id);
+ DataService.setServiceName($scope.service.model.service.name);
+
+ console.log("existingVnfs: ");
+ console.log(JSON.stringify(existingVnfs, null, 4));
+ console.log("existingVnfs: ");
+ console.log(JSON.stringify(existingVnfs, null, 4));
+ var vnf_type = "";
+ var vnf_role = "";
+ var vnf_function = "";
+ var vnf_code = "";
+
+ if (UtilityService.hasContents(vnf.nfType)) {
+ vnf_type = vnf.nfType;
+ }
+ if (UtilityService.hasContents(vnf.nfRole)) {
+ vnf_role = vnf.nfRole;
+ }
+ if (UtilityService.hasContents(vnf.nfFunction)) {
+ vnf_function = vnf.nfFunction;
+ }
+ if (UtilityService.hasContents(vnf.nfCode)) {
+ vnf_code = vnf.nfCode;
+ }
+ DataService.setModelInfo(COMPONENT.VNF, {
+ "modelType": vnf.isPnf ? "pnf" : "vnf",
+ "modelInvariantId": vnf.invariantUuid,
+ "modelVersion": vnf.version,
+ "modelNameVersionId": vnf.uuid,
+ "modelName": vnf.name,
+ "modelCustomizationName": vnf.modelCustomizationName,
+ "customizationUuid": vnf.customizationUuid,
+ "inputs": "",
+ "displayInputs": vnf.displayInputs,
+ "vnfType": vnf_type,
+ "vnfRole": vnf_role,
+ "vnfFunction": vnf_function,
+ "vnfCode": vnf_code,
+ "properties": vnf.properties
+ });
+
+ DataService.setModelInstanceName($scope.service.model.service.name);
+ setCurrentServiceModelInfoFromScope();
+
+ if (vnf.isConfig) {
+ DataService.setServiceProxies($scope.service.model.serviceProxies);
+ DataService.setSourceServiceProxies(vnf.sourceNodes);
+ DataService.setCollectorServiceProxies(vnf.collectorNodes);
+ DataService.setConfigurationByPolicy(vnf.isConfigurationByPolicy);
+ $location.path("/addNetworkNode");
+ } else if (vnf.isPnf) {
+ $location.path("/pnfSearchAssociation");
+ } else if (isVfc) {
+ //do nothing
+ } else {
+ $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
+ componentId: COMPONENT.VNF,
+ callbackFunction: createVnfCallbackFunction
+ });
+ }
+ };
+
+ $scope.addVfModuleInstance = function (vnfInstance, vfModuleModel) {
+
+ if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED) {
+ var msg = VnfService.isVnfStatusValid(vnfInstance);
+ if (msg != "") {
+ alert(msg);
+ return;
+ }
+
+ }
+ var svcModel = $scope.service.convertedModel;
+ DataService.setSubscriberName($scope.service.instance.subscriberName);
+ DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
+ DataService.setServiceType($scope.service.instance.serviceType);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+ DataService.setServiceInstanceId($scope.service.instance.id);
+ DataService.setServiceName($scope.service.model.service.name);
+
+ var vnfModelInvariantUuid = vnfInstance.object[FIELD.ID.MODEL_INVAR_ID];
+ var vnfModelVersionId = vnfInstance.object[FIELD.ID.MODEL_VERSION_ID];
+ var vnfModelCustomizationUuid = vnfInstance.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ var vnfModel = null;
+ if (svcModel.isNewFlow) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ }
+ else {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+
+ var availableVolumeGroupList = [];
+ angular.forEach(vnfInstance[FIELD.ID.AVAILABLEVOLUMEGROUPS], function (volumeGroupInstance, key) {
+ availableVolumeGroupList.push({"instance": volumeGroupInstance});
+ });
+
+ DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
+ setCurrentServiceModelInfoFromScope();
+
+ DataService.setVnfInstanceId(vnfInstance.object[FIELD.ID.VNF_ID]);
+
+ DataService.setModelInfo(COMPONENT.VNF, {
+ "modelInvariantId": vnfModel.invariantUuid,
+ "modelVersion": vnfModel.version,
+ "modelNameVersionId": vnfModel.uuid,
+ "modelName": vnfModel.name,
+ "modelCustomizationName": vnfModel.modelCustomizationName,
+ "customizationUuid": vnfModel.customizationUuid,
+ "inputs": ""
+ });
+
+ DataService.setModelInfo(COMPONENT.VF_MODULE, {
+ "modelInvariantId": vfModuleModel.invariantUuid,
+ "modelVersion": vfModuleModel.version,
+ "modelNameVersionId": vfModuleModel.uuid,
+ "customizationUuid": vfModuleModel.customizationUuid,
+ "modelCustomizationName": vfModuleModel.modelCustomizationName,
+ "modelName": vfModuleModel.name,
+ "inputs": ""
+ });
+
+ $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
+ componentId: COMPONENT.VF_MODULE,
+ callbackFunction: createVfModuleCallbackFunction
+ });
+
+ };
+
+ $scope.addVolumeGroupInstance = function (vnfInstance, volumeGroupModel) {
+ if (VIDCONFIGURATION.VNF_STATUS_CHECK_ENABLED) {
+ var msg = VnfService.isVnfStatusValid(vnfInstance);
+ if (msg != "") {
+ alert(msg);
+ return;
+ }
+ }
+ var svcModel = $scope.service.convertedModel;
+ DataService.setSubscriberName($scope.service.instance.subscriberName);
+ DataService.setGlobalCustomerId($scope.service.instance.globalCustomerId);
+ DataService.setServiceType($scope.service.instance.serviceType);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+ DataService.setServiceInstanceId($scope.service.instance.id);
+ DataService.setServiceName($scope.service.model.service.name);
+ setCurrentServiceModelInfoFromScope();
+
+ DataService.setModelInfo(COMPONENT.SERVICE, {
+ "modelInvariantId": $scope.service.model.service.invariantUuid,
+ "modelVersion": $scope.service.model.service.version,
+ "modelNameVersionId": $scope.service.model.service.uuid,
+ "modelName": $scope.service.model.service.name,
+ "inputs": ""
+ });
+
+ DataService.setVnfInstanceId(vnfInstance.object[FIELD.ID.VNF_ID]);
+
+ var vnfModelInvariantUuid = vnfInstance.object[FIELD.ID.MODEL_INVAR_ID];
+ var vnfModelVersionId = vnfInstance.object[FIELD.ID.MODEL_VERSION_ID];
+ var vnfCustomizationUuid = vnfInstance.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ var vnfModel = null;
+
+ if (svcModel.isNewFlow) {
+ vnfModel = svcModel.vnfs[vnfCustomizationUuid];
+ }
+ else {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+
+ DataService.setModelInfo(COMPONENT.VNF, {
+ "modelInvariantId": vnfModel.invariantUuid,
+ "modelVersion": vnfModel.version,
+ "modelNameVersionId": vnfModel.uuid,
+ "modelName": vnfModel.name,
+ "modelCustomizationName": vnfModel.modelCustomizationName,
+ "customizationUuid": vnfModel.customizationUuid,
+ "inputs": ""
+ });
+
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, {
+ "modelInvariantId": volumeGroupModel.invariantUuid,
+ "modelVersion": volumeGroupModel.version,
+ "modelNameVersionId": volumeGroupModel.uuid,
+ "modelName": volumeGroupModel.name,
+ "modelCustomizationName": volumeGroupModel.modelCustomizationName,
+ "customizationUuid": volumeGroupModel.customizationUuid,
+ "inputs": ""
+ });
+
+ $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
+ componentId: COMPONENT.VOLUME_GROUP,
+ callbackFunction: createVolumeGroupCallbackFunction
+ });
+ };
+
+ $scope.resume = function (serviceObject, vfModule, vnfModel) {
+ populate_popup_vfModule(serviceObject, vfModule, vnfModel);
+ setCurrentVNFModelInfo(vnfModel);
+
+ var availableVolumeGroupList = [];
+ angular.forEach(vfModule.volumeGroups, function (volumeGroupInstance, key) {
+ availableVolumeGroupList.push({"instance": volumeGroupInstance});
+ });
+
+ DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
+
+ DataService.setVfModuleInstanceName(vfModule.object[FIELD.ID.VF_MODULE_NAME]);
+ setCurrentServiceModelInfoFromScope();
+
+ if (DataService.getLoggedInUserId()) {
+ openVfModuleWithHomingDataModal(COMPONENT.RESUME, vfModule);
+ }
+ else {
+ AaiService.getLoggedInUserID(function (response) {
+ var userID = response.data;
+ DataService.setLoggedInUserId(userID);
+ openVfModuleWithHomingDataModal(COMPONENT.RESUME, vfModule);
+ });
+ }
+ };
+
+ $scope.deleteConfiguration = function (serviceObject, configuration) {
+ console.log("Deleting Configuration " + configuration.name);
+
+ var serviceInstance = serviceObject.object;
+ var svcModel = $scope.service.convertedModel;
+ var configModel;
+ DataService.setInventoryItem(configuration.object);
+ // set model default and override later if found
+ DataService.setModelInfo(COMPONENT.CONFIGURATION, {});
+
+ if (configuration.object != null) {
+
+ //var netModelInvariantUuid = network.object[FIELD.ID.MODEL_INVAR_ID];
+ var configModelVersionId = configuration.object[FIELD.ID.MODEL_VERSION_ID]; // model uuid
+ var configModelCustomizationUuid = configuration.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ //configurations added to vnfs list, in order to be part of the "Add VNF" drop-down list
+ if ((!($scope.isObjectEmpty(svcModel))) && (!($scope.isObjectEmpty(svcModel.vnfs)))) {
+ if ((svcModel.isNewFlow) && (UtilityService.hasContents(configModelCustomizationUuid))) {
+ configModel = svcModel.vnfs[configModelCustomizationUuid];
+ }
+ else {
+
+ if (UtilityService.hasContents(configModelVersionId)) {
+ configModel = svcModel.vnfs[configModelVersionId];
+ }
+
+ }
+ }
+ }
+ if (!($scope.isObjectEmpty(configModel))) {
+ DataService.setModelInfo(COMPONENT.CONFIGURATION, {
+ "modelInvariantId": configModel.invariantUuid,
+ "modelVersion": configModel.version,
+ "modelNameVersionId": configModel.uuid,
+ "modelCustomizationName": configModel.modelCustomizationName,
+ "customizationUuid": configModel.customizationUuid,
+ "modelName": configModel.name,
+ "inputs": ""
+ });
+ }
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+ DataService.setServiceName($scope.service.model.service.name);
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+ DataService.setConfigurationInstanceId(configuration.object[FIELD.ID.CONFIGURATION_ID]);
+
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId: COMPONENT.CONFIGURATION,
+ dialogMethod: COMPONENT.DELETE,
+ callbackFunction: deleteCallbackFunction
+ });
+ };
+
+ var deleteCallbackFunction = function () {
+ console.log('hi')
+ };
+
+ $scope.resetProgress = function () {
+ $scope.percentProgress = 0;
+ $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_INFO;
+ };
+
+ $scope.setProgress = function (percentProgress) {
+ percentProgress = parseInt(percentProgress);
+ if (percentProgress >= 100) {
+ $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_SUCCESS;
+ }
+
+ if (percentProgress < $scope.percentProgress) {
+ return;
+ }
+
+ $scope.percentProgress = percentProgress;
+ $scope.progressWidth = {width: percentProgress + "%"};
+ if (percentProgress >= 5) {
+ $scope.progressText = percentProgress + " %";
+ } else {
+ // Hidden since color combination is barely visible when progress portion is narrow.
+ $scope.progressText = "";
+ }
+ };
+ $scope.isObjectEmpty = function (o) {
+ var len = 0;
+ if (UtilityService.hasContents(o)) {
+ var keys = Object.keys(o);
+ len = keys.length;
+ if (len == 0) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+ else {
+ return true;
+ }
+ };
+ $scope.isMacro = function () {
+ return $scope.service && AsdcService.isMacro($scope.service.model);
+ };
+ $scope.reloadRoute = function () {
+ $route.reload();
+ };
+
+
+ /*
+Private metthods
+*/
+
+ /*
+ setPnf
+ * set the controller pnf param using api call
+ * return: void
+ */
+ function _setPnf(data) { // data is the $scope.service.instance object
+ return PnfService.getPnfs(data)
+ .then(
+ function (response) {
+ return response.data;
+ // * can add here changes on the data that are needed to the view ( filter, ect..)
+ },
+ function (error) {
+ console.error(error);
+ }
+ );
+ }
+
+
+ function _setCr(data) { // data is the $scope.service.instance object
+ return CrService.getCr(data)
+ .then(
+ function (response) {
+ return response.data.results;
+ // * can add here changes on the data that are needed to the view ( filter, ect..)
+ },
+ function (error) {
+ console.error(error);
+ }
+ );
+ }
+
+
+ /*
+ Callbaks functions
+
+ */
+ var updateProvStatusVnfCallbackFunction = function (response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+ $scope.reloadRoute();
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function () {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+ }, 500);
+
+ };
+
+ var createVnfCallbackFunction = function (response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function () {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $scope.reloadRoute();
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+ }, 500);
+
+
+ };
+
+ var deleteOrResumeCallback = function (response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function () {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $scope.reloadRoute();
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+ }, 500);
+
+ };
+
+ var createVfModuleCallbackFunction = function (response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function () {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $scope.reloadRoute();
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ $scope.reloadRoute();
+ }
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+ }, 500);
+
+ };
+
+ var deleteServiceInstanceCallbackFunction = function (response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function () {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $location.path(COMPONENT.SERVICEMODELS_MODELS_SERVICES_PATH);
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+ }, 500);
+
+ };
+
+ var createVolumeGroupCallbackFunction = function (response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function () {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $scope.reloadRoute();
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color": color
+ };
+ }, 500);
+
+
+ };
+
+ });
+})();
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
index 6399065f8..8856d1873 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
@@ -1,509 +1,509 @@
-<!--
- ============LICENSE_START=======================================================
- VID
- ================================================================================
- Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END=========================================================
- -->
-
-<div>
-
- <div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
- ng-cloak>
- <div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/deleteResumeDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/statusDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/iframeDialog.htm'"></div>
- </div>
- <div ng-controller="aaiSubscriberController" ng-init="getComponentList() ">
- <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
- <img src="app/vid/images/spinner.gif"></img>
- <label>Status:</label><span class="status">{{status}}</span>
- </div>
-
- <div class="error-msg" ng-if="errorMsg != null" style="white-space: pre-line"><font color='red'>{{errorMsg}}
- <pre>{{errorDetails | json}}</pre>
- </font></div>
-
- <h1 class="heading1" style="margin-top: 20px;">{{isPermitted ? "View/Edit" : "View"}} Service Instance</h1>
- <a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();"><span
- class="glyphicon glyphicon-refresh"></span></a>
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- data-tests-id="show-new-screen" ng-if="allowTransferToNewScreenAndShowButton()"
- ng-click="navigateToNewEditViewScreen()" style="margin-right: 8px;">More actions</a>
- <br>
-
- <center>
- <table att-table border="1" ng-model="service">
- <tr>
- <th style="text-align: center" width="33%">SUBSCRIBER:
- {{service.instance.subscriberName}}
- </th>
- <th style="text-align: center" width="34%">SERVICE TYPE:
- {{service.instance.serviceType}}
- </th>
- <th data-tests-id="service-instanceId-th-id" style="text-align: center" width="33%">SERVICE INSTANCE
- ID: {{service.instance.serviceInstanceId}}
- </th>
- <tr>
- <tr>
- <td colspan='3' style="text-align: center">Service Instance
- Name: {{service.instance.name || "Not defined"}}
- </td>
- <tr>
- </table>
-
- </center>
-
- <div ui-tree data-drag-enabled="false" data-nodrop-enabled="true" style="margin: 30px">
-
- <ol ui-tree-nodes="" ng-model="service">
- <li ng-repeat="aService in [service]" ui-tree-node>
-
- <div ng-if="isCR && collectionResource != null">
- <div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs" data-nodrag ng-click="this.toggle()">
- <span class="glyphicon"
- ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- SERVICE INSTANCE: {{aService.instance.name}} | ORCH STATUS: {{serviceOrchestrationStatus}}
- <a ng-if="isPermitted" data-tests-id="deleteServiceButton"
- class="pull-right btn btn-danger btn-xs" data-nodrag
- ng-click="deleteService(aService.instance);">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
-
- <a class="pull-right btn btn-primary btn-xs" data-tests-id="infoServiceButton" data-nodrag
- ng-click="describeService(aService.instance)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign service-info"></span>
- </a>
- </div>
- <ol ui-tree-nodes="" ng-model="collections" ng-class="{hidden: collapsed}">
- <li ng-repeat="collection in collections" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content" data-tests-id="collectionDiv">
- <a class="btn btn-success btn-xs" data-nodrag ng-click="this.toggle()">
- <span class="glyphicon"
- ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- COLLECTION: {{collection["collection-name"]}} | TYPE:
- {{collection["collection-type"]}}
- </div>
- <ol ui-tree-nodes="" ng-model="networks" ng-class="{hidden: collapsed}">
- <li ng-repeat="network in networks" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content"
- data-tests-id="collectionNetworkDiv">
- NETWORK INSTANCE GROUP: {{network["network-id"]}} | ROLE:
- {{network["network-role"]}} | TYPE: {{network["network-type"]}} | # OF
- NETWORKS: {{collectionResource.networks.length}}
- </div>
- </li>
- </ol>
- </li>
- </ol>
- </div>
- <div ng-if="!isCR">
- <div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs"
- ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) ||(aService.instance.pnfs && aService.instance.pnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)"
- data-nodrag ng-click="this.toggle()">
- <span class="glyphicon"
- ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- SERVICE INSTANCE: {{aService.instance.name}} | ORCH STATUS: {{serviceOrchestrationStatus}}
- <a ng-if="((isMacro()) || (isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks) && isObjectEmpty(aService.instance.pnfs))) && isPermitted"
- data-tests-id="deleteServiceButton" class="pull-right btn btn-danger btn-xs" data-nodrag
- ng-click="deleteService(aService.instance, serviceOrchestrationStatus);">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <div class="pull-right btn-group"
- ng-if="(aService.convertedModel.vnfs||aService.convertedModel.vnfs) &&(!isObjectEmpty(aService.convertedModel.pnfs)||!isObjectEmpty(aService.convertedModel.pnfs)) && !aService.convertedModel.isNewFlow && isPermitted">
- <button type="button" data-tests-id="addVNFButton"
- class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- Add node instance<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs">
- <a role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs"
- data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}"
- ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}</a>
-
- </ul>
- </div>
- <div class="pull-right btn-group"
- ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && aService.convertedModel.isNewFlow && isPermitted">
- <button type="button" data-tests-id="addVNFButton"
- class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- Add node instance<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs"
- data-tests-id="addVnfsDropdown">
- <li role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs">
- <a data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}"
- ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}
- {{vnf.nfType}} {{vnf.nfRole}} {{vnf.nfFunction}} {{vnf.nfCode}}</a>
- </li>
- </ul>
- </div>
- <!-- <div class="pull-right btn-group" ng-if="aService.model.networks && !equals(aService.model.networks, {})">-->
- <div class="pull-right btn-group"
- ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks))) && isPermitted">
- <!--<div class="pull-right btn-group" ng-if="aService.model.networks">-->
- <button type="button" data-tests-id="addNetworkButton"
- class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- Add Network<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="aService.convertedModel.networks">
- <li ng-repeat="(networkUuid, network) in aService.convertedModel.networks">
- <a data-tests-id="addNetworkOption-{{network.modelCustomizationName}}"
- ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
- </li>
- </ul>
- </div>
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="describeService(aService.instance)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign service-info"></span>
- </a>
- <a data-tests-id="deactivateButton" ng-disabled="!isActivateDeactivateEnabled('deactivate')"
- class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="deactivateMSOInstance()"
- style="margin-right: 8px;">
- Deactivate
- </a>
- <a ng-if="!isActivateFabricConfiguration()" data-tests-id="activateButton" ng-disabled="!isActivateDeactivateEnabled('activate')"
- class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateMSOInstance()"
- style="margin-right: 8px;">
- Activate
- </a>
- <a ng-if="isActivateFabricConfiguration()" data-tests-id="activateFabricConfigurationButton" ng-disabled="!allConfigurationsAssigned"
- class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateFabricConfigurationMSO()"
- style="margin-right: 8px;">
- Activate Fabric Configuration
- </a>
- <a data-tests-id="showAssignmentsButton" ng-if="isShowAssignmentsEnabled()"
- class="pull-right btn btn-primary btn-xs" data-nodrag style="margin-right: 8px;"
- target="_blank" ng-href="{{showAssignmentsSDNC()}}">
- Show Assignments
- </a>
- <a data-tests-id="verifyServiceButton" ng-if="isShowVerifyService()" ng-disabled="!isEnableVerifyService()"
- class="pull-right btn btn-primary btn-xs" data-nodrag style="margin-right: 8px;"
- target="_blank" ng-click="activateVerifyService()">
- Verify Service
- </a>
- </div>
- <ol ui-tree-nodes="" ng-model="aService.instance.vnfs" ng-class="{hidden: collapsed}">
- <li ng-repeat="vnf in aService.instance.vnfs" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs"
- ng-if="(vnf.vfModules && vnf.vfModules.length > 0) || (vnf.volumeGroups && vnf.volumeGroups.length > 0)"
- data-nodrag ng-click="this.toggle()">
- <span class="glyphicon"
- ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- VNF: {{vnf.name}} | TYPE: {{vnf.nodeType}} | ORCH STATUS: {{vnf.nodeStatus}}
-
- <a ng-if="(vnf.vfModules.length == 0) && (vnf.volumeGroups.length == 0) && isPermitted"
- data-tests-id="deleteVNFButton" class="pull-right btn btn-danger btn-xs"
- data-nodrag ng-click="deleteVnf(aService.instance, vnf)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <!-- <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs[vnf.object['model-invariant-id']][vnf.object['model-version-id']].vfModules">-->
- <div class="pull-right btn-group"
- ng-if="(hasVfModules(vnf.object) && (aService.convertedModel.isNewFlow)) && isPermitted">
-
- <button type="button" data-tests-id="addVFModuleButton"
- class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- Add VF-Module<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vfModule">
- <a ng-repeat="(vfModuleCustomizationUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].vfModules"
- data-tests-id="addVFModuleOption-{{vfModule.modelCustomizationName}}"
- ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}} </a>
- </ul>
- </div>
-
-
- <div class="pull-right btn-group"
- ng-if="(hasVfModules(vnf.object) && (!(aService.convertedModel.isNewFlow))) && isPermitted">
-
- <button type="button" data-tests-id="addVFModuleButton"
- class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- Add VF-Module<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vnf">
- <a ng-repeat="(vfModuleUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-version-id']].vfModules"
- data-tests-id="addVFModuleOption-{{vfModule.modelCustomizationName}}"
- ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}}</a>
- </li>
- </ul>
-
- </div>
-
- <div class="pull-right btn-group"
- ng-if="(hasVolumeGroups(vnf.object) && (aService.convertedModel.isNewFlow)) && isPermitted">
- <button type="button" data-tests-id="addVolumeGroupButton"
- class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- Add Volume Group<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="volumeGroup">
- <a ng-repeat="(volumeGroupCustomizationUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].volumeGroups"
- data-tests-id="addVolumeGroupOption-{{volumeGroup.modelCustomizationName}}"
- ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
- </ul>
- </div>
-
- <div class="pull-right btn-group"
- ng-if="(hasVolumeGroups(vnf.object) && (!(aService.convertedModel.isNewFlow))) && isPermitted">
-
- <button type="button" data-tests-id="addVolumeGroupButton"
- class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- Add Volume Group<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vnf">
- <a ng-repeat="(volumeGroupUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-version-id']].volumeGroups"
- data-tests-id="addVolumeGroupOption-{{volumeGroup.modelCustomizationName}}"
- ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
- </li>
- </ul>
-
- </div>
-
- <!-- VID-374/378 - switching-off feature <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="getStatusOfVnf(aService.instance, vnf)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-exclamation-sign"></span>
- </a> -->
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="describeVnf(aService.instance, vnf)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign vnf-info"></span>
- </a>
- </div>
- <ol ui-tree-nodes="" ng-model="vnf.instanceGroups" ng-class="{hidden: collapsed}">
- <li ng-repeat="instanceGroup in vnf.instanceGroups" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content"
- ng-class="'instanceGroupTreeNode'">
- INSTANCE-GROUP: {{instanceGroup.name}} | TYPE: Instance-Group
- </div>
-
- </li>
- </ol>
-
- <ol ui-tree-nodes="" ng-model="vnf.vfModules" ng-class="{hidden: collapsed}">
- <li ng-repeat="vfModule in vnf.vfModules" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content"
- ng-class="'vfModuleTreeNode-' + vfModule.nodeStatus.toLowerCase()">
- <a class="btn btn-success btn-xs"
- ng-if="(vfModule.volumeGroups && vfModule.volumeGroups.length > 0)"
- data-nodrag ng-click="this.toggle()">
- <span class="glyphicon"
- ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- VFMODULE: {{vfModule.name}} | TYPE: {{vfModule.nodeType}} | ORCH STATUS:
- {{vfModule.nodeStatus}}
- <!-- -->
- <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted"
- data-tests-id="deleteVFModuleButton-{{vfModule.name}}" data-nodrag
- ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <div class="pull-right btn-group">
- <!-- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Attach Volume Group<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vnf.volumeGroups">
- <li ng-repeat="volumeGroup in vnf.availableVolumeGroups">
- <a ng-click="attachVolumeGroupInstance(vfModule, volumeGroup)">{{volumeGroup.name}}</a>
- </li>
- </ul> -->
- </div>
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="describeVfModule(aService.instance, vfModule, vnf)"
- style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign vfmodule-info"></span>
- </a>
- <div class="resume"
- ng-if="isPermitted && isResumeShown(vfModule.nodeStatus)">
- <a data-tests-id="resumeVFModuleButton-{{vfModule.name}}"
- class="pull-right btn btn-success btn-xs button-margin"
- ng-click="resume(aService.instance, vfModule, vnf)">
- Resume
- </a>
- </div>
-
- </div>
- <ol ui-tree-nodes="" ng-model="vfModule.volumeGroups"
- ng-class="{hidden: collapsed}">
- <li ng-repeat="volumeGroup in vfModule.volumeGroups" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}}
- | ORCH STATUS: {{volumeGroup.nodeStatus}}
- <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVolumeGroup(aService.instance, vnf, vfModule, volumeGroup)">
- <span class="glyphicon glyphicon-remove"></span>
- </a> -->
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)"
- style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign"></span>
- </a>
- </div>
- </li>
- </ol>
- </li>
- </ol>
- <ol ui-tree-nodes="" ng-model="vnf.availableVolumeGroups"
- ng-class="{hidden: collapsed}">
- <li ng-repeat="volumeGroup in vnf.availableVolumeGroups" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}} | ORCH
- STATUS: {{volumeGroup.nodeStatus}}
- <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted"
- data-tests-id="deleteVNFVolumeGroupButton" data-nodrag
- ng-click="deleteVnfVolumeGroup(aService.instance, vnf, volumeGroup)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)"
- style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign volume-group-info"></span>
- </a>
- </div>
- </li>
- </ol>
-
- <ol ui-tree-nodes="" ng-model="vnf.networks"
- ng-class="{hidden: collapsed}">
- <li ng-repeat="network in vnf.networks" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- NETWORK: {{network.name}} | TYPE: {{network.nodeType}} | ORCH
- STATUS: {{network.nodeStatus}}
- </div>
- <ol ui-tree-nodes="" ng-model="network.vlans" ng-class="{hidden: collapsed}">
- <li ng-repeat="vlan in network.vlans" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content"
- ng-class="'vlansTreeNode'">
- VLAN: {{vlan.vlanIdOuter}} | TYPE: VLAN
- </div>
-
- </li>
- </ol>
- </li>
- </ol>
- </li>
- </ol>
-
- <ol ui-tree-nodes="" ng-model="aService.instance.networks" ng-class="{hidden: collapsed}">
- <li ng-repeat="network in aService.instance.networks" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- NETWORK: {{network.name}} | TYPE: {{network.nodeType}} | ORCH STATUS:
- {{network.nodeStatus}}
-
- <a class="pull-right btn btn-danger btn-xs" ng-if="!isMacro() && isPermitted"
- data-tests-id="deleteNetworkButton" data-nodrag
- ng-click="deleteNetwork(aService.instance, network)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteNetwork(aService.instance, network)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>-->
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="describeNetwork(aService.instance, network)"
- style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign network-info"></span>
- </a>
- </div>
-
- <ol ui-tree-nodes="" ng-model="network.vlans" ng-class="{hidden: collapsed}">
- <li ng-repeat="vlan in network.vlans" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content"
- ng-class="'vlansTreeNode'">
- VLAN: {{vlan.vlanIdOuter}} | TYPE: VLAN
- </div>
-
- </li>
- </ol>
- </li>
- </ol>
-
- <ol ui-tree-nodes="" ng-model="aService.instance.configurations" ng-class="{hidden: collapsed}">
- <li ng-repeat="configuration in aService.instance.configurations" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs"
- ng-if="(configuration.ports && configuration.ports.length > 0)" data-nodrag
- ng-click="this.toggle()">
- <span class="glyphicon"
- ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- CONFIGURATION: {{configuration.name}} | TYPE: {{configuration.nodeType}} | ORCH
- STATUS: {{configuration.nodeStatus}}
-
- <a class="pull-right btn btn-danger btn-xs"
- ng-if="!isMacro() && isPermitted && configuration.nodeStatus !== STATUS_CONSTANTS.AAI_ACTIVE"
- ng-disabled="!isConfigurationDataAvailiable(configuration)"
- data-tests-id="deleteConfigurationButton-{{configuration.name}}"
- data-nodrag
- ng-click="deleteConfiguration(aService, configuration)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
-
-
- <a class="pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="toggleConfigurationStatus(aService, configuration)"
- ng-if="isPermitted && allowConfigurationActions(configuration)"
- ng-disabled="!isConfigurationDataAvailiable(configuration)"
- data-tests-id="activateDeactivateButton-{{configuration.name}}">
- {{configuration.nodeStatus === STATUS_CONSTANTS.AAI_ACTIVE ? "Deactivate" :
- "Activate"}}
- </a>
- </div>
- <ol ui-tree-nodes="" ng-model="configuration.ports" ng-class="{hidden: collapsed}">
- <li ng-repeat="port in configuration.ports" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- PORT: {{port.portName}} | ORCH STATUS: {{port.portStatus}}
-
- <button type="button" data-tests-id="enableDisableButton-{{configuration.name}}-{{port.portName}}"
- class="pull-right btn btn-primary btn-xs"
- ng-if="configuration.nodeStatus == STATUS_CONSTANTS.AAI_ACTIVE"
- ng-disabled="!isConfigurationDataAvailiable(configuration)"
- ng-click="togglePortStatus(aService, configuration, port)">
- {{port.portStatus === STATUS_CONSTANTS.AAI_ENABLED ? "Disable" :
- "Enable"}}
- </button>
- </div>
- </li>
- </ol>
- </li>
- </ol>
-
- <ol id="pnfs-tree" ui-tree-nodes="" ng-model="pnfs"
- ng-class="{hidden: collapsed || pnf.length === 0}">
- <li ng-repeat="pnf in pnfs" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- PNF: {{pnf}}
- <a ng-if="isMacro()===false" class="dissociate-pnf pull-right btn btn-primary btn-xs" data-nodrag
- ng-click="dissociatePnf(pnf)" style="margin-right: 8px;">
- <span>Dissociate</span>
- </a>
- </div>
- </li>
- </ol>
- </div>
- </li>
- </ol>
- </div>
- </div>
-</div>
+<!--
+ ============LICENSE_START=======================================================
+ VID
+ ================================================================================
+ Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+
+<div>
+
+ <div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
+ ng-cloak>
+ <div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/deleteResumeDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/statusDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/iframeDialog.htm'"></div>
+ </div>
+ <div ng-controller="aaiSubscriberController" ng-init="getComponentList() ">
+ <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
+ <img src="app/vid/images/spinner.gif"></img>
+ <label>Status:</label><span class="status">{{status}}</span>
+ </div>
+
+ <div class="error-msg" ng-if="errorMsg != null" style="white-space: pre-line"><font color='red'>{{errorMsg}}
+ <pre>{{errorDetails | json}}</pre>
+ </font></div>
+
+ <h1 class="heading1" style="margin-top: 20px;">{{isPermitted ? "View/Edit" : "View"}} Service Instance</h1>
+ <a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();"><span
+ class="glyphicon glyphicon-refresh"></span></a>
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ data-tests-id="show-new-screen" ng-if="allowTransferToNewScreenAndShowButton(isPermitted)"
+ ng-click="navigateToNewEditViewScreen()" style="margin-right: 8px;">More actions</a>
+ <br>
+
+ <center>
+ <table att-table border="1" ng-model="service">
+ <tr>
+ <th style="text-align: center" width="33%">SUBSCRIBER:
+ {{service.instance.subscriberName}}
+ </th>
+ <th style="text-align: center" width="34%">SERVICE TYPE:
+ {{service.instance.serviceType}}
+ </th>
+ <th data-tests-id="service-instanceId-th-id" style="text-align: center" width="33%">SERVICE INSTANCE
+ ID: {{service.instance.serviceInstanceId}}
+ </th>
+ <tr>
+ <tr>
+ <td colspan='3' style="text-align: center">Service Instance
+ Name: {{service.instance.name || "Not defined"}}
+ </td>
+ <tr>
+ </table>
+
+ </center>
+
+ <div ui-tree data-drag-enabled="false" data-nodrop-enabled="true" style="margin: 30px">
+
+ <ol ui-tree-nodes="" ng-model="service">
+ <li ng-repeat="aService in [service]" ui-tree-node>
+
+ <div ng-if="isCR && collectionResource != null">
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs" data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon"
+ ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ SERVICE INSTANCE: {{aService.instance.name}} | ORCH STATUS: {{serviceOrchestrationStatus}}
+ <a ng-if="isPermitted" data-tests-id="deleteServiceButton"
+ class="pull-right btn btn-danger btn-xs" data-nodrag
+ ng-click="deleteService(aService.instance);">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+
+ <a class="pull-right btn btn-primary btn-xs" data-tests-id="infoServiceButton" data-nodrag
+ ng-click="describeService(aService.instance)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign service-info"></span>
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="collections" ng-class="{hidden: collapsed}">
+ <li ng-repeat="collection in collections" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content" data-tests-id="collectionDiv">
+ <a class="btn btn-success btn-xs" data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon"
+ ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ COLLECTION: {{collection["collection-name"]}} | TYPE:
+ {{collection["collection-type"]}}
+ </div>
+ <ol ui-tree-nodes="" ng-model="networks" ng-class="{hidden: collapsed}">
+ <li ng-repeat="network in networks" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content"
+ data-tests-id="collectionNetworkDiv">
+ NETWORK INSTANCE GROUP: {{network["network-id"]}} | ROLE:
+ {{network["network-role"]}} | TYPE: {{network["network-type"]}} | # OF
+ NETWORKS: {{collectionResource.networks.length}}
+ </div>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ </div>
+ <div ng-if="!isCR">
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs"
+ ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) ||(aService.instance.pnfs && aService.instance.pnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)"
+ data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon"
+ ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ SERVICE INSTANCE: {{aService.instance.name}} | ORCH STATUS: {{serviceOrchestrationStatus}}
+ <a ng-if="((isMacro()) || (isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks) && isObjectEmpty(aService.instance.pnfs))) && isPermitted"
+ data-tests-id="deleteServiceButton" class="pull-right btn btn-danger btn-xs" data-nodrag
+ ng-click="deleteService(aService.instance, serviceOrchestrationStatus);">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <div class="pull-right btn-group"
+ ng-if="(aService.convertedModel.vnfs||aService.convertedModel.vnfs) &&(!isObjectEmpty(aService.convertedModel.pnfs)||!isObjectEmpty(aService.convertedModel.pnfs)) && !aService.convertedModel.isNewFlow && isPermitted">
+ <button type="button" data-tests-id="addVNFButton"
+ class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ Add node instance<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs">
+ <a role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs"
+ data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}"
+ ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}</a>
+
+ </ul>
+ </div>
+ <div class="pull-right btn-group"
+ ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && aService.convertedModel.isNewFlow && isPermitted">
+ <button type="button" data-tests-id="addVNFButton"
+ class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ Add node instance<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs"
+ data-tests-id="addVnfsDropdown">
+ <li role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs">
+ <a data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}"
+ ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}
+ {{vnf.nfType}} {{vnf.nfRole}} {{vnf.nfFunction}} {{vnf.nfCode}}</a>
+ </li>
+ </ul>
+ </div>
+ <!-- <div class="pull-right btn-group" ng-if="aService.model.networks && !equals(aService.model.networks, {})">-->
+ <div class="pull-right btn-group"
+ ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks))) && isPermitted">
+ <!--<div class="pull-right btn-group" ng-if="aService.model.networks">-->
+ <button type="button" data-tests-id="addNetworkButton"
+ class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ Add Network<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="aService.convertedModel.networks">
+ <li ng-repeat="(networkUuid, network) in aService.convertedModel.networks">
+ <a data-tests-id="addNetworkOption-{{network.modelCustomizationName}}"
+ ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
+ </li>
+ </ul>
+ </div>
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="describeService(aService.instance)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign service-info"></span>
+ </a>
+ <a data-tests-id="deactivateButton" ng-disabled="!isActivateDeactivateEnabled('deactivate')"
+ class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="deactivateMSOInstance()"
+ style="margin-right: 8px;">
+ Deactivate
+ </a>
+ <a ng-if="!isActivateFabricConfiguration()" data-tests-id="activateButton" ng-disabled="!isActivateDeactivateEnabled('activate')"
+ class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateMSOInstance()"
+ style="margin-right: 8px;">
+ Activate
+ </a>
+ <a ng-if="isActivateFabricConfiguration()" data-tests-id="activateFabricConfigurationButton" ng-disabled="!allConfigurationsAssigned"
+ class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateFabricConfigurationMSO()"
+ style="margin-right: 8px;">
+ Activate Fabric Configuration
+ </a>
+ <a data-tests-id="showAssignmentsButton" ng-if="isShowAssignmentsEnabled()"
+ class="pull-right btn btn-primary btn-xs" data-nodrag style="margin-right: 8px;"
+ target="_blank" ng-href="{{showAssignmentsSDNC()}}">
+ Show Assignments
+ </a>
+ <a data-tests-id="verifyServiceButton" ng-if="isShowVerifyService()" ng-disabled="!isEnableVerifyService()"
+ class="pull-right btn btn-primary btn-xs" data-nodrag style="margin-right: 8px;"
+ target="_blank" ng-click="activateVerifyService()">
+ Verify Service
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="aService.instance.vnfs" ng-class="{hidden: collapsed}">
+ <li ng-repeat="vnf in aService.instance.vnfs" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs"
+ ng-if="(vnf.vfModules && vnf.vfModules.length > 0) || (vnf.volumeGroups && vnf.volumeGroups.length > 0)"
+ data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon"
+ ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ VNF: {{vnf.name}} | TYPE: {{vnf.nodeType}} | ORCH STATUS: {{vnf.nodeStatus}}
+
+ <a ng-if="(vnf.vfModules.length == 0) && (vnf.volumeGroups.length == 0) && isPermitted"
+ data-tests-id="deleteVNFButton" class="pull-right btn btn-danger btn-xs"
+ data-nodrag ng-click="deleteVnf(aService.instance, vnf)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <!-- <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs[vnf.object['model-invariant-id']][vnf.object['model-version-id']].vfModules">-->
+ <div class="pull-right btn-group"
+ ng-if="(hasVfModules(vnf.object) && (aService.convertedModel.isNewFlow)) && isPermitted">
+
+ <button type="button" data-tests-id="addVFModuleButton"
+ class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ Add VF-Module<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vfModule">
+ <a ng-repeat="(vfModuleCustomizationUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].vfModules"
+ data-tests-id="addVFModuleOption-{{vfModule.modelCustomizationName}}"
+ ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}} </a>
+ </ul>
+ </div>
+
+
+ <div class="pull-right btn-group"
+ ng-if="(hasVfModules(vnf.object) && (!(aService.convertedModel.isNewFlow))) && isPermitted">
+
+ <button type="button" data-tests-id="addVFModuleButton"
+ class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ Add VF-Module<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vnf">
+ <a ng-repeat="(vfModuleUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-version-id']].vfModules"
+ data-tests-id="addVFModuleOption-{{vfModule.modelCustomizationName}}"
+ ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}}</a>
+ </li>
+ </ul>
+
+ </div>
+
+ <div class="pull-right btn-group"
+ ng-if="(hasVolumeGroups(vnf.object) && (aService.convertedModel.isNewFlow)) && isPermitted">
+ <button type="button" data-tests-id="addVolumeGroupButton"
+ class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ Add Volume Group<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="volumeGroup">
+ <a ng-repeat="(volumeGroupCustomizationUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].volumeGroups"
+ data-tests-id="addVolumeGroupOption-{{volumeGroup.modelCustomizationName}}"
+ ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
+ </ul>
+ </div>
+
+ <div class="pull-right btn-group"
+ ng-if="(hasVolumeGroups(vnf.object) && (!(aService.convertedModel.isNewFlow))) && isPermitted">
+
+ <button type="button" data-tests-id="addVolumeGroupButton"
+ class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ Add Volume Group<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vnf">
+ <a ng-repeat="(volumeGroupUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-version-id']].volumeGroups"
+ data-tests-id="addVolumeGroupOption-{{volumeGroup.modelCustomizationName}}"
+ ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
+ </li>
+ </ul>
+
+ </div>
+
+ <!-- VID-374/378 - switching-off feature <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="getStatusOfVnf(aService.instance, vnf)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-exclamation-sign"></span>
+ </a> -->
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="describeVnf(aService.instance, vnf)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign vnf-info"></span>
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="vnf.instanceGroups" ng-class="{hidden: collapsed}">
+ <li ng-repeat="instanceGroup in vnf.instanceGroups" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content"
+ ng-class="'instanceGroupTreeNode'">
+ INSTANCE-GROUP: {{instanceGroup.name}} | TYPE: Instance-Group
+ </div>
+
+ </li>
+ </ol>
+
+ <ol ui-tree-nodes="" ng-model="vnf.vfModules" ng-class="{hidden: collapsed}">
+ <li ng-repeat="vfModule in vnf.vfModules" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content"
+ ng-class="'vfModuleTreeNode-' + vfModule.nodeStatus.toLowerCase()">
+ <a class="btn btn-success btn-xs"
+ ng-if="(vfModule.volumeGroups && vfModule.volumeGroups.length > 0)"
+ data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon"
+ ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ VFMODULE: {{vfModule.name}} | TYPE: {{vfModule.nodeType}} | ORCH STATUS:
+ {{vfModule.nodeStatus}}
+ <!-- -->
+ <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted"
+ data-tests-id="deleteVFModuleButton-{{vfModule.name}}" data-nodrag
+ ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <div class="pull-right btn-group">
+ <!-- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Attach Volume Group<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vnf.volumeGroups">
+ <li ng-repeat="volumeGroup in vnf.availableVolumeGroups">
+ <a ng-click="attachVolumeGroupInstance(vfModule, volumeGroup)">{{volumeGroup.name}}</a>
+ </li>
+ </ul> -->
+ </div>
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="describeVfModule(aService.instance, vfModule, vnf)"
+ style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign vfmodule-info"></span>
+ </a>
+ <div class="resume"
+ ng-if="isPermitted && isResumeShown(vfModule.nodeStatus)">
+ <a data-tests-id="resumeVFModuleButton-{{vfModule.name}}"
+ class="pull-right btn btn-success btn-xs button-margin"
+ ng-click="resume(aService.instance, vfModule, vnf)">
+ Resume
+ </a>
+ </div>
+
+ </div>
+ <ol ui-tree-nodes="" ng-model="vfModule.volumeGroups"
+ ng-class="{hidden: collapsed}">
+ <li ng-repeat="volumeGroup in vfModule.volumeGroups" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}}
+ | ORCH STATUS: {{volumeGroup.nodeStatus}}
+ <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVolumeGroup(aService.instance, vnf, vfModule, volumeGroup)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a> -->
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)"
+ style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign"></span>
+ </a>
+ </div>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ <ol ui-tree-nodes="" ng-model="vnf.availableVolumeGroups"
+ ng-class="{hidden: collapsed}">
+ <li ng-repeat="volumeGroup in vnf.availableVolumeGroups" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}} | ORCH
+ STATUS: {{volumeGroup.nodeStatus}}
+ <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted"
+ data-tests-id="deleteVNFVolumeGroupButton" data-nodrag
+ ng-click="deleteVnfVolumeGroup(aService.instance, vnf, volumeGroup)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)"
+ style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign volume-group-info"></span>
+ </a>
+ </div>
+ </li>
+ </ol>
+
+ <ol ui-tree-nodes="" ng-model="vnf.networks"
+ ng-class="{hidden: collapsed}">
+ <li ng-repeat="network in vnf.networks" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ NETWORK: {{network.name}} | TYPE: {{network.nodeType}} | ORCH
+ STATUS: {{network.nodeStatus}}
+ </div>
+ <ol ui-tree-nodes="" ng-model="network.vlans" ng-class="{hidden: collapsed}">
+ <li ng-repeat="vlan in network.vlans" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content"
+ ng-class="'vlansTreeNode'">
+ VLAN: {{vlan.vlanIdOuter}} | TYPE: VLAN
+ </div>
+
+ </li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ </ol>
+
+ <ol ui-tree-nodes="" ng-model="aService.instance.networks" ng-class="{hidden: collapsed}">
+ <li ng-repeat="network in aService.instance.networks" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ NETWORK: {{network.name}} | TYPE: {{network.nodeType}} | ORCH STATUS:
+ {{network.nodeStatus}}
+
+ <a class="pull-right btn btn-danger btn-xs" ng-if="!isMacro() && isPermitted"
+ data-tests-id="deleteNetworkButton" data-nodrag
+ ng-click="deleteNetwork(aService.instance, network)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteNetwork(aService.instance, network)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>-->
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="describeNetwork(aService.instance, network)"
+ style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign network-info"></span>
+ </a>
+ </div>
+
+ <ol ui-tree-nodes="" ng-model="network.vlans" ng-class="{hidden: collapsed}">
+ <li ng-repeat="vlan in network.vlans" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content"
+ ng-class="'vlansTreeNode'">
+ VLAN: {{vlan.vlanIdOuter}} | TYPE: VLAN
+ </div>
+
+ </li>
+ </ol>
+ </li>
+ </ol>
+
+ <ol ui-tree-nodes="" ng-model="aService.instance.configurations" ng-class="{hidden: collapsed}">
+ <li ng-repeat="configuration in aService.instance.configurations" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs"
+ ng-if="(configuration.ports && configuration.ports.length > 0)" data-nodrag
+ ng-click="this.toggle()">
+ <span class="glyphicon"
+ ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ CONFIGURATION: {{configuration.name}} | TYPE: {{configuration.nodeType}} | ORCH
+ STATUS: {{configuration.nodeStatus}}
+
+ <a class="pull-right btn btn-danger btn-xs"
+ ng-if="!isMacro() && isPermitted && configuration.nodeStatus !== STATUS_CONSTANTS.AAI_ACTIVE"
+ ng-disabled="!isConfigurationDataAvailiable(configuration)"
+ data-tests-id="deleteConfigurationButton-{{configuration.name}}"
+ data-nodrag
+ ng-click="deleteConfiguration(aService, configuration)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+
+
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="toggleConfigurationStatus(aService, configuration)"
+ ng-if="isPermitted && allowConfigurationActions(configuration)"
+ ng-disabled="!isConfigurationDataAvailiable(configuration)"
+ data-tests-id="activateDeactivateButton-{{configuration.name}}">
+ {{configuration.nodeStatus === STATUS_CONSTANTS.AAI_ACTIVE ? "Deactivate" :
+ "Activate"}}
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="configuration.ports" ng-class="{hidden: collapsed}">
+ <li ng-repeat="port in configuration.ports" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ PORT: {{port.portName}} | ORCH STATUS: {{port.portStatus}}
+
+ <button type="button" data-tests-id="enableDisableButton-{{configuration.name}}-{{port.portName}}"
+ class="pull-right btn btn-primary btn-xs"
+ ng-if="configuration.nodeStatus == STATUS_CONSTANTS.AAI_ACTIVE"
+ ng-disabled="!isConfigurationDataAvailiable(configuration)"
+ ng-click="togglePortStatus(aService, configuration, port)">
+ {{port.portStatus === STATUS_CONSTANTS.AAI_ENABLED ? "Disable" :
+ "Enable"}}
+ </button>
+ </div>
+ </li>
+ </ol>
+ </li>
+ </ol>
+
+ <ol id="pnfs-tree" ui-tree-nodes="" ng-model="pnfs"
+ ng-class="{hidden: collapsed || pnf.length === 0}">
+ <li ng-repeat="pnf in pnfs" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ PNF: {{pnf}}
+ <a ng-if="isMacro()===false" class="dissociate-pnf pull-right btn btn-primary btn-xs" data-nodrag
+ ng-click="dissociatePnf(pnf)" style="margin-right: 8px;">
+ <span>Dissociate</span>
+ </a>
+ </div>
+ </li>
+ </ol>
+ </div>
+ </li>
+ </ol>
+ </div>
+ </div>
+</div>
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
index 04c1c55ef..2e6e800de 100644
--- a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
@@ -93,7 +93,7 @@ describe('View Edit Page: Upgrade VFModule', function () {
it(`should display the more actions button if user is permitted`, function () {
let SERVICE_INSTANCE_ID="3f93c7cb-2fd0-4557-9514-e189b7b04f9d";
let SERVICE_TYPE="TYLER%20SILVIA";
- cy.visit(`/serviceModels.htm#/instantiate?subscriberId=${SUBSCRIBER_ID}&subscriberName=SILVIA%20ROBBINS&serviceType=${SERVICE_TYPE}&serviceInstanceId=${SERVICE_INSTANCE_ID}&aaiModelVersionId=${serviceUuid}&isPermitted=true`);
+ cy.visit(`/serviceModels.htm#/instantiate?subscriberId=${SUBSCRIBER_ID}&subscriberName=SILVIA%20ROBBINS&serviceType=${SERVICE_TYPE}&serviceInstanceId=${SERVICE_INSTANCE_ID}&aaiModelVersionId=${serviceUuid}`);
cy.get("[data-tests-id='service-instanceId-th-id']").should('contain', SERVICE_INSTANCE_ID);
cy.getElementByDataTestsId("show-new-screen").should('be.visible').should('have.text', 'More actions').click();