Forum Discussion
iControl REST API Pool Member disable
- Feb 12, 2024
also FYI...if you get a working postman sample, you can click the </> icon and find samples in a lot of tools/languages of that specific query.
And the python sample they shared from my working postman PATCH is:
import requests import json url = "https://ltm15/mgmt/tm/ltm/pool/~Common~nginx-pool/members/~Common~172.16.102.5:80" payload = json.dumps({ "session": "user-disabled", "state": "user-down" }) headers = { 'Content-Type': 'application/json', 'Authorization': 'Basic notsofastmyfriends', 'Cookie': 'BIGIPAuthCookie=supersecretpassphrasehere; BIGIPAuthUsernameCookie=admin' } response = requests.request("PATCH", url, headers=headers, data=payload) print(response.text)
Thank You for the response,
I tried the same and got Method Not Allowed, something similar. also, fixed the quotes and pairs.
Not sure, If I put the same via PostMan its accepting but not via Py. :(
- JRahmFeb 12, 2024Admin
you need to format your python dictionary as json...
json.dumps({"session": "user-disabled"})
- JRahmFeb 12, 2024Admin
also FYI...if you get a working postman sample, you can click the </> icon and find samples in a lot of tools/languages of that specific query.
And the python sample they shared from my working postman PATCH is:
import requests import json url = "https://ltm15/mgmt/tm/ltm/pool/~Common~nginx-pool/members/~Common~172.16.102.5:80" payload = json.dumps({ "session": "user-disabled", "state": "user-down" }) headers = { 'Content-Type': 'application/json', 'Authorization': 'Basic notsofastmyfriends', 'Cookie': 'BIGIPAuthCookie=supersecretpassphrasehere; BIGIPAuthUsernameCookie=admin' } response = requests.request("PATCH", url, headers=headers, data=payload) print(response.text)
- whispererFeb 13, 2024MVP
Make sure you set those headers as mentioned. It gets pissy if you dont give it content-type!
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com