Skip to content

Account for existing objects in bucket when using storage.bucket.Bucket.upload_file #162

Closed

Description

@dhermes

From TODO:

    # TODO: What do we do about overwriting data?

See storage.bucket.Bucket.upload_file for relevant code and #146 for some context.

git blame output

b7f1b774 (JJ Geewax   2014-01-29 18:02:29 -0500 201)     # TODO: What do we do about overwriting data?

Activity

  1. dhermes commented on Sep 22, 2014

    @dhermes
    ContributorAuthor

    It's possible there is an API feature to only write if doesn't exist (though race conditions may make this a PITA). May also be worth requesting from API eng team?

  2. added this to the milestone on Sep 24, 2014
  3. tseaver commented on Oct 29, 2014

    @tseaver
    Contributor

    Once support for the lifecycle field of the bucket resource lands (see #314), this issue will resolve: buckets with no lifecycle defined will overwrite without checking for existing objects, while those with lifecycle policies will obey them (generations, etc.).

  4. tseaver commented on Oct 29, 2014

    @tseaver
    Contributor

    See the lifecycle spec for notes on configuring the bucket's lifecycle policy.

  5. tseaver commented on Oct 31, 2014

    @tseaver
    Contributor

    The lifecycle rules for number of versions will only be effective if object versioning is enabled on the bucket. Currently, we can enable this via:

    self.patch_metadata({'versioning': {'enabled': True})
    

    #314 proposes adding more direct support for the versioning and lifecycle fields (along with others).

  6. added a commit that references this issue on Nov 3, 2014
    a0df78a
  7. modified the milestones: , Storage Stable on Jan 30, 2015
  8. added a commit that references this issue on Jan 17, 2020
  9. 85 remaining items

  10. added 8 commits that reference this issue on Nov 22, 2025
    bde2247
    1f800b9
    a73ac6d
    381f60b
    6c39bb4
    b7caf11
    7c0c837
    a612dff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions