Solved

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 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

16 Experts available now in Live!

Get 1:1 Help Now