update
This commit is contained in:
1 parent
da8fb57bfb
commit
bba75c7dc6
35 files changed
+92592
-500
No files matched your search
@@ -0,0 +1,33 @@
|
||||
const axios = require('axios');
|
||||
const path = require('path');
|
||||
require('dotenv').config({ path: path.join(__dirname, '.env.local') });
|
||||
|
||||
const API_KEY = process.env.NETIFY_API_KEY;
|
||||
const SITE_UUID = process.env.NETIFY_SITE_UUID;
|
||||
const BASE = 'https://informatics.netify.ai/api/v1';
|
||||
|
||||
const headers = {
|
||||
'x-api-key': API_KEY,
|
||||
'x-net-site': SITE_UUID,
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
async function inspect() {
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/data/flows`, { headers, params: { settings_limit: 2 } });
|
||||
console.log('=== FLOW 0 ===');
|
||||
console.dir(res.data?.data?.[0], { depth: null });
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await axios.get(`${BASE}/intelligence/discovery/devices`, { headers, params: { settings_limit: 2 } });
|
||||
console.log('=== DISCOVERY DEVICE 0 ===');
|
||||
console.dir(res.data?.data?.[0], { depth: null });
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
inspect();
|
||||
Reference in new issue
Block a user