Replace network configuration
PUT
/
cloud-cdn
/
distributions
/
configurations
/
network
Replace network configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/network \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hostnames": {
"custom_hostnames": [
{
"hostname": "<string>"
}
]
},
"compression_configuration": {
"gzip": {
"enabled": true
},
"brotli": {
"enabled": true,
"mime_types": [
"<string>"
]
},
"pull_precompressed_content": {
"enabled": true
}
},
"bandwidth_limiter_configuration": {
"enabled": true,
"limit_speed": 1,
"limit_buffer": 1
},
"allowed_http_methods": {
"get": true,
"head": true,
"post": true,
"put": true,
"patch": true,
"delete": true,
"options": true
},
"websockets_support": true,
"grpc_passthrough": true
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/network"
payload = {
"hostnames": { "custom_hostnames": [{ "hostname": "<string>" }] },
"compression_configuration": {
"gzip": { "enabled": True },
"brotli": {
"enabled": True,
"mime_types": ["<string>"]
},
"pull_precompressed_content": { "enabled": True }
},
"bandwidth_limiter_configuration": {
"enabled": True,
"limit_speed": 1,
"limit_buffer": 1
},
"allowed_http_methods": {
"get": True,
"head": True,
"post": True,
"put": True,
"patch": True,
"delete": True,
"options": True
},
"websockets_support": True,
"grpc_passthrough": 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({
hostnames: {custom_hostnames: [{hostname: '<string>'}]},
compression_configuration: {
gzip: {enabled: true},
brotli: {enabled: true, mime_types: ['<string>']},
pull_precompressed_content: {enabled: true}
},
bandwidth_limiter_configuration: {enabled: true, limit_speed: 1, limit_buffer: 1},
allowed_http_methods: {
get: true,
head: true,
post: true,
put: true,
patch: true,
delete: true,
options: true
},
websockets_support: true,
grpc_passthrough: true
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/network', 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-cdn/distributions/configurations/network"
payload := strings.NewReader("{\n \"hostnames\": {\n \"custom_hostnames\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n },\n \"compression_configuration\": {\n \"gzip\": {\n \"enabled\": true\n },\n \"brotli\": {\n \"enabled\": true,\n \"mime_types\": [\n \"<string>\"\n ]\n },\n \"pull_precompressed_content\": {\n \"enabled\": true\n }\n },\n \"bandwidth_limiter_configuration\": {\n \"enabled\": true,\n \"limit_speed\": 1,\n \"limit_buffer\": 1\n },\n \"allowed_http_methods\": {\n \"get\": true,\n \"head\": true,\n \"post\": true,\n \"put\": true,\n \"patch\": true,\n \"delete\": true,\n \"options\": true\n },\n \"websockets_support\": true,\n \"grpc_passthrough\": true\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
Distribution identifier.
Required range:
x >= 1Body
application/json
Response
Network configuration updated.
Replace network configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/network \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hostnames": {
"custom_hostnames": [
{
"hostname": "<string>"
}
]
},
"compression_configuration": {
"gzip": {
"enabled": true
},
"brotli": {
"enabled": true,
"mime_types": [
"<string>"
]
},
"pull_precompressed_content": {
"enabled": true
}
},
"bandwidth_limiter_configuration": {
"enabled": true,
"limit_speed": 1,
"limit_buffer": 1
},
"allowed_http_methods": {
"get": true,
"head": true,
"post": true,
"put": true,
"patch": true,
"delete": true,
"options": true
},
"websockets_support": true,
"grpc_passthrough": true
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/network"
payload = {
"hostnames": { "custom_hostnames": [{ "hostname": "<string>" }] },
"compression_configuration": {
"gzip": { "enabled": True },
"brotli": {
"enabled": True,
"mime_types": ["<string>"]
},
"pull_precompressed_content": { "enabled": True }
},
"bandwidth_limiter_configuration": {
"enabled": True,
"limit_speed": 1,
"limit_buffer": 1
},
"allowed_http_methods": {
"get": True,
"head": True,
"post": True,
"put": True,
"patch": True,
"delete": True,
"options": True
},
"websockets_support": True,
"grpc_passthrough": 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({
hostnames: {custom_hostnames: [{hostname: '<string>'}]},
compression_configuration: {
gzip: {enabled: true},
brotli: {enabled: true, mime_types: ['<string>']},
pull_precompressed_content: {enabled: true}
},
bandwidth_limiter_configuration: {enabled: true, limit_speed: 1, limit_buffer: 1},
allowed_http_methods: {
get: true,
head: true,
post: true,
put: true,
patch: true,
delete: true,
options: true
},
websockets_support: true,
grpc_passthrough: true
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/network', 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-cdn/distributions/configurations/network"
payload := strings.NewReader("{\n \"hostnames\": {\n \"custom_hostnames\": [\n {\n \"hostname\": \"<string>\"\n }\n ]\n },\n \"compression_configuration\": {\n \"gzip\": {\n \"enabled\": true\n },\n \"brotli\": {\n \"enabled\": true,\n \"mime_types\": [\n \"<string>\"\n ]\n },\n \"pull_precompressed_content\": {\n \"enabled\": true\n }\n },\n \"bandwidth_limiter_configuration\": {\n \"enabled\": true,\n \"limit_speed\": 1,\n \"limit_buffer\": 1\n },\n \"allowed_http_methods\": {\n \"get\": true,\n \"head\": true,\n \"post\": true,\n \"put\": true,\n \"patch\": true,\n \"delete\": true,\n \"options\": true\n },\n \"websockets_support\": true,\n \"grpc_passthrough\": true\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>"
}