Skip to content

Commit

Permalink
Merge branch 'release/v0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
r4ntix committed Sep 21, 2019
2 parents 9e9bd3b + 0657b28 commit e0a7713
Show file tree
Hide file tree
Showing 11 changed files with 326 additions and 48 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
on: [push, pull_request]

name: Continuous integration

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
with:
command: test

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install rustfmt
run: rustup component add rustfmt

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install clippy
run: rustup component add clippy

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- ROA style client.

## [0.3.0] - 2019-09-21

### Added
- New function(`get`, `query`, `send`) for RPC style client.

### Deprecated
- `request` function is deprecated, please use the `get` function instead.

## [0.2.0] - 2019-09-01

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "aliyun-openapi-core-rust-sdk"
description = "Aliyun OpenAPI POP core SDK for Rust"
version = "0.2.0"
version = "0.3.0"
keywords = ["aliyun", "openapi", "api", "sdk"]
categories = ["api-bindings"]
authors = ["mc404 <[email protected]>"]
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# aliyun-openapi-core-rust-sdk

Aliyun OpenAPI POP core SDK for Rust.

## Installation

Write into Cargo.toml dependencies:
[![Crates Status](http://meritbadge.herokuapp.com/aliyun-openapi-core-rust-sdk)](https://crates.io/crates/aliyun-openapi-core-rust-sdk)
[![Actions Status](https://github.com/r4ntix/aliyun-openapi-core-rust-sdk/workflows/ci.yml/badge.svg)](https://github.com/r4ntix/aliyun-openapi-core-rust-sdk/actions)

```toml
[dependencies]
aliyun-openapi-core-rust-sdk = "0.2.0"
```
Aliyun OpenAPI POP core SDK for Rust.

### Notes
## Notes

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

Expand All @@ -36,9 +30,15 @@ fn main() -> Result<(), Box<dyn Error>> {
String::from("<version>"),
);

// 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.request("DescribeInstances", &[("RegionId", "cn-hangzhou")])?;
let response = aliyun_openapi_client
.get("DescribeInstances")
.query(&[("RegionId", "cn-hangzhou")])
.send()?;
println!("DescribeInstances response: {}", response);

Ok(())
Expand Down
8 changes: 5 additions & 3 deletions examples/ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ fn main() -> Result<(), Box<dyn Error>> {
);

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

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

Ok(())
Expand Down
8 changes: 5 additions & 3 deletions examples/rds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ fn main() -> Result<(), Box<dyn Error>> {
);

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

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

Ok(())
Expand Down
8 changes: 5 additions & 3 deletions examples/slb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ fn main() -> Result<(), Box<dyn Error>> {
);

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

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

Ok(())
Expand Down
7 changes: 5 additions & 2 deletions examples/vpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ fn main() -> Result<(), Box<dyn Error>> {
);

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

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

Ok(())
Expand Down
16 changes: 11 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//!
//! The RPC style client:
//!
//! ```rust
//! ```no_run
//! use aliyun_openapi_core_rust_sdk::RPClient;
//! use std::error::Error;
//!
Expand All @@ -25,18 +25,24 @@
//! String::from("<version>"),
//! );
//!
//! // 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.request("DescribeInstances", &[("RegionId", "cn-hangzhou")])?;
//! println!("DescribeInstances response: {}", response);
//! let response = aliyun_openapi_client
//! .get("DescribeInstances")
//! .query(&[("RegionId", "cn-hangzhou")])
//! .send()?;
//! println!("DescribeInstances response: {}", response);
//!
//! Ok(())
//! }
//! ```
//!
//! The ROA style client:
//!
//! ```rust
//! ```no_run
//! unimplemented!();
//! ```
//! # Examples
Expand Down
Loading

0 comments on commit e0a7713

Please sign in to comment.