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