'configure a VLAN as a service access point'

def config_vap_vlan(self):

    if (not self.vap_info):
        self.module.fail_json(msg=('Error:    Bridge    domain    %s    does    not    exist.' % self.bridge_domain_id))
    xml_str = ''
    if (self.state == 'present'):
        if (not is_vlan_in_bitmap(self.bind_vlan_id, self.vap_info['vlanList'])):
            self.updates_cmd.append(('bridge-domain    %s' % self.bridge_domain_id))
            self.updates_cmd.append(('l2    binding    vlan    %s' % self.bind_vlan_id))
            vlan_bitmap = vlan_vid_to_bitmap(self.bind_vlan_id)
            xml_str = (CE_NC_MERGE_BD_VLAN % (self.bridge_domain_id, vlan_bitmap, vlan_bitmap))
    elif is_vlan_in_bitmap(self.bind_vlan_id, self.vap_info['vlanList']):
        self.updates_cmd.append(('bridge-domain    %s' % self.bridge_domain_id))
        self.updates_cmd.append(('undo    l2    binding    vlan    %s' % self.bind_vlan_id))
        vlan_bitmap = vlan_vid_to_bitmap(self.bind_vlan_id)
        xml_str = (CE_NC_MERGE_BD_VLAN % (self.bridge_domain_id, ('0' * 1024), vlan_bitmap))
    if (not xml_str):
        return
    recv_xml = set_nc_config(self.module, xml_str)
    self.check_response(recv_xml, 'CONFIG_VAP_VLAN')
    self.changed = True
