Description
The addConnectTest operation handles configuration related to ConnectTest model.
HTTP request
POST /api/fdm/v6/action/connecttest
Data Parameters
Parameter | Required | Type | Description | |||
---|---|---|---|---|---|---|
destination | True | string | An optional string that specifies the destination to test. The default is www.cisco.com. You can enter an IPv4 address or a fully-qualified domain name. Field level constraints: cannot be null, must be a valid host (FQDN or IP) or a list of valid hosts. (Note: Additional constraints might exist) |
|||
connected | False | boolean | A boolean value, TRUE or FALSE (the default). The TRUE value specifies that the connection is established. FALSE indicates the connection is not established. | |||
msg | False | string | A string representing the message when the connection fails. | |||
interface | False | object | An interface object through which connectivity to a specific destination would be tested. Allowed types are: [BridgeGroupInterface, EtherChannelInterface, PhysicalInterface, SubInterface, VirtualTunnelInterface, VlanInterface] |
|||
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 '{
"connected": true,
"destination": "string",
"id": "string",
"interface": {
"id": "string",
"name": "string",
"type": "string",
"version": "string"
},
"msg": "string",
"type": "ConnectTest"
}' \
"https://${HOST}:${PORT}/api/fdm/v6/action/connecttest"
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_connect_test(client, body):
return client.ConnectTest.addConnectTest(
body=body
).response().result
if __name__ == "__main__":
host = "ftd.example.com"
token = "access_token"
client = get_client(host, token)
body = {'connected': True,
'destination': 'string',
'interface': {'id': 'string',
'name': 'string',
'type': 'string',
'version': 'string'},
'msg': 'string',
'type': 'ConnectTest'}
add_connect_test(client, body)