diff --git a/README.md b/README.md index 9f4b3d8..475cdbb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ **其他语言: [English](README_en.md) | [中文](README.md)** -# JCS-pub(云际存储公共基础设施+开箱即用云际存储客户端) +# JCS-pub(云际存储公共基础设施)+ JCS-client(开箱即用云际存储客户端) + ## 项目简介 云际存储是基于云际对等协作机制,纳管多个云的存储资源,为用户提供统一数据存储服务的一种存储服务模式。其核心理念是强调各个云的对等独立地位,通过非侵入方式联接多个云的存储资源;强调云际协作,综合运用各个云的存算网资源,提供高质量存储服务。 @@ -66,13 +67,13 @@ - 请发邮件至`song-jc@foxmail.com`领取账号密码和证书,申请流程如下图。
-
+ ## 架构图
-
+ ### 1、云存储空间 - 使用云际存储客户端前,用户需自行准备云存储空间。云存储空间主要指对象存储服务的桶和文件存储服务的目录。可使用用户在公有云开通的云存储服务,也可以使用用户私有的云存储服务。 diff --git a/README_en.md b/README_en.md index ffe72d7..5898258 100644 --- a/README_en.md +++ b/README_en.md @@ -1,17 +1,17 @@ **Read in: [English](README_en.md) | [中文](README.md)** -# JCS-pub (JointCloud Storage Public Infrastructure + Ready-to-Use Storage Client) +# JCS-pub (JointCloud Storage Public Infrastructure) + JCS-client (Ready-to-Use JointCloud Storage Client) ## Project Overview -JointCloud Storage is a storage service model built on a peer-to-peer jointcloud collaboration mechanism. It manages storage resources across multiple clouds and provides users with a unified data storage service. The core idea emphasizes the independent and equal status of each cloud, connecting them in a non-intrusive manner. It also promotes intercloud collaboration by integrating computing, storage, and networking resources across clouds to deliver high-quality storage services. +JointCloud Storage is a storage service model built on a peer-to-peer JointCloud collaboration mechanism. It manages storage resources across multiple clouds and provides users with a unified data storage service. The core idea emphasizes the independent and equal status of each cloud, connecting them in a non-intrusive manner. It also promotes intercloud collaboration by integrating computing, storage, and networking resources across clouds to deliver high-quality storage services. -This project aims to turn JointCloud Storage into a public infrastructure that is easy to use for individuals and enterprises alike. By simply using a ready-to-use storage client, users can quickly access efficient jointcloud storage without the need to deploy additional components. At the same time, the system allows flexible customization of its features to meet diverse needs. +This project aims to turn JointCloud Storage into a public infrastructure that is easy to use for individuals and enterprises alike. By simply using a JCS-client, users can quickly access efficient jointcloud storage without the need to deploy additional components. At the same time, the system allows flexible customization of its features to meet diverse needs. ## Evolution Roadmap
-
+ ## Features @@ -23,7 +23,7 @@ This project aims to turn JointCloud Storage into a public infrastructure that i - Filtering Rules: Migrate files based on size, file extension, or directory path. - Scheduling Control: Define migration time windows. - Post-Migration Actions: Allow users to choose whether to retain or delete the original data after migration. -- **Migration Efficiency Optimization**: Improve migration performance and reduce bandwidth costs by leveraging the **JointCloud Storage Public Infrastructure**. +- **Migration Efficiency Optimization**: Improve migration performance and reduce bandwidth costs by leveraging the JCS-pub. ### 2. Cross-Cloud Data Storage @@ -37,7 +37,7 @@ This project aims to turn JointCloud Storage into a public infrastructure that i - REST API - Command-line interface - FUSE file system -- **Access Efficiency Optimization**: Boost cross-cloud data access speed and reduce traffic costs via the **JointCloud Storage Public Infrastructure**. +- **Access Efficiency Optimization**: Boost cross-cloud data access speed and reduce traffic costs via the JCS-pub. ### 3. Hybrid Local + Multi-Cloud Storage @@ -46,7 +46,7 @@ This project aims to turn JointCloud Storage into a public infrastructure that i - Data Filtering: Dynamically select files for remote sync based on size, path, or extension. - Local Retention: Configure whether to keep local copies of remote data. - Bidirectional Sync: Independently configure local-to-cloud and cloud-to-local synchronization. -- **Collaboration Efficiency Optimization**: Enhance sync performance and reduce traffic costs using the **JointCloud Storage Public Infrastructure**. +- **Collaboration Efficiency Optimization**: Enhance sync performance and reduce traffic costs using the JCS-pub. - **Multiple Data Access Methods** - REST API - Command-line interface @@ -56,7 +56,7 @@ This project aims to turn JointCloud Storage into a public infrastructure that i - Simply download and install the client — no additional components or configuration needed. -### 5. JointCloud Storage Public Infrastructure +### 5. JCS-pub - **Unified Hybrid Storage View**: Supports unified access across **local file systems** and **multiple remote cloud platforms**, abstracting the complexity behind a consistent interface. - **Dual Operation Modes**: @@ -74,16 +74,16 @@ This project aims to turn JointCloud Storage into a public infrastructure that i ## Architecture Diagram
-
+ ### 1. Cloud Storage Space - Before using the JointCloud Storage client, users must prepare their own cloud storage space. This typically refers to object storage buckets or directories in file storage services. Both public cloud storage services and private cloud deployments are supported. - For tutorials on registering mainstream public cloud storage services, see: [Guide](docs/公有云注册及使用教程.md) -### 2. JointCloud Storage Public Infrastructure +### 2. JCS-pub - The public infrastructure consists of multiple proxy nodes. These nodes collaborate with clients to perform cross-cloud operations such as data migration, upload, and download. They also optimize data transfer routes and support concurrent access, improving performance and reducing bandwidth costs. This design prevents the client from becoming a performance bottleneck. -### 3. JointCloud Storage Client +### 3. JCS-client - The JointCloud Storage Client is deployed on the user's server and serves as both a data service gateway and metadata management node. - Users manage their cloud storage data through various interfaces provided by the client. - All metadata and cloud storage credentials remain on the client managed by the user. When a proxy node needs to access a user’s cloud storage, the client temporarily grants access permissions as needed. @@ -233,7 +233,7 @@ By default, `jcsctl` attempts to connect to the client at `https://127.0.0.1:789 ### 3. API -See the API documentation: [Access here](docs/JCS_pub_API.md) +See the API documentation: [Access here](docs/JCS_pub_API_en.md) ## Testing & Evaluation diff --git a/docs/JCS_pub_API.md b/docs/JCS_pub_API.md index 543a88f..4c0511a 100644 --- a/docs/JCS_pub_API.md +++ b/docs/JCS_pub_API.md @@ -1,6 +1,6 @@ # JCS-pub API -**跳转回README.md [中文](../README.md) [English](../README_en.md)** +**跳转回[README.md](../README.md)** ## 1 桶相关 diff --git a/docs/JCS_pub_API_en.md b/docs/JCS_pub_API_en.md new file mode 100644 index 0000000..87dbe86 --- /dev/null +++ b/docs/JCS_pub_API_en.md @@ -0,0 +1,1543 @@ +# JCS-pub API + +**Back to [README.md](../README_en.md)** + +## 1 Bucket Operations + +### 1.1 Create Bucket + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/bucket/create
QueryNone
Body +
{
+    "userID": 1,
+    "name": "bkt1"  // Bucket name
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "bucket": {
+            "bucketID": 1,   // Bucket ID
+            "name": "bkt1"   // Bucket name
+        }
+    }
+}
+
+ +### 1.2 Get Bucket by Name + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/bucket/getByName
Query +

