List IPs

GET POST/api/2.0/fo/asset/ip/?action=list

List IP addresses in the user account. By default, all hosts in the user account are included. Optional input parameters support filtering the list by IP addresses and host tracking method.

Permissions - Managers and Auditors view all assets in the subscription, Unit Managers view assets in their own business unit, Scanners and Readers view assets in their own account.

Express Lite - This API is available to Express Lite users.

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

action=list

Required String

Specify action=list to get IPs

echo_request={0|1}

Optional Integer 

Specify 1 to view (echo) input parameters in the XML output. By default these are not included.

ips={value}

Optional Integer 

Show only certain IP addresses/ranges. One or more IPs/ranges may be specified. Multiple entries are comma separated. A host IP range is specified with a hyphen (for example, 10.10.10.44-10.10.10.90).

network_id={value}

Optional, and valid only when the Network Support feature is enabled for the user’s account String 

A non-Manager user can use this parameter to restrict the request to IP addresses in a certain custom network ID. For a Manager user, the output will be the same regardless of the network_id specified in the request because all IPs are part of all networks automatically and Managers have access to all IPs in all networks. Specify network_id along with tracking_method to filter the results.

tracking_method={value}

Optional String 

Show only IP addresses/ranges which have a certain tracking method. A valid value is: IP, DNS, or NETBIOS.

compliance_enabled={0|1}

Optional and valid only when the policy compliance module is enabled for the user account Integer

Specify 1 to list compliance IP addresses in the user’s account. These hosts in the user's the policy compliance module license.

Specify 0 to list hosts which are not compliance IP addresses.

certview_enabled={0|1}

Optional Integer 

Set to 1 to list IP addresses in the user’s account assigned to the Certificate View module. Specify 0 to list IPs that are not assigned to the Certificate View module. Note - This option will be supported when Certificate View GA is released and is enabled for your account.

Filter the Output by ModuleFilter the Output by Module

Only interested in seeing IP addresses for VM, PC or CertView? Your request must include the compliance_enabled and certview_enabled parameters as described below.

To return only VM IP addresses, specify compliance_enabled=0 and certview_enabled=0.

To return only PC IP addresses, specify compliance_enabled=1 and certview_enabled=0.

To return only CertView IP addresses, specify compliance_enabled=0 and certview_enabled=1.

To return both PC and CertView IP addresses, specify compliance_enabled=1 and certview_enabled=1.

Sample - List Host IPsSample - List Host IPs

API Request

curl -H "X-Requested-With: Curl Sample" -b "QualysSession=71e6cda2a35d2cd404cddaf305ea0208; path=/api; secure" "https://<qualys_base_url>/api/2.0/fo/asset/ip/?action=list"

XML Output

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE IP_LIST_OUTPUT SYSTEM
"https://<qualys_base_url>/api/2.0/fo/asset/ip/
ip_list_output.dtd">
<IP_LIST_OUTPUT>
  <RESPONSE>
    <DATETIME>2018-05-21T13:32:17Z</DATETIME>
    <IP_SET>
      <IP>123.123.45.0</IP>
      <IP_RANGE>123.124.45.0-123.124.45.255</IP_RANGE>
      <IP_RANGE>123.124.46.0-123.124.46.255</IP_RANGE>
      <IP_RANGE>123.124.47.0-123.124.47.255</IP_RANGE>
      <IP_RANGE>123.124.48.0-123.124.48.255</IP_RANGE>
    </IP_SET>
  </RESPONSE>
</IP_LIST_OUTPUT>

DTD

<platform API server>/api/2.0/fo/asset/ip/ip_list_output.dtd