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 --- .../sdc/tosca/datatypes/model/ServiceTemplate.java | 25 ++++++---- .../model/heatextend/AnnotationDefinition.java | 42 +++++++++++++++++ .../datatypes/model/heatextend/AnnotationType.java | 53 ++++++++++++++++++++++ .../model/heatextend/ParameterDefinitionExt.java | 34 ++++++++------ .../resources/globalTypes/openecomp/_index.yml | 2 + .../globalTypes/openecomp/annotations.yml | 42 +++++++++++++++++ 6 files changed, 174 insertions(+), 24 deletions(-) create mode 100644 common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationDefinition.java create mode 100644 common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationType.java create mode 100644 common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/annotations.yml (limited to 'common/openecomp-tosca-datatype/src') diff --git a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java index aecb9315e3..297a2498bb 100644 --- a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java +++ b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java @@ -1,25 +1,22 @@ -/*- - * ============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.datatypes.model; +import org.openecomp.sdc.tosca.datatypes.model.heatextend.AnnotationType; import java.util.List; import java.util.Map; @@ -39,6 +36,7 @@ public class ServiceTemplate implements Template { private Map node_types; private Map group_types; private Map policy_types; + private Map annotation_types; private TopologyTemplate topology_template; public String getTosca_definitions_version() { @@ -145,4 +143,13 @@ public class ServiceTemplate implements Template { public void setTopology_template(TopologyTemplate topology_template) { this.topology_template = topology_template; } + + public Map getAnnotation_types() { + return annotation_types; + } + + public void setAnnotation_types(Map annotation_types) { + this.annotation_types = annotation_types; + } + } diff --git a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationDefinition.java b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationDefinition.java new file mode 100644 index 0000000000..24b5dec416 --- /dev/null +++ b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationDefinition.java @@ -0,0 +1,42 @@ +/* + * 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.model.heatextend; + +import java.util.Map; + +public class AnnotationDefinition { + + private String type; + private Map properties; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + +} diff --git a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationType.java b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationType.java new file mode 100644 index 0000000000..b76966e1f8 --- /dev/null +++ b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/AnnotationType.java @@ -0,0 +1,53 @@ +/* + * Copyright © 2018 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.model.heatextend; + + import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; + + import java.util.Map; + + public class AnnotationType { + + private String version; + private String description; + private Map properties; + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + } \ No newline at end of file diff --git a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java index 5442db244f..58ee1cadd0 100644 --- a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java +++ b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java @@ -1,35 +1,30 @@ -/*- - * ============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.datatypes.model.heatextend; - import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; - - +import java.util.Map; public class ParameterDefinitionExt extends ParameterDefinition { - String label; - Boolean hidden; - Boolean immutable; + private String label; + private Boolean hidden; + private Boolean immutable; + private Map annotations; public String getLabel() { return label; @@ -54,4 +49,13 @@ public class ParameterDefinitionExt extends ParameterDefinition { public void setImmutable(Boolean immutable) { this.immutable = immutable; } + + public Map getAnnotations() { + return annotations; + } + + public void setAnnotations(Map annotations) { + this.annotations = annotations; + } + } diff --git a/common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/_index.yml b/common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/_index.yml index 5c4cefb6ff..8f6d419536 100644 --- a/common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/_index.yml +++ b/common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/_index.yml @@ -32,4 +32,6 @@ imports: file: groups.yml - data: file: data.yml +- annotations: + file: annotations.yml diff --git a/common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/annotations.yml b/common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/annotations.yml new file mode 100644 index 0000000000..bfbf1c2d32 --- /dev/null +++ b/common/openecomp-tosca-datatype/src/main/resources/globalTypes/openecomp/annotations.yml @@ -0,0 +1,42 @@ +# +# 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. +# + +tosca_definitions_version: tosca_simple_yaml_1_1 + +metadata: + filename: openecomp/annotations.yml + version: '1.0' + +imports: +- openecomp_index: + file: _index.yml + +annotation_types: + + org.openecomp.annotations.Source: + description: Indicates the origin source of an input + properties: + source_type: + type: string + required: true + vf_module_label: + description: List of HEAT file name this input was originated from + type: list + required: true + entry_schema: + type: string + param_name: + type: string + required: false + description: Source parameter name \ No newline at end of file -- cgit 1.2.3-korg