diff options
Diffstat (limited to 'ResmanagementService/service/src/main/resources')
15 files changed, 3592 insertions, 0 deletions
diff --git a/ResmanagementService/service/src/main/resources/log4j.properties b/ResmanagementService/service/src/main/resources/log4j.properties new file mode 100644 index 0000000..d371d16 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/log4j.properties @@ -0,0 +1,23 @@ +############################################################################### +# 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.appender.root.Append=true +log4j.appender.root.File=${catalina.base}/logs/resmanagement.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
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/HostMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/HostMapper.xml new file mode 100644 index 0000000..850eef4 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/HostMapper.xml @@ -0,0 +1,189 @@ +<?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.resmanagement.service.mapper.HostMapper"> + <resultMap id="BaseResultMap" + type="org.openo.nfvo.resmanagement.service.entity.HostEntity"> + <id column="ID" property="id" jdbcType="VARCHAR" /> + <result column="NAME" property="name" jdbcType="VARCHAR" /> + <result column="CPU" property="cpu" jdbcType="VARCHAR" /> + <result column="MEMORY" property="memory" jdbcType="VARCHAR" /> + <result column="DISK" property="disk" jdbcType="VARCHAR" /> + <result column="VIM_ID" property="vimId" jdbcType="VARCHAR" /> + <result column="VIM_NAME" property="vimName" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List"> + ID, NAME, CPU, MEMORY, DISK, VIM_ID, VIM_NAME + </sql> + <select id="getHost" resultMap="BaseResultMap" parameterType="java.lang.String"> + select + <include refid="Base_Column_List" /> + from host + where ID = #{id,jdbcType=VARCHAR} + </select> + <select id="getHosts" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from host + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + <if test="vimId != null"> + AND VIM_ID = #{vimId,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteHost" parameterType="java.lang.String"> + delete from host + where ID = #{id,jdbcType=VARCHAR} + </delete> + <delete id="deleteHostByVimId" parameterType="java.lang.String"> + delete from host + where VIM_ID = #{vimId,jdbcType=VARCHAR} + </delete> + <insert id="addHost" + parameterType="org.openo.nfvo.resmanagement.service.entity.HostEntity"> + insert into host (ID, NAME, CPU, MEMORY, DISK, VIM_ID, VIM_NAME) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{cpu,jdbcType=VARCHAR}, + #{memory,jdbcType=VARCHAR}, #{disk,jdbcType=VARCHAR}, #{vimId,jdbcType=VARCHAR} + , #{vimName,jdbcType=VARCHAR}) + </insert> + <insert id="addHostSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.HostEntity"> + insert into host + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + ID, + </if> + <if test="name != null"> + NAME, + </if> + <if test="cpu != null"> + CPU, + </if> + <if test="memory != null"> + MEMORY, + </if> + <if test="disk != null"> + DISK, + </if> + <if test="vimId != null"> + VIM_ID, + </if> + <if test="vimName != null"> + VIM_NAME, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="cpu != null"> + #{cpu,jdbcType=VARCHAR}, + </if> + <if test="memory != null"> + #{memory,jdbcType=VARCHAR}, + </if> + <if test="disk != null"> + #{disk,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + #{vimName,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateHostSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.HostEntity"> + update host + <set> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="cpu != null"> + CPU = #{cpu,jdbcType=VARCHAR}, + </if> + <if test="memory != null"> + MEMORY = #{memory,jdbcType=VARCHAR}, + </if> + <if test="disk != null"> + DISK = #{disk,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + VIM_ID = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + </set> + <where> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR} + </if> + <if test="vimId != null"> + AND VIM_ID = #{vimId,jdbcType=VARCHAR} + </if> + </where> + </update> + <update id="updateHost" + parameterType="org.openo.nfvo.resmanagement.service.entity.HostEntity"> + update host + set NAME = #{name,jdbcType=VARCHAR}, + CPU = #{cpu,jdbcType=VARCHAR}, + MEMORY = #{memory,jdbcType=VARCHAR}, + DISK = #{disk,jdbcType=VARCHAR}, + VIM_ID = #{vimId,jdbcType=VARCHAR}, + VIM_NAME = #{vimName,jdbcType=VARCHAR} + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateHostByVimId" + parameterType="org.openo.nfvo.resmanagement.service.entity.HostEntity"> + update host + <set> + <if test="id != null"> + ID = #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="cpu != null"> + CPU = #{cpu,jdbcType=VARCHAR}, + </if> + <if test="memory != null"> + MEMORY = #{memory,jdbcType=VARCHAR}, + </if> + <if test="disk != null"> + DISK = #{disk,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + VIM_ID = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + </set> + where VIM_ID = #{vimId,jdbcType=VARCHAR} + </update> +</mapper> diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/LocationMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/LocationMapper.xml new file mode 100644 index 0000000..b0ecba2 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/LocationMapper.xml @@ -0,0 +1,158 @@ +<?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.resmanagement.service.mapper.LocationMapper"> + <resultMap id="BaseResultMap" + type="org.openo.nfvo.resmanagement.service.entity.LocationEntity"> + + <id column="ID" property="id" jdbcType="VARCHAR" /> + <result column="COUNTRY" property="country" jdbcType="VARCHAR" /> + <result column="LOCATION" property="location" jdbcType="VARCHAR" /> + <result column="LATITUDE" property="latitude" jdbcType="VARCHAR" /> + <result column="LONGITUDE" property="longitude" jdbcType="VARCHAR" /> + <result column="DESCRIPTION" property="description" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List"> + ID, COUNTRY, LOCATION, LATITUDE, LONGITUDE, DESCRIPTION + </sql> + <select id="getLocation" resultMap="BaseResultMap" + parameterType="java.lang.String"> + select + <include refid="Base_Column_List" /> + from location + where ID = #{id,jdbcType=VARCHAR} + </select> + <select id="getCountry" resultType="java.lang.String"> + select distinct COUNTRY from location + </select> + <select id="getLocationByCountry" resultType="java.lang.String" + parameterType="java.util.Map"> + select distinct LOCATION from location + <where> + <if test="country != null"> + AND COUNTRY = #{country,jdbcType=VARCHAR} + </if> + </where> + </select> + <select id="getLocations" resultMap="BaseResultMap" + parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from location + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + <if test="location !=null"> + AND LOCATION = #{location,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteLocation" parameterType="java.lang.String"> + delete from location + where ID = #{id,jdbcType=VARCHAR} + </delete> + <insert id="addLocation" + parameterType="org.openo.nfvo.resmanagement.service.entity.LocationEntity"> + + insert into location (ID, COUNTRY, LOCATION, + LATITUDE, LONGITUDE, DESCRIPTION) + values (#{id,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, + #{location,jdbcType=VARCHAR}, + #{latitude,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}) + </insert> + <insert id="addLocationSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.LocationEntity"> + + insert into location + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + ID, + </if> + <if test="country != null"> + COUNTRY, + </if> + <if test="location != null"> + LOCATION, + </if> + <if test="latitude != null"> + LATITUDE, + </if> + <if test="longitude != null"> + LONGITUDE, + </if> + <if test="description != null"> + DESCRIPTION, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=VARCHAR}, + </if> + <if test="country != null"> + #{country,jdbcType=VARCHAR}, + </if> + <if test="location != null"> + #{location,jdbcType=VARCHAR}, + </if> + <if test="latitude != null"> + #{latitude,jdbcType=VARCHAR}, + </if> + <if test="longitude != null"> + #{longitude,jdbcType=VARCHAR}, + </if> + <if test="description != null"> + #{description,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateLocationSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.LocationEntity"> + + update location + <set> + <if test="country != null"> + COUNTRY = #{country,jdbcType=VARCHAR}, + </if> + <if test="location != null"> + LOCATION = #{location,jdbcType=VARCHAR}, + </if> + <if test="latitude != null"> + LATITUDE = #{latitude,jdbcType=VARCHAR}, + </if> + <if test="longitude != null"> + LONGITUDE = #{longitude,jdbcType=VARCHAR}, + </if> + <if test="description != null"> + DESCRIPTION = #{description,jdbcType=VARCHAR}, + </if> + </set> + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateLocation" + parameterType="org.openo.nfvo.resmanagement.service.entity.LocationEntity"> + + update location + set COUNTRY = #{country,jdbcType=VARCHAR}, + LOCATION = #{location,jdbcType=VARCHAR}, + LATITUDE = #{latitude,jdbcType=VARCHAR}, + LONGITUDE = #{longitude,jdbcType=VARCHAR}, + DESCRIPTION = #{description,jdbcType=VARCHAR} + where ID = #{id,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/NetworkMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/NetworkMapper.xml new file mode 100644 index 0000000..65e4d67 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/NetworkMapper.xml @@ -0,0 +1,216 @@ +<?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.resmanagement.service.mapper.NetworkMapper"> + <resultMap id="BaseResultMap" + type="org.openo.nfvo.resmanagement.service.entity.NetworkEntity"> + <id column="ID" property="id" jdbcType="VARCHAR" /> + <result column="NAME" property="name" jdbcType="VARCHAR" /> + <result column="TENANT_ID" property="tenantId" jdbcType="VARCHAR" /> + <result column="VIM_ID" property="vimId" jdbcType="VARCHAR" /> + <result column="VIM_NAME" property="vimName" jdbcType="VARCHAR" /> + <result column="STATUS" property="status" jdbcType="VARCHAR" /> + <result column="PHYSICAL_NETWORK" property="physicalNetwork" + jdbcType="VARCHAR" /> + <result column="NETWORK_TYPE" property="networkType" jdbcType="VARCHAR" /> + <result column="SEGMENTATION_ID" property="segmentationId" + jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List"> + ID, NAME, TENANT_ID, VIM_ID, VIM_NAME, STATUS, + PHYSICAL_NETWORK, NETWORK_TYPE, SEGMENTATION_ID + </sql> + <select id="getNetwork" resultMap="BaseResultMap" parameterType="java.lang.String"> + select + <include refid="Base_Column_List" /> + from network + where ID = #{id,jdbcType=VARCHAR} + </select> + <select id="getNetworks" resultMap="BaseResultMap" + parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from network + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + <if test="vimId != null"> + AND VIM_ID = #{vimId,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteNetwork" parameterType="java.lang.String"> + delete from network + where ID = #{id,jdbcType=VARCHAR} + </delete> + <delete id="deleteNetworkByVimId" parameterType="java.lang.String"> + delete from network + where VIM_ID = #{vimId,jdbcType=VARCHAR} + </delete> + <insert id="addNetwork" + parameterType="org.openo.nfvo.resmanagement.service.entity.NetworkEntity"> + insert into network (ID, NAME, TENANT_ID, + VIM_ID, VIM_NAME, STATUS, + PHYSICAL_NETWORK, NETWORK_TYPE, SEGMENTATION_ID + ) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{tenantId,jdbcType=VARCHAR}, + #{vimId,jdbcType=VARCHAR}, #{vimName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, + #{physicalNetwork,jdbcType=VARCHAR}, #{networkType,jdbcType=VARCHAR}, + #{segmentationId,jdbcType=VARCHAR} + ) + </insert> + <insert id="addNetworkSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.NetworkEntity"> + insert into network + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + ID, + </if> + <if test="name != null"> + NAME, + </if> + <if test="tenantId != null"> + TENANT_ID, + </if> + <if test="vimId != null"> + VIM_ID, + </if> + <if test="vimName != null"> + VIM_NAME, + </if> + <if test="status != null"> + STATUS, + </if> + <if test="physicalNetwork != null"> + PHYSICAL_NETWORK, + </if> + <if test="networkType != null"> + NETWORK_TYPE, + </if> + <if test="segmentationId != null"> + SEGMENTATION_ID, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="tenantId != null"> + #{tenantId,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + #{vimName,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + #{status,jdbcType=VARCHAR}, + </if> + <if test="physicalNetwork != null"> + #{physicalNetwork,jdbcType=VARCHAR}, + </if> + <if test="networkType != null"> + #{networkType,jdbcType=VARCHAR}, + </if> + <if test="segmentationId != null"> + #{segmentationId,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateNetworkSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.NetworkEntity"> + update network + <set> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="tenantId != null"> + TENANT_ID = #{tenantId,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + VIM_ID = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + STATUS = #{status,jdbcType=VARCHAR}, + </if> + <if test="physicalNetwork != null"> + PHYSICAL_NETWORK = #{physicalNetwork,jdbcType=VARCHAR}, + </if> + <if test="networkType != null"> + NETWORK_TYPE = #{networkType,jdbcType=VARCHAR}, + </if> + <if test="segmentationId != null"> + SEGMENTATION_ID = #{segmentationId,jdbcType=VARCHAR}, + </if> + </set> + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateNetwork" + parameterType="org.openo.nfvo.resmanagement.service.entity.NetworkEntity"> + update network + set NAME = #{name,jdbcType=VARCHAR}, + TENANT_ID = #{tenantId,jdbcType=VARCHAR}, + VIM_ID = #{vimId,jdbcType=VARCHAR}, + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + STATUS = #{status,jdbcType=VARCHAR}, + PHYSICAL_NETWORK = #{physicalNetwork,jdbcType=VARCHAR}, + NETWORK_TYPE = #{networkType,jdbcType=VARCHAR}, + SEGMENTATION_ID = #{segmentationId,jdbcType=VARCHAR} + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateNetworkByVimId" + parameterType="org.openo.nfvo.resmanagement.service.entity.NetworkEntity"> + update network + <set> + <if test="id != null"> + ID = #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="tenantId != null"> + TENANT_ID = #{tenantId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + STATUS = #{status,jdbcType=VARCHAR}, + </if> + <if test="physicalNetwork != null"> + PHYSICAL_NETWORK = #{physicalNetwork,jdbcType=VARCHAR}, + </if> + <if test="networkType != null"> + NETWORK_TYPE = #{networkType,jdbcType=VARCHAR}, + </if> + <if test="segmentationId != null"> + SEGMENTATION_ID = #{segmentationId,jdbcType=VARCHAR}, + </if> + </set> + where VIM_ID = #{vimId,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/PortMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/PortMapper.xml new file mode 100644 index 0000000..765dcfe --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/PortMapper.xml @@ -0,0 +1,180 @@ +<?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.resmanagement.service.mapper.PortMapper"> + <resultMap id="BaseResultMap" + type="org.openo.nfvo.resmanagement.service.entity.PortEntity"> + <id column="ID" property="id" jdbcType="VARCHAR" /> + <result column="NAME" property="name" jdbcType="VARCHAR" /> + <result column="NWTWORK_ID" property="networkId" jdbcType="VARCHAR" /> + <result column="STATUS" property="status" jdbcType="VARCHAR" /> + <result column="TENANT_ID" property="tenantId" jdbcType="VARCHAR" /> + <result column="VIM_ID" property="vimId" jdbcType="VARCHAR" /> + <result column="VIM_NAME" property="vimName" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List"> + ID, NAME, NWTWORK_ID, STATUS, TENANT_ID, VIM_ID, VIM_NAME + </sql> + <select id="getPort" resultMap="BaseResultMap" parameterType="java.lang.String"> + select + <include refid="Base_Column_List" /> + from port + where ID = #{id,jdbcType=VARCHAR} + </select> + <select id="getPorts" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from port + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deletePort" parameterType="java.lang.String"> + delete from port + where ID = #{id,jdbcType=VARCHAR} + </delete> + <delete id="deletePortByVimId" parameterType="java.lang.String"> + delete from port + where VIM_ID = #{vimId,jdbcType=VARCHAR} + </delete> + <insert id="addPort" + parameterType="org.openo.nfvo.resmanagement.service.entity.PortEntity"> + insert into port (ID, NAME, NWTWORK_ID, STATUS, TENANT_ID, VIM_ID, + VIM_NAME) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{networkId,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{tenantId,jdbcType=VARCHAR}, #{vimId,jdbcType=VARCHAR} + , #{vimName,jdbcType=VARCHAR}) + </insert> + <insert id="addPortSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.PortEntity"> + insert into port + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + ID, + </if> + <if test="name != null"> + NAME, + </if> + <if test="networkId != null"> + NWTWORK_ID, + </if> + <if test="status != null"> + STATUS, + </if> + <if test="tenantId != null"> + TENANT_ID, + </if> + <if test="vimId != null"> + VIM_ID, + </if> + <if test="vimName != null"> + VIM_NAME, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="networkId != null"> + #{networkId,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + #{status,jdbcType=VARCHAR}, + </if> + <if test="tenantId != null"> + #{tenantId,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + #{vimName,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updatePortSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.PortEntity"> + update port + <set> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="networkId != null"> + NWTWORK_ID = #{networkId,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + STATUS = #{status,jdbcType=VARCHAR}, + </if> + <if test="tenantId != null"> + TENANT_ID = #{tenantId,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + VIM_ID = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + </set> + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updatePort" + parameterType="org.openo.nfvo.resmanagement.service.entity.PortEntity"> + update port + set NAME = #{name,jdbcType=VARCHAR}, + NWTWORK_ID = #{networkId,jdbcType=VARCHAR}, + STATUS = #{status,jdbcType=VARCHAR}, + TENANT_ID = #{tenantId,jdbcType=VARCHAR}, + VIM_ID = #{vimId,jdbcType=VARCHAR}, + VIM_NAME = #{vimName,jdbcType=VARCHAR} + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updatePortByVimId" + parameterType="org.openo.nfvo.resmanagement.service.entity.PortEntity"> + update port + <set> + <if test="id != null"> + ID = #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="networkId != null"> + NWTWORK_ID = #{networkId,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + STATUS = #{status,jdbcType=VARCHAR}, + </if> + <if test="tenantId != null"> + TENANT_ID = #{tenantId,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + VIM_ID = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + </set> + where ID = #{id,jdbcType=VARCHAR} + </update> +</mapper> diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/SitesMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/SitesMapper.xml new file mode 100644 index 0000000..14f7b52 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/SitesMapper.xml @@ -0,0 +1,286 @@ +<?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.resmanagement.service.mapper.SitesMapper"> + <resultMap id="BaseResultMap" + type="org.openo.nfvo.resmanagement.service.entity.SitesEntity"> + <id column="ID" property="id" jdbcType="VARCHAR" /> + <result column="NAME" property="name" jdbcType="VARCHAR" /> + <result column="LOCATION" property="location" jdbcType="VARCHAR" /> + <result column="COUNTRY" property="country" jdbcType="VARCHAR" /> + <result column="VIM_ID" property="vimId" jdbcType="VARCHAR" /> + <result column="VIM_NAME" property="vimName" jdbcType="VARCHAR" /> + <result column="STATUS" property="status" jdbcType="VARCHAR" /> + <result column="TOTAL_CPU" property="totalCPU" jdbcType="VARCHAR" /> + <result column="TOTAL_MEMORY" property="totalMemory" jdbcType="VARCHAR" /> + <result column="TOTAL_DISK" property="totalDisk" jdbcType="VARCHAR" /> + <result column="USED_CPU" property="usedCPU" jdbcType="VARCHAR" /> + <result column="USED_MEMORY" property="usedMemory" jdbcType="VARCHAR" /> + <result column="USED_DISK" property="usedDisk" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List"> + ID, NAME, LOCATION, COUNTRY, VIM_ID, VIM_NAME, STATUS, + TOTAL_CPU, + TOTAL_MEMORY, TOTAL_DISK, + USED_CPU, USED_MEMORY, USED_DISK + </sql> + <select id="getSite" resultMap="BaseResultMap" parameterType="java.lang.String"> + select + <include refid="Base_Column_List" /> + from site + where ID = #{id,jdbcType=VARCHAR} + </select> + <select id="getSites" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from site + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + <if test="name != null"> + AND NAME = #{name,jdbcType=VARCHAR} + </if> + <if test="location != null"> + AND LOCATION = #{location,jdbcType=VARCHAR} + </if> + <if test="vimId != null"> + AND VIM_ID = #{vimId,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteSite" parameterType="java.lang.String"> + delete from site + where ID = + #{id,jdbcType=VARCHAR} + </delete> + <insert id="addSite" + parameterType="org.openo.nfvo.resmanagement.service.entity.SitesEntity"> + insert into site (ID, NAME, LOCATION, + COUNTRY, VIM_ID, + VIM_NAME, STATUS,TOTAL_CPU, TOTAL_MEMORY, TOTAL_DISK, + USED_CPU, + USED_MEMORY, USED_DISK) + values (#{id,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, + #{location,jdbcType=VARCHAR}, + #{country,jdbcType=VARCHAR}, #{vimId,jdbcType=VARCHAR}, + #{vimName,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{totalCPU,jdbcType=VARCHAR}, #{totalMemory,jdbcType=VARCHAR}, + #{totalDisk,jdbcType=VARCHAR}, + #{usedCPU,jdbcType=VARCHAR}, + #{usedMemory,jdbcType=VARCHAR}, + #{usedDisk,jdbcType=VARCHAR}) + </insert> + <insert id="addSiteSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.SitesEntity"> + insert into site + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + ID, + </if> + <if test="name != null"> + NAME, + </if> + <if test="location != null"> + LOCATION, + </if> + <if test="country != null"> + COUNTRY, + </if> + <if test="vimId != null"> + VIM_ID, + </if> + <if test="vimName != null"> + VIM_NAME, + </if> + <if test="status != null"> + STATUS, + </if> + <if test="totalCPU != null"> + TOTAL_CPU, + </if> + <if test="totalMemory != null"> + TOTAL_MEMORY, + </if> + <if test="totalDisk != null"> + TOTAL_DISK, + </if> + <if test="usedCPU != null"> + USED_CPU, + </if> + <if test="usedMemory != null"> + USED_MEMORY, + </if> + <if test="usedDisk != null"> + USED_DISK, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="location != null"> + #{location,jdbcType=VARCHAR}, + </if> + <if test="country != null"> + #{country,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + #{vimName,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + #{status,jdbcType=VARCHAR}, + </if> + <if test="totalCPU != null"> + #{totalCPU,jdbcType=VARCHAR}, + </if> + <if test="totalMemory != null"> + #{totalMemory,jdbcType=VARCHAR}, + </if> + <if test="totalDisk != null"> + #{totalDisk,jdbcType=VARCHAR}, + </if> + <if test="usedCPU != null"> + #{usedCPU,jdbcType=VARCHAR}, + </if> + <if test="usedMemory != null"> + #{usedMemory,jdbcType=VARCHAR}, + </if> + <if test="usedDisk != null"> + #{usedDisk,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateSiteSelective" + parameterType="org.openo.nfvo.resmanagement.service.entity.SitesEntity"> + update site + <set> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="location != null"> + LOCATION = #{location,jdbcType=VARCHAR}, + </if> + <if test="country != null"> + COUNTRY = #{country,jdbcType=VARCHAR}, + </if> + <if test="vimId != null"> + VIM_ID = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + STATUS = #{status,jdbcType=VARCHAR}, + </if> + <if test="totalCPU != null"> + TOTAL_CPU = #{totalCPU,jdbcType=VARCHAR}, + </if> + <if test="totalMemory != null"> + TOTAL_MEMORY = #{totalMemory,jdbcType=VARCHAR}, + </if> + <if test="totalDisk != null"> + TOTAL_DISK = #{totalDisk,jdbcType=VARCHAR}, + </if> + <if test="usedCPU != null"> + USED_CPU = #{usedCPU,jdbcType=VARCHAR}, + </if> + <if test="usedMemory != null"> + USED_MEMORY = #{usedMemory,jdbcType=VARCHAR}, + </if> + <if test="usedDisk != null"> + USED_DISK = #{usedDisk,jdbcType=VARCHAR}, + </if> + </set> + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateSite" + parameterType="org.openo.nfvo.resmanagement.service.entity.SitesEntity"> + update site + set NAME = #{name,jdbcType=VARCHAR}, + LOCATION + = #{location,jdbcType=VARCHAR}, + COUNTRY = #{country,jdbcType=VARCHAR}, + VIM_ID = #{vimId,jdbcType=VARCHAR}, + VIM_NAME = + #{vimName,jdbcType=VARCHAR}, + STATUS = #{status,jdbcType=VARCHAR}, + TOTAL_CPU = #{totalCPU,jdbcType=VARCHAR}, + TOTAL_MEMORY = + #{totalMemory,jdbcType=VARCHAR}, + TOTAL_DISK = + #{totalDisk,jdbcType=VARCHAR}, + USED_CPU = #{usedCPU,jdbcType=VARCHAR}, + USED_MEMORY = #{usedMemory,jdbcType=VARCHAR}, + USED_DISK = + #{usedDisk,jdbcType=VARCHAR} + where ID = #{id,jdbcType=VARCHAR} + </update> + <update id="updateSiteByVimId" + parameterType="org.openo.nfvo.resmanagement.service.entity.SitesEntity"> + update site + <set> + <if test="id != null"> + ID = #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null"> + NAME = #{name,jdbcType=VARCHAR}, + </if> + <if test="location != null"> + LOCATION = #{location,jdbcType=VARCHAR}, + </if> + <if test="country != null"> + COUNTRY = #{country,jdbcType=VARCHAR}, + </if> + <if test="vimName != null"> + VIM_NAME = #{vimName,jdbcType=VARCHAR}, + </if> + <if test="status != null"> + STATUS = #{status,jdbcType=VARCHAR}, + </if> + <if test="totalCPU != null"> + TOTAL_CPU = #{totalCPU,jdbcType=VARCHAR}, + </if> + <if test="totalMemory != null"> + TOTAL_MEMORY = #{totalMemory,jdbcType=VARCHAR}, + </if> + <if test="totalDisk != null"> + TOTAL_DISK = #{totalDisk,jdbcType=VARCHAR}, + </if> + <if test="usedCPU != null"> + USED_CPU = #{usedCPU,jdbcType=VARCHAR}, + </if> + <if test="usedMemory != null"> + USED_MEMORY = #{usedMemory,jdbcType=VARCHAR}, + </if> + <if test="usedDisk != null"> + USED_DISK = #{usedDisk,jdbcType=VARCHAR}, + </if> + </set> + where VIM_ID = #{vimId,jdbcType=VARCHAR} + </update> + +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/VimMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/VimMapper.xml new file mode 100644 index 0000000..e6f38ef --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/VimMapper.xml @@ -0,0 +1,52 @@ +<?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.resmanagement.service.mapper.VimMapper"> + <resultMap id="BaseResultMap" + type="org.openo.nfvo.resmanagement.service.entity.VimEntity"> + <id column="ID" property="id" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List"> + ID + </sql> + <select id="getVim" resultMap="BaseResultMap" parameterType="java.lang.String"> + select + <include refid="Base_Column_List" /> + from vim + where ID = #{id,jdbcType=VARCHAR} + </select> + <select id="getVims" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from vim + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteVim" parameterType="java.lang.String"> + delete from vim + where ID = #{id,jdbcType=VARCHAR} + </delete> + <insert id="addVim" + parameterType="org.openo.nfvo.resmanagement.service.entity.VimEntity"> + insert into vim (ID) + values (#{id,jdbcType=VARCHAR}) + </insert> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/VirtualLinkMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/VirtualLinkMapper.xml new file mode 100644 index 0000000..b4d2394 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/VirtualLinkMapper.xml @@ -0,0 +1,273 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2016-2017, 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.resmanagement.service.mapper.VirtualLinkMapper" > + <resultMap id="BaseResultMap" type="org.openo.nfvo.resmanagement.service.entity.VirtualLinkEntity" > + <id column="id" property="id" jdbcType="VARCHAR" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + <result column="backend_id" property="backendId" jdbcType="VARCHAR" /> + <result column="is_public" property="isPublic" jdbcType="VARCHAR" /> + <result column="dc_name" property="dcName" jdbcType="VARCHAR" /> + <result column="vim_id" property="vimId" jdbcType="VARCHAR" /> + <result column="vim_name" property="vimName" jdbcType="VARCHAR" /> + <result column="physicial_net" property="physicialNet" jdbcType="VARCHAR" /> + <result column="ns_id" property="nsId" jdbcType="VARCHAR" /> + <result column="ns_name" property="nsName" jdbcType="VARCHAR" /> + <result column="description" property="description" jdbcType="VARCHAR" /> + <result column="network_type" property="networkType" jdbcType="VARCHAR" /> + <result column="segmentation" property="segmentation" jdbcType="VARCHAR" /> + <result column="mtu" property="mtu" jdbcType="VARCHAR" /> + <result column="vlan_transparent" property="vlanTransparent" jdbcType="VARCHAR" /> + <result column="router_external" property="routerExternal" jdbcType="VARCHAR" /> + <result column="resource_provider_type" property="resourceProviderType" jdbcType="VARCHAR" /> + <result column="resource_provider_id" property="resourceProviderId" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + id, name, backend_id, is_public, dc_name, vim_id, vim_name, physicial_net, ns_id, + ns_name, description, network_type, segmentation, mtu, vlan_transparent, router_external, + resource_provider_type, resource_provider_id + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from vl + where id = #{id,jdbcType=VARCHAR} + </select> + <select id="getVls" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from vl + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > + delete from vl + where id = #{id,jdbcType=VARCHAR} + </delete> + <insert id="insert" parameterType="org.openo.nfvo.resmanagement.service.entity.VirtualLinkEntity" > + insert into vl (id, name, backend_id, + is_public, dc_name, vim_id, + vim_name, physicial_net, ns_id, + ns_name, description, network_type, + segmentation, mtu, vlan_transparent, + router_external, resource_provider_type, resource_provider_id + ) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{backendId,jdbcType=VARCHAR}, + #{isPublic,jdbcType=VARCHAR}, #{dcName,jdbcType=VARCHAR}, #{vimId,jdbcType=VARCHAR}, + #{vimName,jdbcType=VARCHAR}, #{physicialNet,jdbcType=VARCHAR}, #{nsId,jdbcType=VARCHAR}, + #{nsName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{networkType,jdbcType=VARCHAR}, + #{segmentation,jdbcType=VARCHAR}, #{mtu,jdbcType=VARCHAR}, #{vlanTransparent,jdbcType=VARCHAR}, + #{routerExternal,jdbcType=VARCHAR}, #{resourceProviderType,jdbcType=VARCHAR}, #{resourceProviderId,jdbcType=VARCHAR} + ) + </insert> + <insert id="insertSelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VirtualLinkEntity" > + insert into vl + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="id != null" > + id, + </if> + <if test="name != null" > + name, + </if> + <if test="backendId != null" > + backend_id, + </if> + <if test="isPublic != null" > + is_public, + </if> + <if test="dcName != null" > + dc_name, + </if> + <if test="vimId != null" > + vim_id, + </if> + <if test="vimName != null" > + vim_name, + </if> + <if test="physicialNet != null" > + physicial_net, + </if> + <if test="nsId != null" > + ns_id, + </if> + <if test="nsName != null" > + ns_name, + </if> + <if test="description != null" > + description, + </if> + <if test="networkType != null" > + network_type, + </if> + <if test="segmentation != null" > + segmentation, + </if> + <if test="mtu != null" > + mtu, + </if> + <if test="vlanTransparent != null" > + vlan_transparent, + </if> + <if test="routerExternal != null" > + router_external, + </if> + <if test="resourceProviderType != null" > + resource_provider_type, + </if> + <if test="resourceProviderId != null" > + resource_provider_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="id != null" > + #{id,jdbcType=VARCHAR}, + </if> + <if test="name != null" > + #{name,jdbcType=VARCHAR}, + </if> + <if test="backendId != null" > + #{backendId,jdbcType=VARCHAR}, + </if> + <if test="isPublic != null" > + #{isPublic,jdbcType=VARCHAR}, + </if> + <if test="dcName != null" > + #{dcName,jdbcType=VARCHAR}, + </if> + <if test="vimId != null" > + #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null" > + #{vimName,jdbcType=VARCHAR}, + </if> + <if test="physicialNet != null" > + #{physicialNet,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + #{nsId,jdbcType=VARCHAR}, + </if> + <if test="nsName != null" > + #{nsName,jdbcType=VARCHAR}, + </if> + <if test="description != null" > + #{description,jdbcType=VARCHAR}, + </if> + <if test="networkType != null" > + #{networkType,jdbcType=VARCHAR}, + </if> + <if test="segmentation != null" > + #{segmentation,jdbcType=VARCHAR}, + </if> + <if test="mtu != null" > + #{mtu,jdbcType=VARCHAR}, + </if> + <if test="vlanTransparent != null" > + #{vlanTransparent,jdbcType=VARCHAR}, + </if> + <if test="routerExternal != null" > + #{routerExternal,jdbcType=VARCHAR}, + </if> + <if test="resourceProviderType != null" > + #{resourceProviderType,jdbcType=VARCHAR}, + </if> + <if test="resourceProviderId != null" > + #{resourceProviderId,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VirtualLinkEntity" > + update vl + <set > + <if test="name != null" > + name = #{name,jdbcType=VARCHAR}, + </if> + <if test="backendId != null" > + backend_id = #{backendId,jdbcType=VARCHAR}, + </if> + <if test="isPublic != null" > + is_public = #{isPublic,jdbcType=VARCHAR}, + </if> + <if test="dcName != null" > + dc_name = #{dcName,jdbcType=VARCHAR}, + </if> + <if test="vimId != null" > + vim_id = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null" > + vim_name = #{vimName,jdbcType=VARCHAR}, + </if> + <if test="physicialNet != null" > + physicial_net = #{physicialNet,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + ns_id = #{nsId,jdbcType=VARCHAR}, + </if> + <if test="nsName != null" > + ns_name = #{nsName,jdbcType=VARCHAR}, + </if> + <if test="description != null" > + description = #{description,jdbcType=VARCHAR}, + </if> + <if test="networkType != null" > + network_type = #{networkType,jdbcType=VARCHAR}, + </if> + <if test="segmentation != null" > + segmentation = #{segmentation,jdbcType=VARCHAR}, + </if> + <if test="mtu != null" > + mtu = #{mtu,jdbcType=VARCHAR}, + </if> + <if test="vlanTransparent != null" > + vlan_transparent = #{vlanTransparent,jdbcType=VARCHAR}, + </if> + <if test="routerExternal != null" > + router_external = #{routerExternal,jdbcType=VARCHAR}, + </if> + <if test="resourceProviderType != null" > + resource_provider_type = #{resourceProviderType,jdbcType=VARCHAR}, + </if> + <if test="resourceProviderId != null" > + resource_provider_id = #{resourceProviderId,jdbcType=VARCHAR}, + </if> + </set> + where id = #{id,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="org.openo.nfvo.resmanagement.service.entity.VirtualLinkEntity" > + update vl + set name = #{name,jdbcType=VARCHAR}, + backend_id = #{backendId,jdbcType=VARCHAR}, + is_public = #{isPublic,jdbcType=VARCHAR}, + dc_name = #{dcName,jdbcType=VARCHAR}, + vim_id = #{vimId,jdbcType=VARCHAR}, + vim_name = #{vimName,jdbcType=VARCHAR}, + physicial_net = #{physicialNet,jdbcType=VARCHAR}, + ns_id = #{nsId,jdbcType=VARCHAR}, + ns_name = #{nsName,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + network_type = #{networkType,jdbcType=VARCHAR}, + segmentation = #{segmentation,jdbcType=VARCHAR}, + mtu = #{mtu,jdbcType=VARCHAR}, + vlan_transparent = #{vlanTransparent,jdbcType=VARCHAR}, + router_external = #{routerExternal,jdbcType=VARCHAR}, + resource_provider_type = #{resourceProviderType,jdbcType=VARCHAR}, + resource_provider_id = #{resourceProviderId,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/VmMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/VmMapper.xml new file mode 100644 index 0000000..dc2376c --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/VmMapper.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2016-2017, 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.resmanagement.service.mapper.VmMapper" > + <resultMap id="BaseResultMap" type="org.openo.nfvo.resmanagement.service.entity.VmEntity" > + <id column="vm_id" property="vmId" jdbcType="VARCHAR" /> + <result column="vm_name" property="vmName" jdbcType="VARCHAR" /> + <result column="vm_status" property="vmStatus" jdbcType="VARCHAR" /> + <result column="vnf_instance_id" property="vnfInstanceId" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + vm_id, vm_name, vm_status, vnf_instance_id + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from vm + where vm_id = #{vmId,jdbcType=VARCHAR} + </select> + <select id="getVms" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from vm + <where> + <if test="vmId != null"> + AND vm_id = #{vmId,jdbcType=VARCHAR} + </if> + <if test="vnfInstanceId != null"> + AND vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > + delete from vm + where vm_id = #{vmId,jdbcType=VARCHAR} + </delete> + <delete id="deleteByVnfId" parameterType="java.lang.String" > + delete from vm + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </delete> + <insert id="insert" parameterType="org.openo.nfvo.resmanagement.service.entity.VmEntity" > + insert into vm (vm_id, vm_name, vm_status, + vnf_instance_id) + values (#{vmId,jdbcType=VARCHAR}, #{vmName,jdbcType=VARCHAR}, #{vmStatus,jdbcType=VARCHAR}, + #{vnfInstanceId,jdbcType=VARCHAR}) + </insert> + <insert id="insertSelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VmEntity" > + insert into vm + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="vmId != null" > + vm_id, + </if> + <if test="vmName != null" > + vm_name, + </if> + <if test="vmStatus != null" > + vm_status, + </if> + <if test="vnfInstanceId != null" > + vnf_instance_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="vmId != null" > + #{vmId,jdbcType=VARCHAR}, + </if> + <if test="vmName != null" > + #{vmName,jdbcType=VARCHAR}, + </if> + <if test="vmStatus != null" > + #{vmStatus,jdbcType=VARCHAR}, + </if> + <if test="vnfInstanceId != null" > + #{vnfInstanceId,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VmEntity" > + update vm + <set > + <if test="vmName != null" > + vm_name = #{vmName,jdbcType=VARCHAR}, + </if> + <if test="vmStatus != null" > + vm_status = #{vmStatus,jdbcType=VARCHAR}, + </if> + <if test="vnfInstanceId != null" > + vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR}, + </if> + </set> + where vm_id = #{vmId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="org.openo.nfvo.resmanagement.service.entity.VmEntity" > + update vm + set vm_name = #{vmName,jdbcType=VARCHAR}, + vm_status = #{vmStatus,jdbcType=VARCHAR}, + vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + where vm_id = #{vmId,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml new file mode 100644 index 0000000..135ccc1 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfInfoMapper.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2016-2017, 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.resmanagement.service.mapper.VnfInfoMapper" > + <resultMap id="BaseResultMap" type="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + <id column="vnf_instance_id" property="vnfInstanceId" jdbcType="VARCHAR" /> + <result column="ns_id" property="nsId" jdbcType="VARCHAR" /> + <result column="vnfm_id" property="vnfmId" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + vnf_instance_id, ns_id, vnfm_id + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from vnfinfo + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </select> + <select id="getVnfInfos" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from vnf + <where> + <if test="vnfInstanceId != null"> + AND vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > + delete from vnfinfo + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </delete> + <insert id="insert" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + insert into vnfinfo (vnf_instance_id, ns_id, vnfm_id + ) + values (#{vnfInstanceId,jdbcType=VARCHAR}, #{nsId,jdbcType=VARCHAR}, #{vnfmId,jdbcType=VARCHAR} + ) + </insert> + <insert id="insertSelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + insert into vnfinfo + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="vnfInstanceId != null" > + vnf_instance_id, + </if> + <if test="nsId != null" > + ns_id, + </if> + <if test="vnfmId != null" > + vnfm_id, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="vnfInstanceId != null" > + #{vnfInstanceId,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + #{nsId,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + #{vnfmId,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + update vnfinfo + <set > + <if test="nsId != null" > + ns_id = #{nsId,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + vnfm_id = #{vnfmId,jdbcType=VARCHAR}, + </if> + </set> + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity" > + update vnfinfo + set ns_id = #{nsId,jdbcType=VARCHAR}, + vnfm_id = #{vnfmId,jdbcType=VARCHAR} + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfMapper.xml new file mode 100644 index 0000000..cd187c3 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfMapper.xml @@ -0,0 +1,319 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2016-2017, 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.resmanagement.service.mapper.VnfMapper" > + <resultMap id="BaseResultMap" type="org.openo.nfvo.resmanagement.service.entity.VnfEntity" > + <id column="id" property="id" jdbcType="VARCHAR" /> + <result column="vnf_instance_id" property="vnfInstanceId" jdbcType="VARCHAR" /> + <result column="vnf_instance_name" property="vnfInstanceName" jdbcType="VARCHAR" /> + <result column="ns_id" property="nsId" jdbcType="VARCHAR" /> + <result column="ns_name" property="nsName" jdbcType="VARCHAR" /> + <result column="vnfm_id" property="vnfmId" jdbcType="VARCHAR" /> + <result column="vnfm_name" property="vnfmName" jdbcType="VARCHAR" /> + <result column="vnf_package_name" property="vnfPackageName" jdbcType="VARCHAR" /> + <result column="vnf_descriptor_name" property="vnfDescriptorName" jdbcType="VARCHAR" /> + <result column="vim_id" property="vimId" jdbcType="VARCHAR" /> + <result column="vim_name" property="vimName" jdbcType="VARCHAR" /> + <result column="vim_tenant" property="vimTenant" jdbcType="VARCHAR" /> + <result column="job_id" property="jobId" jdbcType="VARCHAR" /> + <result column="vnf_status" property="vnfStatus" jdbcType="VARCHAR" /> + <result column="vnf_type" property="vnfType" jdbcType="VARCHAR" /> + <result column="max_vm" property="maxVm" jdbcType="INTEGER" /> + <result column="max_cpu" property="maxCpu" jdbcType="INTEGER" /> + <result column="max_disk" property="maxDisk" jdbcType="INTEGER" /> + <result column="max_ram" property="maxRam" jdbcType="INTEGER" /> + <result column="max_shd" property="maxShd" jdbcType="INTEGER" /> + <result column="max_net" property="maxNet" jdbcType="INTEGER" /> + <result column="name" property="name" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + id, vnf_instance_id, vnf_instance_name, ns_id, ns_name, vnfm_id, vnfm_name, vnf_package_name, + vnf_descriptor_name, vim_id, vim_name, vim_tenant, job_id, vnf_status, vnf_type, + max_vm, max_cpu, max_disk, max_ram, max_shd, max_net, name + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from vnf + where id = #{id,jdbcType=VARCHAR} + </select> + <select id="getVnfs" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from vnf + <where> + <if test="id != null"> + AND ID = #{id,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > + delete from vnf + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </delete> + <insert id="insert" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfEntity" > + insert into vnf (id, vnf_instance_id, vnf_instance_name, + ns_id, ns_name, vnfm_id, + vnfm_name, vnf_package_name, vnf_descriptor_name, + vim_id, vim_name, vim_tenant, + job_id, vnf_status, vnf_type, + max_vm, max_cpu, max_disk, + max_ram, max_shd, max_net, + name) + values (#{id,jdbcType=VARCHAR}, #{vnfInstanceId,jdbcType=VARCHAR}, #{vnfInstanceName,jdbcType=VARCHAR}, + #{nsId,jdbcType=VARCHAR}, #{nsName,jdbcType=VARCHAR}, #{vnfmId,jdbcType=VARCHAR}, + #{vnfmName,jdbcType=VARCHAR}, #{vnfPackageName,jdbcType=VARCHAR}, #{vnfDescriptorName,jdbcType=VARCHAR}, + #{vimId,jdbcType=VARCHAR}, #{vimName,jdbcType=VARCHAR}, #{vimTenant,jdbcType=VARCHAR}, + #{jobId,jdbcType=VARCHAR}, #{vnfStatus,jdbcType=VARCHAR}, #{vnfType,jdbcType=VARCHAR}, + #{maxVm,jdbcType=INTEGER}, #{maxCpu,jdbcType=INTEGER}, #{maxDisk,jdbcType=INTEGER}, + #{maxRam,jdbcType=INTEGER}, #{maxShd,jdbcType=INTEGER}, #{maxNet,jdbcType=INTEGER}, + #{name,jdbcType=VARCHAR}) + </insert> + <insert id="insertSelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfEntity" > + insert into vnf + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="id != null" > + id, + </if> + <if test="vnfInstanceId != null" > + vnf_instance_id, + </if> + <if test="vnfInstanceName != null" > + vnf_instance_name, + </if> + <if test="nsId != null" > + ns_id, + </if> + <if test="nsName != null" > + ns_name, + </if> + <if test="vnfmId != null" > + vnfm_id, + </if> + <if test="vnfmName != null" > + vnfm_name, + </if> + <if test="vnfPackageName != null" > + vnf_package_name, + </if> + <if test="vnfDescriptorName != null" > + vnf_descriptor_name, + </if> + <if test="vimId != null" > + vim_id, + </if> + <if test="vimName != null" > + vim_name, + </if> + <if test="vimTenant != null" > + vim_tenant, + </if> + <if test="jobId != null" > + job_id, + </if> + <if test="vnfStatus != null" > + vnf_status, + </if> + <if test="vnfType != null" > + vnf_type, + </if> + <if test="maxVm != null" > + max_vm, + </if> + <if test="maxCpu != null" > + max_cpu, + </if> + <if test="maxDisk != null" > + max_disk, + </if> + <if test="maxRam != null" > + max_ram, + </if> + <if test="maxShd != null" > + max_shd, + </if> + <if test="maxNet != null" > + max_net, + </if> + <if test="name != null" > + name, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="id != null" > + #{id,jdbcType=VARCHAR}, + </if> + <if test="vnfInstanceId != null" > + #{vnfInstanceId,jdbcType=VARCHAR}, + </if> + <if test="vnfInstanceName != null" > + #{vnfInstanceName,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + #{nsId,jdbcType=VARCHAR}, + </if> + <if test="nsName != null" > + #{nsName,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + #{vnfmId,jdbcType=VARCHAR}, + </if> + <if test="vnfmName != null" > + #{vnfmName,jdbcType=VARCHAR}, + </if> + <if test="vnfPackageName != null" > + #{vnfPackageName,jdbcType=VARCHAR}, + </if> + <if test="vnfDescriptorName != null" > + #{vnfDescriptorName,jdbcType=VARCHAR}, + </if> + <if test="vimId != null" > + #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null" > + #{vimName,jdbcType=VARCHAR}, + </if> + <if test="vimTenant != null" > + #{vimTenant,jdbcType=VARCHAR}, + </if> + <if test="jobId != null" > + #{jobId,jdbcType=VARCHAR}, + </if> + <if test="vnfStatus != null" > + #{vnfStatus,jdbcType=VARCHAR}, + </if> + <if test="vnfType != null" > + #{vnfType,jdbcType=VARCHAR}, + </if> + <if test="maxVm != null" > + #{maxVm,jdbcType=INTEGER}, + </if> + <if test="maxCpu != null" > + #{maxCpu,jdbcType=INTEGER}, + </if> + <if test="maxDisk != null" > + #{maxDisk,jdbcType=INTEGER}, + </if> + <if test="maxRam != null" > + #{maxRam,jdbcType=INTEGER}, + </if> + <if test="maxShd != null" > + #{maxShd,jdbcType=INTEGER}, + </if> + <if test="maxNet != null" > + #{maxNet,jdbcType=INTEGER}, + </if> + <if test="name != null" > + #{name,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfEntity" > + update vnf + <set > + <if test="vnfInstanceId != null" > + vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR}, + </if> + <if test="vnfInstanceName != null" > + vnf_instance_name = #{vnfInstanceName,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + ns_id = #{nsId,jdbcType=VARCHAR}, + </if> + <if test="nsName != null" > + ns_name = #{nsName,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + vnfm_id = #{vnfmId,jdbcType=VARCHAR}, + </if> + <if test="vnfmName != null" > + vnfm_name = #{vnfmName,jdbcType=VARCHAR}, + </if> + <if test="vnfPackageName != null" > + vnf_package_name = #{vnfPackageName,jdbcType=VARCHAR}, + </if> + <if test="vnfDescriptorName != null" > + vnf_descriptor_name = #{vnfDescriptorName,jdbcType=VARCHAR}, + </if> + <if test="vimId != null" > + vim_id = #{vimId,jdbcType=VARCHAR}, + </if> + <if test="vimName != null" > + vim_name = #{vimName,jdbcType=VARCHAR}, + </if> + <if test="vimTenant != null" > + vim_tenant = #{vimTenant,jdbcType=VARCHAR}, + </if> + <if test="jobId != null" > + job_id = #{jobId,jdbcType=VARCHAR}, + </if> + <if test="vnfStatus != null" > + vnf_status = #{vnfStatus,jdbcType=VARCHAR}, + </if> + <if test="vnfType != null" > + vnf_type = #{vnfType,jdbcType=VARCHAR}, + </if> + <if test="maxVm != null" > + max_vm = #{maxVm,jdbcType=INTEGER}, + </if> + <if test="maxCpu != null" > + max_cpu = #{maxCpu,jdbcType=INTEGER}, + </if> + <if test="maxDisk != null" > + max_disk = #{maxDisk,jdbcType=INTEGER}, + </if> + <if test="maxRam != null" > + max_ram = #{maxRam,jdbcType=INTEGER}, + </if> + <if test="maxShd != null" > + max_shd = #{maxShd,jdbcType=INTEGER}, + </if> + <if test="maxNet != null" > + max_net = #{maxNet,jdbcType=INTEGER}, + </if> + <if test="name != null" > + name = #{name,jdbcType=VARCHAR}, + </if> + </set> + where id = #{id,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfEntity" > + update vnf + set vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR}, + vnf_instance_name = #{vnfInstanceName,jdbcType=VARCHAR}, + ns_id = #{nsId,jdbcType=VARCHAR}, + ns_name = #{nsName,jdbcType=VARCHAR}, + vnfm_id = #{vnfmId,jdbcType=VARCHAR}, + vnfm_name = #{vnfmName,jdbcType=VARCHAR}, + vnf_package_name = #{vnfPackageName,jdbcType=VARCHAR}, + vnf_descriptor_name = #{vnfDescriptorName,jdbcType=VARCHAR}, + vim_id = #{vimId,jdbcType=VARCHAR}, + vim_name = #{vimName,jdbcType=VARCHAR}, + vim_tenant = #{vimTenant,jdbcType=VARCHAR}, + job_id = #{jobId,jdbcType=VARCHAR}, + vnf_status = #{vnfStatus,jdbcType=VARCHAR}, + vnf_type = #{vnfType,jdbcType=VARCHAR}, + max_vm = #{maxVm,jdbcType=INTEGER}, + max_cpu = #{maxCpu,jdbcType=INTEGER}, + max_disk = #{maxDisk,jdbcType=INTEGER}, + max_ram = #{maxRam,jdbcType=INTEGER}, + max_shd = #{maxShd,jdbcType=INTEGER}, + max_net = #{maxNet,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfStatusMapper.xml b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfStatusMapper.xml new file mode 100644 index 0000000..08a5101 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/mybatis/mysql/VnfStatusMapper.xml @@ -0,0 +1,213 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2016-2017, 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.resmanagement.service.mapper.VnfStatusMapper" > + <resultMap id="BaseResultMap" type="org.openo.nfvo.resmanagement.service.entity.VnfStatusEntity" > + <id column="vnf_instance_id" property="vnfInstanceId" jdbcType="VARCHAR" /> + <result column="job_id" property="jobId" jdbcType="VARCHAR" /> + <result column="ns_id" property="nsId" jdbcType="VARCHAR" /> + <result column="vnfm_id" property="vnfmId" jdbcType="VARCHAR" /> + <result column="response_descriptor" property="responseDescriptor" jdbcType="VARCHAR" /> + <result column="status" property="status" jdbcType="VARCHAR" /> + <result column="progress" property="progress" jdbcType="VARCHAR" /> + <result column="status_description" property="statusDescription" jdbcType="VARCHAR" /> + <result column="error_code" property="errorCode" jdbcType="VARCHAR" /> + <result column="response_id" property="responseId" jdbcType="VARCHAR" /> + <result column="response_history_list" property="responseHistoryList" jdbcType="VARCHAR" /> + <result column="add_vm" property="addVm" jdbcType="VARCHAR" /> + <result column="del_vm" property="delVm" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + vnf_instance_id, job_id, ns_id, vnfm_id, response_descriptor, status, progress, status_description, + error_code, response_id, response_history_list, add_vm, del_vm + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > + select + <include refid="Base_Column_List" /> + from vnfstatus + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </select> + <select id="getVnfStatuss" resultMap="BaseResultMap" parameterType="java.util.Map"> + select + <include refid="Base_Column_List" /> + from vnfstatus + <where> + <if test="vnfInstanceId != null"> + AND vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </if> + </where> + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > + delete from vnfstatus + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </delete> + <insert id="insert" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfStatusEntity" > + insert into vnfstatus (vnf_instance_id, job_id, ns_id, + vnfm_id, response_descriptor, status, + progress, status_description, error_code, + response_id, response_history_list, add_vm, + del_vm) + values (#{vnfInstanceId,jdbcType=VARCHAR}, #{jobId,jdbcType=VARCHAR}, #{nsId,jdbcType=VARCHAR}, + #{vnfmId,jdbcType=VARCHAR}, #{responseDescriptor,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, + #{progress,jdbcType=VARCHAR}, #{statusDescription,jdbcType=VARCHAR}, #{errorCode,jdbcType=VARCHAR}, + #{responseId,jdbcType=VARCHAR}, #{responseHistoryList,jdbcType=VARCHAR}, #{addVm,jdbcType=VARCHAR}, + #{delVm,jdbcType=VARCHAR}) + </insert> + <insert id="insertSelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfStatusEntity" > + insert into vnfstatus + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="vnfInstanceId != null" > + vnf_instance_id, + </if> + <if test="jobId != null" > + job_id, + </if> + <if test="nsId != null" > + ns_id, + </if> + <if test="vnfmId != null" > + vnfm_id, + </if> + <if test="responseDescriptor != null" > + response_descriptor, + </if> + <if test="status != null" > + status, + </if> + <if test="progress != null" > + progress, + </if> + <if test="statusDescription != null" > + status_description, + </if> + <if test="errorCode != null" > + error_code, + </if> + <if test="responseId != null" > + response_id, + </if> + <if test="responseHistoryList != null" > + response_history_list, + </if> + <if test="addVm != null" > + add_vm, + </if> + <if test="delVm != null" > + del_vm, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="vnfInstanceId != null" > + #{vnfInstanceId,jdbcType=VARCHAR}, + </if> + <if test="jobId != null" > + #{jobId,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + #{nsId,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + #{vnfmId,jdbcType=VARCHAR}, + </if> + <if test="responseDescriptor != null" > + #{responseDescriptor,jdbcType=VARCHAR}, + </if> + <if test="status != null" > + #{status,jdbcType=VARCHAR}, + </if> + <if test="progress != null" > + #{progress,jdbcType=VARCHAR}, + </if> + <if test="statusDescription != null" > + #{statusDescription,jdbcType=VARCHAR}, + </if> + <if test="errorCode != null" > + #{errorCode,jdbcType=VARCHAR}, + </if> + <if test="responseId != null" > + #{responseId,jdbcType=VARCHAR}, + </if> + <if test="responseHistoryList != null" > + #{responseHistoryList,jdbcType=VARCHAR}, + </if> + <if test="addVm != null" > + #{addVm,jdbcType=VARCHAR}, + </if> + <if test="delVm != null" > + #{delVm,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfStatusEntity" > + update vnfstatus + <set > + <if test="jobId != null" > + job_id = #{jobId,jdbcType=VARCHAR}, + </if> + <if test="nsId != null" > + ns_id = #{nsId,jdbcType=VARCHAR}, + </if> + <if test="vnfmId != null" > + vnfm_id = #{vnfmId,jdbcType=VARCHAR}, + </if> + <if test="responseDescriptor != null" > + response_descriptor = #{responseDescriptor,jdbcType=VARCHAR}, + </if> + <if test="status != null" > + status = #{status,jdbcType=VARCHAR}, + </if> + <if test="progress != null" > + progress = #{progress,jdbcType=VARCHAR}, + </if> + <if test="statusDescription != null" > + status_description = #{statusDescription,jdbcType=VARCHAR}, + </if> + <if test="errorCode != null" > + error_code = #{errorCode,jdbcType=VARCHAR}, + </if> + <if test="responseId != null" > + response_id = #{responseId,jdbcType=VARCHAR}, + </if> + <if test="responseHistoryList != null" > + response_history_list = #{responseHistoryList,jdbcType=VARCHAR}, + </if> + <if test="addVm != null" > + add_vm = #{addVm,jdbcType=VARCHAR}, + </if> + <if test="delVm != null" > + del_vm = #{delVm,jdbcType=VARCHAR}, + </if> + </set> + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="org.openo.nfvo.resmanagement.service.entity.VnfStatusEntity" > + update vnfstatus + set job_id = #{jobId,jdbcType=VARCHAR}, + ns_id = #{nsId,jdbcType=VARCHAR}, + vnfm_id = #{vnfmId,jdbcType=VARCHAR}, + response_descriptor = #{responseDescriptor,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + progress = #{progress,jdbcType=VARCHAR}, + status_description = #{statusDescription,jdbcType=VARCHAR}, + error_code = #{errorCode,jdbcType=VARCHAR}, + response_id = #{responseId,jdbcType=VARCHAR}, + response_history_list = #{responseHistoryList,jdbcType=VARCHAR}, + add_vm = #{addVm,jdbcType=VARCHAR}, + del_vm = #{delVm,jdbcType=VARCHAR} + where vnf_instance_id = #{vnfInstanceId,jdbcType=VARCHAR} + </update> +</mapper>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/spring/Resmanagement/services.xml b/ResmanagementService/service/src/main/resources/spring/Resmanagement/services.xml new file mode 100644 index 0000000..a24efd5 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/spring/Resmanagement/services.xml @@ -0,0 +1,331 @@ +<?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:aop="http://www.springframework.org/schema/aop" + 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" + 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/aop/spring-aop-3.0.xsd"> + + <!-- 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="source" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> + <property name="driverClassName" value="com.mysql.jdbc.Driver"/> + <property name="url" value="jdbc:mysql://127.0.0.1:3306/resmanagementdb"/> + <property name="username" value="root"/> + <property name="password" value="rootpass"/> + </bean> + + <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> + <property name="dataSource" ref="source" /> + <property name="mapperLocations" value="classpath*:mybatis/mysql/*.xml" /> + <!-- <property name="configLocation" value="classpath:mybatis-config.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> + + <!--location --> + <bean id="locationDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.LocationDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="locationBusiness" + class="org.openo.nfvo.resmanagement.service.business.impl.LocationBusinessImpl"> + <property name="locationDao" ref="locationDao"></property> + </bean> + + <bean id="location" + class="org.openo.nfvo.resmanagement.service.base.openstack.impl.LocationImpl"> + <property name="locationBusiness" ref="locationBusiness"></property> + </bean> + + <bean id="locationRoa" class="org.openo.nfvo.resmanagement.service.rest.LocationRoa"> + <property name="location" ref="location"></property> + <property name="sites" ref="sites"></property> + </bean> + + <!--port --> + <bean id="portDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.PortDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="portBusiness" + class="org.openo.nfvo.resmanagement.service.business.impl.PortBusinessImpl"> + <property name="portDao" ref="portDao"></property> + </bean> + + <bean id="port" + class="org.openo.nfvo.resmanagement.service.base.openstack.impl.PortImpl"> + <property name="portBusiness" ref="portBusiness"></property> + </bean> + + <bean id="portRoa" class="org.openo.nfvo.resmanagement.service.rest.PortRoa"> + <property name="port" ref="port"></property> + </bean> + + <!--host --> + <bean id="hostDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.HostDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="hostBusiness" + class="org.openo.nfvo.resmanagement.service.business.impl.HostBusinessImpl"> + <property name="hostDao" ref="hostDao"></property> + </bean> + + <bean id="host" + class="org.openo.nfvo.resmanagement.service.base.openstack.impl.HostImpl"> + <property name="hostBusiness" ref="hostBusiness"></property> + </bean> + + <bean id="hostRoa" class="org.openo.nfvo.resmanagement.service.rest.HostRoa"> + <property name="host" ref="host"></property> + </bean> + + <!--network --> + <bean id="networkDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.NetworkDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="networkBusiness" + class="org.openo.nfvo.resmanagement.service.business.impl.NetworkBusinessImpl"> + <property name="networkDao" ref="networkDao"></property> + </bean> + + <bean id="network" + class="org.openo.nfvo.resmanagement.service.base.openstack.impl.NetworkImpl"> + <property name="networkBusiness" ref="networkBusiness"></property> + </bean> + + <bean id="networkRoa" class="org.openo.nfvo.resmanagement.service.rest.NetworkRoa"> + <property name="network" ref="network"></property> + </bean> + + <!--sites --> + <bean id="sitesDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.SitesDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="sitesBusiness" + class="org.openo.nfvo.resmanagement.service.business.impl.SitesBusinessImpl"> + <property name="sitesDao" ref="sitesDao"></property> + </bean> + + <bean id="sites" + class="org.openo.nfvo.resmanagement.service.base.openstack.impl.SitesImpl"> + <property name="sitesBusiness" ref="sitesBusiness"></property> + <property name="limitsBusiness" ref="limitsBusiness"></property> + <property name="resOperateService" ref="resOperateService"></property> + </bean> + + <bean id="sitesRoa" class="org.openo.nfvo.resmanagement.service.rest.SitesRoa"> + <property name="sites" ref="sites"></property> + </bean> + + <!--vim --> + <bean id="vimDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.VimDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="vimBusiness" + class="org.openo.nfvo.resmanagement.service.business.impl.VimBusinessImpl"> + <property name="vimDao" ref="vimDao"></property> + </bean> + + <bean id="vim" + class="org.openo.nfvo.resmanagement.service.base.openstack.impl.VimImpl"> + <property name="vimBusiness" ref="vimBusiness"></property> + </bean> + + <!-- limits --> + <bean id="limitsBusiness" + class="org.openo.nfvo.resmanagement.service.business.impl.LimitsBusinessImpl"> + </bean> + + <bean id="limitsRoa" class="org.openo.nfvo.resmanagement.service.rest.LimitsRoa"> + <property name="limitsBusiness" ref="limitsBusiness"></property> + </bean> + + <!-- vl --> + <bean id="virtualLinkDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.VirtualLinkDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="virtualLink" + class="org.openo.nfvo.resmanagement.service.group.impl.VirtualLinkServiceImpl"> + <property name="virtualLinkDao" ref="virtualLinkDao"></property> + </bean> + + <bean id="virtualLinkRoa" class="org.openo.nfvo.resmanagement.service.rest.VirtualLinkRoa"> + <property name="virtualLink" ref="virtualLink"></property> + </bean> + + <!-- vnf --> + <bean id="vnfDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.VnfDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="vnfService" + class="org.openo.nfvo.resmanagement.service.group.impl.VnfServiceImpl"> + <property name="vnfDao" ref="vnfDao"></property> + <property name="vnfInfoService" ref="vnfInfoService"></property> + </bean> + + <bean id="vnfRoa" class="org.openo.nfvo.resmanagement.service.rest.VnfRoa"> + <property name="vnfService" ref="vnfService"></property> + </bean> + + <!-- vm --> + <bean id="vmDao" class="org.openo.nfvo.resmanagement.service.dao.impl.VmDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="vmService" class="org.openo.nfvo.resmanagement.service.group.impl.VmServiceImpl"> + <property name="vmDao" ref="vmDao"></property> + </bean> + + <bean id="vmRoa" class="org.openo.nfvo.resmanagement.service.rest.VmRoa"> + <property name="vmService" ref="vmService"></property> + </bean> + + <!-- vnfInfo --> + <bean id="vnfInfoDao" + class="org.openo.nfvo.resmanagement.service.dao.impl.VnfInfoDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="vnfInfoService" + class="org.openo.nfvo.resmanagement.service.group.impl.VnfInfoServiceImpl"> + <property name="vnfInfoDao" ref="vnfInfoDao"></property> + <property name="vmService" ref="vmService"></property> + </bean> + + <bean id="vnfInfoRoa" class="org.openo.nfvo.resmanagement.service.rest.VnfInfoRoa"> + <property name="vnfInfoService" ref="vnfInfoService"></property> + </bean> + + <!-- vnfstatus --> + <bean id="vnfStatusDao" class="org.openo.nfvo.resmanagement.service.dao.impl.VnfStatusDaoImpl"> + <property name="session" ref="session"></property> + </bean> + + <bean id="vnfStatusService" class="org.openo.nfvo.resmanagement.service.group.impl.VnfStatusServiceImpl"> + <property name="vnfStatusDao" ref="vnfStatusDao"></property> + </bean> + + <bean id="vnfStatusRoa" class="org.openo.nfvo.resmanagement.service.rest.VnfStatusRoa"> + <property name="vnfStatusService" ref="vnfStatusService"></property> + </bean> + + <!-- grantResource --> + <bean id="grantResService" class="org.openo.nfvo.resmanagement.service.group.impl.GrantResServiceImpl"> + <property name="sites" ref="sites"></property> + </bean> + + <bean id="grantResourseRoa" class="org.openo.nfvo.resmanagement.service.rest.GrantResourseRoa"> + <property name="grantResService" ref="grantResService"></property> + </bean> + + <!--group_resoperate --> + <bean id="resOperateService" + class="org.openo.nfvo.resmanagement.service.group.impl.ResOperateServiceImpl"> + <property name="host" ref="host"></property> + <property name="port" ref="port"></property> + <property name="sites" ref="sites"></property> + <property name="network" ref="network"></property> + <property name="vim" ref="vim"></property> + <property name="iResourceUpdateServiceImpl" ref="iResourceUpdateServiceImpl"></property> + <property name="iResourceAddServiceImpl" ref="iResourceAddServiceImpl"></property> + <property name="iResourceDelServiceImpl" ref="iResourceDelServiceImpl"></property> + </bean> + + <bean id="iResourceUpdateServiceImpl" + class="org.openo.nfvo.resmanagement.service.group.impl.IResourceUpdateServiceImpl"> + </bean> + + <bean id="iResourceAddServiceImpl" + class="org.openo.nfvo.resmanagement.service.group.impl.IResourceAddServiceImpl"> + </bean> + + <bean id="iResourceDelServiceImpl" + class="org.openo.nfvo.resmanagement.service.group.impl.IResourceDelServiceImpl"> + </bean> + + <bean id="resOperateRoa" class="org.openo.nfvo.resmanagement.service.rest.ResOperateRoa"> + <property name="resOperateService" ref="resOperateService"></property> + </bean> + + <bean id="SwaggerRoa" class="org.openo.nfvo.resmanagement.service.rest.SwaggerRoa"></bean> + + <jaxrs:server id="restContainer" address="/"> + <jaxrs:serviceBeans> + <ref bean="locationRoa" /> + <ref bean="portRoa" /> + <ref bean="hostRoa" /> + <ref bean="networkRoa" /> + <ref bean="sitesRoa" /> + <ref bean="resOperateRoa" /> + <ref bean="limitsRoa" /> + <ref bean="virtualLinkRoa" /> + <ref bean="vnfRoa" /> + <ref bean="vmRoa" /> + <ref bean="vnfInfoRoa" /> + <ref bean="vnfStatusRoa" /> + <ref bean="grantResourseRoa" /> + <ref bean="SwaggerRoa" /> + </jaxrs:serviceBeans> + <jaxrs:providers> + <ref bean="jsonProvider" /> + <bean class="org.openo.nfvo.resmanagement.service.rest.exceptionmapper.ServiceExceptionMapper" /> + <bean class="org.openo.nfvo.resmanagement.service.rest.exceptionmapper.GenericExceptionMapper" /> + </jaxrs:providers> + </jaxrs:server> +</beans> diff --git a/ResmanagementService/service/src/main/resources/spring/Resmanagement/svc_register.xml b/ResmanagementService/service/src/main/resources/spring/Resmanagement/svc_register.xml new file mode 100644 index 0000000..38394ae --- /dev/null +++ b/ResmanagementService/service/src/main/resources/spring/Resmanagement/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.resmanagement.service.activator.ROAResmgrServicePostProcessor"></bean> + <bean class="org.openo.nfvo.resmanagement.service.adapter.impl.ResmgrAdapterMgrService"></bean> +</beans>
\ No newline at end of file diff --git a/ResmanagementService/service/src/main/resources/swagger.json b/ResmanagementService/service/src/main/resources/swagger.json new file mode 100644 index 0000000..6273c04 --- /dev/null +++ b/ResmanagementService/service/src/main/resources/swagger.json @@ -0,0 +1,1100 @@ +{ + "swagger": "2.0", + "info": { + "title": "Resource Management API", + "description": "Resource Management API", + "version": "1.0.0" + }, + "tags": [ + { + "name": "Resource Management services" + } + ], + "basePath": "/openoapi/resmgr/v1", + "paths": { + "/limits": { + "get": { + "summary": "Query limits information", + "description": "Query limits information", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "vimId", + "in": "query", + "description": "vim Id", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successfully Query limits information", + "schema": { + "$ref": "#/definitions/QueryLimts" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Limits Not Found" + }, + "500": { + "description": "Limits failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/resource/grant": { + "put": { + "summary": "Grant VNF Life Cycle Operation", + "description": "Grant Resource", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "open-o", + "description": "OPEN-O Interface.", + "required": true, + "schema": { + "$ref": "#/definitions/GrantResource" + } + } + ], + "responses": { + "200": { + "description": "VNF Resource Response", + "schema": { + "$ref": "#/definitions/GrantResourceResponse" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Resource Not Found" + }, + "500": { + "description": "VNF resource failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/vl": { + "post": { + "summary": "Create virtual link resource", + "description": "virtual link Resource", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "open-o", + "description": "OPEN-O Interface.", + "required": true, + "schema": { + "$ref": "#/definitions/VirtualLink" + } + } + ], + "responses": { + "202": { + "description": "Successfully Created VNF Resource", + "schema": { + "$ref": "#/definitions/VirtualLinkResponse" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Resource Not Found" + }, + "500": { + "description": "VNF resource failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/vl/{id}": { + "delete": { + "summary": "Delete virtual link resource", + "description": "Delete virtual link Resource", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "VNF Resource Id", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successfully Deleted VNF Resource" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Resource Not Found" + }, + "500": { + "description": "VNF resource failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/vnf": { + "post": { + "summary": "Create VNF instance resource", + "description": "Create VNF Resource", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "open-o", + "description": "OPEN-O Interface.", + "required": true, + "schema": { + "$ref": "#/definitions/CreateVNFResource" + } + } + ], + "responses": { + "201": { + "description": "Successfully Created VNF Resource", + "schema": { + "$ref": "#/definitions/CreateVNFResponse" + } + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Resource Not Found" + }, + "500": { + "description": "VNF resource failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/vnfinfo": { + "post": { + "summary": "Write VNF status information", + "description": "VNF Status", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "open-o", + "description": "OPEN-O Interface.", + "required": true, + "schema": { + "$ref": "#/definitions/VNFStatusInfo" + } + } + ], + "responses": { + "201": { + "description": "Successfully write VNF status" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Resource Not Found" + }, + "500": { + "description": "VNF resource failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/vnfdetailinfo": { + "post": { + "summary": "Write VNF detail information", + "description": "VNF detail info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "open-o", + "description": "OPEN-O Interface", + "required": true, + "schema": { + "$ref": "#/definitions/VNFDetailInfo" + } + } + ], + "responses": { + "201": { + "description": "Successfully write VNF detail Info" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "VNF Resource Not Found" + }, + "500": { + "description": "VNF resource failed to process the request", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "QueryLimts": { + "type": "object", + "description": "Query Limits Response.", + "required": [ + "vimId", + "vimName", + "totalCPU", + "totalMemory", + "totalDisk", + "usedCPU", + "usedMemory", + "usedDisk" + ], + "properties": { + "vimId": { + "type": "string", + "description": "Identifier of vimId." + }, + "vimName": { + "type": "string", + "description": "Name." + }, + "totalCPU": { + "type": "string" + }, + "totalMemory": { + "type": "string" + }, + "totalDisk": { + "type": "string" + }, + "usedCPU": { + "type": "string" + }, + "usedMemory": { + "type": "string" + }, + "usedDisk": { + "type": "string" + } + } + }, + "VirtualLinkResponse": { + "type": "object", + "description": "Virtual Link Response.", + "required": [ + "Id", + "Name" + ], + "properties": { + "Id": { + "type": "string", + "description": "Identifier of VL." + }, + "Name": { + "type": "string", + "description": "Name of VL." + } + } + }, + "CreateVNFResponse": { + "type": "object", + "description": "Create VNF Response.", + "required": [ + "Id", + "Name" + ], + "properties": { + "Id": { + "type": "string", + "description": "UUID." + }, + "Name": { + "type": "string", + "description": "Instance Name." + } + } + }, + "VNFDetailInfo": { + "type": "object", + "description": "List of Vm to be added or deleted", + "required": [ + "vnfInstanceId", + "nsId", + "vnfmId", + "Vms" + ], + "properties": { + "vnfInstanceId": { + "type": "string", + "description": "The id of VNF instance" + }, + "nsId": { + "type": "string", + "description": "NS ID" + }, + "vnfmId": { + "type": "string", + "description": "VNFM ID" + }, + "Vms": { + "type": "array", + "items": { + "$ref": "#/definitions/Vm" + } + } + } + }, + "VNFStatusInfo": { + "type": "object", + "description": "Write VNF Status.", + "required": [ + "vnfInstanceId", + "jobId", + "nsId", + "vnfmId", + "responseDescriptor", + "status", + "progress", + "sStatusDescription", + "errorCode", + "responseId", + "responseHistoryList", + "addVm", + "delVm" + ], + "properties": { + "vnfInstanceId": { + "type": "string", + "description": "The Id of VNF Instance." + }, + "jobId": { + "type": "string", + "description": "The ID of workflow." + }, + "nsId": { + "type": "string", + "description": "NS ID." + }, + "vnfmId": { + "type": "string", + "description": "The VNFM ID." + }, + "responseDescriptor": { + "type": "string", + "description": "The name of VNFM." + }, + "status": { + "type": "string", + "description": "Status of VNF - started processing finished error." + }, + "progress": { + "type": "integer", + "description": "progress (1-100)." + }, + "sStatusDescription": { + "type": "string", + "description": "current Progress Description." + }, + "errorCode": { + "type": "integer", + "description": "Error code." + }, + "responseId": { + "type": "integer", + "description": "Message Number." + }, + "responseHistoryList": { + "type": "array", + "items": { + "$ref": "#/definitions/progressInfo" + } + }, + "addVm": { + "type": "array", + "items": { + "$ref": "#/definitions/Vm" + } + }, + "delVm": { + "type": "array", + "items": { + "$ref": "#/definitions/Vm" + } + } + } + }, + "progressInfo": { + "type": "object", + "description": "List of Vm to be added or deleted", + "required": [ + "progress", + "status", + "statusDescription", + "errorCode", + "responseId", + "responseHistoryList" + ], + "properties": { + "progress": { + "type": "integer", + "description": "progress (1 - 100)" + }, + "status": { + "type": "string", + "description": "status" + }, + "statusDescription": { + "type": "string", + "description": "status description" + }, + "errorCode": { + "type": "integer", + "description": "Error Code" + }, + "responseId": { + "type": "integer", + "description": "Id" + }, + "responseHistoryList": { + "type": "array", + "items": { + "$ref": "#/definitions/historyInfo" + } + } + } + }, + "historyInfo": { + "type": "object", + "description": "List of Vm to be added or deleted", + "required": [ + "progress", + "status", + "statusDescription", + "errorCode", + "responseId" + ], + "properties": { + "progress": { + "type": "integer", + "description": "progress (1 - 100)" + }, + "status": { + "type": "string", + "description": "status" + }, + "statusDescription": { + "type": "string", + "description": "status description" + }, + "errorCode": { + "type": "integer", + "description": "Error Code" + }, + "responseId": { + "type": "integer", + "description": "Id" + } + } + }, + "Vm": { + "type": "object", + "description": "List of Vm to be added or deleted", + "required": [ + "vmId", + "vmName", + "vmStatus" + ], + "properties": { + "vmId": { + "type": "string", + "description": "The ID of VM" + }, + "vmName": { + "type": "string", + "description": "The name of VM" + }, + "vmStatus": { + "type": "string", + "description": "The Status of VM" + } + } + }, + "CreateVNFResource": { + "type": "object", + "description": "Create VNF Resource.", + "required": [ + "vnfInstanceId", + "vnfInstanceName", + "nsId", + "nsName", + "vnfmId", + "vnfmName", + "vnfPackageName", + "vnfDescriptorName", + "vimId", + "vimName", + "vimTenant", + "jobId", + "vnfStatus", + "vnfType", + "maxVm", + "maxCpu", + "maxDisk", + "maxRam", + "maxShd", + "maxNet" + ], + "properties": { + "vnfInstanceId": { + "type": "string", + "description": "The Identifier of VNF Instance." + }, + "vnfInstanceName": { + "type": "string", + "description": "The name of VNF." + }, + "nsId": { + "type": "string", + "description": "NS ID." + }, + "nsName": { + "type": "string", + "description": "NS name." + }, + "vnfmId": { + "type": "string", + "description": "The ID of VNFM." + }, + "vnfmName": { + "type": "string", + "description": "The name of VNFM." + }, + "vnfPackageName": { + "type": "string", + "description": "The description of VNF Package." + }, + "vnfDescriptorName": { + "type": "string", + "description": "The Description of VNFD." + }, + "vimId": { + "type": "string", + "description": "Vim ID." + }, + "vimName": { + "type": "string", + "description": "The Name of VIM." + }, + "vimTenant": { + "type": "string", + "description": "The tenant of VIM." + }, + "jobId": { + "type": "string", + "description": "The ID of workflow." + }, + "vnfStatus": { + "type": "string", + "description": "The status of VNF." + }, + "vnfType": { + "type": "string", + "description": "The type of VNF." + }, + "maxVm": { + "type": "integer", + "description": "Max Vm in this VNF." + }, + "maxCpu": { + "type": "integer", + "description": "Max CPU in this VNF." + }, + "maxDisk": { + "type": "integer", + "description": "Max Disk in this VNF." + }, + "maxRam": { + "type": "integer", + "description": "Max Memory in this VNF." + }, + "maxShd": { + "type": "integer", + "description": "Max Share Disk in this VNF." + }, + "maxNet": { + "type": "integer", + "description": "Max logical Network in this VNF." + } + } + }, + "VirtualLink": { + "type": "object", + "description": "Virtual Link Resource.", + "required": [ + "name", + "backendId", + "isPublic", + "dcName", + "vimId", + "vimName", + "physicialNet", + "nsId", + "nsName", + "description", + "networkType", + "segmentation", + "mtu", + "vlanTransparent", + "routerExternal", + "resourceProviderType", + "resourceProviderId" + ], + "properties": { + "name": { + "type": "string", + "description": "Logical Network Name." + }, + "backendId": { + "type": "string", + "description": "The backend id on VIM." + }, + "isPublic": { + "type": "string", + "description": "Sharable - True or False." + }, + "dcName": { + "type": "string", + "description": "The DataCenter name." + }, + "vimId": { + "type": "string", + "description": "vim Id." + }, + "vimName": { + "type": "string", + "description": "The name of VIM." + }, + "physicialNet": { + "type": "string", + "description": "Physicial Network." + }, + "nsId": { + "type": "string", + "description": "NsId." + }, + "nsName": { + "type": "string", + "description": "The name of NS." + }, + "description": { + "type": "string", + "description": "Description." + }, + "networkType": { + "type": "string", + "description": "Network Type - gre/vlan/vxlan." + }, + "segmentation": { + "type": "string", + "description": "Segmentation Id just like vlan id." + }, + "mtu": { + "type": "string", + "description": "MTU value." + }, + "vlanTransparent": { + "type": "string", + "description": "Support vlan transparent- True/False." + }, + "routerExternal": { + "type": "string", + "description": "Support External Router - True / False." + }, + "resourceProviderType": { + "type": "string", + "description": "The location to be deployed in one of the list - VIM/DC/Zone/Host." + }, + "resourceProviderId": { + "type": "string", + "description": "The location ID to be deployed." + } + } + }, + "GrantResourceResponse": { + "type": "object", + "description": "Resource Response.", + "required": [ + "vim", + "zone", + "zoneGroup", + "addResource", + "tempResource", + "removeResource", + "updateResource", + "vimAssets", + "additionalParam" + ], + "properties": { + "vim": { + "$ref": "#/definitions/VimInfo" + }, + "zone": { + "type": "string" + }, + "zoneGroup": { + "type": "string" + }, + "addResource": { + "$ref": "#/definitions/GrantInfo" + }, + "tempResource": { + "$ref": "#/definitions/GrantInfo" + }, + "removeResource": { + "$ref": "#/definitions/GrantInfo" + }, + "updateResource": { + "$ref": "#/definitions/GrantInfo" + }, + "vimAssets": { + "type": "string" + }, + "additionalParam": { + "type": "string" + } + } + }, + "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" + } + } + }, + "GrantInfo": { + "type": "object", + "description": "Grant Information.", + "required": [ + "resourceDefinitionId", + "reservationId", + "vimId", + "resourceProviderId", + "zoneId" + ], + "properties": { + "resourceDefinitionId": { + "type": "string", + "description": "Identifier of the related ResourceDefinition information from Grant Request" + }, + "reservationId": { + "type": "string", + "description": "Reservation Identifier applicable to the VNFC/VL." + }, + "vimId": { + "type": "string", + "description": "Reference to the identifier of the VimInfo information element defining the VIM under whose control this resource to be placed." + }, + "resourceProviderId": { + "type": "string", + "description": "Identifies the entity responsible for the management of the virtualized resource." + }, + "zoneId": { + "type": "string", + "description": "Reference of the identifier of the zoneInfo information element defining the resource zone in which resource to be placed." + } + } + }, + "GrantResource": { + "type": "object", + "description": "Grant Resource Request Body.", + "required": [ + "vnfInstanceId", + "addResource", + "vimId", + "additionalParam" + ], + "properties": { + "vnfInstanceId": { + "type": "string", + "description": "Identifier Instance." + }, + "vimId": { + "type": "string", + "description": "Identifier vim." + }, + "addResource": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceDefinition" + }, + "description": "Information sufficient to identify the VNF Descriptor which defines the VNF to be created." + }, + "removeResource": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceDefinition" + } + }, + "additionalParam": { + "type": "object", + "description": "additionalParam.", + "required": [ + "vnfmid" + ], + "properties": { + "vnfmid": { + "type": "string" + }, + "vimid": { + "type": "string" + }, + "tenant": { + "type": "string" + } + } + } + } + }, + "ResourceDefinition": { + "type": "object", + "description": "List of resources to be added / deleted / updated.", + "required": [ + "resourceDefinitionId", + "resourceTemplate", + "type", + "vdu" + ], + "properties": { + "resourceDefinitionId": { + "type": "string", + "description": "Identifier of this ResourceDefinition information element, unique at least within the scope of the Grant request." + }, + "resourceTemplate": { + "$ref": "#/definitions/ResourceTemplate" + }, + "type": { + "default": "compute", + "enum": [ + "compute", + "VL", + "CP", + "Storage" + ], + "description": "Currently only support tosca.nodes.nfv.VDU." + }, + "vdu": { + "type": "string", + "description": "Reference to the related Vdu applicable to this resource in the VNFD." + } + } + }, + "ResourceTemplate": { + "type": "object", + "description": "Resource templates.", + "required": [ + "VirtualComputeDescriptor", + "VirtualStorageDescriptor" + ], + "properties": { + "VirtualComputeDescriptor": { + "$ref": "#/definitions/VirtualComputeDescriptor" + }, + "VirtualStorageDescriptor": { + "$ref": "#/definitions/VirtualStorageDescriptor" + } + } + }, + "VirtualComputeDescriptor": { + "type": "object", + "description": "Reference to a resource template.", + "required": [ + "virtualCpu", + "virtualMemory" + ], + "properties": { + "virtualCpu": { + "type": "integer", + "format": "int32", + "description": "Number of virtual CPUs" + }, + "virtualMemory": { + "type": "integer", + "format": "int32", + "description": "Amount of virtual Memory" + } + } + }, + "VirtualStorageDescriptor": { + "type": "object", + "description": "Reference to a resource template.", + "required": [ + "typeOfStorage", + "sizeOfStorage", + "swImageDescriptor" + ], + "properties": { + "typeOfStorage": { + "type": "string", + "description": "Type of virtualized storage resource" + }, + "sizeOfStorage": { + "type": "integer", + "format": "int32", + "description": "Size of virtualized storage resource" + }, + "swImageDescriptor": { + "type": "string", + "description": "Software image to be loaded on the Virtual Storage" + } + } + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + } + } +}
\ No newline at end of file |