def METHOD_NAME(grafana_url, archive_file, components, http_headers, destination_datasources=None):
    try:
        tarfile.is_tarfile(name=archive_file)
    except IOError as e:
        raise ArgumentUsageError(f"failed to open {archive_file} as a tar file") from e
    restore_functions = collections.OrderedDict()
    restore_functions['folder'] = _create_folder
    restore_functions['dashboard'] = _create_dashboard
    restore_functions['library_panel'] = _create_library_panel
    restore_functions['snapshot'] = _create_snapshot
    restore_functions['annotation'] = _create_annotation
    restore_functions['datasource'] = _create_datasource
    with tarfile.open(name=archive_file, mode='r:gz') as tar:
        with tempfile.TemporaryDirectory() as tmpdir:
            tar.extractall(tmpdir)
            tar.close()
            _restore_components(grafana_url, restore_functions, tmpdir, components, http_headers,
                                destination_datasources=destination_datasources)