- name:string // Bucket name

+
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+      "bucket": {
+        "bucketID": 1,  // Bucket ID
+        "name": "bkt1"  // Bucket name
+      }
+    }
+}
+
+ +### 1.3 List Buckets + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/bucket/listAll
QueryNone
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+      "buckets": [{
+        "bucketID": 1,  // Bucket ID
+        "name": "bkt1"  // Bucket name
+      }]
+    }
+}
+
+ +### 1.4 Delete Bucket + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/bucket/delete
QueryNone
Body +
{
+    "bucketID":1
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": null
+}
+
+ +## 2 Package Operations + +### 2.1 Create Package + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/package/create
QueryNone
Body +
{
+    "bucketID":1,
+    "name": ""  // Package name
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "package": {
+            "packageID": 32,
+            "name": "t1",
+            "bucketID": 1,
+            "createTime": "2025-06-24T16:31:28.5148754+08:00"
+        }
+    }
+}
+
+ +### 2.2 Get Package by Bucket Name and Package Name + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/package/getByFullName
Query +

- bucketName:string // Bucket name +- packageName:string // Package name

+
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "package": {
+            "packageID": 32,
+            "name": "t1",
+            "bucketID": 1,
+            "createTime": "2025-06-24T16:31:28.5148754+08:00"
+        }
+    }
+}
+
+ +### 2.3 List Packages in Bucket + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/package/listBucketPackages
Query +

- bucketID:int64 // Bucket ID

