Repository Integration

In the Management Console you also specify cluster of RoboServers, these are used to execute scheduled robots, as well as robots executed as REST services. The API allowed you to use the RepositoryClient to obtain cluster information from Management Console, check the RepositoryClient documentation for details.


using System;
using Com.KapowTech.RoboSuite.Api;
using Com.KapowTech.RoboSuite.Api.Construct;
using Com.KapowTech.RoboSuite.Api.Repository.Engine;

namespace Examples
{
    public class RepositoryIntegration
    {
        public static void Main(String[] args)
        {
            string userName = "admin";
            string password = "admin";
            RepositoryClient client = new RepositoryClient("http://localhost:50080", userName, password);

            Request.RegisterCluster(client, "Production");
            var request = new Request("Library:/Tutorials/NewsMagazine.robot");
            var result = request.Execute("Production");
            Console.WriteLine(result.ToString());
        }
    }
}
                            

Repository Integration


The above example shows how to create a RepositoryClient which connects to a Management Console deployed on localhost port 50080.

If the Management Console requires authentication you will need to pass a username and password, otherwise you may pass null for both. When we register the RepositoryClient we specify the name of a cluster which exists on the Management Console, this will then query the Management Console to get a list of RoboServers configured for this cluster, and check every 2 minutes to see if the cluster configuration has been updated on the Management Console

This integration allows you to create a cluster on Management Console that you can change dynamically using the Management Console user interface. When you use a Management Console cluster with the API usage should be exclusive, and you should not use it for scheduling robot, as this would break the two client rule.