ixnetwork_restpy icon indicating copy to clipboard operation
ixnetwork_restpy copied to clipboard

enable port FramePreemption Error

Open HJiayang opened this issue 2 years ago • 0 comments

Hi, My environment: ixnewetork-restpy 1.16, IxNetwork 9.20.

I try to enable port FramePreemption as following, Error occurred when update(IsFramePreemptionEnabled=True,IsSmdVREnabled=True).

>  from ixnetwork_restpy import SessionAssistant
> > 
> > # create a test tool session
> > session_assistant = SessionAssistant(IpAddress='127.0.0.1',
> >     LogLevel=SessionAssistant.LOGLEVEL_INFO,
> >     ClearConfig=True)
> > ixnetwork = session_assistant.Ixnetwork
> > 
> > # create tx and rx port resources
> > port_map = session_assistant.PortMapAssistant()
> > ixChassisIpList = '10.38.174.114'
> > port_map.Map(ixChassisIpList, CardId=1, PortId=1, Name='Tx')
> > port_map.Map(ixChassisIpList, CardId=1, PortId=2, Name='Rx')
> > 
> > # create a TrafficItem resource
> > # TrafficItem acts a a high level container for ConfigElement resources
> > # ConfigElement is a high level container for individual HighLevelStream resources
> > vport_1 = ixnetwork.Vport.find(Name='^Tx')
> > vport_2 = ixnetwork.Vport.find(Name='^Rx')
> > 
> > ResType = 'ethernet'
> > vport_1.L1Config.update(ResType)
> > vport_2.L1Config.update(ResType)
> > # Error: IsFramePreemptionEnabled=True , port not support???
> > vport_1.L1Config.FramePreemption.update(IsFramePreemptionEnabled=True,IsSmdVREnabled=True)
> > vport_2.L1Config.FramePreemption.update(IsFramePreemptionEnabled=None, IsSmdVREnabled=None)

Traceback (most recent call last): File "C:/Users/hjiayang/Desktop/DCprojects/SoureCode/pyixnetwork/preemption_test.py", line 25, in vport_1.L1Config.FramePreemption.update(IsFramePreemptionEnabled=True,IsSmdVREnabled=True) File "C:\Users\hjiayang\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\ixnetwork_restpy\testplatform\sessions\ixnetwork\vport\l1config\framepreemption\framepreemption.py", line 89, in update return self._update(self._map_locals(self._SDM_ATT_MAP, locals())) File "C:\Users\hjiayang\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\ixnetwork_restpy\base.py", line 425, in _update self._connection._update(href, payload) File "C:\Users\hjiayang\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\ixnetwork_restpy\connection.py", line 272, in _update return self._send_recv("PATCH", url, payload) File "C:\Users\hjiayang\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\ixnetwork_restpy\connection.py", line 575, in _send_recv self._process_response_status_code(url, headers, response) File "C:\Users\hjiayang\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\ixnetwork_restpy\connection.py", line 461, in _process_response_status_code raise BadRequestError(message, response.status_code) ixnetwork_restpy.errors.BadRequestError: FramePreemption is not enabled for the port

It shows vport_1.IsFramePreemptionSupported = True, which means FramePreemption should be supported for the port. Why BadRequestError occurred? image

HJiayang avatar Jul 18 '22 07:07 HJiayang