List distributions
Returns Cloud CDN distributions in the API key’s project. Requires the list-distributions permission.
GET
/
cloud-cdn
/
distributions
List distributions
curl --request GET \
--url https://api.aptranet.com/cloud-cdn/distributions \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions"
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Aptranet-Secret': '<api-key>'}
};
fetch('https://api.aptranet.com/cloud-cdn/distributions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"id": 123,
"name": "<string>",
"hostname": "<string>",
"origin_group": {
"id": 123,
"name": "<string>",
"connected_distributions_count": 1,
"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
},
"aws_v4_auth": {
"bucket_name": "<string>",
"region": "<string>"
}
},
"status": "active",
"ssl_active": true,
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z"
}
]{
"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
Maximum number of resources to return.
Required range:
x >= 1Response
Distribution collection.
Show child attributes
Show child attributes
Available options:
active, inactive, provisioning, suspended, deleted List distributions
curl --request GET \
--url https://api.aptranet.com/cloud-cdn/distributions \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions"
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Aptranet-Secret': '<api-key>'}
};
fetch('https://api.aptranet.com/cloud-cdn/distributions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"id": 123,
"name": "<string>",
"hostname": "<string>",
"origin_group": {
"id": 123,
"name": "<string>",
"connected_distributions_count": 1,
"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
},
"aws_v4_auth": {
"bucket_name": "<string>",
"region": "<string>"
}
},
"status": "active",
"ssl_active": true,
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z"
}
]{
"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>"
}