Create Response Target
Creates a new response target configuration. You can change an existing configuration with the Update Response Target API.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
POST /api/sonar/response-targets
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d name="Firewall response target" \
-d description="Blocks attacker IPs on the perimeter firewall" \
-d model_type="bluemax-ngf" \
-d profile_guid="66666666-7777-8888-9999-000000000000" \
-d 'configs={}' \
-d ip_blacklist_guid="4dc14f3d-ebf8-4032-8a7a-ef9ec6cd3dd2" \
-X POST \
https://HOSTNAME/api/sonar/response-targets
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| name | Yes | String | Response target name | Minimum 1, maximum 50 characters |
| description | No | String | Description | Maximum 2,000 characters |
| model_type | Yes | String | Response model type code | Value provided by an installed app that supports response targets |
| profile_guid | Yes | String | Connect profile GUID | 36-character GUID |
| configs | Yes | String key/value | Model-specific configuration values | JSON object |
| ip_blacklist_guid | Yes | String | Address group GUID to register the blocked IP addresses in | 36-character GUID |
Tip
To find the configs items required for a model_type, select the response model on the New Response Target screen under Settings > Response Targets in the web console.
Success Response
{
"guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
- guid (String): GUID of the created response target configuration
Error Responses
Required parameter is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "name should be not null"
}
name value length is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'name' must be shorter than or equal to 50 characters."
}
Response model is not found
HTTP status code 500
{
"error_code": "response-model-not-found",
"error_msg": null
}
Address group does not exist
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "address group not found: 4dc14f3d-ebf8-4032-8a7a-ef9ec6cd3dd2"
}
Connect profile does not exist
HTTP status code 500
{
"error_code": "profile-not-found",
"error_msg": null
}
Response target name already exists
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "duplicated response target name: Firewall response target"
}
configs value is too large
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "too long response target configs (> 65535)"
}
No permission
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}