ostinato.core module¶
This is the core module for the Ostinato Python API. All drone configuration is done by creating an instance of the DroneProxy
class and calling its various methods subsequently.
Module Classes¶
DroneProxy class¶
DroneProxy(host_name, port_number=7878)
Class methods¶
disconnect¶
DroneProxy.disconnect()
connect¶
DroneProxy.connect()
hostName¶
DroneProxy.hostName() : str(unicode)
portNumber¶
DroneProxy.portNumber() : int
saveCaptureBuffer¶
DroneProxy.saveCaptureBuffer(buffer, file_name)
getPortIdList¶
DroneProxy.getPortIdList(Void) : PortIdList
Returns PortIdList
getPortConfig¶
DroneProxy.getPortConfig(PortIdList) : PortConfigList
Returns a PortConfigList
modifyPort¶
DroneProxy.modifyPort(PortConfigList) : Ack
Returns Ack
getStreamIdList¶
DroneProxy.getStreamIdList(PortId) : StreamIdList
Returns StreamIdList
getStreamConfig¶
DroneProxy.getStreamConfig(StreamIdList) : StreamConfigList
Returns StreamConfigList
addStream¶
DroneProxy.addStream(StreamIdList) : Ack
Returns Ack
deleteStream¶
DroneProxy.deleteStream(StreamIdList) : Ack
Returns Ack
modifyStream¶
DroneProxy.modifyStream(StreamConfigList) : Ack
Returns Ack
build¶
DroneProxy.build(BuildConfig) : Ack
If startTransmit() is called without calling build(), it will first build the packets and then start transmit.
This API was introduced in ver 1.0
Returns Ack
startTransmit¶
DroneProxy.startTransmit(TransmitConfig) : Ack (1) [Since v1.4]
DroneProxy.startTransmit(PortIdList) : Ack (2) [Deprecated]
TransmitConfig.duration
is 0 (default), transmit will stop when there are no more packets to send or when stopTransmit() is called. If duration is set to a non-zero value, the transmit will automatically stop after the specified duration (in seconds). There may be a small variation in the configured duration and the actual transmit duration.
This API was introduced in ver 1.4
(2) Deprecated starting v1.4: Starts transmit on each port in the given PortIdList
Returns Ack
stopTransmit¶
DroneProxy.stopTransmit(PortIdList) : Ack
Returns Ack
startCapture¶
DroneProxy.startCapture(PortIdList) : Ack
Returns Ack
stopCapture¶
DroneProxy.stopCapture(PortIdList) : Ack
Returns Ack
getCaptureBuffer¶
DroneProxy.getCaptureBuffer(PortId) : CaptureBuffer
Returns Ack
getStats¶
DroneProxy.getStats(PortIdList) : PortStatsList
Returns PortStatsList
clearStats¶
DroneProxy.clearStats(PortIdList) : Ack
Returns Ack
getDeviceGroupIdList¶
DroneProxy.getDeviceGroupIdList(PortId) : DeviceGroupIdList
getDeviceGroupConfig¶
DroneProxy.getDeviceGroupConfig(DeviceGroupIdList) : DeviceGroupConfigList
Returns DeviceGroupConfigList
addDeviceGroup¶
DroneProxy.addDeviceGroup(DeviceGroupIdList) : Ack
Returns Ack
deleteDeviceGroup¶
DroneProxy.deleteDeviceGroup(DeviceGroupIdList) : Ack
Returns Ack
modifyDeviceGroup¶
DroneProxy.modifyDeviceGroup(DeviceGroupConfigList) : Ack
Returns Ack
getDeviceList¶
DroneProxy.getDeviceList(PortId) : PortDeviceList
Returns PortDeviceList
resolveDeviceNeighbors¶
DroneProxy.resolveDeviceNeighbors(PortIdList) : Ack
The ARP/ND replies received in response to these requests will be stored in the Neighbor Table (i.e. ARP/ND cache)
Returns Ack
clearDeviceNeighbors¶
DroneProxy.clearDeviceNeighbors(PortIdList) : Ack
Returns Ack
getDeviceNeighbors¶
DroneProxy.getDeviceNeighbors(PortId) : PortNeighborList
getStreamStats¶
DroneProxy.getStreamStats(StreamGuidList) : StreamStatsList
StreamGuidList.stream_guid
. If not populated, stats for all GUIDs are returned.
Returns StreamStatsList
getStreamStatsDict¶
DroneProxy.getStreamStatsDict(StreamGuidList) : StreamStatsDict
stream_stats = drone.getStreamStatsDict(guid_list)
stream_stats.sguid[101].port[1].tx_pkts
stream_stats.port[1].sguid[101].rx_bytes
In addition, you can also retrieve totals across ports, e.g.
stream_stats.port[1].total.rx_pkts
stream_stats.port[1].total.rx_bytes
stream_stats.port[1].total.tx_pkts
stream_stats.port[1].total.tx_bytes
and totals across sguids -
stream_stats.sguid[101].total.tx_pkts
stream_stats.sguid[101].total.rx_pkts
stream_stats.sguid[101].total.pkt_loss
This method is a wrapper around getStreamStats
clearStreamStats¶
DroneProxy.clearStreamStats(StreamGuidList) : Ack
StreamGuidList.stream_guid
. If not populated, stats for all GUIDs are cleared.
Returns Ack