feat: allow storage endpoint updates and deletion
This commit is contained in:
@@ -522,6 +522,22 @@ pub async fn test_endpoint(state: &AppState, endpoint: &StorageEndpoint) -> Resu
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn test_existing_object(
|
||||
state: &AppState,
|
||||
endpoint: &StorageEndpoint,
|
||||
key: &str,
|
||||
) -> Result<(), AppError> {
|
||||
let client = client_for(state, endpoint, EndpointKind::Internal)?;
|
||||
client
|
||||
.head_object()
|
||||
.bucket(&endpoint.bucket)
|
||||
.key(key)
|
||||
.send()
|
||||
.await
|
||||
.map_err(|err| storage_error("S3 历史对象访问测试失败", err))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn client_for(
|
||||
state: &AppState,
|
||||
endpoint: &StorageEndpoint,
|
||||
|
||||
Reference in New Issue
Block a user