Forum Discussion
tadams9145
Nimbostratus
Jul 19, 2025Struggling with Node.js API for Searching Profiles Across Multiple F5 Devices
Hey everyone, I’m working on a Node.js API that connects to my frontend and allows users to search for an SSL or LTM profile by name and get back all the relevant details. The twist is that the p...
Jeffrey_Granier
Employee
Aug 14, 2025Hello,
For Node.js have you considered parallel execution using async/await with Promise.all/Promise.allSettled ? This will query all you BIG-IP devices concurrently which should help with keeping response time down. You could also leverage axios-retry for retries depending upon the error codes. On the BIG-IP side you will likely have to increase some of the restjavad settings refer here --> restjavad memory issues
Here is a sample code snippet to work off of:
const axios = require('axios');
const retry = require('axios-retry');
const pLimit = require('p-limit');
retry(axios, { retries: 3, retryDelay: (retryCount) => retryCount * 1000 });
const mgmtIPs = ['10.0.0.1', '10.0.0.2', /* ... up to 40+ */];
const profileName = 'your-profile-name'; // From user input
const limit = pLimit(10); // Concurrency limit
async function queryDevice(ip) {
try {
// Create session token (POST /mgmt/shared/authn/login)
const tokenRes = await axios.post(`https://${ip}/mgmt/shared/authn/login`, {
username: 'admin', password: 'your-password' // Use env vars or secrets manager
}, { timeout: 5000 });
const token = tokenRes.data.token.token;
// Query SSL or LTM profile (adjust endpoint: /mgmt/tm/ltm/profile/client-ssl or server-ssl for SSL, /mgmt/tm/ltm/profile for LTM)
const profileRes = await axios.get(`https://${ip}/mgmt/tm/ltm/profile/client-ssl/${profileName}`, {
headers: { 'X-F5-Auth-Token': token },
timeout: 10000 // Custom timeout
});
return { ip, details: profileRes.data }; // Aggregate if found
} catch (err) {
console.error(`Error on ${ip}: ${err.message}`);
return { ip, error: err.message }; // Don't throw; collect failures
}
}
// In your API endpoint
async function searchProfiles(req, res) {
const promises = mgmtIPs.map(ip => limit(() => queryDevice(ip)));
const results = await Promise.allSettled(promises);
const foundProfiles = results
.filter(r => r.status === 'fulfilled' && !r.value.error)
.map(r => r.value);
res.json(foundProfiles); // Return aggregated list
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects