Skip to main content
GET
/
storage
/
buckets
/
{bucketName}
/
usage
/
storage
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const response = await client.storage.buckets.usage.getBucketUsage('');

console.log(response.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.storage.buckets.usage.get_bucket_usage(
"",
)
print(response.data)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Storage.Buckets.Usage.GetBucketUsage(context.TODO(), "")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.storage.buckets.usage.UsageGetBucketUsageParams;
import com.telnyx.sdk.models.storage.buckets.usage.UsageGetBucketUsageResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

UsageGetBucketUsageResponse response = client.storage().buckets().usage().getBucketUsage("");
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

response = telnyx.storage.buckets.usage.get_bucket_usage("")

puts(response)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$response = $client->storage->buckets->usage->getBucketUsage('');

var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx storage:buckets:usage get-bucket-usage \
--api-key 'My API Key' \
--bucket-name ''
curl --request GET \
--url https://api.telnyx.com/v2/storage/buckets/{bucketName}/usage/storage \
--header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "size": 123456,
      "size_kb": 123456,
      "num_objects": 123456,
      "timestamp": "2020-01-01T00:00:00Z"
    }
  ],
  "meta": {
    "page_number": 2,
    "page_size": 25,
    "total_pages": 3,
    "total_results": 55
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

bucketName
string
required

The name of the bucket

Response

Bucket Storage Usage

data
object[]
meta
object