Storage Usage
servinga Cloud
servinga Cloud customers can find statistics about the used storage of their S3 buckets in the servinga Cloud Panel on the detail page of each bucket respectively.
Alternatively, the same method as described below can be utilized by servinga Cloud customers to get programmatical access to their bucket usage statistics.
servinga Managed Services
Customers of servinga Managed Services who didn't obtain their bucket access via servinga Cloud can request information about their bucket usage statistics from an API endpoint. The endpoint depends on the S3 data location your bucket resides within.
When making the request, the bucket credentials need to be provided in the HTTP headers of the request.
Credentials | Header |
---|---|
Access Key | X-Access-Key |
Secret Key | X-Secret-Key |
The response of the usage API endpoint will be in JSON and look like this:
{
"id": "e7278305-ab36-4b12-bc79-6d2c590a694f.194558136.3",
"bucket": "your-bucket-name",
"owner": "your-username",
"usage": {
"utilized_size": 215606800,
"actual_size": 215606820,
"objects": 890
}
}
The actual_size
represents the accumulated size of all stored objects after the distribution in 4096-byte (4K) blocks in kilobytes. Due to the nature of object storage, an object's actual size is always rounded up to the next 4096-byte block size.
If a bucket consists of two objects where one object has a size of 4,200 bytes, and the second object has a size of 8,900 bytes, the first object's actual size will be 8192 bytes (2 * 4096 bytes
, as 4096 < 4200 < 8192
) and the second object's actual size will be 12288 bytes (3 * 4096 bytes
, as 8192 < 8900 < 12288
).
The actual_size
is the base size being used for billing and accounting purposes. The "real size" of the file doesn't matter. If you're going to upload a file with a size of a single byte, our system will still assume storage utilization of 4096 bytes.
The utilized_size
is the total size of the stored data in kilobytes after compression and/or encryption, if applicable. While encrypting your data could increase its size, applying compression could decrease it.
The objects
simply represents the number of objects that is being stored within the bucket and is for informational purposes, only.
The response you get from the API endpoint is being cached for 30 minutes to reduce the load on our internal APIs. Also, the underlying utilization statistic is not recalculated in real-time.
Netherlands, Rotterdam
https://nl.s3.servinga.cloud/api/v1/bucket/{bucket_name}/usage
Example
You can call the API endpoint with curl
using the following example command. Make sure to replace your bucket name, access key and secret key. As the response is in JSON, you can pretty-print it using jq
.
ACCESS_KEY=<your-access-key>
SECRET_KEY=<your-secret-key>
BUCKET=<your-bucket-name>
curl -s -H "X-Access-Key: $ACCESS_KEY" -H "X-Secret-Key: $SECRET_KEY" https://nl.s3.servinga.cloud/api/v1/bucket/$BUCKET/usage | jq .
Under Windows, you can utilize the Invoke-RestMethod
cmdlet in the PowerShell command line to make the request.
Invoke-RestMethod -Uri "https://nl.s3.servinga.cloud/api/v1/bucket/<YOUR_BUCKET>/usage" -Headers @{
"X-Access-Key" = "<YOUR_ACCESS_KEY>"
"X-Secret-Key" = "<YOUR_SECRET_KEY>"
} | ConvertTo-Json