code: def _port_action_vlan(self, port, segment, func, vni):
          
  
          # Verify segment.
          if not self._is_valid_segment(segment):
              return
  
          device_id = self._get_port_uuid(port)
  
          if nexus_help.is_baremetal(port):
              host_id = port.get('dns_name')
          else:
              host_id = port.get(bc.portbindings.HOST_ID)
  
          vlan_id = segment.get(api.SEGMENTATION_ID)
          is_provider = nxos_db.is_provider_vlan(vlan_id)
  
          settings = {"vlan_id": vlan_id,
                      "device_id": device_id,
                      "host_id": host_id}
          missing_fields = [field for field, value in settings.items()
                            if (field != 'host_id' and not value)]
          if not missing_fields:
              func(port, vlan_id, device_id, host_id, vni, is_provider)
          else:
              raise excep.NexusMissingRequiredFields(
                  fields=' '.join(missing_fields))
docs: Verify configuration and then process event.