This crate provides structures and client to interact with the Clever-Cloud API.
This crate is under development, you can use it, but it may have bugs or unimplemented features.
To install this dependency, just add the following line to your Cargo.toml
manifest.
toml
clevercloud-sdk = { version = "^0.10.7", features = ["metrics", "jsonschemas"] }
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}};
async fn main() -> Result<(), Box
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 example.
| name | description |
| ----------- | ------------------------------------------------------------------------------------------------- |
| trace | Use tracing
crate to expose traces |
| tokio | Use tokio
crate as back-end for tracing
crate |
| 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 | Use lazy_static
and prometheus
crates to register metrics. Implies oauth10a/metrics
feature |
Below, the exposed metrics gathered by prometheus:
| name | labels | kind | description | | -------------------------------- | --------------------------------------------------------------- | ------- | -------------------------- | | oauth10aclientrequest | endpoint: String, method: String, status: Integer | Counter | number of request on api | | oauth10aclientrequest_duration | endpoint: String, method: String, status: Integer, unit: String | Counter | duration of request on api |
See the license.