def _dataset_id_for_name(self, name):
        listing = self._flocker_client.list_datasets_configuration()

        def got_configured(configured):
            for dataset in configured:
                if dataset.metadata.get(NAME_FIELD) == name:
                    return dataset.dataset_id
            raise NOT_FOUND_RESPONSE

        listing.addCallback(got_configured)
        return listing
Lookup a dataset's ID based on name in metadata.
dataset/ETHPy150Open ClusterHQ/flocker/flocker/dockerplugin/_api.py/VolumePlugin._dataset_id_for_name