Exemplo n.º 1
0
        public Response.Progress Monitor(string function, string token)
        {
            string service  = "http://" + url + ":" + port + "/nuix-restful-service/svc/v1/asyncFunctions/" + function + "?token=" + token;
            string method   = "GET";
            string response = Call(service, method, null, true);

            try
            {
                return(JsonConvert.DeserializeObject <Response.Progress>(response));
            }
            catch (Exception ex)
            {
                Console.WriteLine("Failed attempting to serialize the following JSON:");
                Console.WriteLine(response);
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
            Response.Progress fail = new Response.Progress();
            fail.progress = -1;
            fail.done     = false;
            fail.total    = -1;
            return(fail);
        }
Exemplo n.º 2
0
 public Response.Progress Monitor(string function, string token)
 {
     string service = "http://" + url + ":" + port + "/nuix-restful-service/svc/v1/asyncFunctions/" + function + "?token=" + token;
     string method = "GET";
     string response = Call(service, method, null, true);
     try
     {
         return JsonConvert.DeserializeObject<Response.Progress>(response);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Failed attempting to serialize the following JSON:");
         Console.WriteLine(response);
         Console.WriteLine(ex.Message);
         Console.WriteLine(ex.StackTrace);
     }
     Response.Progress fail = new Response.Progress();
     fail.progress = -1;
     fail.done = false;
     fail.total = -1;
     return fail;
 }