From a090a83268cfd8b1341c266d32ccfb670b9f0e8c Mon Sep 17 00:00:00 2001 From: brunomilitzer Date: Mon, 30 Aug 2021 18:46:53 +0100 Subject: Add Delete Instantiation Functionality. Update UI to centralize Instantiation Management Created Delete button to delete the instantiations Fixed Change Order State Functionality Issue-ID: POLICY-3558 Change-Id: I2efb00ce041ab4fc217e06ed72385ad8ea1b10fb Signed-off-by: brunomilitzer --- gui-clamp/ui-react/src/api/ControlLoopService.js | 27 +++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'gui-clamp/ui-react/src/api') diff --git a/gui-clamp/ui-react/src/api/ControlLoopService.js b/gui-clamp/ui-react/src/api/ControlLoopService.js index 0d6e11c..96eb403 100644 --- a/gui-clamp/ui-react/src/api/ControlLoopService.js +++ b/gui-clamp/ui-react/src/api/ControlLoopService.js @@ -26,7 +26,7 @@ export default class ControlLoopService { return response } - static async createInstanceProperties(instancePropertiesTemplate, windowLocationPathname) { + static async createInstanceProperties(instanceName, instancePropertiesTemplate, windowLocationPathname) { const response = await fetch(windowLocationPathname + '/restservices/clds/v2/toscaControlLoop/postToscaInstanceProperties', { @@ -41,8 +41,29 @@ export default class ControlLoopService { return response } - static async getInstanceOrderState(windowLocationPathName) { - const response = await fetch(windowLocationPathName + '/restservices/clds/v2/toscaControlLoop/getInstantiationOrderState'); + static async deleteInstantiation(name, version, windowLocationPathName) { + console.log(windowLocationPathName); + const params = { + name: name, + version: version + } + + const response = await fetch(windowLocationPathName + '/restservices/clds/v2/toscaControlLoop/deleteToscaInstanceProperties?' + (new URLSearchParams(params)), { + method: 'DELETE', + credentials: 'same-origin', + }); + + const data = await response; + + return data; + } + + static async getInstanceOrderState(name, version, windowLocationPathName) { + const params = { + name: name, + version: version + } + const response = await fetch(windowLocationPathName + '/restservices/clds/v2/toscaControlLoop/getInstantiationOrderState'+ '?' + (new URLSearchParams(params))); const data = await response; -- cgit 1.2.3-korg