shadow82
Jan 04, 2024Cirrus
HowTo disable/enable VServer based on timetable?
Hi!
We need to enable a VServer only in business hours. After - it should be disabled.
Is there any function (time schedule, iRule, LTM policy rule) or should I go into cron on F5 with commands like:
tmsh modify ltm virtual test disabled
or REST API - (found here https://community.f5.com/t5/technical-forum/rest-api-to-disable-virtual-server/m-p/295092)
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")