summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test
diff options
context:
space:
mode:
authorsiddharth0905 <siddharth.singh4@amdocs.com>2019-04-10 17:49:51 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2019-04-11 07:11:04 +0000
commit6896c1b309aaa50dca820169b9f1ae3f8af84294 (patch)
tree8da13382863f2e4adc9724dd046b535032ae58c7 /catalog-be/src/test
parent4568e48647b15b5654a669651ddf536d590288b0 (diff)
Apply Valid Value Constraints validation
Apply Valid Value Constraints validation for FE and BE in Property Assignment, Input, Service Consumption screen Change-Id: I01c7523bad702f003cd52fd88bc69fe950b2b4f3 Issue-ID: SDC-2224 Signed-off-by: siddharth0905 <siddharth.singh4@amdocs.com>
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtilTest.java317
-rw-r--r--catalog-be/src/test/resources/csars/with_groups.csarbin65804 -> 65799 bytes
-rw-r--r--catalog-be/src/test/resources/types/datatypes/constraintTest.json405
3 files changed, 722 insertions, 0 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtilTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtilTest.java
new file mode 100644
index 0000000000..95020b6112
--- /dev/null
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtilTest.java
@@ -0,0 +1,317 @@
+package org.openecomp.sdc.be.datamodel.utils;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+import fj.data.Either;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.openecomp.sdc.be.components.impl.ResponseFormatManager;
+import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
+import org.openecomp.sdc.be.model.ComponentInstanceProperty;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
+import org.openecomp.sdc.be.model.InputDefinition;
+import org.openecomp.sdc.be.model.PropertyConstraint;
+import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache;
+import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
+import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
+import org.openecomp.sdc.exception.ResponseFormat;
+
+public class PropertyValueConstraintValidationUtilTest {
+
+ @Mock
+ ApplicationDataTypeCache applicationDataTypeCache;
+
+ @Mock
+ ToscaOperationFacade toscaOperationFacade;
+
+ @Spy
+ @InjectMocks
+ PropertyValueConstraintValidationUtil propertyValueConstraintValidationUtil;
+
+ private Map<String, DataTypeDefinition> dataTypeDefinitionMap;
+
+ @Before
+ public void init() {
+ MockitoAnnotations.initMocks(this);
+ ResponseFormatManager responseFormatManagerMock = Mockito.mock(ResponseFormatManager.class);
+ when(responseFormatManagerMock.getResponseFormat(any())).thenReturn(new ResponseFormat());
+ when(responseFormatManagerMock.getResponseFormat(any(), any())).thenReturn(new ResponseFormat());
+ when(responseFormatManagerMock.getResponseFormat(any(), any(), any())).thenReturn(new ResponseFormat());
+ when(propertyValueConstraintValidationUtil.getResponseFormatManager()).thenReturn(responseFormatManagerMock);
+
+ createDataTypeMap();
+ }
+
+ @Test
+ public void primitiveValueSuccessTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("integer");
+ propertyDefinition.setValue("10");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isLeft());
+ }
+
+ @Test
+ public void primitiveValueFailTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("integer");
+ propertyDefinition.setValue("abcd");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isRight());
+ }
+
+ @Test
+ public void complexWithValidValueSuccessTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"prefixlen\":\"4\"}");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isLeft());
+ }
+
+ @Test
+ public void complexWithValidValueFailTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"prefixlen\":\"5\"}");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isRight());
+ }
+
+ @Test
+ public void complexWithListWithPrimitiveValueSuccessTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"allocation_pools\":[\"slaac\"]}");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isLeft());
+ }
+
+ @Test
+ public void complexWithListWithPrimitiveValueFailTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"allocation_pools\":[\"value\"]}");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isRight());
+ }
+
+ @Test
+ public void complexWithMapWithPrimitiveValueSuccessTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"value_specs\":{\"key\":\"slaac\"}}");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isLeft());
+ }
+
+ @Test
+ public void complexWithMapWithPrimitiveValueFailTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"value_specs\":{\"key\":\"value\"}}");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isRight());
+ }
+
+ @Test
+ public void inputValidValueSuccessTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ InputDefinition inputDefinition = new InputDefinition();
+ inputDefinition.setInputPath("propetyName#ipv6_ra_mode");
+ inputDefinition.setDefaultValue("slaac");
+ inputDefinition.setType("string");
+ ComponentInstanceProperty propertyDefinition = new ComponentInstanceProperty();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ inputDefinition.setProperties(Collections.singletonList(propertyDefinition));
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(inputDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isLeft());
+ }
+
+ @Test
+ public void inputValidValueFailTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ InputDefinition inputDefinition = new InputDefinition();
+ inputDefinition.setInputPath("propetyName#ipv6_ra_mode");
+ inputDefinition.setDefaultValue("incorrectValue");
+ ComponentInstanceProperty propertyDefinition = new ComponentInstanceProperty();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ inputDefinition.setProperties(Collections.singletonList(propertyDefinition));
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(inputDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isRight());
+ }
+
+ @Test
+ public void serviceConsumptionValidValueSuccessTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"ipv6_ra_mode\":\"slaac\"}");
+ propertyDefinition.setName("ipv6_ra_mode");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isLeft());
+ }
+ @Test
+ public void serviceConsumptionValidValueFailTest() {
+ Either<Map<String, DataTypeDefinition>, TitanOperationStatus> either = Either.left(dataTypeDefinitionMap);
+ Mockito.when(applicationDataTypeCache.getAll()).thenReturn(either);
+
+ PropertyDefinition propertyDefinition = new PropertyDefinition();
+ propertyDefinition.setType("org.openecomp.datatypes.heat.network.neutron.Subnet");
+ propertyDefinition.setValue("{\"ipv6_ra_mode\":\"incorrectValue\"}");
+ propertyDefinition.setName("ipv6_ra_mode");
+
+ Either<Boolean, ResponseFormat> responseEither =
+ propertyValueConstraintValidationUtil.validatePropertyConstraints(
+ Collections.singletonList(propertyDefinition), applicationDataTypeCache);
+
+ Assert.assertTrue(responseEither.isRight());
+ }
+
+ private void createDataTypeMap() {
+ Type constraintType = new TypeToken<PropertyConstraint>() {}.getType();
+ Type typeOfHashMap = new TypeToken<Map<String, DataTypeDefinition>>() { }.getType();
+ Gson gson = new GsonBuilder().registerTypeAdapter(constraintType,
+ new PropertyOperation.PropertyConstraintDeserialiser()).create();
+
+ dataTypeDefinitionMap = gson.fromJson(readFile(), typeOfHashMap);
+
+ DataTypeDefinition dataTypeDefinition = dataTypeDefinitionMap.get("org.openecomp.datatypes.heat.network"
+ + ".neutron.Subnet");
+
+ PropertyDefinition mapProperty = null;
+ PropertyDefinition listProperty = null;
+ List<PropertyConstraint> constraints = null;
+ for (PropertyDefinition propertyDefinition : dataTypeDefinition.getProperties()) {
+ if ("value_specs".equals(propertyDefinition.getName())) {
+ mapProperty = propertyDefinition;
+ } else if ("allocation_pools".equals(propertyDefinition.getName())) {
+ listProperty = propertyDefinition;
+ } else if ("ipv6_ra_mode".equals(propertyDefinition.getName())) {
+ constraints = propertyDefinition.getConstraints();
+ }
+ }
+
+ PropertyDefinition definition = new PropertyDefinition(mapProperty.getSchema().getProperty());
+ definition.setConstraints(constraints);
+ mapProperty.getSchema().setProperty(definition);
+
+ definition = new PropertyDefinition(listProperty.getSchema().getProperty());
+ definition.setConstraints(constraints);
+ listProperty.getSchema().setProperty(definition);
+ }
+
+ private static String readFile() {
+ StringBuilder stringBuilder = new StringBuilder();
+ File file = new File(Objects.requireNonNull(
+ PropertyValueConstraintValidationUtilTest.class.getClassLoader().getResource("types/datatypes"
+ + "/constraintTest.json")).getFile());
+ Path logFile = Paths.get(file.getAbsolutePath());
+ try (BufferedReader reader = Files.newBufferedReader(logFile, StandardCharsets.UTF_8)) {
+ reader.lines().forEach(stringBuilder::append);
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ e.printStackTrace();
+ }
+ return stringBuilder.toString();
+ }
+
+}
diff --git a/catalog-be/src/test/resources/csars/with_groups.csar b/catalog-be/src/test/resources/csars/with_groups.csar
index 3859114aa5..3a9e9ab8e0 100644
--- a/catalog-be/src/test/resources/csars/with_groups.csar
+++ b/catalog-be/src/test/resources/csars/with_groups.csar
Binary files differ
diff --git a/catalog-be/src/test/resources/types/datatypes/constraintTest.json b/catalog-be/src/test/resources/types/datatypes/constraintTest.json
new file mode 100644
index 0000000000..9596e92436
--- /dev/null
+++ b/catalog-be/src/test/resources/types/datatypes/constraintTest.json
@@ -0,0 +1,405 @@
+{
+ "string": {
+ "derivedFrom": {
+ "name": "tosca.datatypes.Root",
+ "uniqueId": "tosca.datatypes.Root.datatype",
+ "description": "The TOSCA root Data Type all other TOSCA base Data Types derive from",
+ "creationTime": 1550136563278,
+ "modificationTime": 1550136563278,
+ "toscaPresentation": {}
+ },
+ "name": "string",
+ "uniqueId": "string.datatype",
+ "derivedFromName": "tosca.datatypes.Root",
+ "creationTime": 1550136564103,
+ "modificationTime": 1550136564103,
+ "toscaPresentation": {}
+ },
+ "org.openecomp.datatypes.heat.network.neutron.Subnet": {
+ "derivedFrom": {
+ "name": "tosca.datatypes.Root",
+ "uniqueId": "tosca.datatypes.Root.datatype",
+ "description": "The TOSCA root Data Type all other TOSCA base Data Types derive from",
+ "creationTime": 1550136563278,
+ "modificationTime": 1550136563278,
+ "toscaPresentation": {}
+ },
+ "properties": [
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.tenant_id",
+ "type": "string",
+ "required": false,
+ "definition": false,
+ "description": "The ID of the tenant who owns the network",
+ "password": false,
+ "name": "tenant_id",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.enable_dhcp",
+ "type": "boolean",
+ "required": false,
+ "definition": false,
+ "defaultValue": "true",
+ "description": "Set to true if DHCP is enabled and false if DHCP is disabled",
+ "password": false,
+ "name": "enable_dhcp",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "constraints": [
+ {
+ "validValues": [
+ "dhcpv6-stateful",
+ "dhcpv6-stateless",
+ "slaac"
+ ]
+ }
+ ],
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.ipv6_address_mode",
+ "type": "string",
+ "required": false,
+ "definition": false,
+ "description": "IPv6 address mode",
+ "password": false,
+ "name": "ipv6_address_mode",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "constraints": [
+ {
+ "validValues": [
+ "dhcpv6-stateful",
+ "dhcpv6-stateless",
+ "slaac"
+ ]
+ }
+ ],
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.ipv6_ra_mode",
+ "type": "string",
+ "required": false,
+ "definition": false,
+ "description": "IPv6 RA (Router Advertisement) mode",
+ "password": false,
+ "name": "ipv6_ra_mode",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.value_specs",
+ "type": "map",
+ "required": false,
+ "definition": false,
+ "defaultValue": "{}",
+ "description": "Extra parameters to include in the request",
+ "schema": {
+ "property": {
+ "constraints": [
+ {
+ "validValues": [
+ "dhcpv6-stateful",
+ "dhcpv6-stateless",
+ "slaac"
+ ]
+ }
+ ],
+ "type": "string",
+ "required": true,
+ "definition": false,
+ "password": false,
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ "toscaPresentation": {}
+ },
+ "password": false,
+ "name": "value_specs",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.allocation_pools",
+ "type": "list",
+ "required": false,
+ "definition": false,
+ "description": "The start and end addresses for the allocation pools",
+ "schema": {
+ "property": {
+ "type": "string",
+ "required": true,
+ "definition": false,
+ "password": false,
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ "toscaPresentation": {}
+ },
+ "password": false,
+ "name": "allocation_pools",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.subnetpool",
+ "type": "string",
+ "required": false,
+ "definition": false,
+ "description": "The name or ID of the subnet pool",
+ "password": false,
+ "name": "subnetpool",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.dns_nameservers",
+ "type": "list",
+ "required": false,
+ "definition": false,
+ "defaultValue": "[]",
+ "description": "A specified set of DNS name servers to be used",
+ "schema": {
+ "property": {
+ "type": "string",
+ "required": true,
+ "definition": false,
+ "password": false,
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ "toscaPresentation": {}
+ },
+ "password": false,
+ "name": "dns_nameservers",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.host_routes",
+ "type": "list",
+ "required": false,
+ "definition": false,
+ "description": "The gateway IP address",
+ "schema": {
+ "property": {
+ "type": "org.openecomp.datatypes.heat.network.subnet.HostRoute",
+ "required": true,
+ "definition": false,
+ "password": false,
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ "toscaPresentation": {}
+ },
+ "password": false,
+ "name": "host_routes",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "constraints": [
+ {
+ "validValues": [
+ "4",
+ "6"
+ ]
+ }
+ ],
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.ip_version",
+ "type": "integer",
+ "required": false,
+ "definition": false,
+ "defaultValue": "4",
+ "description": "The gateway IP address",
+ "password": false,
+ "name": "ip_version",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.name",
+ "type": "string",
+ "required": false,
+ "definition": false,
+ "description": "The name of the subnet",
+ "password": false,
+ "name": "name",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "constraints": [
+ {
+ "greaterOrEqual": "0"
+ },
+ {
+ "validValues": [
+ "4",
+ "6"
+ ]
+ }
+ ],
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.prefixlen",
+ "type": "integer",
+ "required": false,
+ "definition": false,
+ "description": "Prefix length for subnet allocation from subnet pool",
+ "password": false,
+ "name": "prefixlen",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.cidr",
+ "type": "string",
+ "required": false,
+ "definition": false,
+ "description": "The CIDR",
+ "password": false,
+ "name": "cidr",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.gateway_ip",
+ "type": "string",
+ "required": false,
+ "definition": false,
+ "description": "The gateway IP address",
+ "password": false,
+ "name": "gateway_ip",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ }
+ ],
+ "name": "org.openecomp.datatypes.heat.network.neutron.Subnet",
+ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype",
+ "derivedFromName": "tosca.datatypes.Root",
+ "description": "A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances",
+ "creationTime": 1550136564412,
+ "modificationTime": 1550136564464,
+ "toscaPresentation": {}
+ },
+ "org.openecomp.datatypes.heat.contrailV2.virtual.machine.subInterface.MacAddress": {
+ "derivedFrom": {
+ "name": "tosca.datatypes.Root",
+ "uniqueId": "tosca.datatypes.Root.datatype",
+ "description": "The TOSCA root Data Type all other TOSCA base Data Types derive from",
+ "creationTime": 1550136563278,
+ "modificationTime": 1550136563278,
+ "toscaPresentation": {}
+ },
+ "properties": [
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.contrailV2.virtual.machine.subInterface.MacAddress.datatype.mac_address",
+ "type": "list",
+ "required": false,
+ "definition": false,
+ "description": "Mac Addresses List.",
+ "schema": {
+ "property": {
+ "type": "string",
+ "required": true,
+ "definition": false,
+ "password": false,
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ "toscaPresentation": {}
+ },
+ "password": false,
+ "name": "mac_address",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ }
+ ],
+ "name": "org.openecomp.datatypes.heat.contrailV2.virtual.machine.subInterface.MacAddress",
+ "uniqueId": "org.openecomp.datatypes.heat.contrailV2.virtual.machine.subInterface.MacAddress.datatype",
+ "derivedFromName": "tosca.datatypes.Root",
+ "description": "Virtual Machine Sub Interface Mac Address.",
+ "creationTime": 1550136565026,
+ "modificationTime": 1550136565030,
+ "toscaPresentation": {}
+ },
+ "org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList": {
+ "derivedFrom": {
+ "name": "tosca.datatypes.Root",
+ "uniqueId": "tosca.datatypes.Root.datatype",
+ "description": "The TOSCA root Data Type all other TOSCA base Data Types derive from",
+ "creationTime": 1550136563278,
+ "modificationTime": 1550136563278,
+ "toscaPresentation": {}
+ },
+ "properties": [
+ {
+ "uniqueId": "org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList.datatype.network_policy_entries_policy_rule",
+ "type": "list",
+ "required": false,
+ "definition": false,
+ "description": "Contrail network rule",
+ "schema": {
+ "property": {
+ "type": "org.openecomp.datatypes.heat.contrailV2.network.rule.Rule",
+ "required": true,
+ "definition": false,
+ "password": false,
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ },
+ "toscaPresentation": {}
+ },
+ "password": false,
+ "name": "network_policy_entries_policy_rule",
+ "hidden": false,
+ "immutable": false,
+ "toscaPresentation": {}
+ }
+ ],
+ "name": "org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList",
+ "uniqueId": "org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList.datatype",
+ "derivedFromName": "tosca.datatypes.Root",
+ "description": "list of policy rules",
+ "creationTime": 1550136564716,
+ "modificationTime": 1550136564720,
+ "toscaPresentation": {}
+ },
+ "integer": {
+ "derivedFrom": {
+ "name": "tosca.datatypes.Root",
+ "uniqueId": "tosca.datatypes.Root.datatype",
+ "description": "The TOSCA root Data Type all other TOSCA base Data Types derive from",
+ "creationTime": 1550136563278,
+ "modificationTime": 1550136563278,
+ "toscaPresentation": {}
+ },
+ "name": "integer",
+ "uniqueId": "integer.datatype",
+ "derivedFromName": "tosca.datatypes.Root",
+ "creationTime": 1550136564094,
+ "modificationTime": 1550136564094,
+ "toscaPresentation": {}
+ }
+} \ No newline at end of file