Draft of op policy
First draft of the Operational policy based on JsonEditor, it's a wip
code
Issue-ID: CLAMP-430
Change-Id: I2c7970e94488f4020377fd9d4d00691a3590b13e
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js
index 3ee5acc..d83e3ce 100644
--- a/ui-react/src/api/LoopCache.js
+++ b/ui-react/src/api/LoopCache.js
@@ -51,6 +51,10 @@
getOperationalPolicyConfigurationJson() {
return this.loopJsonCache["operationalPolicies"]["0"]["configurationsJson"];
}
+
+ getOperationalPolicyJsonSchema() {
+ return this.loopJsonCache["operationalPolicySchema"];
+ }
getOperationalPolicies() {
return this.loopJsonCache["operationalPolicies"];
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js
index 031ec63..eece20c 100644
--- a/ui-react/src/api/LoopService.js
+++ b/ui-react/src/api/LoopService.js
@@ -104,6 +104,30 @@
return "";
});
}
+
+ static setOperationalPolicyProperties(loopName, jsonData) {
+ return fetch('/restservices/clds/v2/loop/updateOperationalPolicies/' + loopName, {
+ method: 'POST',
+ credentials: 'same-origin',
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(jsonData),
+ })
+ .then(function (response) {
+ console.debug("updateOperationalPolicies response received: ", response.status);
+ if (response.ok) {
+ return response.text();
+ } else {
+ console.error("updateOperationalPolicies query failed");
+ return "";
+ }
+ })
+ .catch(function (error) {
+ console.error("updateOperationalPolicies error received", error);
+ return "";
+ });
+ }
static updateGlobalProperties(loopName, jsonData) {
return fetch('/restservices/clds/v2/loop/updateGlobalProperties/' + loopName, {