aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/api
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-08-09 18:36:09 +0200
committersebdet <sebastien.determe@intl.att.com>2019-08-19 07:55:11 -0700
commitf9e2ceeae29504505f631086e612fad4e1e16979 (patch)
tree5917e0e5eb6a4d178190f61f7394d9c3380736cf /ui-react/src/api
parent691e2b7a8bb16d224a0fbe30390152ea309e88e2 (diff)
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>
Diffstat (limited to 'ui-react/src/api')
-rw-r--r--ui-react/src/api/LoopCache.js4
-rw-r--r--ui-react/src/api/LoopService.js24
2 files changed, 28 insertions, 0 deletions
diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js
index 3ee5acc68..d83e3ce9d 100644
--- a/ui-react/src/api/LoopCache.js
+++ b/ui-react/src/api/LoopCache.js
@@ -51,6 +51,10 @@ export default class LoopCache {
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 031ec638f..eece20c96 100644
--- a/ui-react/src/api/LoopService.js
+++ b/ui-react/src/api/LoopService.js
@@ -104,6 +104,30 @@ export default class LoopService {
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, {