diff options
author | 2022-05-05 14:19:39 +0100 | |
---|---|---|
committer | 2022-05-05 14:19:43 +0100 | |
commit | 777d1457e6f24ef187612d0150a5415002550cee (patch) | |
tree | c807c972826576726f0c24a8bdd2850977d3b319 /gui-clamp/ui-react/src/api | |
parent | 2fc78d7979c470c670e4caa154e3ec40fd47c73c (diff) |
Added Edit Button Functionality
Issue-ID: POLICY-4094
Change-Id: I7e83e1c194272f274f351bc1ee34761fcc7353a4
Signed-off-by: brunomilitzer <bruno.militzer@est.tech>
Diffstat (limited to 'gui-clamp/ui-react/src/api')
-rw-r--r-- | gui-clamp/ui-react/src/api/ACMService.js | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/gui-clamp/ui-react/src/api/ACMService.js b/gui-clamp/ui-react/src/api/ACMService.js index 393741f..722a571 100644 --- a/gui-clamp/ui-react/src/api/ACMService.js +++ b/gui-clamp/ui-react/src/api/ACMService.js @@ -42,6 +42,25 @@ export default class ACMService { return response } + static async updateInstanceProperties(instanceName, version, instancePropertiesTemplate) { + const params = { + name: instanceName, + version: version + } + + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/acm/putToscaInstanceProperties?' + (new URLSearchParams(params)), { + method: 'PUT', + headers: { + "Content-Type": "application/json" + }, + credentials: 'same-origin', + body: JSON.stringify(instancePropertiesTemplate), + }); + + return response + } + static async deleteInstantiation(name, version) { const params = { name: name, @@ -86,11 +105,17 @@ export default class ACMService { return response } - static async getToscaTemplate(name, version) { - const params = { - name: name, - version: version - } + static async getToscaTemplate(name, version, instanceName) { + const params = instanceName != null ? + { + name: name, + version: version, + instanceName: instanceName + } : + { + name: name, + version: version + } const response = await fetch(window.location.pathname + 'restservices/clds/v2/acm/getToscaTemplate' + '?' + (new URLSearchParams(params))); @@ -132,12 +157,19 @@ export default class ACMService { return data; } - static async getCommonOrInstanceProperties(name, version, isCommon) { - const params = { - name: name, - version: version, - common: isCommon - } + static async getCommonOrInstanceProperties(name, version, instanceName, isCommon) { + const params = instanceName != null ? + { + name: name, + version: version, + instanceName: instanceName, + common: isCommon + } : + { + name: name, + version: version, + common: isCommon + } const response = await fetch(window.location.pathname + 'restservices/clds/v2/acm/getCommonOrInstanceProperties' + '?' + (new URLSearchParams(params))); |