From 777d1457e6f24ef187612d0150a5415002550cee Mon Sep 17 00:00:00 2001 From: brunomilitzer Date: Thu, 5 May 2022 14:19:39 +0100 Subject: Added Edit Button Functionality Issue-ID: POLICY-4094 Change-Id: I7e83e1c194272f274f351bc1ee34761fcc7353a4 Signed-off-by: brunomilitzer --- gui-clamp/ui-react/src/api/ACMService.js | 54 +++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 11 deletions(-) (limited to 'gui-clamp/ui-react/src/api') 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))); -- cgit