import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.storage.buckets.usage.getAPIUsage('', {
filter: { end_time: '2019-12-27T18:11:19.117Z', start_time: '2019-12-27T18:11:19.117Z' },
});
console.log(response.data);{
"data": [
{
"categories": [
{
"bytes_sent": [
123456
],
"bytes_received": [
123456
],
"ops": [
123456
],
"successful_ops": [
123456
],
"category": [
"put_obj"
]
}
],
"total": {
"bytes_sent": [
123456
],
"bytes_received": [
123456
],
"ops": [
123456
],
"successful_ops": [
123456
]
},
"timestamp": [
"2020-01-01T00:00:00Z"
]
}
]
}Returns the detail on API usage on a bucket of a particular time period, group by method category.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.storage.buckets.usage.getAPIUsage('', {
filter: { end_time: '2019-12-27T18:11:19.117Z', start_time: '2019-12-27T18:11:19.117Z' },
});
console.log(response.data);{
"data": [
{
"categories": [
{
"bytes_sent": [
123456
],
"bytes_received": [
123456
],
"ops": [
123456
],
"successful_ops": [
123456
],
"category": [
"put_obj"
]
}
],
"total": {
"bytes_sent": [
123456
],
"bytes_received": [
123456
],
"ops": [
123456
],
"successful_ops": [
123456
]
},
"timestamp": [
"2020-01-01T00:00:00Z"
]
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The name of the bucket
Consolidated filter parameter (deepObject style). Originally: filter[start_time], filter[end_time]
Bucket Usage
Show child attributes
Show child attributes
The number of bytes sent
[123456]The number of bytes received
[123456]The number of operations
[123456]The number of successful operations
[123456]The category of the bucket operation
list_bucket, list_buckets, get-bucket_location, create_bucket, stat_bucket, get_bucket_versioning, set_bucket_versioning, get_obj, put_obj, delete_obj ["put_obj"]Show child attributes
The time the usage was recorded
["2020-01-01T00:00:00Z"]Was this page helpful?