Getting an Object Storage Bucket's Details
View the details of an Object Storage bucket.
Use the oci os bucket get command and required parameters to get the details of a bucket:
oci os bucket get --name bucket_name [OPTIONS]
For example:oci os bucket get --name MyBucket { "data": { "approximate-count": null, "approximate-size": null, "auto-tiering": null, "compartment-id": "ocid.compartment.oc1..exampleuniqueID", "created-by": "ocid1.user.oc1..exampleuniqueID", "defined-tags": {}, "etag": "7b7c3dc1-713f-4996-b176-a938345cae8e", "freeform-tags": {}, "id": "ocid1.bucket.oc1..exampleuniqueID", "is-read-only": false, "kms-key-id": null, "metadata": {}, "name": "MyBucket", "namespace": "MyNamespace", "object-events-enabled": false, "object-lifecycle-policy-etag": null, "public-access-type": "NoPublicAccess", "replication-enabled": false, "storage-tier": "Standard", "time-created": "2020-06-22T19:04:05.879000+00:00", "versioning": "Disabled" }, "etag": "7b7c3dc1-713f-4996-b176-a938345cae8e" }
Viewing Bucket Size and Number of Objects in the Bucket
Use the
fields
parameter and its supported values to get information on the count and size of objects contained in a bucket.approximateCount
is the approximate number of objects in the bucket. Count statistics are reported periodically. You might see a lag between what is displayed and the actual object count.approximateSize
is the approximate total size of all objects in the bucket. Size statistics are reported periodically. You might see a lag between what is displayed and the actual size of the bucket.
For example:
For example:oci os bucket get --name bucket_name --fields approximateCount --fields approximateSize [OPTIONS]
oci os bucket get --name MyBucket --fields approximateCount --fields approximateSize { "data": { "approximate-count": 25, "approximate-size": 8075918, "auto-tiering": null, "compartment-id": "ocid1.compartment.oc1..exampleuniqueID", "created-by": "ocid1:user:oc1:phx:1458751937789:exampleuniqueID", "defined-tags": {}, "etag": "218f201f-28a4-434d-9591-f05b6223c67a", "freeform-tags": {}, "id": "ocid1.bucket.oc1..exampleuniqueID", "is-read-only": false, "kms-key-id": null, "metadata": {}, "name": "MyBucket", "namespace": "MyNamespace", "object-events-enabled": false, "object-level-audit-mode": "Disabled", "object-lifecycle-policy-etag": null, "public-access-type": "NoPublicAccess", "replication-enabled": false, "storage-tier": "Standard", "time-created": "2017-10-19T04:11:32.040000+00:00", "versioning": "Disabled" }, "etag": "218f201f-28a4-434d-9591-f05b6223c67a" }
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the GetBucket operation to get the details of a bucket.
When accessing the Object Storage API, the bucket name is used with the Object Storage namespace name to form the request URL:
n/object_storage_namespace/b/bucket