Description

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

HTTP request

POST /api/fdm/v6/object/timeranges

Data Parameters

Parameter Required Type Description
name True string The name of the object.
description False string An optional description of the object.
Field level constraints: length must be between 0 and 200 (inclusive), must match pattern ^((?!;).)*$. (Note: Additional constraints might exist)
effectiveStartDateTime False string Optional Field.If Specified, defines the date and time on which the time range should become effective. Prior to date and time, the time range object will not be effective, and any policy in which you use the object will act as if there are no time period restrictions. Specify the date and time in YYYY-MM-DDTHH:MM format.To indicate that the time range should start immediately,don't pass the field.
Field level constraints: must match pattern ^((?!;).)*$. (Note: Additional constraints might exist)
effectiveEndDateTime False string Optional Field.The date and time on which the time range should no longer apply. After this date and time passes, the time range object will not be effective, and any policy in which you use the object will henceforth act as if there are no time period restrictions. Specify the date and time in YYYY-MM-DDTHH:MM format.To indicate that the time range should should never end,don't pass the field.
Field level constraints: must match pattern ^((?!;).)*$. (Note: Additional constraints might exist)
recurrenceList False [object] list of mutliple recurring Interval Object of type DAILY_INTERVAL Or RANGE
timeRangeObjectId False integer A unique Id assigned to each TimeRangeObject
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",
        "effectiveEndDateTime": "string",
        "effectiveStartDateTime": "string",
        "id": "string",
        "name": "string",
        "recurrenceList": [],
        "timeRangeObjectId": 0,
        "type": "timerangeobject",
        "version": "string"
    }' \
    "https://${HOST}:${PORT}/api/fdm/v6/object/timeranges"
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_time_range_object(client, body):
    return client.TimeRange.addTimeRangeObject(
        body=body
    ).response().result


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

    body = {'description': 'string',
 'effectiveEndDateTime': 'string',
 'effectiveStartDateTime': 'string',
 'name': 'string',
 'recurrenceList': [],
 'timeRangeObjectId': 0,
 'type': 'timerangeobject'}

    add_time_range_object(client, body)