def get_bond(self, switch, bond_number): """ Displays informations about a bond :arg str hostname: Hostname or IP of the switch :code 200 OK: Example output: .. literalinclude:: ../doc_config/api_samples/get_switch_hostname_bond_v2.json :language: json """ return 200, bond.to_api( switch.get_bond(bond_number), version=request.headers.get("Netman-Max-Version"))
def get_bonds(self, switch): """ Displays informations about all bonds :arg str hostname: Hostname or IP of the switch :code 200 OK: Example output: .. literalinclude:: ../doc_config/api_samples/get_switch_hostname_bonds_v2.json :language: json """ bonds = sorted(switch.get_bonds(), key=lambda x: x.number) return 200, [bond.to_api( b, version=request.headers.get("Netman-Max-Version") ) for b in bonds]
def get_bonds(self, switch): """ Displays informations about all bonds :arg str hostname: Hostname or IP of the switch :code 200 OK: Example output: .. literalinclude:: ../doc_config/api_samples/get_switch_hostname_bonds_v2.json :language: json """ bonds = sorted(switch.get_bonds(), key=lambda x: x.number) return 200, [ bond.to_api(b, version=request.headers.get("Netman-Max-Version")) for b in bonds ]