fetchCableData.mjs
Sends Authorization: Basic <base64(user:pass)> with configurable credentials.
Accepts --user and --pass, or env CPL_USER/CPL_PASS; defaults to Littwin/Littwin.
Uses an https.Agent({ rejectUnauthorized: false }) when --insecure is set.
Corrected output folder to cable-monitoring-data.
CLI parser supports both --key=value and --key value (PowerShell friendly).
Quick usage (PowerShell)
All 32 slots, both types (iso=3, rsl=4), all DIA modes, last 30 days:
npm run mocks:cable
Specific date range (e.g., 2025-07-13 to 2025-08-12), all slots and types:
node .\mocks\scripts\fetchCableData.mjs --from 2025-07-13 --to 2025-08-12 --insecure
Only slot 0, Isolationswiderstand, DIA1:
node .\mocks\scripts\fetchCableData.mjs --slots 0 --modes DIA1 --types iso --from 2025-07-13 --to 2025-08-12 --insecure
Provide credentials explicitly:
node .\mocks\scripts\fetchCableData.mjs --user Littwin --pass Littwin --insecure
Or via environment variables for the session:
$env:CPL_USER = "Littwin"; $env:CPL_PASS = "Littwin"
node .\mocks\scripts\fetchCableData.mjs --insecure
Output structure
mocks/device-cgi-simulator/cable-monitoring-data/slot{0..31}/
isolationswiderstand/DIA0.json, DIA1.json, DIA2.json
schleifenwiderstand/DIA0.json, DIA1.json, DIA2.json
I smoke-tested slot 0, DIA1, iso with login and it produced DIA1.json under slot0/isolationswiderstand. If you need me to also add a convenience npm script with user/pass placeholders, say the credentials source you prefer (env vs args), and I’ll wire it.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,188 @@
|
||||
[
|
||||
{
|
||||
"t": "2025-08-12 00:00:00",
|
||||
"i": 2.533,
|
||||
"a": 2.536,
|
||||
"g": 2.534
|
||||
},
|
||||
{
|
||||
"t": "2025-08-11 00:00:00",
|
||||
"i": 2.527,
|
||||
"a": 2.54,
|
||||
"g": 2.535
|
||||
},
|
||||
{
|
||||
"t": "2025-08-10 00:00:00",
|
||||
"i": 2.527,
|
||||
"a": 2.539,
|
||||
"g": 2.529
|
||||
},
|
||||
{
|
||||
"t": "2025-08-09 00:00:00",
|
||||
"i": 2.516,
|
||||
"a": 2.54,
|
||||
"g": 2.531
|
||||
},
|
||||
{
|
||||
"t": "2025-08-08 00:00:00",
|
||||
"i": 2.525,
|
||||
"a": 2.54,
|
||||
"g": 2.532
|
||||
},
|
||||
{
|
||||
"t": "2025-08-07 00:00:00",
|
||||
"i": 2.529,
|
||||
"a": 2.547,
|
||||
"g": 2.537
|
||||
},
|
||||
{
|
||||
"t": "2025-08-06 00:00:00",
|
||||
"i": 2.525,
|
||||
"a": 2.546,
|
||||
"g": 2.531
|
||||
},
|
||||
{
|
||||
"t": "2025-08-05 00:00:00",
|
||||
"i": 2.517,
|
||||
"a": 2.543,
|
||||
"g": 2.526
|
||||
},
|
||||
{
|
||||
"t": "2025-08-04 00:00:00",
|
||||
"i": 2.512,
|
||||
"a": 2.55,
|
||||
"g": 2.531
|
||||
},
|
||||
{
|
||||
"t": "2025-08-03 00:00:00",
|
||||
"i": 2.502,
|
||||
"a": 2.539,
|
||||
"g": 2.527
|
||||
},
|
||||
{
|
||||
"t": "2025-08-02 00:00:00",
|
||||
"i": 2.502,
|
||||
"a": 2.54,
|
||||
"g": 2.528
|
||||
},
|
||||
{
|
||||
"t": "2025-08-01 00:00:00",
|
||||
"i": 2.52,
|
||||
"a": 2.529,
|
||||
"g": 2.525
|
||||
},
|
||||
{
|
||||
"t": "2025-07-31 00:00:00",
|
||||
"i": 2.516,
|
||||
"a": 2.537,
|
||||
"g": 2.527
|
||||
},
|
||||
{
|
||||
"t": "2025-07-30 00:00:00",
|
||||
"i": 2.523,
|
||||
"a": 2.53,
|
||||
"g": 2.528
|
||||
},
|
||||
{
|
||||
"t": "2025-07-29 00:00:00",
|
||||
"i": 2.52,
|
||||
"a": 2.537,
|
||||
"g": 2.529
|
||||
},
|
||||
{
|
||||
"t": "2025-07-28 00:00:00",
|
||||
"i": 2.521,
|
||||
"a": 2.537,
|
||||
"g": 2.53
|
||||
},
|
||||
{
|
||||
"t": "2025-07-27 00:00:00",
|
||||
"i": 2.521,
|
||||
"a": 2.535,
|
||||
"g": 2.527
|
||||
},
|
||||
{
|
||||
"t": "2025-07-26 00:00:00",
|
||||
"i": 2.517,
|
||||
"a": 2.535,
|
||||
"g": 2.527
|
||||
},
|
||||
{
|
||||
"t": "2025-07-25 00:00:00",
|
||||
"i": 2.51,
|
||||
"a": 2.55,
|
||||
"g": 2.53
|
||||
},
|
||||
{
|
||||
"t": "2025-07-24 00:00:00",
|
||||
"i": 2.522,
|
||||
"a": 2.539,
|
||||
"g": 2.531
|
||||
},
|
||||
{
|
||||
"t": "2025-07-23 00:00:00",
|
||||
"i": 2.515,
|
||||
"a": 2.56,
|
||||
"g": 2.538
|
||||
},
|
||||
{
|
||||
"t": "2025-07-22 00:00:00",
|
||||
"i": 2.515,
|
||||
"a": 2.545,
|
||||
"g": 2.53
|
||||
},
|
||||
{
|
||||
"t": "2025-07-21 00:00:00",
|
||||
"i": 2.522,
|
||||
"a": 2.54,
|
||||
"g": 2.531
|
||||
},
|
||||
{
|
||||
"t": "2025-07-20 00:00:00",
|
||||
"i": 2.524,
|
||||
"a": 2.544,
|
||||
"g": 2.531
|
||||
},
|
||||
{
|
||||
"t": "2025-07-19 00:00:00",
|
||||
"i": 2.524,
|
||||
"a": 2.544,
|
||||
"g": 2.535
|
||||
},
|
||||
{
|
||||
"t": "2025-07-18 00:00:00",
|
||||
"i": 2.519,
|
||||
"a": 2.543,
|
||||
"g": 2.528
|
||||
},
|
||||
{
|
||||
"t": "2025-07-17 00:00:00",
|
||||
"i": 2.517,
|
||||
"a": 2.548,
|
||||
"g": 2.535
|
||||
},
|
||||
{
|
||||
"t": "2025-07-16 00:00:00",
|
||||
"i": 2.523,
|
||||
"a": 2.54,
|
||||
"g": 2.529
|
||||
},
|
||||
{
|
||||
"t": "2025-07-15 00:00:00",
|
||||
"i": 2.51,
|
||||
"a": 2.544,
|
||||
"g": 2.522
|
||||
},
|
||||
{
|
||||
"t": "2025-07-14 00:00:00",
|
||||
"i": 2.525,
|
||||
"a": 2.544,
|
||||
"g": 2.532
|
||||
},
|
||||
{
|
||||
"t": "2025-07-13 00:00:00",
|
||||
"i": 2.517,
|
||||
"a": 2.538,
|
||||
"g": 2.527
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user