Is it a Billable Op Changing Storage Class of Existing Objects?

北战南征 提交于 2019-12-11 03:27:51

问题


I was trying to change storage class of a set of existing objects (over 300 GBs) as advised in this post:

I tried it on one file first:

fyn@pod-arch:~$ gsutil ls -L gs://some-bucket/sub-dir/audioArch.mp3
gs://some-bucket/sub-dir/audioArch.mp3:
    Creation time:          Fri, 29 Jul 2016 00:52:51 GMT
    Update time:            Fri, 05 Aug 2016 15:40:51 GMT
    Storage class:          DURABLE_REDUCED_AVAILABILITY
    Content-Language:       en
    Content-Length:         43033404
    Content-Type:           audio/mpeg
    ... ...

fyn@pod-arch:~$ gsutil -m rewrite -s coldline gs://some-bucket/sub-dir/audioArch.mp3
- [1/1 files][ 41.0 MiB/ 41.0 MiB] 100% Done
Operation completed over 1 objects/41.0 MiB.

fyn@pod-arch:~$ gsutil ls -L gs://some-bucket/sub-dir/audioArch.mp3
gs://some-bucket/sub-dir/audioArch.mp3:
    Creation time:          Sun, 30 Oct 2016 23:49:34 GMT
    Update time:            Sun, 30 Oct 2016 23:49:34 GMT
    Storage class:          COLDLINE
    Content-Language:       en
    Content-Length:         43033404
    Content-Type:           audio/mpeg
    ... ...

Then I tried it on 15 more, and then on the rest of the objects in a subdir... Works like a charm ☺, although the operation overwrites the Creation & Update times!

I had two follow-up queries though:

  1. Is gsutil rewrite operation billable?
  2. Can Creation time be preserved?

Many thanks.

Cheers!

fynali


回答1:


Yes, it is billable as a Class A operation (it uses storage.objects.rewrite, see cloud.google.com/storage/pricing). No, there's no way to preserve the creation/update time because rewrite creates a new object generation.

–Travis Hobrla in comment here



来源:https://stackoverflow.com/questions/40368297/is-it-a-billable-op-changing-storage-class-of-existing-objects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!