POST /asset_model/assets

Creates a new asset. An asset contains the following fields:

  • interfaces - Array - The interfaces on this asset, only one interface is accepted.
    • mac_address - String - The MAC address of this interface.
    • ip_address - Array - Interface is allowed a maximum of two IP addresses, whether IPv4 or IPv6, with no provision for more than two addresses.value - String - The IP address for this asset is required. At least one valid IP address must be configured.
  • domain_name - String - The domain name on this asset.
  • products - Array - The products on this asset. Each asset must have at least one value specified for the product name, vendor, and version.
    • name - String - Product name of this asset.
    • version - String - Product version of this asset.
    • vendor - String - Product vendor of this asset.
  • hostnames - Array - The hostnames on this asset. Asset may be assigned no more than two hostnames.
    • name - String - Name of hostname on this asset. The hostname for each asset must be limited to a maximum of 255 characters.
    • type - String - Type of hostname on this asset. Type must be either DNS or NETBIOS and can be added once.
  • properties - Array - The property on this asset.
    • name - String - Name of property on this asset.
    • value - String - Value of property on this asset.
Table 1. POST /asset_model/assets resource details
MIME Type

application/json

Table 2. POST /asset_model/assets request body details
Parameter Data Type MIME Type Description Sample

asset

JSON

application/json

null

{ "interfaces": [ { "mac_address": "mac address", "ip_addresses": [ { "value": "1.1.1.1" }, { "value": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" } ] } ], "domain_name": "domainname", "properties": [ { "name": "property name", "value": "property value" } ], "hostnames": [ { "name": "hostname", "type": "DNS" }, { "name": "hostname", "type": "NETBIOS" } ], "products": [ { "vendor": "Microsoft", "name": "Windows 95", "version": "0.0.0" } ] }

Table 3. POST /asset_model/assets response codes
HTTP Response Code Unique Code Description

201

A new asset is successfully created with asset id.

200

An asset is reconciled with existing asset id.

409

1001

No domain exists with the specified name.

409

1002

Hostname size should not be greater than 255 characters.

409

1003

Hostname value can either be DNS or NETBIOS and can be added once.

409

1004

Hostname type should not be the same.

409

1005

Expected at least one value from product, version or vendor.

409

1006

Only one product is accepted.

409

1007

Property 'name' should not be null or empty.

409

1008

Property 'value' should not be null or empty.

409

1009

No property exists with the specified name.

422

1010

Invalid IP address format.

422

1011

IPv6 link local is not allowed.

422

1012

MAC address format is not correct.

422

1013

Field cannot be null or empty.

422

1014

Only one interface is accepted.

422

1015

Maximum two IPs are accepted.

Response Description

The newly created asset.

Response Sample


{
    "domain_id": 42,
    "domain_name": "String",
    "hostnames": [
        {
            "created": 42,
            "first_seen_profiler": 42,
            "first_seen_scanner": 42,
            "id": 42,
            "last_seen_profiler": 42,
            "last_seen_scanner": 42,
            "name": "String",
            "type": "String <one of: DNS, NETBIOS, NETBIOSGROUP>"
        }
    ],
    "id": 42,
    "interfaces": [
        {
            "created": 42,
            "first_seen_profiler": 42,
            "first_seen_scanner": 42,
            "id": 42,
            "ip_addresses": [
                {
                    "created": 42,
                    "first_seen_profiler": 42,
                    "first_seen_scanner": 42,
                    "id": 42,
                    "last_seen_profiler": 42,
                    "last_seen_scanner": 42,
                    "network_id": 42,
                    "type": "String",
                    "value": "String"
                }
            ],
            "last_seen_profiler": 42,
            "last_seen_scanner": 42,
            "mac_address": "String"
        }
    ],
    "products": [
        {
            "first_seen_profiler": 42,
            "first_seen_scanner": 42,
            "id": 42,
            "last_scanned_for": 42,
            "last_seen_profiler": 42,
            "last_seen_scanner": 42,
            "name": "String",
            "product_variant_id": 42,
            "vendor": "String",
            "version": "String"
        }
    ],
    "properties": [
        {
            "id": 42,
            "last_reported": 42,
            "last_reported_by": "String",
            "name": "String",
            "type_id": 42,
            "value": "String"
        }
    ],
    "risk_score_sum": 42.5,
    "users": [
        {
            "first_seen_profiler": 42,
            "first_seen_scanner": 42,
            "id": 42,
            "last_seen_profiler": 42,
            "last_seen_scanner": 42,
            "username": "String"
        }
    ],
    "vulnerability_count": 42
}