Description

The addSLAMonitor operation handles configuration related to SLAMonitor model. 
This API call is not allowed on the standby unit in an HA pair.

HTTP request

POST /api/fdm/v6/object/slamonitors

Data Parameters

Parameter Required Type Description
name True string The name of the SLA Monitor.
description False string An optional description of the SLA Monitor object
Field level constraints: length must be between 0 and 200 (inclusive). (Note: Additional constraints might exist)
monitoredAddress True object The IP address to be monitored to determine if the route is functional. The address is typically the gateway address for the route, but it can be another always-on server on that network, such as a syslog or AAA server.
Field level constraints: cannot be null. (Note: Additional constraints might exist)
Allowed types are: [NetworkObject]
targetInterface True object The name of the interface through which to send the echo request packets. The interface source address is used as the source address in the echo request packets.
Field level constraints: cannot be null. (Note: Additional constraints might exist)
Allowed types are: [EtherChannelInterface, PhysicalInterface, SubInterface, VirtualTunnelInterface, VlanInterface]
slaOperation True object A collection of the attribute-value pairs for an IpIcmpEcho object, which defines the operational properties for this SLA Monitor.
Field level constraints: cannot be null. (Note: Additional constraints might exist)
type True string An required enum that specifies the type of the SLA Monitor object. The only type is slamonitor

Example

curl -X POST \
    --header "Accept: application/json" \
    --header "Authorization: Bearer ${ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    -d '{
        "description": "string",
        "id": "string",
        "monitoredAddress": {
            "id": "string",
            "name": "string",
            "type": "string",
            "version": "string"
        },
        "name": "string",
        "slaOperation": {
            "type": "slaoperation"
        },
        "targetInterface": {
            "id": "string",
            "name": "string",
            "type": "string",
            "version": "string"
        },
        "type": "slamonitor",
        "version": "string"
    }' \
    "https://${HOST}:${PORT}/api/fdm/v6/object/slamonitors"
from bravado.requests_client import RequestsClient
from bravado.client import SwaggerClient


def get_client(host, token):
    http_client = RequestsClient()
    http_client.ssl_verify = False
    http_client.set_api_key(
        host,
        "Bearer {}".format(token),
        param_name="Authorization",
        param_in="header"
    )
    return SwaggerClient.from_url(
        "https://{}/apispec/ngfw.json".format(host),
        http_client=http_client,
        config={
            "validate_responses": False,
            "validate_swagger_spec": False
        }
    )


def add_sla_monitor(client, body):
    return client.SLAMonitor.addSLAMonitor(
        body=body
    ).response().result


if __name__ == "__main__":
    host = "ftd.example.com"
    token = "access_token"
    client = get_client(host, token)

    body = {'description': 'string',
 'monitoredAddress': {'id': 'string',
                      'name': 'string',
                      'type': 'string',
                      'version': 'string'},
 'name': 'string',
 'slaOperation': {'type': 'slaoperation'},
 'targetInterface': {'id': 'string',
                     'name': 'string',
                     'type': 'string',
                     'version': 'string'},
 'type': 'slamonitor'}

    add_sla_monitor(client, body)