DX Unified Infrastructure Management

 View Only
  • 1.  Move a Robot from one hub to another using Perl SDK API?

    Posted May 09, 2018 11:48 AM

    Move a Robot from one hub to another using Perl SDK API?

    Using Infrastructure Manager we can very easily move a robot by right-clicking on the robot and selecting the "move.." option and further selecting the Hub from the list of hubs in the domain. This process updates the "robot.cfg" and the new robot immediately starts reporting to the new selected Hub.

    I want to perform this operating using "callback". Is there any probe utility callback available that can be used to perform this operating using perl script. I have already tried "addrobot" callback oh hub probe and was unsuccessful.

     

    Please help if there is any probe utility callback available or if not that how this process can be automated. 

    chagg



  • 2.  Re: Move a Robot from one hub to another using Perl SDK API?

    Broadcom Employee
    Posted May 09, 2018 12:40 PM

    The addrobot callback is for passive robots. Have you tried the sethub callback on the controller?



  • 3.  Re: Move a Robot from one hub to another using Perl SDK API?

    Posted May 10, 2018 02:12 PM

    Hi,

     

    1) Setup secondary hub with probe_config_set (if you have one)

    my $PDS = pdsCreate();
    pdsPut_PCH($PDS, "/controller/secondary_domain", $Domain);
    pdsPut_PCH($PDS, "/controller/secondary_hub", $Hubname);
    pdsPut_PCH($PDS, "/controller/secondary_hubrobotname", $HubRobotname);
    pdsPut_PCH($PDS, "/controller/temporary_hub_broadcast", "no");
    pdsPut_PCH($PDS, "/controller/secondary_hubip", $HubRobotname);
    pdsPut_PCH($PDS, "/controller/secondary_hubport", "48002");
    pdsPut_PCH($PDS, "/controller/secondary_hub_dns_name", "");

    my $PDS_ARGS = pdsCreate();
    pdsPut_PCH ($PDS_ARGS,"name","controller");
    pdsPut_PDS ($PDS_ARGS,"as_pds",$PDS);

    my ($RC) = nimNamedRequest("/ADDR/controller", "probe_config_set", $PDS_ARGS);
    pdsDelete($PDS);
    pdsDelete($PDS_ARGS);

    if ($RC != NIME_OK)  {
        print "Failed to call the callback probe_config_set (Error $RC)\n";
        return;
    }

     

    Something like this.

     

    And trigger sethub callback

    my $PDS = pdsCreate();
    pdsPut_PCH ($PDS, "hubdomain", "Domain");
    pdsPut_PCH ($PDS, "hubname", "Hubname");
    pdsPut_PCH ($PDS, "hubip", "Hubrobotname");
    pdsPut_PCH ($PDS, "hubport", "");
    pdsPut_PCH ($PDS, "hub_dns_name", "Hubrobotname");
    pdsPut_PCH ($PDS, "robotip_alias", "");

    my ($RC) = nimNamedRequest("/ADDR/controller", "sethub", $PDS);
    pdsDelete($PDS);

     

    Think to update variables and robot addr  

     

    These API are fully documented on my Perl SDK documentation:

    GitHub - UIM-Community/Perl-SDK: CA UIM - Nimsoft - Perl SDK API Documentation 

     

    Best Regards,

    Thomas