2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
35 function($scope, $rootScope, $uibModalInstance, $http, $q, data, dialogs, cldsModelService) {
36 function validate_and_set_deploy_parameters() {
37 var form = $("#deployForm")[0];
39 for( var i = 0; i < form.length; ++i ) {
40 var name = form[i].name;
41 var value = form[i].value;
47 var el = getGlobalProperty();
48 el["dcaeDeployParameters"] = obj;
49 $scope.saveGlobalProperties(JSON.stringify(el)).then(function(pars) {
50 updateGlobalProperties(el);
55 $scope.load_deploy_parameters = function() {
56 var el = getDeploymentProperties();
58 var propertyValue = el[key];
59 $('#deployForm').append(
60 $('<label for="' + key + '" class="control-label">' + key + ' </label>'));
61 $('#deployForm').append(
62 $('<input style="width: 100%; clear: both;" class="form-control" name="'
63 + key + '"></input>').val(propertyValue).html(propertyValue));
66 $scope.deploy = function() {
67 validate_and_set_deploy_parameters();
68 $uibModalInstance.close();
70 $scope.close = function() {
71 $uibModalInstance.dismiss();
73 $scope.saveGlobalProperties = function(form) {
74 var modelName = getLoopName();
76 var svcUrl = "/restservices/clds/v2/loop/updateGlobalProperties/" + modelName;
77 $http.post(svcUrl, form).success(function(data) {
79 }).error(function(data) {
80 def.reject("Save Global properties not successful");