### OSS Console Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo A guide to getting started with Object Storage Service (OSS) using the management console. It covers basic operations and navigation. ```text 控制台快速入门 ``` -------------------------------- ### Initialize S3 Client with Credentials Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-go Example of creating an S3 client using your AccessKey and SecretKey. Ensure you have Go 1.5 or later installed. ```go package main import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" ) func main() { ak := "your accesskey" sk := "your secretkey" creds := credentials.NewStaticCredentials(ak, sk, "") _,err := creds.Get() config := &aws.Config{ Region :aws.String("cn-north-1"), Endpoint :aws.String("s3.cn-north-1.jdcloud-oss.com"), DisableSSL :aws.Bool(false), Credentials :creds, } client := s3.New(session.New(config)) //use s3 client to create bucket、put object.... } ``` -------------------------------- ### Media Processing Service (Old) Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo A quick start guide for using the legacy Media Processing Service, covering basic workflow creation. ```text 快速入门 ``` -------------------------------- ### Linux Cloud Assistant Client Installation (Suqian) Source: https://docs.jdcloud.com/cn/virtual-machines/Install-cloudassistant-client Use this startup script to install the Cloud Assistant client on Linux instances in the Suqian region. The script checks network connectivity, downloads the client, and installs it. ```bash #!/bin/bash date_time=`date '+%Y%m%d-%H%M%S'` test_dir_name="assist-agent-${date_time}" mkdir /home/$test_dir_name cd /home/$test_dir_name time_used=0 url="sq-cloudassistant.s3-internal.cn-east-1.jdcloud-oss.com" while [ $time_used -le 600 ]; do ping $url -c 1 if [ $? -eq 0 ]; then echo "connected!" break else echo "Cannot access, continue" sleep 5 ((time_used += 5 )) fi done wget https://$url/x86/jdcloudservice.tar.gz tar zxvf jdcloudservice.tar.gz cd jdcloudservice ./install.sh systemctl status jdcloudservice ``` -------------------------------- ### Initialize Go SDK for OSS Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-go Provides an example of initializing the S3 compatible Go SDK for Object Storage Service. Ensure the AWS SDK for Go is installed. ```go package main import ( "fmt" "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() { // Initialize a session in us-west-2 that the SDK will use to load // credentials from the shared credentials file ~/.aws/credentials // and from the AWS configuration file ~/.aws/config. ssess := session.Must(session.NewSessionWithOptions(session.Options{ SharedConfigState: session.SharedConfigEnable, })) // Create S3 client in the specified region ssvc := s3.New(sess, &aws.Config{ Region: aws.String("us-west-2"), // Replace with your desired region }) fmt.Println("S3 client initialized successfully.") // You can now use ssvc to interact with OSS _ = ssvc // Prevent unused variable error } ``` -------------------------------- ### Linux Cloud Assistant Client Installation (Guangzhou) Source: https://docs.jdcloud.com/cn/virtual-machines/Install-cloudassistant-client Use this startup script to install the Cloud Assistant client on Linux instances in the Guangzhou region. The script checks network connectivity, downloads the client, and installs it. ```bash #!/bin/bash date_time=`date '+%Y%m%d-%H%M%S'` test_dir_name="assist-agent-${date_time}" mkdir /home/$test_dir_name cd /home/$test_dir_name time_used=0 url="gz-cloudassistant.s3-internal.cn-south-1.jdcloud-oss.com" while [ $time_used -le 600 ]; do ping $url -c 1 if [ $? -eq 0 ]; then echo "connected!" break else echo "Cannot access, continue" sleep 5 ((time_used += 5 )) fi done wget https://$url/x86/jdcloudservice.tar.gz tar zxvf jdcloudservice.tar.gz cd jdcloudservice ./install.sh systemctl status jdcloudservice ``` -------------------------------- ### Create Database Example Source: https://docs.jdcloud.com/cn/jchdb/sqlgrammar Example of creating a database named 'db_1' on the 'default' cluster. ```sql CREATE DATABASE db_1 ON CLUSTER default; ``` -------------------------------- ### Install Cloud Assistant Client Source: https://docs.jdcloud.com/cn/virtual-machines/Install-cloudassistant-client Execute the installation script for the Cloud Assistant client. ```bash ./install.sh ``` -------------------------------- ### Upload Object using S3 Browser Quick Start Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo This example is a conceptual reference to using S3 Browser for managing OSS. It implies a GUI-based approach rather than code. ```text S3 Browser 快速入门 ``` -------------------------------- ### Linux Cloud Assistant Client Installation (Beijing) Source: https://docs.jdcloud.com/cn/virtual-machines/Install-cloudassistant-client Use this startup script to install the Cloud Assistant client on Linux instances in the Beijing region. The script checks network connectivity, downloads the client, and installs it. ```bash #!/bin/bash date_time=`date '+%Y%m%d-%H%M%S'` test_dir_name="assist-agent-${date_time}" mkdir /home/$test_dir_name cd /home/$test_dir_name time_used=0 url="bj-cloudassistant.s3-internal.cn-north-1.jdcloud-oss.com" while [ $time_used -le 600 ]; do ping $url -c 1 if [ $? -eq 0 ]; then echo "connected!" break else echo "Cannot access, continue" sleep 5 ((time_used += 5 )) fi done wget https://$url/x86/jdcloudservice.tar.gz tar zxvf jdcloudservice.tar.gz cd jdcloudservice ./install.sh systemctl status jdcloudservice ``` -------------------------------- ### 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 ``` -------------------------------- ### Linux Cloud Assistant Client Installation (Shanghai) Source: https://docs.jdcloud.com/cn/virtual-machines/Install-cloudassistant-client Use this startup script to install the Cloud Assistant client on Linux instances in the Shanghai region. The script checks network connectivity, downloads the client, and installs it. ```bash #!/bin/bash date_time=`date '+%Y%m%d-%H%M%S'` test_dir_name="assist-agent-${date_time}" mkdir /home/$test_dir_name cd /home/$test_dir_name time_used=0 url="sh-cloudassistant.s3-internal.cn-east-2.jdcloud-oss.com" while [ $time_used -le 600 ]; do ping $url -c 1 if [ $? -eq 0 ]; then echo "connected!" break else echo "Cannot access, continue" sleep 5 ((time_used += 5 )) fi done wget https://$url/x86/jdcloudservice.tar.gz tar zxvf jdcloudservice.tar.gz cd jdcloudservice ./install.sh systemctl status jdcloudservice ``` -------------------------------- ### Example database creation and switch Source: https://docs.jdcloud.com/cn/rds/dblink This example shows the creation of a database named 'db1' and then switching the current connection to 'db1'. ```sql postgres=> create database db1; CREATE DATABASE postgres=> \c db1 ``` -------------------------------- ### Start MongoDB with Configuration File Source: https://docs.jdcloud.com/cn/jcs-for-mongodb/export-data Start the MongoDB daemon using the specified configuration file. ```bash mongod -f /root/mongo/mongod.conf ``` -------------------------------- ### Install Multi-Queue Script (Permanent Configuration) Source: https://docs.jdcloud.com/cn/virtual-machines/configurate-eni-multi-queue Download, extract, and run the `install.sh` script to permanently configure network interface multi-queue. This script automates the setup process for supported CentOS and Ubuntu versions. ```bash tar zxvf multi-queue-jd.tgz cd multi-queue-jd bash install.sh ``` -------------------------------- ### Bucket Policy Examples Source: https://docs.jdcloud.com/cn/object-storage-service/access-management-practices Examples of how to configure Bucket Policies for common access management scenarios. ```APIDOC ## Bucket Policy Examples ### 1. Granting Read-Only Access to a Specific OSS Bucket to Another JD Cloud Account ```json { "Version": "1", "Statement": [ { "Sid": "GrantReadOnlyAccess", "Effect": "Allow", "Principal": { "qcs": "qcs::cam::uin/12345678901234567890:ownerid/12345678901234567890" }, "Action": [ "oss:GetObject", "oss:ListBucket" ], "Resource": [ "qcs::oss:*:*:bucketName", "qcs::oss:*:*:bucketName/*" ] } ] } ``` ### 2. Denying Public Read Access to a Bucket ```json { "Version": "1", "Statement": [ { "Sid": "DenyPublicRead", "Effect": "Deny", "Principal": "*", "Action": "oss:GetObject", "Resource": "qcs::oss:*:*:bucketName/*" } ] } ``` ``` -------------------------------- ### Request Example for DescribeBandwidthPackage Source: https://docs.jdcloud.com/cn/virtual-private-cloud/api/describebandwidthpackage This snippet shows how to make a GET request to retrieve the details of a specific shared bandwidth package using its region and ID. ```bash GET https://vpc.jdcloud-api.com/v1/regions/cn-north-1/bandwidthPackages/bwp-1njs5vuoh7 ``` -------------------------------- ### Start Domain Source: https://docs.jdcloud.com/cn/cdn/api/overview Starts an acceleration domain. ```APIDOC ## POST startDomain ### Description Starts an acceleration domain. ### Method POST ### Endpoint /startDomain ``` -------------------------------- ### S3 Java SDK Installation Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo Instructions on how to install the S3 compatible Java SDK for interacting with OSS. ```text 安装 ``` -------------------------------- ### InitiateMultipartUpload Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/initiatemultipartupload An example of an InitiateMultipartUpload request, including the Host, storage class, date, and authorization headers. ```http POST /multipart.data?uploads HTTP/1.1 Host: oss-example.s-bj.jcloud.com x-jss-storage-class: STANDARD Date: Wed, 12 Jul 2017 07:45:27 GMT Authorization: jingdong qbS5QXpLORrvdrmb:wYoTTKpqU1mZu4Dy3IlTRbCUx0w= ``` -------------------------------- ### Install AWS SDK for Ruby Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-ruby Install the AWS SDK for Ruby by running the following command. ```bash gem install aws-sdk-s3 -V ``` -------------------------------- ### Install pip using curl Source: https://docs.jdcloud.com/cn/cli/installation Download and run the get-pip.py script to install pip. ```bash curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py ``` -------------------------------- ### Get Bucket Referer Request Example Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucketreferer An example of a GET request to retrieve bucket referer configuration. This includes necessary headers like Host, Date, and Authorization. ```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 ``` -------------------------------- ### Request Example for Get Watermark Template Source: https://docs.jdcloud.com/cn/media-processing-service/api/getWatermarkTemplate This example shows the GET request URL to retrieve a watermark template by its ID. Ensure you replace 'c35a7f843a6e49a4a32b1f8fab99fbd8' with the actual template ID. ```bash GET https://mps.jdcloud-api.com/v1/watermarkTemplates/c35a7f843a6e49a4a32b1f8fab99fbd8 ``` -------------------------------- ### OSS Tool Guide Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo Provides a guide to various tools that can be used with Object Storage Service (OSS) for management and operations. ```text 工具指南 ``` -------------------------------- ### Get Snapshot Template Request Source: https://docs.jdcloud.com/cn/media-processing-service/api/getsnapshottemplate This is an example of a GET request to retrieve a specific snapshot template by its ID. ```bash GET https://mps.jdcloud-api.com/v1/snapshotTemplates/c35a7f843a6e49a4a32b1f8fab99fbd8 ``` -------------------------------- ### DescribeQuotas API Request Example Source: https://docs.jdcloud.com/cn/dedicated-host/api/describequotas This is an example of a GET request to the DescribeQuotas API to retrieve quota information for a specific region. ```bash GET /v1/regions/cn-north-1/dhQuotas ``` -------------------------------- ### Get Bucket Request with Prefix and Delimiter Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucket This is an example of a GET request to the Get Bucket API, including prefix and delimiter parameters. These parameters help in organizing and filtering the bucket's contents. ```http GET /?prefix=jingdong%2F&delimiter=%2F HTTP/1.1 Host: oss-example.s-bj.jcloud.com Date: Tue, 11 Jul 2017 08:05:13 GMT Authorization: jingdong qbS5QXpLORrvdrmb:jXw8QQvs6IS+JJ2EpiFMUGtgNEM= ``` -------------------------------- ### Get Bucket Response with Prefix Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucket This is an example of a successful response from the Get Bucket API when a prefix parameter is used. It lists objects and common prefixes within the specified prefix. ```json HTTP/1.1 200 OK Server: nginx Date: Tue, 11 Jul 2017 08:01:09 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 613 Connection: keep-alive Vary: Accept-Encoding Vary: Accept-Encoding x-jss-request-id: 9CCEA5403AA5ED6E X-Trace: 200-1499760069435-0-0-20-45-45 { "Name": "oss-example", "Prefix": "jingdong/", "Marker": null, "NextMarker":null, "Delimiter": null, "MaxKeys": 1000, "HasNext": false, "HasCommonPrefix": true, "Contents": [ { "Key": "jingdong/dir/file", "LastModified": "Mon, 17 Jul 2017 12:12:39 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" }, { "Key": "jingdong/dir/file2", "LastModified": "Mon, 17 Jul 2017 12:14:49 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" }, { "Key": "jingdong/test.jpg", "LastModified": "Mon, 17 Jul 2017 12:12:17 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" } ], "CommonPrefixes": [ ] } ``` -------------------------------- ### Example Video Task Query Request Source: https://docs.jdcloud.com/cn/object-storage-service/query-video-task An example of an HTTP GET request to query a specific video task. This includes sample headers like Date, Authorization, Host, and User-Agent. ```http GET getVideoTask&taskId=11311576e2ee46d3b11dd4672d8e13c4 HTTP/1.1 Date: Tue, 15 Dec 2015 12:43:24 GMT Authorization: jingdong 2sTXh1AoApNv5x8p:AsYj3qfR2lhnwZT+5ZweZG0JgOs= 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) ``` -------------------------------- ### startInstance Source: https://docs.jdcloud.com/cn/iavm/linuxs Starts a specified Linux system host that is currently stopped. ```APIDOC ## POST /instances/{instanceId}/start ### Description Starts a specified Linux system host that is currently stopped. ### Method POST ### Endpoint /instances/{instanceId}/start ### Parameters #### Path Parameters - **instanceId** (string) - Required - The ID of the instance to start. ### Response #### Success Response (200) - **requestId** (string) - The ID of the request. #### Response Example ```json { "requestId": "req-xxxxxxxx" } ``` ``` -------------------------------- ### Get Bucket with Prefix Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucket This example shows how to list objects in a bucket using only a prefix for filtering. ```APIDOC ## GET / ### Description Retrieves a list of objects within a bucket, filtered by a specified prefix. ### Method GET ### Endpoint `/?prefix={prefix}` ### Query Parameters - **prefix** (string) - Optional - Specifies a prefix to filter the objects returned. ### Response #### Success Response (200) - **Name** (string) - The name of the bucket. - **Prefix** (string) - The prefix used for filtering. - **Marker** (string) - The marker used for pagination. - **NextMarker** (string) - The marker for the next page of results. - **Delimiter** (string) - The delimiter used for grouping. - **MaxKeys** (integer) - The maximum number of keys to return. - **HasNext** (boolean) - Indicates if there are more results. - **HasCommonPrefix** (boolean) - Indicates if common prefixes are returned. - **Contents** (array) - A list of objects matching the criteria. - **Key** (string) - The object key. - **LastModified** (string) - The last modified date of the object. - **ETag** (string) - The ETag of the object. - **Size** (integer) - The size of the object in bytes. - **StorageClass** (string) - The storage class of the object. - **CommonPrefixes** (array) - A list of common prefixes found. #### Response Example ```json { "Name": "oss-example", "Prefix": "jingdong/", "Marker": null, "NextMarker":null, "Delimiter": null, "MaxKeys": 1000, "HasNext": false, "HasCommonPrefix": true, "Contents": [ { "Key": "jingdong/dir/file", "LastModified": "Mon, 17 Jul 2017 12:12:39 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" }, { "Key": "jingdong/dir/file2", "LastModified": "Mon, 17 Jul 2017 12:14:49 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" }, { "Key": "jingdong/test.jpg", "LastModified": "Mon, 17 Jul 2017 12:12:17 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" } ], "CommonPrefixes": [ ] } ``` ``` -------------------------------- ### Get Snapshot Template Response Source: https://docs.jdcloud.com/cn/media-processing-service/api/getsnapshottemplate This is an example of a successful JSON response when querying for a snapshot template. ```json { "requestId": "bgvmivir54gddpgi764se9f4kfr7ge41", "result": { "createTime": "2019-04-16T15:51:32Z", "fillType": "stretch", "format": "jpg", "frameType": "any", "height": 480, "interval": 10, "number": 10, "spriteConfig": { "cellHeight": 48, "cellWidth": 48, "columns": 10, "doKeepShots": true, "rows": 10 }, "startTime": 0, "templateId": "c35a7f843a6e49a4a32b1f8fab99fbd8", "title": "我的截图模板", "updateTime": "2019-04-16T15:51:32Z", "width": 720 } } ``` -------------------------------- ### Get Bucket Response with Prefix and Delimiter Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucket This is an example of a successful response from the Get Bucket API when both prefix and delimiter parameters are used. It shows how to list objects and common prefixes under a specific directory structure. ```json HTTP/1.1 200 OK Server: nginx Date: Tue, 11 Jul 2017 08:05:13 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 456 Connection: keep-alive Vary: Accept-Encoding Vary: Accept-Encoding x-jss-request-id: 96F2C2E9FC9B3BE5 X-Trace: 200-1499760313279-0-0-20-45-45 { "Name": "oss-example", "Prefix": "jingdong/", "Marker": null, "NextMarker":null, "Delimiter": "/", "MaxKeys": 1000, "HasNext": false, "HasCommonPrefix": false, "Contents": [ { "Key": "jingdong/test.jpg", "LastModified": "Mon, 17 Jul 2017 12:12:17 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" } ], "CommonPrefixes": [ "jingdong/dir" ] } ``` -------------------------------- ### OpenClaw Quick Deployment Guide Source: https://docs.jdcloud.com/cn/iavm/openclawbs This section outlines the steps for a quick deployment of OpenClaw, including creating applications, setting up Linux and Windows hosts, and one-click deployment of 幻兽帕鲁. ```APIDOC ## OpenClaw Quick Deployment Guide ### Description This guide provides instructions for quickly deploying OpenClaw. It covers the process of creating applications, setting up Linux and Windows system hosts, and offers a one-click deployment option for 幻兽帕鲁. ### Topics Covered: - Quick application creation - Creating Linux system hosts - Creating Windows system hosts - One-click deployment of 幻兽帕鲁 - Methods for logging into Windows systems ``` -------------------------------- ### List Watermark Templates Request Source: https://docs.jdcloud.com/cn/media-processing-service/api/listWatermarkTemplates This is an example GET request to list watermark templates with specified pagination. ```bash https://mps.jdcloud-api.com/v1/watermarkTemplates?pageNumber=1&pageSize=10 ``` -------------------------------- ### OSS SDK Initialization with Access Keys Source: https://docs.jdcloud.com/cn/object-storage-service/Regularupload Demonstrates initializing the OSS client with access key ID and secret access key. These credentials are required for authentication. ```java OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); ``` -------------------------------- ### Slow Log Response Example Source: https://docs.jdcloud.com/cn/jcs-for-redis/api/describeslowlog An example of the JSON response structure when retrieving slow query logs. It includes the request ID, and a list of slow logs with command details, execution time, shard ID, and start time. ```json { "requestId": "c3o9oteswcpou221oegepq4mtd4or99c", "result": { "slowLogs": [ { "command": "hgetall post:user1:1234", "executionTime": "10.58 ms", "shardId": "redis-1234-shard-0", "startTime": "2021-07-14T08:09:48Z" }, { "command": "keys *", "executionTime": "15.85 ms", "shardId": "redis-1234-shard-0", "startTime": "2021-07-14T08:06:20Z" } ], "totalCount": 2 } } ``` -------------------------------- ### Response Example for DescribeTaskProgressList Source: https://docs.jdcloud.com/cn/jcs-for-redis/api/describetaskprogresslist This is an example of the JSON response received after calling the DescribeTaskProgressList API. It shows the request ID and the details of the task progress, including task type, ID, status, progress percentage, elapsed time, and start time. ```json ```json { "requestId": "c3o9ovh8ujsqnfm8bw56piuoqcn03ue4", "result": { "taskProgresses": [ { "elapsedTimeSecond": 443, "progressPercent": 100, "startTime": "2021-07-08T06:20:18Z", "taskId": "c3j9i8fr05a7bhcbuncr3hj39nipmguc", "taskStatus": "success", "taskType": "resize" } ] } } ``` ``` -------------------------------- ### Java SDK: Get Bucket Policy Source: https://docs.jdcloud.com/cn/object-storage-service/buy-resourcepkg Example of retrieving the bucket policy using the S3 compatible Java SDK for OSS. ```java OSSClient ossClient = new OSSClient("http://oss-cn-hangzhou.aliyuncs.com", "", ""); //获取存储桶策略 String bucketPolicy = ossClient.getBucketPolicy("my-bucket"); System.out.println("Bucket policy:" + bucketPolicy); //关闭client ossClient.shutdown(); ``` -------------------------------- ### Create Local Table Example Source: https://docs.jdcloud.com/cn/jchdb/sqlgrammar Example of creating a replicated local table 'ontime_local' with specific columns, partitioning, ordering, and sampling. ```sql CREATE TABLE ontime_local ON CLUSTER default ( Year UInt16, Quarter UInt8, Month UInt8, DayofMonth UInt8, DayOfWeek UInt8, FlightDate Date, FlightNum String, Div5WheelsOff String, Div5TailNum String )ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/ontime_local','{replica}') PARTITION BY toYYYYMM(FlightDate) PRIMARY KEY (intHash32(FlightDate)) ORDER BY (intHash32(FlightDate),FlightNum) SAMPLE BY intHash32(FlightDate) SETTINGS index_granularity= 8192 ; ``` -------------------------------- ### Create OSS Bucket Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo Step-by-step instructions on how to create a new storage bucket in OSS using the console or API. ```text 创建存储空间 ``` -------------------------------- ### Media Processing Service: Get Video Task List API Source: https://docs.jdcloud.com/cn/object-storage-service/default-encryption-for-oss-buckets-2 Example of using the API to retrieve a list of video processing tasks. ```json { "Action": "ListVideoTasks", "Bucket": "your-bucket-name", "Status": "Processing" } ``` -------------------------------- ### Java SDK: Get Bucket Metadata Source: https://docs.jdcloud.com/cn/object-storage-service/buy-resourcepkg Example of retrieving metadata for a specific bucket using the S3 compatible Java SDK for OSS. ```java OSSClient ossClient = new OSSClient("http://oss-cn-hangzhou.aliyuncs.com", "", ""); //获取存储空间元数据 BucketMeta bucketMeta = ossClient.getBucketMeta("my-bucket"); System.out.println("Bucket location:" + bucketMeta.getLocation()); //关闭client ossClient.shutdown(); ``` -------------------------------- ### 控制台创建Deployment及静态块存储卷挂载示例 Source: https://docs.jdcloud.com/cn/jcs-for-kubernetes/create-pv-dynamically Example of creating a Deployment and mounting a static block volume (CDS) using the console. This involves configuring the Deployment to use a pre-existing PersistentVolumeClaim for block storage. ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: my-app-block spec: replicas: 1 selector: matchLabels: app: my-app-block template: metadata: labels: app: my-app-block spec: containers: - name: my-app-container image: nginx ports: - containerPort: 80 volumeMounts: - name: my-block-volume mountPath: /usr/share/nginx/html volumes: - name: my-block-volume persistentVolumeClaim: claimName: my-pvc ``` -------------------------------- ### Get Bucket with Prefix and Delimiter Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucket This example demonstrates how to list objects in a bucket, filtering by a prefix and specifying a delimiter to simulate directory structures. ```APIDOC ## GET / ### Description Retrieves a list of objects within a bucket, optionally filtered by a prefix and a delimiter. This allows for simulating directory listings. ### Method GET ### Endpoint `/?prefix={prefix}&delimiter={delimiter}` ### Query Parameters - **prefix** (string) - Optional - Specifies a prefix to filter the objects returned. - **delimiter** (string) - Optional - Specifies a delimiter, typically '/' to simulate directory structures. ### Request Example ```http GET /?prefix=jingdong%2F&delimiter=%2F HTTP/1.1 Host: oss-example.s-bj.jcloud.com Date: Tue, 11 Jul 2017 08:05:13 GMT Authorization: jingdong qbS5QXpLORrvdrmb:jXw8QQvs6IS+JJ2EpiFMUGtgNEM= ``` ### Response #### Success Response (200) - **Name** (string) - The name of the bucket. - **Prefix** (string) - The prefix used for filtering. - **Marker** (string) - The marker used for pagination. - **NextMarker** (string) - The marker for the next page of results. - **Delimiter** (string) - The delimiter used for grouping. - **MaxKeys** (integer) - The maximum number of keys to return. - **HasNext** (boolean) - Indicates if there are more results. - **HasCommonPrefix** (boolean) - Indicates if common prefixes are returned. - **Contents** (array) - A list of objects matching the criteria. - **Key** (string) - The object key. - **LastModified** (string) - The last modified date of the object. - **ETag** (string) - The ETag of the object. - **Size** (integer) - The size of the object in bytes. - **StorageClass** (string) - The storage class of the object. - **CommonPrefixes** (array) - A list of common prefixes found. #### Response Example ```json { "Name": "oss-example", "Prefix": "jingdong/", "Marker": null, "NextMarker":null, "Delimiter": "/", "MaxKeys": 1000, "HasNext": false, "HasCommonPrefix": false, "Contents": [ { "Key": "jingdong/test.jpg", "LastModified": "Mon, 17 Jul 2017 12:12:17 GMT", "ETag": "77abd5a162ef88440102129fffbb404c", "Size": 2884006, "StorageClass": "STANDARD" } ], "CommonPrefixes": [ "jingdong/dir" ] } ``` ``` -------------------------------- ### Create MongoDB Configuration File Source: https://docs.jdcloud.com/cn/jcs-for-mongodb/export-data Create a configuration file for starting mongod in single-node mode. This example uses the WiredTiger storage engine. ```bash touch /root/mongo/mongod.conf ``` ```yaml systemLog: destination: file path: /home/Logs/mongod.log logAppend: true security: authorization: enabled storage: dbPath: /home/data directoryPerDB: true net: port: 27017 unixDomainSocket: enabled: false processManagement: fork: true pidFilePath: /home/var/mongod.pid ``` -------------------------------- ### Download Cloud Assistant Client Package (Suqian) Source: https://docs.jdcloud.com/cn/virtual-machines/Install-cloudassistant-client Download the Cloud Assistant client installation package for Linux instances in the Suqian region. ```bash wget https://sq-cloudassistant.s3-internal.cn-east-1.jdcloud-oss.com/x86/jdcloudservice.tar.gz ``` -------------------------------- ### 控制台创建Deployment及静态文件存储卷挂载示例 Source: https://docs.jdcloud.com/cn/jcs-for-kubernetes/create-pv-dynamically Example of creating a Deployment and mounting a static file volume (CFS) using the console. This involves configuring the Deployment to use a pre-existing PersistentVolumeClaim. ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 1 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app-container image: nginx ports: - containerPort: 80 volumeMounts: - name: my-volume mountPath: /usr/share/nginx/html volumes: - name: my-volume persistentVolumeClaim: claimName: my-static-pvc ``` -------------------------------- ### Create View Example Source: https://docs.jdcloud.com/cn/jchdb/sqlgrammar Example of creating a simple view named 'view_1' that selects columns a, b, c, d from table 'db1.t1'. ```sql CREATE VIEW view_1 ON CLUSTER default AS SELECT a,b,c,d FROM db1.t1; ``` -------------------------------- ### Request Example for Describe Dedicated Pools Source: https://docs.jdcloud.com/cn/dedicated-host/api/describeDedicatedPools This snippet shows a GET request to retrieve details of dedicated pools, filtered by a specific pool ID. ```http GET /v1/regions/cn-north-1/dedicatedPools?filters.1.name=dedicatedPoolId&filters.1.values.1=pool-p2ae****0c ``` -------------------------------- ### Quick Use of OSS Image Service Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo Provides a quick start guide for using the image processing service in OSS, demonstrating common operations. ```text 快速使用图片服务 ``` -------------------------------- ### Set Static Website Hosting Configuration using Java SDK Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-go Demonstrates how to configure static website hosting for a storage bucket using the S3 compatible Java SDK. This allows serving website content directly from OSS. ```java import com.amazonaws.regions.Regions; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.model.BucketWebsiteConfiguration; import com.amazonaws.services.s3.model.SetBucketWebsiteConfigurationRequest; public class SetStaticWebsiteConfigExample { public static void main(String[] args) { AmazonS3 s3Client = AmazonS3ClientBuilder.standard() .withRegion(Regions.US_EAST_1) .build(); String bucketName = "my-unique-bucket-name"; // Replace with your bucket name String indexDoc = "index.html"; String errorDoc = "error.html"; // Define the website configuration BucketWebsiteConfiguration websiteConfig = new BucketWebsiteConfiguration() .withIndexDocument(indexDoc) .withErrorDocument(errorDoc); // Set the website configuration on the bucket SetBucketWebsiteConfigurationRequest request = new SetBucketWebsiteConfigurationRequest(bucketName, websiteConfig); s3Client.setBucketWebsiteConfiguration(request); System.out.println("Static website hosting configured for bucket: " + bucketName); } } ``` -------------------------------- ### Console Deployment and Static Block Storage Volume Mount Example Source: https://docs.jdcloud.com/cn/jcs-for-kubernetes/y-version-release This example shows how to create a Kubernetes Deployment using the console and mount a static CDS block storage volume. It's a user-friendly way to configure persistent block storage for applications. ```yaml # Console-based configuration, no direct code snippet available. # Refer to the console UI for creating a Deployment and selecting a pre-created CDS PersistentVolumeClaim. ``` -------------------------------- ### Response Example for Get Watermark Template Source: https://docs.jdcloud.com/cn/media-processing-service/api/getWatermarkTemplate This is a sample JSON response for a successful watermark template query. It includes details such as template ID, user, name, type, dimensions, position, and timestamps. ```json { "requestId": "bgvmivir54gddpgi764se9f4kfr7ge41", "result": { "createTime": "2026-06-16T15:51:32Z", "height": 100, "imageUrl": "https://example.com/watermark.png", "name": "我的水印模板", "offsetUnit": "pixel", "offsetX": 10, "offsetY": 10, "position": "BR", "rotation": 0, "shadow": 0, "sizeUnit": "pixel", "tile": false, "type": "image", "updateTime": "2026-06-16T15:51:32Z", "userPin": "userpin", "watermarkId": "c35a7f843a6e49a4a32b1f8fab99fbd8", "width": 200 } } ``` -------------------------------- ### Download Cloud Assistant Client Package (Guangzhou) Source: https://docs.jdcloud.com/cn/virtual-machines/Install-cloudassistant-client Download the Cloud Assistant client installation package for Linux instances in the Guangzhou region. ```bash wget https://gz-cloudassistant.s3-internal.cn-south-1.jdcloud-oss.com/x86/jdcloudservice.tar.gz ``` -------------------------------- ### Configure OSS Lifecycle Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo Step-by-step guide on how to configure lifecycle rules for OSS buckets to manage object storage duration and costs. ```text 配置生命周期 ``` -------------------------------- ### Response Example with Referer Rules Set Source: https://docs.jdcloud.com/cn/object-storage-service/api/getbucketreferer This example shows a successful HTTP 200 OK response when referer rules are configured for the bucket. It includes the referer configuration details like AllowNull, Effect, and Value. ```http HTTP/1.1 200 OK Server: nginx Date: Tue, 11 Jul 2017 09:12:10 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 43 Connection: keep-alive x-jss-request-id: A84C875C916A1E24 {"AllowNull":false,"Effect":"ALLOW","Value":["www.abc.com","www.*.com"]} ``` -------------------------------- ### Java SDK: Media Processing - Get Video Task List Source: https://docs.jdcloud.com/cn/object-storage-service/buy-resourcepkg Example of retrieving a list of video processing tasks using the media processing service via the S3 compatible Java SDK for OSS. ```java OSSClient ossClient = new OSSClient("http://oss-cn-hangzhou.aliyuncs.com", "", ""); //获取视频任务列表 String taskList = ossClient.listVideoTasks(); System.out.println("Video tasks:" + taskList); //关闭client ossClient.shutdown(); ``` -------------------------------- ### Create OSS Bucket using Go SDK Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-go Shows how to create a new storage bucket using the S3 compatible Go SDK. Bucket names must be globally unique. ```go package main import ( "fmt" "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 := session.Must(session.NewSessionWithOptions(session.Options{ SharedConfigState: session.SharedConfigEnable, })) ssvc := s3.New(sess, &aws.Config{ Region: aws.String("us-west-2"), }) bucketName := "my-unique-go-bucket-name" // Replace with your desired bucket name // Create the bucket _, err := ssvc.CreateBucket(&s3.CreateBucketInput{ Bucket: aws.String(bucketName), }) if err != nil { fmt.Printf("Failed to create bucket %s, %v", bucketName, err) return } fmt.Printf("Bucket %s created successfully.\n", bucketName) } ``` -------------------------------- ### Optimizing PPT Outline Skill 2 Prompt Source: https://docs.jdcloud.com/cn/agents/prompt_case This prompt enhances the 'Customized Structure Design' skill for PPTs, guiding the AI to create a fitting structure and providing a detailed example format for the PPT outline. ```markdown ### 技能 2:定制专属结构 1. 根据深入理解的需求,精心设计一个完全契合用户需求和目标的 PPT 结构框架。 2. 这个结构应具备高度的逻辑性和连贯性,同时合理规划内容的重点分布和呈现顺序。 ===回复示例=== - 📋 PPT 结构: - 封面:<封面的设计理念和主要内容概述> - 目录:<目录的层级划分和具体内容要点> - 主体内容: - 幻灯片 1:<幻灯片 1 的标题及核心内容简述> - 幻灯片 2:<幻灯片 2 的标题及核心内容简述> - …… - 结论:<结论部分的总结要点和未来展望> ===示例结束=== ``` -------------------------------- ### Example Command Line Connection Source: https://docs.jdcloud.com/cn/rds/connect-instance-postgresql An example of connecting to a PostgreSQL database with username 'test_user', host '192.168.0.44', port '5432', and database 'postgres'. The '-W' flag prompts for the password. ```sql psql -U test_user -h 192.168.0.44 -p 5432 -d postgres -W ``` -------------------------------- ### OSS Java SDK - Image Processing - Get Image Information Source: https://docs.jdcloud.com/cn/object-storage-service/product-terms-of-service Example of retrieving information about an image (like format, dimensions, and size) using the OSS image processing feature by adding a specific parameter to the URL. ```url http://your-bucket.oss.cn-bj.jcloud.com/image.jpg?x-oss-process=image/info ``` -------------------------------- ### Create Bucket using Java SDK Source: https://docs.jdcloud.com/cn/object-storage-service/Regularupload Demonstrates how to create a new storage bucket using the S3-compatible Java SDK. Ensure the SDK is properly installed and initialized. ```java ossClient.createBucket(bucketName); ``` -------------------------------- ### SQL Comment Hints for Query Optimization Source: https://docs.jdcloud.com/cn/rds/pg_hint_plan Use special SQL comments starting with /*+ and ending with */ to guide the query optimizer. This method is useful when you can modify the SQL query directly. Hints can span multiple lines for readability. ```sql /*+ HashJoin(a b) >SeqScan(a) */ EXPLAIN SELECT * FROM pgbench_branches b JOIN pgbench_accounts a ON b.bid = a.bid ORDER BY a.aid; ``` -------------------------------- ### Example import foreign schema and query Source: https://docs.jdcloud.com/cn/rds/dblink This example imports the 'public' schema from 'foreign_server1' into a local schema named 'ft', and then queries the 'products' table within the 'ft' schema. ```sql db1=> import foreign schema public from server foreign_server1 into ft; IMPORT FOREIGN SCHEMA db1=> select * from ft.products; ``` -------------------------------- ### Install boto3 with pip Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-python_1782440773248 Use this command to install the boto3 package if you have pip installed. Ensure pip is up-to-date. ```bash pip install boto3 ``` -------------------------------- ### Initialize Java SDK for OSS Source: https://docs.jdcloud.com/cn/object-storage-service/sdk-go Demonstrates how to initialize the S3 compatible Java SDK for Object Storage Service. Ensure you have the SDK installed. ```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(); System.out.println("S3 client initialized successfully."); // Further operations can be performed using s3Client } } ``` -------------------------------- ### Install NVIDIA Driver (Linux) Source: https://docs.jdcloud.com/cn/virtual-machines/install-GPU Executes the downloaded NVIDIA driver installer script. Follow on-screen prompts to complete the installation. ```bash sh NVIDIA-Linux-x86_64-450.248.02.run ``` -------------------------------- ### Start and Stop Docker Containers Source: https://docs.jdcloud.com/cn/virtual-machines/mdocker Commands to manage container lifecycle: `docker run -d` to create and start in background, `docker start` to start a stopped container, `docker stop` to gracefully stop, and `docker restart` to reboot. ```bash docker run -itd --name demo2_nginx nginx:v1.0 /bin/bash ``` ```bash docker start demo_nginx ``` ```bash docker stop demo_nginx ``` ```bash docker restart demo_nginx ``` -------------------------------- ### OSS SDK Initialization with Endpoint Source: https://docs.jdcloud.com/cn/object-storage-service/Regularupload Shows how to initialize the OSS client using a specific endpoint. This is crucial for connecting to the correct OSS region. ```java String endpoint = "http://oss.cn-north-1.jcloud.com"; String accessKeyId = "YOUR_ACCESS_KEY"; String accessKeySecret = "YOUR_SECRET_KEY"; OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); ``` -------------------------------- ### Install CUDA Toolkit (Linux) Source: https://docs.jdcloud.com/cn/virtual-machines/install-GPU Executes the CUDA toolkit installer script. Follow prompts, including accepting the license and choosing installation options. ```bash sudo sh cuda_11.0.3_450.51.06_linux.run ``` -------------------------------- ### OSS Static Website Hosting Settings Source: https://docs.jdcloud.com/cn/object-storage-service/listbucketsdemo Guides users on how to configure OSS buckets for static website hosting, including setting index and error documents. ```text 静态网站托管设置 ```