From aea64ba99fa9c9b51112b30aeb0872c4cdb89759 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 18 Aug 2021 14:34:33 +0100 Subject: Validate the Resource Model before importing VSP Validates the Resource Model selected during the Import VSP. This model must be aligned with one of the models that the imported VSP relates to. Fix VSP package retrieval to get the exact version from the VSP chosen during the Import VSP process. Introduces a client in the Catalog to retrieve from the Onboarding backend a VSP information using its Id and version Id. Change-Id: Ic8fb52b6daadc0e7203c81a9c15c3e46d5b9fffb Issue-ID: SDC-3675 Signed-off-by: andre.schmid --- .../files/default/error-configuration.yaml | 26 ++++++++++++++++++++++ .../templates/default/BE-configuration.yaml.erb | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'catalog-be/src/main/docker') diff --git a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml index 6d243d2e94..563594a728 100644 --- a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml +++ b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml @@ -2554,3 +2554,29 @@ errors: messageId: "SVC4154" } + #-----------SVC4155--------------------------- + # %1 - "VSP id" + # %2 - "VSP version id" + VSP_FIND_ERROR: { + code: 500, + message: "An error has occurred while retrieving the Vendor Software Product of id '%1', version id '%2'", + messageId: "SVC4155" + } + + #-----------SVC4156--------------------------- + # %1 - "VSP id" + # %2 - "VSP version id" + VSP_NOT_FOUND: { + code: 404, + message: "Could not find Vendor Software Product of id '%1', version id '%2'", + messageId: "SVC4156" + } + + #-----------SVC4157--------------------------- + # %1 - "The model name" + # %2 - "List of allowed models" + VSP_MODEL_NOT_ALLOWED: { + code: 400, + message: "The Model '%1' is not allowed for the imported Vendor Software Product. Allowed Models: '%2'", + messageId: "SVC4157" + } \ No newline at end of file diff --git a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb index 9f49bc52e1..60616c2709 100644 --- a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb +++ b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb @@ -945,7 +945,9 @@ onboarding: protocol: http port: <%= node['ONBOARDING_BE'][:http_port] %> <% end -%> - downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages" + getVspPackageUri: "/onboarding-api/v1.0/vendor-software-products/packages/%s?versionId=%s" # /onboarding-api/v1.0/vendor-software-products/packages/:vspId?versionId=:vspVersionId + getLatestVspPackageUri: "/onboarding-api/v1.0/vendor-software-products/packages/%s" # /onboarding-api/v1.0/vendor-software-products/packages/:vspId + getVspUri: "/onboarding-api/v1.0/vendor-software-products/%s/versions/%s" # /onboarding-api/v1.0/vendor-software-products/:vspId/versions/:vspVersionId healthCheckUri: "/onboarding-api/v1.0/healthcheck" # #GSS IDNS -- cgit 1.2.3-korg