summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-12-14 20:02:29 +0530
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-12-24 16:45:05 +0530
commit6addc71625d4ae32d74908fbeb0ce975f2fded9a (patch)
treef2cef0b4fcc3f595ae4a7dff62277a2ed3515ff2 /adapters
parent8521170839c30e240eac51b0daa5544293dac7b3 (diff)
update request input and sequence to DB
Update request input and sequence to DB. Resource sequence has been added as new column in service table. Resource input has been added as new column in resp resource. Change-Id: I97c8227636f06692190a843a87178517db038bbd Issue-ID: SO-1248 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java4
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.22__AddResourceInput.sql13
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/schema.sql4
6 files changed, 26 insertions, 1 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
index 7a215a9458..859666f446 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryAllottedResourceCustomization.java
@@ -52,7 +52,8 @@ public class QueryAllottedResourceCustomization extends CatalogQuery {
"\t\t\"nfFunction\" : <NF_FUNCTION>,\n"+
"\t\t\"nfType\" : <NF_TYPE>,\n"+
"\t\t\"nfRole\" : <NF_ROLE>,\n"+
- "\t\t\"nfNamingCode\" : <NF_NAMING_CODE>\n"+
+ "\t\t\"nfNamingCode\" : <NF_NAMING_CODE>,\n"+
+ "\t\t\"resourceInput\" : <RESOURCE_INPUT>\n"+
"\t}";
public QueryAllottedResourceCustomization() {
@@ -125,6 +126,7 @@ public class QueryAllottedResourceCustomization extends CatalogQuery {
put(valueMap, "PROVIDING_SERVICE_MODEL_INVARIANT_UUID", o.getProvidingServiceModelInvariantUUID());
put(valueMap, "PROVIDING_SERVICE_MODEL_UUID", o.getProvidingServiceModelUUID());
put(valueMap, "PROVIDING_SERVICE_MODEL_NAME", o.getProvidingServiceModelName());
+ put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
sb.append(sep).append(this.setTemplate(TEMPLATE, valueMap));
sep = ",\n";
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java
index 3b50871a8d..edbf9749c6 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceMacroHolder.java
@@ -45,6 +45,7 @@ public class QueryServiceMacroHolder extends CatalogQuery {
"\t\"serviceType\" : <SERVICE_TYPE>,\n"+
"\t\"serviceRole\" : <SERVICE_ROLE>,\n"+
"\t\"environmentContext\" : <ENVIRONMENT_CONTEXT>,\n"+
+ "\t\"resourceOrder\" : <RESOURCE_ORDER>,\n"+
"\t\"workloadContext\" : <WORKLOAD_CONTEXT>,\n"+
"<_SERVICEVNFS_>,\n"+
"<_SERVICENETWORKS_>,\n"+
@@ -81,6 +82,7 @@ public class QueryServiceMacroHolder extends CatalogQuery {
put(valueMap, "SERVICE_ROLE", service.getServiceRole());
put(valueMap, "ENVIRONMENT_CONTEXT", service.getEnvironmentContext());
put(valueMap, "WORKLOAD_CONTEXT", service.getWorkloadContext());
+ put(valueMap, "RESOURCE_ORDER", service.getResourceOrder());
String subitem;
subitem = new QueryServiceVnfs(service.getVnfCustomizations()).JSON2(true, true);
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
index a2256f724a..f7457fda4a 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceNetworks.java
@@ -50,6 +50,7 @@ public class QueryServiceNetworks extends CatalogQuery {
"\t\t\"toscaNodeType\" : <TOSCA_NODE_TYPE>,\n"+
"\t\t\"networkType\" : <NETWORK_TYPE>,\n"+
"\t\t\"networkTechnology\" : <NETWORK_TECHNOLOGY>,\n"+
+ "\t\t\"resourceInput\" : <RESOURCE_INPUT>,\n"+
"\t\t\"networkRole\" : <NETWORK_ROLE>,\n"+
"\t\t\"networkScope\" : <NETWORK_SCOPE>\n"+
"\t}";
@@ -116,6 +117,7 @@ public class QueryServiceNetworks extends CatalogQuery {
put(valueMap, "NETWORK_ROLE", o.getNetworkRole());
put(valueMap, "NETWORK_SCOPE", o.getNetworkScope());
put(valueMap, "NETWORK_TECHNOLOGY", o.getNetworkTechnology());
+ put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
sb.append(sep).append(this.setTemplate(TEMPLATE, valueMap));
sep = ",\n";
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
index 82b6aa2aeb..4170047e0b 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryServiceVnfs.java
@@ -53,6 +53,7 @@ public class QueryServiceVnfs extends CatalogQuery {
"\t\"nfRole\" : <NF_ROLE>,\n"+
"\t\"nfNamingCode\" : <NF_NAMING_CODE>,\n"+
"\t\"multiStageDesign\" : <MULTI_STEP_DESIGN>,\n"+
+ "\t\"resourceInput\" : <RESOURCE_INPUT>,\n"+
"<_VFMODULES_>\n" +
"\t}";
@@ -119,6 +120,7 @@ public class QueryServiceVnfs extends CatalogQuery {
put(valueMap, "NF_ROLE", o.getNfRole());
put(valueMap, "NF_NAMING_CODE", o.getNfNamingCode());
put(valueMap, "MULTI_STEP_DESIGN", o.getMultiStageDesign());
+ put(valueMap, "RESOURCE_INPUT", o.getResourceInput());
String subitem = new QueryVfModule(vrNull ? null : o.getVfModuleCustomizations()).JSON2(true, true);
valueMap.put("_VFMODULES_", subitem.replaceAll("(?m)^", "\t\t"));
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.22__AddResourceInput.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.22__AddResourceInput.sql
new file mode 100644
index 0000000000..10d8789328
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.22__AddResourceInput.sql
@@ -0,0 +1,13 @@
+use catalogdb;
+
+ALTER TABLE service
+ADD RESOURCE_ORDER varchar(255);
+
+ALTER TABLE vnf_resource_customization
+ADD RESOURCE_INPUT varchar(2000);
+
+ALTER TABLE network_resource_customization
+ADD RESOURCE_INPUT varchar(2000);
+
+ALTER TABLE allotted_resource_customization
+ADD RESOURCE_INPUT varchar(2000); \ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index a051417cc1..eff5c632fa 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -28,6 +28,7 @@ create table `allotted_resource_customization` (
`min_instances` int(11) default null,
`max_instances` int(11) default null,
`ar_model_uuid` varchar(200) not null,
+ `resource_input` varchar(2000) default null,
`creation_timestamp` datetime not null default current_timestamp,
primary key (`model_customization_uuid`),
key `fk_allotted_resource_customization__allotted_resource1_idx` (`ar_model_uuid`),
@@ -168,6 +169,7 @@ create table `network_resource_customization` (
`network_scope` varchar(45) default null,
`creation_timestamp` datetime not null default current_timestamp,
`network_resource_model_uuid` varchar(200) not null,
+ `resource_input` varchar(2000) default null,
primary key (`model_customization_uuid`),
key `fk_network_resource_customization__network_resource1_idx` (`network_resource_model_uuid`),
constraint `fk_network_resource_customization__network_resource1` foreign key (`network_resource_model_uuid`) references `network_resource` (`model_uuid`) on delete cascade on update cascade
@@ -203,6 +205,7 @@ create table `service` (
`service_role` varchar(200) default null,
`environment_context` varchar(200) default null,
`workload_context` varchar(200) default null,
+ `resource_order` varchar(200) default null,
primary key (`model_uuid`),
key `fk_service__tosca_csar1_idx` (`tosca_csar_artifact_uuid`),
constraint `fk_service__tosca_csar1` foreign key (`tosca_csar_artifact_uuid`) references `tosca_csar` (`artifact_uuid`) on delete cascade on update cascade
@@ -381,6 +384,7 @@ create table `vnf_resource_customization` (
`creation_timestamp` datetime not null default current_timestamp,
`vnf_resource_model_uuid` varchar(200) not null,
`multi_stage_design` varchar(20) default null,
+ `resource_input` varchar(2000) default null,
primary key (`model_customization_uuid`),
key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade