Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion plugins/NetBox/v1/dataStreams/circuits.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
"getArgs": [
{
"key": "fields",
"value": "id,cid,display,display_url,provider,provider_account,type,status,tenant,install_date,termination_date,commit_rate,description,termination_a,termination_z,created,last_updated,custom_fields"
"value": "id,cid,display,display_url,provider,provider_account,type,status,tenant,install_date,termination_date,commit_rate,description,termination_a,termination_z,created,last_updated,tags,custom_fields"
},
{
"key": "id",
"value": "{{ (typeof circuit !== 'undefined' && circuit && circuit.length) ? circuit.map(o => [].concat(o.rawId)[0]) : null }}"
},
{
"key": "tag",
"value": "{{ (typeof tag !== 'undefined' && tag && tag.length) ? [].concat(tag).flatMap(t => (t && typeof t === 'object') ? [t.value] : String(t).split(',')).map(t => String(t).trim()).filter(Boolean) : null }}"
}
],
"paging": {
Expand All @@ -40,6 +48,34 @@
"expandInnerObjects": true
},
"matches": "none",
"ui": [
{
"type": "objects",
"name": "circuit",
"label": "Circuit(s) (optional)",
"matches": {
"sourceType": {
"type": "oneOf",
"values": [
"Circuit"
]
}
}
},
{
"type": "autocomplete",
"name": "tag",
"label": "Tag(s) (optional)",
"help": "Returns only objects that have all the selected tags",
"isMulti": true,
"allowCustomValues": true,
"data": {
"source": "dataStream",
"dataStreamName": "tags",
"dataSourceConfig": {}
}
}
],
"metadata": [
{
"name": "id",
Expand Down Expand Up @@ -127,6 +163,21 @@
"displayName": "Last Updated",
"shape": "date"
},
{
"pattern": "^tags[.].*",
"visible": false
},
{
"name": "tags.0.display",
"displayName": "Tags",
"shape": [
"array",
{
"itemShape": "string"
}
],
"valueExpression": "{{ (() => { const out = []; for (let i = 0; i < 100; i++) { const n = $['tags.' + i + '.name']; if (typeof n !== 'string' || !n) break; out.push(n); } return out.length ? JSON.stringify(out) : null; })() }}"
},
{
"name": "display_url",
"displayName": "Link",
Expand Down
51 changes: 50 additions & 1 deletion plugins/NetBox/v1/dataStreams/devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"getArgs": [
{
"key": "fields",
"value": "id,display,display_url,status,role,device_type,platform,site,location,rack,position,face,serial,asset_tag,tenant,primary_ip,oob_ip,cluster,parent_device,description,created,last_updated,custom_fields"
"value": "id,display,display_url,status,role,device_type,platform,site,location,rack,position,face,serial,asset_tag,tenant,primary_ip,oob_ip,cluster,parent_device,description,created,last_updated,tags,custom_fields"
},
{
"key": "id",
"value": "{{ (typeof device !== 'undefined' && device && device.length) ? device.map(o => [].concat(o.rawId)[0]) : null }}"
},
{
"key": "site_id",
Expand All @@ -26,6 +30,10 @@
{
"key": "role",
"value": "{{ (typeof role !== 'undefined' && role && role.length) ? [].concat(role).flatMap(r => (r && typeof r === 'object') ? [r.value] : String(r).split(',')).map(r => String(r).trim()).filter(Boolean) : null }}"
},
{
"key": "tag",
"value": "{{ (typeof tag !== 'undefined' && tag && tag.length) ? [].concat(tag).flatMap(t => (t && typeof t === 'object') ? [t.value] : String(t).split(',')).map(t => String(t).trim()).filter(Boolean) : null }}"
}
],
"paging": {
Expand Down Expand Up @@ -53,6 +61,19 @@
},
"matches": "none",
"ui": [
{
"type": "objects",
"name": "device",
"label": "Device(s) (optional)",
"matches": {
"sourceType": {
"type": "oneOf",
"values": [
"Device"
]
}
}
},
{
"type": "objects",
"name": "site",
Expand Down Expand Up @@ -90,6 +111,19 @@
"dataStreamName": "deviceRoles",
"dataSourceConfig": {}
}
},
{
"type": "autocomplete",
"name": "tag",
"label": "Tag(s) (optional)",
"help": "Returns only objects that have all the selected tags",
"isMulti": true,
"allowCustomValues": true,
"data": {
"source": "dataStream",
"dataStreamName": "tags",
"dataSourceConfig": {}
}
}
],
"metadata": [
Expand Down Expand Up @@ -260,6 +294,21 @@
"computed": true,
"valueExpression": "{{ typeof $['last_updated'] === 'string' && $['last_updated'] ? Math.floor((Date.now() - new Date($['last_updated']).getTime()) / 86400000) : null }}"
},
{
"pattern": "^tags[.].*",
"visible": false
},
{
"name": "tags.0.display",
"displayName": "Tags",
"shape": [
"array",
{
"itemShape": "string"
}
],
"valueExpression": "{{ (() => { const out = []; for (let i = 0; i < 100; i++) { const n = $['tags.' + i + '.name']; if (typeof n !== 'string' || !n) break; out.push(n); } return out.length ? JSON.stringify(out) : null; })() }}"
},
{
"name": "display_url",
"displayName": "Link",
Expand Down
34 changes: 33 additions & 1 deletion plugins/NetBox/v1/dataStreams/ipAddresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"getArgs": [
{
"key": "fields",
"value": "id,address,display,display_url,family,vrf,tenant,status,role,assigned_object_id,assigned_object,dns_name,description,created,last_updated,custom_fields"
"value": "id,address,display,display_url,family,vrf,tenant,status,role,assigned_object_id,assigned_object,dns_name,description,created,last_updated,tags,custom_fields"
},
{
"key": "assigned",
Expand All @@ -38,6 +38,10 @@
{
"key": "virtual_machine_id",
"value": "{{ (typeof virtualMachine !== 'undefined' && virtualMachine && virtualMachine.length) ? virtualMachine.map(o => [].concat(o.rawId)[0]) : null }}"
},
{
"key": "tag",
"value": "{{ (typeof tag !== 'undefined' && tag && tag.length) ? [].concat(tag).flatMap(t => (t && typeof t === 'object') ? [t.value] : String(t).split(',')).map(t => String(t).trim()).filter(Boolean) : null }}"
}
],
"paging": {
Expand Down Expand Up @@ -146,6 +150,19 @@
"label": "SLAAC"
}
]
},
{
"type": "autocomplete",
"name": "tag",
"label": "Tag(s) (optional)",
"help": "Returns only objects that have all the selected tags",
"isMulti": true,
"allowCustomValues": true,
"data": {
"source": "dataStream",
"dataStreamName": "tags",
"dataSourceConfig": {}
}
}
],
"metadata": [
Expand Down Expand Up @@ -258,6 +275,21 @@
"displayName": "Last Updated",
"shape": "date"
},
{
"pattern": "^tags[.].*",
"visible": false
},
{
"name": "tags.0.display",
"displayName": "Tags",
"shape": [
"array",
{
"itemShape": "string"
}
],
"valueExpression": "{{ (() => { const out = []; for (let i = 0; i < 100; i++) { const n = $['tags.' + i + '.name']; if (typeof n !== 'string' || !n) break; out.push(n); } return out.length ? JSON.stringify(out) : null; })() }}"
},
{
"name": "display_url",
"displayName": "Link",
Expand Down
30 changes: 29 additions & 1 deletion plugins/NetBox/v1/dataStreams/powerFeeds.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"postBody": {
"query": "query PowerFeeds($offset: Int = 0) { power_feed_list(pagination: { offset: $offset, limit: 500 }{{ (typeof site !== 'undefined' && site && site.length) ? ', filters: { power_panel: { site: { id: { in_list: [' + site.map(s => Number([].concat(s.rawId)[0])).join(', ') + '] } } } }' : '' }}) { id name description status type supply phase voltage amperage max_utilization available_power mark_connected cable { id } tenant { name } rack { id name } power_panel { id name site { id name } } created last_updated custom_field_data } }"
"query": "query PowerFeeds($offset: Int = 0) { power_feed_list(pagination: { offset: $offset, limit: 500 }{{ (typeof site !== 'undefined' && site && site.length) ? ', filters: { power_panel: { site: { id: { in_list: [' + site.map(s => Number([].concat(s.rawId)[0])).join(', ') + '] } } } }' : '' }}) { id name description status type supply phase voltage amperage max_utilization available_power mark_connected cable { id } tenant { name } rack { id name } power_panel { id name site { id name } } created last_updated tags { name slug display } custom_field_data } }"
},
"paging": {
"mode": "offset",
Expand Down Expand Up @@ -54,6 +54,19 @@
]
}
}
},
{
"type": "autocomplete",
"name": "tag",
"label": "Tag(s) (optional)",
"help": "Returns only objects that have all the selected tags",
"isMulti": true,
"allowCustomValues": true,
"data": {
"source": "dataStream",
"dataStreamName": "tags",
"dataSourceConfig": {}
}
}
],
"metadata": [
Expand Down Expand Up @@ -192,6 +205,21 @@
"displayName": "Last Updated",
"shape": "date"
},
{
"pattern": "^tags[.].*",
"visible": false
},
{
"name": "tags.0.display",
"displayName": "Tags",
"shape": [
"array",
{
"itemShape": "string"
}
],
"valueExpression": "{{ (() => { const out = []; for (let i = 0; i < 100; i++) { const n = $['tags.' + i + '.name']; if (typeof n !== 'string' || !n) break; out.push(n); } return out.length ? JSON.stringify(out) : null; })() }}"
},
{
"name": "rack.id",
"visible": false
Expand Down
51 changes: 50 additions & 1 deletion plugins/NetBox/v1/dataStreams/prefixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@
"getArgs": [
{
"key": "fields",
"value": "id,display,display_url,prefix,family,vrf,scope_type,scope,status,role,tenant,vlan,is_pool,mark_utilized,_depth,children,description,created,last_updated,custom_fields"
"value": "id,display,display_url,prefix,family,vrf,scope_type,scope,status,role,tenant,vlan,is_pool,mark_utilized,_depth,children,description,created,last_updated,tags,custom_fields"
},
{
"key": "id",
"value": "{{ (typeof prefix !== 'undefined' && prefix && prefix.length) ? prefix.map(o => [].concat(o.rawId)[0]) : null }}"
},
{
"key": "site_id",
"value": "{{ (typeof site !== 'undefined' && site && site.length) ? site.map(s => [].concat(s.rawId)[0]) : null }}"
},
{
"key": "tag",
"value": "{{ (typeof tag !== 'undefined' && tag && tag.length) ? [].concat(tag).flatMap(t => (t && typeof t === 'object') ? [t.value] : String(t).split(',')).map(t => String(t).trim()).filter(Boolean) : null }}"
}
],
"paging": {
Expand Down Expand Up @@ -45,6 +53,19 @@
},
"matches": "none",
"ui": [
{
"type": "objects",
"name": "prefix",
"label": "Prefix(es) (optional)",
"matches": {
"sourceType": {
"type": "oneOf",
"values": [
"Prefix"
]
}
}
},
{
"type": "objects",
"name": "site",
Expand All @@ -57,6 +78,19 @@
]
}
}
},
{
"type": "autocomplete",
"name": "tag",
"label": "Tag(s) (optional)",
"help": "Returns only objects that have all the selected tags",
"isMulti": true,
"allowCustomValues": true,
"data": {
"source": "dataStream",
"dataStreamName": "tags",
"dataSourceConfig": {}
}
}
],
"metadata": [
Expand Down Expand Up @@ -152,6 +186,21 @@
"displayName": "Last Updated",
"shape": "date"
},
{
"pattern": "^tags[.].*",
"visible": false
},
{
"name": "tags.0.display",
"displayName": "Tags",
"shape": [
"array",
{
"itemShape": "string"
}
],
"valueExpression": "{{ (() => { const out = []; for (let i = 0; i < 100; i++) { const n = $['tags.' + i + '.name']; if (typeof n !== 'string' || !n) break; out.push(n); } return out.length ? JSON.stringify(out) : null; })() }}"
},
{
"name": "display_url",
"displayName": "Link",
Expand Down
Loading
Loading