Description

The addCommand operation handles configuration related to Command model. 

HTTP request

POST /api/fdm/v6/action/command

Data Parameters

Parameter Required Type Description
commandInput True string A mandatory utf-8 string, maximum of 1024 characters, specifying the input command that needs to be executed on the device.
Field level constraints: cannot be blank or empty, length must be between 0 and 1024 (inclusive). (Note: Additional constraints might exist)
commandOutput False string A utf-8 string specifying the output of the command executed.
timeOut False integer An optional long numeric value specifying the time in milliseconds. It specifies the maximum time within which the command executes.
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 '{
        "commandInput": "string",
        "commandOutput": "string",
        "id": "string",
        "timeOut": 0,
        "type": "Command"
    }' \
    "https://${HOST}:${PORT}/api/fdm/v6/action/command"
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_command(client, body):
    return client.Command.addCommand(
        body=body
    ).response().result


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

    body = {'commandInput': 'string',
 'commandOutput': 'string',
 'timeOut': 0,
 'type': 'Command'}

    add_command(client, body)