Create Address Object
Creates a new address object for a specified address group.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
POST /api/sonar/address-groups/:guid/addresses
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d address=8.8.8.8 \
-d description="Public DNS" \
-X POST \
https://HOSTNAME/api/sonar/address-groups/4dc14f3d-ebf8-4032-8a7a-ef9ec6cd3dd2/addresses
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| guid | O | String | Address group GUID | 36 characters |
| address | O | String | IP address | |
| description | X | String | Description | Maximimum 255 characters |
| period | X | 32-bit integer | Retention period in days | Minimum 1 to maximum 52,560,000 |
Success Response
{}
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "address should be not null"
}
Invalid argument length
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'description' must be shorter than or equal to 255 characters."
}
Identifier is not in valid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
Invalid IP address
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "address should be valid IPv4 address: 256.255.255.255"
}
Retention period value is less than 1
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'period' must be greater than or equal to 1."
}
Retention period value is greater than 52,560,000
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'period' must be less than or equal to 52560000."
}
Address group is not found
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "address group not found: ede06992-dd57-4b79-8c54-a295f33d8613"
}
No privilege to create an address group
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}