curl --request GET \
--url {schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage', 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 => "{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage",
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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cpu_app": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"storage_app_services": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"memory_app": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"cpu_services": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"memory_services": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"backup_storage": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"build_cpu": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"build_memory": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"egress_bandwidth": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"ingress_requests": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"logs_fwd_content_size": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"fastly_bandwidth": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"fastly_requests": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
}
}{
"error": "<string>"
}Get current usage for a subscription
curl --request GET \
--url {schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage', 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 => "{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage",
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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/organizations/{organization_id}/subscriptions/{subscription_id}/current_usage")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cpu_app": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"storage_app_services": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"memory_app": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"cpu_services": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"memory_services": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"backup_storage": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"build_cpu": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"build_memory": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"egress_bandwidth": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"ingress_requests": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"logs_fwd_content_size": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"fastly_bandwidth": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
},
"fastly_requests": {
"title": "<string>",
"type": true,
"current_usage": 123,
"current_usage_formatted": "<string>",
"not_charged": true,
"free_quantity": 123,
"free_quantity_formatted": "<string>",
"daily_average": 123,
"daily_average_formatted": "<string>"
}
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the organization.
The ID of the subscription.
Query Parameters
A list of usage groups to retrieve current usage for.
Whether to include not charged usage groups.
Response
OK
A subscription's usage group current usage object.
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Current usage info for a usage group.
Show child attributes
Show child attributes
Was this page helpful?