This document provides a brief description of the IPSLA OpEN APIs. It provides the following services:
- Create an IP SLA operation for the given IP SLA number.
- Delete an IP SLA operation for the given IP SLA number.
- Schedule an IP SLA operation to start or stop probing.
- Get the config information of the given IP SLA number.
- Get the operational info of the given IP SLA number.
- To get the IPSLA ID of the first IPSLA probe operational. Entry from the IPSLA Table.
- To get the ipSla id of the next IPSLA probe operational entry from the IPSLA Table.
- Get the operational status of the given IP SLA number.
- Get the tracking status of the given Track number.
- Get the config information of the given track number.
- Get the operational info of the given track number.
- To get the track Id of the first track object's operational entry from the Track Table.
- To get the track Id of the next track object's operational entry from the TrackTable.
- Create a Track object for the given track number.
- Delete the Track object for the given track number.
- Set the given Track object's Up delay time value.
- Set the given Track object's Down delay time value.
- Set the given IP SLA Operation's ICMP-ECHO Type params.
- Set the given IP SLA Operation's ICMP-ECHO Frequency value.
- Set the given IP SLA Operation's ICMP-ECHO Timeout value.
- Set the given IP SLA Operation's ICMP-ECHO Threshold value.
- Set the given IP SLA Operation's ICMP-ECHO VRF Name value.
- Clear IP SLA statistical information for given IP SLA operation or all IP SLAs.
Example C Application ipsla_example
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
ipsla_example
ipsla_example.c is a sample application that demonstrates the use of OpEN's IPSLA APIs. ipsla_example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: ./ipsla_example <test#> <arg1> <arg2> ...
- Test 1: Create an IP SLA operation for the given IP SLA number: ipsla_example 1 <ipSlaId>
- Test 2: Delete an IP SLA operation for the given IP SLA number: ipsla_example 2 <ipSlaId>
- Test 3: Schedule an IP SLA operation to start or stop probing: ipsla_example 3 <ipSlaId> <toSchedule>
- Test 4: Get the config information of the given IP SLA number: ipsla_example 4 <ipSlaId>
- Test 5: Get the operational info of the given IP SLA number: ipsla_example 5 <ipSlaId>
- Test 6: To get the IPSLA ID of the first IPSLA probe operational. Entry from the IPSLA Table: ipsla_example 6
- Test 7: To get the ipSla id of the next IPSLA probe operational entry from the IPSLA Table: ipsla_example 7 <ipSlaId>
- Test 8: Get the operational status of the given IP SLA number: ipsla_example 8 <ipSlaId>
- Test 9: Get the tracking status of the given Track number: ipsla_example 9 <trackId>
- Test 10: Get the config information of the given track number: ipsla_example 10 <trackId>
- Test 11: Get the operational info of the given track number: ipsla_example 11 <trackId>
- Test 12: To get the track Id of the first track object's operational entry from the Track Table: ipsla_example 12
- Test 13: To get the track Id of the next track object's operational entry from the TrackTable: ipsla_example 13 <trackId>
- Test 14: Create a Track object for the given track number: ipsla_example 14 <trackId><ipSlaId> <trackingType>
- Test 15: Delete the Track object for the given track number: ipsla_example 15 <trackId>
- Test 16: Set the given Track object's Up delay time value: ipsla_example 16 <trackId> <upDelayTime>
- Test 17: Set the given Track object's Down delay time value: ipsla_example 17 <trackId> <downDelayTime>
- Test 18: Set the given IP SLA Operation's ICMP-ECHO Type params: ipsla_example 18 <ipSlaId> <destIpAddress> <srcIntIfNum>
- Test 19: Set the given IP SLA Operation's ICMP-ECHO Frequency value: ipsla_example 19 <ipSlaId> <frequency>
- Test 20: Set the given IP SLA Operation's ICMP-ECHO Timeout value: ipsla_example 20 <ipSlaId> <timeout>
- Test 21: Set the given IP SLA Operation's ICMP-ECHO Threshold value: ipsla_example 21 <ipSlaId> <threshold>
- Test 22: Set the given IP SLA Operation's ICMP-ECHO VRF Name value: ipsla_example 22 <ipSlaId> <vrfName>
- Test 23: Clear IP SLA statistical information for given IP SLA operation or all IP SLAs: ipsla_example 23 <ipSlaId>
IPSLA CLI/API Cross Reference
(Config)#
track <id> ip sla <id> [reachability|state] | openapiIpSlaTrackIdCreate() (Config)#
no track <id> ip sla <id> [reachability|state] | openapiIpSlaTrackIdDelete() (Privileged exec Mode)#
show track ip sla <id> | openapiIpSlaTrackIdCfgNodeFirstGet() (Privileged exec Mode)#
show track ip sla <id> | openapiIpSlaTrackIdCfgNodeNextGet() (Track config Mode)#
[no] delay {up <secs> [down <secs>] | down <secs> [up <secs>]} | openapiIpSlaSetTrackOjectsDelayUpTime() (Track config Mode)#
[no] delay {up <secs> [down <secs>] | down <secs> [up <secs>]} | openapiIpSlaSetTrackOjectsDelayDownTime() (IPSLA config Mode)#
icmp-echo <dest-ipaddr> [src-intf {<u/s/p> | vlan <id>}] | openapiIpSlaIpSlaProbesIcmpEchoTypeSet() (ICMP-Echo config Mode)#
[no] frequency <seconds> | openapiIpSlaSetIpSlaProbesFrequency() (ICMP-Echo config Mode)#
[no] timeout <milliseconds> | openapiIpSlaSetIpSlaProbesTimeout() (ICMP-Echo config Mode)#
[no] threshold <milliseconds> | openapiIpSlaSetIpSlaProbesThreshold() (ICMP-Echo config Mode)#
[no] vrf <vrf-name> | openapiIpSlaSetIpSlaProbesVrfName() (Privileged exec Mode)#
clear ip sla statistics | openapiIpSlaIpSlaStatisticsClear()