Skip to content

Commit df7a168

Browse files
committed
make device datastreams scoped and fix timeframes
1 parent 3c0f4d6 commit df7a168

6 files changed

Lines changed: 412 additions & 132 deletions

File tree

plugins/NinjaOne/v1/dataStreams/disks.json

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,23 @@
33
"displayName": "Devices (Disks)",
44
"tags": ["Monitoring"],
55
"description": "Physical disk inventory with SMART status",
6-
"baseDataSourceName": "httpRequestUnscoped",
6+
"baseDataSourceName": "httpRequestScoped",
77
"config": {
88
"httpMethod": "get",
99
"paging": {
10-
"mode": "token",
11-
"pageSize": {
12-
"realm": "queryArg",
13-
"path": "pageSize",
14-
"value": "1000"
15-
},
16-
"in": {
17-
"realm": "payload",
18-
"path": "cursor.name"
19-
},
20-
"out": {
21-
"realm": "queryArg",
22-
"path": "cursor"
23-
}
10+
"mode": "none"
2411
},
2512
"expandInnerObjects": false,
26-
"endpointPath": "/v2/queries/disks",
27-
"pathToData": "results",
28-
"getArgs": [
29-
{
30-
"key": "ts",
31-
"value": "{{timeframe.end}}"
32-
}
33-
],
13+
"endpointPath": "/v2/device/{{objects[0].deviceId}}/disks",
14+
"getArgs": [],
3415
"headers": []
3516
},
17+
"matches": {
18+
"sourceType": {
19+
"type": "oneOf",
20+
"values": ["Device"]
21+
}
22+
},
3623
"metadata": [
3724
{
3825
"name": "status",
@@ -55,13 +42,6 @@
5542
"shape": "string",
5643
"role": "label"
5744
},
58-
{
59-
"name": "deviceId",
60-
"displayName": "Device ID",
61-
"shape": "string",
62-
"role": "id",
63-
"visible": false
64-
},
6545
{
6646
"name": "model",
6747
"displayName": "Model",
@@ -111,18 +91,5 @@
11191
"pattern": ".*"
11292
}
11393
],
114-
"timeframes": [
115-
"last1hour",
116-
"last12hours",
117-
"last24hours",
118-
"last7days",
119-
"last30days",
120-
"thisMonth",
121-
"thisQuarter",
122-
"thisYear",
123-
"lastMonth",
124-
"lastQuarter",
125-
"lastYear",
126-
"none"
127-
]
94+
"timeframes": false
12895
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"name": "disksGlobal",
3+
"displayName": "Devices (Disks Global)",
4+
"tags": ["Monitoring"],
5+
"description": "Physical disk inventory with SMART status across all devices",
6+
"baseDataSourceName": "httpRequestUnscoped",
7+
"config": {
8+
"httpMethod": "get",
9+
"paging": {
10+
"mode": "token",
11+
"pageSize": {
12+
"realm": "queryArg",
13+
"path": "pageSize",
14+
"value": "1000"
15+
},
16+
"in": {
17+
"realm": "payload",
18+
"path": "cursor.name"
19+
},
20+
"out": {
21+
"realm": "queryArg",
22+
"path": "cursor"
23+
}
24+
},
25+
"expandInnerObjects": false,
26+
"endpointPath": "/v2/queries/disks",
27+
"pathToData": "results",
28+
"getArgs": [
29+
{
30+
"key": "ts",
31+
"value": "{{timeframe.end}}"
32+
}
33+
],
34+
"headers": []
35+
},
36+
"metadata": [
37+
{
38+
"name": "status",
39+
"displayName": "Status",
40+
"shape": [
41+
"state",
42+
{
43+
"map": {
44+
"error": ["error", "failed", "pred fail"],
45+
"success": ["ok"],
46+
"warning": ["warning"],
47+
"unknown": []
48+
}
49+
}
50+
]
51+
},
52+
{
53+
"name": "name",
54+
"displayName": "Disk Name",
55+
"shape": "string",
56+
"role": "label"
57+
},
58+
{
59+
"name": "deviceId",
60+
"displayName": "Device ID",
61+
"shape": "string",
62+
"role": "id",
63+
"visible": false
64+
},
65+
{
66+
"name": "model",
67+
"displayName": "Model",
68+
"shape": "string"
69+
},
70+
{
71+
"name": "manufacturer",
72+
"displayName": "Manufacturer",
73+
"shape": "string"
74+
},
75+
{
76+
"name": "mediaType",
77+
"displayName": "Media Type",
78+
"shape": "string"
79+
},
80+
{
81+
"name": "size",
82+
"displayName": "Size (Bytes)",
83+
"shape": [
84+
"number",
85+
{
86+
"decimalPlaces": 0
87+
}
88+
]
89+
},
90+
{
91+
"name": "interfaceType",
92+
"displayName": "Interface",
93+
"shape": "string"
94+
},
95+
{
96+
"name": "smartCapable",
97+
"displayName": "SMART Capable",
98+
"shape": "boolean"
99+
},
100+
{
101+
"name": "partitionCount",
102+
"displayName": "Partition Count",
103+
"shape": [
104+
"number",
105+
{
106+
"decimalPlaces": 0
107+
}
108+
]
109+
},
110+
{
111+
"pattern": ".*"
112+
}
113+
],
114+
"timeframes": [
115+
"last1hour",
116+
"last12hours",
117+
"last24hours",
118+
"last7days",
119+
"last30days",
120+
"thisMonth",
121+
"thisQuarter",
122+
"thisYear",
123+
"lastMonth",
124+
"lastQuarter",
125+
"lastYear",
126+
"none"
127+
]
128+
}

