[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2014-01-13
1
Medium Priority
?
472 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Starting up a Project

872 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