Пример #1
0
            portObj.clearPortOwnership(portList)
        else:
            raise IxNetRestApiException(
                'Ports are owned by another user and forceTakePortOwnership is set to False'
            )

    # If the license is activated on the chassis's license server, this variable should be True.
    # Otherwise, if the license is in a remote server or remote chassis, this variable should be False.
    # Configuring license requires releasing all ports even for ports that is not used for this test.
    if licenseIsInChassis == False:
        portObj.releaseAllPorts()
        mainObj.configLicenseServerDetails([licenseServerIp], licenseModel,
                                           licenseTier)

    fileMgmtObj = FileMgmt(mainObj)
    fileMgmtObj.loadConfigFile(configFile)

    portObj.assignPorts(portList)
    portObj.verifyPortState()

    protocolObj = Protocol(mainObj)

    # MODIFY BGP CONFIG:
    #    Step 1 of 2:  Get the BGP host object.
    #                  Filter the BGP host by it's Topology Group name.
    #                  State all the BGP attributes to modify in a list.
    bgpAttributeMultivalue = protocolObj.getBgpObject(
        topologyName='Topo1',
        bgpAttributeList=['flap', 'uptimeInSec', 'downtimeInSec'])

    # Step 2 of 2: MODIFY THE BGP OBJECT ATTRIBUTES
Пример #2
0
    #---------- Preference Settings End --------------
    portObj = PortMgmt(mainObj)
    portObj.connectIxChassis(ixChassisIp)

    if portObj.arePortsAvailable(portList, raiseException=False) != 0:
        if forceTakePortOwnership == True:
            portObj.releasePorts(portList)
            portObj.clearPortOwnership(portList)
        else:
            raise IxNetRestApiException(
                '\nPorts are owned by another user and forceTakePortOwnership is set to False. Exiting test.'
            )

    fileMgmtObj = FileMgmt(mainObj)
    # localFile=True if config file is not located in the Windows c: drive.
    fileMgmtObj.loadConfigFile(configFile, localFile=True)

    portObj.releasePorts(portList)
    mainObj.configLicenseServerDetails([licenseServerIp], licenseModel,
                                       licenseTier)

    portObj = PortMgmt(mainObj)
    portObj.assignPorts(portList, forceTakePortOwnership)
    portObj.verifyPortState()

    protocolObj = Protocol(mainObj)

    # MODIFY BGP CONFIG:
    #    Step 1 of 2:  Get the BGP host object.
    #                  Filter the BGP host by it's Topology Group name.
    #                  State all the BGP attributes to modify in a list.