OpenIxia / IxNetwork

A central location for IxNetwork sample scripts and utilities. Please also visit http://openixia.com
MIT License
50 stars 59 forks source link

Assigned and connected ixia ports are showing as unassigned in IXIA REST #68

Closed ThakkarJignesh closed 5 years ago

ThakkarJignesh commented 5 years ago

I configured vports and assigned them to test ports. Below is the GUI snapshot for same. When I try to retrieve the vport attributes, for most of them it shows false or None/unassigned. Is there any known issue for this? Any fix available for this?

(Pdb) vport.ConnectionState u'unassigned' (Pdb) vport.ConnectionStatus u'Unassigned' (Pdb) vport.State u'unassigned' (Pdb) vport.IsAvailable True (Pdb) vport.IsConnected False (Pdb) vport.IsMapped False (Pdb) vport.AssignedTo u'' (Pdb)

IXIA_Screenshot
therkong commented 5 years ago

How did you get the vport node? Here's my code sample: vport = ixNetwork.Vport.find()[0]

vport.ActualSpeed 100000 vport.ConnectionStatus '10.36.88.91:07:01 ' vport.ConnectionInfo 'chassis="10.36.88.91" card="7" port="1" portip="20.0.7.1"'

You can also do a print to print out all attributes. See below: print(vport) None Vport[0]: /api/v1/sessions/1/ixnetwork/vport/1 ActualSpeed: 100000 AssignedTo: 10.36.88.91:7:1 ConnectedTo: /api/v1/sessions/1/ixnetwork/availableHardware/chassis/1/card/7/port/1 ConnectionInfo: chassis="10.36.88.91" card="7" port="1" portip="20.0.7.1" ConnectionState: connectedLinkUp ConnectionStatus: 10.36.88.91:07:01 InternalId: 1 IsAvailable: True IsConnected: True IsMapped: True IsPullOnly: False IsVMPort: False IxnChassisVersion: IxnClientVersion: IxosChassisVersion: IxOS 8.50.1700.11 EA-SP1 Licenses: obsolete, do not use Name: 1/7/1 RxMode: captureAndMeasure State: up StateDetail: idle TransmitIgnoreLinkStatus: False TxGapControlMode: averageMode TxMode: interleaved Type: tenFortyHundredGigLan ValidTxModes: ['sequential', 'interleaved']

ThakkarJignesh commented 5 years ago

Here is my complete code in interpreter.

import sys, os, time, traceback import linecache from ixnetwork_restpy.testplatform.testplatform import TestPlatform from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant platform = 'windows' apiServerPort = 11009 apiServerIp = x.x.x.x forceTakePortOwnership = True ixChassisIpList = [y.y.y.y] portList = [[ixChassisIpList[0], 8,14],[ixChassisIpList[0], 8,1]] testPorts = [] testPlatform = TestPlatform(ip_address=apiServerIp, rest_port=apiServerPort, platform=platform, log_file_name='restpy.log' ) 2019-07-17 23:14:40 [ixnetwork_restpy.connection] [INFO] using python version 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] 2019-07-17 23:14:40 [ixnetwork_restpy.connection] [INFO] using ixnetwork-restpy version 1.0.25 session = testPlatform.Sessions.add() ixNetwork = session.Ixnetwork ixNetwork.NewConfig() u'kVoid'

Port_8_14 = ixNetwork.Vport.add(Name='Port_8_14') Port_8_1 = ixNetwork.Vport.add(Name='Port_8_1') vportList = [vport.href for vport in ixNetwork.Vport.find()] for port in portList: ... testPorts.append(dict(Arg1=port[0], Arg2=port[1], Arg3=port[2])) ... ... hrefvport1 = ixNetwork.AssignPorts(testPorts, [], vportList, forceTakePortOwnership)

Port_8_14.ActualSpeed 100 Port_8_14.ConnectionStatus u'Unassigned' Port_8_14.ConnectionState u'unassigned'

Port_8_14.ConnectionInfo u''

print (Port_8_14) Vport[0]: /api/v1/sessions/1/ixnetwork/vport/1 ActualSpeed: 100 AssignedTo: ConnectedTo: null ConnectionInfo: ConnectionState: unassigned ConnectionStatus: Unassigned InternalId: 1 IsAvailable: True IsConnected: False IsMapped: False IsPullOnly: False IsVMPort: False IxnChassisVersion: unknown IxnClientVersion: unknown IxosChassisVersion: unknown Licenses: obsolete, do not use Name: Port_8_14 RxMode: measure State: unassigned StateDetail: idle TransmitIgnoreLinkStatus: False TxGapControlMode: averageMode TxMode: interleaved Type: ethernet ValidTxModes: [u'sequential', u'interleaved']

Regards, Jignesh

From: therkong notifications@github.com Reply-To: OpenIxia/IxNetwork reply@reply.github.com Date: Wednesday, July 17, 2019 at 4:29 PM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: "Jignesh Thakkar (jigthakk)" jigthakk@cisco.com, Author author@noreply.github.com Subject: Re: [OpenIxia/IxNetwork] Assigned and connected ixia ports are showing as unassigned in IXIA REST (#68)

How did you get the vport node? Here's my code sample: vport = ixNetwork.Vport.find()[0]

vport.ActualSpeed 100000 vport.ConnectionStatus '10.36.88.91:07:01 ' vport.ConnectionInfo 'chassis="10.36.88.91" card="7" port="1" portip="20.0.7.1"'

You can also do a print to print out all attributes. See below: print(vport) None Vport[0]: /api/v1/sessions/1/ixnetwork/vport/1 ActualSpeed: 100000 AssignedTo: 10.36.88.91:7:1 ConnectedTo: /api/v1/sessions/1/ixnetwork/availableHardware/chassis/1/card/7/port/1 ConnectionInfo: chassis="10.36.88.91" card="7" port="1" portip="20.0.7.1" ConnectionState: connectedLinkUp ConnectionStatus: 10.36.88.91:07:01 InternalId: 1 IsAvailable: True IsConnected: True IsMapped: True IsPullOnly: False IsVMPort: False IxnChassisVersion: IxnClientVersion: IxosChassisVersion: IxOS 8.50.1700.11 EA-SP1 Licenses: obsolete, do not use Name: 1/7/1 RxMode: captureAndMeasure State: up StateDetail: idle TransmitIgnoreLinkStatus: False TxGapControlMode: averageMode TxMode: interleaved Type: tenFortyHundredGigLan ValidTxModes: ['sequential', 'interleaved']

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/OpenIxia/IxNetwork/issues/68?email_source=notifications&email_token=AMURAEP2BQCCXPXSBLU2I5DP76TNVA5CNFSM4IEVEL5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2G354Q#issuecomment-512605938, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMURAEMSRQN4KDA2C4QC3LDP76TNVANCNFSM4IEVEL5A.

ajbalogh commented 5 years ago

After the AssignPorts method refresh the individual vport objects you have prior to printing them.

hrefvport1 = ixNetwork.AssignPorts(testPorts, [], vportList, forceTakePortOwnership) print (Port_8_14.refresh())