Forum Discussion

mgbailey_160800's avatar
mgbailey_160800
Icon for Nimbostratus rankNimbostratus
Oct 08, 2014

Manipulating GTM WideIP pools from iControl REST

I have been trying unsuccessfully to figure out how to manipulate the pools on a WideIP using iControl REST. To make things clearer, I am using curl for my experiments. First, here is a WideIP as viewed from the REST interface:

 

    [/Users/mbailey/f5play]$ curl -k -u svcscsdev:xxxx -X GET https://cdc240003a-scs-test-gtm.acme.com/mgmt/tm/gtm/wideip/timtest99.cloud-int.acme.com | python -m json.tool
{
    "enabled": true, 
    "fullPath": "timtest99.cloud-int.acme.com", 
    "generation": 1, 
    "ipv6NoErrorNegTtl": 0, 
    "ipv6NoErrorResponse": "disabled", 
    "kind": "tm:gtm:wideip:wideipstate", 
    "name": "timtest99.cloud-int.acme.com", 
    "persistCidrIpv4": 32, 
    "persistCidrIpv6": 128, 
    "persistence": "disabled", 
    "poolLbMode": "round-robin", 
    "pools": [
        {
            "name": "timtest99.acme.com_ned_pool", 
            "order": 0, 
            "partition": "Common", 
            "ratio": 1
        }
    ], 
    "selfLink": "https://localhost/mgmt/tm/gtm/wideip/timtest99.cloud-int.acme.com?ver=11.5.1", 
    "ttlPersistence": 3600
}
`

Now if I just try to do something as simple as narrowing this down to the pools, I get an error:

`[/Users/mbailey/f5play]$ curl -k -u svcscsdev:xxxx -X GET https://cdc240003a-scs-test-gtm.acme.com/mgmt/tm/gtm/wideip/timtest99.cloud-int.acme.com/pools | python -m json.tool
{
    "code": 403, 
    "errorStack": [], 
    "message": "Operation is not allowed on property /gtm/wideip/timtest99.cloud-int.acme.com/pools."
}
`

Trying something a little more complex, I get the same results if I try to add an existing GTM pool to the WideIP (using this payload: {"name":"user002rel21test2.acme.com_ned_pool"}):
`[/Users/mbailey/f5play]$ curl -k -u svcscsdev:xxxx -X POST "https://cdc240003a-scs-test-gtm.acme.com/mgmt/tm/gtm/wideip/timtest99.cloud-int.acme.com/pools" -d @gtmWIPPool.json -H "Content-Type:application/json" | python -m json.tool
{
    "code": 403, 
    "errorStack": [], 
    "message": "Operation is not allowed on configuration item /gtm/wideip/timtest99.cloud-int.acme.com/pools/user002rel21test2.acme.com_ned_pool."
}

I also have the same results if I try ~Common~timtest99.cloud-int.acme.com instead of just timtest99.cloud-int.acme.com for these commands.

 

It appears that the uri I am using to access the pools within a WideIP (https://cdc240003a-scs-test-gtm.acme.com/mgmt/tm/gtm/wideip/timtest99.cloud-int.acme.com/pools) is not functional. Please help me determine the correct uri.

 

2 Replies

  • Hello, i guess pool is not an entity you can address but a property of the wideip so you address the entity wideip directly to modify the pool.

    so if you want to add a pool to an existing wide ip you need to use PUT/PATCH method to the wideip url with json payload containing you pools definition:

    {
        "pools":
               [
                   {
                       "name": "mypool2",
                       "partition": "Common",
                       "order": 0,
                       "ratio": 1
                   }
               ]
           }
    

    note that it is replacing existing property, meaning you don't add the new pool to existing pools, you replace it.

  • You can also modify the pool directly from the gtm object. https:///mgmt/tm/gtm/pool/