From 030e820579b88f9df3a4c6d568b671b766aa12d0 Mon Sep 17 00:00:00 2001 From: Thomas Brinkmann Date: Wed, 1 Jun 2022 21:32:44 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EGET=20/protection/incidents/{ipAddress?= =?UTF-8?q?}=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GET-%2Fprotection%2Fincidents%2F%7BipAddress%7D.md | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 GET-%2Fprotection%2Fincidents%2F%7BipAddress%7D.md diff --git a/GET-%2Fprotection%2Fincidents%2F%7BipAddress%7D.md b/GET-%2Fprotection%2Fincidents%2F%7BipAddress%7D.md new file mode 100644 index 0000000..4f79840 --- /dev/null +++ b/GET-%2Fprotection%2Fincidents%2F%7BipAddress%7D.md @@ -0,0 +1,118 @@ +## **GET /protection/incidents/{ipAddress}** + + +## **Inhalt** +--- +- Parameter +- Optionale Parameter +- Beispiel Anfrage +- Beispiel Antwort +- Mögliche Fehlermeldungen +--- + +### Parameter + +|URL Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|- | -| - + +|Body Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| - | - | - | + + +--- + +### Optionale Parameter + +|Query-String Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|?page | integer | Beschreibt die aktuelle Seitenzahl +|?limit | integer | Beschreibt wieviele Elemente pro Seite angezeigt werden sollen +|?size | integer | Beschreibt wieviele Elemente geholt werden sollen (Maximal 1000, Standard 500) + +--- + +### Beispiel Anfrage + +##### PHP +```php + 'control.local/api/v2/protection/incidents/192.168.1.2', + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_HTTPHEADER => array( + 'X-TOKEN: test-token', + 'Content-Type: application/json' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + +##### cURL +```bash +curl --location --request GET 'control.local/api/v2//protection/incidents/192.168.1.2' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK", + "totalResults": 1, + "page": 1, + "itemsPerPage": 25, + "maxPages": 1, + "items": [ + { + "@_timestamp": "2022-05-31T22:21:42+02:00", + "@timestamp": "2022-05-31T22:21:42+02:00", + "cluster": "ffm3", + "custom": "4485", + "ip": "192.168.1.2", + "mbps": "1064", + "method": "Threshold reached", + "mode": "l4_dynamic", + "packetsize": "", + "pps": "91750", + "sample_count": 20, + "samples": [ + { + "bytes": 1450, + "icmp_code": 0, + "icmp_type": 0, + "ip_dst": "192.168.1.2", + "ip_protocol": 17, + "ip_src": "X.X.X.X", + "ip_ttl": 56, + "port_dst": 22, + "port_src": 33983, + "tcp_flags": 0, + "time": 1654028500, + "vlan_dst": 61, + "vlan_src": 73 + }, + // .... + ], + "uuid": "ae398eda-5bfc-4ba7-b32e-5e1168811620" + } + ] +} +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied + +> :warning: Status Code **500** - Payment Methods could not be fetched! \ No newline at end of file