Create Asset IP

Creates a new asset IP address.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

POST /api/sonar/ip-addresses
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=high \
     -X POST \
     https://HOSTNAME/api/sonar/ip-addresses
Request Parameters
KeyRequiredTypeDescriptionNote
guidXStringIP address GUID36-character GUID. Randomly generated if not set
ipOStringIP address
site_guidXStringSite GUID36 characters
category_guidXStringCategory GUID36 characters
descriptionXStringDescriptionMaximum 2000 characters
emp_guidXStringPrimary contact GUID36 characters
emp_guid2XStringSecondary contact GUID36 characters
hostnameXStringHostnameMaximum 255 characters
os_nameXStringOS nameMaximum 50 characters
os_verXStringOS versionMaximum 20 characters
workgroupXStringWorkgroupMaximum 255 characters
locationXStringLocationMaximum 255 characters
macXStringMAC address
installedXStringInstallation dateyyyy-MM-dd'T'HH:mm:ss.SSSX format
scoring_typeOStringScoring typepriority or cia
priorityXStringPriorityRequired when scoring_type is priority. One of low, medium, high
confidentialityXStringConfidentialityRequired when scoring_type is cia. One of low, medium, high
integrityXStringIntegrityRequired when scoring_type is cia. One of low, medium, high
availabilityXStringAvailabilityRequired when scoring_type is cia. One of low, medium, high

Success Response

{}

Error Responses

Required argument is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "ip 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'."
}
Invalid priority value

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'priority' should be one of 'low', 'medium', 'high'."
}
Invalid CIA value

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'confidentiality' should be one of 'low', 'medium', 'high'."
}
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": "duplicate ip address: 192.168.1.100"
}
No permission

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}