https://github.com/clevercloud/clevercloud-sdk-rust
A rust client and structures to interact with the Clever-Cloud API.
https://github.com/clevercloud/clevercloud-sdk-rust
clevercloud jsonschemas logging metrics sdk
Last synced: 8 months ago
JSON representation
A rust client and structures to interact with the Clever-Cloud API.
- Host: GitHub
- URL: https://github.com/clevercloud/clevercloud-sdk-rust
- Owner: CleverCloud
- License: mit
- Created: 2021-10-12T16:15:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-07-02T14:27:43.000Z (11 months ago)
- Last Synced: 2025-10-04T18:36:12.171Z (8 months ago)
- Topics: clevercloud, jsonschemas, logging, metrics, sdk
- Language: Rust
- Homepage: https://crates.io/crates/clevercloud-sdk
- Size: 321 KB
- Stars: 11
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Clever-Cloud Software Development Kit - Rust edition
[](https://crates.io/crates/clevercloud-sdk)
[](https://docs.rs/clevercloud-sdk)
[](https://github.com/CleverCloud/clevercloud-sdk-rust/actions/workflows/ci.yml)
> This crate provides structures and a client to interact with the Clever-Cloud
> API.
## Status
This crate is under development, you can use it, but it may have bugs or unimplemented features.
## Installation
To install this dependency, just add the following line to your `Cargo.toml` manifest.
```toml
clevercloud-sdk = { version = "^0.11.1", features = ["metrics", "jsonschemas"] }
```
## Usage
Below, you will find an example of executing a request to get information about
myself.
```rust
use std::error::Error;
use clevercloud_sdk::{Client, v2::myself::{self, Myself}};
#[tokio::main]
async fn main() -> Result<(), Box> {
let client = Client::from(Credentials {
token: "".to_string(),
secret: "".to_string(),
consumer_key: "".to_string(),
consumer_secret: "".to_string(),
});
let _myself: Myself = myself::get(&client).await?;
Ok(())
}
```
You could found more examples of how you could use the clevercloud-sdk by looking at the [command line](examples/cli/README.md) example.
## Features
| name | description |
| ----------- |--------------------------------------------------------------------------------------------------|
| trace | Use `tracing` crate to expose traces |
| jsonschemas | Use `schemars` to add a derive instruction to generate json schemas representation of structures |
| logging | Use the `log` facility crate to print logs. Implies `oauth10a/logging` feature |
| metrics | Expose HTTP metrics through `oauth10a` crate feature. |
### Metrics
Below, the exposed metrics gathered by prometheus:
| name | labels | kind | description |
| -------------------------------- | --------------------------------------------------------------- | ------- | -------------------------- |
| oauth10a_client_request | endpoint: String, method: String, status: Integer | Counter | number of request on api |
| oauth10a_client_request_duration | endpoint: String, method: String, status: Integer, unit: String | Counter | duration of request on api |
## License
See the [license](LICENSE).
## Getting in touch
- [@FlorentinDUBOIS](https://twitter.com/FlorentinDUBOIS)