Forum Discussion

Lazaro_Pereira_'s avatar
Lazaro_Pereira_
Icon for Nimbostratus rankNimbostratus
Jul 23, 2014

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

  • 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.

  • 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's avatar
      Chitrarekha_174
      Icon for Nimbostratus rankNimbostratus
      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?
  • kunjan's avatar
    kunjan
    Icon for Nimbostratus rankNimbostratus

    Try this

     

    curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST  -d '{"name":" VCS.com:80"}'
    

     

    • dfosborne2_2224's avatar
      dfosborne2_2224
      Icon for Nimbostratus rankNimbostratus
      kunjan, dude you just saved me from failling any further down that rabbit hole. Thank you!
    • Mike_Biancaniel's avatar
      Mike_Biancaniel
      Icon for Nimbostratus rankNimbostratus

      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's avatar
      Mike_Biancaniel
      Icon for Nimbostratus rankNimbostratus

      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.

       

  • Try this

     

    curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST  -d '{"name":" VCS.com:80"}'
    

     

    • dfosborne2_2224's avatar
      dfosborne2_2224
      Icon for Nimbostratus rankNimbostratus
      kunjan, dude you just saved me from failling any further down that rabbit hole. Thank you!
    • Mike_Biancaniel's avatar
      Mike_Biancaniel
      Icon for Nimbostratus rankNimbostratus

      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's avatar
      Mike_Biancaniel
      Icon for Nimbostratus rankNimbostratus

      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.