Add/Edit a device

Adds a device to AFA, or edits the device configuration for a device already managed by AFA.

Resource details

Resource Name:

/api/v1/devices/

Request Methods:

  • POST - adds a device
  • PUT - edits a device

Request URL Parameters:

Parameter

Required

Type

Description

body

Mandatory

String

Data in JSON format that specifies the values for all parameters applicable to the brand of the added or edited device.

For more details, see Request parameters by brand.

addChildren

Optional

Boolean

True - managed devices are automatically added. (Default)

False - managed devices are not added unless specified explicitly.

testMode

Optional

Boolean

True - used as a test run without actually adding or editing the device specified. Returns all parameters that would have been sent by the request.

False (default) - performs the actual request.

Response:

Code

Description

200

Operation completed successfully

400

Bad request, with one of the following error messages:

  • ALREADY_EXISTS. Specified device not found in AFA.
  • SCHEME_ERROR. Failed to load the device schema.
  • Validation Error. API values are not valid according to the device schema.
  • Not Found. Relevant when editing a device configuration, if the specified device is not found in AFA.

401

Unauthorized

403

Non-admin user

Request example - edit device

curl --location --request PUT 'https://docker:7443/afa/api/v1/devices/' \ --header 'Content-Type: application/json' \ --header 'Accept: */*' \ --header 'Cookie: PHPSESSID=r9psihhnjebng2oovhv268odh1' \ --data-raw '{ "display_name": "myUpdatedNSC", "name": "fw_10_20_13_1", "host_name": "10.20.13.1", "user_name": "admin", "passwd": "algosec", "collector": "Central Manager", "baseline_profile": "JuniperNetscreenProfile", "vrouters": "yes", "con": "SSH", "ssh_port": "", "log_collection_mode": "extensive", "collect_log": "yes", "collect_log_from": "nsm", "log_host_name": "10.0.0.2", "log_user_name": "root", "log_passwd": "algosec", "collect_log_from_adt": "nsm", "log_host_name_adt": "10.0.0.1", "log_user_name_adt": "root", "log_passwd_adt": "algosec", "additional_fw_ids": "1.1.1.1:2.2.2.2:ServerName", "log_collection_frequency": "20", "active_change": "yes", "monitoring": "no", "set_user_permissions": "no", "password_fields": "passwd:log_passwd:log_passwd_adt", "FW_TYPE": "FW_NSC" }'

Response example - edit device

{
				"httpStatus": "200",
				"message": "Successfully modified \"myUpdatedNSC\"",
				"LogData": "",
				"fw_name": "fw_10_20_13_1",
				"syslog_restart_needed": false,
				"not_supported_audit_from_clm": false,
				"set_user_permissions": false
			}

Back to top

Request parameters by brand

The following tables list the parameters valid for each brand recognized by AFA. In the tables, click each parameter name to jump to more details.

Request parameters for device from file

The following table lists parameters for devices created from file.

Device parameter details

The following table lists all the parameters used by /api/v1/devices/ GET, POST and PUT methods. All of the listed values are formatted as Strings, unless otherwise indicated.

Back to top