Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud storage is missing 'compose' functionality #1982

Closed
theacodes opened this issue Jul 13, 2016 · 18 comments
Closed

Cloud storage is missing 'compose' functionality #1982

theacodes opened this issue Jul 13, 2016 · 18 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@theacodes
Copy link
Contributor

No description provided.

@theacodes theacodes added the api: storage Issues related to the Cloud Storage API. label Jul 13, 2016
@daspecster
Copy link
Contributor

@theacodes
Copy link
Contributor Author

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.

@tseaver
Copy link
Contributor

tseaver commented 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
Copy link
Contributor Author

@tseaver our current sample creates a new object from two existing objects.

@tseaver
Copy link
Contributor

tseaver commented 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
Copy link
Contributor Author

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
Copy link
Contributor

tseaver commented 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
Copy link
Contributor

jgeewax commented Jul 14, 2016

@Capstan is our GCS go-to person :)

On Thu, Jul 14, 2016 at 2:23 PM, Tres Seaver [email protected]
wrote:

@jonparrott https://github.com/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).


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1982 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAG5IElgavVoAqXrtvEbQgVk5zaXBnsdks5qVn6VgaJpZM4JLrp8
.

@theacodes
Copy link
Contributor Author

@tseaver makes sense. I think you can append to an existing blob, but @Capstan will have to verify.

@theacodes theacodes added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. blocks-docs-samples labels Jul 14, 2016
@tseaver
Copy link
Contributor

tseaver commented 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
Copy link
Contributor Author

@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
Copy link
Contributor

tseaver commented Jul 18, 2016

@jonparrott OK. How do you deal with drift?

@theacodes
Copy link
Contributor Author

Tests, tests, and more tests. We also optimistically update dependencies and fix as needed.

@tseaver
Copy link
Contributor

tseaver commented 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
Copy link
Contributor Author

We have nightly tests and an automated dependency checker (which right now we're behind on for reasons).

@tseaver
Copy link
Contributor

tseaver commented 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
Copy link

Capstan commented 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
Copy link
Contributor

tseaver commented Oct 4, 2016

@Capstan thanks for the clarification.

@tseaver tseaver self-assigned this Oct 5, 2016
richkadel pushed a commit to richkadel/google-cloud-python that referenced this issue May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

5 participants