Update playbooks_filters.rst (#57200)

* Update playbooks_filters.rst to show JSON in the "JSON Query Filter" example data structure
pull/4420/head
Ilya Reshetnikov 2019-06-04 02:15:11 +10:00 committed by Alicia Cozine
parent ce24b43f2e
commit bf0e846a39
1 changed files with 46 additions and 23 deletions

View File

@ -482,29 +482,52 @@ Sometimes you end up with a complex data structure in JSON format and you need t
Now, let's take the following data structure:: Now, let's take the following data structure::
domain_definition: {
domain: "domain_definition": {
cluster: "domain": {
- name: "cluster1" "cluster": [
- name: "cluster2" {
server: "name": "cluster1"
- name: "server11" },
cluster: "cluster1" {
port: "8080" "name": "cluster2"
- name: "server12" }
cluster: "cluster1" ],
port: "8090" "server": [
- name: "server21" {
cluster: "cluster2" "name": "server11",
port: "9080" "cluster": "cluster1",
- name: "server22" "port": "8080"
cluster: "cluster2" },
port: "9090" {
library: "name": "server12",
- name: "lib1" "cluster": "cluster1",
target: "cluster1" "port": "8090"
- name: "lib2" },
target: "cluster2" {
"name": "server21",
"cluster": "cluster2",
"port": "9080"
},
{
"name": "server22",
"cluster": "cluster2",
"port": "9090"
}
],
"library": [
{
"name": "lib1",
"target": "cluster1"
},
{
"name": "lib2",
"target": "cluster2"
}
]
}
}
}
To extract all clusters from this structure, you can use the following query:: To extract all clusters from this structure, you can use the following query::