/// <summary> /// 命令执行 /// </summary> /// <param name="rct">命令参数</param> /// <param name="rctna">命令参数(不含arg和match)</param> /// <returns></returns> public static BaseType CmdRun(string json) { if (string.IsNullOrEmpty(json)) { return(null); } var resp = HttpUtilities.APIWebHelper(APIurl, HttpUtilities.HttpRequestMethod.POST, json); if (resp.Length == 3) { return(new BaseType() { @return = new List <object> { "ERROR", resp } }); } return(JsonConvert.DeserializeObject <BaseType>(resp)); }
/// <summary> /// 详细查询特定 Job /// </summary> /// <param name="jid"></param> /// <returns></returns> public static Dictionary <string, List <Dictionary <string, dynamic> > > job(string jid) { var r = HttpUtilities.APIWebHelper(APIUrlSelect(APIType.JOBS, jid), HttpUtilities.HttpRequestMethod.GET); return(JsonConvert.DeserializeObject <Dictionary <string, List <Dictionary <string, dynamic> > > >(r)); }
/// <summary> /// 获取 minion 的详细信息 /// </summary> /// <param name="minionName"> minion 名称</param> /// <returns></returns> public static dynamic MinionDetails(string minionName) { var r = JsonConvert.DeserializeObject <BaseType>(HttpUtilities.APIWebHelper(APIUrlSelect(APIType.MINIONS, minionName), HttpUtilities.HttpRequestMethod.GET)); return(DynamicJson.Parse(r.@return[0].ToString())); }