From d5b4901c6a1ae136138c1300d377447e26bac4ef Mon Sep 17 00:00:00 2001 From: eleonorali Date: Sun, 11 Feb 2018 12:15:48 +0200 Subject: SRIOV - add annotations SRIOV - add annotations to input TOSCA parameter converted from HEAT file (2) Change-Id: Id0b0156730ae64093df42d09e2873de047c13ac9 Issue-ID: SDC-996 Signed-off-by: eleonorali --- .../datatypes/extend/ToscaAnnotationType.java | 34 ++++++++++++++++++++++ .../sdc/tosca/services/ConfigConstants.java | 15 ++++------ .../sdc/tosca/services/ToscaConstants.java | 25 ++++++++++------ 3 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/extend/ToscaAnnotationType.java (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main/java/org') diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/extend/ToscaAnnotationType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/extend/ToscaAnnotationType.java new file mode 100644 index 0000000000..5fc5c1f710 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/extend/ToscaAnnotationType.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2016-2017 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openecomp.sdc.tosca.datatypes.extend; + +import org.openecomp.config.api.Configuration; +import org.openecomp.config.api.ConfigurationManager; +import org.openecomp.sdc.tosca.services.ConfigConstants; + + +public class ToscaAnnotationType { + + private static Configuration config = ConfigurationManager.lookup(); + public static final String ANNOTATION_TYPE_PREFIX = + config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_ANNOTATION_TYPE); + + public static final String SOURCE = + ANNOTATION_TYPE_PREFIX + "Source"; + +} + diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java index 91103c55df..8666da9833 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ConfigConstants.java @@ -1,21 +1,17 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * Copyright © 2016-2017 European Support Limited + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END========================================================= */ package org.openecomp.sdc.tosca.services; @@ -32,6 +28,7 @@ public class ConfigConstants { public static final String PREFIX_POLICY_TYPE = PREFIX + ".policyType"; public static final String PREFIX_ARTIFACT_TYPE = PREFIX + ".artifactType"; public static final String PREFIX_RELATIONSHIP_TYPE = PREFIX + ".relationshipType"; + public static final String PREFIX_ANNOTATION_TYPE = PREFIX + ".annotationType"; public static final String PREFIX_NODE_TYPE_VFC = PREFIX + ".nodeType.vfc"; public static final String PREFIX_NODE_TYPE_NETWORK = PREFIX + ".nodeType.network"; diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java index 4d45e8fbf1..1aa171961f 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java @@ -1,21 +1,17 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * Copyright © 2016-2017 European Support Limited + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END========================================================= */ package org.openecomp.sdc.tosca.services; @@ -42,6 +38,9 @@ public class ToscaConstants { public static final String FEATURE_CAPABILITY_ID = "feature"; public static final String PORT_MIRRORING_CAPABILITY_ID = "port_mirroring"; + //TOSCA Annotation Ids + public static final String SOURCE_ANNOTATION_ID = "source"; + //General public static final String TOSCA_DEFINITIONS_VERSION = "tosca_simple_yaml_1_0_0"; public static final String MODELABLE_ENTITY_NAME_SELF = "SELF"; @@ -70,5 +69,13 @@ public class ToscaConstants { public static final String COMPUTE_IMAGE = "image"; public static final String COMPUTE_FLAVOR = "flavor"; + public static final String SOURCE_TYPE_PROPERTY_NAME = "source_type"; + public static final String VF_MODULE_LABEL_PROPERTY_NAME = "vf_module_label"; + public static final String PARAM_NAME_PROPERTY_NAME = "param_name"; + + // propertiies valid values + public static final String HEAT_SOURCE_TYPE = "HEAT"; + public static final String GENERIC_SOURCE_TYPE = "Generic"; + } -- cgit 1.2.3-korg