Skip to content

Commit

Permalink
docs: Updated the official document links
Browse files Browse the repository at this point in the history
The previous document links has expred
  • Loading branch information
yu31 committed Jan 9, 2024
1 parent 32495f9 commit 5a8a9a9
Show file tree
Hide file tree
Showing 45 changed files with 121 additions and 128 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# QingStor SDK for Python

[![Build Status](https://github.com/qingstor/qingstor-sdk-python/workflows/Unit%20Test/badge.svg?branch=master)](https://github.com/qingstor/qingstor-sdk-python/actions?query=workflow%3A%22Unit+Test%22)
[![API Reference](http://img.shields.io/badge/api-reference-green.svg)](https://docs.qingcloud.com/qingstor/)
[![API Reference](http://img.shields.io/badge/api-reference-green.svg)](https://docsv4.qingcloud.com/user_guide/storage/object_storage/)
[![License](http://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/yunify/qingstor-sdk-python/blob/master/LICENSE)
[![Join the chat](https://img.shields.io/badge/chat-online-blue?style=flat&logo=zulip)](https://qingstor.zulipchat.com/join/nofzrqd5a5skt5ebnaor5b7d/)

English | [中文](README_zh-CN.md)

The official QingStor SDK for the Python programming language.

Before you start using the SDK, make sure you have a basic understanding of the concepts of [QingStor object storage](https://docs.qingcloud.com/qingstor/api/common/overview.html) (such as Zone, Service, Bucket, Object, etc.).
Before you start using the SDK, make sure you have a basic understanding of the concepts of [QingStor object storage](https://docsv4.qingcloud.com/user_guide/storage/object_storage/intro/product/) (such as Zone, Service, Bucket, Object, etc.).

This SDK try to keep a one-to-one correspondence with the methods on the [QingCloud QingStor object storage documentation](https://docs.qingcloud.com/qingstor/api/). For details of each method, please refer to the corresponding chapter in the link.
This SDK try to keep a one-to-one correspondence with the methods on the [QingCloud QingStor object storage documentation](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/). For details of each method, please refer to the corresponding chapter in the link.

## Quick Start

Expand All @@ -27,9 +27,9 @@ Checkout our [releases](https://github.com/yunify/qingstor-sdk-python/releases)

## Reference Documentations

- [QingStor Documentation](https://docs.qingcloud.com/qingstor/index.html)
- [QingStor Guide](https://docs.qingcloud.com/qingstor/guide/index.html)
- [QingStor APIs](https://docs.qingcloud.com/qingstor/api/index.html)
- [QingStor Documentation](https://docsv4.qingcloud.com/user_guide/storage/object_storage/intro/product/)
- [QingStor Guide](https://docsv4.qingcloud.com/user_guide/storage/object_storage/)
- [QingStor APIs](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/)

## Contributing

Expand Down
12 changes: 6 additions & 6 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# QingStor SDK for Python

[![Build Status](https://github.com/qingstor/qingstor-sdk-python/workflows/Unit%20Test/badge.svg?branch=master)](https://github.com/qingstor/qingstor-sdk-python/actions?query=workflow%3A%22Unit+Test%22)
[![API Reference](http://img.shields.io/badge/api-reference-green.svg)](https://docs.qingcloud.com/qingstor/)
[![API Reference](http://img.shields.io/badge/api-reference-green.svg)](https://docsv4.qingcloud.com/user_guide/storage/object_storage/)
[![License](http://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/yunify/qingstor-sdk-python/blob/master/LICENSE)
[![Join the chat](https://img.shields.io/badge/chat-online-blue?style=flat&logo=zulip)](https://qingstor.zulipchat.com/join/nofzrqd5a5skt5ebnaor5b7d/)

[English](README.md) | 中文

Python 语言版本的 QingStor 官方 SDK.

在开始使用 SDK 之前,请确保你对[青云 QingStor 对象存储基本概念](https://docs.qingcloud.com/qingstor/api/common/overview.html)(如 Zone,Service,Bucket,Object 等)有一定的了解。
在开始使用 SDK 之前,请确保你对[青云 QingStor 对象存储基本概念](https://docsv4.qingcloud.com/user_guide/storage/object_storage/intro/product/)(如 Zone,Service,Bucket,Object 等)有一定的了解。

本 SDK 与[青云 QingStor 对象存储帮助文档](https://docs.qingcloud.com/qingstor/api/)上的方法尽量保持一一对应,具体每个方法的详细说明请查看上述链接中的对应章节。
本 SDK 与[青云 QingStor 对象存储帮助文档](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/)上的方法尽量保持一一对应,具体每个方法的详细说明请查看上述链接中的对应章节。

## 快速开始

Expand All @@ -27,9 +27,9 @@ Python 语言版本的 QingStor 官方 SDK.

## 参考文档

- [QingStor 文档](https://docs.qingcloud.com/qingstor/index.html)
- [QingStor 指南](https://docs.qingcloud.com/qingstor/guide/index.html)
- [QingStor APIs](https://docs.qingcloud.com/qingstor/api/index.html)
- [QingStor 文档](https://docsv4.qingcloud.com/user_guide/storage/object_storage/intro/product/)
- [QingStor 指南](https://docsv4.qingcloud.com/user_guide/storage/object_storage/)
- [QingStor APIs](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/)

## 贡献

Expand Down
2 changes: 1 addition & 1 deletion docs/example/delete_multiple_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Then set the input parameters used by the `delete_multiple_objects` method. `qui
objects = [{"key": "file_will_be_delete.jpg"}, {"key": "file_will_be_delete.zip"}]
```

For parameter details, please refer to [Official API Documentation](https://docs.qingcloud.com/qingstor/api/bucket/delete_multiple).
For parameter details, please refer to [Official API Documentation](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/bucket/basic_opt/delete_multiple/).

Then call the `delete_multiple_objects` method to delete the object. object_key Sets the filepath of the object to be deleted (in the current bucket).

Expand Down
2 changes: 1 addition & 1 deletion docs/example/delete_multiple_object_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bucket_srv = qingstor.Bucket(bucket_name, zone_name)
objects = [{"key": "file_will_be_delete.jpg"}, {"key": "file_will_be_delete.zip"}]
```

想要了解详细的参数信息,可以参考[官方 API 文档](https://docs.qingcloud.com/qingstor/api/bucket/delete_multiple)
想要了解详细的参数信息,可以参考[官方 API 文档](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/bucket/basic_opt/delete_multiple/)

然后调用 `delete_multiple_objects` 方法删除对象。object_key 设置要删除的对象的 filepath(位于当前 bucket 中)。

Expand Down
4 changes: 2 additions & 2 deletions docs/example/encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

You can encrypt data when uploading.

To understand the process of encryption better, visit the link [https://docs.qingcloud.com/qingstor/api/common/encryption.html#object-storage-encryption-headers](https://docs.qingcloud.com/qingstor/api/common/encryption.html#object-storage-encryption-headers) .
To understand the process of encryption better, visit the link [https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/encryption/](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/encryption/) .

First, initialize the bucket service.

Expand All @@ -24,7 +24,7 @@ Encrypt when uploading files. The encryption operation is performed by setting r
```python
object_key = "your_file_encrypted"
with open("/tmp/your-picture.jpg", "rb") as f:
output = bucket_srv.put_object(object_key=object_key,
output = bucket_srv.put_object(object_key=object_key,
x_qs_encryption_customer_algorithm="AES256",
x_qs_encryption_customer_key="key",
x_qs_encryption_customer_key_md5="MD5 of the key",
Expand Down
4 changes: 2 additions & 2 deletions docs/example/encryption_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

上传时可对数据进行加密。

访问该链接 [https://docs.qingcloud.com/qingstor/api/common/encryption.html#object-storage-encryption-headers](https://docs.qingcloud.com/qingstor/api/common/encryption.html#object-storage-encryption-headers) .
访问该链接 [https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/encryption/](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/encryption/) .
以更好的理解数据加密解密的过程。

首先,需要初始化 bucket 服务。
Expand All @@ -25,7 +25,7 @@ bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```python
object_key = "your_file_encrypted"
with open("/tmp/your-picture.jpg", "rb") as f:
output = bucket_srv.put_object(object_key=object_key,
output = bucket_srv.put_object(object_key=object_key,
x_qs_encryption_customer_algorithm="AES256",
x_qs_encryption_customer_key="key",
x_qs_encryption_customer_key_md5="MD5 of the key",
Expand Down
2 changes: 1 addition & 1 deletion docs/example/get_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

For parameter details, please refer to [Official API Documentation](https://docs.qingcloud.com/qingstor/api/object/get).
For parameter details, please refer to [Official API Documentation](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/get/).

Then call the `get_object` method to download the object. object_key Sets the filepath of the object to be fetched (in the current bucket).

Expand Down
2 changes: 1 addition & 1 deletion docs/example/get_object_by_segment.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

The parameter that must be set manually here is the range parameter. For parameter details, please refer to [Official API Documentation](https://docs.qingcloud.com/qingstor/api/object/get).
The parameter that must be set manually here is the range parameter. For parameter details, please refer to [Official API Documentation](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/get/).

Then call the `get_object` method to download the object and set 5M as the segment size. object_key sets the filepath of the object to be fetched (in the current bucket).

Expand Down
2 changes: 1 addition & 1 deletion docs/example/get_object_by_segment_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

这里必须手动设置的参数是 Range 参数。想要了解详细的参数信息,可以参考[官方 API 文档](https://docs.qingcloud.com/qingstor/api/object/get)
这里必须手动设置的参数是 Range 参数。想要了解详细的参数信息,可以参考[官方 API 文档](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/get/)

然后调用 `get_object` 方法下载对象,将 5M 设置为分段大小。object_key 设置要获取的对象的 filepath(位于当前 bucket 中)。

Expand Down
2 changes: 1 addition & 1 deletion docs/example/get_object_url.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

For parameter details, please refer to [Official API Documentation](https://docs.qingcloud.com/qingstor/api/object/get).
For parameter details, please refer to [Official API Documentation](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/get/).

Then you can get the signature address of the object. object_key Sets the filepath of the object to be fetched (in the current bucket).

Expand Down
2 changes: 1 addition & 1 deletion docs/example/get_object_url_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

想要了解详细的参数信息,可以参考[官方 API 文档](https://docs.qingcloud.com/qingstor/api/object/get)
想要了解详细的参数信息,可以参考[官方 API 文档](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/get/)

然后你可以获得该对象的签名地址。object_key 设置要获取的对象的 filepath(位于当前 bucket 中)。

Expand Down
2 changes: 1 addition & 1 deletion docs/example/get_object_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

想要了解详细的参数信息,可以参考[官方 API 文档](https://docs.qingcloud.com/qingstor/api/object/get)
想要了解详细的参数信息,可以参考[官方 API 文档](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/get/)

然后调用 `get_object` 方法下载对象。object_key 设置要获取的对象的 filepath(位于当前 bucket 中)。

Expand Down
4 changes: 2 additions & 2 deletions docs/example/head_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

For parameter details, please refer to [Official API Documentation](https://docs.qingcloud.com/qingstor/api/object/head).
For parameter details, please refer to [Official API Documentation](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/head/).

Then call the `head_object` method to get the object meta information and test if it can be accessed. object_key Sets the filepath of the object to be fetched (in the current bucket).

Expand All @@ -33,7 +33,7 @@ if output.status_code != 200:
bucket_name,
str(output.content, 'utf-8')))
else:
# check all useful headers related to object info in: https://docs.qingcloud.com/qingstor/api/object/head
# check all useful headers related to object info in: https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/head/
print(output.headers['ETag'])
print(output.headers['Content-Type'])
```
Expand Down
6 changes: 3 additions & 3 deletions docs/example/head_object_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 获取文件的元数据
# 获取文件的元数据

## 代码片段

Expand All @@ -20,7 +20,7 @@ zone_name = "pek3b"
bucket_srv = qingstor.Bucket(bucket_name, zone_name)
```

想要了解详细的参数信息,可以参考[官方 API 文档](https://docs.qingcloud.com/qingstor/api/object/head)
想要了解详细的参数信息,可以参考[官方 API 文档](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/head/)

然后调用 `head_object` 方法获取对象元信息,测试是否可以被访问。object_key 设置要获取的对象的 filepath(位于当前 bucket 中)。

Expand All @@ -33,7 +33,7 @@ if output.status_code != 200:
bucket_name,
str(output.content, 'utf-8')))
else:
# check all useful headers related to object info in: https://docs.qingcloud.com/qingstor/api/object/head
# check all useful headers related to object info in: https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/basic_opt/head/
print(output.headers['ETag'])
print(output.headers['Content-Type'])
```
Expand Down
18 changes: 9 additions & 9 deletions docs/example/image_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Currently supported image formats are:

> Currently, the encrypted picture is not supported. The maximum size of a single picture is 10M.
For image process parameters' details, Please see [QingStor Image API](https://docs.qingcloud.com/qingstor/data_process/image_process).
For image process parameters' details, Please see [QingStor Image API](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/image_process/).

## Usage

Expand Down Expand Up @@ -83,43 +83,43 @@ object_key = "your-picture-uploaded.jpg"
```python
print(perform_img_action(bucket_srv, object_key, "info"))
```

2. Crop the image (here a 300px wide, 400px image is cropped around the center of the image).
```python
print(perform_img_action(bucket_srv, object_key, "crop:w_300,h_400,g_0", True))
```

3. Rotate the image 90 degrees.
```python
print(perform_img_action(bucket_srv, object_key, "rotate:a_90", True))
```

4. Resize the image.
```python
print(perform_img_action(bucket_srv, object_key, "resize:w_300,h_400,m_0", True))
```

5. Add a text watermark to the image (the text should first be base64 encoded and remove padding, the same with color).
```python
import base64

color = str.replace("c_" + str(base64.b64encode(bytes('#FF0000', encoding='utf8')), 'utf8'), "=", "")
print(perform_img_action(bucket_srv, object_key,
"watermark:d_150,p_0.9,t_5rC05Y2w5paH5a2X," + color, True))
```

6. Add a picture watermark to the image.
```python
print(perform_img_action(bucket_srv, object_key,
"watermark_image:l_10,t_10,p_2,"
"u_aHR0cHM6Ly9wZWszYS5xaW5nc3Rvci5jb20vaW1nLWRvYy1lZy9xaW5jbG91ZC5wbmc", True))
```

7. Format the image as png.
```python
print(perform_img_action(bucket_srv, object_key, "format:t_png", True))
```

8. include operations in pipeline and they will be processed in order. The maximum number of operations in the pipeline is 10. The example ends with a save action to save the image to `img_res.png` in the bucket: `your-bucket-01`.
```python
print(perform_img_action(bucket_srv, object_key,
Expand Down
18 changes: 9 additions & 9 deletions docs/example/image_process_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

> 目前不支持对加密过后的图片进行处理,单张图片最大为 10M 。
图片处理的参数详细信息请参考对应文档说明 [API Docs](https://docs.qingcloud.com/qingstor/data_process/image_process)
图片处理的参数详细信息请参考对应文档说明 [API Docs](https://docsv4.qingcloud.com/user_guide/storage/object_storage/api/object/image_process/)

## 用法

Expand Down Expand Up @@ -83,43 +83,43 @@ object_key = "your-picture-uploaded.jpg"
```python
print(perform_img_action(bucket_srv, object_key, "info"))
```

2. 裁剪图像(这里围绕图片中心裁剪出宽 300px, 高 400px 的图片)。
```python
print(perform_img_action(bucket_srv, object_key, "crop:w_300,h_400,g_0", True))
```

3. 旋转图像 90 度。
```python
print(perform_img_action(bucket_srv, object_key, "rotate:a_90", True))
```

4. 调整图像大小。
```python
print(perform_img_action(bucket_srv, object_key, "resize:w_300,h_400,m_0", True))
```

5. 为图像添加文字水印(文字应首先进行 base64 编码并去除 padding,颜色也一样)。
```python
import base64

color = str.replace("c_" + str(base64.b64encode(bytes('#FF0000', encoding='utf8')), 'utf8'), "=", "")
print(perform_img_action(bucket_srv, object_key,
"watermark:d_150,p_0.9,t_5rC05Y2w5paH5a2X," + color, True))
```

6. 为图像添加图片水印。
```python
print(perform_img_action(bucket_srv, object_key,
"watermark_image:l_10,t_10,p_2,"
"u_aHR0cHM6Ly9wZWszYS5xaW5nc3Rvci5jb20vaW1nLWRvYy1lZy9xaW5jbG91ZC5wbmc", True))
```

7. 格式化图像为 png。
```python
print(perform_img_action(bucket_srv, object_key, "format:t_png", True))
```

8. 操作管道,图像将按顺序处理。 管道中的最大操作数为10。例子最后使用 save action 将图片保存至 bucket: `your-bucket-01` 中的 `img_res.png`
```python
print(perform_img_action(bucket_srv, object_key,
Expand Down
Loading

0 comments on commit 5a8a9a9

Please sign in to comment.