API to Add a New Config to Connector
This endpoint adds a new config to the Connector with given ID
POST /openapi/v1/connectors/<id>/config
where <id> is the id that can be obtained from the API to Get Connectors. <config_type> is the "valid_config" that can be obtained from API to Get Appliance Schema. To obtain <config> schema, select one of the "config" from API to Get All Types of Connectors response, apply the "config" to API to Get the Schema of Config.
Parameters: The request URL contains the following parameters
Name |
Type |
Description |
---|---|---|
name |
string |
Specify the config name |
type |
string |
Specify the config type. Refer to API to Get the Schema of Config for all possible values listed under Description |
config |
set |
Provide the filled config schema in JSON format |
Response object: Returns the updated config.
Sample response
req_payload = {
"name": "Log instance 2/1/23 22:29",
"type": "LOG",
"config": {
"secured": {},
"unsecured": {
"log-level": "info",
"max-log-size": 10,
"max-log-age": 30,
"max-log-backups": 20
}
}
}
resp = restclient.post('/connectors/63db5418e6ee1167a4c0986c/config', json_body=json.dumps(req_payload))
if resp.status_code == 200:
parsed_resp = json.loads(resp.content)
print json.dumps(parsed_resp)
Sample response
{
"mode": "TEST_AND_APPLY",
"name": "Log instance 2/1/23 11:29",
"root_scope_id": "63d98f45497d4f53005b24fa",
"vrf_id": 1,
"appliance_id": "63dad690e6ee1131f255e985",
"connector_id": "63db5418e6ee1167a4c0986c",
"deleted": false,
"type": "LOG",
"state": "PENDING",
"attempts": 0,
"config": {
"secured": {},
"unsecured": {
"log-level": "info",
"max-log-size": 10,
"max-log-age": 30,
"max-log-backups": 20
}
},
"push_to_dio_at": 0,
"created_at": 1675322272,
"updated_at": 1675322272,
"discovery_completed_at": 0,
"committed_at": 0,
"delete_at": 0,
"error_at": 0,
"hidden": false,
"discovery_phase": 0,
"internal": false,
"id": "63db63a0f029813659f9fcf7"
}