Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

How to create GTM Pool with members from IControl Rest API?

MKlocker
Nimbostratus
Nimbostratus

Hi,

I'm hoping someone can help me figure out how to create a Gtm Pool and related members via the IContro Rest API. I have scoured the interwebs and have not found an example. The API Documentation for /gtm/pool shows a subcollection of 'members' but does not expand on what the structure of this subcollection looks like.

I don't know if I have to create a pool first and then add members to it with subsequent operations or whether I can do it all at once. Either way, I don't know how to create a pool nor do I know how to add a member to an existing pool.

 

Thanks in advance.

Does anyone have any examples of them doing this.

1 REPLY 1

Hi,

I got a solution after exploring the API for one hour ‌‌, so well:
The first step is to determine the virtual servers configured on the DNS system calling the api:

GET https://"Your_IP"/mgmt/tm/gtm/server/~Common~"Name of your server"/virtual-servers?ver=15.1.3.1

Then, to create the pool you need to send a post to:

POST https://"Your_IP"/mgmt/tm/gtm/pool/a

And then use the body in JSON format:

 

{
"name": "Your_Pool_Name",
"partition": "Common",
"alternateMode": "round-robin",
"verifyMemberAvailability": "enabled",
"membersReference": { 
"items":[{
    "name": "VS-WAF",
    "partition":"Common",
    "subPath":"big-ip:/Common"   
},
{
    "name": "VS_HAckazon",
    "partition":"Common",
    "subPath":"big-ip:/Common" 
}
]}
}

In the Body Example, I add two virtual servers to the pool, VS_HAchazon and VS-WAF.

I hope it´s help.