You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/03/30 05:32:54 UTC

[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #1801: feat(gcs): add support for gcs append

Xuanwo commented on code in PR #1801:
URL: https://github.com/apache/incubator-opendal/pull/1801#discussion_r1152753889


##########
core/src/services/gcs/backend.rs:
##########
@@ -625,6 +641,85 @@ impl GcsBackend {
 
         self.client.send_async(req).await
     }
+
+    async fn gcs_initiate_multipart_upload(
+        &self,
+        path: &str,
+    ) -> Result<Response<IncomingAsyncBody>> {
+        let p = build_abs_path(&self.root, path);
+        let url = format!("{}/{}/{}?uploads", self.endpoint, self.bucket, p);
+        let mut req = Request::post(&url)
+            .body(AsyncBody::Empty)
+            .map_err(new_request_build_error)?;
+        self.signer.sign(&mut req).map_err(new_request_sign_error)?;
+        self.client.send_async(req).await
+    }
+
+    pub fn gcs_upload_part_request(
+        &self,
+        path: &str,
+        upload_id: &str,
+        part_number: usize,
+        size: Option<u64>,
+        body: AsyncBody,
+    ) -> Result<Request<AsyncBody>> {
+        let p = build_abs_path(&self.root, path);
+        let url = format!(
+            "{}/{}/{}?partNumber={}&uploadId={}",

Review Comment:
   This API is part of gcs's XML API is can't be used here. We should use gcs's JSON API. For example: https://cloud.google.com/storage/docs/resumable-uploads



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org