chore: fix request config for liveness - get_cloud_check

This commit is contained in:
Jesús Pérez Lorenzo 2021-09-23 12:42:51 +01:00
parent 1bc7dccb37
commit 28404160ed
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,4 @@
pub mod h_config;
pub mod h_data;
pub mod h_defs;
pub mod h_defs;
pub mod datastores;

View File

@ -15,10 +15,10 @@ use kloud::{
};
use clds::clouds::defs::{Cloud};
use crate::defs::{DataDBs}; // ,CollsData};
use clds::clouds::on_clouds::{on_cloud_req,on_cloud_name_req};
use clds::clouds::on_clouds::{on_cloud_req,on_cloud_name_req,get_cloud_check};
pub async fn cloud_req(reqname: &str,cloud: &Cloud,reqenv: &ReqEnv,opts: &KloudQueryConfigFilters) -> String {
let result: String;
let mut result: String;
if opts.grp.is_empty() {
result = on_cloud_req(&reqname,&cloud,&reqenv,&opts.tsksrvcs,&opts.srvrs,&opts.cld).await;
} else if opts.name.is_empty() {
@ -28,6 +28,9 @@ pub async fn cloud_req(reqname: &str,cloud: &Cloud,reqenv: &ReqEnv,opts: &KloudQ
let source = format!("{}/{}/{}",&opts.cld,&opts.grp,&opts.name);
result = on_cloud_name_req(&reqname,&cloud,&reqenv,&opts.tsksrvcs,&opts.srvrs,&source).await;
}
if opts.tsksrvcs.contains("liveness") {
result = format!("{}:{}{}:{}{}",r#"{"req""#,&result,r#","liveness""#,get_cloud_check(&reqenv).await,r#"}"#);
}
match reqname {
"config" => {
result.to_owned()