Creating an IP address list
IP address lists are created in two phases: first create the IP Address List element, then upload the content to the IP Address List element.
After logon, create an IP Address List element with the following request:
POST http://localhost:8082/7.1/elements/ip_list
Request body:
{
"name": "myIpList1",
"comment": "My SMC API's my IP Address List 1"
}
The request returns a 201 HTTP response status code and the following in the Location HTTP header:
http://localhost:8082/7.1/elements/ip_list/1704
Upload the content for the created IP Address List element with the following request:
POST http://localhost:8082/7.1/elements/ip_list/1704/ip_address_list
Request body:
{
"ip":
[
"1.2.3.4",
"10.0.0.0/8",
"192.168.0.0-192.168.255.255"
]
}
On success, the request returns HTTP response status code 202.
You can modify the content of the IP Address List element by uploading new content for an existing IP Address List element. The existing content is overwritten by the content in the request.
To read the content of the IP Address List element, call GET to the same URI as above:
GET http://localhost:8082/7.1/elements/ip_list/1704/ip_address_list
On success, the response code is 200 and the content is provided in an identical format to the content upload above:
{
"ip":
[
"1.2.3.4",
"10.0.0.0/8",
"192.168.0.0-192.168.255.255"
]
}
See createIpAddressListModifyAndDeleteIt.py
JSON and XML samples.