diff options
author | Sébastien Determe <sebastien.determe@intl.att.com> | 2020-03-13 15:37:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-03-13 15:37:30 +0000 |
commit | 8063862aeed5341f32cb6d95e212ed99e43e57c7 (patch) | |
tree | a0bf9da40f396b05dd9adc2852bc4c7ad78a4ad3 /ui-react/src/api | |
parent | 3af9347e47302e3f6754cba8ea2b63772980a5d9 (diff) | |
parent | fb4b25f6827accf6f975f9ca9a7aaee08d335c2f (diff) |
Merge "Add remove op policy option"
Diffstat (limited to 'ui-react/src/api')
-rw-r--r-- | ui-react/src/api/LoopService.js | 67 |
1 files changed, 45 insertions, 22 deletions
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js index d665f8148..2750763da 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 {}; + }); + } } |