Forum Discussion
REST API Pool Member Creation
If I use the REST API and create a pool can I have a different Name than address? I looked at the example but when you run it the member in the pool shows up as the IP in both the node name field and the address field. I would like to be able to add a member with: Node Name : Server-Bob Address: 10.0.0.1:443
Is this possible with REST or do I need to look a different solution. I would prefer to use something like the python example at:
https://devcentral.f5.com/wiki/iControlREST.Python-Virtual-Server-Pool-Create.ashx
Thanks,
Lazarus
12 Replies
- Kevin_Stewart
Employee
Yes you can. Here's what it looks like in a simple cURL statement:
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://x.x.x.x/mgmt/tm/ltm/pool -d '{"name":"test-pool","members":[{"name":"Server-Bob:443","address":"10.0.0.1"}]}'
Notice that the port is actually part of the name.
- Lazaro_Pereira_
Nimbostratus
Hi Kevin,
Thank you sir!!! I ended up having it correct and it was something with the CSV file that was causing the issue(some strange whitespaces that made me have to delete some cells) but having the confirmation that using "address": was ok really helped me out in the debugging.
Lazaro
- Chitrarekha_174
Nimbostratus
how i'll add a existing member to a pool and existing member has fully qualified domain name ,either i use ip address or FQDN to add into the pool example : VCS.com i want add this to a pool. VCS.com has ip address 192.168.23.4 can anybody here to help me? - Chitrarekha_174
Nimbostratus
In rest api
- kunjan
Nimbostratus
Try this
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST -d '{"name":" VCS.com:80"}'
- dfosborne2_2224
Nimbostratus
kunjan, dude you just saved me from failling any further down that rabbit hole. Thank you! - Mike_Biancaniel
Nimbostratus
So, this adds the member, but returns a 404, which kind of screws up any automation that tries to manage members.
ver=11.5.4
Is this fixed in a later release?
- Mike_Biancaniel
Nimbostratus
Returning a 404 after successfully adding a member is definitely a bug, however, there is a workaround: add a "partition" attribute:
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://x.x.x.x/mgmt/tm/ltm/pool/test-pool/members -d '{"name":" VCS.com:80", "partition":"Common"}'
Until they fix this, just modify your code to add the "partition" for any POSTs to members/.
edit: I just found another post that references this same behavior in v12.0.
- kunjan_118660
Cumulonimbus
Try this
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST -d '{"name":" VCS.com:80"}'
- dfosborne2_2224
Nimbostratus
kunjan, dude you just saved me from failling any further down that rabbit hole. Thank you! - Mike_Biancaniel
Nimbostratus
So, this adds the member, but returns a 404, which kind of screws up any automation that tries to manage members.
ver=11.5.4
Is this fixed in a later release?
- Mike_Biancaniel
Nimbostratus
Returning a 404 after successfully adding a member is definitely a bug, however, there is a workaround: add a "partition" attribute:
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://x.x.x.x/mgmt/tm/ltm/pool/test-pool/members -d '{"name":" VCS.com:80", "partition":"Common"}'
Until they fix this, just modify your code to add the "partition" for any POSTs to members/.
edit: I just found another post that references this same behavior in v12.0.
Recent Discussions
Related Content
* 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