aliyun-log-rust-sdk

Crates.ioaliyun-log-rust-sdk
lib.rsaliyun-log-rust-sdk
version0.1.0
created_at2025-04-29 09:23:06.086194+00
updated_at2025-04-29 09:23:06.086194+00
descriptionRust sdk for Aliyun Log Service
homepagehttps://github.com/aliyun/aliyun-log-rust-sdk/tree/master/client
repositoryhttps://github.com/aliyun/aliyun-log-rust-sdk/tree/master/client
max_upload_size
id1653356
size139,364
Crimson (crimson-gao)

documentation

https://docs.rs/aliyun-log-rust-sdk

README

aliyun-log-rust-sdk

This crate is rust sdk for access Aliyun Log Service.
This SDK uses tokio as async runtime.

For more Documents.

Quick Start

  1. Create a client
use aliyun_log_rust_sdk::{Client, Config, FromConfig};
let config = Config::builder()
    .endpoint("cn-hangzhou.log.aliyuncs.com")
    .access_key("access_key_id", "access_key_secret")
    .build()?;
let client = Client::from_config(config)?;
  1. Send a request
use aliyun_log_rust_sdk::GetLogsRequest;
use chrono::Utc;
let now = Utc::now().timestamp();
let one_hour_ago = now - 3600;
let resp = client.get_logs("my-project", "my-logstore")
        .from(one_hour_ago)         // Start time (required)
        .to(now)                    // End time (required)
        .query("level:ERROR")       // Filter for error logs only
        .offset(0)                  // Start from the first log
       .lines(100)                 // Return up to 100 logs
       .send()
       .await?;
Commit count: 8

cargo fmt