Create an origin group
POST
/
cloud-cdn
/
origin_groups
Create an origin group
curl --request POST \
--url https://api.aptranet.com/cloud-cdn/origin_groups \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"use_next_upstream": true,
"next_upstream_cases": {
"on_error": true,
"on_timeout": true,
"on_invalid_header": true,
"on_http_403": true,
"on_http_404": true,
"on_http_429": true,
"on_http_500": true,
"on_http_502": true,
"on_http_503": true,
"on_http_504": true
},
"origins": [
{
"source": "<string>",
"enabled": true,
"backup_only": true,
"host_header_override": "<string>",
"s3_region": "<string>",
"s3_bucket_name": "<string>",
"s3_access_key": "<string>",
"s3_access_secret": "<string>"
}
]
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/origin_groups"
payload = {
"name": "<string>",
"use_next_upstream": True,
"next_upstream_cases": {
"on_error": True,
"on_timeout": True,
"on_invalid_header": True,
"on_http_403": True,
"on_http_404": True,
"on_http_429": True,
"on_http_500": True,
"on_http_502": True,
"on_http_503": True,
"on_http_504": True
},
"origins": [
{
"source": "<string>",
"enabled": True,
"backup_only": True,
"host_header_override": "<string>",
"s3_region": "<string>",
"s3_bucket_name": "<string>",
"s3_access_key": "<string>",
"s3_access_secret": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
use_next_upstream: true,
next_upstream_cases: {
on_error: true,
on_timeout: true,
on_invalid_header: true,
on_http_403: true,
on_http_404: true,
on_http_429: true,
on_http_500: true,
on_http_502: true,
on_http_503: true,
on_http_504: true
},
origins: [
{
source: '<string>',
enabled: true,
backup_only: true,
host_header_override: '<string>',
s3_region: '<string>',
s3_bucket_name: '<string>',
s3_access_key: '<string>',
s3_access_secret: '<string>'
}
]
})
};
fetch('https://api.aptranet.com/cloud-cdn/origin_groups', 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/origin_groups"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"use_next_upstream\": true,\n \"next_upstream_cases\": {\n \"on_error\": true,\n \"on_timeout\": true,\n \"on_invalid_header\": true,\n \"on_http_403\": true,\n \"on_http_404\": true,\n \"on_http_429\": true,\n \"on_http_500\": true,\n \"on_http_502\": true,\n \"on_http_503\": true,\n \"on_http_504\": true\n },\n \"origins\": [\n {\n \"source\": \"<string>\",\n \"enabled\": true,\n \"backup_only\": true,\n \"host_header_override\": \"<string>\",\n \"s3_region\": \"<string>\",\n \"s3_bucket_name\": \"<string>\",\n \"s3_access_key\": \"<string>\",\n \"s3_access_secret\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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))
}{
"id": 2
}{
"id": 2
}{
"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.
Body
application/json
Response
Origin group created.
Required range:
x >= 1Create an origin group
curl --request POST \
--url https://api.aptranet.com/cloud-cdn/origin_groups \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"use_next_upstream": true,
"next_upstream_cases": {
"on_error": true,
"on_timeout": true,
"on_invalid_header": true,
"on_http_403": true,
"on_http_404": true,
"on_http_429": true,
"on_http_500": true,
"on_http_502": true,
"on_http_503": true,
"on_http_504": true
},
"origins": [
{
"source": "<string>",
"enabled": true,
"backup_only": true,
"host_header_override": "<string>",
"s3_region": "<string>",
"s3_bucket_name": "<string>",
"s3_access_key": "<string>",
"s3_access_secret": "<string>"
}
]
}
'import requests
url = "https://api.aptranet.com/cloud-cdn/origin_groups"
payload = {
"name": "<string>",
"use_next_upstream": True,
"next_upstream_cases": {
"on_error": True,
"on_timeout": True,
"on_invalid_header": True,
"on_http_403": True,
"on_http_404": True,
"on_http_429": True,
"on_http_500": True,
"on_http_502": True,
"on_http_503": True,
"on_http_504": True
},
"origins": [
{
"source": "<string>",
"enabled": True,
"backup_only": True,
"host_header_override": "<string>",
"s3_region": "<string>",
"s3_bucket_name": "<string>",
"s3_access_key": "<string>",
"s3_access_secret": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
use_next_upstream: true,
next_upstream_cases: {
on_error: true,
on_timeout: true,
on_invalid_header: true,
on_http_403: true,
on_http_404: true,
on_http_429: true,
on_http_500: true,
on_http_502: true,
on_http_503: true,
on_http_504: true
},
origins: [
{
source: '<string>',
enabled: true,
backup_only: true,
host_header_override: '<string>',
s3_region: '<string>',
s3_bucket_name: '<string>',
s3_access_key: '<string>',
s3_access_secret: '<string>'
}
]
})
};
fetch('https://api.aptranet.com/cloud-cdn/origin_groups', 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/origin_groups"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"use_next_upstream\": true,\n \"next_upstream_cases\": {\n \"on_error\": true,\n \"on_timeout\": true,\n \"on_invalid_header\": true,\n \"on_http_403\": true,\n \"on_http_404\": true,\n \"on_http_429\": true,\n \"on_http_500\": true,\n \"on_http_502\": true,\n \"on_http_503\": true,\n \"on_http_504\": true\n },\n \"origins\": [\n {\n \"source\": \"<string>\",\n \"enabled\": true,\n \"backup_only\": true,\n \"host_header_override\": \"<string>\",\n \"s3_region\": \"<string>\",\n \"s3_bucket_name\": \"<string>\",\n \"s3_access_key\": \"<string>\",\n \"s3_access_secret\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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))
}{
"id": 2
}{
"id": 2
}{
"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>"
}