parent
4faec02c2e
commit
09ce62ee52
1 changed files with 96 additions and 0 deletions
@ -0,0 +1,96 @@ |
|||||||
|
## **GET /protection/routing/{ipAddress}/{cidr}** |
||||||
|
|
||||||
|
|
||||||
|
## **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| |
||||||
|
|----------|-----|-------------| |
||||||
|
|- | - | - |
||||||
|
|
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### 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 => '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/routing/192.168.1.2/32' \ |
||||||
|
--header 'X-TOKEN: test-token' \ |
||||||
|
--header 'Content-Type: application/json' |
||||||
|
``` |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### Beispiel Antwort |
||||||
|
|
||||||
|
```json |
||||||
|
{ |
||||||
|
"status": "OK", |
||||||
|
"result": [ |
||||||
|
{ |
||||||
|
"blackhole": null, |
||||||
|
"flowspec": null, |
||||||
|
"l4_dynamic": null, |
||||||
|
"l4_permanent": false, |
||||||
|
"l7_only": false, |
||||||
|
"l7_permanent": false, |
||||||
|
"last_changed": { |
||||||
|
"@timestamp": "2022-04-18T10:39:55+02:00", |
||||||
|
"time": 1650271195 |
||||||
|
}, |
||||||
|
"prefix": "192.168.1.2/32" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
### Mögliche Fehlermeldungen |
||||||
|
|
||||||
|
> :warning: Status Code **204** - Routing has not changed yet for this ip |
||||||
|
|
||||||
|
> :warning: Status Code **403** - Permission denied |
||||||
|
|
||||||
|
> :warning: Status Code **404** - IP address not found |
Loading…
Reference in new issue