Forum Discussion

Faintly_Lucky's avatar
Faintly_Lucky
Icon for Nimbostratus rankNimbostratus
Nov 06, 2015

REST - Any way to add multiple pool members in the same request?

I can add a single member at time and I can use a for loop to add multiple members to a given pool. The sticking point is when I have to add the same 30 members to 110 pools. It's doable with a for loop inside of a for loop, but it's rather inefficient to say the least.

 

Using a PUT method to replace all members in 110 pools is something that would be more efficient, but I'd rather not touch what's already there. Is there a way of adding multiple members in one request?

 

Moving on to most efficient, being able to specify a collection of pool names along with a collection of members to add in a single request (possible through SOAP API) would be great.

 

Obviously, if anyone knows how to accomplish "most efficient", great! I'd settle for adding multiple members to a single pool in a single request encapsulated in a for loop, which would bring the total requests down from 3300 to 110.

 

Thanks in advance,

 

Lucky

 

4 Replies

  • Seems to be not supported. Bug or feature?

    On v12.1.2 I just tried the following with

    PUT
    and
    PATCH
    for /mgmt/tm/ltm/pool/~~/members/:

    '{"items":[{"name":"node_113:80","partition":"Common","address":"10.131.131.113"},{"name":"node_115:80","partition":"Common","address":"10.131.131.115"}]}'

    A 403 error is returned: Operation is not supported on property /ltm/pool/~~/members.

    Via tmsh it works as expected:

    tmsh modify ltm pool  members add { node_113:80 { address 10.131.131.113 } node_115:80 { address 10.131.131.115 } }

  • Hello Stephan,

    On v13 it is supported. Could you try it on v12.1.2 using this format :

     Create a pool called ipool2
    curl -sk -u admin:admin -H "Content-Type: application/json" -X POST https://X.X.X.X/mgmt/tm/ltm/pool -d '{"name":"ipool2" }'
    
     Add multiple member to that pool
    curl -sk -u admin:admin -H "Content-Type: application/json" -X PUT https://X.X.X.X/mgmt/tm/ltm/pool/~Common~ipool2 -d '{"members":[{"name":"1.1.1.1:8080"},{"name":"2.2.2.2:8080"}]}'
    

    Hope it helps

    Please give me a feedback .

    Regards

  • The PUT request will do a replace-all-with even in v13.x. That works if it is your intention, but I am trying to get a PATCH call to just add new members and not touch the existing ones.I have an RFE open for this feature. Bit of a conflict with F5 PD claiming a PATCH request to add multiple members violated REST standards, so I believe the RFE is stalled currently. If you need this feature, please ask for an RFE from your F5 account team. The more we ask, the more likely they will implement.

     

    I have found that doing individual member adds in a transaction gives the best performance for now.

     

    • StephanManthey's avatar
      StephanManthey
      Icon for MVP rankMVP

      Hi bbusby, currently I´m using PATCH on pool level to replace the complete list of pool members without touching other pool properties. Indeed I was looking as well to add a list of new members to the already existing members. Adding a single member to the existing members works fine in v12 and adding a list is on my "nice-to-have" list as well. If you would provide your RFE reference please, I will ask my client to open a support ticket to be attachted to your RFE. As it works in tmsh, it should be working via REST as well in my opionion. Using transactions would be a good alternative. At this time I´m using them to replace client-ssl profiles in a virtual server configuration. Cheers, Stephan