diff options
Diffstat (limited to 'ui-react/src/api')
-rw-r--r-- | ui-react/src/api/PolicyService.js | 5 | ||||
-rw-r--r-- | ui-react/src/api/PolicyToscaService.js | 68 |
2 files changed, 37 insertions, 36 deletions
diff --git a/ui-react/src/api/PolicyService.js b/ui-react/src/api/PolicyService.js index a77a8bdb0..a9f44b2a4 100644 --- a/ui-react/src/api/PolicyService.js +++ b/ui-react/src/api/PolicyService.js @@ -43,8 +43,9 @@ export default class PolicyService { return ""; }) } - static createNewPolicy(policyModelType, policyModelVersion, policyJson) { - return fetch(window.location.pathname + 'restservices/clds/v2/policies/' + policyModelType + '/' + policyModelVersion, { + static createNewPolicy(policyModelType, policyModelVersion, policyName, policyVersion, policyJson) { + return fetch(window.location.pathname + 'restservices/clds/v2/policies/' + policyModelType + '/' + + policyModelVersion + '/' + policyName + '/' + policyVersion, { method: 'POST', credentials: 'same-origin', headers: { diff --git a/ui-react/src/api/PolicyToscaService.js b/ui-react/src/api/PolicyToscaService.js index 351126328..c54e768a9 100644 --- a/ui-react/src/api/PolicyToscaService.js +++ b/ui-react/src/api/PolicyToscaService.js @@ -39,43 +39,43 @@ export default class PolicyToscaService { } static getToscaPolicyModelYaml(policyModelType, policyModelVersion) { - return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels/yaml/' + policyModelType + "/" + policyModelVersion, { - method: 'GET', - credentials: 'same-origin' - }) - .then(function (response) { - console.debug("getToscaPolicyModelYaml response received: ", response.status); - if (response.ok) { - return response.json(); - } else { - console.error("getToscaPolicyModelYaml query failed"); - return ""; - } - }) - .catch(function (error) { - console.error("getToscaPolicyModelYaml error received", error); - return ""; - }); + return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels/yaml/' + policyModelType + "/" + policyModelVersion, { + method: 'GET', + credentials: 'same-origin' + }) + .then(function (response) { + console.debug("getToscaPolicyModelYaml response received: ", response.status); + if (response.ok) { + return response.json(); + } else { + console.error("getToscaPolicyModelYaml query failed"); + return ""; + } + }) + .catch(function (error) { + console.error("getToscaPolicyModelYaml error received", error); + return ""; + }); } static getToscaPolicyModel(policyModelType, policyModelVersion) { - return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels/' + policyModelType + "/" + policyModelVersion, { - method: 'GET', - credentials: 'same-origin' - }) - .then(function (response) { - console.debug("getToscaPolicyModel response received: ", response.status); - if (response.ok) { - return response.json(); - } else { - console.error("getToscaPolicyModel query failed"); - return {}; - } - }) - .catch(function (error) { - console.error("getToscaPolicyModel error received", error); - return {}; - }); + return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels/' + policyModelType + "/" + policyModelVersion, { + method: 'GET', + credentials: 'same-origin' + }) + .then(function (response) { + console.debug("getToscaPolicyModel response received: ", response.status); + if (response.ok) { + return response.json(); + } else { + console.error("getToscaPolicyModel query failed"); + return {}; + } + }) + .catch(function (error) { + console.error("getToscaPolicyModel error received", error); + return {}; + }); } static createPolicyModelFromToscaModel(jsonData) { |