Update playbooks_filters.rst (#57200)
* Update playbooks_filters.rst to show JSON in the "JSON Query Filter" example data structure
This commit is contained in:
parent
ce24b43f2e
commit
bf0e846a39
1 changed files with 46 additions and 23 deletions
|
@ -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::
|
||||
|
||||
domain_definition:
|
||||
domain:
|
||||
cluster:
|
||||
- name: "cluster1"
|
||||
- name: "cluster2"
|
||||
server:
|
||||
- name: "server11"
|
||||
cluster: "cluster1"
|
||||
port: "8080"
|
||||
- name: "server12"
|
||||
cluster: "cluster1"
|
||||
port: "8090"
|
||||
- name: "server21"
|
||||
cluster: "cluster2"
|
||||
port: "9080"
|
||||
- name: "server22"
|
||||
cluster: "cluster2"
|
||||
port: "9090"
|
||||
library:
|
||||
- name: "lib1"
|
||||
target: "cluster1"
|
||||
- name: "lib2"
|
||||
target: "cluster2"
|
||||
{
|
||||
"domain_definition": {
|
||||
"domain": {
|
||||
"cluster": [
|
||||
{
|
||||
"name": "cluster1"
|
||||
},
|
||||
{
|
||||
"name": "cluster2"
|
||||
}
|
||||
],
|
||||
"server": [
|
||||
{
|
||||
"name": "server11",
|
||||
"cluster": "cluster1",
|
||||
"port": "8080"
|
||||
},
|
||||
{
|
||||
"name": "server12",
|
||||
"cluster": "cluster1",
|
||||
"port": "8090"
|
||||
},
|
||||
{
|
||||
"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::
|
||||
|
||||
|
|
Loading…
Reference in a new issue