Description

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

HTTP request

POST /api/fdm/v6/object/urls

Data Parameters

Parameter Required Type Description
name True string An string represents the name of URL object
description False string An string containing the description information of URL object
Field level constraints: length must be between 0 and 200 (inclusive). (Note: Additional constraints might exist)
url True string An string value containing the URL address
Field level constraints: cannot be blank or empty, length must be between 0 and 400 (inclusive). (Note: Additional constraints might exist)
type True string A UTF8 string, all letters lower-case, that represents the class-type. This corresponds to the class name.

Example

curl -X POST \
    --header "Accept: application/json" \
    --header "Authorization: Bearer ${ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    -d '{
        "description": "string",
        "id": "string",
        "name": "string",
        "type": "urlobject",
        "url": "string",
        "version": "string"
    }' \
    "https://${HOST}:${PORT}/api/fdm/v6/object/urls"
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_url_object(client, body):
    return client.URLObject.addURLObject(
        body=body
    ).response().result


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

    body = {'description': 'string',
 'name': 'string',
 'type': 'urlobject',
 'url': 'string'}

    add_url_object(client, body)