Closed psagrera closed 3 years ago
Hi psagrera,
We have a sample script that does exactly what you need. In this sample script, change the IP address, chassisIP and ports to use your resources: https://github.com/OpenIxia/IxNetwork/blob/master/RestPy/SampleScripts/loadConfigFile.py
Pablo, did you save the ixncfg file with the ports already assigned? If so, try removing the ports from the config and resave the ixncfg file with no ports assigned. Then use the sample provided by Hubert.
What you are trying to do is achievable, and common. However, it looks to me from the error that your config file has assigned ports you don’t have and could be used by a different person or session. Even if you are the one using the ports, when you run the script you may be creating new sessions each time and the system thinks you don’t own the ports, and you don’t have “force ownership” enabled in the configuration. You could check this setting as well to possibly get rid of the exception about port ownership.
But best practice is to save the config file with no port assignments and then assign the ports in the script. This makes the script and the configuration file more portable, and it will run faster because it doesn’t have to wait for the ports to connect when in reality you weren’t planning to use them anyway.
Regards, Wes
Wesley Hand | Product Management | KTO – Labs PathWave Keysight Technologies | Loveland, CO | Tel: +1 818-722-7495 | Mob: +1 818-312-6752
From: Pablo Sagrera @.> Sent: Wednesday, November 17, 2021 10:50 AM To: OpenIxia/ixnetwork_restpy @.> Cc: Subscribed @.***> Subject: [OpenIxia/ixnetwork_restpy] Trying to start traffic loading a file (Issue #59)
CAUTION: This message originates from an external sender.
Hi All,
I don't really know if what I'm trying to achieve is doable or not.
I've manually created a .ixncfg file with a simple test and what I'm trying to achieve is to load this file and start it
from ixnetwork_restpy import SessionAssistant, Files, TestPlatform
from time import sleep
session_assistant = SessionAssistant(IpAddress='1.1.1.1',UserName='admin', Password='admin',
LogLevel=SessionAssistant.LOGLEVEL_INFO,
ClearConfig=True)
ixnetwork = session_assistant.Ixnetwork
ixnetwork.LoadConfig(Files('test.ixncfg'))
ixnetwork.StartAllProtocols()
but I'm getting all the time the same error
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [INFO] using python version 2.7.17 (default, Feb 27 2021, 15:10:58)
[GCC 7.5.0]
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [INFO] using ixnetwork-restpy version 1.1.3
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [WARNING] Verification of certificates is disabled
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [INFO] Determining the platform and rest_port using the 10.51.158.48 address...
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [WARNING] Unable to connect to http://10.51.158.48:11009https://urldefense.com/v3/__http:/10.51.158.48:11009__;!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayuwoVK_6wg$.
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [WARNING] Unable to connect to https://10.51.158.48:11009https://urldefense.com/v3/__https:/10.51.158.48:11009__;!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayuwuON3pTw$.
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [WARNING] Unable to connect to http://10.51.158.48:443https://urldefense.com/v3/__http:/10.51.158.48:443__;!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayuy1LKfmkw$.
2021-11-17 17:42:10 [ixnetwork_restpy.connection] [INFO] Connection established to https://10.51.158.48:443<https://urldefense.com/v3/__https:/10.51.158.48:443__;!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayuzKjiAszA$> on linux
2021-11-17 17:42:27 [ixnetwork_restpy.connection] [INFO] Using IxNetwork api server version 9.10.2007.7
2021-11-17 17:42:27 [ixnetwork_restpy.connection] [INFO] User info IxNetwork/ixnetworkweb/admin-50-30366
ixnetwork_restpy.errors.BadRequestError: System Exception Caught. Exception Text: Port is not owned by this user
Port is not owned by this user
System Exception Caught. Exception Text: Port is not owned by this user
Port is not owned by this user
I would like to know if it's possible and if so, what I'm doing wrong
Thanks
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/ixnetwork_restpy/issues/59__;!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayuzEzp3AUw$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AGJXMDC4OLPED7X3R4NFMFTUMPTKVANCNFSM5IHTI2HQ__;!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayux-qYL-XA$. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https:/apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayuwVscG-VQ$ or Androidhttps://urldefense.com/v3/__https:/play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!I5pVk4LIGAfnvw!ytLDC-ZJODyw5T3qIIJ8t1gOPIsq3fOPxSrHGdoOojC8JTpVwzaayuyRyL1TSg$.
Thank you both. I've removed the ports from te config and used the sample provided by Hubert and it works perfectly. Thanks a lot for your help
Hi All,
I don't really know if what I'm trying to achieve is doable or not.
I've manually created a .ixncfg file with a simple test and what I'm trying to achieve is to load this file and start it
but I'm getting all the time the same error
I would like to know if it's possible and if so, what I'm doing wrong
Thanks