Search the graph and return the resulting graph.
POST/graph/:graph_id/search/graph
Search the graph and return the matching nodes including the traversed edges. The resulting data can be interpreted as a graph. A section can be defined (defaults to /
== root) to interpret relative property paths. Example: is(volume) and (reported.age>23d or desired.clean==true or metadata.version==2)
Request​
Path Parameters
The identifier of the graph
Query Parameters
Possible values: [reported
, desired
, metadata
]
The name of the section used for all property paths. If not defined root is assumed.
Include the kind of the node in the result node.
Default value: true
Optional parameter to get a Ck-Element-Count header which returns the number of returned json elements
Optional duration the search is allowed to run.
The timestamp to use for the search. If not defined the latest version of the graph is used.
- text/plain
Body
The search to perform
string
Responses​
- 200
The result of this search in the defined format
- application/json
- application/x-ndjson
- text/plain
- application/yaml
- application/vnd.graphml+xml
- application/vnd.cytoscape+json
- text/vnd.graphviz
- Schema
- Example (from schema)
Schema
Array [
]
The kind of this node.
[
{
"id": "123456",
"reported": {
"kind": "test.person",
"name": "Batman",
"city": "Gotham"
}
}
]
- Schema
- Example (from schema)
- Example
Schema
The kind of this node.
{
"id": "123456",
"reported": {
"kind": "test.person",
"name": "Batman",
"city": "Gotham"
}
}
{"type": "node", "id": "root", "revision": "123", "reported": {"kind": "graph_root", "id": "root", "tags": {}, "name": "root"}}
{"type": "node", "id": "cloud_id", "revision": "12", "reported": {"kind": "cloud", "id": "onelogin", "tags": {}, "name": "onelogin", "ctime": "2021-12-14T08:49:52Z", "age": "6d7h"}}
{"type": "edge", "from": "root", "to": "cloud_id", "edge_type": "default"}
- Schema
- Example
Schema
any
reported:
kind: graph_root
id: root
tags: {}
name: root
metadata:
cleaned: false
phantom: true
protected: false
- Schema
- Example
Schema
any
id: root
type: node
revision: _daGy-Bu---
reported:
kind: graph_root
id: root
tags: { }
name: root
metadata:
python_type: fixlib.baseresources.GraphRoot
cleaned: false
phantom: true
protected: false
kinds:
- graph_root
---
id: 2RZlTX9yzeBwTNT_H1KZVA
type: node
revision: _daGy-Bi---
reported:
kind: cloud
id: onelogin
tags: { }
name: onelogin
ctime: '2021-12-14T08:49:52Z'
age: 6d7h
metadata:
python_type: fixlib.baseresources.Cloud
cleaned: false
phantom: false
protected: false
descendant_summary:
onelogin_account: 1
onelogin_region: 1
onelogin_user: 1034
descendant_count: 1036
ancestors:
cloud:
reported:
name: onelogin
id: onelogin
kinds:
- cloud
- base_cloud
- resource
---
type: edge
from: root
to: 2RZlTX9yzeBwTNT_H1KZVA
edge_type: default
- Schema
- Example
Schema
any
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="d4" for="node" attr.name="age" attr.type="string"/>
<key id="d3" for="node" attr.name="ctime" attr.type="string"/>
<key id="d2" for="node" attr.name="name" attr.type="string"/>
<key id="d1" for="node" attr.name="id" attr.type="string"/>
<key id="d0" for="node" attr.name="kind" attr.type="string"/>
<graph edgedefault="directed">
<node id="root">
<data key="d0">graph_root</data>
<data key="d1">root</data>
<data key="d2">root</data>
</node>
<node id="cloud_id">
<data key="d0">cloud</data>
<data key="d1">onelogin</data>
<data key="d2">onelogin</data>
<data key="d3">2021-12-14T08:49:52Z</data>
<data key="d4">6d7h</data>
</node>
<edge source="root" target="cloud_id"/>
</graph>
</graphml>
- Schema
- Example
Schema
any
{
"data": [ ],
"directed": true,
"elements": {
"edges": [
{
"data": {
"source": "root",
"target": "cloud_id"
}
}
],
"nodes": [
{
"data": {
"id": "root",
"kind": "graph_root",
"name": "root",
"tags": { },
"value": "root"
}
},
{
"data": {
"age": "6d7h",
"ctime": "2021-12-14T08:49:52Z",
"id": "onelogin",
"kind": "cloud",
"name": "onelogin",
"tags": { },
"value": "cloud_id"
}
}
]
},
"multigraph": false
}
- Schema
- Example
Schema
any
digraph {
rankdir=LR
overlap=false
splines=true
node [shape=Mrecord colorscheme=paired12]
edge [arrowsize=0.5]
"root" [label="root|graph_root", style=filled fillcolor=1];
"2RZlTX9yzeBwTNT_H1KZVA" [label="onelogin|cloud", style=filled fillcolor=2];
"root" -> "2RZlTX9yzeBwTNT_H1KZVA"
subgraph "graph_root" {
"root"
"2RZlTX9yzeBwTNT_H1KZVA"
}
}