Esempio n. 1
0
 def enabled(self) -> bool:
     shutdown = jh.query('shutdown."#standalone"', self.yy.native)
     if shutdown:
         return False
     else:
         return True
Esempio n. 2
0
 def description(self) -> Optional[str]:
     return cast(Optional[str],
                 jh.query('description."#text"', self.yy.native))
Esempio n. 3
0
 def status(self) -> str:
     if jh.query('shutdown."#standalone"', self.yy.native):
         return "SUSPENDED"
     else:
         return "ACTIVE"
Esempio n. 4
0
 def name(self) -> Optional[str]:
     v = jh.query('name."#text"', self.yy.native)
     if v is not None:
         return str(v)
     else:
         return None
Esempio n. 5
0
 def interface_mode(self) -> Optional[str]:
     v = jh.query('switchport.mode."#text"', self.yy.native)
     if v is not None:
         return cast(str, v.upper())
     else:
         return None
Esempio n. 6
0
 def trunk_vlans(self) -> Optional[List[str]]:
     v = jh.query('switchport.trunk.allowed.vlan."#text"', self.yy.native)
     if v is not None:
         return cast(List[str], v.split(","))
     return None
Esempio n. 7
0
 def access_vlan(self) -> Optional[int]:
     v = jh.query('switchport.access.vlan."#text"', self.yy.native)
     if v is not None:
         return int(v)
     return None