GeezerVison is showing github.com — Cloud storage is missing 'compose' functionality · Issue #1982 · googleapis/google-cloud-python
Cloud storage is missing 'compose' functionality #1982Activitydaspecster commented on Jul 13, 2016 theacodes commented on Jul 13, 2016 ContributorAuthor More actions Thanks, @daspecster. This is important so we can write usage samples for gcloud-python that have feature parity with the google-api-python-client samples. Reacted by Thomas Schultz tseaver commented on Jul 14, 2016 @jonparrott Can you clarify whether the compose request is intended only to create a new object, or whether it might replace the content of an existing one? For instance, the docs show two optional query parameters, ifGenerationMatch and ifMetagenerationMatch, which don't make sense for new objects, but the description of the API says, "Concatenates a list of existing objects into a new object."
Also, the request body example has a top-level contentType key which is not documented below it, and which would appear to duplicate the same field from the destination resource. theacodes commented on Jul 14, 2016 ContributorAuthor More actions tseaver commented on Jul 14, 2016 @jonparrott Thanks for the example. I imagine it would look something like this gist, which assumes that compose is an operation on our Bucket class, taking the destination name, a list of our Blob objects as the sources, and a content-type.
is there somebody we should loop in to answer my questions about the API docs? theacodes commented on Jul 14, 2016 ContributorAuthor More actions
is there somebody we should loop in to answer my questions about the API docs?
@jgeewax do we have a particular eng contact for GCS?
which assumes that compose is an operation on our Bucket class, taking the destination name, a list of our Blob objects as the sources, and a content-type.
That could work, it could also be an operation on a blob, which would make it on parity with the API (it's an operation on the object resource):
blob = bucket.blob('composed-object')
blob.compose(part_one, part_two)
It's up to you, I think either way is fine. tseaver commented on Jul 14, 2016 @jonparrott I considered that option: if the API is actually supposed to allow replacing the contents of an existing Object with the composed media, that would definitely be a better spelling. If it can only be used to create a new Object, then making it an operation on the Bucket seems cleaner (I just updated my gist to show bucket.compose() returning the new instance). jgeewax commented on Jul 14, 2016 theacodes commented on Jul 14, 2016 ContributorAuthor More actions @tseaver makes sense. I think you can append to an existing blob, but @Capstan will have to verify. tseaver commented on Jul 18, 2016 @jonparrott speaking of samples, WDYT of keeping them in this repository, so that we can use them within the Sphinx docs / docstrings, like the ones we have for pubsub and bigquery. Then we can arrange to test / fix them as they break. theacodes commented on Jul 18, 2016 ContributorAuthor More actions @tseaver it's be exhaustively discussed. The samples in python-docs-samples are samples included from documentation on cloud.google.com. This sometimes overlaps with samples here, especially for the really basic use cases, but often is more illustrative on how to accomplish a task with the service rather than just use the API. tseaver commented on Jul 18, 2016 theacodes commented on Jul 18, 2016 ContributorAuthor More actions Tests, tests, and more tests. We also optimistically update dependencies and fix as needed. tseaver commented on Jul 18, 2016 @jonparrott Do you have a webhook we should be poking from this repo to trigger those tests for the Python examples? theacodes commented on Jul 18, 2016 ContributorAuthor More actions We have nightly tests and an automated dependency checker (which right now we're behind on for reasons). tseaver commented on Oct 3, 2016 @Capstan can you verify whether the compose operation always creates a new object, or might be used to append to an existing one? Capstan commented on Oct 3, 2016 It logically always creates a new object. That said, creating a new object on top of an old object overwrites the old object, so you can do an extremely limited mimic of append by writing a separate object and composing the original and the separate object with a destination of the original object. This matters more if you have versioning turned on, as the old version will stick around. tseaver commented on Oct 4, 2016 added a commit that references this issue on May 6, 2017This issue will close once commit 48be505 is merged into the 'master' branch.48be505
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|