HSRP, Tracking Object, IP SLA
Introduction to HSRP
Cisco HSRP provides high network availability through redundancy of IP hosts on an IEEE 802 LAN. HSRP enables a group of router interfaces to work together to present the appearance of a single virtual router to hosts on a LAN.
Active and Standby Routers
Within the group or routers, only one router is designated as “active” at any one time. The active router is the router of choice for routing packets. Another router in the group is designated as the “standby” router, which takes over routing duties if the active router fails or when preset conditions are met.
The group of routers communicates periodically to determine which router is active. The active router is elected according to a preconfigured set of priorities.
Load Sharing
To enable load sharing, it is possible to configure multiple HSRP groups on a router interface. A router can play an active role in one HSRP group and standby role in another group.
HSRP Interface Configuration
To enable HSRP, standby configurations must be added into the participating router’s LAN interfaces. All of the LAN interfaces must be in the same subnet as the standby IP address. The interfaces communicate periodically with each other to ensure that at any given time, one is assigned to serve as the standby IP address.
The standby address is a key element of the HSRP feature; it identifies a group of configurations. Consequently, standby address is a used for identifying HSRP resources.
HSRP supports IPv6 and VPN routing/forwarding table (VRF) standby addresses. If the interface is defined in a VRF, the standby address will be a VRF standby address. If the interface is removed from the VRF, the active and standby address associated with the interface will be removed with it.
Resource Summary for HSRP, Tracking Objects, and IP SLA
|
|
|
|
|
|
|
|
|
HSRP: Standby addresses |
/api/v1/hsrp/ |
Y |
Y |
N |
N |
/api/v1/hsrp/<standby address> Supports IPv4 addresses. |
Y |
N |
Y |
Y |
Tracking objects |
/api/v1/tracking-objects |
Y |
Y |
N |
N |
/api/v1/tracking-objects/<object-id> |
Y |
N |
Y |
Y |
IP SLA |
/api/v1/vrf/<vrf-name>/ip-sla |
Y |
Y |
N |
N |
/api/v1/ip-sla/ |
Y |
Y |
N |
N |
/api/v1/vrf/<vrf-name>/ip-sla/<sla-id> |
Y |
N |
Y |
Y |
/api/v1/ip-sla/<sla-id> |
Y |
N |
Y |
Y |
/api/v1/ip-sla/responder |
Y |
Y |
N |
Y |
/api/v1/ip-sla/responder/<sla-type>/<ip-address>/<port> |
Y |
N |
N |
Y |
HSRP Standby Resource
History
|
|
IOS XE 3.13 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
virtual-ip-address |
string |
Mandatory |
Virtual IPv4 or IPv6 address of the group’s standby. A different address on the same interface uses different group number. |
interface-name |
string |
Mandatory |
L3, LAN interface participating in HSRP. The interface should be in the same subnet as the standby IP address. One router can have a maximum of 32 interfaces configured for HSRP. |
virtual-mac-address |
string |
Optional |
Virtual MAC address Default: 0000.0c07.acXX XX is the group number. |
group |
number |
Optional |
HSRP group number. All participants that standby the same IP address must be in the same group. If one interface needs to standby two different IP addresses, the addresses must be in different groups. A group can only have one standby address. Default: 0 |
name |
string |
|
Name of the group |
version |
number |
Optional |
(sub-property of name) HSRP message version to communicate within the group. Possible values: 1, 2 The two versions are not compatible. Usage
- All participants in the same group must communicate in the same version.
- IPv6 requires version 2.
- One interface can communicate in only one version.
|
priority |
number |
Optional |
(sub-property of name) Priority number of the router. Possible values: 1 to 255 The highest priority living router is the candidate to be the active router. Default: 100 |
preempt |
object |
Optional |
(sub-property of name) Possible values (all optional):
- minimum-delay
- sync-delay
- reload-delay
(description of each option below) |
(continued) |
|
Optional |
minimum-delay (number) Preemption may be delayed for a minimum number of seconds with the minimum delay extension. This is useful for enabling routing tables, and so on, to be updated before a router becomes active. Range: 0 to 3600 Default: 0 |
(continued) |
|
Optional |
sync-delay (number) Maximum synchronization period (seconds) for IP redundancy clients. The synchronization delay is the maximum time that a group will wait to synchronize with the IP redundancy clients. This delay specifies the maximum time allowed before preemption may occur. Note : Consider delay as the minimum time that must pass before preemption may occur. Configuring a sync of 120 specifies that after 120 seconds, preemption will attempt. |
(continued) |
|
Optional |
reload-delay (number) Preemption delay (seconds) after a reload only. This delay period applies only to the first interface-up event after the router has reloaded. |
tracking-object |
object |
Optional |
(sub-property of name) Possible values (all optional):
(description of each option below) When the object is down, the standby priority is decrement by that value. Default: 10 Usage
- There is no error if the object is not configured.
- No tracking object by default.
- The Cisco IOS CLI supports a list of tracking objects on the interface, but in this usage only one tracking object is supported per standby group.
|
(continued) |
|
Mandatory |
object-id (number) Tracking-object index |
(continued) |
|
Optional |
decrement (number) When the tracking object is down, the system decrements the HSRP priority by this amount. |
Example
JSON Request
Content-Type: application/json
"virtual-ip-address":"11.1.2.1",
"interface-name": "gigabitethernet2",
"preempt" : {"minimum-delay":60, "sync-delay":60,
"tracking-object":{"object-id":3, "decrement":50 }
JSON Response
Location: http://host/api/v1/hsrp/11.1.2.1
Retrieve All Standby IP Address Information in the Router
Tracking Object Resource
The tracking object feature creates a separate, standalone tracking process that can be used by processes such as HSRP, VRRP, GLBP, and so on. This feature allows tracking of other objects such as interface line-protocol state, IP routing state, Service Level Agreement (SLA) operations, and so on. The feature can even track a list of many sub-objects.
A client process, such as HSRP, can register an interest in tracking objects and request notification of when the tracked object changes state. Several clients can track the same object, and can take different actions when the object changes state.
A maximum of 1000 tracking objects can be configured.
History
|
|
IOS XE 3.13 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
Properties
|
|
Required for POST and PUT
|
|
object-id |
number |
Mandatory |
Index of the tracking object. Maximum number of tracking objects: 1000 |
object-type |
string |
Mandatory |
Object type. The object type determines which sub-properties are relevant. Possible values:
- ip-sla
- interface
- ip-route
- list (list of objects)
|
ip-sla |
object |
Optional |
(sub-property of object-type) (Required only if object-type is “ip-sla”) SLA entry |
sla-id |
number |
Mandatory |
(sub-property of ip-sla) SLA entry ID Range: 1 to 2147483647 (2 giga) Note : Specifying a non-existent SLA entry does not generate an error. |
selection |
string |
Optional |
(sub-property of ip-sla) Possible values: reachability, state Default: state |
interface |
object |
Optional |
(sub-property of object-type) (Required only if object-type is “interface”) Interface |
interface-name |
string |
Mandatory |
(sub-property of interface) Valid interface name. Note : If the specified interface is a virtual interface and the virtual interface does not exist, it will be created automatically. |
selection |
string |
Mandatory |
(sub-property of ip-sla) Possible values: ip-routing or line-protocol |
ip-route |
object |
Optional |
(sub-property of object-type) (Required only if object-type is “ip-route”) IP-route entry Note : Although Cisco IOS supports both IPv4 and IPv6 entries, the Tracking Object resource supports only IPv4 in the current release. |
address |
string |
Mandatory |
(sub-property of ip-route) IP address (IPv4 or IPv6) |
mask |
string |
Mandatory |
(sub-property of ip-route) IP mask (IPv4 or IPv6) |
vrf-name |
string |
Optional |
(sub-property of ip-route) VRF name Default: none A tracking object can track a route in VRF scope, but the object can be tracked by non-VRF applications. Note : Ensure that the VRF is already configured. |
selection |
string |
Optional |
(sub-property of ip-route) Select different type of objects or entries Possible values: reachability, metric threshold Default: reachability |
list |
object |
Optional |
(sub-property of object-type) (Required only if object-type is “list”) List of tracked objects. Can include a boolean expression. |
base-on |
string |
Mandatory |
(sub-property of list) List of sub-objects. The object state is determined by the state of the sub-objects in the list. This property selects the logic to apply when evaluating the states of the sub-objects. Possible values: “boolean-and” and “boolean-or” |
object-list |
list of objects |
Mandatory |
(sub-property of list) List of other object IDs. The objects can be:
- interface objects
- IP route objects
- SLA objects
Each object in the list can have an optional “not” keyword. The keyword “not” reverses the state of the object—when the object is up, the tracked list detects the object as down. Example :
{{"object-id": 10, "state": "not"},
"object-id" is a number: index of an object. "state" is an optional string; value is "yes" or "not"; default is "yes". Note : There is no error when the sub-object does not exist. |
Resource URI
|
|
POST |
/api/v1/tracking-objects/ |
Example 1: IP SLA Tracking Object
This example configures an IP SLA tracking object.
JSON Request
POST /api/v1/tracking-objects/
Content-Type: application/json
"selection":"reachability"
JSON Response
Location: http://host/api/v1/tracking-objects/10
Example 2: Interface Tracking Object
This example configures an interface tracking object.
JSON Request
POST /api/v1/tracking-objects/
Content-Type: application/json
"object-type": "interface",
"interface-name":"gigabitethernet1",
"selection":"line-protocol"
JSON Response
Location: http://api/v1/tracking-objects/11
Example 3: IP Route Tracking Object
This example configures an IP route tracking object.
JSON Request
POST /api/v1/tracking-objects/
Content-Type: application/json
"object-type": "ip-route",
"ip-route":{"address":"10.0.0.1",
"selection":"reachability"
JSON Response
Location: http://api/v1/tracking-objects/12
Example 4: List Tracking Object
This example configures a list tracking object.
JSON Request
POST /api/v1/tracking-objects/
Content-Type: application/json
"object-list": [{"object-id":1},
{"object-id":2, "state": "not"},
JSON Response
Location: http://api/v1/tracking-objects/15
IP SLA Resource
History
|
|
IOS XE 3.13 |
Introduced for the CSR1000V platform |
IOS XE 3.14 |
Introduced for ASR1001-X and ASR1002-X platforms |
IOS XE 3.17 |
Introduced several IP SLA APIs and properties |
Properties
|
|
Required for POST and PUT
|
|
sla-id |
number |
Not applicable |
Index of the SLA entry |
schedule |
boolean |
Mandatory |
Activate/deactivate the SLA entry. true—Schedule SLA entry to run. false—Do not schedule SLA entry to run An already scheduled SLA cannot be modified. When modifying attributes of an SLA and configuring schedule=true , the SLA is first deactivated, then the modifications are configured, then the SLA entry is scheduled to run. When modifying attributes of an SLA and configuring schedule=false , the SLA is first deactivated, then the modifications are configured. The SLA entry is not scheduled to run after the modification. |
lifetime |
string |
Optional |
(Only required when scheduling an SLA) Length of time that the SLA entry will be active. Possible values: "forever" or number of seconds |
start-time |
string |
Optional |
(Only required when scheduling an SLA) Start time Possible values: "now" or specific date/time Example : "12:00:00 Nov 22" Note : For this feature to work, the clock must be set correctly on the router. |
sla-type |
string |
Mandatory |
SLA type Possible values: "icmp-echo", "path-echo", "path-jitter", "udp-echo", "udp-jitter", "tcp-connect","dhcp", "dns", "ftp", "http" |
<sla-type> |
object |
Mandatory |
Define the configuration from the sub properties of sla types. Possible values for <sla-type>: "icmp-echo", "path-echo", "path-jitter", "udp-echo", "udp-jitter", "tcp-connect","dhcp", "dns", "ftp", "http" See sections below for sub-properties relevant to each of these options. |
Sub-properties:
Sub-properties for sla-type: icmp-echo
|
|
Required for POST and PUT
|
|
address |
string |
Mandatory |
(sub-property of <sla-type>) Address (IPv4 or IPv6) |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
tos |
number |
Optional |
(sub-property of <sla-type>) tos value in the ping packet Possible values: 0 to 255 |
vrf-name |
string |
Optional |
(sub-property of <sla-type>) VRF name. Notes :
- The VRF name must already exist.
- An SLA in one VRF can be used in another scope; it is visible globally.
|
Sub-properties for sla-type: path-echo
|
|
Required for POST and PUT
|
|
address |
string |
Mandatory |
(sub-property of <sla-type>) Address (IPv4 or IPv6) |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
tos |
number |
Optional |
(sub-property of <sla-type>) tos value in the ping packet Possible values: 0 to 255 |
Sub-properties for sla-type: path-jitter
|
|
Required for POST and PUT
|
|
address |
string |
Mandatory |
(sub-property of <sla-type>) Address (IPv4 or IPv6) |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
tos |
number |
Optional |
(sub-property of <sla-type>) tos value in the ping packet Possible values: 0 to 255 |
interval |
number |
Optional |
(sub-property of <sla-type>) Inter Packet Interval Possible values: 1 to 1000 |
num-packets |
number |
Optional |
(sub-property of <sla-type>) Number of Packets to be transmitted Possible values: 1 to 100 |
Sub-properties for sla-types: udp-echo, tcp-connect
|
|
Required for POST and PUT
|
|
address |
string |
Mandatory |
(sub-property of <sla-type>) Address (IPv4 or IPv6) |
port-number |
number |
Optional |
(sub-property of <sla-type>) Port number Possible values: 0 to 65535 (Recommend using ports greater than 1023) |
dest-ipaddr |
string |
Optional |
(sub-property of <sla-type>) Destination IP address |
dest-port |
number |
Optional |
(sub-property of <sla-type>) Port number Possible values: 0 to 65535 (Recommend using ports greater than 1023) |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
tos |
number |
Optional |
(sub-property of <sla-type>) tos value in the ping packet Possible values: 0 to 255 |
Sub-properties for sla-type: udp-jitter
|
|
Required for POST and PUT
|
|
address |
string |
Mandatory |
(sub-property of <sla-type>) Address (IPv4 or IPv6) |
port-number |
number |
Optional |
(sub-property of <sla-type>) Port number Possible values: 0 to 65535 (Recommend using ports greater than 1023) |
dest-ipaddr |
string |
Optional |
(sub-property of <sla-type>) Destination IP address |
dest-port |
number |
Optional |
(sub-property of <sla-type>) Port number Possible values: 0 to 65535 (Recommend using ports greater than 1023) |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
tos |
number |
Optional |
(sub-property of <sla-type>) tos value in the ping packet Possible values: 0 to 255 |
codec |
string |
Optional |
(sub-property of <sla-type>) codec type to be configured. Possible values:
- g711alaw: G.711 A Law, 64000 bps
- g711ulaw: G.711 U Law, 64000 bps
- g729a: G.729, 8000 bps
|
interval |
number |
Optional |
(sub-property of <sla-type>) Inter Packet Interval Possible values: 1 to 1000 |
num-packets |
number |
Optional |
(sub-property of <sla-type>) Number of Packets to be transmitted Possible values: 1 to 100 |
Sub-properties for sla-type: dhcp
|
|
Required for POST and PUT
|
|
address |
string |
Mandatory |
(sub-property of <sla-type>) Address (IPv4 or IPv6) |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
Sub-properties for sla-type: dns
|
|
Required for POST and PUT
|
|
address |
string |
Mandatory |
(sub-property of <sla-type>) Address (IPv4 or IPv6) |
name-server |
number |
Mandatory |
(sub-property of <sla-type>) IP address of name server |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
Sub-properties for sla-type: ftp
|
|
Required for POST and PUT
|
|
url |
string |
Mandatory |
(sub-property of <sla-type>) URL for ftp/http |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
tos |
number |
Optional |
(sub-property of <sla-type>) tos value in the ping packet Possible values: 0 to 255 |
Sub-properties for sla-type: http
|
|
Required for POST and PUT
|
|
url |
string |
Mandatory |
(sub-property of <sla-type>) URL for ftp/http |
frequency |
number |
Optional |
(sub-property of <sla-type>) Frequency of sending ping packets Possible values: 1 to 604800 (seconds) |
http-raw-request |
string |
Optional |
(sub-property of <sla-type>) Sets a request in case the http raw request requires configuration. |
threshold |
number |
Optional |
(sub-property of <sla-type>) Possible values: 0 to 60000 |
timeout |
number |
Optional |
(sub-property of <sla-type>) ICMP timeout Ping packet round trip time which, if exceeded, results in timeout. Possible values: 0 to 604800000 (milliseconds) |
tos |
number |
Optional |
(sub-property of <sla-type>) tos value in the ping packet Possible values: 0 to 255 |
JSON Representation
"description" : "Service Level Agreements Schema",
"sla-id":{"type":"number","minimum":1," maximum" :2147483647, "required":True},
"schedule":{"type":"boolean"},
"start-time":{"type":"string", "required":False},
"lifetime":{"type":"string", "required":False},
"sla-type":{"type":"string", "enum":["icmp-echo", "path-echo", "path-jitter",
"udp-echo", "udp-jitter", "tcp-connect","dhcp", "dns", "ftp", "http"],
<sla-type>:SLA_TYPE_CONFIG
"additionalProperties" : False
SLA type configuration:
"type":"object", "required":False,
"address":{"type":"string", "format":"ip-address"},
"timeout":{"type":"number", "required":False, "minimum":0, "maximum": 604800000},
"threshold":{"type":"number", "required":False, "minimum":0, "maximum": 60000},
"frequency":{"type":"number", "required":False, "minimum":1, "maximum": 604800},
"tos":{"type":"number", "required":False, "minimum":0, "maximum": 255},
JSON Representation—Responder
"description" : "Service Level Agreements Responder Schema",
"sla-type":{"type":"string", "required":True, "enum":["udp-echo","tcp-connect"]},
"ipadress":{"type":"string", "required":True, "format":"ip-address"},
"port":{"type":"number", "required":True, "minimum":1, "maximum": 65535}
About the IP-SLA Responder
The IP SLA Responder listens on a specific port for control protocol messages sent by an IP SLA operation. When it receives a control message, the responder enables the specified UDP or TCP port for the specified duration. During this time, the responder accepts requests and responds to them. The responder disables the port after it responds to the IP SLA packet, or when the specified time expires. For added security, MD5 authentication for control messages is available.
Resource URI
|
|
POST |
/api/v1/vrf/<vrf-name>/ip-sla |
Example 1: tcp-connect operation
JSON Request
POST /api/v1/vrf/coke/ip-sla
Content-Type: application/json
"kind" : "object#ip-sla",
"sla-type":"tcp-connect",
JSON Response
Location: https://host/api/v1/vrf/coke/ip-sla/2
Resource URI
|
|
GET |
/api/v1/vrf/<vrf-name>/ip-sla/<sla-id> |
Example
JSON Request
GET /api/v1/vrf/coke/ip-sla/2
JSON Response
Content-type: application/json
"kind" : "object#ip-sla",
Resource URI
|
|
GET |
/api/v1/vrf/<vrf-name>/ip-sla |
Example
JSON Request
GET /api/v1/vrf/coke/ip-sla
JSON Response
"kind": "collection#ip-sla",
"sla-type": "tcp-connect",
Resource URI
|
|
PUT |
/api/v1/vrf/<vrf-name>/ip-sla/<sla-id> |
Example
JSON Request
PUT /api/v1/vrf/coke/ip-sla/2
Content-Type: application/json
"kind" : "object#ip-sla",
JSON Response
Resource URI
|
|
DELETE |
/api/v1/vrf/<vrf-name>/ip-sla/<sla-id> |
Example
JSON Request
DELETE /api/v1/vrf/coke/ip-sla/2
JSON Response
Resource URI
|
|
POST |
/api/v1/ip-sla/responder |
Example 1: Create an IP SLA Responder
JSON Request
POST /api/v1/ip-sla/responder
Content-Type: application/json
"kind" : "object#ip-sla-responder-entry",
"sla-type":"tcp-connect",
JSON Response
Location: https://host/api/v1/ip-sla/responder/tcp-connect/1.2.3.4/1056
Example 2: Create an IP SLA Responder with No JSON Data
Used in udp-echo responder configuration and tcp-connect responder configuration.
JSON Request
POST /api/v1/ip-sla/responder
Content-Type: application/json
JSON Response
Location: https://host/api/v1/ip-sla/responder
Retrieve an IP-SLA Responder
Resource URI
|
|
GET |
/api/v1/ip-sla/responder/<sla-type>/<ip-address>/<port> |
Example
JSON Request
GET /api/v1/ip-sla/responder/tcp-connect/1.2.3.4/1056
JSON Response
Content-type: application/json
"kind" : "object#ip-sla-responder-entry",
"sla-type":"tcp-connect",
Retrieve ALL IP-SLA Responder Entries
Resource URI
|
|
GET |
/api/v1/ip-sla/responder |
Example
JSON Request
GET /api/v1/ip-sla/responder
JSON Response
Content-type: application/json
“kind” : “collection#ip-sla-responder”,
"kind" : "object#ip-sla-responder-entry",
"sla-type":"tcp-connect",
"kind" : "object#ip-sla-responder",
"ipadress": "10.20.30.40",
Delete an IP-SLA TCP-Connect Responder
Deletes the tcp-connect reponder. This API deletes the entire responder, not only the IP-address and port number.
Resource URI
|
|
DELETE |
/api/v1/ip-sla/responder/<sla-type>/<ip-address>/<port> |
Example
JSON Request
DELETE /api/v1/ip-sla/responder/tcp-connect/1.2.3.4/1056
JSON Response
Delete an IP-SLA Responder
Deletes the IP-SLA responder.
Resource URI
|
|
DELETE |
/api/v1/ip-sla/responder |
Example
JSON Request
DELETE /api/v1/ip-sla/responder
JSON Response
Batch Operations
The HSRP feature supports configuring multiple tracking objects or IP-SLA entries at once, using a batch operation.
Limitations
- Maximum of 25 entries.
- If there is failure in the middle of the batching operation, the JSON response indicates which operations were successful and which failed, as well as the reason for failure.
- For a batch delete, any non-existing elements are reported as "not found" and the batch operation continues. If this occurs, the final status code is 200.
Creating Tracking Objects
This batch example creates the following tracking objects:
ip sla 1 reachability
list boolean-and
object 1
object 2 not
object 6
interface GigabitEthernet1 line-protocol
interface GigabitEthernet2 ip-routing
ip route 9.9.9.9 255.255.255.0 metric threshold
ip vrf vrf2
Example
JSON Request
POST /api/v1/tracking-objects/batch
Content-Type: application/json
"ip-sla":{"sla-id":1, "selection":"reachability"}
"list":{"base-on":"boolean-and",
{"object-id": 2, "state": "not"}]
"object-type":"interface",
"interface":{"interface-name":"GigabitEthernet1",
"selection":"line-protocol"}
"object-type":"interface",
"interface":{"interface-name":"GigabitEthernet2",
"selection":"ip-routing"}
"object-type":"ip-route",
"ip-route":{"address":" 9.9.9.9",
"selection":"metric threshold",
JSON Response Showing Successful Completion of the Batch Operations
Location: https://host/api/v1/tracking-objects/
In the body of the response, the following appears:
{"object-id":1, "result":"https://host/api/v1/tracking-object/1"},
{"object-id":3, "result":"https://host/api/v1/tracking-object/3"},
{"object-id":4, "result":"https://host/api/v1/tracking-object/4"},
{"object-id":5, "result":"https://host/api/v1/tracking-object/5"},
{"object-id":6, "result":"https://host/api/v1/tracking-object/6"}
JSON Response Showing Some Failed Batch Operations
In the body of the response, the following appears:
{"object-id":1, "result":"https://host/api/v1/tracking-object/1"},
{"object-id":3, "result":"https://host/api/v1/tracking-object/3"},
{"object-id":4, "result":"object already exist"},
{"object-id":5, "result":"not processed"},
{"object-id":6, "result":"not processed"}
Modifying Tracking Objects
PUT operations for modifying tracking objects are similar to the POST batch operations described earlier in this section.
Successful completion of the batch operation results in the following response:
If some operations fail, the response is the following, with details described in the body of the response:
Deleting Tracking Objects
JSON Representation
"number-of-items":"number",
"item-list":[{"object-id":"number"}]
Example
JSON Request
DELETE /api/v1/tracking-objects/batch
Content-Type: application/json
"item-list":[{"object-id":100}, {"object-id":400},{"object-id":300},{"object-id":600}]
JSON Response Showing Successful Completion of the Batch Operations
JSON Response Showing Some Failed Batch Operations
In the body of the response, the following or similar appears:
{"object-id":100, "result":"OK"},
{"object-id":400, "result":"OK"},
{"object-id":300, "result":"object 300 not found"},
{"object-id":600, "result":"ok"}
Creating IP-SLA Entries
This batch example creates the following IP-SLA entries:
icmp-echo 1.2.0.1
tos 192
vrf vrf2
threshold 2000
timeout 2000
frequency 3
ip sla schedule 1 life forever start-time now
icmp-echo 2::2
icmp-echo 2.3.4.5
ip sla schedule 21 life 900000 start-time 12:30:00 Nov 21
Example
JSON Request
POST /api/v1/ip-sla/batch
Content-Type: application/json
"schedule":true, "lifetime":"forever", "start-time":"now",
"icmp-echo":{"address":"1.2.0.1", "tos":192, "timeout":2000,
"frequency":3, "threshold":2000, "vrf-name":"vrf2"}
"schedule":true, "lifetime":"9000000", "start-time":"12:30:00 Nov 21",
"icmp-echo":{"address":"2.3.4.5"}
"icmp-echo":{"address":"2::2"}
JSON Response Showing Successful Completion of the Batch Operations
Location: https://host/api/v1/ip-sla
In the body of the response, the following appears:
{"sla-id":1, "result":"https://host/api/v1/ip-sla/1"},
{"sla-id":21, "result":https://host/api/v1/ip-sla/21"},
{"sla-id":20, "result":https://host/api/v1/ip-sla/20"}
JSON Response Showing Some Failed Batch Operations
In the body of the response, the following or similar appears:
{"sla-id":1, "result":"https://host/api/v1/ip-sla/1"},
{"sla-id":21, "result":"https://host/api/v1/ip-sla/21"},
{"sla-id":20, "result":"<reason for failure>"}
Modifying IP-SLA Entries
PUT operations for modifying IP-SLA entries are similar to the POST batch operations described earlier in this section.
Successful completion of the batch operation results in the following response:
If some operations fail, the response is the following, with details described in the body of the response:
Example
JSON Request
DELETE /api/v1/ip-sla/batch
Content-Type: application/json
"number-of-items":"number",
"item-list":[{"sla-id":"number"}]
JSON Response Showing Successful Completion of the Batch Operations
JSON Response Showing Some Failed Batch Operations
In the body of the response, the following or similar appears:
{"sla-id":1, "result" :"ok"},
{"sla-id":21, "result":"ok"},
{"sla-id":20, "result":"ip sla not found"}