Set bucket storage class
Updated at:2025-11-03
Set bucket storage class
A newly created bucket is of the standard storage class by default. You can set or get the storage class of a specified bucket through the following code:
- Basic workflow
- Create a BosClient
- Call the putBucketStorageclass() method
-
Example code
JavaScript1client.putBucketStorageclass(<BucketName>,<storageClass>) 2 .then(function() { 3 // Setup completed 4 }) 5 .catch(function(error) { 6 // Setup failed 7 }); - Request parameters
| Parameters | Description |
|---|---|
| BucketName | Bucket name |
| storageClass | Storage classes supported: 'STANDARD' (standard storage class), 'STANDARD_IA' (infrequent access storage), 'ARCHIVE' (archive storage), 'COLD' (cold storage), 'MAZ_STANDARD' (standard storage - multi-AZ), 'MAZ_STANDARD_IA' (infrequent access storage - multi-AZ) |
