-
Notifications
You must be signed in to change notification settings - Fork 20
/
release_get_release.rs
48 lines (40 loc) · 1.39 KB
/
release_get_release.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// release_get_release.rs
// Get a specific release example
use anyhow::Result;
use azure_devops_rust_api::release;
use std::env;
mod utils;
#[tokio::main]
async fn main() -> Result<()> {
// Get authentication credential
let credential = utils::get_credential()?;
// Get ADO server configuration via environment variables
let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION");
let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT");
// Create release client
let release_client = release::ClientBuilder::new(credential).build();
// Get the release ID from user
let release_id: i32 = env::args()
.nth(1)
.expect("Usage: release_get_specific_release <release_id>")
.parse()
.unwrap();
// Query a specific release
println!("\nRelease:");
let release = release_client
.releases_client()
.get_release(&organization, &project, release_id)
.await?;
println!("{:#?}", release);
// Get manual interventions on a release
println!("\nManual interventions:");
let manual_interventions = release_client
.manual_interventions_client()
.list(&organization, &project, release_id)
.await?
.value;
println!("{:#?}", manual_interventions);
Ok(())
}