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 * ===================================================================
24 function updateMsProperties(type, newMsProperties) {
25 if (newMsProperties["name"] == type) {
26 for (p in cl_props["microServicePolicies"]) {
27 if (cl_props["microServicePolicies"][p]["name"] == type) {
28 cl_props["microServicePolicies"][p] = newMsProperties;
34 function updateGlobalProperties(newGlobalProperties) {
35 cl_props["globalPropertiesJson"] = newGlobalProperties;
38 function updateOpPolicyProperties(newOpProperties) {
39 cl_props["operationalPolicies"] = newOpProperties;
42 function getLoopName() {
43 return cl_props["name"];
46 function getOperationalPolicyProperty() {
47 return JSON.parse(JSON.stringify(cl_props["operationalPolicies"]["0"]["configurationsJson"]));
50 function getOperationalPolicies() {
51 return JSON.parse(JSON.stringify(cl_props["operationalPolicies"]));
54 function getGlobalProperty() {
55 return JSON.parse(JSON.stringify(cl_props["globalPropertiesJson"]));
58 function getDeploymentProperties() {
59 return JSON.parse(JSON.stringify(cl_props["globalPropertiesJson"]["dcaeDeployParameters"]));
62 function getMsJson(type) {
63 var msProperties = cl_props["microServicePolicies"];
64 for (p in msProperties) {
65 if (msProperties[p]["name"] == type) {
66 return JSON.parse(JSON.stringify(msProperties[p]));
72 function getMsProperty(type) {
73 var msProperties = cl_props["microServicePolicies"];
74 for (p in msProperties) {
75 if (msProperties[p]["name"] == type) {
76 if (msProperties[p]["properties"] !== null && msProperties[p]["properties"] !== undefined) {
77 return JSON.parse(JSON.stringify(msProperties[p]["properties"]));
84 function getMsUI(type) {
85 var msProperties = cl_props["microServicePolicies"];
86 for (p in msProperties) {
87 if (msProperties[p]["name"] == type) {
88 return JSON.parse(JSON.stringify(msProperties[p]["jsonRepresentation"]));
94 function getLastUpdatedStatus() {
95 return cl_props["lastComputedState"];
98 function setLastComputedState(status) {
99 cl_props["lastComputedState"] = status;
102 function getDeploymentID() {
103 return cl_props["dcaeDeploymentId"];
106 function setDeploymentID(deploymentId) {
107 cl_props["dcaeDeploymentId"] = deploymentId;
110 function getDeploymentStatusURL() {
111 return cl_props["dcaeDeploymentStatusUrl"];
114 function setDeploymentStatusURL(deploymentStatusURL) {
115 cl_props["dcaeDeploymentStatusUrl"] = deploymentStatusURL;
118 function getResourceDetailsVfProperty() {
119 return cl_props["modelPropertiesJson"]["resourceDetails"]["VF"];
122 function getResourceDetailsVfModuleProperty() {
123 return cl_props["modelPropertiesJson"]["resourceDetails"]["VFModule"];
126 function getLoopLogsArray() {
127 return cl_props.loopLogs;
130 module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsVfProperty,getResourceDetailsVfModuleProperty };