diff options
author | 2022-05-23 13:04:09 +0000 | |
---|---|---|
committer | 2022-05-23 13:04:09 +0000 | |
commit | f53b403af9e33081ec459f1969085e6a21c53cf7 (patch) | |
tree | 61720b63113a7d0d62e1852125b1b08f8e5d4fbb /gui-clamp/ui-react/src/api/ACMService.js | |
parent | 9e22903cfc9a159ab1a39ed6ada929037b07567d (diff) | |
parent | 777d1457e6f24ef187612d0150a5415002550cee (diff) |
Merge "Added Edit Button Functionality"
Diffstat (limited to 'gui-clamp/ui-react/src/api/ACMService.js')
-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))); |