Openwhisk Client Rust

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.

Prerequisites

Ensure the latest version of Rust is installed and configured on your system.

Installation

Add the following to your Cargo.toml file:

toml [dependencies] openwhisk-client-rust = { version = "0.1.7", default-features = false }

Then, run cargo build to download and compile the OpenWhisk Rust Client.

Usage

To start using the OpenWhisk Rust Client, you need to configure the client with your OpenWhisk credentials and settings.

Configuration

Create a WskProperties instance with your API host, auth token, namespace, and connection security preference:

rust let wsk_properties = WskProperties::new( "<Openwhisk_Auth_Token>", "<Openwhisk_API_Host>", "<Namespace>" );

Examples

Here are a few examples of how to use the OpenWhisk Rust Client:

```rust use openwhiskclientrust::{NativeClient, OpenwhiskClient, WskProperties};

let wsk_properties = WskProperties::new( "", "", "" );

let client = OpenwhiskClient::::new(Some(&wsk_properties));

client.actions().invoke("actionname",serdejson::json!({"key":"value"}),true,true).unwrap();

```

```rust use openwhiskclientrust::{NativeClient, OpenwhiskClient, WskProperties};

let wsk_properties = WskProperties::new( "", "", "" );

let client = OpenwhiskClient::::new(Some(&wsk_properties));

let triggers = client.triggers().list().unwrap(); ```

```rust use openwhiskclientrust::{NativeClient, OpenwhiskClient, Rule, RuleResponse, WskProperties};

let wsk_properties = WskProperties::new( "", "", "" );

let client = OpenwhiskClient::::new(Some(&wsk_properties));

let properties = client.rules().list().unwrap(); ```

Testing

Run the test suite using

bash cargo test

Contributions

We welcome contributions to improve the library, add new features, and fix bugs. To contribute, follow these steps:

References

Special thanks to Openwhisk-go-client for inspiring us to develop Openwhisk Client in rust

License

Licensed under Apache-2.0