diff options
Diffstat (limited to 'catalog-be/src/main')
2 files changed, 10 insertions, 1 deletions
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 b161c4a006..4f5374fa3c 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 @@ -2587,4 +2587,12 @@ errors: code: 400, message: "The Model '%1' is not allowed for the imported Vendor Software Product. Allowed Models: '%2'", messageId: "SVC4157" + } + + #---------SVC4158----------------------------- + # %1 - Valid artifact label name + INVALID_ARTIFACT_LABEL_NAME: { + code: 400, + message: "Invalid label name. Only the following characters are allowed in label name: '%1'", + messageId: "SVC4158" }
\ No newline at end of file diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java index 1331cbfe7c..a566d6c73d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java @@ -169,6 +169,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { private static final String COMMIT = "all changes committed"; private static final String UPDATE_ARTIFACT = "Update Artifact"; private static final String FOUND_DEPLOYMENT_ARTIFACT = "Found deployment artifact {}"; + private static final String VALID_ARTIFACT_LABEL_NAME = "'A-Z', 'a-z', '0-9', '-', '@', '+' and space."; private Gson gson = new GsonBuilder().setPrettyPrinting().create(); @javax.annotation.Resource private IInterfaceLifecycleOperation interfaceLifecycleOperation; @@ -1530,7 +1531,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { artifactInfo.setArtifactDisplayName(displayName); if (!ValidationUtils.validateArtifactLabel(artifactLabel)) { log.debug("Invalid format form Artifact label : {}", artifactLabel); - return Either.right(componentsUtils.getResponseFormat(ActionStatus.INVALID_CONTENT)); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.INVALID_ARTIFACT_LABEL_NAME, VALID_ARTIFACT_LABEL_NAME)); } artifactLabel = ValidationUtils.normalizeArtifactLabel(artifactLabel); if (artifactLabel.isEmpty()) { |