Closed muthvar1 closed 4 years ago
Hi,
In TestPlatform.Sessions(), there's DownloadFile() to download the file to your local machine. check: https://openixia.github.io/ixnetwork_restpy/#/reference
""" Method Sessions.DownloadFile
Download a file from the IxNetwork session instance
from ixnetwork_restpy import TestPlatform
sessions = TestPlatform('127.0.0.1') \ .Sessions.find() sessions.DownloadFile(remote_filename, local_filename=None)
HI Theresa, Is this DownloadFile a new addition to the SDK? I don't see it in my earlier versions
It’s been there for a while. Please check RestPy API guide: https://openixia.github.io/ixnetwork_restpy/#/reference DownloadFile is under TestPlatform->Sessions
What is your ixnetwork_restpy version?
Regards, Theresa
From: varghese muthalaly notifications@github.com Sent: Thursday, June 11, 2020 1:19 PM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Theresa Kong theresa.kong@keysight.com; Assign assign@noreply.github.com Subject: Re: [OpenIxia/IxNetwork] is there an equivalent api for capture like takecsvsnapshot in RestPy (#104)
[EXTERNAL]
HI Theresa, Is this DownloadFile a new addition to the SDK? I don't see it in my earlier versions
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/104*issuecomment-642906250__;Iw!!I5pVk4LIGAfnvw!2oGRrIqKogWzKUE8QofXwiOpbRlATC4WIQQOpxGmmRvGrhYmgGBMn5-gNlIZ-prDo5cJ$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AIRRUUOUOALJGXKKYUMXOIDRWE32XANCNFSM4N3VSBTQ__;!!I5pVk4LIGAfnvw!2oGRrIqKogWzKUE8QofXwiOpbRlATC4WIQQOpxGmmRvGrhYmgGBMn5-gNlIZ-jnBX9Pj$.
https://github.com/OpenIxia/ixnetwork_restpy/blob/master/RELEASENOTES.md#feb2019
On Thu, Jun 11, 2020 at 1:22 PM therkong notifications@github.com wrote:
It’s been there for a while. Please check RestPy API guide: https://openixia.github.io/ixnetwork_restpy/#/reference DownloadFile is under TestPlatform->Sessions
What is your ixnetwork_restpy version?
Regards, Theresa
From: varghese muthalaly notifications@github.com Sent: Thursday, June 11, 2020 1:19 PM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Theresa Kong theresa.kong@keysight.com; Assign < assign@noreply.github.com> Subject: Re: [OpenIxia/IxNetwork] is there an equivalent api for capture like takecsvsnapshot in RestPy (#104)
[EXTERNAL]
HI Theresa, Is this DownloadFile a new addition to the SDK? I don't see it in my earlier versions
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub< https://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/104*issuecomment-642906250__;Iw!!I5pVk4LIGAfnvw!2oGRrIqKogWzKUE8QofXwiOpbRlATC4WIQQOpxGmmRvGrhYmgGBMn5-gNlIZ-prDo5cJ$>, or unsubscribe< https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AIRRUUOUOALJGXKKYUMXOIDRWE32XANCNFSM4N3VSBTQ__;!!I5pVk4LIGAfnvw!2oGRrIqKogWzKUE8QofXwiOpbRlATC4WIQQOpxGmmRvGrhYmgGBMn5-gNlIZ-jnBX9Pj$>.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OpenIxia/IxNetwork/issues/104#issuecomment-642907498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHFTFQO2DVO6R3BCECZOUDRWE4GRANCNFSM4N3VSBTQ .
It's weird. I can see it in my version of the codebase in the sessions module. But for some reason, I cannot access the method. I need to debug more.
Sorry, I had accindentally pointed my code base to an older SDK. Corrected it now. But I still see some issue with the file download. Is the expectation for all files to be stored in a manged filePath?
ixnetwork.Vport.find(Name='1/1/13').Capture.HardwareEnabled = True
ixnetwork.StartCapture()
ixnetwork.Traffic.Apply()
ixnetwork.Traffic.Start()
flowStatistics = StatViewAssistant(ixnetwork, 'Flow Statistics')
ixnetwork.StopCapture()
remote_filename = ixnetwork.SaveCaptureFiles("C:\Results", "capture")[0]
print remote_filename
C:\Results\1-1-13_HWcatapult.cap
session.DownloadFile(remote_filename,local_filename='/local/vamuthal')
Traceback (most recent call last):
File "", line 1, in
Looks like it only allows downloads from specific file systems. I see that it is a server-side error, not sure if it is a restriction on the ixNetwork API server or the Windows system as such. Can someone help explain? I would ideally like to not store the captured files under C:\Users\ixia\AppData\Local\Ixia. This is because we have autopurge routines that run on the client VMs that do not take this folder into consideration.
I will test this out and let you know.
Regards, Theresa
From: varghese muthalaly notifications@github.com Sent: Thursday, June 11, 2020 1:59 PM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Theresa Kong theresa.kong@keysight.com; Assign assign@noreply.github.com Subject: Re: [OpenIxia/IxNetwork] is there an equivalent api for capture like takecsvsnapshot in RestPy (#104)
[EXTERNAL]
Looks like it only allows downloads from specific file systems. I see that it is a server-side error, not sure if it is a restriction on the ixNetwork API server or the Windows system as such. Can someone help explain? I would ideally like to not store the captured files under C:\Users\ixia\AppData\Local\Ixia. This is because we have autopurge routines that run on the client VMs that do not take this folder into consideration.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/104*issuecomment-642924889__;Iw!!I5pVk4LIGAfnvw!yjAOF6YRXu8gY2dV4OQKpCo_XLSo2MHCXrhn_gjrw1U3oTe80QPIegGE3ZVNHT6q2hAu$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AIRRUUJMVVF7LQMEDGFBS6LRWFAQRANCNFSM4N3VSBTQ__;!!I5pVk4LIGAfnvw!yjAOF6YRXu8gY2dV4OQKpCo_XLSo2MHCXrhn_gjrw1U3oTe80QPIegGE3ZVNHZYOHgJG$.
I’d like to open a support ticket to keep track of this… Can you send me your company email account?
Regards, Theresa
From: varghese muthalaly notifications@github.com Sent: Thursday, June 11, 2020 1:59 PM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Theresa Kong theresa.kong@keysight.com; Assign assign@noreply.github.com Subject: Re: [OpenIxia/IxNetwork] is there an equivalent api for capture like takecsvsnapshot in RestPy (#104)
[EXTERNAL]
Looks like it only allows downloads from specific file systems. I see that it is a server-side error, not sure if it is a restriction on the ixNetwork API server or the Windows system as such. Can someone help explain? I would ideally like to not store the captured files under C:\Users\ixia\AppData\Local\Ixia. This is because we have autopurge routines that run on the client VMs that do not take this folder into consideration.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/104*issuecomment-642924889__;Iw!!I5pVk4LIGAfnvw!yjAOF6YRXu8gY2dV4OQKpCo_XLSo2MHCXrhn_gjrw1U3oTe80QPIegGE3ZVNHT6q2hAu$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AIRRUUJMVVF7LQMEDGFBS6LRWFAQRANCNFSM4N3VSBTQ__;!!I5pVk4LIGAfnvw!yjAOF6YRXu8gY2dV4OQKpCo_XLSo2MHCXrhn_gjrw1U3oTe80QPIegGE3ZVNHZYOHgJG$.
I tried out in my setup. Indeed, the capture file must be save under C:\Users\ixia\AppData\Local\Ixia. I checked with our engineer. It's for security reasons that we limit where you can write the files. Did you want to remove the capture files with your autopurge routine? Is it possible to add more paths to your autopurge?
Hi Theresa, I will see if we can add this folder to our auto-purge in that case.
Thanks, Varghese
On Thu, Jun 11, 2020 at 4:34 PM therkong notifications@github.com wrote:
I tried out in my setup. Indeed, the capture file must be save under C:\Users\ixia\AppData\Local\Ixia. I checked with our engineer. It's for security reasons that we limit where you can write the files. Did you want to remove the capture files with your autopurge routine? Is it possible to add more paths to your autopurge?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenIxia/IxNetwork/issues/104#issuecomment-642981822, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDWUCXZRC3OO5YUDC5Q2CLRWFSWTANCNFSM4N3VSBTQ .
I am basically looking for an api in RestPy that takes the capture of a given vport and then also saves the file to the local _root_directory. I have the below commands. But this saves it locally on the ixNetworkClient. I need the file transferred to my local _root_directory.
ixnetwork.Vport.find(Name='1/1/13').Capture.HardwareEnabled = True
ixnetwork.StartCapture() ixnetwork.Traffic.Apply() ixnetwork.Traffic.Start() flowStatistics = StatViewAssistant(ixnetwork, 'Flow Statistics') ixnetwork.StopCapture() ixnetwork.SaveCaptureFiles("C:\Results", "trace.pcap")