Comment 4 for bug 1671116

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to craton (master)

Reviewed: https://review.openstack.org/443941
Committed: https://git.openstack.org/cgit/openstack/craton/commit/?id=606926b89d2106fac4680052dbf984083f6a1e83
Submitter: Jenkins
Branch: master

commit 606926b89d2106fac4680052dbf984083f6a1e83
Author: Thomas Maddox <email address hidden>
Date: Thu Mar 9 17:11:45 2017 +0000

    JSON Path-like querying for variables

    This patch implements the ability to query for values
    in nested variable documents. For instance, if we had
    hosts with a variables that look like:

    {
        "hardware_profiles": {
            "disks": [
                {
                    "manufacturer": "seagate",
                    "capacity_quantity": 2,
                    "capacity_unit": "TB"
                },
                {
                    "manufacturer": "western",
                    "capacity_quantity": 3,
                    "capacity_unit": "TB"
                }
            ]
        }
    }

    and we wanted to grab all of them with a disk that was
    manufactured by Seagate, we would like to be able to
    query like so:

    GET /v1/hosts?vars=hardware_profiles.disks[*].manufacturer:"seagate"

    This does modify the variables query to expect valid JSON
    values. So, strings need to be quoted, for instance.

    Change-Id: Id597d3e57d2e28766fecd1b314f53176543e1b9d
    Closes-Bug: 1671116