?
Solved

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

Posted on 2014-01-13
1
Medium Priority
?
467 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Starting up a Project
Suggested Courses

771 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