X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ui-react%2Fsrc%2Fapi%2FLoopService.js;h=2750763daa69fca7e97f46ae102789b2d8b62873;hb=fb4b25f6827accf6f975f9ca9a7aaee08d335c2f;hp=d665f81481e85725eb2f0a2cf7202062f6e26b3c;hpb=5c3a825851bb1a345620c5c4951726c5b94a0341;p=clamp.git diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js index d665f814..2750763d 100644 --- a/ui-react/src/api/LoopService.js +++ b/ui-react/src/api/LoopService.js @@ -194,26 +194,49 @@ export default class LoopService { }); } - static addOperationalPolicyType(loopName, policyType, policyVersion) { - return fetch('/restservices/clds/v2/loop/addOperationaPolicy/' + loopName + '/policyModel/' + policyType +'/' + policyVersion , { - method: 'PUT', - headers: { - "Content-Type": "application/json" - }, - credentials: 'same-origin' - }) - .then(function (response) { - console.debug("Add Operational Policy response received: ", response.status); - if (response.ok) { - return response.json(); - } else { - console.error("Add Operational Policy query failed"); - return {}; - } - }) - .catch(function (error) { - console.error("Add Operational Policy error received", error); - return {}; - }); - } + static addOperationalPolicyType(loopName, policyType, policyVersion) { + return fetch('/restservices/clds/v2/loop/addOperationaPolicy/' + loopName + '/policyModel/' + policyType +'/' + policyVersion , { + method: 'PUT', + headers: { + "Content-Type": "application/json" + }, + credentials: 'same-origin' + }) + .then(function (response) { + console.debug("Add Operational Policy response received: ", response.status); + if (response.ok) { + return response.json(); + } else { + console.error("Add Operational Policy query failed"); + return {}; + } + }) + .catch(function (error) { + console.error("Add Operational Policy error received", error); + return {}; + }); + } + + static removeOperationalPolicyType(loopName, policyType, policyVersion) { + return fetch('/restservices/clds/v2/loop/removeOperationaPolicy/' + loopName + '/policyModel/' + policyType +'/' + policyVersion , { + method: 'PUT', + headers: { + "Content-Type": "application/json" + }, + credentials: 'same-origin' + }) + .then(function (response) { + console.debug("Remove Operational Policy response received: ", response.status); + if (response.ok) { + return response.json(); + } else { + console.error("Remove Operational Policy query failed"); + return {}; + } + }) + .catch(function (error) { + console.error("Remove Operational Policy error received", error); + return {}; + }); + } }