'AWS S3 SDK to Google Cloud Storage - how to get uploaded VersionID?

I have a versioning enabled bucket in GCS. The application I'm working on uses the AWS S3 .NET SDK to connect to a S3-compatible object storage and has been working just fine for this use case.

Now we're also about to support GCS object storage. From my research and testing, GCS offers S3-compatibility through their XML-api. I've tested this and sure enough, GetObject/PutObject/multipart uploads/chunked downloads are all working fine with the code using the S3 library.

However, the compatibility seems to stop when I tried testing the versioning feature: our application makes heavy use of object storage versioned buckets, requesting non-current versions by their VersionID. With the S3 library connecting to the S3 object storage, everything works fine: PutObject and multipart uploads (= CompleteMultipartUpload response) return the VersionID properly. For GCS though, this does not return their version of a "VersionID" (= the object Generation).

Response looks like this: enter image description here I would have expected that GCS returns this Generation as the VersionID in these responses, since they are conceptually the same. But as you can see, VersionID is null (and the bucket is definitely versioning-enabled).

I would just write another implementation class that uses the GCS .NET SDK, but our application heavily relies on chunked uploading where we retrieve a chunk of data from an external source one by one (so we don't have the full Stream of data). This works well with S3's multipart upload (each chunk is uploaded in a separate UploadPart call), but GCS resumable upload expects a Stream that just has all the data right away. So it looks like we really need multipart upload functionality, that we can use through the S3 library with GCS's XML API. If anyone has suggestions on how to make this work with GCS whereby we can upload chunk per chunk in separate calls to construct an object like multipart upload, would also be greatly appreciated.

So my questions are: will receiving the VersionID after uploading just not work with the AWS S3 SDK to Google Cloud Storage or am I doing it wrong? Do I have to look elsewhere in the response for it? Configure some setting to get this properly returned?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source