parent
09ce62ee52
commit
90b0576321
1 changed files with 103 additions and 0 deletions
@ -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 |
||||
<?php |
||||
|
||||
$curl = curl_init(); |
||||
|
||||
curl_setopt_array($curl, array( |
||||
CURLOPT_URL => '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 |
Loading…
Reference in new issue