use hyper::client::Client;
#[allow(unused_imports)]
use hyper::client::Body;
use hyper::client::response::Response;
use hyper::error::Result;
use ::RequestParams;
pub fn get<'a>(client: &'a mut Client, req: &'a RequestParams) -> Result<Response>{
let url_qry = &req.get_url_qry();
let base = &req.base_url;
let mut url_fmtd = String::with_capacity(base.len() + 18 + url_qry.len());
url_fmtd.push_str(base);
url_fmtd.push_str("/_snapshot/_status");
url_fmtd.push_str(url_qry);
let res = client.get(&url_fmtd).headers(req.headers.to_owned());
res.send()
}
pub fn get_repository<'a>(client: &'a mut Client, req: &'a RequestParams,
repository: &'a str) -> Result<Response>{
let url_qry = &req.get_url_qry();
let base = &req.base_url;
let mut url_fmtd =
String::with_capacity(base.len() + 11 + 8 + repository.len() +
url_qry.len());
url_fmtd.push_str(base);
url_fmtd.push_str("/_snapshot/");
url_fmtd.push_str(repository);
url_fmtd.push_str("/_status");
url_fmtd.push_str(url_qry);
let res = client.get(&url_fmtd).headers(req.headers.to_owned());
res.send()
}
pub fn get_repository_snapshot<'a>(client: &'a mut Client, req: &'a RequestParams,
repository: &'a str, snapshot: &'a str)
-> Result<Response>{
let url_qry = &req.get_url_qry();
let base = &req.base_url;
let mut url_fmtd =
String::with_capacity(base.len() + 11 + 1 + 8 + repository.len() +
snapshot.len() + url_qry.len());
url_fmtd.push_str(base);
url_fmtd.push_str("/_snapshot/");
url_fmtd.push_str(repository);
url_fmtd.push_str("/");
url_fmtd.push_str(snapshot);
url_fmtd.push_str("/_status");
url_fmtd.push_str(url_qry);
let res = client.get(&url_fmtd).headers(req.headers.to_owned());
res.send()
}