From 7121c1ad45d1305894159255fab791425ac042df Mon Sep 17 00:00:00 2001 From: Thomas Brinkmann Date: Wed, 1 Jun 2022 22:05:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EGET=20/protection/flexrules/{uuid}?= =?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%2Fflexrules%2F%7Buuid%7D.md | 133 ++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 GET-%2Fprotection%2Fflexrules%2F%7Buuid%7D.md diff --git a/GET-%2Fprotection%2Fflexrules%2F%7Buuid%7D.md b/GET-%2Fprotection%2Fflexrules%2F%7Buuid%7D.md new file mode 100644 index 0000000..4a00f97 --- /dev/null +++ b/GET-%2Fprotection%2Fflexrules%2F%7Buuid%7D.md @@ -0,0 +1,133 @@ +## **GET /protection/flexrules/{uuid}** + + +## **Inhalt** +--- +- Parameter +- Optionale Parameter +- Beispiel Anfrage +- Beispiel Antwort +- Mögliche Fehlermeldungen +--- + +### Parameter + +|URL Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|uuid | string | Die UUID der Flexrule + +|Body Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| - | - | - | + + +--- + +### Optionale Parameter + +|Query-String Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|?metrics | integer | Anzahl der zurückzugebenden Übereinstimmungsmetriken (pps) (max. 500, Standard: keine) +|?time_start | string | Unix-Zeitstempel der Metriken (pps) Zeitbereich Start +|?time_end | string | Unix-Zeitstempel der Metriken (pps) Zeitbereich Ende + +--- + +### Beispiel Anfrage + +##### PHP +```php + 'control.local/api/v2/protection/flexrules/ABCDE-FGHI-1234-567-8910', + 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/flexrules/ABCDE-FGHI-1234-567-8910' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK", + "flexrule": + { + "uuid": "ABCDE-FGHI-1234-567-8910", + "seq": 1, + "from": { + "ip": { + "src": { + "start": "X.X.X.X", + "end": "X.X.X.X" + }, + "dst": "192.168.1.2/32", + "protocol": 6 + }, + "port": { + "src": { + "start": 0, + "end": 0 + }, + "dst": { + "start": 0, + "end": 0 + } + }, + "length": { + "start": 0, + "end": 0 + }, + "payload": "", + "geo": { + "asn": 0, + "country": 0 + }, + "tcp": { + "flags": false, + "syn": false, + "ack": false, + "psh": false, + "fin": false, + "urg": false, + "rst": false + } + }, + "then": { + "ratelimit": 0, + "seqjump": 0, + "action": 1, + "gqc": { + "type": 0, + "ratelimit": 0, + "passthrough": false + } + } + } +} +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied + +> :warning: Status Code **404** - Flexrule not found \ No newline at end of file