Skip to content

Commit

Permalink
Merge pull request dmm-com#339 from a10networks/feature/dynamic_inter…
Browse files Browse the repository at this point in the history
…face_detection

[Feature][STACK-2015][Dynamic Interface Detection]: Support for Dynamic Interface Detection after loadbalancers and members creation and deletion.
  • Loading branch information
ytsai-a10 authored Mar 19, 2021
2 parents cd90fee + edc54f4 commit 6df2177
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions acos_client/v30/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,41 @@ def get_vcs_summary_oper(self):
def get_thunder_up_time(self):
url = "/miscellenious-alb/oper"
return self._get(url)

def probe_network_devices(self):
url = "/system/probe-network-devices"
self._post(url)

def get_acos_version(self):
url = "/version/oper"
return self._get(url)

def reload_reboot_for_interface_attachment(self, acos_version=None):
if not acos_version:
version_summary = self.get_acos_version()
acos_version = version_summary['version']['oper']['sw-version'].split(',')[0]

major = acos_version.split('.')[0]
minor = acos_version.split('.')[1]
patch = acos_version.split('.')[2]

if major >= 5 and minor >= 2 and patch >= 0:
self.probe_network_devices()
self.reload()
else:
self.reboot()

def reload_reboot_for_interface_detachment(self, acos_version=None):
if not acos_version:
version_summary = self.get_acos_version()
acos_version = version_summary['version']['oper']['sw-version'].split(',')[0]

major = acos_version.split('.')[0]
minor = acos_version.split('.')[1]
patch = acos_version.split('.')[2]

if major >= 5 and minor >= 2 and patch >= 1:
self.probe_network_devices()
self.reload()
else:
self.reboot()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requests>=2.3.0
six
uhashring
uhashring==1.2
ipaddress==1.0.22; python_version < '3.0'

0 comments on commit 6df2177

Please sign in to comment.