GetStats
Returns the statistics for the specified bucket.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetBucketStatsRequest =
cloudApi.storage.bucket_service.GetBucketStatsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.BucketServiceClient);
const result = await client.getStats(
GetBucketStatsRequest.fromPartial({
name: "name",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.storage.v1.bucket_service_pb2_grpc import BucketServiceStub
from yandex.cloud.storage.v1.bucket_service_pb2 import GetBucketStatsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(BucketServiceStub)
response = service.GetStats(GetBucketStatsRequest(name="name"))
print(response)
GetBucketStatsRequest
name
: string
Name of the bucket to return the statistics for.
BucketStats
A bucket statistics resource.
name
: string
Name of the bucket.
maxSize
: google.protobuf.Int64Value
Maximum size of the bucket, in bytes.
usedSize
: int64
Size of used space in the bucket, in bytes.
storageClassMaxSizes
: OptionalSizeByClass
Size of available space in the bucket by storage class, in bytes.
storageClassUsedSizes
: SizeByClass
Size of used space in the bucket by storage class, in bytes.
storageClassCounters
: CountersByClass
Object-related statistics by storage class and type of upload (simple vs. multipart), in bytes.
defaultStorageClass
: google.protobuf.StringValue
Default storage class for objects in the bucket. Supported classes are standard storage (STANDARD
), cold storage
(COLD
, STANDARD_IA
, NEARLINE
all synonyms), and ice storage (ICE
and GLACIER
are synonyms).
For details, see documentation.
anonymousAccessFlags
: AnonymousAccessFlags
Flags for configuring public (anonymous) access to the bucket's content and settings. For details, see documentation.
createdAt
: google.protobuf.Timestamp
Bucket creation timestamp.
updatedAt
: google.protobuf.Timestamp
Bucket latest update timestamp.
OptionalSizeByClass
A resource for size of available space in a bucket for a storage class.
storageClass
: string
Storage class. Supported classes are standard storage (STANDARD
), cold storage (COLD
, STANDARD_IA
, NEARLINE
all synonyms), and ice storage (ICE
and GLACIER
are synonyms).
For details, see documentation.
classSize
: google.protobuf.Int64Value
Size of available space in the bucket for the storage class.
SizeByClass
A resource for size of used space in a bucket for a storage class.
storageClass
: string
Storage class. Supported classes are standard storage (STANDARD
), cold storage (COLD
, STANDARD_IA
, NEARLINE
all synonyms), and ice storage (ICE
and GLACIER
are synonyms).
For details, see documentation.
classSize
: int64
Size of used space in the bucket for the storage class.
CountersByClass
A resource for object-related statistics for a storage class by type of upload (simple vs. multipart).
storageClass
: string
Storage class. Supported classes are standard storage (STANDARD
), cold storage (COLD
, STANDARD_IA
, NEARLINE
all synonyms), and ice storage (ice
and GLACIER
are synonyms).
For details, see documentation.
counters
: Counters
Object-related statistics for the storage class by type of upload.
AnonymousAccessFlags
read
: google.protobuf.BoolValue
Specifies whether public (anonymous) access to read objects in the bucket is enabled.
list
: google.protobuf.BoolValue
Specifies whether public (anonymous) access to the list of objects in the bucket is enabled.
configRead
: google.protobuf.BoolValue
Specifies whether public (anonymous) access to read CORS, static website hosting, and object lifecycles settings of the bucket is enabled.
Counters
simpleObjectSize
: int64
Total size of objects uploaded in single operation, in bytes.
simpleObjectCount
: int64
Number of objects uploaded in single operation.
objectsPartsSize
: int64
Total size of uploaded parts in incomplete multipart uploads, in bytes.
objectsPartsCount
: int64
Number of uploaded parts in incomplete multipart uploads.
multipartObjectsSize
: int64
Total size of objects uploaded in multiple parts, in bytes.
multipartObjectsCount
: int64
Number of objects uploaded in multiple parts.
activeMultipartCount
: int64
Number of incomplete multipart uploads.