Azure DevOps Rust API
This is an unofficial Azure DevOps Rust API crate. It is in early development and only a small subset of function has been tested, so there will be issues and breaking changes. If you find any issues then please raise them via Github.
Overview
azure_devops_rust_api
implements a Rust interface to the Azure DevOps REST API (version 7.1).
The crate is autogenerated from the Azure DevOps OpenAPI spec.
Usage
Usage overview
The crate has many features/modules, but the general approach is similar for all:
- Obtain authentication credentials
- Create a client for the feature/module that you want to use
- Use the client to make requests
Code example
Example usage (from examples/git_repo_list.rs):
// Get authentication credentials via the az cli
let credential = new;
// Get ADO server configuration via environment variables
let service_endpoint =
var.expect;
let organization = var.expect;
let project = var.expect;
// Create a "git" client
let client = new;
// Use the client to list all repositories in the specified organization/project
let repos = client
.repositories
.list
.into_future
.await
.unwrap
.value;
// Output repo names
for repo in repos.iter
println!;
Individual components in the API are enabled via Rust features
.
See the features
section of Cargo.toml for the full list of features.
Example application Cargo.toml
dependency spec showing how to specify desired features:
[]
...
= { = "0.1.0", = ["git", "pipelines"] }
Examples
See examples directory.
Define environment variables:
Note that you need to authenticate via az login
before running the examples.