3 GET /protection/routing/{ipAddress}/{cidr}
Thomas Brinkmann edited this page 2 years ago

GET /protection/routing/{ipAddress}/{cidr}

Inhalt


  • Parameter
  • Optionale Parameter
  • Beispiel Anfrage
  • Beispiel Antwort
  • Mögliche Fehlermeldungen

Parameter

URL Parameter Typ Beschreibung
ipAddress string Die IP-Adresse für die man das Routing abrufen möchte
cidr integer CIDR Um das Routing ganzer Subnetze abzurufen (Single IP: 32)
Body Parameter Typ Beschreibung
- - -

Optionale Parameter

Query-String Parameter Typ Beschreibung
- - -

Beispiel Anfrage

PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.dsh.gg/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
curl --location --request GET 'https://api.dsh.gg/api/v2/protection/routing/192.168.1.2/32' \
--header 'X-TOKEN: test-token' \
--header 'Content-Type: application/json'

Beispiel Antwort

{
    "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

Status Code 204 - Routing has not changed yet for this ip

Status Code 403 - Permission denied

Status Code 404 - IP address not found