Crates.io | happv |
lib.rs | happv |
version | 0.1.2 |
source | src |
created_at | 2016-09-13 18:49:19.806768 |
updated_at | 2016-09-14 06:54:17.245108 |
description | A minimal AppVeyor API library in Rust |
homepage | |
repository | https://github.com/booyaa/happv |
max_upload_size | |
id | 6469 |
size | 42,545 |
travis-ci | appveyor |
---|---|
[] |
A minimal AppVeyor API library in Rust.
Warning: this is a partial implemented API of the AppVeyor REST API. I only need the following endpoints:
The following have not yet been implemented:
PRs welcome if you want to implement other endpoints and/or the Build Worker API.
Full documentation can be found here.
This crate is on crates.io and can be used by adding happv
to the dependencies in your project's Cargo.toml
.
[dependencies]
happv = "0.1.*"
and this to your crate root:
extern crate happv;
How to get a list of projects on AppVeyor
use happv::AppVeyor;
let happv = AppVeyor::new(env!("APPVEYOR"));
let result = happv.get_projects().unwrap();
assert!(0 < result.len());
println!("Get project list:");
for i in result.into_iter() {
println!("\tId:{} Slug:{}", i.project_id, i.slug);
}
enable_test_mode
.[ignore]
so they won't trip up travis.You may find it easy to work off a cached copy of the JSON response. I've placed my original test fixtures in tests/fixtures.
Retrieving a collection or single item
curl --silent --header 'Authorization: Bearer '$APPVEYOR \
--request GET https://ci.appveyor.com/api/projects
Cancelling
curl --silent --header 'Authorization: Bearer '$APPVEYOR \
--request DELETE https://ci.appveyor.com/api/builds/booyaa/hai/1.0.11
Adding/Modifying entries
curl --silent --header 'Authorization: Bearer '$APPVEYOR \
--header 'Content-Type: application/json' \
--request POST https://ci.appveyor.com/api/projects \
-d '{"repositoryProvider" : "gitHub", "repositoryName" : "booyaa/hello-homu"}'
Copyright 2016 Mark Sta Ana.
Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> at your option. This file may not be copied, modified, or distributed except according to those terms.