Replace security configuration
PUT
/
cloud-cdn
/
distributions
/
configurations
/
security
Replace security configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/security \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"ip_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"referrer_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"user_agent_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"secure_key": {
"enabled": true,
"key": "<string>"
}
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/security"
payload = {
"country_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"ip_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"referrer_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"user_agent_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"secure_key": {
"enabled": True,
"key": "<string>"
}
}
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({
country_acl: {enabled: true, excepted_values: ['<string>']},
ip_acl: {enabled: true, excepted_values: ['<string>']},
referrer_acl: {enabled: true, excepted_values: ['<string>']},
user_agent_acl: {enabled: true, excepted_values: ['<string>']},
secure_key: {enabled: true, key: '<string>'}
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/security', 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/security"
payload := strings.NewReader("{\n \"country_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"ip_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"referrer_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"user_agent_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"secure_key\": {\n \"enabled\": true,\n \"key\": \"<string>\"\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
Distribution identifier.
Required range:
x >= 1Body
application/json
Response
Security configuration updated.
Replace security configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/security \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"ip_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"referrer_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"user_agent_acl": {
"enabled": true,
"excepted_values": [
"<string>"
]
},
"secure_key": {
"enabled": true,
"key": "<string>"
}
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/security"
payload = {
"country_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"ip_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"referrer_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"user_agent_acl": {
"enabled": True,
"excepted_values": ["<string>"]
},
"secure_key": {
"enabled": True,
"key": "<string>"
}
}
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({
country_acl: {enabled: true, excepted_values: ['<string>']},
ip_acl: {enabled: true, excepted_values: ['<string>']},
referrer_acl: {enabled: true, excepted_values: ['<string>']},
user_agent_acl: {enabled: true, excepted_values: ['<string>']},
secure_key: {enabled: true, key: '<string>'}
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/security', 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/security"
payload := strings.NewReader("{\n \"country_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"ip_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"referrer_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"user_agent_acl\": {\n \"enabled\": true,\n \"excepted_values\": [\n \"<string>\"\n ]\n },\n \"secure_key\": {\n \"enabled\": true,\n \"key\": \"<string>\"\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>"
}