Use these APIs to manage VLANs (set, remove) on scanner appliances. Your account must have the VLANs and static routes feature enabled.
Use the "set_vlans" parameter to set one or more VLANs. The format for a single VLAN is
<VLAN_ID> | <IPv4_ADDRESS> | <NETMASK> | <VLAN_NAME> | ipv6_static or ipv6_auto | <IPv6_ADDRESS> with pipe (|) used as a delimiter.
To skip IPv4 attributes (IPv4 address and netmask), you must include an empty space in place of each attribute. Multiple VLANs can be assigned using a comma separated list.
Attribute |
Description |
---|---|
<VLAN_ID> |
Customer-defined ID (not assigned by Qualys). Must be in the range 0 to 4096, inclusive. |
<IPv4_ADDRESS> |
A valid IPv4 IP address (dotted quad), such as 10.10.10.1. Leave empty when specifying an IPv6 address. |
<NETMASK> |
A valid network mask (dotted quad), such as 255.255.255.0. eave empty when specifying an IPv6 address. |
<VLAN_NAME> |
A valid name (can be empty). The name can be a maximum of 256 ASCII characters. The character : (colon) is permitted. These characters are not permitted: , (comma), < (less than), > (greater than), " (double quote), & (ampersand), | (pipe), = (equals). |
ipv6_static or ipv6_auto |
Specify ipv6_static to provide a static IPv6 address. Specify ipv6_auto to auto-configure IPv6 using SLAAC on the VLAN. |
<IPv6_ADDRESS> |
A valid IPv6 address is required when “ipv6_static” is specified, such as fdd1:0:1:107::500. Leave empty when “ipv6_auto” is specified. |
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_vlans=1234|||Name1234|ipv6_static|fdd1:0:1:109::500" "https://<qualys_base_url>/api/2.0/fo/appliance/"
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_vlans=5678|123.123.123.123|255.255.255.255|Name5678" "https://<qualys_base_url>/api/2.0/fo/appliance/"
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_vlans=1234|||Name1234|ipv6_static|fdd1:0:1:108::500,5678|123.123.123.123|255.255.255.255|Name5678,9012|244.244.244.244|255.255.255.0|Name9012|ipv6_auto,3456|12.12.12.12|255.255.255.0|Name3456|ipv6_static|fdd1:0:1:107::500" "https://<qualys_base_url>/api/2.0/fo/appliance/"
XML Output
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE SIMPLE_RETURN SYSTEM "https://https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
<RESPONSE>
<DATETIME>2018-07-20T11:45:03Z</DATETIME>
<TEXT>Virtual scanner updated successfully</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>126209</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
Set VLANs on physical scanner appliances in the same way a virtual scanner appliances. The only difference is the URL endpoint.
API Request
curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d "action=update&id=126209&set_vlans=1234|||Name1234|ipv6_static|fdd1:0:1:109::500" "https://<qualys_base_url>/api/2.0/fo/appliance/physical"
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-07-20T11:58:06Z</DATETIME>
<TEXT>Physical scanner updated successfully</TEXT>
<ITEM_LIST>
<ITEM>
<KEY>ID</KEY>
<VALUE>126209</VALUE>
</ITEM>
</ITEM_LIST>
</RESPONSE>
</SIMPLE_RETURN>
Use the "set_vlans" parameter and set it to " (empty string).
API Request
curl -u "USERNAME:PASSWD" -H "X-Requested-With: -d "id=43463&set_vlans=""https://<qualys_base_url>/api/2.0/fo/appliance/?action=update"
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-05-10T08:49:18Z</DATETIME>
<TEXT>Virtual scanner updated successfully</TEXT>
...
<platform API server>/api/2.0/simple_return.dtd