get vitrage topology show failed with query condition

Asked by dongwenjuan

I use the cli: vitrage topology show --filter '{"and": [{"==": {"category": "RESOURCE"}},{"==": {"is_deleted": "False"}}]}' --graph-type tree
It returns `Unknown Error (HTTP 404)'

In the GrapApiHandle, i print the log:

The root_data is:
{'category': 'RESOURCE', 'is_placeholder': False, 'is_deleted': False, 'name': 'openstack.cluster', 'aggregated_state': u'RUNNING', 'state': 'available', 'vitrage_id': 'RESOURCE:openstack.cluster', 'type': 'openstack.cluster', 'id': 'openstack.cluster'}

and my query condition is:
2016-05-11 12:21:23.309 16932 DEBUG vitrage.graph.query [-] create_predicate::((item.get('category')== 'RESOURCE') and (item.get('is_deleted')== 'False')) create_predicate /opt/stack/vitrage/vitrage/graph/

2016-05-11 12:21:23.311 16932 INFO vitrage.graph.algo_driver.networkx_algorithm [-] graph_query_vertices: root RESOURCE:openstack.cluster does not match filter {u'and': [{u'==': {u'category': u'RESOURCE'}}, {u'==': {u'is_deleted': u'False'}}]}

It seems that the query condition is match the root_data, why there are not macth filter?

Thanks for help~

Question information

English Edit question
Vitrage Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alexey Weyl (aweyl) said :

In order to run the command correctly you need to write:
vitrage topology show --filter '{"and": [{"==": {"category": "RESOURCE"}},{"==": {"is_deleted": false}}]}' --graph-type tree
The changes here from the command that you ran are:
1. false with lower case letter
2. remove the Quotation mark from false, because it is a boolean value.

It is not supposed to return 404. We need to understand exactly the reason it happens (because when you just write incorrect filter it returns 500), and open a bug about it.

Can you help with this problem?

Provide an answer of your own, or ask dongwenjuan for more information if necessary.

To post a message you must log in.