def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) common.txt_subelement(elem, 'name', self.name) if self._config: elem.append(self.config.to_xml_element()) return elem
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) if self.vlan_id: common.txt_subelement(elem, 'vlan-id', str(self.vlan_id), attrib={'operation': self.operation}) if self.config: elem.append(self.config.to_xml_element()) return elem
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) if self.operation: elem.set('operation', self.operation) if self.lag_type is not None: common.txt_subelement(elem, 'lag-type', self.lag_type) if self.min_links is not None: common.txt_subelement(elem, 'min-links', str(self.min_links)) return elem
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ element = ElementTree.Element(self.TAG) if self.operation: element.set('operation', self.operation) if self.aggregate_id is not None: common.txt_subelement(element, 'aggregate-id', self.aggregate_id, xmlns=self._aggregate_id_namespace) return element
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) if self.operation: elem.set('operation', self.operation) common.txt_subelement(elem, 'name', self.name) if self.config: elem.append(self.config.to_xml_element()) if self.aggregation: elem.append(self.aggregation.to_xml_element()) return elem
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) if self.name is not None: common.txt_subelement(elem, 'name', self.name, attrib={'operation': self.operation}) if self.description is not None: common.txt_subelement(elem, 'description', self.description, attrib={'operation': self.operation}) if self.enabled is not None: common.txt_subelement(elem, 'enabled', str(self.enabled).lower(), attrib={'operation': self.operation}) if self.mtu is not None: common.txt_subelement(elem, 'mtu', str(self.mtu), attrib={'operation': self.operation}) return elem
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) if self.operation: elem.set('operation', self.operation) if self.interface_mode: common.txt_subelement(elem, 'interface-mode', self.interface_mode) if self.access_vlan is not None: common.txt_subelement(elem, 'access-vlan', str(self.access_vlan)) if self.native_vlan is not None: common.txt_subelement(elem, 'native-vlan', str(self.native_vlan)) if self.trunk_vlans is not None: for item in self.trunk_vlans: common.txt_subelement(elem, 'trunk-vlans', str(item)) return elem
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) elem.set('operation', self.operation) if self.name is not None: common.txt_subelement(elem, 'name', self.name) if self.interval is not None: common.txt_subelement(elem, 'interval', self.interval) if self.lacp_mode is not None: common.txt_subelement(elem, 'lacp-mode', self.lacp_mode) return elem
def to_xml_element(self): """Create XML Element :return: ElementTree Element with SubElements """ elem = ElementTree.Element(self.TAG) elem.set('operation', self.operation) if self.vlan_id is not None: common.txt_subelement(elem, 'vlan-id', str(self.vlan_id)) if self.name is not None: common.txt_subelement(elem, 'name', self.name) if self.status is not None: common.txt_subelement(elem, 'status', self.status) return elem