Lacking support for searching nested variables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
craton |
Fix Released
|
High
|
Thomas Maddox |
Bug Description
We are currently unable to effectively query on nested variables for a resources. Not being able to do so severely hinders the power of this API and harms our value-add.
For example, let's say we want to query a series of hosts for which have a disk manufactured by Seagate and the data for this, expressed via variables on hosts, looks like:
{
"hardware_
"disks": [
{
},
{
}
]
}
}
We wouldn't be able to effectively query for this condition with our existing minimal variable querying capabilities (simply matches for "key:value"). After some discussion, we've agreed that it'd be more expressive and easier to work with if we were to provide something like JSONPath queries to achieve this. So, the end-result would look something like:
craton host-list --vars 'hardware_
There are several problems presented:
1. How do we leverage our database's JSON capabilities to achieve querying variables this way?
2. How do we handle the existing data model where a variable can be either a String datatype or a JSON document?
3. How can this be applied to querying for resolved variables?
4. What limitations exist in SQLAlchemy that may prevent or hinder our ability to implement this, and how do we overcome them?
5. In order to support this somewhat cleanly, we'll need to pin our DB requirement at MySQL 5.7, so this imposes a deployer burden.
Workaround:
The interim solution for this lies in flattening the storage of the data to diminish the need for querying nested variables, but it's still not solved entirely, and certainly not in a sustainable way.
Changed in craton: | |
milestone: | none → v0.1.0 |
importance: | Undecided → Critical |
importance: | Critical → High |
description: | updated |
Changed in craton: | |
assignee: | nobody → Thomas Maddox (thomas-maddox) |
description: | updated |
Fix proposed to branch: master /review. openstack. org/443186
Review: https:/