.. versionadded:: 2019.2.0

    Update an existing interface with new attributes.

    device_name
        The name of the device, e.g., ``edge_router``
    interface_name
        The name of the interface, e.g., ``ae13``
    kwargs
        Arguments to change in interface, e.g., ``mac_address=50:87:69:53:32:D0``

    CLI Example:

    .. code-block:: bash

        salt myminion netbox.update_interface edge_router ae13 mac_address=50:87:69:53:32:D0

def update_interface(device_name, interface_name, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    Update an existing interface with new attributes.

    device_name
        The name of the device, e.g., ``edge_router``
    interface_name
        The name of the interface, e.g., ``ae13``
    kwargs
        Arguments to change in interface, e.g., ``mac_address=50:87:69:53:32:D0``

    CLI Example:

    .. code-block:: bash

        salt myminion netbox.update_interface edge_router ae13 mac_address=50:87:69:53:32:D0
    '''
    nb_device = get_('dcim', 'devices', name=device_name)
    nb_interface = _get('dcim', 'interfaces', auth_required=True, device_id=nb_device['id'], name=interface_name)
    if not nb_device:
        return False
    if not nb_interface:
        return False
    else:
        for k, v in __utils__['args.clean_kwargs'](**kwargs).items():
            setattr(nb_interface, k, v)
        try:
            nb_interface.save()
            return {'dcim': {'interfaces': {nb_interface.id: dict(nb_interface)}}}
        except RequestError as e:
            log.error('%s, %s, %s', e.req.request.headers, e.request_body, e.error)
            return False