Ejemplo n.º 1
0
        /// <summary>
        /// Register Check
        /// </summary>
        static void RegisterCheck()
        {
            var agentGovern   = new AgentGovern();
            var registerCheck = new RegisterCheckParmeter()
            {
                ID       = "test001",
                Name     = "test" + DateTime.Now.ToString("yyyyMMddHHmmssfff"),
                Interval = "10s",
                HTTP     = "https://example.com",
                Method   = "POST",
            };

            var result = agentGovern.RegisterCheck(registerCheck).GetAwaiter().GetResult();

            Console.WriteLine($"result={result.result}");
            Console.WriteLine($"back content={result.backJson}");
        }
Ejemplo n.º 2
0
 private void btnCheckModify_Click(object sender, EventArgs e)
 {
     try
     {
         var agentGovern = new AgentGovern();
         gridCheck.DataSource = agentGovern.RegisterCheck(new RegisterCheckParmeter
         {
             ID            = txbCheckID.Text,
             Name          = txbCheckName.Text,
             HTTP          = txbCheckHttp.Text,
             Interval      = txbCheckInterval.Text,
             Method        = comCheckMethod.Text,
             ServiceID     = gridService.SelectedRows[0].Cells["id"].Value.ToString(),
             TLSSkipVerify = false
         });
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }