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 // These two properties only added for testing
\r
68 properties.msoDefaultBaseUrl = $scope.baseUrl;
\r
69 properties.responseTimeoutMsec = $scope.responseTimeoutMsec;
\r
71 UtilityService.setProperties(properties);
\r
74 $scope.autoGetSubs = function() {
\r
76 * Optionally comment in / out one of these method calls (or add a similar
\r
77 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
79 $timeout(function() {
\r
80 $scope.getSubscribers();
\r
81 // $scope.deleteServiceInstance();
\r
82 // $scope.generateInvalidUrl405();
\r
86 $scope.autoGetSubDetails = function() {
\r
88 * Optionally comment in / out one of these method calls (or add a similar
\r
89 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
91 $timeout(function() {
\r
92 $scope.getSubDetails();
\r
93 // $scope.deleteServiceInstance();
\r
94 // $scope.generateInvalidUrl405();
\r
98 $scope.autoPopulateViewEdit = function() {
\r
100 * Optionally comment in / out one of these method calls (or add a similar
\r
101 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
103 $timeout(function() {
\r
104 $scope.getComponentList();
\r
105 // $scope.deleteServiceInstance();
\r
106 // $scope.generateInvalidUrl405();
\r
110 $scope.refreshSubs = function() {
\r
112 * Optionally comment in / out one of these method calls (or add a similar
\r
113 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
115 $timeout(function() {
\r
116 $scope.refreshSubscribers();
\r
117 // $scope.deleteServiceInstance();
\r
118 // $scope.generateInvalidUrl405();
\r
122 $scope.autoStartQueryTest = function() {
\r
124 * Optionally comment in / out one of these method calls (or add a similar
\r
125 * entry) to auto-invoke an entry when the test screen is redrawn.
\r
127 $timeout(function() {
\r
128 // $scope.queryServiceInstance();
\r
132 $scope.queryServiceInstance = function() {
\r
134 * Example of method call needed to query a service instance.
\r
136 $scope.$broadcast(COMPONENT.QUERY_SERVICE_INSTANCE, {
\r
137 serviceInstanceId: COMPONENT.SERVICE_INSTANCE_ID_1
\r
141 $scope.getSubscribers = function() {
\r
143 * Example of method call needed to commit an instance creation request.
\r
145 $scope.$broadcast(COMPONENT.GET_SUBS, {
\r
146 url : FIELD.ID.AAI_GET_SUBSCRIBERS,
\r
147 requestDetails : createServiceRequestDetails
\r
151 $scope.getSubDetails = function() {
\r
153 * Example of method call needed to commit an instance creation request.
\r
155 $scope.$broadcast(COMPONENT.GET_SUB_DETAILS, {
\r
156 url : FIELD.ID.AAI_SUB_DETAILS,
\r
157 requestDetails : createServiceRequestDetails
\r
161 $scope.getComponentList = function() {
\r
163 * Example of method call needed to commit an instance creation request.
\r
165 $scope.$broadcast(COMPONENT.GET_COMPONENT_LIST, {
\r
166 url : FIELD.ID.AAI_SUB_VIEWEDIT,
\r
167 requestDetails : createServiceRequestDetails
\r
172 $scope.refreshSubscribers = function() {
\r
174 * Example of method call needed to commit an instance creation request.
\r
176 $scope.$broadcast(COMPONENT.GET_SUBS, {
\r
177 url : FIELD.ID.AAI_REFRESH_SUBSCRIBERS,
\r
178 requestDetails : createServiceRequestDetails
\r
182 $scope.deleteServiceInstance = function() {
\r
184 * Example of method call needed to commit an instance deletion request.
\r
186 $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
\r
187 url : COMPONENT.MSO_DELETE_SVC_INSTANCE_PATH + COMPONENT.SERVICE_INSTANCE_ID_1,
\r
188 requestDetails : deleteServiceRequestDetails
\r
192 $scope.createNetworkInstance = function() {
\r
193 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
194 url : COMPONENT.MSO_CREATE_NW_INSTANCE,
\r
195 requestDetails : createNetworkRequestDetails
\r
199 $scope.deleteNetworkInstance = function() {
\r
200 $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
\r
201 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
202 requestDetails : deleteNetworkRequestDetails
\r
206 $scope.generateError = function(testName) {
\r
207 // Clone example request object
\r
208 var request = JSON.parse(JSON.stringify(createServiceRequestDetails));
\r
209 request.modelInfo.modelName = testName;
\r
210 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
211 url : COMPONENT.MSO_CREATE_SVC_INSTANCE,
\r
212 requestDetails : request
\r
216 $scope.generateInvalidUrl404 = function() {
\r
217 var properties = UtilityService.getProperties(properties);
\r
218 properties.msoDefaultBaseUrl = COMPONENT.INVALID_STRING;
\r
219 UtilityService.setProperties(properties);
\r
220 $scope.$broadcast(COMPONENT.REFRESH_PROPERTIES);
\r
222 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
223 url : COMPONENT.MSO_CREATE_SVC_INSTANCE,
\r
224 requestDetails : createServiceRequestDetails
\r
227 properties.msoDefaultBaseUrl = $scope.baseUrl;
\r
228 UtilityService.setProperties(properties);
\r
229 $scope.$broadcast(COMPONENT.REFRESH_PROPERTIES);
\r
232 $scope.generateInvalidUrl405 = function() {
\r
233 $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
\r
234 url : COMPONENT.INVALID_STRING_MSO_CREATE_SVC_INSTANCE,
\r
235 requestDetails : createServiceRequestDetails
\r
240 * Test data objects:
\r
243 var subscriberInfo = {
\r
244 globalSubscriberId : COMPONENT.GLOBAL_SUBSCRIBER_ID_1,
\r
245 subscriberName : COMPONENT.SUBSCRIBER_NAME_GED12
\r
248 var createServiceRequestDetails = {
\r
250 modelType : COMPONENT.SERVICE,
\r
251 modelId : COMPONENT.MODEL_ID_1,
\r
252 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_1,
\r
253 modelName : COMPONENT.MODEL_NAME_WANBONDING,
\r
254 modelVersion : COMPONENT.MODEL_VERSION_1
\r
256 subscriberInfo : subscriberInfo,
\r
257 requestParameters : {
\r
258 vpnId : COMPONENT.VPN_ID_1,
\r
259 productName : COMPONENT.PRODUCT_NAME_TRINITY,
\r
260 customerId : COMPONENT.CUSTOMER_ID_1
\r
264 var deleteServiceRequestDetails = {
\r
266 modelType : COMPONENT.SERVICE,
\r
267 modelId : COMPONENT.MODEL_ID_1,
\r
268 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_1,
\r
269 modelName : COMPONENT.MODEL_NAME_WANBONDING,
\r
270 modelVersion : COMPONENT.MODEL_VERSION_1
\r
274 var createNetworkRequestDetails = {
\r
276 modelType : COMPONENT.NETWORK,
\r
277 modelId : COMPONENT.MODEL_ID_2,
\r
278 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_2,
\r
279 modelName : COMPONENT.MODEL_NAME_VISBCOAMNETWORK,
\r
280 modelVersion : COMPONENT.MODEL_VERSION_1
\r
282 relatedModelList : [
\r
285 instanceId : COMPONENT.INSTANCE_ID_1,
\r
287 modelType : COMPONENT.SERVICE,
\r
288 modelId : COMPONENT.MODEL_ID_3,
\r
289 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_3,
\r
290 modelName : COMPONENT.MODEL_NAME_IISBC,
\r
291 modelVersion : COMPONENT.MODEL_VERSION_1
\r
297 instanceId : COMPONENT.INSTANCE_ID_2,
\r
299 modelType : COMPONENT.VNF,
\r
300 modelId : COMPONENT.MODEL_ID_4,
\r
301 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_4,
\r
302 modelName : COMPONENT.MODEL_NAME_VISBC,
\r
303 modelVersion : COMPONENT.MODEL_VERSION_1
\r
309 instanceId : COMPONENT.INSTANCE_ID_3,
\r
311 modelType : COMPONENT.VF_MODULE,
\r
312 modelId : COMPONENT.MODEL_ID_5,
\r
313 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_5,
\r
314 modelName : COMPONENT.MODEL_NAME_VISBCRTPEXPANSIONMODULE,
\r
315 modelVersion : COMPONENT.MODEL_VERSION_1
\r
319 subscriberInfo : subscriberInfo,
\r
320 requestParameters : {
\r
322 * FYI: quotes around field names are needed due to embedded "-"
\r
325 "cidr-mask" : COMPONENT.CIDR_MASK_1,
\r
326 "gateway-address" : COMPONENT.GATEWAY_ADDRESS_1,
\r
327 "dhcp-enabled" : COMPONENT.TRUE
\r
331 var deleteNetworkRequestDetails = {
\r
333 modelType : COMPONENT.NETWORK,
\r
334 modelId : COMPONENT.MODEL_ID_2,
\r
335 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_2,
\r
336 modelName : COMPONENT.MODEL_NAME_VISBCOAMNETWORK,
\r
337 modelVersion : COMPONENT.MODEL_VERSION_1
\r
339 relatedModelList : [
\r
342 instanceId : COMPONENT.INSTANCE_ID_1,
\r
344 modelType : COMPONENT.SERVICE,
\r
345 modelId : COMPONENT.MODEL_ID_3,
\r
346 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_3,
\r
347 modelName : COMPONENT.MODEL_NAME_IISBC,
\r
348 modelVersion : COMPONENT.MODEL_VERSION_1
\r
354 instanceId : COMPONENT.INSTANCE_ID_2,
\r
356 modelType : COMPONENT.VNF,
\r
357 modelId : COMPONENT.MODEL_ID_4,
\r
358 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_4,
\r
359 modelName : COMPONENT.MODEL_NAME_VISBC,
\r
360 modelVersion : COMPONENT.MODEL_VERSION_1
\r
366 instanceId : COMPONENT.INSTANCE_ID_3,
\r
368 modelType : COMPONENT.VF_MODULE,
\r
369 modelId : COMPONENT.MODEL_ID_5,
\r
370 modelNameVersionId : COMPONENT.MODEL_NAME_VERSION_ID_5,
\r
371 modelName : COMPONENT.MODEL_NAME_VISBCRTPEXPANSIONMODULE,
\r
372 modelVersion : COMPONENT.MODEL_VERSION_1
\r
377 $scope.getSubscriberDet = function(selectedCustomer){
\r
378 window.location.href = COMPONENT.SUBDETAILS_SELECTEDSUBSCRIBER + selectedCustomer;
\r