+
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+      "packages":[{
+            "packageID": 32,
+            "name": "t1",
+            "bucketID": 1,
+            "createTime": "2025-06-24T16:31:28.5148754+08:00"
+        }]
+    }
+}
+
+ +### 2.4 Delete Package + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/package/delete
QueryNone
Body +
{
+    "packageID":1
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": null
+}
+
+ +## 3 Object Operations + +### 3.1 Batch Upload Objects + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTmultipart/form-data; boundary=xxxxxxx/v1/object/upload
QueryNone
Body +

Afterwards, the request body is split into multiple parts using the boundary. The first part must have the name info and follow this JSON format:

+
{
+  "packageID": 1,  // Package ID, obtained from the response of the Create Package API
+  "affinity": 1  // Preferred storage space for uploading the file (optional)
+}
+

Each subsequent part is a file. The name should be files, and the filename should be the file path (must be URL-encoded). +Example:

+
POST /object/upload HTTP/1.1
+User-Agent: PostmanRuntime/7.29.0
+Accept: */*
+Postman-Token: c12fa8b5-d902-46f3-b104-028effa0d531
+Host: localhost:7890
+Accept-Encoding: gzip, deflate, br
+Connection: keep-alive
+Content-Type: multipart/form-data; boundary=-----------------------------818270992847011232305151
+Content-Length: 1649
+
+-----------------------------818270992847011232305151
+Content-Disposition: form-data; name="info"
+
+{
+	"userID": 1,
+	"packageID": 1
+}
+-----------------------------818270992847011232305151
+Content-Disposition: form-data; name="files"; filename="test.txt"
+Content-Type: text/plain
+
+testdata
+-----------------------------818270992847011232305151
+Content-Disposition: form-data; name="files"; filename="a%2Fb%2Ftest2.txt"
+
+testdata2
+-----------------------------818270992847011232305151--
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "uploadeds": [
+            {
+                "objectID": 7,
+                "packageID": 1,
+                "path": "test.txt",
+                "size": "123456",
+                "fileHash": "xxxxxxxxxx",
+                "redundancy": {
+                    "type": "none"
+                },
+                "createTime": "2024-11-05T11:06:28+08:00",
+                "updateTime": "2025-01-10T09:15:39.4452196+08:00"
+            },
+            {
+                "objectID": 8,
+                "packageID": 1,
+                "path": "a/b/test2.txt",
+                "size": "123456",
+                "fileHash": "xxxxxxxxxx",
+                "redundancy": {
+                    "type": "none"
+                },
+                "createTime": "2024-11-05T11:06:28+08:00",
+                "updateTime": "2025-01-10T09:15:39.4452196+08:00"
+            }
+        ]
+    }
+}
+
+ +### 3.2 Download Object + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/object/download
Query +

- objectID:int64 +- offset:int64 +- length:int64 // Length to read. If not provided, the entire object will be read.

+
BodyNone
Response Example
+

If the request is successful, the Content-Type will be application/octet-stream and the response body will contain the file data.
+If the request fails, the Content-Type will be application/json and the response body will be in the following format:

+
{
+    "code": "OperationFailed",
+    "message": "xxxxxxxx",
+    "data": null
+}
+
+ +### 3.3 Download Object by Path + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/object/downloadByPath
Query +

- path:string +- offset:int64 +- length:int64 // Length to read. If not provided, the entire object will be read.

+
BodyNone
Response Example
+

If the request is successful, the Content-Type will be application/octet-stream and the response body will contain the file data.
+If the request fails, the Content-Type will be application/json and the response body will be in the following format:

+
{
+    "code": "OperationFailed",
+    "message": "xxxxxxxx",
+    "data": null
+}
+
+ +### 3.4 Get Object by Path + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/object/listByPath
Query +

- packageID:int64 +- path:string +- isPrefix:bool // If true, perform a prefix search using the path parameter +- noRecursive:bool // If true, when performing a prefix search, the results will separate objects and "directories" like a directory listing +- maxKeys:int // Maximum number of results returned in this query (the total number of items in commonPrefixes + objects) +- continuationToken:string // Start this query from the position specified by the token; leave empty to start from the beginning. This value should be the same as the corresponding field from the previous response.

+
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "nextContinuationToken": "123456", // Used for the next paginated query
+        "isTruncated": false, // If true, it indicates more results are available for the next query
+        "commonPrefixes": [
+            "a/b/",
+            "a/c/"
+        ],
+        "objects": [
+            {
+                "objectID": 617,
+                "packageID": 12,
+                "path": "a/1.txt",
+                "size": "1293",
+                "fileHash": "Full4E69A8B8CD9F42EDE371DA94458BADFB2308AFCA736AA393784A3D81F4746377",
+                "redundancy": {
+                    "type": "none"
+                },
+                "createTime": "2024-11-19T16:02:25+08:00",
+                "updateTime": "2024-11-19T16:02:25+08:00"
+            },
+            {
+                "objectID": 618,
+                "packageID": 12,
+                "path": "a/2.txt",
+                "size": "1293",
+                "fileHash": "Full4E69A8B8CD9F42EDE371DA94458BADFB2308AFCA736AA393784A3D81F4746377",
+                "redundancy": {
+                    "type": "none"
+                },
+                "createTime": "2024-11-19T16:02:25+08:00",
+                "updateTime": "2024-11-19T16:02:25+08:00"
+            }
+        ]
+    }
+}
+
+ +### 3.5 List Objects in Package + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/object/getPackageObjects
Query +

- packageID:int64

+
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "objects": [
+            {
+                "objectID": 617,
+                "packageID": 12,
+                "path": "a/1.txt",
+                "size": "1293",
+                "fileHash": "Full4E69A8B8CD9F42EDE371DA94458BADFB2308AFCA736AA393784A3D81F4746377",
+                "redundancy": {
+                    "type": "none"
+                },
+                "createTime": "2024-11-19T16:02:25+08:00",
+                "updateTime": "2024-11-19T16:02:25+08:00"
+            },
+            {
+                "objectID": 618,
+                "packageID": 12,
+                "path": "a/2.txt",
+                "size": "1293",
+                "fileHash": "Full4E69A8B8CD9F42EDE371DA94458BADFB2308AFCA736AA393784A3D81F4746377",
+                "redundancy": {
+                    "type": "none"
+                },
+                "createTime": "2024-11-19T16:02:25+08:00",
+                "updateTime": "2024-11-19T16:02:25+08:00"
+            }
+        ]
+    }
+}
+
+ +### 3.6 Batch Move Objects + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/object/move
QueryNone
Body +
{
+    "movings":[
+        {
+            "objectID":4, // Original object ID
+            "packageID":3, // Target package ID after moving
+            "path":"trace2.txt" // Target path after moving
+        }
+    ]
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+      "successes": [ // IDs of successfully moved objects
+        4
+      ]
+    }
+}
+
+ +### 3.7 Batch Delete Objects + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/object/delete
QueryNone
Body +
{
+    "objectIDs":[
+      4
+    ]
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": null
+}
+

The response code will be OK even if the file does not exist.

+
+ +### 3.8 Batch Copy Objects + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/object/clone
QueryNone
Body +
{
+    "clonings": [
+        {
+            "objectID": 4,  // Original object ID
+            "newPath": "trace3.txt",  // The new object's path
+            "newPackageID": 3  // The new object's package ID
+        }
+    ]
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+      "objects":[{
+                "objectID": 5,
+                "packageID": 3,
+                "path": "trace3.txt",
+                "size": "1293",
+                "fileHash": "Full4E69A8B8CD9F42EDE371DA94458BADFB2308AFCA736AA393784A3D81F4746377",
+                "redundancy": {
+                    "type": "none"
+                },
+                "createTime": "2024-11-19T16:02:25+08:00",
+                "updateTime": "2024-11-19T16:02:25+08:00"
+       }]
+    }
+}
+
+ +### 3.9 Create Multipart Upload + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/object/newMultipartUpload
QueryNone
Body +
{
+    "packageID": 3,
+    "path": "multi"  // The object's path
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "object": {
+            "objectID": 1039,
+            "packageID": 3,
+            "path": "obj.txt",
+            "size": "0",
+            "fileHash": "Full0000000000000000000000000000000000000000000000000000000000000000",
+            "redundancy": {
+                "type": "multipartUpload"
+            },
+            "createTime": "2025-03-04T16:03:18+08:00",
+            "updateTime": "2025-03-11T15:20:44.5182982+08:00"
+        }
+    }
+}
+

The created object can be found using the query interface.

+
+ +### 3.10 Upload Part + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTmultipart/form-data; boundary=xxxxxxx/v1/object/uploadPart
QueryNone
Body +

Similar to the object upload interface, the request must contain two parts: info and file. The info part should have the following format:

+
{
+  "objectID": 1, // The Object ID obtained from the Create Multipart Upload API
+  "index": 1 // The part number used for merging later. Parts with the same index will overwrite the old data.
+}
+

The file part contains the file data.

+
Response Example
+
{
+    "code": "OK",
+    "message": ""
+}
+
+ +### 3.11 Complete Multipart Upload + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/object/completeMultipartUpload
QueryNone
Body +
{
+    "objectID": 1039,  // The Object ID to be merged
+    "indexes": [2,3,1]  // The list of part numbers. Duplicate part numbers are allowed; parts will be merged in the specified order. Unused parts will be discarded.
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "object": {
+            "objectID": 1039,
+            "packageID": 3,
+            "path": "obj.txt",
+            "size": "30",
+            "fileHash": "FullB7660EB37969EDC68202258A1838B89493B4C77EA006B1640768D20CEF7A7CD2",
+            "redundancy": {
+                "type": "none"
+            },
+            "createTime": "2025-03-04T16:03:18+08:00",
+            "updateTime": "2025-03-11T15:42:03+08:00"
+        }
+    }
+}
+
+ +## 4 User Storage Configuration + +### 4.1 Create User Storage Configuration + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/userSpace/create
QueryNone
Body +
{
+    "name": "test1",
+    "storage": { // Storage system type
+        "type": "OBS",
+        "region": "",
+        "endpoint": "",
+        "bucket": "",
+        "projectID": ""
+    },
+    "credential": { // Permission information required to access the storage system
+        "type": "OBS",
+        "accessKeyId": "",
+        "secretAccessKey": ""
+    },
+    "shardStore": { // Configuration for shard storage; if null, shard storage is disabled
+        "maxSize":1024
+    },
+    "features": [], // Configuration of feature functions for the storage system
+    "workingDir": "" // Root directory for storing data of various components, including shard storage
+}
+

- The content of storage and credential is determined by the value of the type field. You can find more type definitions in the package at gitlink.org.cn/cloudream/jcs-pub/coordinator/types. +- Features configures the feature functions of the storage system; the specific available features can also be referenced from the package above. Note: Not all storage systems support all features.

+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "userSpace": {
+            "userSpaceID": 1,
+            "name": "test1",
+            "storage": {
+                "type": "OBS",
+                "region": "",
+                "endpoint": "",
+                "bucket": "",
+                "projectID": ""
+            },
+            "credential": {
+                "type": "OBS",
+                "accessKeyId": "",
+                "secretAccessKey": ""
+            },
+            "shardStore": {
+                "maxSize": 1024
+            },
+            "features": [],
+            "workingDir": "",
+            "revision": 1
+        }
+    }
+}
+
+ +### 4.2 Update User Storage Configuration + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/userSpace/update
QueryNone
Body +
{
+    "userSpaceID": 1,
+    "name": "test1",  // New name
+    "credential": {   // New credential information
+        "type": "OBS",
+        "accessKeyId": "",
+        "secretAccessKey": ""
+    }
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "userSpace": {
+            "userSpaceID": 1,
+            "name": "test1",
+            "storage": {
+                "type": "OBS",
+                "region": "",
+                "endpoint": "",
+                "bucket": "",
+                "projectID": ""
+            },
+            "credential": {
+                "type": "OBS",
+                "accessKeyId": "",
+                "secretAccessKey": ""
+            },
+            "shardStore": {
+                "maxSize": 1024
+            },
+            "features": [],
+            "workingDir": "",
+            "revision": 1
+        }
+    }
+}
+
+ +### 4.3 Delete User Storage Configuration + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/userSpace/delete
QueryNone
Body +
{
+    "userSpaceID": 1
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": null
+}
+

The response code will be OK even if the file does not exist.

+
+ +### 4.4 Get User Storage Configuration + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/userSpace/get
Query +

- userSpaceID: int64

+
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "userSpace": {
+            "userSpaceID": 1,
+            "name": "test1",
+            "storage": {
+                "type": "OBS",
+                "region": "",
+                "endpoint": "",
+                "bucket": "",
+                "projectID": ""
+            },
+            "credential": {
+                "type": "OBS",
+                "accessKeyId": "",
+                "secretAccessKey": ""
+            },
+            "shardStore": {
+                "maxSize": 1024
+            },
+            "features": [],
+            "workingDir": "",
+            "revision": 1
+        }
+    }
+}
+
+ +### 4.5 Test User Storage Configuration + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/userSpace/test
QueryNone
Body +
{
+    "storage": {
+        "type": "OBS",
+        "region": "",
+        "endpoint": "",
+        "bucket": "",
+        "projectID": ""
+    },
+    "credential": {
+        "type": "OBS",
+        "accessKeyId": "",
+        "secretAccessKey": ""
+    },
+    "workingDir": ""
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": null
+}
+

The OK response indicates the configuration is valid and connected to the storage system.

+
+ +### 4.6 Upload to New Package from User Storage + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/userSpace/createPackage
QueryNone
Body +
{
+    "userSpaceID": 1,
+    "path": "",  // Path within the user's storage space. Can be a folder or a file. Note: WorkingDir is not prepended.
+    "bucketID": 1,  // bucketID of the newly created package
+    "name": "",  // Name of the newly created package
+    "spaceAffinity": 0  // Preferred storage space for uploading files. 0 means no preference.
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "package": {
+            "packageID": 32,
+            "name": "t1",
+            "bucketID": 1,
+            "createTime": "2025-06-24T16:31:28.5148754+08:00"
+        }
+    }
+}
+
+ +### 4.7 Download Package to User Storage + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/userSpace/downloadPackage
QueryNone
Body +
{
+    "userSpaceID": 1,
+    "packageID": 1,
+    "rootPath": "", // Root path for storing downloaded files
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": null
+}
+
+ +## 5 User Storage Sync + +### 5.1 Create Sync Task + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/spaceSyncer/createTask
QueryNone
Body +
{
+    "trigger": { // Sync task trigger condition
+        "type": "Interval",
+        "interval": 30
+    },
+    "mode": { // Sync mode
+        "type": "Diff",
+        "includeSize": false,
+        "includeModTime": true
+    },
+    "filters": [ // Filter rules
+        {
+            "type": "Size",
+            "minSize": 10,
+            "maxSize": 20000
+        }
+    ],
+    "options": { // Options
+        "noEmptyDirectories": false
+    }, 
+    "srcUserSpaceID": 1, // Source storage space ID
+    "srcPath": "space1/cli", // Path within source storage space
+    "destUserSpaceIDs": [ // Destination storage space IDs
+        2
+    ],
+    "destPathes": [ // Paths within destination storage spaces
+        "space2/svr"
+    ]
+}
+

The contents of trigger, mode, and filters vary according to their type fields. For more details, please refer to the package at gitlink.org.cn/cloudream/jcs-pub/client/types.

+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "task": {
+            "taskID": 1,
+            "trigger": {
+                "type": "Interval",
+                "interval": 30
+            },
+            "mode": {
+                "type": "Diff",
+                "includeSize": false,
+                "includeModTime": true
+            },
+            "filters": [
+                {
+                    "type": "Size",
+                    "minSize": 10,
+                    "maxSize": 20000
+                }
+            ],
+            "options": {
+                "noEmptyDirectories": false
+            },
+            "srcUserSpaceID": 1,
+            "srcPath": "space1/cli",
+            "destUserSpaceIDs": [
+                2
+            ],
+            "destPathes": [
+                "space2/svr"
+            ]
+        }
+    }
+}
+
+ +### 5.2 Get Sync Task + + + + + + + + + + + + + + + + + + + + + + + + +
Request
GETapplication/json/v1/spaceSyncer/getTask
Query +

- taskID: int64

+
BodyNone
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": {
+        "task": {
+            "taskID": 1,
+            "trigger": {
+                "type": "Interval",
+                "interval": 30
+            },
+            "mode": {
+                "type": "Diff",
+                "includeSize": false,
+                "includeModTime": true
+            },
+            "filters": [
+                {
+                    "type": "Size",
+                    "minSize": 10,
+                    "maxSize": 20000
+                }
+            ],
+            "options": {
+                "noEmptyDirectories": false
+            },
+            "srcUserSpaceID": 1,
+            "srcPath": "space1/cli",
+            "destUserSpaceIDs": [
+                2
+            ],
+            "destPathes": [
+                "space2/svr"
+            ]
+        }
+    }
+}
+
+ +### 5.3 Cancel Sync Task + + + + + + + + + + + + + + + + + + + + + + + + +
Request
POSTapplication/json/v1/spaceSyncer/cancelTask
QueryNone
Body +
{
+    "taskID": 1
+}
+
Response Example
+
{
+    "code": "OK",
+    "message": "",
+    "data": null
+}
+
+ + + diff --git a/docs/figs/architecture_en.png b/docs/figs/architecture_en.png new file mode 100644 index 0000000..f54327e Binary files /dev/null and b/docs/figs/architecture_en.png differ diff --git a/docs/figs/roadmap_en.png b/docs/figs/roadmap_en.png new file mode 100644 index 0000000..029c077 Binary files /dev/null and b/docs/figs/roadmap_en.png differ diff --git a/docs/公有云注册及使用教程.md b/docs/公有云注册及使用教程.md index a387dba..1d7c54a 100644 --- a/docs/公有云注册及使用教程.md +++ b/docs/公有云注册及使用教程.md @@ -7,17 +7,17 @@ ### 1、注册 -访问阿里云账号登录页面 [点击进入](https://www.aliyun.com/) +访问阿里云账号登录页面: [点击进入](https://www.aliyun.com/)
- +
在账号注册页面,输入:手机号、验证码、账号名和密码。 点击“注册”,出现以下界面,则注册完成。(**账号名和密码要记住,不能忘记**)
- +
### 2、实名阿里云账号 @@ -29,53 +29,53 @@ 实名认证分两种,企业实名和个人实名,下面以个人支付宝认证为例进行实名认证。 -其余认证方式详细教程参见文档 [这里](https://help.aliyun.com/zh/account/user-guide/overview-verification?spm=a2c4g.11186623.0.i2) +其余认证方式详细教程参见文档: [这里](https://help.aliyun.com/zh/account/user-guide/overview-verification?spm=a2c4g.11186623.0.i2) 所需材料:支付宝 步骤: -1、选择认证类型为“个人支付宝认证”,在右侧弹出框内勾选协议,同意授权阿里云获取支付宝认证信息(姓名、身份证号),然后点击登录支付宝。 +选择认证类型为“个人支付宝认证”,在右侧弹出框内勾选协议,同意授权阿里云获取支付宝认证信息(姓名、身份证号),然后点击登录支付宝。
- +
-2、在弹出的支付宝登录二维码页面,用手机支付宝扫码登录 +在弹出的支付宝登录二维码页面,用手机支付宝扫码登录。
- +
-3、经验证成功后即完成认证 +经验证成功后即完成认证。 ### 3、注册对象存储OSS -1、打开阿里云主页,点击右上角控制台,将鼠标移至产品,找到并单击对象存储OSS,打开OSS产品详情页面。 +打开阿里云主页,点击右上角控制台,将鼠标移至产品,找到并单击对象存储OSS,打开OSS产品详情页面。
- +
-2、在OSS产品详情页中,点击立即开通。 +在OSS产品详情页中,点击立即开通。
- +
-3、选择对象存储OSS,在右侧的配置清单点击立即购买。 +选择对象存储OSS,在右侧的配置清单点击立即购买。
- +
-4、在确认订单页面,勾选服务协议,并点击去支付,等到页面出现完成页面,即OSS对象存储服务开通成功。 +在确认订单页面,勾选服务协议,并点击去支付,等到页面出现完成页面,即OSS对象存储服务开通成功。
-5、点击操作对象存储OSS右侧的管理控制台,进入下一步操作。 +点击操作对象存储OSS右侧的管理控制台,进入下一步操作。
@@ -83,17 +83,17 @@ ### 4、创建桶 -1、在控制台页面,点击选择bucket中的“请选择”,在下拉框中选择创建Bucket +在控制台页面,点击选择bucket中的“请选择”,在下拉框中选择创建Bucket。
-2、在右侧弹出框中,填写要创建的Bucket信息,地址选择自己所在区域。 +在右侧弹出框中,填写要创建的Bucket信息,地址选择自己所在区域。
- - + +
填写完成后,点击完成创建,看到创建成功界面,即为创建成功。 @@ -103,7 +103,7 @@ 随后点击进入Bucket。
- +
创建完毕后,可以上传一个文件,测试是否成功。 @@ -121,7 +121,7 @@ 等待上传列表中文件状态变为上传成功即可。
- +
点击左侧文件列表,即可看到上传后的文件,在文件右侧下拉框中选择下载,若能正常下载,则证明文件可以访问。 @@ -148,19 +148,19 @@ 进入页面后,点击创建AccessKey。
- +
此处需要再次验证账号,可以选择手机号验证或者扫脸验证。
- +
验证完成后,即会生成一个AccessKey ID和对应的AccessKey Secret,可以复制或保存使用。
- +
@@ -180,7 +180,7 @@ OSS要接入CDS存储系统,需要填写以下内容: 访问华为云账号登录页面 [点击进入](https://activity.huaweicloud.com/) -点击右上角注册按钮 +点击右上角注册按钮。
@@ -195,7 +195,7 @@ OSS要接入CDS存储系统,需要填写以下内容:
- +
@@ -213,11 +213,11 @@ OSS要接入CDS存储系统,需要填写以下内容:
-实名认证分两种,企业实名和个人实名,下面以个人认证为例进行实名认证, +实名认证分两种,企业实名和个人实名,下面以个人认证为例进行实名认证。 -其余认证方式详细教程参见文档 [这里](https://support.huaweicloud.com/usermanual-account/zh-cn_topic_0071343161.html) +其余认证方式详细教程参见文档: [这里](https://support.huaweicloud.com/usermanual-account/zh-cn_topic_0071343161.html) -点击个人认证,在页面中选择人脸识别认证 +点击个人认证,在页面中选择人脸识别认证。
@@ -226,7 +226,7 @@ OSS要接入CDS存储系统,需要填写以下内容: 用手机微信扫描二维码,按要求输入姓名和身份证号,并进行人脸识别,完成认证。
- +
认证成功后,会出现如下页面。 @@ -243,7 +243,7 @@ OSS要接入CDS存储系统,需要填写以下内容:
-在页面上点击创建桶 +在页面上点击创建桶。
@@ -252,17 +252,17 @@ OSS要接入CDS存储系统,需要填写以下内容: 选择自己所在区域,填写桶名称,填写完成后,点击右下角的立即创建。
- +
- +
出现以下页面即创建成功。
- +
在桶列表页面,点击桶所在行(除桶名以外的位置),右侧会显示桶的基本信息,保存记录桶名称、区域和Endpoint信息,在后面接入存储系统时使用。 @@ -274,7 +274,7 @@ OSS要接入CDS存储系统,需要填写以下内容: 随后点击桶名,进入桶。
- +
在桶页面中点击上传对象,在右侧弹出框中添加要上传的文件,随后点击确定。 @@ -306,7 +306,7 @@ OSS要接入CDS存储系统,需要填写以下内容:
-在左侧选择访问密钥,点击新增访问密钥, +在左侧选择访问密钥,点击新增访问密钥。
@@ -315,19 +315,19 @@ OSS要接入CDS存储系统,需要填写以下内容: 在弹出框中勾选我已悉知,为账号创建访问密钥会带来的风险,然后点击继续创建。
- +
此处需要再次验证账号,可以选择手机验证或者邮箱验证。
- +
出现创建成功页面,则表示访问密钥创建成功,点击立即下载,保存文件中的AccessKey ID和对应的AccessKey Secret,弹窗关闭后将无法再次获取该密钥信息。
- +
**需要注意的是,为了保证账号安全,每个访问密钥仅可以下载一次,需要及时保存,如果丢失,可重新创建访问密钥。** @@ -374,30 +374,30 @@ OBS要接入CDS存储系统,需要填写以下内容:
-在左侧选择实名认证,认证方式分两种,个人认证和企业认证,下面以个人认证为例进行实名认证,其余认证方式详细教程参见文档 [这里](https://www.tencentcloud.com/zh/document/product/378/10495) +在左侧选择实名认证,认证方式分两种,个人认证和企业认证,下面以个人认证为例进行实名认证,其余认证方式详细教程参见文档: [这里](https://www.tencentcloud.com/zh/document/product/378/10495) -点击开始个人认证 +点击开始个人认证。
-按要求填写个人基本信息后,点击下一步 +按要求填写个人基本信息后,点击下一步。
- +
有三种校验认证信息的方式,微信扫码、人脸识别和QQ扫码,选择其中一种按要求完成校验。
- +
出现如下界面,即表示认证成功。
- +
### 3、在对象存储COS中创建桶 @@ -411,7 +411,7 @@ OBS要接入CDS存储系统,需要填写以下内容: 勾选我已阅读并同意《腾讯云服务协议》、《对象存储服务等级协议》和《COS默认按量计费(后付费)》,然后点击开通COS并领取额度资源包。
- +
点击创建存储桶。 @@ -423,26 +423,26 @@ OBS要接入CDS存储系统,需要填写以下内容: 按要求填写桶的基本信息,主要选择所属地域,填写桶名称,并勾选协议,填写完成后点击下一步。
- +
- +
到最后一步确认配置,保存记录桶名称、所属地域和Endpoint信息(请求域名中,桶名后面的半段),在后面接入存储系统时使用。
- +
-随后点击桶名称进入存储桶中 +随后点击桶名称进入存储桶中。
-点击上传文件,在弹出框中,点击选择文件,选择完毕后,点击上传 +点击上传文件,在弹出框中,点击选择文件,选择完毕后,点击上传。
@@ -454,10 +454,10 @@ OBS要接入CDS存储系统,需要填写以下内容:
-将鼠标移到文件上,文件右上角会出现三个点,点击后可以在下拉框中进行预览、下载等操作 +将鼠标移到文件上,文件右上角会出现三个点,点击后可以在下拉框中进行预览、下载等操作。
- +
### 4、创建AccessKey @@ -465,10 +465,10 @@ OBS要接入CDS存储系统,需要填写以下内容: 在控制台页面,将鼠标移动到右上角账号头像位置,在下拉框中点击访问管理。
- +
-在左侧菜单栏中选择访问密钥下面的API密钥管理,点击新建密钥 +在左侧菜单栏中选择访问密钥下面的API密钥管理,点击新建密钥。
@@ -477,7 +477,7 @@ OBS要接入CDS存储系统,需要填写以下内容: 弹出框中会生成访问密钥,点击下载CSV文件或者复制,及时保存生成的SecretID和对应的SecretKey,弹窗关闭后将无法再次获取该密钥信息。
- +
**需要注意的是,为了保证账号安全,每个访问密钥仅可以下载一次,需要及时保存,如果丢失,可重新创建访问密钥。** @@ -496,5 +496,5 @@ COS要接入CDS存储系统,需要填写以下内容: ## 金山云 +## UCloud -## UCloud \ No newline at end of file