'get existing info'

def get_existing(self):

    sampler_tmp = dict()
    statistic_tmp = dict()
    statistic_tmp1 = dict()
    index_tmp = dict()
    temp = False
    self.get_exist_sampler_interval()
    self.get_exist_interface_statistic()
    self.get_exist_statistic_record()
    self.get_exist_index_switch()
    if (self.state == 'present'):
        for sampler_tmp in self.existing['sampler']:
            if (self.interface == str(sampler_tmp['interface'])):
                temp = True
                if ((self.sampler_interval and (str(sampler_tmp['sampler_interval']) != self.sampler_interval)) or (self.sampler_direction and (str(sampler_tmp['sampler_direction']) != self.sampler_direction))):
                    self.sampler_changed = True
        if (not temp):
            if (self.sampler_direction or self.sampler_interval):
                self.sampler_changed = True
        for statistic_tmp in self.existing['statistic']:
            if ((str(statistic_tmp['interface']) == self.interface) and (self.interface != 'all')):
                if (self.type == 'vxlan'):
                    if (statistic_tmp['statistics_direction'] and ('outbound' in statistic_tmp['statistics_direction'])):
                        self.module.fail_json(msg='Error:    The    NetStream    record    vxlan    cannot    be    configured    because    the    port    has    been    configured    NetStream    outbound    ip.')
                if (statistic_tmp['statistics_direction'] and self.statistics_direction):
                    if (self.statistics_direction not in statistic_tmp['statistics_direction']):
                        self.statistic_changed = True
                elif self.statistics_direction:
                    self.statistic_changed = True
        for statistic_tmp1 in self.existing['flexible_statistic']:
            if ((self.interface != 'all') and (self.type == str(statistic_tmp1['type'])) and (self.interface == str(statistic_tmp1['interface']))):
                if (statistic_tmp1['statistics_record'] and self.statistics_record):
                    if (self.statistics_record not in statistic_tmp1['statistics_record']):
                        self.flexible_changed = True
                elif self.statistics_record:
                    self.flexible_changed = True
        for index_tmp in self.existing['index-switch']:
            if (self.type == str(index_tmp['type'])):
                if (self.index_switch != str(index_tmp['index-switch'])):
                    self.index_switch_changed = True
    else:
        for sampler_tmp in self.existing['sampler']:
            if (self.interface == str(sampler_tmp['interface'])):
                if ((self.sampler_interval and (str(sampler_tmp['sampler_interval']) == self.sampler_interval)) and (self.sampler_direction and (str(sampler_tmp['sampler_direction']) == self.sampler_direction))):
                    self.sampler_changed = True
        for statistic_tmp in self.existing['statistic']:
            if ((str(statistic_tmp['interface']) == self.interface) and (self.interface != 'all')):
                if (len(statistic_tmp['statistics_direction']) and self.statistics_direction):
                    if (self.statistics_direction in statistic_tmp['statistics_direction']):
                        self.statistic_changed = True
        for statistic_tmp1 in self.existing['flexible_statistic']:
            if ((self.interface != 'all') and (self.type == str(statistic_tmp1['type'])) and (self.interface == str(statistic_tmp1['interface']))):
                if (len(statistic_tmp1['statistics_record']) and self.statistics_record):
                    if (self.statistics_record in statistic_tmp1['statistics_record']):
                        self.flexible_changed = True
        for index_tmp in self.existing['index-switch']:
            if (self.type == str(index_tmp['type'])):
                if (self.index_switch == str(index_tmp['index-switch'])):
                    if (self.index_switch != '16'):
                        self.index_switch_changed = True
