Add URLs to a specified URL Category
Note: Before you use this API, make sure to create the URL Categories override file by copying the file /usr/share/fa/data/plugins/panorama/url_categories.json to this location: /home/afa/.fa/plugins/panorama/.
-
Login as afa user.
(rw-r--r-- permissions are required for the url_categories.json file (644)). -
Run:
mkdir /home/afa/.fa/plugins/panorama/
-
Run:
cp /usr/share/fa/data/plugins/panorama/url_categories.json /home/afa/.fa/plugins/panorama/
-
Run:
chmod 644 /home/afa/.fa/plugins/panorama/url_categories.json
Add URLs to a specified URL Category in the URL Categories override file. Currently only Panorama devices are supported. Use the PAN URL Category Resource Group GET /{category} method to return the list of available URL Categories.
For further information about the URL Categories override file see (optional) Enhance URL Category accuracy.
Resource Name:
Request Method: PUT
Request URL Parameters:
Element |
Type |
Description |
---|---|---|
brand Mandatory |
string |
Brand name code. Only "panorama" is supported. |
category
|
string | Specified URL Category to add URLs to. |
Request Body Parameters:
Element |
Type |
Description |
---|---|---|
body
Mandatory |
string |
A JSON list of URL(s) to be added to the URL Category (including representative IPs). For example: Copy
|
Response parameters
Element |
Type |
Description |
---|---|---|
categories | map of objects |
The list of URL Categories after URLs have been added, each populated by:
|
Response:
Status codes:
Code |
Description |
---|---|
200 |
ActiveChange was triggered |
400 |
Input validation failure |
403 |
Authentication failure |
500 |
Failed to complete operation. |
Request cURL examples
curl -X PUT "https://localhost/afa/api/v1/plugins/panorama/URLCategory/search-engines/URL" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"urls\": { \"urls\": { \"www.bing.com\": [ \"204.79.197.200\", \"13.107.21.200\" ], \"www.google.com\": [ \"172.217.19.132\", \"172.217.18.100\" ] } }}"
Response example for 200
{
"categories": {
"search-engines": {
"www.bing.com": [
"204.79.197.200",
"13.107.21.200"
],
"www.google.com": [
"172.217.19.132",
"172.217.18.100"
]
},
"sports": {
"urls": {
"www.nba.com": [
"104.106.236.138",
"92.122.144.117"
]
}
}
}
}