Skip to content

A project that provides an ergonomic, type-safe interface for interacting with the HashiCorp Nomad API using Rust.

License

Notifications You must be signed in to change notification settings

rasorp/nomad-rs-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nomad-rs-api

The Nomad Rust API is an experimental project that provides an ergonomic, type-safe interface for interacting with the HashiCorp Nomad API using Rust.

⚠️ Status: This project is in an early experimental stage. Expect breaking changes, incomplete endpoints, and evolving design patterns as we iterate.

Usage

The client can be configured automatically using environment variabeles:

use nomad_rs_api::{Config, Nomad};

let client = Nomad::new(Config::from_env());

Alternatively, you can configure the client manually:

let config = Config {
    address: "http://localhost:4646".to_string(),
    token: None,
    ..Default::default()
};

let client = Nomad::new(config);

Query and Write Options

The query and write options can be easily built before making a request:

use nomad_rs_api::{option};

let query_opts = option::QueryOptions::new()
    .with_namespace("platform".to_string())
    .with_auth_token("auth_token".to_string());

let write_opts = option::WriteOptions::new()
    .with_namespace("platform".to_string())
    .with_auth_token("auth_token".to_string());

About

A project that provides an ergonomic, type-safe interface for interacting with the HashiCorp Nomad API using Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published