Forum Discussion
adams8907_36321
Oct 17, 2018Historic F5 Account
How to add nodes in bulk using RestAPI?
I am trying to generate add multiple nodes using RestAPI, but I have not been able.
Wondering if this is possible, if so, can you give me an example?
youssef1
Cumulonimbus
Oct 17, 2018Hello,
First of you have to generate your Authentication token using this command:
curl -k -X POST -H "Content-Type: application/json" -d '{"username":"restapiuser","password":"restapiuser","loginProviderName": "tmos"}' https://management-IP/mgmt/shared/authn/login
You will receive a json, which includes a token. we will use it later for all our other rest API call.
..............{"token":"2MBFDOIJEFEKJ97DSDSDDSETU"...............
node creation:
curl -k -X POST -H "Content-Type: application/json" -H "X-F5-Auth-Token:2MBFDOIJEFEKJ97DSDSDDSETU" -d '{"name":"","address":""}' https://management-IP/mgmt/tm/ltm/node
Monitor creation:
curl -k -X POST -H "Content-Type: application/json" -H "X-F5-Auth-Token:2MBFDOIJEFEKJ97DSDSDDSETU" -d '{"name":"my-monitor-api","send":"GET / HTTP/1.1\r\nHost: mymonitor.domain.com\r\nConnection: Close\r\n\r\n","recv":""}' https://management-ip/mgmt/tm/ltm/monitor/http
Pool Creation:
curl -k -X POST -H "Content-Type: application/json" -H "X-F5-Auth-Token:2MBFDOIJEFEKJ97DSDSDDSETU" -d '{"name":"my-pool-api","monitor":"/Common/my-monitor-api"}' https://management-IP/mgmt/tm/ltm/pool
For more information you have a good doc below:
https://support.f5.com/csp/article/K51731137p1
let me know if you need more details.
regards,
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
