diff --git a/.github/services/yandex_disk/yandex_disk/action.yml b/.github/services/yandex_disk/yandex_disk/action.yml new file mode 100644 index 00000000000..b76cf1c0e9c --- /dev/null +++ b/.github/services/yandex_disk/yandex_disk/action.yml @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: yandex_disk +description: 'Behavior test for Yandex Disk.' + +runs: + using: "composite" + steps: + - name: Setup + uses: 1password/load-secrets-action@v1 + with: + export-env: true + env: + OPENDAL_YANDEX_DISK_ACCESS_TOKEN: op://services/yandex_disk/access_token diff --git a/bindings/java/Cargo.toml b/bindings/java/Cargo.toml index 117a4ee62e0..ffcd629524d 100644 --- a/bindings/java/Cargo.toml +++ b/bindings/java/Cargo.toml @@ -92,6 +92,7 @@ services-all = [ "services-b2", "services-seafile", "services-upyun", + "services-yandex-disk" ] # Default services provided by opendal. @@ -149,6 +150,7 @@ services-tikv = ["opendal/services-tikv"] services-upyun = ["opendal/services-upyun"] services-vercel-artifacts = ["opendal/services-vercel-artifacts"] services-wasabi = ["opendal/services-wasabi"] +services-yandex-disk = ["opendal/services-yandex-disk"] [dependencies] anyhow = "1.0.71" diff --git a/bindings/nodejs/Cargo.toml b/bindings/nodejs/Cargo.toml index 7a4e99dcd1f..9821a9fefc2 100644 --- a/bindings/nodejs/Cargo.toml +++ b/bindings/nodejs/Cargo.toml @@ -87,6 +87,7 @@ services-all = [ "services-upyun", "services-vercel-artifacts", "services-wasabi", + "services-yandex-disk", ] # Default services provided by opendal. @@ -144,6 +145,7 @@ services-tikv = ["opendal/services-tikv"] services-upyun = ["opendal/services-upyun"] services-vercel-artifacts = ["opendal/services-vercel-artifacts"] services-wasabi = ["opendal/services-wasabi"] +services-yandex-disk = ["opendal/services-yandex-disk"] [lib] crate-type = ["cdylib"] diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 7ed79ab2ce1..96132f42ea3 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -89,6 +89,7 @@ services-all = [ "services-seafile", "services-upyun", "services-koofr", + "services-yandex-disk" ] # Default services provided by opendal. @@ -146,6 +147,7 @@ services-tikv = ["opendal/services-tikv"] services-upyun = ["opendal/services-upyun"] services-vercel-artifacts = ["opendal/services-vercel-artifacts"] services-wasabi = ["opendal/services-wasabi"] +services-yandex-disk = ["opendal/services-yandex-disk"] [lib] crate-type = ["cdylib"] diff --git a/core/src/services/yandex_disk/error.rs b/core/src/services/yandex_disk/error.rs index c56c40e84ff..05020e64d79 100644 --- a/core/src/services/yandex_disk/error.rs +++ b/core/src/services/yandex_disk/error.rs @@ -43,6 +43,8 @@ pub async fn parse_error(resp: Response) -> Result { 400 => (ErrorKind::InvalidInput, false), 410 | 403 => (ErrorKind::PermissionDenied, false), 404 => (ErrorKind::NotFound, false), + // We should retry it when we get 423 error. + 423 => (ErrorKind::RateLimited, true), 499 => (ErrorKind::Unexpected, true), 503 | 507 => (ErrorKind::Unexpected, true), _ => (ErrorKind::Unexpected, false),