2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
23 appDS2.requires.push('ngRoute');
\r
24 appDS2.requires.push('ui.tree');
\r
26 appDS2.config(function($routeProvider) {
\r
28 .when("/subviewedit", {
\r
29 templateUrl : "app/vid/scripts/view-models/aaiSubViewEdit.htm",
\r
30 controller : "aaiSubscriberSearchController"
\r
33 .when("/subdetails", {
\r
34 templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm",
\r
35 controller : "aaiSubscriberController"
\r
39 templateUrl : "app/vid/scripts/view-models/aaiGetSubs.htm",
\r
40 controller : "aaiSubscriberSearchController"
\r
44 appDS2.config(function(treeConfig) {
\r
45 treeConfig.defaultCollapsed = true; // collapse nodes by default
\r
48 appDS2.factory("user",function(){
\r
52 appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log", "UtilityService", "user", "PropertyService", "COMPONENT", "FIELD",
\r
53 function($scope, $timeout, $log, UtilityService, user, PropertyService, COMPONENT, FIELD) {
\r
55 $scope.baseUrl = "";
\r
56 $scope.responseTimeoutMsec = 10000;
\r
57 $scope.msoMaxPollingIntervalMsec = 1000;
\r
58 $scope.msoMaxPolls = 7;
\r
60 $scope.init = function(properties) {
\r
61 var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
\r
62 PropertyService.setMsoMaxPollingIntervalMsec(msecs);
\r
64 var polls = PropertyService.retrieveMsoMaxPolls();
\r
65 PropertyService.setMsoMaxPolls(polls);
\r
67 PropertyService.setServerResponseTimeoutMsec(30000);
\r
69 // These two properties only added for testing
\r
70 properties.msoDefaultBaseUrl = $scope.baseUrl;
\r
71 properties.responseTimeoutMsec = $scope.responseTimeoutMsec;
\r
73 UtilityService.setProperties(properties);
\r
76 $scope.autoGetSubs = function() {
\r
78 * Optionally comment in / out one of these method calls (or add a similar
\r
79 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
81 $timeout(function() {
\r
82 $scope.getSubscribers();
\r
83 // $scope.deleteServiceInstance();
\r
84 // $scope.generateInvalidUrl405();
\r
88 $scope.autoGetSubDetails = function() {
\r
90 * Optionally comment in / out one of these method calls (or add a similar
\r
91 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
93 $timeout(function() {
\r
94 $scope.getSubDetails();
\r
95 // $scope.deleteServiceInstance();
\r
96 // $scope.generateInvalidUrl405();
\r
100 $scope.autoPopulateViewEdit = function() {
\r
102 * Optionally comment in / out one of these method calls (or add a similar
\r
103 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
105 $timeout(function() {
\r
106 $scope.getComponentList();
\r
107 // $scope.deleteServiceInstance();
\r
108 // $scope.generateInvalidUrl405();
\r
112 $scope.refreshSubs = function() {
\r
114 * Optionally comment in / out one of these method calls (or add a similar
\r
115 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
117 $timeout(function() {
\r
118 $scope.refreshSubscribers();
\r
119 // $scope.deleteServiceInstance();
\r
120 // $scope.generateInvalidUrl405();
\r
124 $scope.autoStartQueryTest = function() {
\r
126 * Optionally comment in / out one of these method calls (or add a similar
\r
127 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
129 $timeout(function() {
\r
130 // $scope.queryServiceInstance();
\r
134 $scope.queryServiceInstance = function() {
\r
136 * Example of method call needed to query a service instance.
\r
138 $scope.$broadcast(COMPONENT.QUERY_SERVICE_INSTANCE, {
\r
139 serviceInstanceId: COMPONENT.SERVICE_INSTANCE_ID_1
\r
143 $scope.getSubscribers = function() {
\r
145 * Example of method call needed to commit an instance creation request.
\r
147 $scope.$broadcast(COMPONENT.GET_SUBS, {
\r
148 url : FIELD.ID.AAI_GET_SUBSCRIBERS,
\r
149 requestDetails : createServiceRequestDetails
\r
153 $scope.getSubDetails = function() {
\r
155 * Example of method call needed to commit an instance creation request.
\r
157 $scope.$broadcast(COMPONENT.GET_SUB_DETAILS, {
\r
158 url : FIELD.ID.AAI_SUB_DETAILS,
\r
159 requestDetails : createServiceRequestDetails
\r
163 $scope.getComponentList = function() {
\r
165 * Example of method call needed to commit an instance creation request.
\r
167 $scope.$broadcast(COMPONENT.GET_COMPONENT_LIST, {
\r
168 url : FIELD.ID.AAI_SUB_VIEWEDIT,
\r
169 requestDetails : createServiceRequestDetails
\r
174 $scope.refreshSubscribers = function() {
\r
176 * Example of method call needed to commit an instance creation request.
\r
178 $scope.$broadcast(COMPONENT.GET_SUBS, {
\r
179 url : FIELD.ID.AAI_REFRESH_SUBSCRIBERS,
\r
180 requestDetails : createServiceRequestDetails
\r
184 $scope.deleteServiceInstance = function() {
\r
186 * Example of method call needed to commit an instance deletion request.
\r
188 $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
\r
189 url : COMPONENT.MSO_DELETE_SVC_INSTANCE_PATH + COMPONENT.SERVICE_INSTANCE_ID_1,
\r
190 requestDetails : deleteServiceRequestDetails
\r
194 $scope.createNetworkInstance = function() {
\r
195 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
196 url : COMPONENT.MSO_CREATE_NW_INSTANCE,
\r
197 requestDetails : createNetworkRequestDetails
\r
201 $scope.deleteNetworkInstance = function() {
\r
202 $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
\r
203 url : COMPONENT.MSO_CREATE_NW_INSTANCE_PATH + COMPONENT.SERVICE_INSTANCE_ID_1 + COMPONENT.FORWARD_SLASH + COMPONENT.NETWORKS + COMPONENT.FORWARD_SLASH + COMPONENT.DELETE_INSTANCE_ID_1,
\r
204 requestDetails : deleteNetworkRequestDetails
\r
208 $scope.generateError = function(testName) {
\r
209 // Clone example request object
\r
210 var request = JSON.parse(JSON.stringify(createServiceRequestDetails));
\r
211 request.modelInfo.modelName = testName;
\r
212 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
213 url : COMPONENT.MSO_CREATE_SVC_INSTANCE,
\r
214 requestDetails : request
\r
218 $scope.generateInvalidUrl404 = function() {
\r
219 var properties = UtilityService.getProperties(properties);
\r
220 properties.msoDefaultBaseUrl = COMPONENT.INVALID_STRING;
\r
221 UtilityService.setProperties(properties);
\r
222 $scope.$broadcast(COMPONENT.REFRESH_PROPERTIES);
\r
224 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
225 url : COMPONENT.MSO_CREATE_SVC_INSTANCE,
\r
226 requestDetails : createServiceRequestDetails
\r
229 properties.msoDefaultBaseUrl = $scope.baseUrl;
\r
230 UtilityService.setProperties(properties);
\r
231 $scope.$broadcast(COMPONENT.REFRESH_PROPERTIES);
\r
234 $scope.generateInvalidUrl405 = function() {
\r
235 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
236 url : COMPONENT.INVALID_STRING_MSO_CREATE_SVC_INSTANCE,
\r
237 requestDetails : createServiceRequestDetails
\r
242 * Test data objects:
\r
245 var subscriberInfo = {
\r
246 globalSubscriberId : COMPONENT.GLOBAL_SUBSCRIBER_ID_1,
\r
247 subscriberName : COMPONENT.SUBSCRIBER_NAME_GED12
\r
250 var createServiceRequestDetails = {
\r
252 modelType : COMPONENT.SERVICE,
\r
253 modelId : COMPONENT.MODEL_ID_1,
\r
254 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_1,
\r
255 modelName : COMPONENT.MODEL_NAME_WANBONDING,
\r
256 modelVersion : COMPONENT.MODEL_VERSION_1
\r
258 subscriberInfo : subscriberInfo,
\r
259 requestParameters : {
\r
260 vpnId : COMPONENT.VPN_ID_1,
\r
261 productName : COMPONENT.PRODUCT_NAME_TRINITY,
\r
262 customerId : COMPONENT.CUSTOMER_ID_1
\r
266 var deleteServiceRequestDetails = {
\r
268 modelType : COMPONENT.SERVICE,
\r
269 modelId : COMPONENT.MODEL_ID_1,
\r
270 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_1,
\r
271 modelName : COMPONENT.MODEL_NAME_WANBONDING,
\r
272 modelVersion : COMPONENT.MODEL_VERSION_1
\r
276 var createNetworkRequestDetails = {
\r
278 modelType : COMPONENT.NETWORK,
\r
279 modelId : COMPONENT.MODEL_ID_2,
\r
280 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_2,
\r
281 modelName : COMPONENT.MODEL_NAME_VISBCOAMNETWORK,
\r
282 modelVersion : COMPONENT.MODEL_VERSION_1
\r
284 relatedModelList : [
\r
287 instanceId : COMPONENT.INSTANCE_ID_1,
\r
289 modelType : COMPONENT.SERVICE,
\r
290 modelId : COMPONENT.MODEL_ID_3,
\r
291 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_3,
\r
292 modelName : COMPONENT.MODEL_NAME_IISBC,
\r
293 modelVersion : COMPONENT.MODEL_VERSION_1
\r
299 instanceId : COMPONENT.INSTANCE_ID_2,
\r
301 modelType : COMPONENT.VNF,
\r
302 modelId : COMPONENT.MODEL_ID_4,
\r
303 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_4,
\r
304 modelName : COMPONENT.MODEL_NAME_VISBC,
\r
305 modelVersion : COMPONENT.MODEL_VERSION_1
\r
311 instanceId : COMPONENT.INSTANCE_ID_3,
\r
313 modelType : COMPONENT.VF_MODULE,
\r
314 modelId : COMPONENT.MODEL_ID_5,
\r
315 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_5,
\r
316 modelName : COMPONENT.MODEL_NAME_VISBCRTPEXPANSIONMODULE,
\r
317 modelVersion : COMPONENT.MODEL_VERSION_1
\r
321 subscriberInfo : subscriberInfo,
\r
322 requestParameters : {
\r
324 * FYI: quotes around field names are needed due to embedded "-"
\r
327 "cidr-mask" : COMPONENT.CIDR_MASK_1,
\r
328 "gateway-address" : COMPONENT.GATEWAY_ADDRESS_1,
\r
329 "dhcp-enabled" : COMPONENT.TRUE
\r
333 var deleteNetworkRequestDetails = {
\r
335 modelType : COMPONENT.NETWORK,
\r
336 modelId : COMPONENT.MODEL_ID_2,
\r
337 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_2,
\r
338 modelName : COMPONENT.MODEL_NAME_VISBCOAMNETWORK,
\r
339 modelVersion : COMPONENT.MODEL_VERSION_1
\r
341 relatedModelList : [
\r
344 instanceId : COMPONENT.INSTANCE_ID_1,
\r
346 modelType : COMPONENT.SERVICE,
\r
347 modelId : COMPONENT.MODEL_ID_3,
\r
348 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_3,
\r
349 modelName : COMPONENT.MODEL_NAME_IISBC,
\r
350 modelVersion : COMPONENT.MODEL_VERSION_1
\r
356 instanceId : COMPONENT.INSTANCE_ID_2,
\r
358 modelType : COMPONENT.VNF,
\r
359 modelId : COMPONENT.MODEL_ID_4,
\r
360 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_4,
\r
361 modelName : COMPONENT.MODEL_NAME_VISBC,
\r
362 modelVersion : COMPONENT.MODEL_VERSION_1
\r
368 instanceId : COMPONENT.INSTANCE_ID_3,
\r
370 modelType : COMPONENT.VF_MODULE,
\r
371 modelId : COMPONENT.MODEL_ID_5,
\r
372 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_5,
\r
373 modelName : COMPONENT.MODEL_NAME_VISBCRTPEXPANSIONMODULE,
\r
374 modelVersion : COMPONENT.MODEL_VERSION_1
\r
379 $scope.getSubscriberDet = function(selectedCustomer){
\r
380 window.location.href = COMPONENT.SUBDETAILS_SELECTEDSUBSCRIBER + selectedCustomer;
\r