Solved

Trying to set autoremove to yes on robot in Nimbus with Nimbus API and C#

Posted on 2014-01-13
1
455 Views
Last Modified: 2014-01-14
I have tried something like this - using C# and the Nimbus APU fro, NimbusAPI.dll:

NimbusSession contSession = new NimbusSession("localhost", (int)NimbusPort.Controller);
contSession.Login("user", "password", true);
ControllerConfig conTest = new ControllerConfig("controller", contSession);
conTest.SetValue("controller", "autoremove", "yes");
conTest.Save();

Open in new window


But here I am not able to choose what robot to do the changes for. The first argument on method SetValue is "Section," where do I find this?

How am I able to set the raw configuration "autoremove" to "yes" on a robots control probe?
0
Comment
Question by:itnifl
1 Comment
 
LVL 2

Accepted Solution

by:
itnifl earned 0 total points
ID: 39780041
This is how you do it using a console application:

   class Program {
      //The following is implemented in case this code is compiled as a console application:
      static void Main(string[] args) {
         if (args.Length < 1) {
            Console.WriteLine("First argument needs to be the IP address or name of the Nimbus robot you want to remove at shutdown of robot.");
            System.Environment.Exit(0);
         }
         Console.WriteLine("Write in username to authenticate with Nimbus:");
         String username = Console.ReadLine();
         Console.WriteLine("Write in password to authenticate with Nimbus:");
         String password = Console.ReadLine();

         Console.WriteLine("Removing robot named: " + args[0]);
         try {
            NimbusSession contSession = new NimbusSession(args[0], (int)NimbusPort.Controller);
            contSession.Login(username, password, true);         
            ControllerConfig conConfig = new ControllerConfig("controller", contSession);
            conConfig.SetValue("controller", "autoremove", "yes");
            conConfig.Save();
         } catch (Exception e) {
             Console.WriteLine(e.ToString());
         }
         Console.WriteLine("\nExecution done! Press a button to continue.");
         Console.ReadLine();
      }
    }
}

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now