### Example Installation Commands Source: https://docs.ksyun.com/documents/37169?type=3 Examples of how to run the install script for specific operating system versions. ```bash ./install.sh debian 8 ``` ```bash ./install.sh centos 6 ``` -------------------------------- ### Installation Guides Source: https://docs.ksyun.com/documents/1572?preview=1&type=6 Guides for installing various software and drivers on cloud servers. ```APIDOC ## Installation Guides ### Description Provides guides for installing essential software and drivers. ### Category: Installation Guides #### Install CUDA Driver Guide ##### Description Step-by-step guide for installing NVIDIA CUDA drivers. ##### Method GET ##### Endpoint /guides/cuda-driver-installation #### Install cuDNN and NCCL Guide ##### Description Guide for installing cuDNN and NCCL libraries for deep learning. ##### Method GET ##### Endpoint /guides/cudnn-nccl-installation #### Install CAFFE Guide ##### Description Guide for installing the CAFFE deep learning framework. ##### Method GET ##### Endpoint /guides/caffe-installation #### Install TensorFlow Guide ##### Description Guide for installing the TensorFlow machine learning framework. ##### Method GET ##### Endpoint /guides/tensorflow-installation ``` -------------------------------- ### Start kasmVNC Remote Desktop Service Source: https://docs.ksyun.com/documents/44457?type=3 This command starts the kasmVNC remote desktop service, using a Jupyter environment as an example. This is typically executed within a containerized setup. ```bash /docker_config/entrypoint.sh ``` -------------------------------- ### Start Instance Database Audit API Request Source: https://docs.ksyun.com/documents/41005?type=3 This is an example of a GET request to start the instance database audit feature. Ensure you replace '{{region}}' with your specific region and '4d97f65f-5603-4373-b870-48a280ecc464' with your actual DBInstanceIdentifier. ```http http://krds.{{region}}.api.ksyun.com/?Action=StartAudit&Version=2016-07-01&DBInstanceIdentifier=4d97f65f-5603-4373-b870-48a280ecc464 ``` -------------------------------- ### Go SDK - Installation and Initialization Source: https://docs.ksyun.com/documents/44574 Instructions for installing and initializing the Go SDK. ```APIDOC ## Installation (Go) ### Description Provides instructions on how to install the KS3 Go SDK. ### Method N/A (Installation command) ### Endpoint N/A ## Initialization (Go) ### Description Guides on how to initialize the KS3 Go SDK client. ### Method N/A (SDK method) ### Endpoint N/A ``` -------------------------------- ### Start OpenClaw Onboarding Source: https://docs.ksyun.com/documents/45243?type=3 Initiate the OpenClaw configuration process by running the onboard command. This command guides you through the initial setup, including security notices and basic configurations. ```bash openclaw onboard ``` -------------------------------- ### SDK Initialization and Configuration Source: https://docs.ksyun.com/documents/2414?type=3 Instructions for setting up the SDK, including obtaining AK/SK credentials, configuring the credentials file, and installing the SDK using Composer. ```APIDOC ## Initialization ### AK/SK Configuration Create the following file and populate it with your Access Key (ak) and Secret Key (sk): ``` mkdir ~/.ksyun && vi ~/.ksyun/config ``` **config file content:** ```json { "ak":"********************", "sk":"****************************************" } ``` ### Composer Installation Install the SDK using Composer: ```bash mkdir test && cd test composer require kscsdk/ksyun_sdk ``` To use the latest version, modify your `composer.json` file: ```json { "require": { "kscsdk/ksyun_sdk": "dev-master" } } ``` Then run the update command: ```bash composer update ``` ### Debug Demo Run a demo to test the installation: ```bash cp vendor/kscsdk/ksyun_sdk/examples/demo_Kvs.php . php demo_Kvs.php GetPresetList ``` ``` -------------------------------- ### Download File Example (Go) Source: https://docs.ksyun.com/documents/41276?type=3 Use this snippet to download a standard file. Ensure you replace placeholders like , , , and with your actual credentials and object details. ```Go package main import ( "fmt" "github.com/ks3sdklib/aws-sdk-go/aws" "github.com/ks3sdklib/aws-sdk-go/aws/credentials" "github.com/ks3sdklib/aws-sdk-go/service/s3" ) func main() { // 创建访问凭证,请将替换成真正的值 cre := credentials.NewStaticCredentials("", "", "") // 创建S3Client,更多配置项请查看Go-SDK初始化文档 client := s3.New(&aws.Config{ Credentials: cre, Region: "BEIJING", Endpoint: "ks3-cn-beijing.ksyuncs.com", }) // 填写存储空间名称 bucket := "" // 填写对象的key key := "" // 下载文件 resp, err := client.GetObject(&s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(key), }) if err != nil { panic(err) } // 读取返回结果中body的前1024个字节 buffer := make([]byte, 1024) n, err := resp.Body.Read(buffer) if err != nil { panic(err) } fmt.Printf("结果:%s", buffer[:n]) } ``` -------------------------------- ### GET Request Example Source: https://docs.ksyun.com/documents/42251?type=3 Example of making a GET request to the /http-invoke endpoint. ```APIDOC ## GET /http-invoke ### Description Retrieves resources from the /http-invoke endpoint. ### Method GET ### Endpoint http://127.0.0.1:80880/http-invoke ### Request Example ```bash curl -X GET http://127.0.0.1:80880/http-invoke ``` ``` -------------------------------- ### GET Object Example Source: https://docs.ksyun.com/documents/2321 Example of calculating the signature for a GET Object request. ```APIDOC ## GET Object ### Description Retrieves an object from a specified bucket. ### Method GET ### Endpoint /examplebucket/1.txt ### Request Example ``` GET /1.txt HTTP/1.1 Host: examplebucket.ks3-cn-beijing.ksyuncs.com Date: Tue, 30 Nov 2021 11:06:30 GMT Authorization: KSS AKLTA6qLnuowT6KzKybUQNC0Tw:i+PiOc1sxIe6yjZwyi4/+kxmXs8= ``` ### Response Example (Success response depends on the object content) ### Note CanonicalizedResource includes the bucket name, which is not present in the HTTP request URI because the bucket name is specified in the Host request header. ``` ```APIDOC ```python import base64 import hmac from hashlib import sha1 h = hmac.new("OCd5HzFDU1YDUG6eTHASvdt1RRn5bqKNKdl8JxuFrYne+bazX7gmoYUG73XjJ/d2sg==", "GET\n\n\nTue, 30 Nov 2021 11:06:30 GMT\n/examplebucket/photos/1.jpg", sha1) Signature = base64.encodestring(h.digest()).strip() ``` ``` -------------------------------- ### Go SDK - Quick Start Source: https://docs.ksyun.com/documents/40767?type=3 A quick start guide for using the KS3 SDK for Go. ```APIDOC ## Quick Start (Go) ### Description A concise guide to help developers get started quickly with the KS3 SDK for Go, demonstrating basic usage patterns. ``` -------------------------------- ### Go SDK - Installation and Initialization Source: https://docs.ksyun.com/documents/43784?type=3 Instructions for installing and initializing the KS3 Go SDK. ```APIDOC ## Installation (Go) ### Description Installs the KS3 Go SDK using the Go module system. ### Command `go get github.com/ks3sdk/ks3-go-sdk` ## Initialization (Go) ### Description Initializes the KS3 client with your credentials and endpoint. ### Code Example ```go import ( "github.com/ks3sdk/ks3-go-sdk/ks3" ) func main() { client, err := ks3.New("YOUR_ACCESS_KEY_ID", "YOUR_SECRET_ACCESS_KEY", "YOUR_ENDPOINT") if err != nil { panic(err) } // Use the client for operations } ``` ``` -------------------------------- ### Go SDK - Configuration Practices Source: https://docs.ksyun.com/documents/44518?type=3 Practical examples for configuring the Go SDK. ```APIDOC ## Set Retry Strategy and Conditions (Go) ### Description Configures the retry mechanism, including the strategy and conditions under which retries are performed, for the Go SDK. ## Set Log Output (Go) ### Description Configures the logging output for the Go SDK, specifying where and how logs should be recorded. ## Set Custom Request Headers and Parameters (Go) ### Description Allows setting custom HTTP headers and request parameters for requests made by the Go SDK. ## Set DNS Cache (Go) ### Description Configures the DNS caching behavior for the Go SDK to improve performance. ``` -------------------------------- ### Request Example (GET) Source: https://docs.ksyun.com/documents/40308 Example of a GET request including common and query parameters for API authentication. ```APIDOC ## Request Example (GET) ``` GET /?Action=ListUsers&Version=2015-11-01 HTTP/1.1 Host: iam.api.ksyun.com X-Amz-Date: 20160914T114902Z Authorization: AWS4-HMAC-SHA256 Credential=AKLTGo0pHK-EQWiDZWTSBSll2Q/20160914/cn-beijing-6/iam/aws4_request, SignedHeaders=host;x-amz-date, Signature=88f6284257863dedfc350da05d19d07f76cca622e93b829f5ce26c1a75d3da39 ``` ``` -------------------------------- ### Example Mount Command with Credentials Source: https://docs.ksyun.com/documents/43899 An example of mounting a file system, showing the interactive prompts for Token, Secret ID, and Secret Key. ```bash sudo /usr/local/bin/juicefs mount mytest /localfolder Token for mytest:******** Secret ID for ks3 bucket 2000176024-mytest-snx187g2:******** Secret Key for ks3 bucket 2000176024-mytest-snx187g2:******** ``` -------------------------------- ### Example GET Bucket CORS Request Source: https://docs.ksyun.com/documents/42311 An example of a GET Bucket CORS request, including Host, Date, and Authorization headers. ```http GET /?cors HTTP/1.1 Host: ks3-example.ks3-cn-beijing.ksyun.com Date: Wed, 24 Dec 2014 03:08:04 GMT Authorization: authorization string ``` -------------------------------- ### Install Go SDK (Go) Source: https://docs.ksyun.com/documents/40487 Install the KSYUN Go SDK using the go get command. This command fetches and installs the SDK package from its GitHub repository. ```bash go get github.com/ks3sdklib/aws-sdk-go ``` -------------------------------- ### GET Bucket Quota Request Example Source: https://docs.ksyun.com/documents/44897 An example of a GET Bucket Quota request, including a sample host, date, and authorization string. ```http GET /?quota HTTP/1.1 Host: ks3-example.ks3-cn-beijing.ksyuncs.com Date: Wed, 01 Mar 2016 12:00:00 GMT Authorization: authorization string ``` -------------------------------- ### SDK for PHP - Initialization and Basic Usage Source: https://docs.ksyun.com/documents/2414 This snippet covers the installation of the SDK using Composer, configuration of AK/SK credentials, and a basic example of calling the GetPresetList API. ```APIDOC ## Initialization **ak/sk configuration** Create the configuration file `~/.ksyun/config` with your AK/SK: ``` mkdir ~/.ksyun && vi ~/.ksyun/config ``` ```json { "ak":"********************", "sk":"****************************************" } ``` **Composer Installation** Install the SDK using Composer: ```bash mkdir test && cd test composer require kscsdk/ksyun_sdk ``` To use the latest version, update `composer.json` and run `composer update`. **Debugging Demo** Run the demo script: ```bash cp vendor/kscsdk/ksyun_sdk/examples/demo_Kvs.php . php demo_Kvs.php GetPresetList ``` **Basic API Call Example** ```php request('GetPresetList'); echo $response->getBody(); ?> ``` ``` -------------------------------- ### Example GET Request for Job Information Source: https://docs.ksyun.com/documents/44575 This is an example of an HTTP GET request to retrieve the details of a specific batch job using its jobId. ```http GET /?jobs&jobId=184ce261-18af-5e3d-3e30-253723cfd937 HTTP/1.1 Host: ks3-cn-beijing.ksyuncs.com Date: Wed, 01 Mar 2025 12:00:00 GMT Authorization: authorization string ``` -------------------------------- ### GET Bucket Lifecycle Request Example Source: https://docs.ksyun.com/documents/42295 An example of a GET Bucket Lifecycle request, demonstrating the required headers such as Host, Date, and Authorization. ```http GET /?lifecycle HTTP/1.1 Host: ks3-example.ks3-cn-beijing.ksyuncs.com Date: Wed, 01 Mar 2016 12:00:00 GMT Authorization: authorization string ``` -------------------------------- ### Install Python SDK using Git Source: https://docs.ksyun.com/documents/2415 Clone the SDK repository and install it locally using setup.py. This method is useful for development or when direct access to the source is needed. ```bash git clone https://github.com/KscSDK/ksc-sdk-python.git cd ksc-sdk-python python setup.py install ```