Easy1 markMultiple Choice

GCP ACE · Question 37 · Domain 4.4: Managing storage and database solutions

You have an object named report.pdf in a Cloud Storage bucket. It is currently stored in the Standard storage class. You want to change its storage class to Nearline using the command line.

Which command should you use?

Answer options:

A.

gsutil rewrite -s nearline gs://my-bucket/report.pdf

B.

gsutil cp -c nearline gs://my-bucket/report.pdf

C.

gcloud storage class update nearline gs://my-bucket/report.pdf

D.

You cannot change the storage class of an existing object; you must download and re-upload it.

How to approach this question

Recall the specific gsutil command used to modify metadata/storage classes of existing objects.

Full Answer

A.gsutil rewrite -s nearline gs://my-bucket/report.pdf✓ Correct
gsutil rewrite -s nearline gs://my-bucket/report.pdf
To change the storage class of an existing object in Cloud Storage without downloading and re-uploading it, you use the `gsutil rewrite` command with the `-s` flag to specify the new storage class. For example: `gsutil rewrite -s nearline gs://[BUCKET_NAME]/[OBJECT_NAME]`.

Common mistakes

Assuming objects are immutable regarding storage class, or guessing incorrect flags for `gsutil cp`.

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam