forked from turbot/steampipe-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin_versions_inline_nodes_and_edges.sp
94 lines (80 loc) · 1.8 KB
/
plugin_versions_inline_nodes_and_edges.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
dashboard "plugin_versions_tags_inline_nodes_and_edges" {
tags = {
service = "v18 examples"
}
graph {
title = "plugin versions: inline nodes"
node {
category = category.plugin
sql = <<EOQ
select
name as id,
name as title,
jsonb_build_object(
'name', name,
'created', create_time,
'updated', update_time
) as properties
from
steampipe_registry_plugin
where
name = 'turbot/ldap'
EOQ
}
node {
category = category.plugin_version
sql = <<EOQ
select
digest as id,
left(split_part(digest,':',2),12) as title,
jsonb_build_object(
'digest', digest,
'created', create_time,
'updated', update_time
) as properties
from
steampipe_registry_plugin_version
where
name = 'turbot/ldap'
EOQ
}
node {
category = category.plugin_tag
sql = <<EOQ
select
concat(digest,':',tag) as id,
tag as title
from
steampipe_registry_plugin_version,
jsonb_array_elements(tags) as tag
where
name = 'turbot/ldap'
EOQ
}
edge {
title = "version"
sql = <<EOQ
select
name as from_id,
digest as to_id
from
steampipe_registry_plugin_version
where
name = 'turbot/ldap'
EOQ
}
edge {
title = "tag"
sql = <<EOQ
select
digest as from_id,
concat(digest,':',tag) as to_id
from
steampipe_registry_plugin_version,
jsonb_array_elements(tags) as tag
where
name = 'turbot/ldap'
EOQ
}
}
}