Replace a record set
PUT
/
cloud-dns
/
rrsets
Replace a record set
curl --request PUT \
--url https://api.aptranet.com/cloud-dns/rrsets \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl": 1,
"resource_records": [
{
"enabled": true,
"content": [
"<string>"
],
"meta": {
"asn": [
123
],
"continents": [
"<string>"
],
"countries": [
"<string>"
],
"latlong": [
0,
0
],
"backup": true,
"notes": "<string>",
"weight": 1,
"ip": [
"<string>"
],
"default": true
}
}
]
}
'import requests
url = "https://api.aptranet.com/cloud-dns/rrsets"
payload = {
"ttl": 1,
"resource_records": [
{
"enabled": True,
"content": ["<string>"],
"meta": {
"asn": [123],
"continents": ["<string>"],
"countries": ["<string>"],
"latlong": [0, 0],
"backup": True,
"notes": "<string>",
"weight": 1,
"ip": ["<string>"],
"default": True
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ttl: 1,
resource_records: [
{
enabled: true,
content: ['<string>'],
meta: {
asn: [123],
continents: ['<string>'],
countries: ['<string>'],
latlong: [0, 0],
backup: true,
notes: '<string>',
weight: 1,
ip: ['<string>'],
default: true
}
}
]
})
};
fetch('https://api.aptranet.com/cloud-dns/rrsets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-dns/rrsets"
payload := strings.NewReader("{\n \"ttl\": 1,\n \"resource_records\": [\n {\n \"enabled\": true,\n \"content\": [\n \"<string>\"\n ],\n \"meta\": {\n \"asn\": [\n 123\n ],\n \"continents\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"latlong\": [\n 0,\n 0\n ],\n \"backup\": true,\n \"notes\": \"<string>\",\n \"weight\": 1,\n \"ip\": [\n \"<string>\"\n ],\n \"default\": true\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}Authorizations
Access key beginning with APTRANET_.
Current secret paired with the access key.
Query Parameters
DNS zone identifier.
Required range:
x >= 1DNS record-set identifier.
Required range:
x >= 1Body
application/json
Response
Record set updated.
Replace a record set
curl --request PUT \
--url https://api.aptranet.com/cloud-dns/rrsets \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl": 1,
"resource_records": [
{
"enabled": true,
"content": [
"<string>"
],
"meta": {
"asn": [
123
],
"continents": [
"<string>"
],
"countries": [
"<string>"
],
"latlong": [
0,
0
],
"backup": true,
"notes": "<string>",
"weight": 1,
"ip": [
"<string>"
],
"default": true
}
}
]
}
'import requests
url = "https://api.aptranet.com/cloud-dns/rrsets"
payload = {
"ttl": 1,
"resource_records": [
{
"enabled": True,
"content": ["<string>"],
"meta": {
"asn": [123],
"continents": ["<string>"],
"countries": ["<string>"],
"latlong": [0, 0],
"backup": True,
"notes": "<string>",
"weight": 1,
"ip": ["<string>"],
"default": True
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ttl: 1,
resource_records: [
{
enabled: true,
content: ['<string>'],
meta: {
asn: [123],
continents: ['<string>'],
countries: ['<string>'],
latlong: [0, 0],
backup: true,
notes: '<string>',
weight: 1,
ip: ['<string>'],
default: true
}
}
]
})
};
fetch('https://api.aptranet.com/cloud-dns/rrsets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-dns/rrsets"
payload := strings.NewReader("{\n \"ttl\": 1,\n \"resource_records\": [\n {\n \"enabled\": true,\n \"content\": [\n \"<string>\"\n ],\n \"meta\": {\n \"asn\": [\n 123\n ],\n \"continents\": [\n \"<string>\"\n ],\n \"countries\": [\n \"<string>\"\n ],\n \"latlong\": [\n 0,\n 0\n ],\n \"backup\": true,\n \"notes\": \"<string>\",\n \"weight\": 1,\n \"ip\": [\n \"<string>\"\n ],\n \"default\": true\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}{
"error_code": "<string>",
"error": "<string>",
"error_description": "<string>",
"trace_id": "<string>"
}