Traffic sources
List all traffic sources
Request
Definition
GET /api/v1/settings/firewalls
Headers
- 
AuthorizationrequiredAuthentication token with privileges to view the resource.
Bearer {token} 
Response
Status codes
| Status code | Message | 
|---|---|
| 200 | "List of traffic sources" | 
| 403 | "Forbidden" | 
Body
- Attributes
 - Example
 
- 
data.traffic_sources.addressstringIP address on which the traffic source is active.
 - 
data.traffic_sources.date_formatstringIndicates the date format of the logs.
 - 
data.traffic_sources.descriptionstringTraffic source description.
 - 
data.traffic_sources.enabledbooleanIndicates whether the traffic source is enabled.
 - 
data.traffic_sources.http_source_timezonestringTimezone associated with the traffic source.
 - 
data.traffic_sources.log_formatstringLog format.
 - 
data.traffic_sources.namestringTraffic source name.
 - 
data.traffic_sources.portintegerPort on which the traffic source is listening.
 - 
data.traffic_sources.rule_match_formatstring...
 - 
data.traffic_sources.time_formatstringIndicates the format in which the date of the logs should be displayed.
 - 
data.traffic_sources.timestamp_formatstringLog timestamp format.
 - 
data.traffic_sources.typestringIndicates the traffic sorce type.
 - 
data.traffic_sources.unix_timestampsbooleanIf true, it indicates that the timestamp format is UNIX.
 
{
"data": {
    "traffic_sources": [
    {
        "address": "10.99.99.199",
        "date_format": null,
        "description": "test description nginx",
        "enabled": true,
        "http_source_timezone": null,
        "log_format": null,
        "name": "test_nginx_2",
        "port": 2050,
        "rule_match_format": null,
        "time_format": null,
        "timestamp_format": null,
        "type": "nginx_log",
        "unix_timestamps": false
    },
    {
        "address": "99.99.99.198",
        "date_format": null,
        "description": "test desciption custom ts",
        "enabled": false,
        "http_source_timezone": "+02:00",
        "log_format": "client_address=%client_address timestamp=%timestamp",
        "name": "test_custom_ts_2",
        "port": 2051,
        "rule_match_format": null,
        "time_format": null,
        "timestamp_format": "%Y-%m-%dT%H:%M:%S",
        "type": "custom_log",
        "unix_timestamps": null
    },
    {
        "address": "99.99.99.197",
        "date_format": "%Y-%m-%d",
        "description": "test description custom dt",
        "enabled": true,
        "http_source_timezone": "-01:00",
        "log_format": "client_address=%client_address date=%date time=%time",
        "name": "test_custom_dt_2",
        "port": 2052,
        "rule_match_format": null,
        "time_format": "%H:%M:%S",
        "timestamp_format": null,
        "type": "custom_log",
        "unix_timestamps": null
    }
    ]
},
"message": "List of traffic sources",
"status": "ok"
}
List a specific traffic source
Request
Definition
GET /api/v1/settings/traffic_sources/{traffic_source_name}
Headers
- 
AuthorizationrequiredAuthentication token with privileges to view the resource.
Bearer {token} 
Response
Status codes
| Status code | Message | 
|---|---|
| 200 | "Traffic source retrieved" | 
| 400 | "Error retrieving traffic source" | 
| 403 | "Forbidden" | 
Body
{
  "data": {
    "traffic_source": {
      "address": "10.99.99.199",
      "date_format": null,
      "description": "test description nginx",
      "enabled": true,
      "http_source_timezone": null,
      "log_format": null,
      "name": "test_nginx_2",
      "port": 20052,
      "rule_match_format": null,
      "time_format": null,
      "timestamp_format": null,
      "type": "nginx_log",
      "unix_timestamps": false
    }
  },
  "message": "Traffic source retrieved",
  "status": "ok"
}
Create a traffic source
Request
Definition
POST /api/v1/settings/traffic_sorces
Headers
- 
AuthorizationrequiredAuthentication token with privileges to view the resource.
Bearer {token} - 
Content-Typerequiredapplication/json 
Request body
{
  "traffic_source": {
    "address": "10.99.99.196",
    "date_format": "%Y-%m-%d",
    "description": "description test_api_insert",
    "enabled": true,
    "http_source_timezone": "-01:00",
    "log_format": "client_address=%client_address date=%date time=%time",
    "name": "test_api_insert_2",
    "time_format": "%H:%M:%S",
    "type": "custom_log"
  }
}
Response
Status codes
| Status code | Message | 
|---|---|
| 200 | "Traffic source creation submitted" | 
| 400 | "Error creating traffic source" | 
| 403 | "Forbidden" | 
Body
{
  "data": {
    "traffic_source": {
      "address": "10.99.99.196",
      "date_format": "%Y-%m-%d",
      "description": "description test_api_insert",
      "enabled": true,
      "http_source_timezone": "-01:00",
      "log_format": "client_address=%client_address date=%date time=%time",
      "name": "test_api_insert_2",
      "port": 20053,
      "rule_match_format": null,
      "time_format": "%H:%M:%S",
      "timestamp_format": null,
      "type": "custom_log",
      "unix_timestamps": null
    }
  },
  "message": "Traffic source creation submitted",
  "status": "ok"
}
Update a traffic source
Request
Definition
PUT /api/v1/settings/traffic_sources/{traffic_source_name}
Headers
- 
AuthorizationrequiredAuthentication token with privileges to view the resource.
Bearer {token} - 
Content-Typerequiredapplication/json 
Request body
{
  "attrs": {
    "address": "10.87.86.85",
    "date_format": "YYYY_MM_dd",
    "http_source_timezone": "GMT+03:08",
    "time_format": "HH_mm_ss.sss"
  }
}
Response
Status codes
| Status code | Message | 
|---|---|
| 200 | "Traffic source modified" | 
| 400 | "Error updating traffic source" | 
| 403 | "Forbidden" | 
Body
{
  "data": {
    "traffic_source": {
      "address": "10.87.86.85",
      "date_format": "YYYY_MM_dd",
      "description": "test desciption custom ts",
      "enabled": false,
      "http_source_timezone": "GMT+03:08",
      "log_format": "client_address=%client_address timestamp=%timestamp",
      "name": "test_custom_ts_2",
      "port": 20051,
      "rule_match_format": null,
      "time_format": "HH_mm_ss.sss",
      "timestamp_format": "%Y-%m-%dT%H:%M:%S",
      "type": "custom_log",
      "unix_timestamps": null
    }
  },
  "message": "Traffic source modified",
  "status": "ok"
}
Delete a traffic source
Request
Definition
DELETE /api/v1/settings/traffic_sources/{traffic_source_name}
Headers
- 
AuthorizationrequiredAuthentication token with privileges to view the resource.
Bearer {token} - 
Content-Typerequiredapplication/json 
Response
Status codes
| Status code | Message | 
|---|---|
| 200 | "Traffic source deleted" | 
| 400 | "Error deleting traffic source" | 
| 403 | "Forbidden" | 
Body
{
  "data": {
    "traffic_source": {
      "address": null,
      "date_format": null,
      "description": null,
      "enabled": null,
      "http_source_timezone": null,
      "log_format": null,
      "name": "test_api_insert_2",
      "port": null,
      "rule_match_format": null,
      "time_format": null,
      "timestamp_format": null,
      "type": null,
      "unix_timestamps": null
    }
  },
  "message": "Traffic source deleted",
  "status": "ok"
}