Update Asset IP
Updates the specified asset IP address.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
PUT /api/sonar/ip-addresses/:guid
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d ip="192.168.1.100" \
-d hostname="server01" \
-d description="Web server" \
-d scoring_type="priority" \
-d priority=2 \
-X PUT \
https://HOSTNAME/api/sonar/ip-addresses/f47ac10b-58cc-4372-a567-0e02b2c3d479
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| guid | O | String | IP address GUID | 36 characters |
| ip | O | String | IP address | |
| site_guid | X | String | Site GUID | 36 characters |
| category_guid | X | String | Category GUID | 36 characters |
| description | X | String | Description | Maximum 2000 characters |
| emp_guid | X | String | Primary contact GUID | 36 characters |
| emp_guid2 | X | String | Secondary contact GUID | 36 characters |
| hostname | X | String | Hostname | Maximum 255 characters |
| os_name | X | String | OS name | Maximum 50 characters |
| os_ver | X | String | OS version | Maximum 20 characters |
| workgroup | X | String | Workgroup | Maximum 255 characters |
| location | X | String | Location | Maximum 255 characters |
| mac | X | String | MAC address | |
| installed | X | String | Installation date | yyyy-MM-dd HH:mm:ssZ format |
| scoring_type | O | String | Scoring type | priority or cia |
| priority | X | Integer | Priority | Required when scoring_type is priority (1~3) |
| confidentiality | X | Integer | Confidentiality | Required when scoring_type is cia (1~3) |
| integrity | X | Integer | Integrity | Required when scoring_type is cia (1~3) |
| availability | X | Integer | Availability | Required when scoring_type is cia (1~3) |
Success Response
{}
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "guid should be not null"
}
Invalid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
CIA values included when scoring_type is priority
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'confidentiality', 'integrity', 'availability' must not be set when type is 'priority'."
}
Priority value included when scoring_type is cia
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'priority' must not be set when type is 'cia'."
}
Priority value out of range
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'priority' must be between 1 and 3."
}
CIA value out of range
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'confidentiality' must be between 1 and 3."
}
Unsupported scoring_type
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "unsupported type: ABC"
}
Duplicate IP address
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "duplicated ip: 192.168.10.211"
}
IP address not found
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "ip address not found"
}
No permission
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}