curl --request POST \
--url https://api.gcore.com/storage/stats/v1/storage/usage/series \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2006-01-02",
"granularity": "12h",
"locations": [
"s-region-1",
"s-region-2"
],
"source": 123,
"storages": [
"123-myStorage"
],
"to": "2006-01-02",
"ts_string": true
}
'import requests
url = "https://api.gcore.com/storage/stats/v1/storage/usage/series"
payload = {
"from": "2006-01-02",
"granularity": "12h",
"locations": ["s-region-1", "s-region-2"],
"source": 123,
"storages": ["123-myStorage"],
"to": "2006-01-02",
"ts_string": True
}
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',
granularity: '12h',
locations: ['s-region-1', 's-region-2'],
source: 123,
storages: ['123-myStorage'],
to: '2006-01-02',
ts_string: true
})
};
fetch('https://api.gcore.com/storage/stats/v1/storage/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/storage/stats/v1/storage/usage/series",
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',
'granularity' => '12h',
'locations' => [
's-region-1',
's-region-2'
],
'source' => 123,
'storages' => [
'123-myStorage'
],
'to' => '2006-01-02',
'ts_string' => true
]),
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/series"
payload := strings.NewReader("{\n \"from\": \"2006-01-02\",\n \"granularity\": \"12h\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"source\": 123,\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\",\n \"ts_string\": true\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/series")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2006-01-02\",\n \"granularity\": \"12h\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"source\": 123,\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\",\n \"ts_string\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/storage/stats/v1/storage/usage/series")
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 \"granularity\": \"12h\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"source\": 123,\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\",\n \"ts_string\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"clients": {}
}
}{
"error": "<string>"
}Storage usage series
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 usage data in series format filtered by clients, storages and interval.
curl --request POST \
--url https://api.gcore.com/storage/stats/v1/storage/usage/series \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2006-01-02",
"granularity": "12h",
"locations": [
"s-region-1",
"s-region-2"
],
"source": 123,
"storages": [
"123-myStorage"
],
"to": "2006-01-02",
"ts_string": true
}
'import requests
url = "https://api.gcore.com/storage/stats/v1/storage/usage/series"
payload = {
"from": "2006-01-02",
"granularity": "12h",
"locations": ["s-region-1", "s-region-2"],
"source": 123,
"storages": ["123-myStorage"],
"to": "2006-01-02",
"ts_string": True
}
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',
granularity: '12h',
locations: ['s-region-1', 's-region-2'],
source: 123,
storages: ['123-myStorage'],
to: '2006-01-02',
ts_string: true
})
};
fetch('https://api.gcore.com/storage/stats/v1/storage/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/storage/stats/v1/storage/usage/series",
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',
'granularity' => '12h',
'locations' => [
's-region-1',
's-region-2'
],
'source' => 123,
'storages' => [
'123-myStorage'
],
'to' => '2006-01-02',
'ts_string' => true
]),
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/series"
payload := strings.NewReader("{\n \"from\": \"2006-01-02\",\n \"granularity\": \"12h\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"source\": 123,\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\",\n \"ts_string\": true\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/series")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2006-01-02\",\n \"granularity\": \"12h\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"source\": 123,\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\",\n \"ts_string\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/storage/stats/v1/storage/usage/series")
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 \"granularity\": \"12h\",\n \"locations\": [\n \"s-region-1\",\n \"s-region-2\"\n ],\n \"source\": 123,\n \"storages\": [\n \"123-myStorage\"\n ],\n \"to\": \"2006-01-02\",\n \"ts_string\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"clients": {}
}
}{
"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
a From date filter
"2006-01-02"
a Granularity is period of time for grouping data Valid values are: 1h, 12h, 24h
"12h"
a Locations list of filter
["s-region-1", "s-region-2"]
a Source is deprecated parameter
a Storages list of filter
["123-myStorage"]
a To date filter
"2006-01-02"
a TsString is configurator of response time format switch response from unix time format to RFC3339 (2006-01-02T15:04:05Z07:00)
Response
StorageUsageSeriesEndpointRes
Show child attributes
Show child attributes
Was this page helpful?