def _to_reconfigure_payload(**kwargs):
    """
    Utility to convert kafka message to reconfigure API payload.

    :param action_params: Action parameters in key/value pairs.
                          key - param name, value - param value
    :type action_params: ``dict``

    :param invoker-selector: Possible values: cpu, gpu. If supplied, implies
                             reconfiguration at the NFVI level to cpu/gpu node
    :type invoker-selector: ``str``

    :param action-antiaffinity: Possible values: 'true', 'false'. If 'true', do
                                not allow two actions to run on same NFVI node.
                                Relevant with invoker-selector
    :type action-antiaffinity: ``str``

    """
    if not kwargs.get('invoker-selector'):
        payload = {
            'coe_action_params': {
                'action_params': kwargs.get('action_params', {})
            }
        }
    else:
        payload = {
            'coe_action_params': {
                'action_params': kwargs.get('action_params', {}),
                'annotations': [{
                    'key': 'placement',
                    'value': {
                        'invoker-selector': {'processor': kwargs['invoker-selector']},
                        'action-antiaffinity': kwargs.get('action-antiaffinity',
                                                          'false')
                    }
                }]
            },
        }
    return payload