def invalid_port(node): esxi_port_info = vnc_api.ESXIProperties() vnc_port = vnc_api.Port("port-2", node, esxi_port_info=esxi_port_info) json_port = vnc_port.serialize_to_json(["esxi_port_info", "fq_name"]) json_port["esxi_port_info"] = json_port["esxi_port_info"].exportDict( name_=None) return json_port
def port(node): esxi_port_info = vnc_api.ESXIProperties(dvs_name="dvs-1") vnc_port = vnc_api.Port("port-1", node, esxi_port_info=esxi_port_info) json_port = vnc_port.serialize_to_json(["esxi_port_info", "fq_name"]) json_port.update({"physical_interface_back_refs": [{"uuid": "pi-1-uuid"}]}) json_port["esxi_port_info"] = json_port["esxi_port_info"].exportDict( name_=None) return json_port
def create_port(self, port_name, mac_address, node, dvs_name): bms_port_info = vnc_api.BaremetalPortInfo(address=mac_address) esxi_port_info = vnc_api.ESXIProperties(dvs_name=dvs_name) port = vnc_api.Port( name=port_name, parent_obj=node, bms_port_info=bms_port_info, esxi_port_info=esxi_port_info, ) port_uuid = self.vnc_lib.port_create(port) return self.read_port(port_uuid)
def invalid_port(node): esxi_port_info = vnc_api.ESXIProperties() return vnc_api.Port("port-2", node, esxi_port_info=esxi_port_info)
def port(node): esxi_port_info = vnc_api.ESXIProperties(dvs_name="dvs-1") vnc_port = vnc_api.Port("port-1", node, esxi_port_info=esxi_port_info) vnc_port.physical_interface_back_refs = [{"uuid": "pi-1-uuid"}] return vnc_port
def port_3(): port = vnc_api.Port("port-2") esxi_port_info = vnc_api.ESXIProperties() port.set_esxi_port_info(esxi_port_info) return port
def port_2(): port = vnc_api.Port("port-2") esxi_port_info = vnc_api.ESXIProperties(dvs_name="dvs-2") port.set_esxi_port_info(esxi_port_info) return port
def port(): esxi_port_info = vnc_api.ESXIProperties(dvs_name="dvs-1") return vnc_api.Port(esxi_port_info=esxi_port_info)
def update_ports_dvs_name(self, port_uuid, dvs_name): port = self.read_port(port_uuid) esxi_port_info = vnc_api.ESXIProperties(dvs_name=dvs_name) port.set_esxi_port_info(esxi_port_info) self.vnc_lib.port_update(port)