Replace origin configuration
PUT
/
cloud-cdn
/
distributions
/
configurations
/
origin
Replace origin configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/origin \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"follow_origin_redirection": true,
"follow_redirect_codes": [],
"connection_timeout": 1,
"read_timeout": 1,
"rewrite": {
"enabled": true,
"body": "<string>"
},
"force_return": {
"enabled": true,
"code": 349,
"body": "<string>"
},
"origin_group_id": 2
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/origin"
payload = {
"follow_origin_redirection": True,
"follow_redirect_codes": [],
"connection_timeout": 1,
"read_timeout": 1,
"rewrite": {
"enabled": True,
"body": "<string>"
},
"force_return": {
"enabled": True,
"code": 349,
"body": "<string>"
},
"origin_group_id": 2
}
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({
follow_origin_redirection: true,
follow_redirect_codes: [],
connection_timeout: 1,
read_timeout: 1,
rewrite: {enabled: true, body: JSON.stringify('<string>')},
force_return: {enabled: true, code: 349, body: JSON.stringify('<string>')},
origin_group_id: 2
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/origin', 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/origin"
payload := strings.NewReader("{\n \"follow_origin_redirection\": true,\n \"follow_redirect_codes\": [],\n \"connection_timeout\": 1,\n \"read_timeout\": 1,\n \"rewrite\": {\n \"enabled\": true,\n \"body\": \"<string>\"\n },\n \"force_return\": {\n \"enabled\": true,\n \"code\": 349,\n \"body\": \"<string>\"\n },\n \"origin_group_id\": 2\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
Available options:
http, https, match Available options:
301, 302, 303, 307, 308 Required range:
x >= 0Required range:
x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
x >= 1Response
Origin configuration updated.
Replace origin configuration
curl --request PUT \
--url https://api.aptranet.com/cloud-cdn/distributions/configurations/origin \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"follow_origin_redirection": true,
"follow_redirect_codes": [],
"connection_timeout": 1,
"read_timeout": 1,
"rewrite": {
"enabled": true,
"body": "<string>"
},
"force_return": {
"enabled": true,
"code": 349,
"body": "<string>"
},
"origin_group_id": 2
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/configurations/origin"
payload = {
"follow_origin_redirection": True,
"follow_redirect_codes": [],
"connection_timeout": 1,
"read_timeout": 1,
"rewrite": {
"enabled": True,
"body": "<string>"
},
"force_return": {
"enabled": True,
"code": 349,
"body": "<string>"
},
"origin_group_id": 2
}
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({
follow_origin_redirection: true,
follow_redirect_codes: [],
connection_timeout: 1,
read_timeout: 1,
rewrite: {enabled: true, body: JSON.stringify('<string>')},
force_return: {enabled: true, code: 349, body: JSON.stringify('<string>')},
origin_group_id: 2
})
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/configurations/origin', 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/origin"
payload := strings.NewReader("{\n \"follow_origin_redirection\": true,\n \"follow_redirect_codes\": [],\n \"connection_timeout\": 1,\n \"read_timeout\": 1,\n \"rewrite\": {\n \"enabled\": true,\n \"body\": \"<string>\"\n },\n \"force_return\": {\n \"enabled\": true,\n \"code\": 349,\n \"body\": \"<string>\"\n },\n \"origin_group_id\": 2\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>"
}