import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
usage_series_stats = client.cdn.statistics.get_logs_usage_series(
from_="from",
to="to",
)
print(usage_series_stats)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
usageSeriesStats, err := client.CDN.Statistics.GetLogsUsageSeries(context.TODO(), cdn.StatisticGetLogsUsageSeriesParams{
From: "from",
To: "to",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", usageSeriesStats)
}
curl --request GET \
--url https://api.gcore.com/cdn/statistics/raw_logs_usage/series \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cdn/statistics/raw_logs_usage/series', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cdn/statistics/raw_logs_usage/series",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/statistics/raw_logs_usage/series")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/statistics/raw_logs_usage/series")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 1,
"active_from": "2020-01-21T04:36:35.473Z",
"active_to": null,
"client_id": 1,
"cname": "resource-1.com"
},
{
"id": 2,
"active_from": "2020-03-21T04:36:30.269Z",
"active_to": "2020-04-21T04:36:33.062Z",
"client_id": 1,
"cname": "resource-2.com"
}
]Logs uploader usage statistics
Get information about Logs uploader usage statistics for up to 90 days starting today.
Request URL parameters should be added as a query string after the endpoint.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
usage_series_stats = client.cdn.statistics.get_logs_usage_series(
from_="from",
to="to",
)
print(usage_series_stats)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
usageSeriesStats, err := client.CDN.Statistics.GetLogsUsageSeries(context.TODO(), cdn.StatisticGetLogsUsageSeriesParams{
From: "from",
To: "to",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", usageSeriesStats)
}
curl --request GET \
--url https://api.gcore.com/cdn/statistics/raw_logs_usage/series \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cdn/statistics/raw_logs_usage/series', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cdn/statistics/raw_logs_usage/series",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/statistics/raw_logs_usage/series")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/statistics/raw_logs_usage/series")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 1,
"active_from": "2020-01-21T04:36:35.473Z",
"active_to": null,
"client_id": 1,
"cname": "resource-1.com"
},
{
"id": 2,
"active_from": "2020-03-21T04:36:30.269Z",
"active_to": "2020-04-21T04:36:33.062Z",
"client_id": 1,
"cname": "resource-2.com"
}
]Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Query Parameters
Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
Example:
- &from=2018-12-01T00:00:00.000
End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
Example:
- &to=2018-12-01T01:00:00.000
CDN resources IDs.
To request multiple values, use:
- &resource=1&resource=2
Client accounts IDs.
To request multiple values, use:
- &client=1&client=2
Response
Successful.
Internal feature activation ID.
Date and time when paid feature was enabled (ISO 8601/RFC 3339 format, UTC.)
Date and time when paid feature was disabled (ISO 8601/RFC 3339 format, UTC.)
Returns null if the paid feature is enabled.
Client account ID.
CDN resource CNAME.
Was this page helpful?