'worker'

def work(self):

    self.check_params()
    if (self.info_center_enable or self.packet_priority or self.suppress_enable):
        self.cur_global_info = self.get_syslog_global()
    if (self.logfile_max_num or self.logfile_max_size):
        self.cur_logfile_info = self.get_syslog_logfile()
    if self.channel_id:
        self.channel_info = self.get_channel_dict()
    if self.channel_out_direct:
        self.channel_direct_info = self.get_channel_direct_dict()
    if (self.filter_feature_name and self.filter_log_name):
        self.filter_info = self.get_filter_dict()
    if self.ip_type:
        self.server_ip_info = self.get_server_ip_dict()
    if self.server_domain:
        self.server_domain_info = self.get_server_domain_dict()
    self.get_existing()
    self.get_proposed()
    if (self.info_center_enable or self.packet_priority or self.suppress_enable):
        self.merge_syslog_global()
    if (self.logfile_max_num or self.logfile_max_size):
        self.merge_syslog_logfile()
    if self.server_ip:
        if (not self.ip_type):
            self.module.fail_json(msg='Error:    ip_type    and    server_ip    must    be    exist    at    the    same    time.')
    if self.ip_type:
        if (not self.server_ip):
            self.module.fail_json(msg='Error:    ip_type    and    server_ip    must    be    exist    at    the    same    time.')
    if (self.ip_type or self.server_domain or self.channel_id or self.filter_feature_name):
        if (self.ip_type and self.server_domain):
            self.module.fail_json(msg='Error:    ip_type    and    server_domain    can    not    be    exist    at    the    same    time.')
        if (self.channel_id and self.channel_name):
            self.module.fail_json(msg='Error:    channel_id    and    channel_name    can    not    be    exist    at    the    same    time.')
        if self.ssl_policy_name:
            if (self.transport_mode == 'udp'):
                self.module.fail_json(msg='Error:    transport_mode:    udp    does    not    support    ssl_policy.')
            if (not self.transport_mode):
                self.module.fail_json(msg='Error:    transport_mode,    ssl_policy_name    must    be    exist    at    the    same    time.')
        if (self.ip_type == 'ipv6'):
            if (self.vrf_name and (self.vrf_name != '_public_')):
                self.module.fail_json(msg='Error:    ipType:ipv6    only    support    default    vpn:_public_.')
        if (self.is_default_vpn is True):
            if self.vrf_name:
                if (self.vrf_name != '_public_'):
                    self.module.fail_json(msg='Error:    vrf_name    should    be    _public_    when    is_default_vpn    is    True.')
            else:
                self.vrf_name = '_public_'
        elif (self.vrf_name == '_public_'):
            self.module.fail_json(msg='Error:    The    default    vpn    value    is    _public_,    but    is_default_vpn    is    False.')
        if (self.state == 'present'):
            if (self.channel_id and self.channel_cfg_name):
                self.config_merge_syslog_channel(self.channel_id, self.channel_cfg_name)
            if (self.channel_out_direct and self.channel_id):
                self.config_merge_out_direct(self.channel_out_direct, self.channel_id)
            if (self.filter_feature_name and self.filter_log_name):
                self.config_merge_filter(self.filter_feature_name, self.filter_log_name)
            if (self.ip_type and self.server_ip):
                if (not self.vrf_name):
                    self.vrf_name = '_public_'
                if self.check_need_loghost_cfg():
                    self.config_merge_loghost()
            if self.server_domain:
                if (not self.vrf_name):
                    self.vrf_name = '_public_'
                if self.check_need_loghost_cfg():
                    self.config_merge_loghost()
        elif (self.state == 'absent'):
            if self.channel_id:
                self.delete_merge_syslog_channel(self.channel_id, self.channel_cfg_name)
            if self.channel_out_direct:
                self.delete_merge_out_direct(self.channel_out_direct, self.channel_id)
            if (self.filter_feature_name and self.filter_log_name):
                self.delete_merge_filter(self.filter_feature_name, self.filter_log_name)
            if (self.ip_type and self.server_ip):
                if (not self.vrf_name):
                    self.vrf_name = '_public_'
                if self.check_need_loghost_cfg():
                    self.delete_merge_loghost()
            if self.server_domain:
                if (not self.vrf_name):
                    self.vrf_name = '_public_'
                if self.check_need_loghost_cfg():
                    self.delete_merge_loghost()
    self.get_end_state()
    self.results['changed'] = self.changed
    self.results['proposed'] = self.proposed
    self.results['existing'] = self.existing
    self.results['end_state'] = self.end_state
    if self.changed:
        self.results['updates'] = self.updates_cmd
    else:
        self.results['updates'] = list()
    self.module.exit_json(**self.results)
