aliyun-openapi-core-rust-sdk

Crates.io Crates.io Actions Status

Aliyun OpenAPI POP core SDK for Rust.

Notes

You must know your AK(accessKeyId/accessKeySecret), and the aliyun product's endpoint and apiVersion.

For example, The ECS OpenAPI(https://help.aliyun.com/document_detail/25490.html), the API version is 2014-05-26.

And the endpoint list can be found at here, the center endpoint is ecs.aliyuncs.com. Add http protocol http or https, should be https://ecs.aliyuncs.com/.

Usage

The RPC style client:

```rust use aliyunopenapicorerustsdk::RPClient; use std::error::Error;

fn main() -> Result<(), Box> { // create rpc style api client. let aliyunopenapiclient = RPClient::new( String::from(""), String::from(""), String::from(""), String::from(""), );

// call `DescribeRegions` with empty queries.
let response = aliyun_openapi_client.get("DescribeRegions").send()?;
println!("DescribeRegions response: {}", response);

// call `DescribeInstances` with queries.
let response = aliyun_openapi_client
    .get("DescribeInstances")
    .query(&[("RegionId", "cn-hangzhou")])
    .send()?;
println!("DescribeInstances response: {}", response);

Ok(())

} ```

The ROA style client:

rust unimplemented!();

Examples

Export AK info to env, then run cargo run --example <NAME>:

```sh export ACCESSKEYID= export ACCESSKEYSECRET=

ecs example

cargo run --example ecs

rds example

cargo run --example rds

slb example

cargo run --example slb

vpc example

cargo run --example vpc ```

License

The MIT License