Forum Discussion

Angelina_Ilieva's avatar
Angelina_Ilieva
Icon for Nimbostratus rankNimbostratus
Mar 23, 2020

Disable member from GMT pool via REST API

Our GTM is v 11.6.1 and I am using the Rest API to pull pool members.

Upon deployment we have to disable on e of the members.

 

I cannot get the API to respond to us disabling the member off of the pool.

 

Can anyone advise me what is the correct call payload?

4 Replies

  • curl -sk -u test1:test1 -H "Content-Type: application/json" -X PATCH https://192.168.255.1/mgmt/tm/gtm/pool/a/~Common~pool_www/members/~Common~LABBIGIP1.lab.local:www_lab_local -d '{"disabled":true}'
     
    curl -sk -u test1:test1 -H "Content-Type: application/json" -X PATCH https://192.168.255.1/mgmt/tm/gtm/pool/a/~Common~pool_www/members/~Common~LABBIGIP1.lab.local:www_lab_local -d '{"enabled":true}'

    First command is to disable, and second to enable.

    Pool: pool_www

    Pool Member: www_lab_local

    If you want more examples:

    https://support.f5.com/csp/article/K13225405

  •  Thank you so much for responding. Very quick few question though.

     

    1. What is the significance of /a/ in the https://192.168.255.1/mgmt/tm/gtm/pool/a ?

    2. Also in your request structure, what is 'LABBIGIP1.lab.local:'?

    https://192.168.255.1/mgmt/tm/gtm/pool/a/~Common~pool_www/members/~Common~LABBIGIP1.lab.local:www_lab_local

     

    3. Also in your request structure, what is www_lab_local - member address, member name, member server name?

    https://192.168.255.1/mgmt/tm/gtm/pool/a/~Common~pool_www/members/~Common~LABBIGIP1.lab.local:www_lab_local

     

    Regardless of what I do on my end I get this content type error. I do send the content-type as Json. I am starting to think is is some kind of API bug.

     

    {"code":415,"message":"Found invalid content-type. The content-type must be application/json. The received content-type is a887425b-f5ce-42be-a064-0d487397cb97","errorStack":[]}

  • Sorry, but I forgot that you were running 11.6.1, and my lab tests were done in 14.1.2.3.

    You are running a very old version, specially taking into account that iControl REST started as in 11.4.0 as beta (I think).

    Anyway, let me answer you questions...

    1 - In v12 GTM change the name for DNS and also started to support more types of resource types.

    The A indicates an A record, so name to IPv4. That does not exists before v12.

    2 - GTM server object.

    A GTM pool has a pool member that is referenced by the GTM server object + virtual server.

    3 - Virtual server name, that in the GTM context, with the server object will represent the GTM pool member.

    Here is relevant part of the my GTM configuration.

    gtm wideip a www.lab.local {
        pools {
            pool_www {
                order 0
            }
        }
    }
    gtm pool a pool_www {
        members {
            LABBIGIP1.lab.local:www_lab_local {
                member-order 0
            }
        }
    }
    gtm server LABBIGIP1.lab.local {
        addresses {
            10.0.0.1 {
                device-name LABBIGIP1.lab.local
            }
        }
        datacenter LABBIGIP1
        devices {
            LABBIGIP1.lab.local {
                addresses {
                    10.0.0.1 { }
                }
            }
        }
        monitor bigip
        product bigip
        virtual-servers {
            www_lab_local {
                destination 10.0.0.103:http
                ltm-name /Common/vs_www
            }
        }
    }

    The error is very explicit, either you are not sending the correct header with type, or there is a bug for the version you are using.

    It would be a major bug, so I doubt that is the case.

    Try with different software, like curl or Postman.

    Here is the full guide for the version you have.

    I think if you remove the /a in my initial commands, it should be the correct command for your version.

    https://cdn.f5.com/websites/devcentral.f5.com/downloads/icontrol-rest-user-11-6-0_15.pdf

  • Leonardo, thank you for taking the time to help me/us out.

     

    I had written a whole lot against our LTM (which is ver=12.1.2) and had had no problem with taking members offline/getting stats...and much more!

     

    I think this 11.6 version of the GTM is either buggy or they(F5 devs who develop the REST endpoint) have not figured out the error responses correctly yet and it defaults so some obscure content-type unrelated response code.

     

    The fact that I get this very bizarre GUID coming back in the error message is my concern and it leads me to believe, this version of the API is buggy.

     

    I'm doing exactly the same function in the LTM without a problem with the v12.x.

     

    Anyway, I may have to resort to the iControl DLL's and utilize the iControll.cgi wsdls for the time being until we upgrade.