plugins/NinjaOne/v1/dataStreams/networkInterfaces.json

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,23 @@
33
"displayName": "Devices (Network Interfaces)",
44
"tags": ["Monitoring"],
55
"description": "Network adapters with IP, MAC, and link speed",
6-
"baseDataSourceName": "httpRequestUnscoped",
6+
"baseDataSourceName": "httpRequestScoped",
77
"config": {
88
"httpMethod": "get",
99
"paging": {
10-
"mode": "token",
11-
"pageSize": {
12-
"realm": "queryArg",
13-
"path": "pageSize",
14-
"value": "1000"
15-
},
16-
"in": {
17-
"realm": "payload",
18-
"path": "cursor.name"
19-
},
20-
"out": {
21-
"realm": "queryArg",
22-
"path": "cursor"
23-
}
10+
"mode": "none"
2411
},
2512
"expandInnerObjects": true,
26-
"endpointPath": "/v2/queries/network-interfaces",
27-
"pathToData": "results",
28-
"getArgs": [
29-
{
30-
"key": "ts",
31-
"value": "{{timeframe.end}}"
32-
}
33-
],
13+
"endpointPath": "/v2/device/{{objects[0].deviceId}}/network-interfaces",
14+
"getArgs": [],
3415
"headers": []
3516
},
17+
"matches": {
18+
"sourceType": {
19+
"type": "oneOf",
20+
"values": ["Device"]
21+
}
22+
},
3623
"metadata": [
3724
{
3825
"name": "status",
@@ -55,13 +42,6 @@
5542
"shape": "string",
5643
"role": "label"
5744
},
58-
{
59-
"name": "deviceId",
60-
"displayName": "Device ID",
61-
"shape": "string",
62-
"role": "id",
63-
"visible": false
64-
},
6545
{
6646
"name": "adapterName",
6747
"displayName": "Adapter Name",
@@ -116,18 +96,5 @@
11696
"pattern": ".*"
11797
}
11898
],
119-
"timeframes": [
120-
"last1hour",
121-
"last12hours",
122-
"last24hours",
123-
"last7days",
124-
"last30days",
125-
"thisMonth",
126-
"thisQuarter",
127-
"thisYear",
128-
"lastMonth",
129-
"lastQuarter",
130-
"lastYear",
131-
"none"
132-
]
99+
"timeframes": false
133100
}

0 commit comments

Comments
 (0)