Example #1
0
        /// <summary>Returns status of the robot</summary>
        /// <param name="connection">UiPath orchestrator connection info</param>
        /// <param name="robotName">Name of the robot</param>
        public static string GetRobotStatus(UiPathOrchestratorConnection connection, string robotName)
        {
            IRestResponse response = OrchAPI.GETrequest(connection, "Sessions?$expand=Robot");
            JObject       jsonObj  = JObject.Parse(response.Content);
            JArray        jsonArr  = JArray.Parse(jsonObj.SelectToken("value").ToString());

            foreach (var item in jsonArr)
            {
                if (item.SelectToken("Robot").SelectToken("Name").ToString().ToLower() == robotName.ToLower())
                {
                    return(item.SelectToken("State").ToString());
                }
            }
            return("Robot not found");
        }
Example #2
0
        /// <summary>Returns information about all QUeues in the orchestrator</summary>
        /// <param name="connection">UiPath orchestrator connection info</param>
        public static string GetQueues(UiPathOrchestratorConnection connection)
        {
            IRestResponse response = OrchAPI.GETrequest(connection, "QueueDefinitions");

            return(OrchAPI.ParseJson(response, "value"));
        }
Example #3
0
        /// <summary>Returns information about all roles in the orchestrator</summary>
        /// <param name="connection">UiPath orchestrator connection info</param>
        public static string GetRoles(UiPathOrchestratorConnection connection)
        {
            IRestResponse response = OrchAPI.GETrequest(connection, "Roles?$expand=Permissions");

            return(OrchAPI.ParseJson(response, "value"));
        }
Example #4
0
        /// <summary>Returns information about status of the job</summary>
        /// <param name="connection">UiPath orchestrator connection info</param>
        /// <param name="ID">ID of the job</param>
        public static string GetJobStatus(UiPathOrchestratorConnection connection, string ID)
        {
            IRestResponse response = OrchAPI.GETrequest(connection, "Jobs(" + ID + ")");

            return(OrchAPI.ParseJson(response, "State"));
        }