aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-configuration.yaml8
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java3
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java2
3 files changed, 11 insertions, 2 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()) {
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java
index 4465997c4a..30fcfac03e 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/api/ActionStatus.java
@@ -22,7 +22,7 @@ package org.openecomp.sdc.be.dao.api;
public enum ActionStatus {
OK, ACCEPTED, CREATED, NO_CONTENT, GENERAL_ERROR, NOT_ALLOWED, MISSING_INFORMATION, RESTRICTED_OPERATION,
- RESTRICTED_ACCESS, INVALID_CONTENT, INVALID_PROPERTY_VALUES, NOT_SUPPORTED,
+ RESTRICTED_ACCESS, INVALID_CONTENT, INVALID_PROPERTY_VALUES, NOT_SUPPORTED, INVALID_ARTIFACT_LABEL_NAME,
// User related
USER_ALREADY_EXIST, USER_INACTIVE, USER_NOT_FOUND, USER_HAS_ACTIVE_ELEMENTS, INVALID_EMAIL_ADDRESS, INVALID_ROLE, DELETE_USER_ADMIN_CONFLICT, UPDATE_USER_ADMIN_CONFLICT, CANNOT_DELETE_USER_WITH_ACTIVE_ELEMENTS, CANNOT_UPDATE_USER_WITH_ACTIVE_ELEMENTS, INVALID_USER_ID, USER_DEFINED,
// CapabilityType related
268' href='#n268'>268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359