Closed muthvar1 closed 5 years ago
JFYI: I did'nt put the whole code. But I do have the username,pwd,port etc initialized
if osPlatform == 'linux': platform = 'linux' apiServerIp = '10.23.239.233' apiServerPort = 443 username = 'admin' password = 'admin'
It may not matter, but i assume you passed the point of starting traffic? My guess is there is no data if traffic is never started.
please do not use internal methods. try this to see the flow statistic results
session = testPlatform.Sessions.find(Id=3) stats = StatViewAssistant(session.Ixnetwork, 'Flow Statistics') print(stats)
also would you please attach the restpy.log file to the issue
On Fri, Mar 8, 2019 at 3:34 PM Wesley Hand notifications@github.com wrote:
It may not matter, but i assume you passed the point of starting traffic? My guess is there is no data if traffic is never started.
— 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/46#issuecomment-471114003, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac5ZlmzpcZyG0WK9ioW4Ik-TcKDEthX3ks5vUvOYgaJpZM4bmSkd .
Hi Wes, Yes, I did start traffic earlier.
Andy, Like I mentioned during our webex. For backward compatibility with a lot of our scripts we need to use the csv snapshot, which is what consumers of the ixia infra expect. I will attach the restpy log
RestPy Log
2019-03-08 23:05:09 [ixnetwork_restpy.connection] [INFO] using python version 2.7.8 (default, Jun 30 2015, 14:28:51) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] 2019-03-08 23:05:09 [ixnetwork_restpy.connection] [WARNING] ixnetwork-restpy not installed using pip, unable to determine version 2019-03-08 23:05:10 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/auth/session {"username": "admin", "password": "admin"} 2019-03-08 23:05:10 [ixnetwork_restpy.connection] [DEBUG] 307 Temporary Redirect 2019-03-08 23:05:10 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/platform/api/v1/auth/session?redirectedFromDeprecatedApi=true {"username": "admin", "password": "admin"} 2019-03-08 23:05:11 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:05:36 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions None 2019-03-08 23:05:36 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:26 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233/ixnetworkweb/api/v1/sessions/3/ixnetwork/globals None 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233/ixnetworkweb/api/v1/sessions/3/ixnetwork None 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/files None 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/", "properties": [], "children": [{"properties": [""], "filters": [], "child": "statistics"}]}]} 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [{"regex": "^Flow Statistics$", "property": "caption"}], "child": "view"}]}]} 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics/view/14", "properties": [], "children": [{"properties": [""], "filters": [], "child": "data"}]}]} 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"csvStringQuotes": false} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"snapshotViewContents": "allPages"} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"snapshotViewCsvGenerationMode": "overwriteCSVFile"} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"csvLocation": "/root/.local/share/Ixia/sdmStreamManager/common"} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"csvName": "ixnetwork.restpy.Flow Statistics"} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"views": ["/api/v1/sessions/3/ixnetwork/statistics/view/14"]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot {"Arg1": "/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot"} 2019-03-08 23:06:51 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:52 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:52 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:53 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:53 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:54 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:55 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:56 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:56 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:57 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:57 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:58 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:58 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:59 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:59 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["*"], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted ~ ~ ~ ~ ~ ~
what happens when you print(stats) ? this should output all the rows retrieved.
On Fri, Mar 8, 2019 at 3:53 PM varghese muthalaly notifications@github.com wrote:
RestPy Log
2019-03-08 23:05:09 [ixnetwork_restpy.connection] [INFO] using python version 2.7.8 (default, Jun 30 2015, 14:28:51) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] 2019-03-08 23:05:09 [ixnetwork_restpy.connection] [WARNING] ixnetwork-restpy not installed using pip, unable to determine version 2019-03-08 23:05:10 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/auth/session {"username": "admin", "password": "admin"} 2019-03-08 23:05:10 [ixnetwork_restpy.connection] [DEBUG] 307 Temporary Redirect 2019-03-08 23:05:10 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/platform/api/v1/auth/session?redirectedFromDeprecatedApi=true {"username": "admin", "password": "admin"} 2019-03-08 23:05:11 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:05:36 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions None 2019-03-08 23:05:36 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:26 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233/ixnetworkweb/api/v1/sessions/3/ixnetwork/globals None 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233/ixnetworkweb/api/v1/sessions/3/ixnetwork None 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/files None 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "statistics"}]}]} 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [{"regex": "^Flow Statistics$", "property": "caption"}], "child": "view"}]}]} 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics/view/14", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "data"}]}]} 2019-03-08 23:06:29 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"csvStringQuotes": false} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"snapshotViewContents": "allPages"} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"snapshotViewCsvGenerationMode": "overwriteCSVFile"} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:45 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"csvLocation": "/root/.local/share/Ixia/sdmStreamManager/common"} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"csvName": "ixnetwork.restpy.Flow Statistics"} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] PATCH https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot {"views": ["/api/v1/sessions/3/ixnetwork/statistics/view/14"]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:46 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot {"Arg1": "/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot"} 2019-03-08 23:06:51 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted 2019-03-08 23:06:52 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:52 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:53 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:53 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:54 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:55 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:56 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:56 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:57 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:57 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:58 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:58 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:06:59 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:06:59 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/takecsvsnapshot/11 None 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"inlines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["*"], "filters": [], "child": "csvSnapshot"}]}]} 2019-03-08 23:07:00 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted ~ ~ ~ ~ ~ ~
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenIxia/IxNetwork/issues/46#issuecomment-471117861, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac5ZliVaege2wSsRBHgYWHrlgevTj_5gks5vUvftgaJpZM4bmSkd .
I don't think so right? I though you could enumerate only rows. statsview class initilization only returns a statsview object right? I think .rows is an iterator
print stats 2019-03-08 23:58:53 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in 2019-03-08 23:58:53 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:55 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:55 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/t 2019-03-08 23:59:01 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:02 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:03 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:04 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:05 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:06 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:08 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot "}]}]}3-08 23:59:08 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:59:08 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted
In the doc browser and your installation there is an example ( ixnetwork_restpy.tests.assistants.stat_view_assistant.py) that demonstrates how to get statistics using the StatViewAssistant.
One of the lines shows exactly what i described only using the 'Port Statistics' view. You can substitute 'Flow Statistics'. By printing it out you can easily check to see if you have any statistics at all on the server.
# create a stat view assistant for a statistics view port_statistics = StatViewAssistant(ixnetwork, 'Port Statistics')
# print all the rows for a statistics view print(port_statistics)
On Fri, Mar 8, 2019 at 4:01 PM varghese muthalaly notifications@github.com wrote:
I don't think so right? I though you could enumerate only rows. statsview class initilization only returns a statsview object right? I think .rows is an iterator
print stats 2019-03-08 23:58:53 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in 2019-03-08 23:58:53 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:54 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:55 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": ["
"], "filters": [], "child": "csvSnapshot 2019-03-08 23:58:55 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/t https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/t 2019-03-08 23:59:01 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:02 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:03 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:04 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:05 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:06 [ixnetwork_restpy.connection] [DEBUG] GET https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/statistics/csvSnapshot/operations/ta 2019-03-08 23:59:08 [ixnetwork_restpy.connection] [DEBUG] POST https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select https://10.23.239.233:443/api/v1/sessions/3/ixnetwork/operations/select {"selects": [{"in lines": [], "from": "/api/v1/sessions/3/ixnetwork/statistics", "properties": [], "children": [{"properties": [""], "filters": [], "child": "csvSnapshot "}]}]}3-08 23:59:08 [ixnetwork_restpy.connection] [DEBUG] 200 OK 2019-03-08 23:59:08 [ixnetwork_restpy.connection] [DEBUG] 202 Accepted
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenIxia/IxNetwork/issues/46#issuecomment-471119498, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac5ZlmhnfxLyszbnWQS_pGYPWZZN2GN9ks5vUvnDgaJpZM4bmSkd .
Hmm.. maybe your right.. it probably is something else that is wrong.. cause even if I print I get nothing. But I do see the flow stats in the api browser. What could I be doing wrong? I followed the example as in the bgpNgpf.py sample script
per Hubert's request I updated to the latest SDK and now this works fine. FYI: The issue was that there was a bug in the SDK where in stats were not working in the case where the api server session was started on the chassis itself. This may not be a problem for sessions started on dedicated linux VMs. Either way, the latest update should solve this.
The csv file that is saved has an error as such and no data
Code is exactly as below
testPlatform = TestPlatform(ip_address=apiServerIp, rest_port=apiServerPort, platform=platform, log_file_name='restpy.log') testPlatform.Trace = 'request_response' testPlatform.Authenticate(username, password)
Using an existing Session. Not sure if this is the issue.
session = testPlatform.Sessions.find(Id=3) stats = StatViewAssistant(session.Ixnetwork, 'Flow Statistics') result = stats._take_csv_snapshot()
Then opening the file throws an error and no data in it.