コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
 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)
コード例 #4
0
def invalid_port(node):
    esxi_port_info = vnc_api.ESXIProperties()
    return vnc_api.Port("port-2", node, esxi_port_info=esxi_port_info)
コード例 #5
0
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
コード例 #6
0
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
コード例 #7
0
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
コード例 #8
0
def port():
    esxi_port_info = vnc_api.ESXIProperties(dvs_name="dvs-1")
    return vnc_api.Port(esxi_port_info=esxi_port_info)
コード例 #9
0
 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)