-
Notifications
You must be signed in to change notification settings - Fork 515
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
feat(core): Implement list with deleted and versions for gcs #5548
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #5548 will not alter performanceComparing Summary
|
2daea28
to
4e9999d
Compare
core/src/services/gcs/core.rs
Outdated
@@ -193,6 +197,10 @@ impl GcsCore { | |||
|
|||
let mut req = Request::get(&url); | |||
|
|||
if let Some(version) = args.version() { | |||
req = req.header(constants::GENERATION, version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generation
is a query parameter: https://cloud.google.com/storage/docs/json_api/v1/objects/get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I misread that, it's been fixed.
core/src/services/gcs/core.rs
Outdated
@@ -372,6 +384,10 @@ impl GcsCore { | |||
|
|||
let mut req = Request::get(&url); | |||
|
|||
if let Some(version) = args.version() { | |||
req = req.header(constants::IF_GENERATION_MATCH, version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IF_GENERATION_MATCH
is used for conditional check, it's not the version.
core/src/services/gcs/core.rs
Outdated
@@ -397,6 +413,10 @@ impl GcsCore { | |||
|
|||
let mut req = Request::head(&url); | |||
|
|||
if let Some(version) = args.version() { | |||
req = req.header(constants::X_GOOG_IF_GENERATION_MATCH, version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same.
core/src/services/gcs/core.rs
Outdated
let mut req = Request::delete(&url); | ||
|
||
if let Some(version) = args.version() { | ||
req = req.header(constants::GENERATION, version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generation
is a query parameter.
core/src/services/gcs/core.rs
Outdated
@@ -534,6 +561,54 @@ impl GcsCore { | |||
self.send(req).await | |||
} | |||
|
|||
pub async fn gcs_list_object_versions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output is the same for GCS. Perhaps we don't need to split it into two functions?
084af79
to
c75ca31
Compare
c75ca31
to
f712cf0
Compare
@Xuanwo Any other questions? |
There are two things in my mind now: The frist, do we really need an extra Then, to support However, this API is
And
For GCS, |
|
Hi, s3 split them because we need two different API calls, requiring distinct parsing logic. However, GCS doesn’t have this issue; we can simply unify them based on different
Oh, you are right. soft_delete is another new feature. |
Which issue does this PR close?
Part of #5496
Rationale for this change
Implement the gcs in RFC we need.
What changes are included in this PR?
Implement list with deleted for gcs services
Implement versions for gcs services
Are there any user-facing changes?
Users can now list deleted files and user versions from gcs services.