50 lines
1.6 KiB
HTTP
50 lines
1.6 KiB
HTTP
@host = localhost:8080
|
|
@username = user
|
|
@password = password
|
|
@from = 2026-05-27T14:00:00+02:00
|
|
@to = 2026-05-27T18:00:00+02:00
|
|
|
|
### Export CSV - Room A2 - loop over all nodes
|
|
< {%
|
|
request.variables.set("nodesA2", [
|
|
{"room": "A2", "mac": "E1:C0:30:15:4E:89"},
|
|
{"room": "A2", "mac": "C6:7E:0A:DE:DA:74"},
|
|
{"room": "A2", "mac": "E8:F3:0A:F7:3B:F3"},
|
|
{"room": "A2", "mac": "C2:64:0F:68:35:3E"},
|
|
{"room": "A2", "mac": "F5:80:05:76:53:F0"},
|
|
{"room": "A2", "mac": "C6:95:1B:A6:49:E6"}
|
|
])
|
|
%}
|
|
|
|
GET {{host}}/api/v1/export/csv?node={{$.nodesA2..mac}}&from={{from}}&to={{to}}
|
|
Authorization: Basic {{username}} {{password}}
|
|
|
|
> {%
|
|
let current = request.variables.get("nodesA2")[request.iteration()]
|
|
client.test(`Export CSV - Room ${current.room} - Node ${current.mac}`, () => {
|
|
client.assert(response.status === 200, `Expected 200, got ${response.status}`)
|
|
})
|
|
%}
|
|
|
|
### Export CSV - Room A3 - loop over all nodes
|
|
< {%
|
|
request.variables.set("nodesA3", [
|
|
{"room": "A3", "mac": "ED:B2:F3:74:3E:C2"},
|
|
{"room": "A3", "mac": "CE:25:63:38:34:05"},
|
|
{"room": "A3", "mac": "E6:8A:79:C8:87:25"},
|
|
{"room": "A3", "mac": "DC:06:D9:40:7A:CB"},
|
|
{"room": "A3", "mac": "D5:2F:7E:30:10:5A"},
|
|
{"room": "A3", "mac": "EA:1A:AD:15:5E:9F"}
|
|
])
|
|
%}
|
|
|
|
GET {{host}}/api/v1/export/csv?node={{$.nodesA3..mac}}&from={{from}}&to={{to}}
|
|
Authorization: Basic {{username}} {{password}}
|
|
|
|
> {%
|
|
let current = request.variables.get("nodesA3")[request.iteration()]
|
|
client.test(`Export CSV - Room ${current.room} - Node ${current.mac}`, () => {
|
|
client.assert(response.status === 200, `Expected 200, got ${response.status}`)
|
|
})
|
|
%}
|