diff options
Diffstat (limited to 'gui-clamp/ui-react/src/api')
-rw-r--r-- | gui-clamp/ui-react/src/api/ControlLoopService.js | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/gui-clamp/ui-react/src/api/ControlLoopService.js b/gui-clamp/ui-react/src/api/ControlLoopService.js index 96eb403..b3d987c 100644 --- a/gui-clamp/ui-react/src/api/ControlLoopService.js +++ b/gui-clamp/ui-react/src/api/ControlLoopService.js @@ -19,17 +19,18 @@ export default class ControlLoopService { - static async getControlLoopInstantiation(windowLocationPathname) { + static async getControlLoopInstantiation() { - const response = await fetch(windowLocationPathname + '/restservices/clds/v2/toscaControlLoop/getToscaInstantiation'); + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/getToscaInstantiation'); return response } - static async createInstanceProperties(instanceName, instancePropertiesTemplate, windowLocationPathname) { + static async createInstanceProperties(instanceName, instancePropertiesTemplate) { - const response = await fetch(windowLocationPathname + - '/restservices/clds/v2/toscaControlLoop/postToscaInstanceProperties', { + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/postToscaInstanceProperties', { method: 'POST', headers: { "Content-Type": "application/json" @@ -41,14 +42,14 @@ export default class ControlLoopService { return response } - static async deleteInstantiation(name, version, windowLocationPathName) { - console.log(windowLocationPathName); + static async deleteInstantiation(name, version) { const params = { name: name, version: version } - const response = await fetch(windowLocationPathName + '/restservices/clds/v2/toscaControlLoop/deleteToscaInstanceProperties?' + (new URLSearchParams(params)), { + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/deleteToscaInstanceProperties?' + (new URLSearchParams(params)), { method: 'DELETE', credentials: 'same-origin', }); @@ -58,20 +59,22 @@ export default class ControlLoopService { return data; } - static async getInstanceOrderState(name, version, windowLocationPathName) { + static async getInstanceOrderState(name, version) { const params = { name: name, version: version } - const response = await fetch(windowLocationPathName + '/restservices/clds/v2/toscaControlLoop/getInstantiationOrderState'+ '?' + (new URLSearchParams(params))); + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/getInstantiationOrderState'+ '?' + (new URLSearchParams(params))); const data = await response; return data; } - static async changeInstanceOrderState(toscaObject, windowLocationPathName) { - const response = await fetch(windowLocationPathName + '/restservices/clds/v2/toscaControlLoop/putToscaInstantiationStateChange', { + static async changeInstanceOrderState(toscaObject) { + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/putToscaInstantiationStateChange', { method: 'PUT', headers: { "Content-Type": "application/json" @@ -83,23 +86,23 @@ export default class ControlLoopService { return response } - static async getToscaTemplate(name, version, windowLocationPathname) { + static async getToscaTemplate(name, version) { const params = { name: name, version: version } - const response = await fetch(windowLocationPathname + - '/restservices/clds/v2/toscaControlLoop/getToscaTemplate' + '?' + (new URLSearchParams(params))); + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/getToscaTemplate' + '?' + (new URLSearchParams(params))); const data = await response; return data; } - static async uploadToscaFile(toscaObject, windowLocationPathName) { - const response = await fetch(windowLocationPathName + - '/restservices/clds/v2/toscaControlLoop/commissionToscaTemplate', { + static async uploadToscaFile(toscaObject) { + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/commissionToscaTemplate', { method: 'POST', headers: { "Content-Type": "application/json" @@ -112,14 +115,14 @@ export default class ControlLoopService { } - static async deleteToscaTemplate(name, version, windowLocationPathname) { + static async deleteToscaTemplate(name, version) { const params = { name: name, version: version } - const response = await fetch(windowLocationPathname + - '/restservices/clds/v2/toscaControlLoop/decommissionToscaTemplate' + '?' + (new URLSearchParams(params)), + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/decommissionToscaTemplate' + '?' + (new URLSearchParams(params)), { method: 'DELETE' }); @@ -129,10 +132,10 @@ export default class ControlLoopService { return data; } - static async getToscaControlLoopDefinitions(windowLocationPathname) { + static async getToscaControlLoopDefinitions() { - const response = await fetch(windowLocationPathname + - '/restservices/clds/v2/toscaControlLoop/getElementDefinitions'); + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/getElementDefinitions'); this.checkResponseForError(response); @@ -141,27 +144,27 @@ export default class ControlLoopService { return data; } - static async getCommonOrInstanceProperties(name, version, windowLocationPathName, isCommon) { + static async getCommonOrInstanceProperties(name, version, isCommon) { const params = { name: name, version: version, common: isCommon } - const response = await fetch(windowLocationPathName + - '/restservices/clds/v2/toscaControlLoop/getCommonOrInstanceProperties' + '?' + (new URLSearchParams(params))); + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/getCommonOrInstanceProperties' + '?' + (new URLSearchParams(params))); return response; } - static async getToscaServiceTemplateSchema(section, windowLocationPathName) { + static async getToscaServiceTemplateSchema(section) { const params = { section: section } - const response = await fetch(windowLocationPathName + - '/restservices/clds/v2/toscaControlLoop/getJsonSchema' + '?' + (new URLSearchParams(params))); + const response = await fetch(window.location.pathname + + 'restservices/clds/v2/toscaControlLoop/getJsonSchema' + '?' + (new URLSearchParams(params))); this.checkResponseForError(response); |