forked from turbot/steampipe-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode.sp
54 lines (47 loc) · 978 Bytes
/
node.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
node "plugin" {
category = category.plugin
sql = <<EOQ
select
name as id,
name as title,
json_build_object(
'name', name,
'created', create_time,
'updated', update_time
) as properties
from
steampipe_registry_plugin
EOQ
}
node "plugin_version" {
category = category.plugin_version
sql = <<EOQ
select
digest as id,
left(split_part(digest,':',2),12) as title,
json_build_object(
'digest', digest,
'created', create_time,
'updated', update_time
) as properties
from
steampipe_registry_plugin_version
where
name = $1
EOQ
param "plugin_name" {}
}
node "plugin_tag" {
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 = $1
EOQ
param "plugin_name" {}
}