aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/api/PolicyToscaService.js
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2021-02-26 19:14:03 +0100
committerLiam Fallon <liam.fallon@est.tech>2021-03-16 09:20:40 +0000
commit0e46e355ea43f940232ef8e5ba5d60dfdcc3a9f2 (patch)
tree733a29cea8644aa5ff93b8450458324b5ed5bdc8 /ui-react/src/api/PolicyToscaService.js
parentaf03139afd50b8843811201592cfd08569235074 (diff)
Introduce a new json editor component
Add this a new react component so that the json editor can be called within the policies table + Add the tosca tab + Fix for Submit operation in clamp-api-v2.xml Issue-ID: POLICY-3106 Issue-ID: POLICY-3124 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: I18ab3a6034cac719525774f11b2c17f0a14bc2aa Signed-off-by: sebdet <sebastien.determe@intl.att.com> (cherry picked from commit 1e2760ea1ee4baa9db0e921907f3491fda795136)
Diffstat (limited to 'ui-react/src/api/PolicyToscaService.js')
-rw-r--r--ui-react/src/api/PolicyToscaService.js68
1 files changed, 34 insertions, 34 deletions
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) {