### OSS Getting Started Guide Source: https://docs.jdcloud.com/cn/object-storage-service/copyfile Guides for quickly starting with OSS, including console quick start and S3 Browser quick start. ```APIDOC ## Getting Started with OSS ### Description Provides step-by-step instructions to help new users begin using the Object Storage Service (OSS) efficiently, covering console and S3 Browser initial setups. ### Quick Start Options - Console Quick Start - S3 Browser Quick Start ``` -------------------------------- ### OSS Getting Started - Console Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/create-video-snapshot This guide provides a quick start for using the Object Storage Service (OSS) console to perform basic operations. ```APIDOC ## OSS Getting Started - Console Quick Start ### Description This guide provides a quick start for using the Object Storage Service (OSS) console to perform basic operations. ### Steps - **Console Quick Start**: Instructions for navigating and using the OSS management console. ``` -------------------------------- ### Object Storage Service (OSS) - Getting Started Source: https://docs.jdcloud.com/cn/object-storage-service/billing Guides to help users start using OSS, including console and S3 Browser quick starts. ```APIDOC ## OSS Getting Started Guide ### Description This guide provides instructions for new users to quickly begin using JD Cloud's Object Storage Service (OSS). ### Quick Start Options - **Console Quick Start**: Step-by-step guide using the JD Cloud management console. - **S3 Browser Quick Start**: Instructions for using S3 Browser to interact with OSS. ``` -------------------------------- ### Object Storage Service - Getting Started Source: https://docs.jdcloud.com/cn/object-storage-service/search-object Guides to help new users quickly start using the Object Storage Service. ```APIDOC ## Getting Started ### Console Quick Start - **Description**: A guide to quickly get started using the Object Storage Service via the management console. ### S3 Browser Quick Start - **Description**: A guide to quickly get started using the Object Storage Service with S3 Browser. ``` -------------------------------- ### OSS Console Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/inventory-configuration A guide to getting started with OSS using the web-based console. Covers basic operations like creating buckets and uploading files. ```text Console quick start ``` -------------------------------- ### OSS Getting Started - S3 Browser Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/create-video-snapshot This guide provides a quick start for using S3 Browser with Object Storage Service (OSS) for basic file management. ```APIDOC ## OSS Getting Started - S3 Browser Quick Start ### Description This guide provides a quick start for using S3 Browser with Object Storage Service (OSS) for basic file management. ### Steps - **S3 Browser Quick Start**: Instructions for connecting and using S3 Browser with OSS. ``` -------------------------------- ### S3 Browser Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/manage-oss-with-s3browser This section provides a quick start guide for using S3 Browser to manage your OSS resources. It covers the initial setup and basic operations. ```APIDOC ## S3 Browser Quick Start ### Description This guide helps you get started with S3 Browser for managing your Object Storage Service (OSS) resources. It covers the essential steps to connect to your OSS and perform basic operations. ### Method N/A (Client-side tool usage) ### Endpoint N/A (Client-side tool usage) ### Parameters N/A (Configuration within S3 Browser) ### Request Example N/A ### Response N/A ``` -------------------------------- ### Create S3 Bucket using Java SDK (S3 Browser Quick Start) Source: https://docs.jdcloud.com/cn/object-storage-service/putongxiazai Example of creating a bucket using the Java SDK, as might be done in a quick start guide. ```java AmazonS3 s3Client = AmazonS3ClientBuilder.standard().build(); s3Client.createBucket("example-bucket-name"); ``` -------------------------------- ### Console Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-net A quick start guide for using the OSS console to manage your storage resources. ```N/A * 控制台快速入门 ``` -------------------------------- ### OSS Operation Guide: Media Processing Service (Legacy) - Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/config-lifecyclerule Quick start guides for using the legacy Media Processing Service, including video transcoding and screenshotting workflows. ```APIDOC ## Media Processing Service (Legacy) - Quick Start ### Create Video Transcoding Workflow Steps to create a video transcoding workflow. ### Create Video Screenshot Workflow Steps to create a video screenshot workflow. ``` -------------------------------- ### OSS S3 Browser Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/otherdatatransfer Guide to quickly start using OSS with S3 Browser for object storage management. ```en 控制台快速入门 S3 Browser 快速入门 ``` -------------------------------- ### OSS Operation Guide - Open Service Source: https://docs.jdcloud.com/cn/object-storage-service/s3fs This guide provides instructions on how to enable and start using the Object Storage Service (OSS). ```APIDOC ## OSS Operation Guide - Open Service ### Description This guide provides instructions on how to enable and start using the Object Storage Service (OSS). ### Opening the Service - **Steps**: Instructions on how to open and activate the OSS service. ``` -------------------------------- ### Example GET Request for Bucket Referer Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucketreferer An example of a complete GET request to fetch the referer configuration for a bucket. This includes necessary headers like Date, Authorization, and Host. ```http GET /?bucketReferer HTTP/1.1 Date: Tue, 11 Jul 2017 09:12:11 GMT Authorization: jingdong qbS5QXpLORrvdrmb:x7J06zQT3CJ5qF3CXKTKWjVBLvc= Host: oss-test.s-bj.jcloud.com Connection: Keep-Alive ``` -------------------------------- ### GET Bucket website Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-website-2 This example shows a typical GET request to retrieve a bucket's website configuration. ```HTTP GET ?website HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Thu, 27 Jan 2011 00:49:20 GMT Authorization: ``` -------------------------------- ### SDK Usage - Java Source: https://docs.jdcloud.com/cn/object-storage-service/face-recognition Guide to using the Java SDK for interacting with OSS, including installation, initialization, and common operations. ```APIDOC ## SDK Reference - Java Interact with OSS using the recommended Java SDK. ### Installation Add the OSS SDK dependency to your project (e.g., Maven or Gradle). ```xml com.jdcloud.sdk oss-java-sdk x.y.z ``` ### Initialization Initialize the OSS client with your credentials and endpoint. ```java import com.jdcloud.sdk.service.oss.client.OssClient; import com.jdcloud.sdk.service.oss.model.OssConfig; // ... OssConfig config = new OssConfig(); config.setEndpoint("oss.jdcloud.com"); // Replace with your region endpoint OssClient ossClient = OssClient.builder() .region("your-region") // e.g., "cn-north-1" .credentials("your-access-key-id", "your-secret-access-key") .config(config) .build(); ``` ### Bucket Operations #### Create Bucket ```java ossClient.createBucket("your-new-bucket-name"); ``` #### List Buckets ```java List buckets = ossClient.listBuckets(); for (Bucket bucket : buckets) { System.out.println(bucket.getName()); } ``` ### Object Operations #### Upload Object ```java ossClient.putObject("your-bucket-name", "your-object-key", new File("path/to/your/file.txt")); ``` #### Download Object ```java ossClient.getObject("your-bucket-name", "your-object-key", new File("path/to/save/file.txt")); ``` #### Delete Object ```java ossClient.deleteObject("your-bucket-name", "your-object-key"); ``` ``` -------------------------------- ### GET Service Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-service-2 An example of a GET Service request. Replace placeholders like , , and with your specific details. ```http GET / HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Wed, 01 Mar 2006 12:00:00 GMT Authorization: ``` -------------------------------- ### SDK Usage - Python Source: https://docs.jdcloud.com/cn/object-storage-service/face-recognition Guide to using the Python SDK for interacting with OSS, including installation, initialization, and common operations. ```APIDOC ## SDK Reference - Python Interact with OSS using the recommended Python SDK. ### Installation Install the OSS SDK using pip: ```bash pip install jdcloud-sdk-python ``` ### Initialization Initialize the OSS client with your credentials and endpoint. ```python from jdcloud_sdk.services.oss.oss_client import OssClient from jdcloud_sdk.core.credential import BasicCredentials # Replace with your actual credentials and endpoint access_key_id = "your-access-key-id" secret_access_key = "your-secret-access-key" region_id = "your-region" # e.g., "cn-north-1" endpoint = "oss.jdcloud.com" credentials = BasicCredentials(access_key_id, secret_access_key) ossc = OssClient(credentials, region_id, endpoint) ``` ### Bucket Operations #### Create Bucket ```python ossc.create_bucket(bucket_name="your-new-bucket-name") ``` #### List Buckets ```python response = ossc.list_buckets() if response.error is None: for bucket in response.buckets: print(bucket.name) ``` ### Object Operations #### Upload Object ```python with open("path/to/your/file.txt", "rb") as f: response = ossc.put_object(bucket_name="your-bucket-name", object_key="your-object-key", content=f) if response.error: print(f"Upload failed: {response.error}") ``` #### Download Object ```python response = ossc.get_object(bucket_name="your-bucket-name", object_key="your-object-key") if response.error is None: with open("path/to/save/file.txt", "wb") as f: f.write(response.content) ``` #### Delete Object ```python ossc.delete_object(bucket_name="your-bucket-name", object_key="your-object-key") ``` ``` -------------------------------- ### List Bucket Inventory Configurations Source: https://docs.jdcloud.com/cn/object-storage-service/api/list-bucket-inventoryconfigurations This example demonstrates how to list inventory configurations for a bucket using an HTTP GET request. ```APIDOC ## GET /?inventory ### Description Retrieves a list of inventory configurations for a specified bucket. ### Method GET ### Endpoint /?inventory ### Query Parameters - **continuation-token** (string) - Optional - When specified, the response will contain inventory configurations that follow the continuation token. ### Response #### Success Response (200) - **ListBucketInventoryConfigurationsOutput** (Container) - Contains a list of inventory configurations. - **ContinuationToken** (String) - Token to use for fetching the next page of inventory configurations. - **InventoryConfiguration** (Container) - Contains detailed information about an inventory configuration. - **IsTruncated** (Boolean) - Indicates whether all inventory configurations have been listed. Returns `true` if there are more configurations to fetch, `false` otherwise. - **NextContinuationToken** (String) - Token to use for fetching the next page of inventory configurations. This value is present only if `IsTruncated` is `true`. ### Response Example ```xml report1 true CSV 123456789012 arn:aws:s3:::destination-bucket prefix1 Daily prefix/One Size LastModifiedDate ETag StorageClass ... false ... true ... ``` ``` -------------------------------- ### GetBucket Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucket An example of a GET request to list objects, including Host, Date, and Authorization headers. ```http GET / HTTP/1.1 Host: oss-example.s-bj.jcloud.com Date: Tue, 11 Jul 2017 07:54:41 GMT Authorization: jingdong qbS5QXpLORrvdrmb:3xo8IxIXSkA280C0Z5+lkowaAA8= ``` -------------------------------- ### GET Bucket website Response Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-website-2 This example demonstrates a successful response (HTTP 200 OK) containing the bucket's website configuration in XML format. ```XML HTTP/1.1 200 OK x-amz-request-id: 3848CD259D811111 Date: Thu, 27 Jan 2011 00:49:26 GMT Content-Length: 240 Content-Type: application/xml Transfer-Encoding: chunked Server: JDCloudOSS index.html 404.html ``` -------------------------------- ### Java SDK: S3cmd Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/custom-domain-name-guidance Guide to using S3cmd for managing OSS. S3cmd is a command-line tool for interacting with S3-compatible storage. ```markdown ## 使用S3cmd管理OSS S3cmd是一个强大的命令行工具,用于与Amazon S3兼容的存储服务进行交互,包括京东云OSS。 **步骤:** 1. **安装S3cmd:** * 在Linux系统上,通常可以通过包管理器安装:`sudo apt-get install s3cmd` 或 `sudo yum install s3cmd`。 * 在macOS上,可以使用Homebrew:`brew install s3cmd`。 2. **配置S3cmd:** * 运行 `s3cmd --configure` 命令。 * 按照提示输入您的Access Key ID和Secret Access Key。 * 对于“Default region”,您可以留空或输入您的OSS地域(例如:`cn-north-1`)。 * 对于“Encryption password”,您可以选择不设置(留空)。 * 对于“S3 endpoint template”,输入您的OSS Endpoint模板。例如,对于华北-北京地域,可以输入 `s3.cn-north-1.jcloud.com`。请根据您的实际地域修改。 * 对于“DNS-Style bucket olursa”,输入 `%(bucket)s.s3.cn-north-1.jcloud.com`(根据您的地域修改)。 * 保存配置。 3. **基本命令示例:** * **列出存储桶:** `s3cmd ls` * **创建存储桶:** `s3cmd mb s3://your-bucket-name` * **上传文件:** `s3cmd put local_file.txt s3://your-bucket-name/remote_file.txt` * **下载文件:** `s3cmd get s3://your-bucket-name/remote_file.txt local_file.txt` * **删除文件:** `s3cmd del s3://your-bucket-name/remote_file.txt` * **删除存储桶:** `s3cmd rb s3://your-bucket-name` **注意事项:** * 请务必根据您使用的OSS地域,正确配置Endpoint和DNS-Style bucket olursa。 * Access Key ID和Secret Access Key是您的OSS访问凭证,请妥善保管。 * 更多命令和选项,请参考S3cmd的官方文档。 ``` -------------------------------- ### GetBucket Request Example with Prefix Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucket An example of a GET request to list objects with a prefix filter applied. This helps in retrieving objects within a specific 'folder'. ```http GET /?prefix=jingdong%2F HTTP/1.1 Host: oss-example.s-bj.jcloud.com Date: Tue, 11 Jul 2017 08:01:09 GMT Authorization: jingdong qbS5QXpLORrvdrmb:FQZNWlNAraOLgreEflrurbNojJE= ``` -------------------------------- ### Compatible S3 SDK-.NET Source: https://docs.jdcloud.com/cn/object-storage-service/billing Usage guide for the compatible S3 SDK with .NET applications. Covers setup and examples for C# and other .NET languages. ```csharp using Amazon.S3; ``` -------------------------------- ### Initialize Java SDK for OSS Source: https://docs.jdcloud.com/cn/object-storage-service/get-video-task Demonstrates how to initialize the Java SDK for OSS. Ensure you have the correct dependencies and credentials configured. ```java import com.amazonaws.regions.Regions; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; public class OssSdkExample { public static void main(String[] args) { // Initialize the S3 client AmazonS3 s3Client = AmazonS3ClientBuilder.standard() .withRegion(Regions.US_EAST_1) // Specify your region .build(); // Now you can use s3Client to interact with OSS System.out.println("OSS Client initialized successfully."); } } ``` -------------------------------- ### Compatible S3 SDK-Node.js Source: https://docs.jdcloud.com/cn/object-storage-service/billing Guide for using the compatible S3 SDK with Node.js. Covers installation, configuration, and examples for server-side or client-side JavaScript applications. ```javascript const AWS = require('aws-sdk'); ``` -------------------------------- ### Best Practice: Bucket Policy Examples Source: https://docs.jdcloud.com/cn/object-storage-service/add-text-watermarks Provides practical examples and recommendations for implementing Bucket Policies in JD Cloud OSS. This helps in setting up robust access control. ```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::123456789012:user/test"}, "Action": ["s3:GetObject"], "Resource": ["arn:aws:s3:::my-bucket-name/*"] } ] } ``` -------------------------------- ### GET Object Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-object-2 An example of a GET Object request to retrieve a specific object. ```http GET /my-image.jpg HTTP/1.1 Host: oss-example.s3..jcloudcs.com Date: Mon, 3 Oct 2016 22:32:00 GMT Authorization: ``` -------------------------------- ### GET Bucket Accelerate Response Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-accelerate Example response for the GET Bucket accelerate operation. ```http HTTP/1.1 200 OK x-amz-request-id: 51991C342C575321 Date: Thu, 15 Nov 2012 00:17:23 GMT Server: JDCloudOSS Content-Length: length Enabled ``` -------------------------------- ### Go SDK: Initialize S3 Compatible Client Source: https://docs.jdcloud.com/cn/object-storage-service/thumbnail Example of initializing the OSS client using S3 compatible SDK for Go. ```go import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" ) // Replace with your OSS endpoint and credentials endpoint := "http://oss-cn-hangzhou.aliyuncs.com" accessKeyID := "YOUR_ACCESS_KEY_ID" secretAccessKey := "YOUR_ACCESS_KEY_SECRET" session, err := session.NewSession(&aws.Config{ Endpoint: aws.String(endpoint), Region: aws.String("cn-hangzhou"), // Region might be needed DisableSSL: aws.Bool(true), // Use true if your endpoint is http S3ForcePathStyle: aws.Bool(true), // Often required for S3 compatible storage }) if err != nil { panic(err) } // Create an S3 client svc := s3.New(session, &aws.ClientConfig{ Credentials: credentials.NewStaticCredentials(accessKeyID, secretAccessKey, ""), }) // Now you can use svc to interact with OSS ``` -------------------------------- ### S3cmd: Manage OSS using Command Line Source: https://docs.jdcloud.com/cn/object-storage-service/s3fs This example shows how to use the s3cmd tool to manage OSS. It demonstrates basic operations like listing buckets and uploading files. ```bash # Configure s3cmd with your OSS credentials and endpoint s3cmd ls s3cmd put local_file.txt s3://your-bucket-name/object_key.txt ``` -------------------------------- ### Request Example for GET Object retention Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-object-retention An example of a GET Object retention API request, including necessary headers. ```HTTP GET /?retention HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Thu, 12 Apr 2018 21:37:21 GMT Authorization: authorization string ``` -------------------------------- ### GET Object legal hold Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-object-legal-hold An example of a GET Object legal hold request with specific headers. ```HTTP GET /?legal-hold HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Thu, 12 Apr 2018 21:37:21 GMT Authorization: authorization string ``` -------------------------------- ### OSS Best Practices - Tools Guide Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-net A guide covering various tools that can be used for managing and interacting with OSS. ```N/A * 工具指南 ``` -------------------------------- ### Response Example for GET Object retention Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-object-retention An example of a successful response from the GET Object retention API, showing the retention mode and retain until date. ```XML HTTP/1.1 200 OK x-amz-request-id: 0M26D08072A8EX6A x-amz-date: Thu, 12 Apr 2018 21:37:21 GMT Content-Length: 643 Server: JDCloudOSS GOVERNANCE 2019-06-16T10:00:00.000Z ``` -------------------------------- ### Install AWS SDK for Go Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-go Run this command to install the AWS SDK for Go. ```bash go get github.com/aws/aws-sdk-go ``` -------------------------------- ### Enable Bucket Logging Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/put-bucket-logging This example demonstrates how to enable bucket logging by specifying a target bucket and prefix. ```http PUT ?logging HTTP/1.1 Host: .s3..jdcloud-oss.com Content-Length: 163 x-amz-date: Thu, 12 Apr 2012 20:04:21 GMT Authorization: authorization string examplebucket MyLog- ``` -------------------------------- ### Example GET Bucket Notification Request Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-notification-2 An example of a GET request to retrieve notification settings for a bucket. This includes the Host, Date, and Authorization headers. ```HTTP GET ?notification HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Wed, 15 Oct 2014 16:59:03 GMT Authorization: ``` -------------------------------- ### Get Bucket ACL Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-acl-2 An example of a GET request to retrieve a bucket's ACL. This includes the Host, Date, and Authorization headers. ```http GET ?acl HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Wed, 28 Oct 2009 22:32:00 GMT Authorization: ``` -------------------------------- ### GET Object legal hold Response Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-object-legal-hold An example of a successful response to a GET Object legal hold request, indicating the legal hold status. ```HTTP HTTP/1.1 200 OK x-amz-request-id: 0M26D08072A8EX6A x-amz-date: Thu, 12 Apr 2018 21:37:21 GMT Content-Length: 341 Server: JDCloudOSS ON ``` -------------------------------- ### S3 Object Metadata Demo Main Method Source: https://docs.jdcloud.com/cn/object-storage-service/S3MetadataDemo Entry point for the S3 metadata demonstration. Initializes the S3 client and calls various metadata-related methods. ```Java public static void main(String[] args) { String accessKey = "your-access-key"; String secretKey = "your-secret-key"; String region = "cn-north-1"; String bucketName = "your-bucket-name"; S3GetMetadataV1 example = new S3GetMetadataV1(accessKey, secretKey, region); // 示例1:基本获取元数据 example.getObjectMetadataBasic(bucketName, "documents/report.pdf"); // 示例2:使用请求对象获取元数据 example.getObjectMetadataWithRequest(bucketName, "data/config.json", null); // 示例3:获取对象内容 example.getObjectWithMetadata(bucketName, "logs/application.log"); // 示例4:批量获取元数据 example.batchGetObjectsMetadata(bucketName, "images/"); // 示例5:检查特定元数据 boolean exists = example.checkMetadataExists( bucketName, "documents/contract.docx", "Contract-Status", "Approved" ); System.out.println("元数据检查结果: " + exists); // 示例6:检查对象是否存在 example.checkObjectExists(bucketName, "non-existent-file.txt"); } ``` -------------------------------- ### GET Bucket Logging Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-logging An example of a GET request to retrieve bucket logging configuration. This includes the necessary Host, Date, and Authorization headers. ```HTTP GET ?logging HTTP/1.1 Host: .s3..jdcloud-oss.com Date: date Authorization: authorization string ``` -------------------------------- ### Initialize S3 SDK for .NET Source: https://docs.jdcloud.com/cn/object-storage-service/product-terms-of-service Instructions and code examples for initializing the S3 SDK for .NET to interact with OSS. This covers setting up the client. ```csharp // This section would contain C# code examples for initializing the S3 SDK on .NET. ``` -------------------------------- ### Example Bucket Policy GET Request Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-policy-2 An example of a GET request to retrieve a bucket policy. This includes a sample Host header and a placeholder for the Authorization string. ```HTTP GET ?policy HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Wed, 28 Oct 2009 22:32:00 GMT Authorization: ``` -------------------------------- ### Example Bucket Lifecycle Configuration Source: https://docs.jdcloud.com/cn/object-storage-service/api/put-bucket-lifecycle This example demonstrates how to configure lifecycle rules for a bucket. It includes rules for expiring objects after a certain number of days and transitioning objects to a different storage class. ```XML id1 documents/ Enabled 365 id2 documents/ Enabled 30 GLACIER ``` -------------------------------- ### GET Bucket Tagging Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-tagging An example of a GET Bucket tagging request. This demonstrates the structure of the request, including the Host header which specifies the bucket and region. ```HTTP GET ?tagging HTTP/1.1 Host: .s3..jdcloud-oss.com Date: date Authorization: authorization string ``` -------------------------------- ### Configure OSS Lifecycle Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-net Step-by-step guide on configuring lifecycle rules for OSS storage spaces (buckets). ```N/A * 配置生命周期 ``` -------------------------------- ### OSS SDK: Overview Source: https://docs.jdcloud.com/cn/object-storage-service/alert-resourcepkg Provides a general introduction to the OSS SDKs available for various programming languages. Highlights their purpose and benefits. ```text # SDKs simplify interaction with OSS, abstracting API calls. # Supported languages include Java, Python, Go, Node.js, PHP, iOS, Ruby, .NET, Rust. ``` -------------------------------- ### Example Request for Get Video Task List Source: https://docs.jdcloud.com/cn/object-storage-service/get-video-task An example of a GET request to search for video tasks with specific query parameters. This includes detailed JSON parameters for filtering and pagination. ```HTTP GET http://oss.cn-north-1.jcloudcs.com/?searchVideoList&videoTaskQuery=%7B%22flag%22%3A0%2C%22mysqlPage%22%3A0%2C%22orderCloumn%22%3A%22update_time%22%2C%22orderType%22%3A%22desc%22%2C%22page%22%3A1%2C%22pageSize%22%3A10%2C%22status%22%3A0%7DHTTP/1.1 Date: Tue, 15 Dec 2015 12:59:11 GMT Authorization: jingdong 2sTXh1AoApNv5x8p:opNHt6cimASzR20CcsglKbpSaxQ= Content-Length: 0 Host: oss.cn-north-1.jcloudcs.com Connection: Keep-Alive User-Agent: JFS-JCLOUD-SDK-JAVA/1.0.0 (Java 1.8.0_45; Vendor Oracle Corporation; Windows 7 6.1; HttpClient 4.2.1) ``` -------------------------------- ### Initialize S3 .NET SDK Source: https://docs.jdcloud.com/cn/object-storage-service/features Provides an example of initializing the S3-compatible SDK for .NET. ```csharp using Amazon.S3; using Amazon.S3.Model; var config = new AmazonS3Config { ServiceURL = endpoint, Region = region }; var s3Client = new AmazonS3Client(accessKeyId, secretAccessKey, config); ``` -------------------------------- ### GET Service Response Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-service-2 An example XML response for the GET Service operation, listing the owner and their buckets with creation dates. This response is returned upon successful authentication and request. ```xml bcaf1ffd86f461ca5fb16fd081034f webfile quotes 2006-02-03T16:45:09.000Z samples 2006-02-03T16:41:58.000Z ``` -------------------------------- ### GET Object Tagging Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-object-tagging An example of a GET Object tagging request, including necessary headers like Date and Authorization. This request retrieves the tags for a specific object. ```HTTP GET /?tagging HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Thu, 19 Apr 2020 22:18:21 GMT Authorization: authorization string ``` -------------------------------- ### Initialize S3 Go SDK Source: https://docs.jdcloud.com/cn/object-storage-service/core-concepts Provides instructions on how to initialize the S3 Go SDK for interacting with OSS. Ensure you configure the correct region and credentials. ```go import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" ) func main() { ssess, err := session.NewSession(&aws.Config{ Region: aws.String("cn-hangzhou"), Endpoint: aws.String("https://oss-cn-hangzhou.aliyuncs.com"), }) if err != nil { panic(err) } ssvc := s3.New(sess) _ = ssvc // Use the s3 service client } ``` -------------------------------- ### GET Object Response Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-object-2 Example of a successful HTTP response when retrieving an object. ```http HTTP/1.1 200 OK x-amz-request-id: 318BC8BC148832E5 Date: Mon, 3 Oct 2016 22:32:00 GMT Last-Modified: Wed, 12 Oct 2009 17:50:00 GMT ETag: "fba9dede5f27731c9771645a39863328" Content-Length: 434234 [434234 bytes of object data] ``` -------------------------------- ### Initialize S3 Compatible Python SDK Source: https://docs.jdcloud.com/cn/object-storage-service/product-overview1 This code example shows how to initialize the S3 compatible Python SDK (boto3). Ensure your AWS credentials and endpoint are correctly configured. ```python import boto3 s3 = boto3.client('s3', endpoint_url='http://oss.example.com', region_name='us-east-1', # Replace with your region aws_access_key_id='YOUR_ACCESS_KEY_ID', aws_secret_access_key='YOUR_SECRET_ACCESS_KEY' ) # Use s3 for S3 operations ``` -------------------------------- ### Bucket Management Guide Source: https://docs.jdcloud.com/cn/object-storage-service/Regularupload This guide explains how to manage storage buckets in OSS, including creation, deletion, listing, and configuring access permissions and lifecycle rules. ```APIDOC ## Storage Space Management This section details the management of storage buckets (referred to as storage spaces) within OSS. ### Storage Space Overview General information about storage buckets and their purpose. ### Create Storage Space Instructions for creating a new storage bucket. ### Delete Storage Space Procedures for deleting an existing storage bucket. ### List Storage Space How to retrieve a list of all storage buckets associated with your account. ### Manage Storage Space Tags Methods for adding, viewing, and managing tags for storage buckets. ### Query Bucket Usage How to check the current storage usage for a specific bucket. ### Access Permission Settings Configuration of access control for buckets. ### Lifecycle Management * **Lifecycle Overview**: Introduction to lifecycle management. * **Lifecycle Configuration Elements**: Details on the components of a lifecycle rule. * **Configure Lifecycle**: Steps to set up lifecycle rules for automatic object management (e.g., deletion, transition). ### Cross-domain Access Settings Configuration for allowing cross-origin resource sharing (CORS). ### Static Website Hosting Settings Enabling and configuring a bucket to host a static website. ### Custom Domain Instructions for associating a custom domain name with your OSS bucket. ### Callback Notification Setting up notifications for events related to object storage. ### Default Encryption Configuring default encryption for objects stored in the bucket. ### Mirroring Back to Source Setting up mirroring for data retrieval. ### Access Logs Enabling and configuring access logging for buckets. ### Transfer Acceleration Activating transfer acceleration for faster data uploads and downloads. ### Inventory Settings Configuring inventory reports for objects within a bucket. ``` -------------------------------- ### OSS SDK Documentation: Overview Source: https://docs.jdcloud.com/cn/object-storage-service/multipartdemo Provides a general introduction to the SDKs available for interacting with JD Cloud Object Storage Service (OSS). ```text JD Cloud offers SDKs in various programming languages to simplify integration with OSS. These SDKs are generally compatible with the S3 API. ``` -------------------------------- ### Example GET Request for List Parts Source: https://docs.jdcloud.com/cn/object-storage-service/api/list-parts-2 An example of a GET request to list parts, including parameters like uploadId, max-parts, and part-number-marker. This request is useful for paginating through large numbers of parts. ```http GET /example-object?uploadId=XXBsb2FkIElEIGZvciBlbHZpbmcncyVcdS1tb3ZpZS5tMnRzEEEwbG9hZA&max-parts=2&part-number-marker=1 HTTP/1.1 Host: oss-example.s3..jdcloud-oss.com Date: Mon, 1 Nov 2010 20:34:56 GMT Authorization: ``` -------------------------------- ### OSS Best Practices - Tool Guides Source: https://docs.jdcloud.com/cn/object-storage-service/otherdatatransfer Guides on using various tools for managing OSS, including S3cmd, S3 Browser, and data migration tools. ```en 工具指南 使用S3cmd管理OSS 使用S3 Browser管理OSS 数据迁移工具 使用S3fs在Linux实例上挂载Bucket ``` -------------------------------- ### GET Bucket Tagging Response Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-tagging This example shows a successful response (HTTP 200 OK) to a GET Bucket tagging request. It includes the bucket's tags within the element. ```XML HTTP/1.1 200 OK x-amz-request-id: 51991C342C575321 Date: Thu, 15 Nov 2012 00:17:23 GMT Server: JDCloudOSS Content-Length: length Project Project One User jsmith ``` -------------------------------- ### Initialize S3 Python SDK Source: https://docs.jdcloud.com/cn/object-storage-service/lifecycle Demonstrates initializing the S3 Python SDK (boto3) for OSS. Ensure the correct region and endpoint are configured. ```python import boto3 s3 = boto3.client('s3', region_name='cn-hangzhou', endpoint_url='http://oss-cn-hangzhou.aliyuncs.com', aws_access_key_id='YOUR_ACCESS_KEY_ID', aws_secret_access_key='YOUR_SECRET_ACCESS_KEY') ``` -------------------------------- ### OSSutil Tool Guide Source: https://docs.jdcloud.com/cn/object-storage-service/bucket-policy Guide on using the ossutil command-line tool for managing OSS resources, including uploading, downloading, and configuring buckets. ```bash # ossutil configuration example: # ~/.ossutilconfig # [Credentials] # language = EN # endpoint = oss-cn-hangzhou.aliyuncs.com # access_key_id = YOUR-ACCESSKEYID # access_key_secret = YOUR-ACCESSKEYSECRET # # Example command to upload a file: # ossutil cp local_file.txt oss://your-bucket-name/remote_file.txt ``` -------------------------------- ### Create Website from Bucket with s3cmd Source: https://docs.jdcloud.com/cn/object-storage-service/s3cmd Use this command to configure a bucket to serve static website content. ```bash s3cmd ws-create s3://BUCKET ``` -------------------------------- ### ListParts Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/listparts An example of a GET request to list parts for a specific multipart upload. This includes a sample uploadId and host. ```http GET /multipart.data?uploadId=9E417328F6B89F0B HTTP/1.1 Host: oss-example.s-bj.jcloud.com Date: Tue, 11 Jul 2017 12:40:40 GMT Authorization: jingdong qbS5QXpLORrvdrmb:Ihjb1BaIk2pNGk11OCqBogLLL4c= ``` -------------------------------- ### OSS Best Practices: Tools Guide Source: https://docs.jdcloud.com/cn/object-storage-service/inventory-configuration A guide to various tools that can be used with OSS, such as S3cmd, S3 Browser, and data migration utilities. ```text Tools guide ``` -------------------------------- ### .NET SDK: Initialize S3 Compatible Client Source: https://docs.jdcloud.com/cn/object-storage-service/thumbnail Example of initializing the OSS client using S3 compatible SDK for .NET. ```csharp using Amazon.S3; using Amazon.S3.Model; using Amazon.Runtime; // Replace with your OSS endpoint and credentials var endpoint = "http://oss-cn-hangzhou.aliyuncs.com"; var accessKeyId = "YOUR_ACCESS_KEY_ID"; var secretAccessKey = "YOUR_ACCESS_KEY_SECRET"; var region = RegionEndpoint.GetBySystemName("cn-hangzhou"); // Region might be needed var clientConfig = new AmazonS3Config { ServiceURL = endpoint, RegionEndpoint = region, ForcePathStyle = true // Often required for S3 compatible storage }; var s3Client = new AmazonS3Client(accessKeyId, secretAccessKey, clientConfig); // Now you can use s3Client to interact with OSS ``` -------------------------------- ### GetObject Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/getobject An example GET request to retrieve an object named 'example.jpg'. This demonstrates the required headers for a standard object retrieval. ```http GET /example.jpg HTTP/1.1 Host: oss-example.s-bj.jcloud.com Date: Tue, 11 Jul 2017 07:28:01 GMT Authorization: jingdong qbS5QXpLORrvdrmb:Ctm+uA40JmY3T3LvCZ6CkKkANXs= ``` -------------------------------- ### SDK Reference for Java Source: https://docs.jdcloud.com/cn/object-storage-service/default-encryption-for-oss-buckets-2 Documentation for the Java SDK, including installation and initialization. ```java 概述 兼容S3 Java SDK(推荐) ``` -------------------------------- ### List Multipart Uploads Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/listmultipartuploads An example of an HTTP GET request to list multipart uploads. This includes Host, Date, and Authorization headers. ```http GET /?uploads HTTP/1.1 Date: Wed, 12 Jul 2017 13:58:14 GMT Authorization: jingdong 298718BEDE59FF1B2E96A3152937D37B:YVbn+CqITQzQNRWzVKcxPq3V0PY= Host: oss-test.s-bj.jcloud.com Connection: Keep-Alive ``` -------------------------------- ### Range Request Example for GetObject Source: https://docs.jdcloud.com/cn/object-storage-service/api/getobject An example GET request using the 'Range' header to fetch a specific byte range of an object. This is useful for resumable downloads. ```http GET example.jpg HTTP/1.1 Host: oss-example.s-bj.jcloud.com Range: bytes=0-9 Date: Tue, 11 Jul 2017 07:34:11 GMT Authorization: jingdong qbS5QXpLORrvdrmb:/Aaawoo0xVq4XVMei/yK1UqhoFc= ``` -------------------------------- ### PHP SDK: Initialize S3 Compatible Client Source: https://docs.jdcloud.com/cn/object-storage-service/thumbnail Example of initializing the OSS client using S3 compatible SDK for PHP. ```php require 'vendor/autoload.php'; // If using Composer use Aws\S3\S3Client; use Aws\Exception\AwsException; // Replace with your OSS endpoint and credentials $endpoint = 'http://oss-cn-hangzhou.aliyuncs.com'; $accessKeyId = 'YOUR_ACCESS_KEY_ID'; $secretAccessKey = 'YOUR_ACCESS_KEY_SECRET'; try { $s3Client = new S3Client([ 'version' => 'latest', 'region' => 'cn-hangzhou', // Region might be needed 'endpoint' => $endpoint, 'use_path_style_endpoint' => true, // Often required for S3 compatible storage 'credentials' => [ 'key' => $accessKeyId, 'secret' => $secretAccessKey, ] ]); // Now you can use $s3Client to interact with OSS } catch (AwsException $e) { // Display error message echo $e->getMessage() . "\n"; } ``` -------------------------------- ### Bucket Management: Static Website Hosting Source: https://docs.jdcloud.com/cn/object-storage-service/inventory-configuration Guides on enabling static website hosting for an OSS bucket, allowing it to serve HTML, CSS, and JavaScript files directly. ```text Static website hosting settings ``` -------------------------------- ### GetService Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/getservice An example of a complete HTTP GET request to the GetService endpoint, including necessary headers like Date, Authorization, Host, and Connection. ```http GET / HTTP/1.1 Date: Wed, 12 Jul 2017 10:38:35 GMT Authorization: jingdong 298718BEDE59FF1B2E96A3152937D37B:mIdihnpi2ZtWTHaji555S0BBEBA= Host: s-bj.jcloud.com Connection: Keep-Alive ``` -------------------------------- ### Python SDK (Recommended): Initialize OSS Client Source: https://docs.jdcloud.com/cn/object-storage-service/user-defined-metadata Initializes the OSS client using the recommended Python SDK. Ensure correct endpoint and credentials. ```python import oss2 auth = oss2.Auth('YOUR_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY_SECRET') bucket = oss2.Bucket(auth, 'http://oss-cn-hangzhou.aliyuncs.com', 'your-bucket-name') ``` -------------------------------- ### S3 SDK-Go Example Source: https://docs.jdcloud.com/cn/object-storage-service/oss-endpont-list Provides a placeholder for examples using the S3 compatible SDK for Go. Specific operations would follow the SDK's API documentation. ```go // Example: import "github.com/aws/aws-sdk-go/aws" // Example: import "github.com/aws/aws-sdk-go/aws/session" // Example: import "github.com/aws/aws-sdk-go/service/s3" ``` -------------------------------- ### GET Bucket object lock configuration Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-object-lock-configuration An example of an HTTP request to retrieve the object lock configuration. This includes specific Host, Date, and Authorization headers. ```HTTP GET /?object-lock HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Thu, 12 Apr 2018 21:37:21 GMT Authorization: authorization string ``` -------------------------------- ### Create OSS Storage Space Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-net Step-by-step guide on creating a new storage space (bucket) in OSS. ```N/A * 创建存储空间 ``` -------------------------------- ### Bucket Management: Create Bucket Source: https://docs.jdcloud.com/cn/object-storage-service/inventory-configuration Guides on how to create a new storage bucket in OSS. Requires specifying a unique bucket name and region. ```text Create storage space ``` -------------------------------- ### Example GET Bucket CORS Request Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-cors-2 An example of an HTTP request to retrieve a bucket's CORS configuration. This includes a sample Date header and a placeholder for the authorization string. ```HTTP GET /?cors HTTP/1.1 Host: .s3..jdcloud-oss.com Date: Tue, 13 Dec 2011 19:14:42 GMT Authorization: ``` -------------------------------- ### GET Bucket Logging Response Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/get-bucket-logging Example of a successful HTTP 200 OK response when retrieving bucket logging configuration. It shows the structure of the BucketLoggingStatus, including LoggingEnabled, TargetBucket, and TargetPrefix. ```XML HTTP/1.1 200 OK x-amz-request-id: 51991C342C575321 Date: Thu, 15 Nov 2012 00:17:23 GMT Server: JDCloudOSS Content-Length: length JDbucketlogs JDbucket-prefix_log/ ```