A solutions developer needs to upload a large database export named `db_archive.tar.gz` to an existing Google Cloud Storage bucket named `corp-database-backups`. The bucket currently uses the Standard storage class by default for newly uploaded objects. However, to minimize immediate storage costs for this specific file, the developer must ensure that `db_archive.tar.gz` is assigned the Coldline storage class directly during the upload process, without changing the default storage class configuration of the bucket itself. Which Google Cloud CLI command should the developer execute to achieve this?
- Agcloud storage buckets update gs://corp-database-backups --default-storage-class=COLDLINE
- gcloud storage cp db_archive.tar.gz gs://corp-database-backups/ --storage-class=COLDLINECevap
- Cgsutil cp --default-storage-class=COLDLINE db_archive.tar.gz gs://corp-database-backups/
- Dgcloud storage objects update gs://corp-database-backups/db_archive.tar.gz --storage-class=COLDLINE
Cevap
Execute the command: gcloud storage cp db_archive.tar.gz gs://corp-database-backups/ --storage-class=COLDLINE
The correct command uses `gcloud storage cp` accompanied by the `--storage-class=COLDLINE` parameter. This uploads the specific file to the target Google Cloud Storage bucket and assigns it the Coldline storage class upon creation, leaving the bucket's default storage class setting untouched for other uploads.
Adım Adım Çözüm
Anahtar Kavram
Per-Object Storage Class Specification during Upload using gcloud storage CLI