2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 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 * ===================================================================
23 function saveMsProperties(type, form) {
24 var newMsProperties = cl_props["microServicePolicies"];
26 for (p in newMsProperties) {
27 if (newMsProperties[p]["name"] == type) {
28 newMsProperties[p]["properties"] = form;
34 var svcUrl = "/restservices/clds/v2/loop/updateMicroservicePolicies/" + modelName;
37 newMicroservicePolicies : newMsProperties
39 $http.post(svcUrl, svcRequest).success(function(data) {
41 }).error(function(data) {
42 def.reject("Save Model not successful");
45 cl_props["microServicePolicies"] = newMsProperties;
48 function saveGlobalProperties(form) {
51 var svcUrl = "/restservices/clds/v2/loop/globalProperties/" + modelName;
54 newGlobalPolicies : form
56 $http.post(svcUrl, svcRequest).success(function(data) {
58 }).error(function(data) {
59 def.reject("Save Model not successful");
62 cl_props["globalPropertiesJson"] = form;
65 function saveOpPolicyProperties(form) {
66 var newOpProperties = cl_props["operationalPolicies"];
67 newOpProperties["0"]["configurationsJson"]= form;
71 var svcUrl = "/restservices/clds/v2/loop/updateOperationalPolicies/" + modelName;
74 newGlobalPolicies : newOpProperties
76 $http.post(svcUrl, svcRequest).success(function(data) {
78 }).error(function(data) {
79 def.reject("Save Model not successful");
83 cl_props["operationalPolicies"] = newOpProperties;
86 function getOperationalPolicyProperty() {
87 return cl_props["operationalPolicies"]["0"]["configurationsJson"];
90 function getGlobalProperty() {
91 return cl_props["globalPropertiesJson"];
94 function getMsProperty(type) {
95 var msProperties = cl_props["microServicePolicies"];
96 for (p in msProperties) {
97 if (msProperties[p]["name"] == type) {
98 return msProperties[p]["properties"];
104 function getMsUI(type) {
105 var msProperties = cl_props["microServicePolicies"];
106 for (p in msProperties) {
107 if (msProperties[p]["name"] == type) {
108 return msProperties[p]["jsonRepresentation"];
114 function getStatus() {
115 return cl_props["lastComputedState"];
118 function getDeploymentID() {
119 return cl_props["dcaeDeploymentId"];
122 function getDeploymentStatusURL() {
123 return cl_props["dcaeDeploymentStatusUrl"];