„PUT /dns/zones/{domain}/records“ ändern

master
Thomas Brinkmann 3 years ago
parent a9ae6169f9
commit eda795a967
  1. 108
      PUT-%2Fdns%2Fzones%2F%7Bdomain%7D%2Frecords.md

@ -0,0 +1,108 @@
## **PUT /dns/zones/{domain}/records**
## **Inhalt**
---
- Parameter
- Optionale Parameter
- Beispiel Anfrage
- Beispiel Antwort
- Mögliche Fehlermeldungen
---
### Parameter
|URL Parameter | Typ | Beschreibung|
|----------|-----|-------------|
|domain | string | Die Domain dessen Records verändert werden sollen
|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/dns/zones/domain1.de/records',
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"name": "test22.domain1.de.",
"type": "A",
"ttl": 3600,
"records": [
{
"content": "x.x.x.x"
}
]
}',
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/dns/zones/domain1.de/records' \
--header 'X-TOKEN: test-token' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test22.domain1.de.",
"type": "A",
"ttl": 3600,
"records": [
{
"content": "x.x.x.x"
}
]
}'
```
---
### Beispiel Antwort
```json
{
"status": "OK"
}
```
### Mögliche Fehlermeldungen
> :warning: Status Code **400** - TTL must be between 3600 (1 Hour) and 86400 (24 Hours)!
> :warning: Status Code **400** - Record 'content' variable is not present or not a string
> :warning: Status Code **400** - Comment 'content' variable is not present or not a string
> :warning: Status Code **400** - Comment 'account' variable is not present or not a string
> :warning: Status Code **400** - Formatting Error
> :warning: Status Code **403** - Permission denied
Loading…
Cancel
Save