From 90b0576321f9a053ad1f8130fbd1642d26d06288 Mon Sep 17 00:00:00 2001 From: Thomas Brinkmann Date: Wed, 1 Jun 2022 21:28:26 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EPUT=20/protection/routing/{ipAddress}/?= =?UTF-8?q?{cidr}=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ion%2Frouting%2F%7BipAddress%7D%2F%7Bcidr%7D.md | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 PUT-%2Fprotection%2Frouting%2F%7BipAddress%7D%2F%7Bcidr%7D.md diff --git a/PUT-%2Fprotection%2Frouting%2F%7BipAddress%7D%2F%7Bcidr%7D.md b/PUT-%2Fprotection%2Frouting%2F%7BipAddress%7D%2F%7Bcidr%7D.md new file mode 100644 index 0000000..e8b254e --- /dev/null +++ b/PUT-%2Fprotection%2Frouting%2F%7BipAddress%7D%2F%7Bcidr%7D.md @@ -0,0 +1,103 @@ +## **PUT /protection/routing/{ipAddress}/{cidr}** + + +## **Inhalt** +--- +- Parameter +- Optionale Parameter +- Beispiel Anfrage +- Beispiel Antwort +- Mögliche Fehlermeldungen +--- + +### Parameter + +|URL Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|- | -| - + +|Body Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| l4_permanent | boolean | Beschreibt ob der Layer 4 Permanent Schutz aktivert werden soll | +| l7_permanent | boolean | Beschreibt ob der Layer 7 Permanent Schutz aktivert werden soll | +| l7_only | boolean | Beschreibt ob nur der Layer 7 Schutz aktivert werden soll | + +--- + +### Optionale Parameter + +|Query-String Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|- | - | - + + +--- + +### Beispiel Anfrage + +##### PHP +```php + 'control.local/api/v2/protection/routing/192.168.1.2/32', + CURLOPT_CUSTOMREQUEST => 'PUT', + CURLOPT_POSTFIELDS =>'{ + "l4_permanent": true, + "l7_permanent": false, + "l7_only": false + }', + 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 PUT 'control.local/api/v2/protection/routing/192.168.1.2/32' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "l4_permanent": true, + "l7_permanent": false, + "l7_only": false +}' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK", + "result": { + "prefix": "192.168.1.2/32", + "blackhole": false, + "flowspec": false, + "l4_dynamic": false, + "l4_permanent": true, + "l7_only": false, + "l7_permanent": false, + "last_changed": { + "time": 1654111138, + "@timestamp": "2022-06-01T21:18:58+02:00" + } + } +} +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied + +> :warning: Status Code **404** - IP address not found