<?xml version="1.0" encoding="UTF-8" ?>
<package name="notification" version="v0.1.0">

    <!-- 1.依赖分析 - 描述运行本插件包需要的其他插件包 -->
    <packageDependencies>
    </packageDependencies>

    <!-- 2.菜单注入 - 描述运行本插件包需要注入的菜单 -->
    <menus>
    </menus>

    <!-- 3.数据模型 - 描述本插件包的数据模型,并且描述和Framework数据模型的关系 -->
    <dataModel></dataModel>

    <!-- 4.系统参数 - 描述运行本插件包需要的系统参数 -->
    <systemParameters>
        <systemParameter name="DEFAULT_MAIL_SSL_ENABLE" scopeType="global" defaultValue="Y"/>
        <systemParameter name="MAIL_DEFAULT_SENDER_USER" scopeType="global" defaultValue=""/>
        <systemParameter name="MAIL_DEFAULT_SENDER_PASSWORD" scopeType="global" defaultValue=""/>
        <systemParameter name="MAIL_DEFAULT_SENDER_SERVER" scopeType="global" defaultValue=""/>
    </systemParameters>

    <!-- 5.权限设定 -->
    <authorities>
    </authorities>

    <!-- 6.运行资源 - 描述部署运行本插件包需要的基础资源(如主机、虚拟机、容器、数据库等) -->
    <resourceDependencies>
        <docker imageName="wecube-plugins-notifications:v0.1.0" containerName="wecube-plugins-notification-v0.1.0" portBindings="{{ALLOCATE_PORT}}:9095" volumeBindings="{{BASE_MOUNT_PATH}}/notification/logs:/app/notification/logs" envVariables="MAIL_AUTH_USER={{MAIL_DEFAULT_SENDER_USER}},MAIL_AUTH_PASSWORD={{MAIL_DEFAULT_SENDER_PASSWORD}},MAIL_AUTH_SERVER={{MAIL_DEFAULT_SENDER_SERVER}},/etc/localtime:/etc/localtime"/>
    </resourceDependencies>

    <!-- 7.插件列表 - 描述插件包中单个插件的输入和输出 -->
    <plugins>
        <plugin name="mail" targetPackage="" targetEntity="" registerName="" targetEntityFilterRule="">
            <interface action="send" path="/notification/mail/send" httpMethod="POST" filterRule="">
                <inputParameters>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="system_variable" mappingSystemVariableName="DEFAULT_MAIL_SSL_ENABLE">ssl</parameter>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="constant">to</parameter>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="constant">subject</parameter>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="constant">content</parameter>
                    <parameter datatype="string" required="N" sensitiveData="N" mappingType="constant">senderMail</parameter>
                    <parameter datatype="string" required="N" sensitiveData="N" mappingType="constant">senderMailServer</parameter>
                    <parameter datatype="string" required="N" sensitiveData="N" mappingType="constant">senderPassword</parameter>
                </inputParameters>
                <outputParameters>
                    <parameter datatype="string" sensitiveData="N" mappingType="context">errorCode</parameter>
                    <parameter datatype="string" sensitiveData="N" mappingType="context">errorMessage</parameter>
                </outputParameters>
            </interface>
        </plugin>
        <!-- 最佳实践 -->
        <plugin name="mail" targetPackage="wecube-monitor" targetEntity="alarm" registerName="alarm" targetEntityFilterRule="">
            <interface action="send" path="/notification/mail/send" httpMethod="POST" filterRule="">
                <inputParameters>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="system_variable" mappingSystemVariableName="DEFAULT_MAIL_SSL_ENABLE">ssl</parameter>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="entity" mappingEntityExpression="wecube-monitor:alarm.toMail">to</parameter>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="entity" mappingEntityExpression="wecube-monitor:alarm.subject">subject</parameter>
                    <parameter datatype="string" required="Y" sensitiveData="N" mappingType="entity" mappingEntityExpression="wecube-monitor:alarm.content">content</parameter>
                    <parameter datatype="string" required="N" sensitiveData="N" mappingType="system_variable" mappingSystemVariableName="MONITOR_MAIL_SENDER_USER">senderMail</parameter>
                    <parameter datatype="string" required="N" sensitiveData="N" mappingType="system_variable" mappingSystemVariableName="MONITOR_MAIL_SENDER_SERVER">senderMailServer</parameter>
                    <parameter datatype="string" required="N" sensitiveData="N" mappingType="system_variable" mappingSystemVariableName="MONITOR_MAIL_SENDER_PASSWORD">senderPassword</parameter>
                </inputParameters>
                <outputParameters>
                    <parameter datatype="string" sensitiveData="N" mappingType="context">errorCode</parameter>
                    <parameter datatype="string" sensitiveData="N" mappingType="context">errorMessage</parameter>
                </outputParameters>
            </interface>
        </plugin>
    </plugins>
</package>
