Update Network Mapping
curl --request PUT \
--url https://api.gcore.com/dns/v2/network-mappings/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"mapping": [
{
"cidr4": [
"<string>"
],
"cidr6": [
"<string>"
],
"tags": [
"<string>"
]
}
],
"name": "<string>"
}
'import requests
url = "https://api.gcore.com/dns/v2/network-mappings/{id}"
payload = {
"mapping": [
{
"cidr4": ["<string>"],
"cidr6": ["<string>"],
"tags": ["<string>"]
}
],
"name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mapping: [{cidr4: ['<string>'], cidr6: ['<string>'], tags: ['<string>']}],
name: '<string>'
})
};
fetch('https://api.gcore.com/dns/v2/network-mappings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/dns/v2/network-mappings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mapping' => [
[
'cidr4' => [
'<string>'
],
'cidr6' => [
'<string>'
],
'tags' => [
'<string>'
]
]
],
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/dns/v2/network-mappings/{id}"
payload := strings.NewReader("{\n \"mapping\": [\n {\n \"cidr4\": [\n \"<string>\"\n ],\n \"cidr6\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/dns/v2/network-mappings/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mapping\": [\n {\n \"cidr4\": [\n \"<string>\"\n ],\n \"cidr6\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/dns/v2/network-mappings/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mapping\": [\n {\n \"cidr4\": [\n \"<string>\"\n ],\n \"cidr6\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}This response has no body data.NetworkMappings
Update Network Mapping
Update network mapping (Note: name of network mapping cannot be changed)
Example of request:
curl --location --request PUT 'https://api.gcore.com/dns/v2/network-mappings/123' \
--header 'Authorization: Bearer ...' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test-mapping",
"mapping": [
{
"tags": [
"tag1"
],
"cidr4": [
"192.0.2.0/24"
]
},
{
"tags": [
"tag2",
"tag3"
],
"cidr4": [
"192.1.2.0/24"
],
"cidr6": [
"aa:10::/64"
]
}
]
}'
PUT
/
dns
/
v2
/
network-mappings
/
{id}
Update Network Mapping
curl --request PUT \
--url https://api.gcore.com/dns/v2/network-mappings/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"mapping": [
{
"cidr4": [
"<string>"
],
"cidr6": [
"<string>"
],
"tags": [
"<string>"
]
}
],
"name": "<string>"
}
'import requests
url = "https://api.gcore.com/dns/v2/network-mappings/{id}"
payload = {
"mapping": [
{
"cidr4": ["<string>"],
"cidr6": ["<string>"],
"tags": ["<string>"]
}
],
"name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mapping: [{cidr4: ['<string>'], cidr6: ['<string>'], tags: ['<string>']}],
name: '<string>'
})
};
fetch('https://api.gcore.com/dns/v2/network-mappings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/dns/v2/network-mappings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'mapping' => [
[
'cidr4' => [
'<string>'
],
'cidr6' => [
'<string>'
],
'tags' => [
'<string>'
]
]
],
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/dns/v2/network-mappings/{id}"
payload := strings.NewReader("{\n \"mapping\": [\n {\n \"cidr4\": [\n \"<string>\"\n ],\n \"cidr6\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/dns/v2/network-mappings/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mapping\": [\n {\n \"cidr4\": [\n \"<string>\"\n ],\n \"cidr6\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/dns/v2/network-mappings/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mapping\": [\n {\n \"cidr4\": [\n \"<string>\"\n ],\n \"cidr6\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}This response has no body data.Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Path Parameters
network mapping id
Response
UpdateNetworkMappingResponse
The response is of type object.
Was this page helpful?
⌘I