Forum Discussion
RahulG
Apr 28, 2022Altocumulus
Rest API to disable virtual server
Hi, I am trying to create a python script to disable virtual server using REST API. Could you please help me in resolving the error: REST API: virtual_disable = requests.put("https://device/mgmt/tm/...
- Apr 29, 2022
I recommend using patch instead of put. See below:
url = 'https://device/mgmt/tm/ltm/virtual/test'data = {'disabled':True}r=requests.patch(url, json = data, auth=("username", "password"), verify=False)if r.status_code >= 400:print('\tError Code: ' + str(r.status_code))else:print("Disabled VIP")
jaellis
Apr 29, 2022Nimbostratus
I recommend using patch instead of put. See below:
url = 'https://device/mgmt/tm/ltm/virtual/test'
data = {'disabled':True}
r=requests.patch(url, json = data, auth=("username", "password"), verify=False)
if r.status_code >= 400:
print('\tError Code: ' + str(r.status_code))
else:
print("Disabled VIP")
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects