This is a POC Rust client for the Nile API.
Source the Nile environment variables into your environment.
```bash export NILEDEVELOPEREMAIL= export NILEDEVELOPERPASSWORD= export NILEENTITYNAME= export NILEORGANIZATIONNAME= export NILEWORKSPACE= export NILEINSTANCE_ID=
NILE_URL=https://prod.thenile.dev ```
```rust use std::env;
use dotenv::dotenv; use nileclientrs::{EntityInstance, InstanceUpdate, NileClient};
async fn main() -> Result<(), Box
let mut client = NileClient::default();
client
.authenticate(username, password)
.await?;
```
rust
let instances = client.get_instances(&workspace, &entity_name).await?;
println!("instances: {:#?}", instances);
rust
let events = client.get_events(&workspace, &entity_name, 0, 20).await?;
println!("events: {:#?}", events);
```rust let mut updates = Vec::new();
// update the number of pods let podct = InstanceUpdate { op: "replace".toowned(), path: "/numPods".toowned(), value: "5".toowned(), }; updates.push(pod_ct);
// update database status let statusupdate = InstanceUpdate { op: "replace".toowned(), path: "/status".toowned(), value: "Up".toowned(), }; updates.push(status_update);
// send the updates to the Nile let status: EntityInstance = client .patchinstance(&workspace, &org, &entityname, &instance_id, updates) .await?; println!("status: {:#?}", status); }
```