def container_apply_config(api, container, config):
    """
    Apply a configuration on a container.

    Container is an:class:`lxdapi.api.APIResult`for the container, to be able
    to compare the configuration with.

    Config is the dict to pass as JSON to the HTTP API.

    Example usage::

        container_apply_config(api, container_get('yourcontainer'))
    """
    if not container:
        api.post('containers', json=config).wait()
        return True
    return False
