Crates.io | openwhisk-client-rust |
lib.rs | openwhisk-client-rust |
version | 0.1.7 |
source | src |
created_at | 2023-04-01 06:11:20.612665 |
updated_at | 2023-06-12 12:04:56.145318 |
description | OpenWhisk Client written in Rust |
homepage | |
repository | https://github.com/hugobyte/openwhisk-client-rust |
max_upload_size | |
id | 827114 |
size | 82,657 |
The OpenWhisk Rust Client is a Rust library for interacting with the OpenWhisk API. It enables developers to easily access OpenWhisk features from their Rust applications.
Ensure the latest version of Rust is installed and configured on your system.
Add the following to your Cargo.toml
file:
[dependencies]
openwhisk-client-rust = { version = "0.1.7", default-features = false }
Then, run cargo build
to download and compile the OpenWhisk Rust Client.
To start using the OpenWhisk Rust Client, you need to configure the client with your OpenWhisk credentials and settings.
Create a WskProperties
instance with your API host, auth token, namespace, and connection security preference:
let wsk_properties = WskProperties::new(
"<Openwhisk_Auth_Token>",
"<Openwhisk_API_Host>",
"<Namespace>"
);
<Openwhisk_Auth_Token>
in the code snippet with the actual token string.<Openwhisk_API_Host>
in the code snippet with the actual endpoint URL.<Namespace>
in the code snippet with the actual namespace name.Here are a few examples of how to use the OpenWhisk Rust Client:
use openwhisk_client_rust::{NativeClient, OpenwhiskClient, WskProperties};
let wsk_properties = WskProperties::new(
"<Openwhisk_Auth_Token>",
"<Openwhisk_API_Host>",
"<Namespace>"
);
let client = OpenwhiskClient::<NativeClient>::new(Some(&wsk_properties));
client.actions().invoke("action_name",serde_json::json!({"key":"value"}),true,true).unwrap();
use openwhisk_client_rust::{NativeClient, OpenwhiskClient, WskProperties};
let wsk_properties = WskProperties::new(
"<Openwhisk_Auth_Token>",
"<Openwhisk_API_Host>",
"<Namespace>"
);
let client = OpenwhiskClient::<NativeClient>::new(Some(&wsk_properties));
let triggers = client.triggers().list().unwrap();
use openwhisk_client_rust::{NativeClient, OpenwhiskClient, Rule, RuleResponse, WskProperties};
let wsk_properties = WskProperties::new(
"<Openwhisk_Auth_Token>",
"<Openwhisk_API_Host>",
"<Namespace>"
);
let client = OpenwhiskClient::<NativeClient>::new(Some(&wsk_properties));
let properties = client.rules().list().unwrap();
Run the test suite using
cargo test
We welcome contributions to improve the library, add new features, and fix bugs. To contribute, follow these steps:
Special thanks to Openwhisk-go-client for inspiring us to develop Openwhisk Client in rust
Licensed under Apache-2.0