Solved

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

Posted on 2014-01-13
1
460 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

828 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