Add IP addresses to the user's subscription. Once added they are available for scanning and reporting.
Permissions - A Manager has permissions to add IP addresses. A Unit Manager can add IP addresses when the “Add assets” permission is enabled in their account. Users with other roles (Scanner, Reader, Auditor) do not have permissions to add IP addresses.
Parameter |
Required/Optional |
Data Type |
Description |
---|---|---|---|
action=add |
Required | String |
Specify action=add to add new IPs |
echo_request={0|1} |
Optional | Integer |
Specify 1 to view (echo) input parameters in the XML output. By default these are not included. |
enable_vm={0|1} | Required | Integer |
Specify 1 to add IP addresses to the user's account assigned to the VM module. Specifying this parameter is supported only when the VM module is enabled for the user account. |
enable_pc={0|1} | Required | Integer |
Specify 1 to add IP addresses to the user's account assigned to the PC module. Specifying this parameter is supported only when the PC module is enabled for the user account. |
enable_sca={0|1} | Required | Integer |
Specify 1 to add IP addresses to the user's account assigned to the SCA module. Specifying this parameter is supported only when the SCA module is enabled for the user account. |
ips={value} -or- POSTed CSV raw data} |
Required | Integer/ File |
The hosts you want to add to the subscription. IPs must be specified by using the “ips” parameter (using the POST method) or by uploading CSV raw data (using the POST method). To upload CSV raw data, specify --data-binary <data>. How to specify IP addresses. One or more IPs/ranges may be specified. Multiple IPs/ranges are comma separated. An IP range is specified with a hyphen (for example, 10.10.30.1-10.10.30.50). CIDR notation is supported. |
tracking_method={value} |
Optional | String |
The tracking method is set to IP for IP address by default. To use another tracking method specify DNS or NETBIOS. |
enable_vm={0|1} enable_pc={0|1} |
Required | Integer |
You must enable the hosts for the VM application (enable_vm=1) or the PC application (enable_pc=1) or both VM and PC. |
owner={value} |
Optional | String |
The owner of the host asset(s). The owner must be a Manager or a Unit Manager. A valid Unit Manager must have the “Add assets” permission and sufficient remaining IPs (maximum number of IPs that can be added to the Unit Manager’s business unit). |
ud1={value} ud2={value} ud3={value} |
Optional | Integer |
Values for user-defined fields 1, 2 and 3. You can specify a maximum of 128 characters (ascii) for each field value. |
comment={value} |
Optional | String |
User-defined comments. |
ag_title={value} |
Required if the request is being made by a Unit Manager; otherwise invalid | String |
The title of an asset group in the Unit Manager’s business unit that the host(s) will be added to. |
enable_certview={0|1} |
Optional | Integer |
Set to 1 to add IPs to your CertView license. By default IPs are not added to your CertView license. This option will be supported when CertView GA is released and is enabled for your account. |
API Request
curl -H "X-Requested-With: Curl" -H "Content-Type:text/csv"-u "USERNAME:PASSWORD" --data-binary @ips_list.csv"https://<qualys_base_url>/api/2.0/fo/asset/ip/?action=add&enable_vm=1&enable_pc=1&tracking_method=IP&owner=quays_es1"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2018-08-07T01:21:03Z</DATETIME>
<TEXT>IPs successfully added to Vulnerability Management/Compliance Management</TEXT>
</RESPONSE>
</SIMPLE_RETURN>
API Request
curl -H "X-Requested-With: demo" -u "USERNAME:PASSWORD" -X "POST"-d "action=add&enable_vm=1&enable_pc=1&ips=10.10.10.1,10.10.10.10-10.10.10.20,10.10.10.200" "https://<qualys_base_url>/api/2.0/fo/asset/ip/"
<platform API server>/api/2.0/simple_return.dtd