diff options
Diffstat (limited to 'ui-react/src/api')
-rw-r--r-- | ui-react/src/api/LoopService.js | 18 | ||||
-rw-r--r-- | ui-react/src/api/TemplateService.js | 16 |
2 files changed, 34 insertions, 0 deletions
diff --git a/ui-react/src/api/LoopService.js b/ui-react/src/api/LoopService.js index 432eabecd..d665f8148 100644 --- a/ui-react/src/api/LoopService.js +++ b/ui-react/src/api/LoopService.js @@ -38,6 +38,24 @@ export default class LoopService { }); } + static createLoop(loopName, templateName) { + return fetch('/restservices/clds/v2/loop/create/' + loopName + '?templateName=' + templateName, { + method: 'POST', + headers: { + "Content-Type": "application/json" + }, + credentials: 'same-origin' + }) + .then(function (response) { + console.debug("CreateLoop response received: ", response.status); + return response.json(); + }) + .catch(function (error) { + console.error("CreateLoop error received", error); + return ""; + }); + } + static getLoop(loopName) { return fetch('/restservices/clds/v2/loop/' + loopName, { method: 'GET', diff --git a/ui-react/src/api/TemplateService.js b/ui-react/src/api/TemplateService.js index 10e0b5427..6a65d9a04 100644 --- a/ui-react/src/api/TemplateService.js +++ b/ui-react/src/api/TemplateService.js @@ -21,6 +21,22 @@ */ export default class TemplateService { + static getTemplateNames() { + return fetch('/restservices/clds/v2/templates/names', { method: 'GET', credentials: 'same-origin' }) + .then(function (response) { + console.debug("GetTemplateNames response received: ", response.status); + if (response.ok) { + return response.json(); + } else { + console.error("GetTemplateNames query failed"); + return {}; + } + }) + .catch(function (error) { + console.error("GetTemplateNames error received", error); + return {}; + }); + } static getBlueprintMicroServiceTemplates() { return fetch('restservices/clds/v2/templates', { method: 'GET', credentials: 'same-origin', }) |