Storage usage total
curl --request POST \
--url https://api.gcore.com/storage/stats/v1/storage/usage/total \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2006-01-02",
"locations": [
"s-region-1",
"s-region-2"
],
"storages": [
"123-myStorage"
],
"to": "2006-01-02"
}
'import requests
url = "https://api.gcore.com/storage/stats/v1/storage/usage/total"
payload = {
"from": "2006-01-02",
"locations": ["s-region-1", "s-region-2"],
"storages": ["123-myStorage"],
"to": "2006-01-02"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '2006-01-02',
locations: ['s-region-1', 's-region-2'],
storages: ['123-myStorage'],
to: '2006-01-02'
})
};
fetch('https://api.gcore.com/storage/stats/v1/storage/usage/total', 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/storage/stats/v1/storage/usage/total",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '2006-01-02',
'locations' => [
's-region-1',
's-region-2'
],
'storages' => [
'123-myStorage'
],
'to' => '2006-01-02'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/storage/stats/v1/storage/usage/total"
payload := strings.NewReader("{\n \"from\": \"2006-01-02\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/storage/stats/v1/storage/usage/total")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2006-01-02\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/storage/stats/v1/storage/usage/total")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"2006-01-02\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"metrics": {
"file_quantity_sum_max": 123,
"requests_in_sum": 123,
"requests_out_edges_sum": 123,
"requests_out_wo_edges_sum": 123,
"requests_sum": 123,
"size_sum_bytes_hour": 123,
"size_sum_max": 123,
"size_sum_mean": 123,
"traffic_in_sum": 123,
"traffic_out_edges_sum": 123,
"traffic_out_wo_edges_sum": 123,
"traffic_sum": 123
}
}
]
}{
"error": "<string>"
}Storage Statistics
Storage usage total
Consumption statistics is updated in near real-time as a standard practice. However, the frequency of updates can vary, but they are typically available within a 60 minutes period. Exceptions, such as maintenance periods, may delay data beyond 60 minutes until servers resume and backfill missing statistics.
Shows storage total usage data in filtered by storages, locations and interval.
POST
/
storage
/
stats
/
v1
/
storage
/
usage
/
total
Storage usage total
curl --request POST \
--url https://api.gcore.com/storage/stats/v1/storage/usage/total \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2006-01-02",
"locations": [
"s-region-1",
"s-region-2"
],
"storages": [
"123-myStorage"
],
"to": "2006-01-02"
}
'import requests
url = "https://api.gcore.com/storage/stats/v1/storage/usage/total"
payload = {
"from": "2006-01-02",
"locations": ["s-region-1", "s-region-2"],
"storages": ["123-myStorage"],
"to": "2006-01-02"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '2006-01-02',
locations: ['s-region-1', 's-region-2'],
storages: ['123-myStorage'],
to: '2006-01-02'
})
};
fetch('https://api.gcore.com/storage/stats/v1/storage/usage/total', 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/storage/stats/v1/storage/usage/total",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '2006-01-02',
'locations' => [
's-region-1',
's-region-2'
],
'storages' => [
'123-myStorage'
],
'to' => '2006-01-02'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/storage/stats/v1/storage/usage/total"
payload := strings.NewReader("{\n \"from\": \"2006-01-02\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/storage/stats/v1/storage/usage/total")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2006-01-02\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/storage/stats/v1/storage/usage/total")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"2006-01-02\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"metrics": {
"file_quantity_sum_max": 123,
"requests_in_sum": 123,
"requests_out_edges_sum": 123,
"requests_out_wo_edges_sum": 123,
"requests_sum": 123,
"size_sum_bytes_hour": 123,
"size_sum_max": 123,
"size_sum_mean": 123,
"traffic_in_sum": 123,
"traffic_out_edges_sum": 123,
"traffic_out_wo_edges_sum": 123,
"traffic_sum": 123
}
}
]
}{
"error": "<string>"
}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
Body
application/json
Response
StorageUsageTotalEndpointRes
StorageUsageTotalRes for response
Show child attributes
Show child attributes
Was this page helpful?
⌘I