From e032855287effc57922ae435370cfc879a3b1c36 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Wed, 28 Aug 2019 06:52:55 +0000 Subject: [PATCH] Added information how to use JsonFilter Creating a query hint to use JsonFilter that will choose required backed to create a volume was complicated. Added description how to use that will be helpful for others. Change-Id: If04f037cf55b5b9d116927aa4b23a9c42d7b53e6 Co-authored-by: Bartosz Rabiega --- cinder/scheduler/filters/json_filter.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cinder/scheduler/filters/json_filter.py b/cinder/scheduler/filters/json_filter.py index ee763a9d1da..6377537ee9f 100644 --- a/cinder/scheduler/filters/json_filter.py +++ b/cinder/scheduler/filters/json_filter.py @@ -22,7 +22,14 @@ from cinder.scheduler import filters class JsonFilter(filters.BaseBackendFilter): - """Backend filter for simple JSON-based grammar for selecting backends.""" + """Backend filter for simple JSON-based grammar for selecting backends. + + If you want to choose one of your backend, + make a query hint, for example: + + cinder create --hint query='["=", "$backend_id", "rbd:vol@ceph#cloud"]' + """ + def _op_compare(self, args, op): """Compare first item of args with the rest using specified operator.