diff options
Diffstat (limited to 'catalog-be')
3 files changed, 11 insertions, 4 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 8f5b2b6355..6d243d2e94 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 @@ -1803,9 +1803,11 @@ errors: messageId: "SVC4669" } #---------SVC4670------------------------------ + # %1 - artifactname + # %2 - validname ARTIFACT_NAME_INVALID: { code: 400, - message: "Error: Artifact name is invalid.", + message: "Error: Artifact name '%1' is invalid. Only the following characters are allowed in the Artifact Name: '%2'.", messageId: "SVC4670" } #---------SVC4671------------------------------ diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index 152b78b15c..0e08be5d7a 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -198,6 +198,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { private static final String CREATE_RESOURCE_VALIDATE_CAPABILITY_TYPES = "Create Resource - validateCapabilityTypesCreate"; private static final String COMPONENT_INSTANCE_WITH_NAME = "component instance with name "; private static final String COMPONENT_INSTANCE_WITH_NAME_IN_RESOURCE = "component instance with name {} in resource {} "; + private static final String VALID_CHARACTERS_ARTIFACT_NAME = "'A-Z', 'a-z', '0-9', '.', '_', '-', '@' and space"; private static final LoggerSupportability loggerSupportability = LoggerSupportability.getLogger(ResourceBusinessLogic.class.getName()); private final ComponentInstanceBusinessLogic componentInstanceBusinessLogic; private final ResourceImportManager resourceImportManager; @@ -2148,7 +2149,8 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { Either<List<NonMetaArtifactInfo>, String> artifactPathAndNameList = getValidArtifactNames(csarInfo, collectedWarningMessages); if (artifactPathAndNameList.isRight()) { return Either.right( - getComponentsUtils().getResponseFormatByArtifactId(ActionStatus.ARTIFACT_NAME_INVALID, artifactPathAndNameList.right().value())); + getComponentsUtils().getResponseFormatByArtifactId(ActionStatus.ARTIFACT_NAME_INVALID, artifactPathAndNameList.right().value(), + VALID_CHARACTERS_ARTIFACT_NAME)); } EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>> vfCsarArtifactsToHandle = null; if (artifactOperation.isCreateOrLink()) { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java index 3b55e67c75..af05825545 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java @@ -404,12 +404,15 @@ public class ComponentsUtils { return responseFormat; } - public ResponseFormat getResponseFormatByArtifactId(ActionStatus actionStatus, String artifactId) { + public ResponseFormat getResponseFormatByArtifactId(ActionStatus actionStatus, String... params) { ResponseFormat responseFormat; switch (actionStatus) { case RESOURCE_NOT_FOUND: case ARTIFACT_NOT_FOUND: - responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NOT_FOUND, artifactId); + responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NOT_FOUND, params); + break; + case ARTIFACT_NAME_INVALID: + responseFormat = getResponseFormat(ActionStatus.ARTIFACT_NAME_INVALID, params); break; default: responseFormat = getResponseFormat(actionStatus); |