From ee95f36ef23e0d2daf89d85d1d5285e6156ada28 Mon Sep 17 00:00:00 2001 From: zhaoxinxin <1186037180@qq.com> Date: Thu, 29 Aug 2024 21:08:33 +0800 Subject: [PATCH] docs: change commands dfget example Signed-off-by: zhaoxinxin <1186037180@qq.com> --- docs/reference/commands/client/dfget.md | 46 +++++++++--- .../reference/commands/client/dfget.md | 74 +++++++++++++------ 2 files changed, 87 insertions(+), 33 deletions(-) diff --git a/docs/reference/commands/client/dfget.md b/docs/reference/commands/client/dfget.md index f659d05..1ab2761 100644 --- a/docs/reference/commands/client/dfget.md +++ b/docs/reference/commands/client/dfget.md @@ -143,55 +143,79 @@ Options: ## Example {#example} -### Download a file from HTTP server {#downlad-file-with-http} +### Download with HTTP protocol {#downlad-with-http} ```shell dfget https://:/ -O /tmp/file.txt ``` -### Download a file from Amazon Simple Storage Service (S3) {#downlad-file-with-s3} +### Download with S3 protocol {#downlad-with-s3} ```shell +# Download a file. dfget s3:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= + +# Download a directory. +dfget s3:/// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= ``` -### Download a file from Google Cloud Storage Service (GCS) {#downlad-file-with-gcs} +### Download with GCS protocol {#downlad-with-gcs} ```shell -dfget gs:/// -O /tmp/file.txt --storage-credential_path= +# Download a file. +dfget gs:/// -O /tmp/file.txt --storage-credential-path= --storage-endpoint= + +# Download a directory. +dfget gs://// -O /tmp/path/ --storage-credential-path= --storage-endpoint= ``` -### Download a file from Azure Blob Storage Service (ABS) {#downlad-file-with-abs} +### Download with ABS protocol {#downlad-with-abs} ```shell -dfget abs:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= +# Download a file. +dfget abs:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= + +# Download a directory. +dfget abs://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= ``` -### Download a file from Aliyun Object Storage Service (OSS) {#downlad-file-with-oss} +### Download with OSS protocol {#downlad-with-oss} ```shell +# Download a file. dfget oss:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= + +# Download a directory. +dfget oss://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= ``` -### Download a file from Huawei Cloud Object Storage Service (OBS) {#downlad-file-with-obs} +### Download with OBS protocol {#downlad-with-obs} ```shell +# Download a file. dfget obs:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= + +# Download a directory. +dfget obs://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= ``` -### Download a file from Tencent Cloud Object Storage Service (COS) {#downlad-file-with-cos} +### Download with COS protocol {#downlad-with-cos} > Note: The endpoint does not require `BucketName-APPID`, just --storage-endpoint=cos.region.myqcloud.com. ```shell +# Download a file. dfget cos:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= + +# Download a directory. +dfget cos://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= ``` + + ## Log {#log} ```text 1. set option --verbose if you want to print logs to Terminal 2. log path: /var/log/dragonfly/dfget/ ``` - - diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfget.md b/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfget.md index 559d07e..ea31bac 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfget.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfget.md @@ -4,21 +4,27 @@ title: Dfget slug: /reference/commands/client/dfget/ --- -`dfget` 是 Dragonfly 中用来下载和上传文件的客户端。dfget 上传和下载过程中需要使用 dfdaemon GRPC 服务的 unix socket, -使用 dfget 必须开启 dfdaemon。 +`dfget` is the client of Dragonfly used to download and upload files. +The unix socket of the dfdaemon GRPC service needs to be used during the upload and download process of dfget. +To use dfget, dfdaemon must be started. -## 用法 +## Usage {#usage} -dfget 是 Dragonfly 中用来下载和上传文件的客户端,也是 p2p 网络中的一个 peer。当用户发起文件下载请求时, -dfget 将从其他 peer 下载文件。同时,它也能作为上传者,让其他 peer 下载它已拥有的那部分文件。 -此外,dfget 还提供了一些高级功能,如网络带宽限制、加密传输等。 +dfget is the client of Dragonfly which takes +a role of peer in a P2P network. When user triggers a file downloading +task, dfget will download the pieces of +file from other peers. Meanwhile, it will act as an uploader to support other +peers to download pieces from it if it owns them. +In addition, dfget has the abilities to provide more advanced +functionality, such as network bandwidth limit, +transmission encryption and so on. ```shell dfget -O dfget [command] ``` -## 可选参数 +## Options {#options} @@ -92,8 +98,8 @@ Options: --storage-session-token Specify the session token for Amazon Simple Storage Service(S3) - --storage-credential - Specify the credential for Google Cloud Storage Service(GCS) + --storage-credential-path + Specify the local path to credential file for Google Cloud Storage Service(GCS) --storage-predefined-acl Specify the predefined ACL for Google Cloud Storage Service(GCS) @@ -135,57 +141,81 @@ Options: Print version ``` -## 例子 +## Example {#example} -### HTTP server 下载文件 {#downlad-file-with-http} +### Download with HTTP protocol {#downlad-with-http} ```shell dfget https://:/ -O /tmp/file.txt ``` -### Amazon Simple 存储服务 (S3) 下载文件 {#downlad-file-with-s3} +### Download with S3 protocol {#downlad-with-s3} ```shell +# Download a file. dfget s3:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= + +# Download a directory. +dfget s3:/// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= ``` -### Google Cloud 存储服务 (GCS) 下载文件 {#downlad-file-with-gcs} +### Download with GCS protocol {#downlad-with-gcs} ```shell -dfget gs:/// -O /tmp/file.txt --storage-credential_path= +# Download a file. +dfget gs:/// -O /tmp/file.txt --storage-credential-path= + +# Download a directory. +dfget gs://// -O /tmp/path/ --storage-credential-path= ``` -### Azure Blob 存储服务 (ABS) 下载文件 {#downlad-file-with-abs} +### Download with ABS protocol {#downlad-with-abs} ```shell +# Download a file. dfget abs:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= + +# Download a directory. +dfget abs://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= ``` -### 阿里云对象存储服务(OSS)下载文件 {#downlad-file-with-oss} +### Download with OSS protocol {#downlad-with-oss} ```shell +# Download a file. dfget oss:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= + +# Download a directory. +dfget oss://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= ``` -### 华为云对象存储服务(OBS)下载文件 {#downlad-file-with-obs} +### Download with OBS protocol {#downlad-with-obs} ```shell +# Download a file. dfget obs:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= + +# Download a directory. +dfget obs://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= ``` -### 腾讯云对象存储服务(COS)下载文件 {#downlad-file-with-cos} +### Download with COS protocol {#downlad-with-cos} -> 注意: endpoint 不需要添加 `BucketName-APPID`,--storage-endpoint=cos.region.myqcloud.com 即可。 +> Note: The endpoint does not require `BucketName-APPID`, just --storage-endpoint=cos.region.myqcloud.com. ```shell +# Download a file. dfget cos:/// -O /tmp/file.txt --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= + +# Download a directory. +dfget cos://// -O /tmp/path/ --storage-access-key-id= --storage-access-key-secret= --storage-endpoint= ``` -## 日志 +## Log {#log} ```text -1. 终端日志输出需要增加命令行参数 --verbose -2. 正常情况日志目录: /var/log/dragonfly/dfget/ +1. set option --verbose if you want to print logs to Terminal +2. log path: /var/log/dragonfly/dfget/ ```