summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuji7 <lu.ji3@zte.com.cn>2017-09-26 15:44:06 +0800
committerLuji7 <lu.ji3@zte.com.cn>2017-09-26 15:44:17 +0800
commit2266ce0436b3d0f50dcdb39f16b71102dd6defd6 (patch)
treed8e90cccd2f0e805ac70dcca63b0dedabc9cd0a4
parentfe6a23e857b466b9b99c547f659b7d4fffca5bce (diff)
ns and vf package distribution
Change-Id: I0caba0dbd2719c008e5d9ffa0b89a5552ed15c4d Issue-Id: USECASEUI-39 Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java26
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java10
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java38
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Csar.java29
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/DistributionResult.java43
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Job.java29
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/JobStatus.java39
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/ResponseDescriptor.java69
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/exceptions/VfcException.java23
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java42
-rw-r--r--standalone/src/main/assembly/resources/bin/initDB.sh50
-rw-r--r--standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createdb.sql31
-rw-r--r--standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createobj.sql111
13 files changed, 534 insertions, 6 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java
index 05364b24..75db524c 100644
--- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java
+++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/PackageDistributionController.java
@@ -17,13 +17,15 @@ package org.onap.usecaseui.server.controller.lcm;
import org.onap.usecaseui.server.bean.lcm.VfNsPackageInfo;
import org.onap.usecaseui.server.service.lcm.PackageDistributionService;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Csar;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.DistributionResult;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Job;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.JobStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -42,4 +44,22 @@ public class PackageDistributionController {
public VfNsPackageInfo instantiateService(){
return packageDistributionService.retrievePackageInfo();
}
+
+ @ResponseBody
+ @RequestMapping(value = {"/lcm/ns-packages"}, method = RequestMethod.POST , produces = "application/json")
+ public DistributionResult distributeNsPackage(@RequestBody Csar csar){
+ return packageDistributionService.postNsPackage(csar);
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/lcm/vf-packages"}, method = RequestMethod.POST , produces = "application/json")
+ public Job distributeVfPackage(@RequestBody Csar csar){
+ return packageDistributionService.postVfPackage(csar);
+ }
+
+ @ResponseBody
+ @RequestMapping(value = {"/lcm/jobs/{jobId}"}, method = RequestMethod.POST , produces = "application/json")
+ public JobStatus getJobStatus(@PathVariable(value="jobId") String jobId){
+ return packageDistributionService.getJobStatus(jobId);
+ }
}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java
index 867df4d4..2778613e 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/PackageDistributionService.java
@@ -16,8 +16,18 @@
package org.onap.usecaseui.server.service.lcm;
import org.onap.usecaseui.server.bean.lcm.VfNsPackageInfo;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Csar;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.DistributionResult;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Job;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.JobStatus;
public interface PackageDistributionService {
VfNsPackageInfo retrievePackageInfo();
+
+ DistributionResult postNsPackage(Csar csar);
+
+ Job postVfPackage(Csar csar);
+
+ JobStatus getJobStatus(String jobId);
}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java
new file mode 100644
index 00000000..9c7aa2b5
--- /dev/null
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2016-2017 ZTE Corporation.
+ *
+ * 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.onap.usecaseui.server.service.lcm.domain.vfc;
+
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Csar;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.DistributionResult;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Job;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.JobStatus;
+import retrofit2.Call;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.POST;
+import retrofit2.http.Path;
+
+public interface VfcService {
+
+ @POST("/nspackages")
+ Call<DistributionResult> distributeNsPackage(@Body Csar csar);
+
+ @POST("/vnfpackages")
+ Call<Job> distributeVnfPackage(@Body Csar csar);
+
+ @GET("/jobs/{jobId}")
+ Call<JobStatus> getJobStatus(@Path("jobId") String jobId);
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Csar.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Csar.java
new file mode 100644
index 00000000..f33a0a85
--- /dev/null
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Csar.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2016-2017 ZTE Corporation.
+ *
+ * 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.onap.usecaseui.server.service.lcm.domain.vfc.beans;
+
+public class Csar {
+
+ private String csarId;
+
+ public String getCsarId() {
+ return csarId;
+ }
+
+ public void setCsarId(String csarId) {
+ this.csarId = csarId;
+ }
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/DistributionResult.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/DistributionResult.java
new file mode 100644
index 00000000..8d74a576
--- /dev/null
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/DistributionResult.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2016-2017 ZTE Corporation.
+ *
+ * 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.onap.usecaseui.server.service.lcm.domain.vfc.beans;
+
+public class DistributionResult {
+
+ private String status;
+
+ private String statusDescription;
+
+ private String errorCode;
+
+ public DistributionResult(String status, String statusDescription, String errorCode) {
+ this.status = status;
+ this.statusDescription = statusDescription;
+ this.errorCode = errorCode;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public String getStatusDescription() {
+ return statusDescription;
+ }
+
+ public String getErrorCode() {
+ return errorCode;
+ }
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Job.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Job.java
new file mode 100644
index 00000000..59703539
--- /dev/null
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/Job.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2016-2017 ZTE Corporation.
+ *
+ * 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.onap.usecaseui.server.service.lcm.domain.vfc.beans;
+
+public class Job {
+
+ private String jobId;
+
+ public String getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
+ }
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/JobStatus.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/JobStatus.java
new file mode 100644
index 00000000..2a64b5bd
--- /dev/null
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/JobStatus.java
@@ -0,0 +1,39 @@
+/**
+ * Copyright 2016-2017 ZTE Corporation.
+ *
+ * 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.onap.usecaseui.server.service.lcm.domain.vfc.beans;
+
+public class JobStatus {
+
+ private String jobId;
+
+ private ResponseDescriptor responseDescriptor;
+
+ public String getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
+ }
+
+ public ResponseDescriptor getResponseDescriptor() {
+ return responseDescriptor;
+ }
+
+ public void setResponseDescriptor(ResponseDescriptor responseDescriptor) {
+ this.responseDescriptor = responseDescriptor;
+ }
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/ResponseDescriptor.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/ResponseDescriptor.java
new file mode 100644
index 00000000..2dd5c3da
--- /dev/null
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/beans/ResponseDescriptor.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright 2016-2017 ZTE Corporation.
+ *
+ * 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.onap.usecaseui.server.service.lcm.domain.vfc.beans;
+
+public class ResponseDescriptor {
+
+ private String status;
+
+ private String progress;
+
+ private String statusDescription;
+
+ private String errorCode;
+
+ private String responseId;
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getProgress() {
+ return progress;
+ }
+
+ public void setProgress(String progress) {
+ this.progress = progress;
+ }
+
+ public String getStatusDescription() {
+ return statusDescription;
+ }
+
+ public void setStatusDescription(String statusDescription) {
+ this.statusDescription = statusDescription;
+ }
+
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(String errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getResponseId() {
+ return responseId;
+ }
+
+ public void setResponseId(String responseId) {
+ this.responseId = responseId;
+ }
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/exceptions/VfcException.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/exceptions/VfcException.java
new file mode 100644
index 00000000..3b499427
--- /dev/null
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/exceptions/VfcException.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright 2016-2017 ZTE Corporation.
+ *
+ * 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.onap.usecaseui.server.service.lcm.domain.vfc.exceptions;
+
+public class VfcException extends RuntimeException {
+
+ public VfcException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
index 477e4579..383ee296 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java
@@ -23,7 +23,12 @@ import org.onap.usecaseui.server.service.lcm.domain.sdc.SDCCatalogService;
import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.SDCServiceTemplate;
import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.Vnf;
import org.onap.usecaseui.server.service.lcm.domain.sdc.exceptions.SDCCatalogException;
-import org.onap.usecaseui.server.util.RestfulServices;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.VfcService;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Csar;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.DistributionResult;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.Job;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.beans.JobStatus;
+import org.onap.usecaseui.server.service.lcm.domain.vfc.exceptions.VfcException;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Service;
@@ -31,6 +36,7 @@ import java.io.IOException;
import java.util.List;
import static org.onap.usecaseui.server.service.lcm.domain.sdc.consts.SDCConsts.*;
+import static org.onap.usecaseui.server.util.RestfulServices.create;
@Service("PackageDistributionService")
@org.springframework.context.annotation.Configuration
@@ -41,13 +47,16 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
private AAIService aaiService;
+ private VfcService vfcService;
+
public DefaultPackageDistributionService() {
- this(RestfulServices.create(SDCCatalogService.class), RestfulServices.create(AAIService.class));
+ this(create(SDCCatalogService.class), create(AAIService.class), create(VfcService.class));
}
- public DefaultPackageDistributionService(SDCCatalogService sdcCatalogService, AAIService aaiService) {
+ public DefaultPackageDistributionService(SDCCatalogService sdcCatalogService, AAIService aaiService, VfcService vfcService) {
this.sdcCatalogService = sdcCatalogService;
this.aaiService = aaiService;
+ this.vfcService = vfcService;
}
@Override
@@ -61,4 +70,31 @@ public class DefaultPackageDistributionService implements PackageDistributionSer
throw new SDCCatalogException("SDC Service is not available!", e);
}
}
+
+ @Override
+ public DistributionResult postNsPackage(Csar csar) {
+ try {
+ return vfcService.distributeNsPackage(csar).execute().body();
+ } catch (IOException e) {
+ throw new VfcException("VFC service is not available!", e);
+ }
+ }
+
+ @Override
+ public Job postVfPackage(Csar csar) {
+ try {
+ return vfcService.distributeVnfPackage(csar).execute().body();
+ } catch (IOException e) {
+ throw new VfcException("VFC service is not available!", e);
+ }
+ }
+
+ @Override
+ public JobStatus getJobStatus(String jobId) {
+ try {
+ return vfcService.getJobStatus(jobId).execute().body();
+ } catch (IOException e) {
+ throw new VfcException("VFC service is not available!", e);
+ }
+ }
}
diff --git a/standalone/src/main/assembly/resources/bin/initDB.sh b/standalone/src/main/assembly/resources/bin/initDB.sh
new file mode 100644
index 00000000..06d2bfc8
--- /dev/null
+++ b/standalone/src/main/assembly/resources/bin/initDB.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# Copyright (C) 2017 CMCC, Inc. and others. All rights reserved.
+#
+# 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.
+#
+
+DIRNAME=`dirname $0`
+HOME=`cd $DIRNAME/; pwd`
+user=$1
+password=$2
+port=$3
+host=$4
+echo "start create usecase-ui db"
+sql_path=$HOME/../
+mysql -u$user -p$password -P$port -h$host <$sql_path/dbscripts/mysql/usecase-ui-createdb.sql
+sql_result=$?
+if [ $sql_result != 0 ] ; then
+ echo "failed to create usecase-ui database"
+ exit 1
+fi
+fileFlag=*createobj.sql
+location=$sql_path/dbscripts/mysql
+fileName=""
+for i in `ls $location`
+do
+ if [[ $i == ${fileFlag} ]];then
+ fileName=${i};
+ echo "start create table:${fileName}"
+ mysql -u$user -p$password -P$port -h$host <$sql_path/dbscripts/mysql/$fileName
+ sql_result=$?
+ if [ $sql_result != 0 ] ; then
+ echo "failed to init usecase-ui table:${fileName}"
+ exit 1
+ fi
+ fi
+done
+echo "init usecase-ui database success!"
+exit 0
+
diff --git a/standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createdb.sql b/standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createdb.sql
new file mode 100644
index 00000000..31ab5b5e
--- /dev/null
+++ b/standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createdb.sql
@@ -0,0 +1,31 @@
+--
+-- Copyright (C) 2017 CMCC, Inc. and others. All rights reserved.
+--
+-- 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.
+--
+
+/******************drop old database and user***************************/
+use mysql;
+drop database IF EXISTS usercaseui;
+delete from user where User='usecaseui';
+FLUSH PRIVILEGES;
+
+/******************create new database and user***************************/
+create database usercaseui CHARACTER SET utf8;
+
+GRANT ALL PRIVILEGES ON usercaseui.* TO 'usercaseui'@'%' IDENTIFIED BY 'usercaseui' WITH GRANT OPTION;
+GRANT ALL PRIVILEGES ON mysql.* TO 'usercaseui'@'%' IDENTIFIED BY 'usercaseui' WITH GRANT OPTION;
+
+GRANT ALL PRIVILEGES ON usercaseui.* TO 'usercaseui'@'localhost' IDENTIFIED BY 'usercaseui' WITH GRANT OPTION;
+GRANT ALL PRIVILEGES ON mysql.* TO 'usercaseui'@'localhost' IDENTIFIED BY 'usercaseui' WITH GRANT OPTION;
+FLUSH PRIVILEGES; \ No newline at end of file
diff --git a/standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createobj.sql b/standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createobj.sql
new file mode 100644
index 00000000..7a55c72b
--- /dev/null
+++ b/standalone/src/main/assembly/resources/dbscripts/mysql/usecase-ui-createobj.sql
@@ -0,0 +1,111 @@
+--
+-- Copyright (C) 2017 CMCC, Inc. and others. All rights reserved.
+--
+-- 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.
+--
+
+use usercaseui;
+
+SET FOREIGN_KEY_CHECKS=0;
+-- ----------------------------
+-- Table structure for alarms_additionalinformation
+-- ----------------------------
+DROP TABLE IF EXISTS `alarms_additionalinformation`;
+CREATE TABLE `alarms_additionalinformation` (
+ `name` varchar(50) NOT NULL,
+ `value` varchar(500) NOT NULL,
+ `eventId` varchar(30) NOT NULL,
+ `createTime` datetime NOT NULL,
+ `updateTime` datetime NOT NULL,
+ PRIMARY KEY (`name`,`eventId`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Table structure for alarms_commoneventheader
+-- ----------------------------
+DROP TABLE IF EXISTS `alarms_commoneventheader`;
+CREATE TABLE `alarms_commoneventheader` (
+ `version` varchar(10) NOT NULL,
+ `eventName` varchar(50) NOT NULL,
+ `domain` varchar(30) NOT NULL,
+ `eventId` varchar(30) NOT NULL,
+ `eventType` varchar(30) NOT NULL,
+ `nfcNamingCode` varchar(30) DEFAULT NULL,
+ `nfNamingCode` varchar(30) DEFAULT NULL,
+ `sourceId` varchar(50) NOT NULL,
+ `sourceName` varchar(50) NOT NULL,
+ `reportingEntityId` varchar(30) NOT NULL,
+ `reportingEntityName` varchar(30) NOT NULL,
+ `priority` varchar(20) NOT NULL,
+ `startEpochMicrosec` varchar(20) NOT NULL,
+ `lastEpochMicroSec` varchar(20) NOT NULL,
+ `sequence` varchar(10) NOT NULL,
+ `faultFieldsVersion` varchar(10) NOT NULL,
+ `eventServrity` varchar(30) NOT NULL,
+ `eventSourceType` varchar(30) NOT NULL,
+ `eventCategory` varchar(30) NOT NULL,
+ `alarmCondition` varchar(400) NOT NULL,
+ `specificProblem` varchar(400) NOT NULL,
+ `vfStatus` varchar(10) NOT NULL,
+ `alarmInterfaceA` varchar(40) NOT NULL,
+ `status` varchar(11) NOT NULL,
+ `createTime` datetime NOT NULL,
+ `updateTime` datetime NOT NULL,
+ PRIMARY KEY (`eventId`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Table structure for performance_additionalinformation
+-- ----------------------------
+DROP TABLE IF EXISTS `performance_additionalinformation`;
+CREATE TABLE `performance_additionalinformation` (
+ `name` varchar(50) NOT NULL,
+ `value` varchar(500) NOT NULL,
+ `eventId` varchar(30) NOT NULL,
+ `createTime` datetime NOT NULL,
+ `updateTime` datetime NOT NULL,
+ PRIMARY KEY (`name`,`eventId`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Table structure for performance_commoneventheader
+-- ----------------------------
+DROP TABLE IF EXISTS `performance_commoneventheader`;
+CREATE TABLE `performance_commoneventheader` (
+ `version` varchar(10) NOT NULL,
+ `eventName` varchar(50) NOT NULL,
+ `domain` varchar(30) NOT NULL,
+ `eventId` varchar(30) NOT NULL,
+ `eventType` varchar(30) NOT NULL,
+ `nfcNamingCode` varchar(30) DEFAULT NULL,
+ `nfNamingCode` varchar(30) DEFAULT NULL,
+ `sourceId` varchar(50) NOT NULL,
+ `sourceName` varchar(50) NOT NULL,
+ `reportingEntityId` varchar(30) NOT NULL,
+ `reportingEntityName` varchar(30) NOT NULL,
+ `priority` varchar(20) NOT NULL,
+ `startEpochMicrosec` varchar(20) NOT NULL,
+ `lastEpochMicroSec` varchar(20) NOT NULL,
+ `sequence` varchar(10) NOT NULL,
+ `measurementsForVfScalingVersion` varchar(10) NOT NULL,
+ `measurementInterval` varchar(10) NOT NULL,
+ `createTime` datetime NOT NULL,
+ `updateTime` datetime NOT NULL,
+ PRIMARY KEY (`eventId`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Init Records
+-- ----------------------------
+INSERT INTO `alarms_additionalinformation` VALUES ('name', 'value', 'eventId', '2017-09-19 11:12:34', '2017-09-19 11:12:34');
+INSERT INTO `alarms_commoneventheader` VALUES ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '2017-09-04 15:25:11', '2017-09-11 15:25:19');