diff options
Diffstat (limited to 'juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources')
7 files changed, 1231 insertions, 0 deletions
diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/db.properties b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/db.properties new file mode 100644 index 0000000..8f9dbb4 --- /dev/null +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/db.properties @@ -0,0 +1,20 @@ +# +# Copyright 2016 Huawei Technologies Co., Ltd. +# +# 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. +# + +jdbc.username=root +jdbc.password=rootpass +jdbc.url=jdbc:mysql://127.0.0.1:3306/jujuvnfmdb +jdbc.driverClassName=com.mysql.jdbc.Driver
\ No newline at end of file diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/juju-config.properties b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/juju-config.properties new file mode 100644 index 0000000..1141561 --- /dev/null +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/juju-config.properties @@ -0,0 +1,26 @@ +############################################################################### +# Copyright 2016 Huawei Technologies Co., Ltd. +# +# 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. +############################################################################### +catalog_download_url=http://127.0.0.1:8080/abc.csar +charmPath=/opt/csar/ +jujuvnfm_server_url=http://127.0.0.1:8080/juju-vnfmadapter-service +grant_jujuvnfm_url=http://127.0.0.1:8080/juju-vnfmadapter-service +juju_cmd_res_file=E:/juju/response/result.json + +juju_add_model_cmd= +juju_switch_model_cmd= +juju_deploy_cmd= +juju_status_cmd= +juju_destroy_model= diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/log4j.properties b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/log4j.properties new file mode 100644 index 0000000..7fc5d67 --- /dev/null +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/log4j.properties @@ -0,0 +1,28 @@ +############################################################################### +# Copyright 2016 Huawei Technologies Co., Ltd. +# +# 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. +############################################################################### +log4j.rootLogger=INFO,root +log4j.logger.org.openo.nfvo=DEBUG,stdout +log4j.appender.root.Append=true +log4j.appender.root.File=${catalina.base}/logs/jujuvnfmadapterservice.log +log4j.appender.root.layout.ConversionPattern=%d %-5p [%t][%X{moduleID}][%C %L] %m%n +log4j.appender.root.layout=org.apache.log4j.PatternLayout +log4j.appender.root.MaxBackupIndex=50 +log4j.appender.root.MaxFileSize=20MB +log4j.appender.root=org.apache.log4j.RollingFileAppender + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t][%X{moduleID}][%C %L] %m%n
\ No newline at end of file diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/mybatis/mysql/JujuVnfmInfoMapper.xml b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/mybatis/mysql/JujuVnfmInfoMapper.xml new file mode 100644 index 0000000..39d76b7 --- /dev/null +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/mybatis/mysql/JujuVnfmInfoMapper.xml @@ -0,0 +1,382 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2016 Huawei Technologies Co., Ltd. + + 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. + --> + +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper + namespace="org.openo.nfvo.jujuvnfmadapter.service.mapper.JujuVnfmInfoMapper"> + <resultMap id="BaseResultMap" + type="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfo"> + <id column="ID" property="id" jdbcType="VARCHAR" /> + <result column="VNFM_ID" property="vnfmId" jdbcType="VARCHAR" /> + <result column="VNF_ID" property="vnfId" jdbcType="VARCHAR" /> + <result column="APP_NAME" property="appName" jdbcType="VARCHAR" /> + <result column="JOB_ID" property="jobId" jdbcType="VARCHAR" /> + <result column="STATUS" property="status" jdbcType="INTEGER" /> + <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" /> + <result column="MODIFY_TIME" property="modifyTime" jdbcType="TIMESTAMP" /> + <result column="DELETE_TIME" property="deleteTime" jdbcType="TIMESTAMP" /> + </resultMap> + <resultMap id="ResultMapWithBLOBs" + type="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfo" + extends="BaseResultMap"> + <result column="EXTEND" property="extend" jdbcType="LONGVARCHAR" /> + </resultMap> + <sql id="Example_Where_Clause"> + <where> + <foreach collection="oredCriteria" item="criteria" separator="or"> + <if test="criteria.valid"> + <trim prefix="(" suffix=")" prefixOverrides="and"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and + #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach collection="criterion.value" item="listItem" + open="(" close=")" separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> + </foreach> + </where> + </sql> + <sql id="Update_By_Example_Where_Clause"> + <where> + <foreach collection="example.oredCriteria" item="criteria" + separator="or"> + <if test="criteria.valid"> + <trim prefix="(" suffix=")" prefixOverrides="and"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and + #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach collection="criterion.value" item="listItem" + open="(" close=")" separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> + </foreach> + </where> + </sql> + <sql id="Base_Column_List"> + ID, VNFM_ID, VNF_ID, APP_NAME, JOB_ID, STATUS, CREATE_TIME, MODIFY_TIME, + DELETE_TIME + </sql> + <sql id="Blob_Column_List"> + EXTEND + </sql> + <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfoExample"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List" /> + , + <include refid="Blob_Column_List" /> + from jujuvnfm + <if test="_parameter != null"> + <include refid="Example_Where_Clause" /> + </if> + <if test="orderByClause != null"> + order by ${orderByClause} + </if> + </select> + <select id="selectByExample" resultMap="BaseResultMap" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfoExample"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List" /> + from jujuvnfm + <if test="_parameter != null"> + <include refid="Example_Where_Clause" /> + </if> + <if test="orderByClause != null"> + order by ${orderByClause} + </if> + <if test="limitStart >= 0"> + limit ${limitStart} , ${limitEnd} + </if> + </select> + <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" + parameterType="java.lang.String"> + select + <include refid="Base_Column_List" /> + , + <include refid="Blob_Column_List" /> + from jujuvnfm + where ID = #{id,jdbcType=VARCHAR} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> + delete from jujuvnfm + where ID = #{id,jdbcType=VARCHAR} + </delete> + <delete id="deleteByExample" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfoExample"> + delete from jujuvnfm + <if test="_parameter != null"> + <include refid="Example_Where_Clause" /> + </if> + </delete> + <insert id="insert" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfo"> + insert into jujuvnfm (ID, VNFM_ID, VNF_ID, + APP_NAME, JOB_ID, STATUS, + CREATE_TIME, MODIFY_TIME, DELETE_TIME, + EXTEND) + values (#{id,jdbcType=VARCHAR}, #{vnfmId,jdbcType=VARCHAR}, + #{vnfId,jdbcType=VARCHAR}, + #{appName,jdbcType=VARCHAR}, #{jobId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP}, + #{deleteTime,jdbcType=TIMESTAMP}, + #{extend,jdbcType=LONGVARCHAR}) + </insert> + <insert id="insertSelective" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfo"> + insert into jujuvnfm + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + ID, + </if> + <if test="vnfmId != null"> + VNFM_ID, + </if> + <if test="vnfId != null"> + VNF_ID, + </if> + <if test="appName != null"> + APP_NAME, + </if> + <if test="jobId != null"> + JOB_ID, + </if> + <if test="status != null"> + STATUS, + </if> + <if test="createTime != null"> + CREATE_TIME, + </if> + <if test="modifyTime != null"> + MODIFY_TIME, + </if> + <if test="deleteTime != null"> + DELETE_TIME, + </if> + <if test="extend != null"> + EXTEND, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null"> + #{vnfmId,jdbcType=VARCHAR}, + </if> + <if test="vnfId != null"> + #{vnfId,jdbcType=VARCHAR}, + </if> + <if test="appName != null"> + #{appName,jdbcType=VARCHAR}, + </if> + <if test="jobId != null"> + #{jobId,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + #{status,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="modifyTime != null"> + #{modifyTime,jdbcType=TIMESTAMP}, + </if> + <if test="deleteTime != null"> + #{deleteTime,jdbcType=TIMESTAMP}, + </if> + <if test="extend != null"> + #{extend,jdbcType=LONGVARCHAR}, + </if> + </trim> + </insert> + <select id="countByExample" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfoExample" + resultType="java.lang.Integer"> + select count(*) from jujuvnfm + <if test="_parameter != null"> + <include refid="Example_Where_Clause" /> + </if> + </select> + <update id="updateByExampleSelective" parameterType="map"> + update jujuvnfm + <set> + <if test="record.id != null"> + ID = #{record.id,jdbcType=VARCHAR}, + </if> + <if test="record.vnfmId != null"> + VNFM_ID = #{record.vnfmId,jdbcType=VARCHAR}, + </if> + <if test="record.vnfId != null"> + VNF_ID = #{record.vnfId,jdbcType=VARCHAR}, + </if> + <if test="record.appName != null"> + APP_NAME = #{record.appName,jdbcType=VARCHAR}, + </if> + <if test="record.jobId != null"> + JOB_ID = #{record.jobId,jdbcType=VARCHAR}, + </if> + <if test="record.status != null"> + STATUS = #{record.status,jdbcType=INTEGER}, + </if> + <if test="record.createTime != null"> + CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}, + </if> + <if test="record.modifyTime != null"> + MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, + </if> + <if test="record.deleteTime != null"> + DELETE_TIME = #{record.deleteTime,jdbcType=TIMESTAMP}, + </if> + <if test="record.extend != null"> + EXTEND = #{record.extend,jdbcType=LONGVARCHAR}, + </if> + </set> + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause" /> + </if> + </update> + <update id="updateByExampleWithBLOBs" parameterType="map"> + update jujuvnfm + set ID = #{record.id,jdbcType=VARCHAR}, + VNFM_ID = #{record.vnfmId,jdbcType=VARCHAR}, + VNF_ID = #{record.vnfId,jdbcType=VARCHAR}, + APP_NAME = #{record.appName,jdbcType=VARCHAR}, + JOB_ID = #{record.jobId,jdbcType=VARCHAR}, + STATUS = #{record.status,jdbcType=INTEGER}, + CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}, + MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, + DELETE_TIME = #{record.deleteTime,jdbcType=TIMESTAMP}, + EXTEND = #{record.extend,jdbcType=LONGVARCHAR} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause" /> + </if> + </update> + <update id="updateByExample" parameterType="map"> + update jujuvnfm + set ID = #{record.id,jdbcType=VARCHAR}, + VNFM_ID = #{record.vnfmId,jdbcType=VARCHAR}, + VNF_ID = #{record.vnfId,jdbcType=VARCHAR}, + APP_NAME = #{record.appName,jdbcType=VARCHAR}, + JOB_ID = #{record.jobId,jdbcType=VARCHAR}, + STATUS = #{record.status,jdbcType=INTEGER}, + CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}, + MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, + DELETE_TIME = #{record.deleteTime,jdbcType=TIMESTAMP} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause" /> + </if> + </update> + <update id="updateByPrimaryKeySelective" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfo"> + update jujuvnfm + <set> + <if test="vnfmId != null"> + VNFM_ID = #{vnfmId,jdbcType=VARCHAR}, + </if> + <if test="vnfId != null"> + VNF_ID = #{vnfId,jdbcType=VARCHAR}, + </if> + <if test="appName != null"> + APP_NAME = #{appName,jdbcType=VARCHAR}, + </if> + <if test="jobId != null"> + JOB_ID = #{jobId,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + STATUS = #{status,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="modifyTime != null"> + MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, + </if> + <if test="deleteTime != null"> + DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP}, + </if> + <if test="extend != null"> + EXTEND = #{extend,jdbcType=LONGVARCHAR}, + </if> + </set> + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKeyWithBLOBs" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfo"> + update jujuvnfm + set VNFM_ID = #{vnfmId,jdbcType=VARCHAR}, + VNF_ID = #{vnfId,jdbcType=VARCHAR}, + APP_NAME = #{appName,jdbcType=VARCHAR}, + JOB_ID = #{jobId,jdbcType=VARCHAR}, + STATUS = #{status,jdbcType=INTEGER}, + CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}, + MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, + DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP}, + EXTEND = #{extend,jdbcType=LONGVARCHAR} + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" + parameterType="org.openo.nfvo.jujuvnfmadapter.service.entity.JujuVnfmInfo"> + update jujuvnfm + set VNFM_ID = #{vnfmId,jdbcType=VARCHAR}, + VNF_ID = #{vnfId,jdbcType=VARCHAR}, + APP_NAME = #{appName,jdbcType=VARCHAR}, + JOB_ID = #{jobId,jdbcType=VARCHAR}, + STATUS = #{status,jdbcType=INTEGER}, + CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}, + MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, + DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP} + where ID = #{id,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/spring/JujuVnfmadapter/services.xml b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/spring/JujuVnfmadapter/services.xml new file mode 100644 index 0000000..cc7e016 --- /dev/null +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/spring/JujuVnfmadapter/services.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2016 Huawei Technologies Co., Ltd. + + 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. + --> + +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" + xmlns:osgix="http://www.springframework.org/schema/osgi-compendium" + xmlns:ctx="http://www.springframework.org/schema/context" xmlns:jaxrs="http://cxf.apache.org/jaxrs" + xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/osgi + http://www.springframework.org/schema/osgi/spring-osgi.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/osgi-compendium + http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd + http://cxf.apache.org/jaxrs + http://cxf.apache.org/schemas/jaxrs.xsd + http://cxf.apache.org/transports/http/configuration + http://cxf.apache.org/schemas/configuration/http-conf.xsd + http://www.springframework.org/schema/aop + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd + http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> + + <context:annotation-config + proxy-target-class="true" /> + <context:component-scan base-package="org.openo.nfvo.jujuvnfmadapter" /> + + <!-- these are included in the dependency jar --> + <import resource="classpath:META-INF/cxf/cxf.xml" /> + <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> + + <bean id="jsonProvider" class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" /> + + <bean id="db" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> + <property name="location" value="classpath:db.properties"/> + </bean> + + <bean id="source" + class="org.springframework.jdbc.datasource.DriverManagerDataSource"> + <property name="driverClassName" value="${jdbc.driverClassName}" /> + <property name="url" value="${jdbc.url}" /> + <property name="username" value="${jdbc.username}" /> + <property name="password" value="${jdbc.password}" /> + </bean> + + <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> + <property name="dataSource" ref="source" /> + <property name="mapperLocations" value="classpath*:mybatis/mysql/*.xml" /> + </bean> + + <bean id="session" class="org.mybatis.spring.SqlSessionTemplate"> + <constructor-arg index="0" ref="sessionFactory" /> + </bean> + + + <bean id="transactionManager" + class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> + <property name="dataSource" ref="source" /> + </bean> + <bean id="jujuVnfmInfoMapper" class="org.mybatis.spring.mapper.MapperFactoryBean"> + <property name="mapperInterface" + value="org.openo.nfvo.jujuvnfmadapter.service.mapper.JujuVnfmInfoMapper"/> + <property name="sqlSessionFactory" ref="sessionFactory"/> + </bean> + + + <bean id="vnfMgr" class="org.openo.nfvo.jujuvnfmadapter.service.process.VnfMgr"> + <property name="jujuVnfmInfoMapper" ref="jujuVnfmInfoMapper"/> + <property name="resourceManager" ref="resourceManager"/> + </bean> + <bean id="vnfResourceMgr" class="org.openo.nfvo.jujuvnfmadapter.service.process.VnfResourceMgr"> + <property name="jujuVnfmInfoMapper" ref="jujuVnfmInfoMapper"/> + + </bean> + <bean id="jujuClientManager" + class="org.openo.nfvo.jujuvnfmadapter.service.adapter.impl.JujuClientManager"/> + <bean id="resourceManager" + class="org.openo.nfvo.jujuvnfmadapter.service.adapter.impl.AdapterResourceManager"/> + + <!-- --> + <bean id="jujuClientRoa" + class="org.openo.nfvo.jujuvnfmadapter.service.rest.JujuClientRoa"> + <property name="jujuClientManager" ref="jujuClientManager"/> + <property name="vnfMgr" ref="vnfMgr"/> + </bean> + <bean id="vnfRoa" class="org.openo.nfvo.jujuvnfmadapter.service.rest.VnfRoa"> + <property name="vnfMgr" ref="vnfMgr"/> + </bean> + <bean id="configRoa" class="org.openo.nfvo.jujuvnfmadapter.service.rest.ConfigRoa"/> + + <bean id="SwaggerRoa" class="org.openo.nfvo.jujuvnfmadapter.service.rest.SwaggerRoa"/> + <bean id="vnfResourceRoa" class="org.openo.nfvo.jujuvnfmadapter.service.rest.VnfResourceRoa"> + <property name="vnfResourceMgr" ref="vnfResourceMgr"/> + </bean> + + <jaxrs:server id="restContainer" address="/"> + <jaxrs:serviceBeans> + <ref bean="jujuClientRoa" /> + <ref bean="vnfRoa" /> + <ref bean="configRoa" /> + <ref bean="SwaggerRoa" /> + <ref bean="vnfResourceRoa"/> + </jaxrs:serviceBeans> + <jaxrs:providers> + <ref bean="jsonProvider" /> + </jaxrs:providers> + </jaxrs:server> +</beans>
\ No newline at end of file diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/spring/JujuVnfmadapter/svc_register.xml b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/spring/JujuVnfmadapter/svc_register.xml new file mode 100644 index 0000000..27e8c27 --- /dev/null +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/spring/JujuVnfmadapter/svc_register.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright 2016 Huawei Technologies Co., Ltd. + + 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. + --> + +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" + xmlns:osgix="http://www.springframework.org/schema/osgi-compendium" + xmlns:ctx="http://www.springframework.org/schema/context" xmlns:jaxrs="http://cxf.apache.org/jaxrs" + xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/osgi + http://www.springframework.org/schema/osgi/spring-osgi.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/osgi-compendium + http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd + http://cxf.apache.org/jaxrs + http://cxf.apache.org/schemas/jaxrs.xsd + http://cxf.apache.org/transports/http/configuration + http://cxf.apache.org/schemas/configuration/http-conf.xsd + http://www.springframework.org/schema/aop + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd + http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> + <bean class="org.openo.nfvo.jujuvnfmadapter.service.activator.ROAJujuServicePostProcessor"></bean> + <bean class="org.openo.nfvo.jujuvnfmadapter.service.api.internalsvc.impl.JujuAdapterMgrService"></bean> +</beans>
\ No newline at end of file diff --git a/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/swagger.json b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/swagger.json new file mode 100644 index 0000000..cfd1307 --- /dev/null +++ b/juju/juju-vnfmadapter/Juju-vnfmadapterService/service/src/main/resources/swagger.json @@ -0,0 +1,608 @@ +{ + "swagger": "2.0", + "info": { + "title": "Juju VNFM Driver API", + "description": "VNF service provider.", + "version": "1.0.0" + }, + "host": "nfvo.openo.org", + "schemes": [ + "https", + "http" + ], + "basePath": "/openoapi", + "paths": { + "/{vnfmtype}/v1/{vnfmid}/vnfs": { + "post": { + "summary": "Instantiate VNF", + "description": "Add VNF", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "vnfmtype", + "in": "path", + "description": "vnfm type", + "required": true, + "type": "string" + }, + { + "name": "vnfmid", + "in": "path", + "description": "vnfm id", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "vnfmid", + "description": "Provide required properties of VNF.", + "required": true, + "schema": { + "$ref": "#/definitions/Vnf" + } + } + ], + "responses": { + "200": { + "description": "VNF Response", + "schema": { + "$ref": "#/definitions/VnfResponse" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Not Found" + }, + "500": { + "description": "VNF service failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/{vnfmtype}/v1/{vnfmid}/vnfs/{vnfInstanceId}/terminate": { + "post": { + "summary": "Instantiate VNF", + "description": "Add VNF", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "vnfmtype", + "in": "path", + "description": "vnfm type", + "required": true, + "type": "string" + }, + { + "name": "vnfmid", + "in": "path", + "description": "vnfm id", + "required": true, + "type": "string" + }, + { + "name": "vnfInstanceId", + "in": "path", + "description": "vnfm instance id", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "vnfmTerminate", + "description": "Provide required properties of VNF.", + "required": true, + "schema": { + "$ref": "#/definitions/VnfTerminate" + } + } + ], + "responses": { + "200": { + "description": "VNF Response", + "schema": { + "$ref": "#/definitions/VnfTerminateResponse" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Not Found" + }, + "500": { + "description": "VNF service failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/{vnfmtype}/v1/{vnfmid}/vnfs/{vnfInstanceId}": { + "get": { + "summary": "Query VNF", + "description": "Get VNF Details", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "vnfmtype", + "in": "path", + "description": "vnfm type", + "required": true, + "type": "string" + }, + { + "name": "vnfmid", + "in": "path", + "description": "vnfm id", + "required": true, + "type": "string" + }, + { + "name": "vnfInstanceId", + "in": "path", + "description": "vnfm instance id", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "VNF Response", + "schema": { + "$ref": "#/definitions/VnfInfoResponse" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Not Found" + }, + "500": { + "description": "VNF service failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/{vnfmtype}/v1/jobs/{jobid}&responseId={responseId}": { + "get": { + "summary": "Get VNF operational status", + "description": "VNF operational status", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "vnfmtype", + "in": "path", + "description": "vnfm type", + "required": true, + "type": "string" + }, + { + "name": "jobid", + "in": "path", + "description": "jobid", + "required": true, + "type": "string" + }, + { + "name": "responseId", + "in": "path", + "description": "vnfm instance id", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "VNF Response", + "schema": { + "$ref": "#/definitions/VnfStatusResponse" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Not Found" + }, + "500": { + "description": "VNF service failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "VnfStatusResponse": { + "type": "object", + "description": "Operational Status Response.", + "required": [ + "jobId", + "responseDescriptor", + "status", + "progress", + "statusDescription", + "errorCode", + "responseId", + "responseHistoryList" + ], + "properties": { + "jobId": { + "type": "string", + "description": "Job ID" + }, + "responseDescriptor": { + "type": "string", + "description": "Including vnfStatus,statusDescription,errorCode,progress, responseHistoryList, responseId." + }, + "status": { + "type": "string", + "description": "JOB status started processing finished error" + }, + "progress": { + "type": "integer", + "description": "Progress (1 - 100)" + }, + "statusDescription": { + "type": "string", + "description": "Progress Description" + }, + "errorCode": { + "type": "integer", + "description": "Errorcode" + }, + "responseId": { + "type": "integer", + "description": "Response Identifier" + }, + "responseHistoryList": { + "type": "array", + "items": { + "$ref": "#/definitions/HistoryDetails" + } + } + } + }, + "HistoryDetails": { + "type": "object", + "description": "InitiateVnfResponse.", + "required": [ + "vnfStatus", + "statusDescription", + "errorCode", + "progress", + "responseId" + ], + "properties": { + "vnfStatus": { + "type": "string", + "description": "Vnf Job Status." + }, + "statusDescription": { + "type": "string", + "description": "Progress Description." + }, + "errorCode": { + "type": "integer", + "description": "Error code." + }, + "progress": { + "type": "integer", + "description": "progress (1-100)." + }, + "responseId": { + "type": "integer", + "description": "Response Identifier." + } + } + }, + "VnfResponse": { + "type": "object", + "description": "InitiateVnfResponse.", + "required": [ + "jobId", + "vnfInstanceId" + ], + "properties": { + "jobId": { + "type": "string", + "description": "Identifier of the VNF lifecycle operation occurrence." + }, + "vnfInstanceId": { + "type": "string", + "description": "Identifier of the VNF instance." + } + } + }, + "VnfTerminateResponse": { + "type": "object", + "description": "TerminateVnfResponse.", + "required": [ + "jobId" + ], + "properties": { + "jobId": { + "type": "string", + "description": "Identifier of the VNF lifecycle operation occurrence." + } + } + }, + "VnfInfoResponse": { + "type": "object", + "description": "The information items about the selected VNF instance(s) that are returned..", + "required": [ + "VnfInfo" + ], + "properties": { + "VnfInfo": { + "$ref": "#/definitions/VnfInfo" + } + } + }, + "VnfInfo": { + "type": "object", + "description": "The information items about the selected VNF instance(s) that are returned..", + "required": [ + "vnfInstanceId", + "vnfInstanceName", + "vnfInstanceDescription", + "vnfdId", + "vnfPackageId", + "version", + "vnfProvider", + "vnfType", + "vnfStatus" + ], + "properties": { + "vnfInstanceId": { + "type": "string", + "description": "VNF instance identifier." + }, + "vnfInstanceName": { + "type": "string", + "description": "VNF instance name." + }, + "vnfInstanceDescription": { + "type": "string", + "description": "Human-readable description of the VNF instance." + }, + "vnfdId": { + "type": "string", + "description": "Identifier of the VNFD on which the VNF instance is based." + }, + "vnfPackageId": { + "type": "string", + "description": "Identifier of the VNF Package used to manage the lifecycle of the VNF instance." + }, + "version": { + "type": "string", + "description": "Version of the VNF." + }, + "vnfProvider": { + "type": "string", + "description": "Name of the person or company providing the VNF." + }, + "vnfType": { + "type": "string", + "description": "VNF Application Type." + }, + "vnfStatus": { + "default": "active", + "enum": [ + "inactive", + "active" + ], + "description": "The instantiation state of the VNF. Possible values:INACTIVE (Vnf is terminated or not instantiated ), ACTIVE (Vnf is instantiated). [instantiationState]." + } + } + }, + "VnfTerminate": { + "type": "object", + "description": "Terminate VNF.", + "required": [ + "terminationType", + "gracefulTerminationTimeout" + ], + "properties": { + "terminationType": { + "default": "forceful", + "enum": [ + "forceful", + "graceful" + ], + "description": "Signals whether forceful or graceful termination is requested.." + }, + "gracefulTerminationTimeout": { + "type": "integer", + "format": "int32", + "description": "The time interval (second) to wait for the VNF to be taken out of service during graceful termination, before shutting down the VNF and releasing the resources.." + } + } + }, + "Vnf": { + "type": "object", + "description": "VNF encapsulate an external IP for the given project in a domain. Each property description is provided with 1. required 2. update allowed 3. format. whenever its needs to be mentioned explicitly.", + "required": [ + "vnfInstanceName", + "vnfPackageId", + "vnfDescriptorId", + "flavourId", + "vnfInstanceDescription", + "extVirtualLink" + ], + "properties": { + "vnfInstanceName": { + "type": "string", + "description": "Human-readable name of the VNF instance to be created.." + }, + "vnfPackageId": { + "type": "string", + "description": "VNF packageId." + }, + "vnfDescriptorId": { + "type": "string", + "description": "Information sufficient to identify the VNF Descriptor which defines the VNF to be created." + }, + "flavourId": { + "type": "string", + "description": "verify." + }, + "vnfInstanceDescription": { + "type": "string", + "description": "Human-readable description of the VNF instance to be created." + }, + "extVirtualLink": { + "$ref": "#/definitions/ExtVirtualLinkData" + } + } + }, + "ExtVirtualLinkData": { + "type": "object", + "description": "References to external virtual links to connect the VNF to.", + "required": [ + "vlInstanceId", + "vim", + "networkId", + "cpdId" + ], + "properties": { + "vlInstanceId": { + "type": "string", + "description": "Identifier of the VL instance." + }, + "vim": { + "$ref": "#/definitions/VimInfo" + }, + "networkId": { + "type": "string", + "description": "The network UUID of VIM" + }, + "cpdId": { + "type": "string", + "description": "Identifier of the external CPD in VNFD" + } + } + }, + "VimInfo": { + "type": "object", + "description": "Information about the VIM that manages this resource.", + "required": [ + "vimInfoId", + "vimId", + "interfaceInfo", + "accessInfo", + "interfaceEndpoint" + ], + "properties": { + "vimInfoId": { + "type": "string", + "description": "The identifier of this VimInfo instance, for the purpose of referencing it from other information elements." + }, + "vimId": { + "type": "string", + "description": "The identifier of the VIM.." + }, + "interfaceInfo": { + "$ref": "#/definitions/interfaceInfo" + }, + "accessInfo": { + "$ref": "#/definitions/accessInfo" + }, + "interfaceEndpoint": { + "type": "string", + "description": "Information about the interface endpoint. An example is a URL." + } + } + }, + "interfaceInfo": { + "type": "object", + "description": "Information about the interface to the VIM, including VIM provider type, API version, and protocol type..", + "required": [ + "vimType", + "apiVersion", + "protocolType" + ], + "properties": { + "vimType": { + "type": "string", + "description": "vim" + }, + "apiVersion": { + "type": "string", + "description": "api version" + }, + "protocolType": { + "type": "string", + "description": "Type of the protocol" + } + } + }, + "accessInfo": { + "type": "object", + "description": "Authentication credentials for accessing the VIM. Examples may include those to support different authentication schemes, e.g., OAuth, Token, etc..", + "required": [ + "tenant", + "username", + "password" + ], + "properties": { + "tenant": { + "type": "string", + "description": "Tenant Name of tenant" + }, + "username": { + "type": "string", + "description": "Username for login" + }, + "password": { + "type": "string", + "description": "Password of login user" + } + } + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + } + } +}
\ No newline at end of file |