diff options
author | 2021-08-30 18:46:53 +0100 | |
---|---|---|
committer | 2021-09-10 09:21:50 +0100 | |
commit | a090a83268cfd8b1341c266d32ccfb670b9f0e8c (patch) | |
tree | 0b4ecc386f90316008d453c9eacd99b4063bb348 /gui-clamp/ui-react/src/api/ControlLoopService.js | |
parent | f2047d16b47f086395856aefca6c5047b488d207 (diff) |
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 <bruno.militzer@est.tech>
Diffstat (limited to 'gui-clamp/ui-react/src/api/ControlLoopService.js')
-rw-r--r-- | gui-clamp/ui-react/src/api/ControlLoopService.js | 27 |
1 files changed, 24 insertions, 3 deletions
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; |