https://github.com/lvillis/jenkins-sdk-rust
https://github.com/lvillis/jenkins-sdk-rust
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lvillis/jenkins-sdk-rust
- Owner: lvillis
- Created: 2025-02-28T14:05:25.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-28T14:41:34.000Z (3 months ago)
- Last Synced: 2025-02-28T19:33:25.425Z (3 months ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
Table of Contents↗️
jenkins-sdk-rust
📦 Jenkins API SDK written in Rust
---
This project is a Jenkins API SDK written in Rust, designed to simplify interaction with Jenkins for Rust developers. The SDK supports asynchronous programming (via Tokio) and provides a unified interface to manage Jenkins jobs, queues, and executors efficiently.
## Features
- **Asynchronous Support**: Built on Tokio to support high concurrency.
- **Unified Request Handling**: Simplified API interface for consistent and easy interactions.
- **Detailed Documentation**: Clearly documented inputs and outputs for each method.
- **Comprehensive Error Handling**: Robust error handling with meaningful messages for ease of debugging.## Implemented Interfaces
- **Job Management**
- [x] Retrieve Jobs Information
- [x] Retrieve Console Output
- [x] Trigger Builds with Parameters
- [x] Stop Builds- **Queue Management**
- [x] Retrieve Build Queue Length- **Executor Management**
- [x] Retrieve Executors Information## Installation
Add the following to your `Cargo.toml`:
```toml
[dependencies]
jenkins-sdk = "0.1"
```## Quick Example
```rust
use jenkins_sdk::JenkinsClient;
use serde_json::json;#[tokio::main]
async fn main() {
let client = JenkinsClient::new("https://jenkins.example.com", "username", "api_token");match client.get_jobs_info().await {
Ok(jobs) => println!("Jobs: {:?}", jobs),
Err(e) => eprintln!("Error fetching jobs: {}", e),
}// Trigger a build with parameters
let params = json!({ "param1": "value1" });
if let Err(e) = client.trigger_build_with_params("MyJob", ¶ms).await {
eprintln!("Failed to trigger build: {}", e);
}
}
```## License
This project is licensed under the MIT License.